Mercurial > hg > octave-kai > gnulib-hg
view doc/posix-functions/chown.texi @ 12289:e973be2fb39f
chown: detect Solaris and FreeBSD bug
Solaris 9 and FreeBSD 7.2 chown("link-to-file/",uid,gid)
mistakenly changes ownership of "file".
* lib/chown.c (rpl_chown): Work around bug.
* m4/chown.m4 (gl_FUNC_CHOWN): Check for trailing slash bugs.
(gl_PREREQ_CHOWN): Delete.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness.
* modules/unistd (Makefile.am): Populate it.
* lib/unistd.in.h (chown): Update declaration.
* lib/lchown.c (chown): Update client.
* modules/lchown (Depends-on): Add lstat.
* doc/posix-functions/chown.texi (chown): Document the bug.
* doc/posix-functions/getgroups.texi (getgroups): Document
getgroups pitfall.
* modules/chown-tests: New file.
* tests/test-chown.h (test_chown): Likewise.
* tests/test-chown.c (main): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Thu, 12 Nov 2009 21:45:20 -0700 |
parents | c83dc7e8df57 |
children | e92d9385e4ca |
line wrap: on
line source
@node chown @section @code{chown} @findex chown POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/chown.html} Gnulib module: chown Portability problems fixed by Gnulib: @itemize @item Some platforms fail to detect trailing slash on non-directories, as in @code{chown("link-to-file/",uid,gid)}: FreeBSD 7.2, Solaris 9. @item When passed an argument of -1, some implementations really set the owner user/group id of the file to this value, rather than leaving that id of the file alone. @item When applied to a symbolic link, some implementations don't dereference the symlink, i.e.@: they behave like @code{lchown}. @item This function is missing on some platforms; however, the replacement always fails with @code{ENOSYS}: mingw. @end itemize Portability problems not fixed by Gnulib: @itemize @end itemize