Age | Commit message (Collapse) | Author |
|
|
|
out of remove_dir. The sole difference is that upon detecting a
cycle, rm now dies unconditionally. Before, in interactive mode,
it would ask the user whether to continue.
(remove_dir): Call cycle_check.
|
|
|
|
Declare input_file and output_file to be `const'.
(skip): Declare `file' parameter to be `const', too.
|
|
Instead, detect them lazily with just O(1) memory.
Suggestion from Andi Kleen.
(is_power_of_two): New function.
(print_nth_dir, make_active_dir_ent): Remove functions.
(hash_active_dir_ent, hash_compare_active_dir_ents): Likewise.
(remove_dir): Check for cycles here, ...
(rm): ... and don't check for cycles here.
(rm): Call fspec_get_full_mode here, rather than
fspec_get_filetype_mode. We want to get the dev/ino earlier, and
at the same time as when we get the file type, to avoid the risk
that an attacker would change e.g. a directory to a symlink before
we record its dev/ino.
|
|
|
|
|
|
(_, N_) Remove definitions.
Include "gettext.h" instead.
|
|
|
|
|
|
|
|
|
|
initialize the active_dir_map unless --recursive (-r) is specified.
|
|
when --no-create is in effect. Based on a patch from TAKAI Kousuke.
|
|
(print_line): Use "%-8.8s" for the format: the user name is not
always NUL terminated.
(scan_entries) [need_users]: Use IS_USER_PROCESS, so that this works
even on systems without ut_type.
|
|
(NEW_TIME): Define to 0, not INT_MAX.
(UT_PID, UT_ID, UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
Replace literal uses of ut_pid, ut_id, and ut_exit members with
uses through macros.
(make_id_equals_comment): New function, factored out of three others.
|
|
(print_statfs): Use human_fstype to honor format width on %T.
|
|
|
|
|
|
Use xmalloc everywhere, not malloc.
|
|
Include inttypes.h.
(PRIdMAX, PRIuMAX): Define, if not already defined.
(print_statfs): Use those macros, not the literal strings.
(print_stat): Likewise.
|
|
including the mention of SET1.
|
|
|
|
|
|
(print_stat): Remove another #ifdef.
(do_statfs): Likewise.
(print_statfs): Prefer/use fputs over printf.
(print_stat): Likewise.
|
|
|
|
(verbose_usage): Remove function.
|
|
|
|
|
|
|
|
Remove lots of #if directives involving FLASK_LINUX
[!FLASK_LINUX] (is_flask_enabled): Define.
(stat_secure, lstat_secure): Define.
(print_statfs): Remove lots of nested #if directives.
Instead, rely on support fo %llu and %lld printf formats --
but that is only temporary, since it's not porable enough.
(main): Hoist is_flask_enabled test to be done here, rather
than in each of do_stat and do_statfs for every argument.
|
|
Constify many parameters.
(print_statfs): Fix typo: Use %u (to match %lu) for namelen, not %d.
|
|
|
|
|
|
Declare most functions to be `static'.
|
|
[HAVE_SYS_SYSMACROS_H]: Guard inclusion of sys/sysmacros.h.
(PROGRAM_NAME, AUTHORS): Define.
(long_options): Declare/define.
(print_human_access): Rewrite to use mode_string.
(usage): Rewrite.
(main): Use getopt_long.
|
|
and cpp directive (indented via cppi).
|
|
[long_opts]: Remove.
(usage): Tweak --help output; use *_OPTION_DESCRIPTION macros.
(main): Don't use getopt directly. Use parse_long_options instead.
Tweak a diagnostic.
Use EXIT_FAILURE rather than a literal `1'.
(main): If POSIXLY_CORRECT is set, don't recognize --help or --version,
so the program can operate on a file with one of those names.
|
|
[long_opts]: Remove.
(usage): Tweak --help output; use *_OPTION_DESCRIPTION macros.
(main): Don't use getopt directly. Use parse_long_options instead.
Tweak a diagnostic.
Use EXIT_FAILURE rather than a literal `1'.
|
|
|
|
|
|
|
|
|
|
down to just before the first use of that variable. Otherwise, it was
possible to make mv (and probably cp, too) malfunction when copying
hard-linked files into a directory containing at least one of the
source file names. Call forget_created everywhere thereafter where
this function returns without creating a destination file that might
subsequently be linked. Reported by Iida Yosiaki.
|
|
|
|
Might as well keep it simple, and like bash.
(binary_operator): Fix bug with -nt and -ot, when one of the
files did not exist. We want to be compatible with the ksh93
documentation, and with Bash.
|
|
|
|
a *floating-point* format, also in description of that option.
(usage): Also add the `=' signs here: --format=FORMAT,
--separator=STRING.
|
|
(using errno from the failed unlink) when a cross-device `mv'
fails, e.g., because the destination cannot be unlinked.
Prompted by a report from Karl Berry.
|
|
|