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
@ -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…
x
Reference in New Issue
Block a user