Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Mar 2021 17:55:17 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 7d82c78725cf - stable/12 - O_RELATIVE_BENEATH: return ENOTCAPABLE instead of EINVAL for abs path
Message-ID:  <202103211755.12LHtHmn031726@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=7d82c78725cf1769d68059b05f698737abcc8a1f

commit 7d82c78725cf1769d68059b05f698737abcc8a1f
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-02-28 23:59:12 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-03-21 17:54:36 +0000

    O_RELATIVE_BENEATH: return ENOTCAPABLE instead of EINVAL for abs path
    
    Tested by:      pho
    
    (cherry picked from commit 28cd3a673e0e32b009fd573764956b280d1affe1)
---
 sys/kern/vfs_lookup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 442555700425..5948978d238e 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -475,7 +475,7 @@ namei(struct nameidata *ndp)
 
 	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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103211755.12LHtHmn031726>