stat: detect FreeBSD bug
authorEric Blake <ebb9@byu.net>
Sat, 7 Nov 2009 23:59:11 +0000 (16:59 -0700)
committerIan Beckwith <ianb@erislabs.net>
Sun, 15 Nov 2009 02:47:03 +0000 (02:47 +0000)
commitcc8526599a01111b8a6b8ab688383e9b4a85eded
tree4e8bf228868268312c6ab302cfd8959f59242b2b
parent510522d0f9e54f39bac0fb714a4dcce328691d48
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>
(cherry picked from commit 349396ebfcce12ee8f927fedf82067414c427093)
ChangeLog
doc/posix-functions/stat.texi
m4/stat.m4
modules/stat-tests
tests/test-fstatat.c
tests/test-stat.c
tests/test-stat.h