Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_lookup.c
Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | if (ndp->ni_startdir != NULL) { | ||||
rights = *ndp->ni_rightsneeded; | rights = *ndp->ni_rightsneeded; | ||||
cap_rights_set_one(&rights, CAP_LOOKUP); | cap_rights_set_one(&rights, CAP_LOOKUP); | ||||
if (cnp->cn_flags & AUDITVNODE1) | if (cnp->cn_flags & AUDITVNODE1) | ||||
AUDIT_ARG_ATFD1(ndp->ni_dirfd); | AUDIT_ARG_ATFD1(ndp->ni_dirfd); | ||||
if (cnp->cn_flags & AUDITVNODE2) | if (cnp->cn_flags & AUDITVNODE2) | ||||
AUDIT_ARG_ATFD2(ndp->ni_dirfd); | AUDIT_ARG_ATFD2(ndp->ni_dirfd); | ||||
/* | /* | ||||
* Effectively inlined fgetvp_rights, because we need to | * Effectively inlined fgetvp_rights, because | ||||
* inspect the file as well as grabbing the vnode. | * we need to inspect the file as well as | ||||
* grabbing the vnode. No check for O_PATH, | |||||
* files to implement its semantic. | |||||
*/ | */ | ||||
error = fget_cap(td, ndp->ni_dirfd, &rights, | error = fget_cap(td, ndp->ni_dirfd, &rights, | ||||
&dfp, &ndp->ni_filecaps); | &dfp, &ndp->ni_filecaps); | ||||
if (error != 0) { | if (error != 0) { | ||||
/* | /* | ||||
* Preserve the error; it should either be EBADF | * Preserve the error; it should either be EBADF | ||||
* or capability-related, both of which can be | * or capability-related, both of which can be | ||||
* safely returned to the caller. | * safely returned to the caller. | ||||
▲ Show 20 Lines • Show All 1,343 Lines • Show Last 20 Lines |