Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_syscalls.c
Show First 20 Lines • Show All 2,049 Lines • ▼ Show 20 Lines | kern_accessat(struct thread *td, int fd, char *path, enum uio_seg pathseg, | ||||
int flag, int amode) | int flag, int amode) | ||||
{ | { | ||||
struct ucred *cred, *tmpcred; | struct ucred *cred, *tmpcred; | ||||
struct vnode *vp; | struct vnode *vp; | ||||
struct nameidata nd; | struct nameidata nd; | ||||
cap_rights_t rights; | cap_rights_t rights; | ||||
int error; | int error; | ||||
if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0) | |||||
return (EINVAL); | |||||
/* | /* | ||||
* Create and modify a temporary credential instead of one that | * Create and modify a temporary credential instead of one that | ||||
* is potentially shared. | * is potentially shared. | ||||
*/ | */ | ||||
if (!(flag & AT_EACCESS)) { | if (!(flag & AT_EACCESS)) { | ||||
cred = td->td_ucred; | cred = td->td_ucred; | ||||
tmpcred = crdup(cred); | tmpcred = crdup(cred); | ||||
tmpcred->cr_uid = cred->cr_ruid; | tmpcred->cr_uid = cred->cr_ruid; | ||||
▲ Show 20 Lines • Show All 2,680 Lines • Show Last 20 Lines |