Age | Commit message (Collapse) | Author |
|
using --remove-dest with -R.
|
|
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.
|
|
|
|
|
|
|
|
checkpoint
|
|
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.
|
|
|
|
(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.
|
|
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.
|
|
the scope where it's used.
(copy_internal): In calling copy_reg, pass not the raw `src_mode',
but the possibly-umask-relative mode, `get_dest_mode (x, src_mode)'.
|
|
|
|
Honor the umask for `cp', but not for `mv' or `cp -p'.
(copy_reg): New 4th parameter, dst_mode. Pass it as 3rd arg. to open.
(copy_internal): Change type of locals `src_mode' and `src_type' from
int to mode_t.
Remove unnecessary local `fix_mode'.
Combine two if-stmts into one.
Pass `src_mode' as 4th arg to copy_reg.
If we've just created a new regular file, return early, skipping the
chmod step. copy_reg now sets permissions of such files upon creation.
Use get_dest_mode, so there's just one chmod call here.
|
|
message.
|
|
with --verbose and --backup.
|
|
corresponding argument in a `quote (...)' call -- if there's only one.
If there are more than one, then use `quote_n (0, ...),
quote_n (1, ...), ...'.
|
|
invoking savedir, and assume that errno is nonzero if savedir fails.
|
|
failed copy_dir call -- otherwise, the failure to read a single file
in a source directory would cause the containing destination directory
not to have owner/perms set properly. Reported by Piotr Kwapulinski.
|
|
|
|
(copy_internal): Change the || to ^ in the big sameness
test, so copying one symlink onto another, identical one doesn't fail here.
If the symlink call fails, don't report the failure if the destination
already exists and is a symlink pointing to the proper name.
|
|
|
|
a non-directory. Reported by Brian Kimball via Michael Stone.
|
|
(copy_internal): When making backup files in verbose
mode, print the backup file name on the same line as the rest of the
information, e.g., `a -> b (backup: b.~13~)' rather than on a line
by itself.
|
|
(copy_internal): In move mode, if the rename attempt
fails, then unlink any existing destination file. This makes a
cross-device `mv' more consistent with the intra-device behavior.
This change is required by POSIX to make a cross-device move act with
semantics similar to those of the rename syscall. For example now
`mv' can move a file onto a symlink to itself when that symlink
is on a separate partition. With fileutils-4.0j, it would fail with
a diagnostic saying they were the same file.
Reported by Bruno Haible.
|
|
and *do* allow `mv' to move a file onto a symlink to itself when that
symlink is on a separate partition. With fileutils-4.0j, it would
fail with a diagnostic saying they were the same file.
Reported by Bruno Haible.
|
|
`mv src symlink-to-src' when src and dest are on different partitions.
Otherwise, that `mv' command would silently remove `src'.
Reported by Michael Stone.
|
|
|
|
|
|
Otherwise, `mv' would not preserve the permissions when copying
between partitions. Reported by David Godfrey
|
|
Add a single condition to the existing sameness test.
|
|
(copy_internal): Qualify SAME_INODE test with (link-count == 1
|| same_name(...)).
|
|
Based on a patch from Chris Yeo.
|
|
it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block.
Prior to this change, `cp --one-file-system' would traverse a file-
system boundary if the destination directory existed.
From thospel@mail.dma.be.
|
|
That is, even though source and destination are `the same,' don't fail
if the destination is a symlink. From Peter Samuelson.
|
|
Don't assume the traditional Unix values for mode bits.
|
|
|
|
operations when in verbose mode.
(copy_internal): Likewise.
Based on changes from Marty Leisner.
|
|
failed rename of a directory into a subdirectory of itself.
|
|
from format string. From Michiel Bacchiani.
|
|
|
|
test for move/copy-into-self.
Instead, deduce the move-into-self condition from errno==EINVAL
after a failed rename.
|
|
Otherwise, `touch a b; echo n|mv -i a b' would remove b.
From Bernd Leibing.
|
|
to avoid damaging the destination filesystem when copying from a
Netapp snapshot directory. With code from Kjetil Torgrim Hollstein
and Paul Eggert.
|
|
directories (but none of their entries). This makes
`cp --one-file-system' work the same way tar does.
From Marty Leisner.
|
|
|
|
|
|
sameness test: when --force has been specified, the destination
is unlinked before any copy.
(copy_internal): Add yet another: when both src and dest are symlinks.
|