Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_mount.c
Show First 20 Lines • Show All 1,133 Lines • ▼ Show 20 Lines | if (jailed(td->td_ucred) && (!prison_allow(td->td_ucred, | ||||
vput(vp); | vput(vp); | ||||
return (EPERM); | return (EPERM); | ||||
} | } | ||||
/* | /* | ||||
* If the user is not root, ensure that they own the directory | * If the user is not root, ensure that they own the directory | ||||
* onto which we are attempting to mount. | * onto which we are attempting to mount. | ||||
*/ | */ | ||||
error = VOP_GETATTR(vp, &va, td->td_ucred); | error = VOP_GETATTR(vp, 0, &va, td->td_ucred); | ||||
if (error == 0 && va.va_uid != td->td_ucred->cr_uid) | if (error == 0 && va.va_uid != td->td_ucred->cr_uid) | ||||
error = priv_check_cred(td->td_ucred, PRIV_VFS_ADMIN); | error = priv_check_cred(td->td_ucred, PRIV_VFS_ADMIN); | ||||
if (error == 0) | if (error == 0) | ||||
error = vinvalbuf(vp, V_SAVE, 0, 0); | error = vinvalbuf(vp, V_SAVE, 0, 0); | ||||
if (vfsp->vfc_flags & VFCF_FILEMOUNT) { | if (vfsp->vfc_flags & VFCF_FILEMOUNT) { | ||||
if (error == 0 && vp->v_type != VDIR && vp->v_type != VREG) | if (error == 0 && vp->v_type != VDIR && vp->v_type != VREG) | ||||
error = EINVAL; | error = EINVAL; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 2,049 Lines • Show Last 20 Lines |