svn commit: r248030 - stable/8/sys/kern

Konstantin Belousov kib at FreeBSD.org
Fri Mar 8 08:19:50 UTC 2013


Author: kib
Date: Fri Mar  8 08:19:50 2013
New Revision: 248030
URL: http://svnweb.freebsd.org/changeset/base/248030

Log:
  MFC r247560:
  Make the default implementation of the VOP_VPTOCNP() fail if the
  directory entry, matched by the inode number, is ".".

Modified:
  stable/8/sys/kern/vfs_default.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/vfs_default.c
==============================================================================
--- stable/8/sys/kern/vfs_default.c	Fri Mar  8 08:09:26 2013	(r248029)
+++ stable/8/sys/kern/vfs_default.c	Fri Mar  8 08:19:50 2013	(r248030)
@@ -822,8 +822,12 @@ vop_stdvptocnp(struct vop_vptocnp_args *
 				error = ENOMEM;
 				goto out;
 			}
-			bcopy(dp->d_name, buf + i, dp->d_namlen);
-			error = 0;
+			if (dp->d_namlen == 1 && dp->d_name[0] == '.') {
+				error = ENOENT;
+			} else {
+				bcopy(dp->d_name, buf + i, dp->d_namlen);
+				error = 0;
+			}
 			goto out;
 		}
 	} while (len > 0 || !eofflag);


More information about the svn-src-all mailing list