From: Eric Blake Date: Wed, 21 Aug 2013 22:10:18 +0000 (-0600) Subject: d-ino: avoid false negative on symlink X-Git-Tag: v0.1~62 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=9a52d861868c8d787c66b75753a747e5c1ebedc6;p=gnulib.git 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 . * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use lstat. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 9da82723f0..a5803abdd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-08-21 Eric Blake + + 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 (tiny change) bootstrap: port to OpenBSD sed diff --git a/m4/d-ino.m4 b/m4/d-ino.m4 index aab82c2dfd..d093b3ff12 100644 --- a/m4/d-ino.m4 +++ b/m4/d-ino.m4 @@ -1,4 +1,4 @@ -# serial 13 +# serial 14 dnl From Jim Meyering. dnl @@ -30,7 +30,7 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO], 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;