Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
--symbolic-link options now implies --remove-destination.
|
|
unlinks an existing destination before trying to open it for writing.
Otherwise, installing onto a running shared library would make the
running program malfunction.
|
|
slash from one partition to another, and giving it a different
name at the destination would cause mv to get a failed assertion.
Reported by Michael Stone.
(strip_trailing_slashes_2): Move function definition to precede new first use.
|
|
using --remove-dest with -R.
|
|
(also making it match the texinfo documentation).
|
|
preceding chown call and we're supposed to preserve some special
permission bit(s) that would have been reset by chown.
Reported by Greg Louis.
|
|
(copy_internal): Avoid calling chown if we know it's not necessary.
|
|
|
|
|
|
|
|
|
|
|
|
as well as the definition of lstat from cp.c to this file.
|
|
as well as the definition of lstat from here to copy.h.
|
|
|
|
|
|
|
|
checkpoint
|
|
|
|
(cp_option_init): Initialize new members.
(usage): Reflect the fact that --force (-f) relates only to whether
mv prompts.
(main): Remove uses of old `force' option member.
|
|
[long_options]: Add an entry for --remove-destination.
(usage): Describe --remove-destination.
(do_copy): Use unlink_dest_after_failed_open member, not `force.'
(cp_option_init): Initialize new members.
(main): Handle UNLINK_DEST_BEFORE_OPENING (aka --remove-destination).
|
|
|
|
|
|
|
|
[unlink_dest_before_opening]: Add member.
[unlink_dest_after_failed_open]: Add member.
|
|
and partially rewritten.
(copy_internal): Unlink destination file when unlink_dest_before_opening
option is set, and when the source is neither a regular file nor a directory.
|
|
Remove the SPARSE_MODE parameter. Update caller.
Perform POSIX-mandated (for cp) open-with-O_WRONLY|O_TRUNC when
the regular destination file exists; upon failure, unlink
that existing file, then open again, but with O_WRONLY|O_CREAT.
(copy_internal): `force' in not related to interactive; remove
the conjunct.
Remove the entire `else if (x->force)' block; justifying
removal of the non-directory part is easy: POSIX requires we try
to open an existing regular file, so we can't unlink it beforehand.
The part that changes the mode on a directory to allow overwriting
isn't necessary.
|
|
since we then unlink the destination file.
|
|
|
|
|
|
(buggy_lseek_support): New function.
(skip): Use it.
Frank Adler reported that although _llseek returns 0, lseek
erroneously returns an offset suggesting the operation succeeded
even though it fails.
|
|
impossible and some buggy drivers return zero.
Use SEEK_CUR rather than SEEK_SET; this fixes a bug when the
file descriptor is not currently rewound.
|
|
with all the other programs in this directory.
|
|
|
|
(buggy_lseek_support): New function.
(skip): Use it.
Reported by Martin Gallant via Michael Stone.
|
|
|
|
|
|
(usage): Describe -L and -H.
(cp_option_init): Initialize to DEREF_UNDEFINED, not `1'.
(main): Add `H' and `-L' to getopt spec string.
[case 'a']: Initialize `dereference' to DEREF_NEVER, not 0.
[case 'd']: Likewise.
[case 'H']: New case.
[case 'L']: New case.
[case 'R']: Don't set dereference to `0' here.
If it's not yet defined, set x.dereference to DEREF_NEVER
if -R was specified, else set it to DEREF_ALWAYS.
Set x.xstat accordingly for -H.
|
|
(copy_dir): Set `xstat' member to lstat so that with `-H' we don't
follow symlinks found via recursive traversal.
Update uses of `dereference' to compare against new enum member names.
|
|
(struct cp_options) [dereference]: Change type to Dereference_symlink.
|
|
|
|
|
|
From Bruno Haible.
|
|
POSIX.2 requires that cp -p and mv attempt to set the uid of the
destination file, even if you're not root. This affects behavior
only on hosts that let you give files away via chmod.
|
|
and `..'. Reported by Stephen Smoogen, based on a patch from H.J. Lu.
|
|
|