diff options
author | kib <kib@FreeBSD.org> | 2013-08-05 19:42:03 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-08-05 19:42:03 +0000 |
commit | 103825c951713677489b0556d7cd86852ec2969c (patch) | |
tree | 439be760dc40a84491e5dd9293a98d70eba6834f | |
parent | 1e070fe985d3b60b77ddd6155a70b5b2354ae123 (diff) | |
download | FreeBSD-src-103825c951713677489b0556d7cd86852ec2969c.zip FreeBSD-src-103825c951713677489b0556d7cd86852ec2969c.tar.gz |
Do not override the ENOENT error for the empty path, or EFAULT errors
from copyins, with the relative lookup check.
Discussed with: rwatson
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
-rw-r--r-- | sys/kern/vfs_lookup.c | 3 |
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 |