Hash :
84405cbc
Author :
Date :
2009-11-16T14:35:41
chown: work around OpenBSD bug 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>
Description:
lchown() function: change ownership of a file, without following symlinks.
Files:
lib/lchown.c
m4/lchown.m4
Depends-on:
chown
errno
lstat
stdbool
sys_stat
unistd
configure.ac:
gl_FUNC_LCHOWN
gl_UNISTD_MODULE_INDICATOR([lchown])
Makefile.am:
Include:
<unistd.h>
License:
GPL
Maintainer:
Jim Meyering, Eric Blake