lchown: detect Solaris and FreeBSD bug
authorEric Blake <ebb9@byu.net>
Fri, 13 Nov 2009 04:45:20 +0000 (21:45 -0700)
committerEric Blake <ebb9@byu.net>
Sat, 14 Nov 2009 17:34:11 +0000 (10:34 -0700)
commit6bd102382341d268d2e99349abd4c21546a5993e
tree370475caec669fb4ba3a31d2957b3d811ae977ed
parent9cd8acbae7f8ca3985001de0752b22e2a28d0cd7
lchown: detect Solaris and FreeBSD bug

Solaris 9 and FreeBSD 7.2 lchown("link-to-file/",uid,gid)
mistakenly changes ownership of "file".

* lib/lchown.c (rpl_lchown): Work around bug.
* m4/lchown.m4 (gl_FUNC_LCHOWN): Check for trailing slash bugs.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness.
* modules/unistd (Makefile.am): Populate it.
* lib/unistd.in.h (lchown): Update declaration.
* doc/posix-functions/lchown.texi (lchown): Document the bug.
* modules/lchown-tests: New file.
* tests/test-lchown.h (test_lchown): Likewise.
* tests/test-lchown.c (main): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/posix-functions/lchown.texi
lib/lchown.c
lib/unistd.in.h
m4/lchown.m4
m4/unistd_h.m4
modules/lchown
modules/lchown-tests [new file with mode: 0644]
modules/unistd
tests/test-lchown.c [new file with mode: 0644]
tests/test-lchown.h [new file with mode: 0644]