changeset 37158:9c124e7e29ab

d-ino: avoid false negative on symlink If the first entry listed in a directory is a symlink, we had a spurious mismatch between d_ino (which should match the symlink) and stat() results (which chases the symlink). Reported by Stephane Chazelas <stephane.chazelas@gmail.com>. * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use lstat. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Wed, 21 Aug 2013 16:10:18 -0600
parents 96b94361f6d5
children a981b0ed9f83
files ChangeLog m4/d-ino.m4
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 20 11:06:51 2013 -0700
+++ b/ChangeLog	Wed Aug 21 16:10:18 2013 -0600
@@ -1,3 +1,9 @@
+2013-08-21  Eric Blake  <eblake@redhat.com>
+
+	d-ino: avoid false negative on symlink
+	* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use lstat.
+	Reported by Stephane Chazelas.
+
 2013-08-12  Mike Miller  <mtmiller@ieee.org>  (tiny change)
 
 	bootstrap: port to OpenBSD sed
--- a/m4/d-ino.m4	Tue Aug 20 11:06:51 2013 -0700
+++ b/m4/d-ino.m4	Wed Aug 21 16:10:18 2013 -0600
@@ -1,4 +1,4 @@
-# serial 13
+# serial 14
 
 dnl From Jim Meyering.
 dnl
@@ -30,7 +30,7 @@
              e = readdir (dp);
              if (! e)
                return 2;
-             if (stat (e->d_name, &st) != 0)
+             if (lstat (e->d_name, &st) != 0)
                return 3;
              if (e->d_ino != st.st_ino)
                return 4;