summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_lookup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index cf73231..7fe1908 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -172,7 +172,8 @@ namei(struct nameidata *ndp)
* not an absolute path, and not containing '..' components) to
* a real file descriptor, not the pseudo-descriptor AT_FDCWD.
*/
- if (IN_CAPABILITY_MODE(td) && (cnp->cn_flags & NOCAPCHECK) == 0) {
+ if (error == 0 && IN_CAPABILITY_MODE(td) &&
+ (cnp->cn_flags & NOCAPCHECK) == 0) {
ndp->ni_strictrelative = 1;
if (ndp->ni_dirfd == AT_FDCWD) {
#ifdef KTRACE
OpenPOWER on IntegriCloud