Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_mount.c
Show First 20 Lines • Show All 965 Lines • ▼ Show 20 Lines | vfs_domount_first( | ||||
/* | /* | ||||
* 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, &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 && (vp->v_irflag & VIRF_BUFOBJ) != 0) | ||||
error = vinvalbuf(vp, V_SAVE, 0, 0); | error = vinvalbuf(vp, V_SAVE, 0, 0); | ||||
if (error == 0 && vp->v_type != VDIR) | if (error == 0 && vp->v_type != VDIR) | ||||
error = ENOTDIR; | error = ENOTDIR; | ||||
if (error == 0) { | if (error == 0) { | ||||
VI_LOCK(vp); | VI_LOCK(vp); | ||||
if ((vp->v_iflag & VI_MOUNT) == 0 && vp->v_mountedhere == NULL) | if ((vp->v_iflag & VI_MOUNT) == 0 && vp->v_mountedhere == NULL) | ||||
vp->v_iflag |= VI_MOUNT; | vp->v_iflag |= VI_MOUNT; | ||||
else | else | ||||
▲ Show 20 Lines • Show All 1,663 Lines • Show Last 20 Lines |