mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-09-11 11:50:52 +03:00
chown(name,geteuid(),-1) failed to update the change time if name was already owned by the current effective user. Work around it by using chmod, which does not have this bug. Unfortunately, lchown has the same bug, but OpenBSD 4.0 lacks lchmod and lutimes, so there is no way to affect ctime without unlinking and recreating the symlink, which is too dangerous. * lib/chown.c (rpl_chown): Work around the bug. * lib/lchown.c (rpl_lchown): Attempt to do likewise. * m4/chown.m4 (gl_FUNC_CHOWN): Test for ctime bug. * m4/lchown.m4 (gl_FUNC_LCHOWN): Check for lchmod. * modules/chown (Depends-on): Add stdbool. * modules/lchown (Depends-on): Likewise. * doc/posix-functions/chown.texi (chown): Document the bug. * doc/posix-functions/lchown.texi (lchown): Likewise. * tests/test-lchown.h (test_chown): Relax test. Signed-off-by: Eric Blake <ebb9@byu.net>
30 lines
316 B
Plaintext
30 lines
316 B
Plaintext
Description:
|
|
chown() function: change ownership of a file, following symlinks.
|
|
|
|
Files:
|
|
lib/chown.c
|
|
lib/fchown-stub.c
|
|
m4/chown.m4
|
|
|
|
Depends-on:
|
|
open
|
|
stat
|
|
stdbool
|
|
sys_stat
|
|
unistd
|
|
|
|
configure.ac:
|
|
gl_FUNC_CHOWN
|
|
gl_UNISTD_MODULE_INDICATOR([chown])
|
|
|
|
Makefile.am:
|
|
|
|
Include:
|
|
<unistd.h>
|
|
|
|
License:
|
|
GPL
|
|
|
|
Maintainer:
|
|
Jim Meyering
|