Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2015 16:17:00 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286670 - head/sys/kern
Message-ID:  <201508121617.t7CGH0tY013236@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Wed Aug 12 16:17:00 2015
New Revision: 286670
URL: https://svnweb.freebsd.org/changeset/base/286670

Log:
  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.

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Wed Aug 12 16:08:37 2015	(r286669)
+++ head/sys/kern/vfs_lookup.c	Wed Aug 12 16:17:00 2015	(r286670)
@@ -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,



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