[Midnightbsd-cvs] src [8910] trunk/sys/kern/vfs_default.c: make the default implementation of the VOP_VPTOCNP fail if the directory entry, by the inode is "."

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Mon Sep 26 18:45:26 EDT 2016


Revision: 8910
          http://svnweb.midnightbsd.org/src/?rev=8910
Author:   laffer1
Date:     2016-09-26 18:45:25 -0400 (Mon, 26 Sep 2016)
Log Message:
-----------
make the default implementation of the VOP_VPTOCNP fail if the directory entry, by the inode is "."

Modified Paths:
--------------
    trunk/sys/kern/vfs_default.c

Modified: trunk/sys/kern/vfs_default.c
===================================================================
--- trunk/sys/kern/vfs_default.c	2016-09-26 22:43:52 UTC (rev 8909)
+++ trunk/sys/kern/vfs_default.c	2016-09-26 22:45:25 UTC (rev 8910)
@@ -856,8 +856,12 @@
 				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 Midnightbsd-cvs mailing list