open: detect FreeBSD bug
authorEric Blake <ebb9@byu.net>
Sun, 8 Nov 2009 04:34:32 +0000 (21:34 -0700)
committerEric Blake <ebb9@byu.net>
Mon, 9 Nov 2009 13:36:00 +0000 (06:36 -0700)
commit48e988340f85e568ceb9ac1f4bf5824fddf1fd0d
tree1c6d25b4261bcdb2b10fb8908c2f7e81f98041cf
parent349396ebfcce12ee8f927fedf82067414c427093
open: detect FreeBSD bug

open("link-to-file/", O_RDONLY) mistakenly succeeds.  The previous
patch was enough to fix utimens when no fd is involved, but this is
necessary for futimens to pass.

* m4/open.m4 (gl_FUNC_OPEN): Also detect FreeBSD bug with slash on
symlink.
* doc/posix-functions/open.texi (open): Document the bug.
* doc/posix-functions/utimes.texi (utimes): Likewise.
* tests/test-open.h (test_open): Add parameters, and test symlink
handling.
* tests/test-open.c (main): Adjust caller.
* tests/test-fcntl-safer.c (main): Likewise.
* modules/open-tests (Depends-on): Add stdbool, symlink.
* modules/fcntl-safer-tests (Depends-on): Likewise.
* tests/test-openat.c (main): Add test-open tests.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/posix-functions/open.texi
doc/posix-functions/utimes.texi
m4/open.m4
modules/fcntl-safer-tests
modules/open-tests
tests/test-fcntl-safer.c
tests/test-open.c
tests/test-open.h
tests/test-openat.c