Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_syscalls.c
Show First 20 Lines • Show All 895 Lines • ▼ Show 20 Lines | |||||
sys_fchdir(struct thread *td, struct fchdir_args *uap) | sys_fchdir(struct thread *td, struct fchdir_args *uap) | ||||
{ | { | ||||
struct vnode *vp, *tdp; | struct vnode *vp, *tdp; | ||||
struct mount *mp; | struct mount *mp; | ||||
struct file *fp; | struct file *fp; | ||||
int error; | int error; | ||||
AUDIT_ARG_FD(uap->fd); | AUDIT_ARG_FD(uap->fd); | ||||
if (IN_CAPABILITY_MODE(td)) { | |||||
if (td->td_proc->p_fdcwd_root > 0) { | |||||
td->td_proc->p_fdcwd_cur = uap->fd; | |||||
return (0); | |||||
} | |||||
return (ECAPMODE); | |||||
} | |||||
error = getvnode_path(td, uap->fd, &cap_fchdir_rights, | error = getvnode_path(td, uap->fd, &cap_fchdir_rights, | ||||
&fp); | &fp); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
vp = fp->f_vnode; | vp = fp->f_vnode; | ||||
vrefact(vp); | vrefact(vp); | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
vn_lock(vp, LK_SHARED | LK_RETRY); | vn_lock(vp, LK_SHARED | LK_RETRY); | ||||
▲ Show 20 Lines • Show All 4,116 Lines • Show Last 20 Lines |