stat: detect FreeBSD bug
authorEric Blake <ebb9@byu.net>
Sat, 7 Nov 2009 23:59:11 +0000 (16:59 -0700)
committerEric Blake <ebb9@byu.net>
Mon, 9 Nov 2009 13:16:05 +0000 (06:16 -0700)
commit349396ebfcce12ee8f927fedf82067414c427093
treeebc0f680a8f44e92daa6ea293b9b4c7994a0caee
parent6553be82a4a522e50ece1a430e82a9b1dfd0f471
stat: detect FreeBSD bug

Like Solaris 9, FreeBSD 7.2 mistakenly allows stat("link-to-file/").
Unlike Solaris, it correctly forbids stat("file/").  A number of
interfaces are affected (such as utimes), but replacing stat is
enough to catch several by reusing the Solaris 9 fixes.

* m4/stat.m4 (gl_FUNC_STAT): Also detect FreeBSD bug with slash on
symlink.
* doc/posix-functions/stat.texi (stat): Document the bug.
* tests/test-stat.h (test_stat_func): Add argument.
* tests/test-stat.c (main): Adjust caller.
* tests/test-fstatat.c (main): Likewise.
* modules/stat-tests (Depends-on): Add stdbool, symlink.
Reported by Jim Meyering.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/posix-functions/stat.texi
m4/stat.m4
modules/stat-tests
tests/test-fstatat.c
tests/test-stat.c
tests/test-stat.h