diff options
author | Eric Blake <eblake@redhat.com> | 2013-08-21 16:10:18 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2013-08-21 16:16:27 -0600 |
commit | 9a52d861868c8d787c66b75753a747e5c1ebedc6 (patch) | |
tree | ab1cb97b32a239fea453bd748eaeb392693ae3f8 /m4/d-ino.m4 | |
parent | 7c121ba6ebe82ea54dda3ce787f491a85ec1d1d9 (diff) | |
download | gnulib-9a52d861868c8d787c66b75753a747e5c1ebedc6.tar.gz |
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>
Diffstat (limited to 'm4/d-ino.m4')
-rw-r--r-- | m4/d-ino.m4 | 4 |
1 files changed, 2 insertions, 2 deletions
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; |