MFC r276008:
Add VN_OPEN_NAMECACHE flag for vn_open_cred(9), which requests that the created file name was cached. Use the flag for core dumps.
This commit is contained in:
parent
511130787f
commit
315194d815
@ -3177,7 +3177,8 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, struct thread *td,
|
||||
sbuf_delete(&sb);
|
||||
|
||||
cmode = S_IRUSR | S_IWUSR;
|
||||
oflags = VN_OPEN_NOAUDIT | (capmode_coredump ? VN_OPEN_NOCAPCHECK : 0);
|
||||
oflags = VN_OPEN_NOAUDIT | VN_OPEN_NAMECACHE |
|
||||
(capmode_coredump ? VN_OPEN_NOCAPCHECK : 0);
|
||||
|
||||
/*
|
||||
* If the core format has a %I in it, then we need to check
|
||||
|
@ -215,6 +215,8 @@ vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags,
|
||||
return (error);
|
||||
goto restart;
|
||||
}
|
||||
if ((vn_open_flags & VN_OPEN_NAMECACHE) != 0)
|
||||
ndp->ni_cnd.cn_flags |= MAKEENTRY;
|
||||
#ifdef MAC
|
||||
error = mac_vnode_check_create(cred, ndp->ni_dvp,
|
||||
&ndp->ni_cnd, vap);
|
||||
|
@ -577,6 +577,7 @@ vn_canvmio(struct vnode *vp)
|
||||
/* vn_open_flags */
|
||||
#define VN_OPEN_NOAUDIT 0x00000001
|
||||
#define VN_OPEN_NOCAPCHECK 0x00000002
|
||||
#define VN_OPEN_NAMECACHE 0x00000004
|
||||
|
||||
/*
|
||||
* Public vnode manipulation functions.
|
||||
|
Loading…
Reference in New Issue
Block a user