diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2013-08-05 19:42:03 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2013-08-05 19:42:03 +0000 |
commit | 456597e7bd0de1c3e73b8c0999aeb071af2f9454 (patch) | |
tree | 439be760dc40a84491e5dd9293a98d70eba6834f /sys/kern/vfs_lookup.c | |
parent | d8e3f572e2b3c7395d0cf658010d3cc4d973bf7e (diff) | |
download | src-456597e7bd0de1c3e73b8c0999aeb071af2f9454.tar.gz src-456597e7bd0de1c3e73b8c0999aeb071af2f9454.zip |
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
Notes
Notes:
svn path=/head/; revision=253969
Diffstat (limited to 'sys/kern/vfs_lookup.c')
-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 cf7323110bd7..7fe19085dd4b 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 |