Age | Commit message (Collapse) | Author |
|
* src/copy.c (copy_internal): Omit the group- or other-writeable
permissions when creating a directory, to avoid a race condition
if the special mode bits aren't right just after the directory is
created.
* src/cp.c (make_dir_parents_private): Likewise.
* tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
race fix in copy.c.
|
|
* src/cp.c (make_dir_parents_private): Report the error sooner with
"cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
creating the directory, DEST/DIR.
* tests/cp/cp-parents: Test for the non-race-condition bug fixed
by the above change.
|
|
* m4/jm-macros.m4 (coreutils_MACROS): Check for fchmod.
* src/copy.c (fchmod_or_lchmod): New function.
(copy_reg): New arg OMITTED_PERMISSIONS. All uses changed.
Omit confusing and unused ", dst_mode" arg to 'open' without O_CREAT.
When creating a file, use O_EXCL, so we're more likely to detect
funny business by other processes. At the end, if permissions
were omitted, chmod them back in.
(copy_internal): If the ownership might change, omit some permissions
at first, then restore them after chowning the file.
* src/cp.c (make_dir_parents_private): Likewise.
* src/copy.c (cached_umask): New function.
* src/copy.h (cached_umask): New decl.
|
|
7777. This matches historical 'cp' behavior and avoids some
(though not all) implementation-defined behavior of mkdir.
* src/cp.c (make_dir_parents_private): Likewise.
* src/copy.c (copy_internal): Don't pass 'open' a mode greater
than 777. This is required by POSIX. It doesn't make any difference
in actual behavior on any host that I know of.
|
|
where the first one names a directory and the second name ends in
a slash and doesn't exist. E.g., "mv dir B/", for nonexistent B,
now succeeds, once more. This reverts part of the 2004-06-27
change for 5.3.0.
* NEWS: Say the above.
* src/mv.c (target_directory_operand): Don't require (here)
that the target operand "look like" a directory. This change
pushes the test down to the rename syscall level, where a
"mv dir existing-non-dir/" will mistakenly succeed on older systems
that ignore trailing slashes in the rename destination argument.
* src/cp.c (target_directory_operand): Likewise, but for cp.
* tests/mv/trailing-slash: Exercise the above fixes.
* tests/cp/trailing-slash: New file.
* tests/cp/Makefile.am (EXTRA_DIST): Add trailing-slash.
|
|
|
|
S_ISLNK are defined, since they're always defined now.
* src/cp.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/ls.c (get_link_name, make_link_name): Likewise.
* src/mkfifo.c (usage): Likewise.
* src/who.c (S_IWGRP): Likewise.
|
|
|
|
(ASSIGN_BASENAME_STRDUPA): Likewise. Reduce time spent
traversing the string.
|
|
option string from its description, so help2man formats the
derived man page properly. Patch from Nicolas François
in http://bugs.debian.org/351601.
|
|
(re_protect, make_dir_parents_private): Use lchmod rather than chmod.
|
|
|
|
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.
|
|
TIMESPEC_NS macro.
|
|
(usage): Remove description of --reply.
|
|
corresponding option string and value arrays are consistent.
Remove a harmless trailing `, 0' from a value list.
|
|
It was deprecated nearly 6 years ago and has been warning
users to switch to --backup=S since fileutils-4.0j.
|
|
(parents_option): Renamed from flag_path. All uses changed.
(make_dir_parents_private): Renamed from make_path_private.
All uses changed.
(usage): Don't use "path" to describe a file name.
|
|
Use chown_failure_ok rather than our own code.
(cp_options_init): Use chown_privileges rather than getuid.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
re_protect, make_path_private, target_directory_operand, do_copy,
cp_option_init, decode_preserve_arg, main): Use bool when appropriate.
(target_directory_operand): Do not clear *NEW_DST if stat
succeeds. It's not necessary in that case, as *NEW_DST is always
false already.
(do_copy): Rewrite slightly to avoid need for "unreachable" comment.
(main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
|
|
bother to check for this.
|
|
(make_path_private): 2nd arg is now size_t, not int,
to avoid problem when path_concat dir name is longer than 2 GiB (!).
|
|
and --no-target-directory options, respectively.
(NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
Remove. All uses changed to 'T' and 't', respectively.
(long_opts, usage, do_copy, main): Add -t and -T as
aliases for --target-directory and --no-target-directory,
respectively.
|
|
(NO_TARGET_DIRECTORY_OPTION): New constant.
(long_opts, usage, do_copy, main): Add support for
|
|
last operands that are (or look like) directories.
* src/cp.c (target_directory_operand): New, nearly-common function,
It reports an error if the destination appears to be a directory
(e.g., because it has a trailing slash) but is not.
* src/cp.c (do_copy): Use it.
* src/cp.c (do_copy): Don't assume argc is positive.
Don't bother to lstat dest, since copy() will do that for us.
Use "const" to avoid the need for cast.
* src/cp.c (do_copy): Don't output a usage message because of file
problems (e.g., an operand is not a directory). Use it only for
syntax. Standardize on "target %s is not a directory" for the
diagnostic.
* src/cp.c (do_copy): Remove test for trailing slash, since
target_directory_operand now does this.
* src/cp.c (main): Reject multiple target directories.
Check whether a specified target is a directory when parsing the
options, using stat. This gives more-accurate diagnostics.
|
|
--target-directory: s/move/copy/. From Paul Jarc.
|
|
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
(do_copy): Likewise.
|
|
Suggestion from Karl Berry.
Include "quoatearg.h".
(do_copy): Use quotearg_colon (not quote) for diagnostics
that begin with `"%s:'.
|
|
(do_copy): Declare/use local xstat rather than x->xstat.
(main): Remove code that set x.xstat.
|
|
(exit_status): Remove static var....
(main): Making it local here instead. Use =, not |=, to set it.
|
|
(make_path_private): Likewise.
|
|
The former is more maintainable and usually shorter.
|
|
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
|
|
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
|
|
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
|
|
(re_protect): Set file timestamps with utimens, not utime.
|
|
adequate, since join.c uses alloca, yet lacked an in-file #pragma.
Remove `#pragma alloca'.
|
|
to nonexistent destination directory. Reported by Dmitry Rutsky.
See http://bugs.debian.org/199730 for details.
|
|
|
|
|