Properly return ENOTDIR when calling *at() on a non-vnode.
We already properly return ENOTDIR when calling *at() on a non-directory vnode, but it turns out that if you call it on a socket, we see EINVAL. Patch up namei to properly translate this to ENOTDIR.
This commit is contained in:
parent
ad389a8c3b
commit
8c43e4ccfa
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286670
@ -269,6 +269,8 @@ namei(struct nameidata *ndp)
|
||||
AUDIT_ARG_ATFD2(ndp->ni_dirfd);
|
||||
error = fgetvp_rights(td, ndp->ni_dirfd,
|
||||
&rights, &ndp->ni_filecaps, &dp);
|
||||
if (error == EINVAL)
|
||||
error = ENOTDIR;
|
||||
#ifdef CAPABILITIES
|
||||
/*
|
||||
* If file descriptor doesn't have all rights,
|
||||
|
Loading…
Reference in New Issue
Block a user