Age | Commit message (Collapse) | Author |
|
|
|
|
|
a destination with link count greater than one. This is so
that commands like "cp -a" don't get confused when copying into
a destination that already contains many hard links.
|
|
same_file_ok, seen_file, copy_internal, valid_options, copy):
Use bool when appropriate.
|
|
returns NULL, so don't bother to check for this.
|
|
|
|
|
|
|
|
Instead, include yesno.h.
|
|
Instead, include "euidaccess.h".
|
|
royally if the link length is long (e.g., GNU/Hurd). Use
xreadlink instead, it's safer. Don't bother to read the link if
it's the wrong size. Add a FIXME because this area is a bit murky
and undocumented.
|
|
|
|
(copy_reg): Align I/O buffers to page boundaries.
|
|
(copy_internal): Compare time stamps using utimecmp rather than
MTIME_CMP.
|
|
mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki.
When moving a set of N hard-linked files between
partitions, via two or more command line arguments where the
command line argument containing the Nth link contains no other
link to that same file, mv would mistakenly copy the file, rather
than hard-linking it to the other(s). That happens because when the
final link is processed, its link count has been reduced to 1 since
the other links have been `copied' to the destination partition
and the source links have been removed.
(copy_internal): When in move mode, use the source dev/inode
pair to look up destination name even when st_nlink == 1.
|
|
produce an invalid copy on the destination device.
(copy_reg): Even with --sparse=always, try to
make `holes' only if the destination is a regular file.
Reported by Szakacsits Szabolcs.
|
|
portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
inline `stat' and `lstat' functions, thus making the tests of
`xstat == lstat' in copy.c always fail.
(copy_dir): Set `.dereference' member, not .xstat.
(copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
(valid_options): Remove now-obsolete FIXME comments.
|
|
|
|
The former is more maintainable and usually shorter.
|
|
type changes (unsigned int -> size_t) in hash.c.
|
|
S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
via system.h.
|
|
|
|
Remove duplicate inclusion of "same.h".
|
|
on a partition (e.g. VFAT) on which distinct names may refer to the
same directory entry (often due to variations in case), and when the
link count for the file is 1, mv no longer unlinks the file.
FIXME: this is a band-aid fix. If the file happens to have a link
count of 2 or greater, mv will still unlink it.
(same_file_ok): Invoke same_name (which might still
return false for names that refer to the same directory entry)
only if the link count is 2 or more.
|
|
(copy_internal): Set file timestamps with utimens, not utime.
|
|
|
|
adequate, since join.c uses alloca, yet lacked an in-file #pragma.
Remove `#pragma alloca'.
|
|
Use `error_t' (rather than int) as type for local `err'.
|
|
Fix author preservation code.
|
|
(triple_free): Don't apply cast to argument of free.
(seen_file): Add cast here instead.
|
|
xrealloc, and xcalloc return values and of xrealloc's first argument.
|
|
`mv a b' would not remove `a' in some unusual cases. Work around
this by unlinking `a' when necessary.
(same_file_ok): Add an output parameter.
Set it in the offending case.
(copy_internal): When necessary, unlink SRC_PATH and inform caller.
|
|
failure to create a hard link, do not remove the entry associating
the source dev/ino with the destination file name.
|
|
existing destination file, unlink that file and try again.
|
|
|
|
rename a directory, this code would never attempt to rename any
other file in that directory, but would thenceforth always copy.
On some systems (NetApp version ??), renaming a directory may fail
with EXDEV, yet renaming files within that directory to a newly-
created destination directory succeeds.
(copy_internal): Remove local, move_mode;
use x->move_mode instead. Based on a patch from Tom Haynes.
|
|
Patch by Alfred M. Szmidt.
|
|
`failed to preserve ...' to make the failure clearer.
|
|
(copy_internal): Preserve the stat.st_author field.
|
|
from gcc -W about comparison between signed and unsigned.
(copy_internal): Likewise, but use a cast.
|
|
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.
|
|
|
|
(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.
|
|
Instead, just skip it like the diagnostic says.
Reported by Paul Eggert.
|
|
reporting replaced files. This avoids a bug in the code,
which mishandled ino_t wider than long.
|
|
|
|
|
|
issue a warning that `cp -r' is not portable.
|
|
whereby an unprivileged user could gain read access to otherwise-
inaccessible files when root uses cp or mv to copy a hierarchy
belonging to that user.
|
|
|