Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
symlink matched the desired owner/group. Reported by David Malone.
Also reported in 1999 as http://bugs.debian.org/39642.
(change_file_owner): When --dereference has
been specified, and when processing a symlink, stat it to get the
owner and group of the referent.
|
|
use the chown(2) function, if possible.
(change_file_owner): Don't hard-code the
open/fchown/close kludge here. Use `chown' instead.
The chown function works just fine on conforming systems.
Other systems now go through the new chown wrapper that
resorts to the old kludge.
|
|
|
|
Add `extern' keyword.
|
|
|
|
(chopt_init): Initialize new member.
(change_file_owner): Support rm's new --preserve-root option.
|
|
which fts_info indicates an error with the given entry.
|
|
(chown_files): Use xfts_open, rather than fts_open.
|
|
|
|
via explicit recursion.
Include "fts_.h"
(change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
on a single file at a time.
(chown_files): New function.
|
|
|
|
permission bits (e.g., set-user-ID, set-group-ID) that are reset
by chown(2) on some systems. Suggestion and insistence :-) from
Michael Stone.
|
|
|
|
|
|
Include the word `fail' in some diagnostics to make it clearer
that they indicate a failure.
s/getting attributes/failed to get attributes/
|
|
|
|
(uid_to_name): Use it.
(gid_to_name): Use it.
Rename locals, user/group, to uid/gid.
|
|
Rename change_symlinks member to `dereference' and use the DEREF_*
enum values.
(describe_change): Merge the chgrp and chown switch statements.
Use xmalloc to form the `user:group' string.
(change_file_owner): Record (and later, use) is_symlink and is_directory
from the lstat stats, in order to control whether we operate on symlinks
and whether (with -R) we traverse symlinks to directories.
When dereferencing, use open/fchown (rather than chown) on symlinks.
|
|
|
|
|
|
[!_POSIX_VERSION]: Declare getgrnam and getgrgid.
(gid_to_name): New function.
(uid_to_name): Likewise.
(chopt_free): Likewise.
|
|
|