Age | Commit message (Collapse) | Author |
|
blocks, report the number of used blocks as being total - available
(a negative number) rather than as garbage.
|
|
to put a regular file in O_NONBLOCK mode fails with EPERM.
That happens on Linux when using tail -f on a file with the
append-only attribute. Reported by Dean Gaudet. For details,
see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
|
|
|
|
|
|
Don't include "lchown.h".
(restricted_chown): Accept a new parameter, CWD_FD, and use it in
calling openat, lchownat, chownat, rather than open, lchown, chown.
Update caller.
|
|
its clients accordingly -- note that du.c uses fts but doesn't need
any adjustment, since it doesn't operate on the actual files,
but rather just uses the stat buffers provided by fts.
Include "openat.h".
(process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (...
|
|
|
|
changed, except for the ones that didn't already append a newline.
|
|
cast its result to void, to avoid gcc's warning that
``left-hand operand of comma expression has no effect''.
(DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise.
|
|
|
|
This is necessary for Dragonfly. Patch by Joerg Sonnenberger.
|
|
%::z and %:::z (separate with two spaces, not one) so that help2man
formats them properly. Reported by Philip Rowlands.
|
|
First off, the attribute should have been `volatile' (not static)
to avoid longjmp-related risk of clobber. Secondly, now there is
no longer any risk of a local variable being clobbered, so there's
no need for any attribute at all.
|
|
(AD_pop_and_chdir): Use gotos to avoid some duplication.
(AD_push): Rewrite an assertion so that the entire computation
goes away when assertions are turned off.
|
|
It's already defined in "system.h".
|
|
|
|
|
|
(restricted_chown): Return it, if the file cannot be accessed due
to EPERM, or if no uid or gid are required, or if the file is
neither a directory nor a regular file. Rewrite to avoid gotos.
(change_file_owner): Handle RC_do_ordinary_chown case.
Rewrite to avoid gotos.
|
|
|
|
|
|
is useful `mainly' (not `only') when following by name.
Reported here: http://bugs.debian.org/273781
|
|
(main): If -m is given, don't invoke chmod; use umask 0 instead.
Report an error if -m asks for bits outside the 777 range.
Undo 2005-12-19 changes.
|
|
|
|
(main): If -m is given, don't invoke chmod; use umask 0 instead.
Report an error if -m asks for bits outside the 777 range.
|
|
(usage): Clarify -m's operation.
(main): Use lchmod rather than chmod. Don't use lchmod unless the
new mode contains bits outside the 777 range.
|
|
(re_protect, make_dir_parents_private): Use lchmod rather than chmod.
|
|
(copy_internal): Use lchmod rather than chmod.
|
|
|
|
Don't bother trying to open dir for writing, since POSIX prohibits it.
|
|
| O_NOFOLLOW too, for consistency with other dir-openers.
Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
(is_empty_dir): Likewise.
|
|
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
|
|
|
|
open, fchown, and close rather than just chown. To do that reliably
(even with an overly restrictive umask), ensure that each
mknod call uses a mode including at least owner-read access.
(main): When `-m MODE' is specified, exit nonzero if
the subsequent chown (or equivalent open,fchown,close) fails.
|
|
open, fchown, and close rather than just chown. To do that reliably
(even with an overly restrictive umask), ensure that each
mkdir call uses a mode including at least owner-read access.
|
|
open, fchown, and close rather than just chown. To do that reliably
(even with an overly restrictive umask), ensure that each mknod/mkfifo
call uses a mode including at least owner-read access.
|
|
(OPEN_NO_FOLLOW_SYMLINK): Remove definition. Use O_NOFOLLOW in
place of all uses, since it is guaranteed (system.h) to be defined.
|
|
|
|
|
|
|
|
|
|
Remove umask_kill, don't change the process umask, and let the kernel
apply the umask where appropriate.
(make_dir_parents_private): Fix logic for POSIX ACLs.
|
|
On systems with an ACL library, arrange
to link with it via $(LIB_ACL), for the utilities that need it.
|
|
(copy_reg, copy_internal): Use copy_acl and set_acl
instead of fchown/chown. Fix the logic for POSIX ACLs.
(chown_succeded): Remove; we now always copy acls and
preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
did a chown before or not.
|
|
is no requirement for ACL support; particularly, it does not exist
on systems that have POSIX ACLs.
|
|
(OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
(fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
value is now signified by whether cwd_errno is null.
(fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
pointer-to-bool to pointer-to-errno-value. All callers changed.
(rm_1): Don't bother setting a local cwd failure flag and then
ORing it into the caller's. Just set the caller's.
(rm): Use cwd failure errno value to print a slightly-better
diagnostic.
|
|
end of a --printf format string. Reported by Paul Eggert.
|
|
|
|
add new option: --printf=FMT
(isodigit, octtobin, hextobin): Define.
(PRINTF_OPTION): Define.
(interpret_backslash_escapes, trailing_delim): New globals.
(usage): Document them. Alphabetize on long option names.
(print_esc_char): New function.
(print_it): Rewrite, in order to handle backslash escapes.
(main): Handle new option. Set globals for --format, too.
|
|
(check_ordering_compatibility, main): Use it.
(main): Check for -c and -o.
Don't bother with a usage message for
"sort -c a b", for consistency with other error diagnostics.
|
|
(main): Use it.
|