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:
Ed Schouten 2015-08-12 16:17:00 +00:00
parent ad389a8c3b
commit 8c43e4ccfa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286670

View File

@ -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,