diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2021-02-28 23:59:12 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-03-02 18:21:40 +0000 |
commit | 28cd3a673e0e32b009fd573764956b280d1affe1 (patch) | |
tree | 65a177695145b73391083d83ef44d30f499d97b8 | |
parent | 49c98a4bf3a87ace0df99056fa683805c1645e61 (diff) | |
download | src-28cd3a673e0e32b009fd573764956b280d1affe1.tar.gz src-28cd3a673e0e32b009fd573764956b280d1affe1.zip |
O_RELATIVE_BENEATH: return ENOTCAPABLE instead of EINVAL for abs path
Requested and reviewed by: markj
Tested by: arichardson, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28907
-rw-r--r-- | sys/kern/vfs_lookup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b4280f85c5b6..e881e8f909a4 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -405,7 +405,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) } if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { if (cnp->cn_pnbuf[0] == '/') { - error = EINVAL; + error = ENOTCAPABLE; } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE | NI_LCF_CAP_DOTDOT; |