open: detect FreeBSD bug
authorEric Blake <ebb9@byu.net>
Sun, 8 Nov 2009 04:34:32 +0000 (21:34 -0700)
committerIan Beckwith <ianb@erislabs.net>
Sun, 15 Nov 2009 02:47:29 +0000 (02:47 +0000)
commit7f013da1190d9a4483dafd50a865aad9c651817c
treea9bbbcf9fc6ab11686a8804bee3360f5e5fa5f8b
parentcc8526599a01111b8a6b8ab688383e9b4a85eded
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>
(cherry picked from commit 48e988340f85e568ceb9ac1f4bf5824fddf1fd0d)
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