[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
d-ino.m4 doing a stat() instead of lstat()
From: |
Stephane Chazelas |
Subject: |
d-ino.m4 doing a stat() instead of lstat() |
Date: |
Wed, 21 Aug 2013 21:20:16 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hello,
the problem occured to me when building findutils 4.5.11:
configure:19783: checking for d_ino member in directory struct
configure:19824: gcc -std=gnu99 -o conftest -g -O0 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall
-D_FORTIFY_SOURCE=2 -Wl,-z,relro conftest.c >&5
configure:19824: $? = 0
configure:19824: ./conftest
configure:19824: $? = 4
configure: program exited with status 4
configure: failed program was:
[...]
| DIR *dp = opendir (".");
| struct dirent *e;
| struct stat st;
| if (! dp)
| return 1;
| e = readdir (dp);
| if (! e)
| return 2;
| if (stat (e->d_name, &st) != 0)
| return 3;
| if (e->d_ino != st.st_ino)
| return 4;
| return 0;
In the current directory, in my case, the first file is a symlink:
~/install/findutils-4.5.11$ ls -fl | head
total 15664
lrwxrwxrwx 1 chazelas chazelas 28 Aug 21 20:53 config.guess ->
/usr/share/misc/config.guess
drwxr-xr-x 14 chazelas chazelas 4096 Aug 21 21:14 .
-rw-r--r-- 1 chazelas chazelas 2142 Nov 17 2012 Makefile.am
[...]
So obviously e->d_ino is not the same as st.st_ino.
I think it should be a lstat() above instead of stat()
Best regards,
Stephane (note that I'm not subscribed to the list)
- d-ino.m4 doing a stat() instead of lstat(),
Stephane Chazelas <=