]> git.ipfire.org Git - thirdparty/coreutils.git/commit
(change_file_owner): Use ent->fts_statp only if
authorJim Meyering <jim@meyering.net>
Tue, 8 Jun 2004 14:57:57 +0000 (14:57 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 8 Jun 2004 14:57:57 +0000 (14:57 +0000)
commit7e29ef8b885a31e23b0ba8257a20aed3ed950cdf
treefa4af35e7156d6ce10e02ebe951abe4b9a84e314
parent5e1dd2ecb59f85bf6501f3d686dd4486ec325171
(change_file_owner): Use ent->fts_statp only if
needed.  Chown a directory only after chowning its children; this
avoids problems if the new directory ownership doesn't permit
access to the children.  Dereference symlinks before doing
ROOT_DEV_INO_CHECK, not after, so that we catch symlinks to /.
Do not optimize away the chown() system call when the file's owner
and group already have the desired value.  POSIX does not permit
this optimization.  Rely on chown and lchown to do the right
thing with symlinks and/or -1 arguments, now that we have wrappers
to do this.  Use ENOTSUPP not ENOSYS, and ignore all ENOTSUPP
errors, not just command-line errors.
(chown_files): Pass FTS_STAT to xfts_open if we don't need file status.
src/chown-core.c