freebsd-src/bin
Dag-Erling Smørgrav 006017419b cp: Add tests for hard link case.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43052

(cherry picked from commit 1fead66b64)

cp: Add tests for symbolic link case.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, allanjude
Differential Revision:	https://reviews.freebsd.org/D43054

(cherry picked from commit d3a8e9b43b)

cp: Refactor the core logic.

Rewrite `copy_file()` so the lflag and sflag are handled as early as
possible instead of constantly checking that they're not set and then
handling them at the end.  This also opens the door to changing the
failure logic at some future point (for instance, we might decide to
fall back to copying if `errno` indicates that the file system does not
support links).

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, allanjude
Differential Revision:	https://reviews.freebsd.org/D43055

(cherry picked from commit d002316fd7)

cp: Split the basic_symlink test case in two.

This test case tests two different things: first, that copying a symlink
results in a file with the same contents as the target of the symlink,
rather than a second symlink, and second, that cp will refuse to copy a
file to itself, or to a link to itself, or a link to its target.  Leave
the first part in basic_symlink, move the second part to a new test case
named samefile, and slightly expand both cases.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43062

(cherry picked from commit ac56b9d83c)

cp: Move the flags around a bit.

- The HLPR flags are grouped together at the beginning because they are
  the standard flags for programs using FTS.  Move the N flag out from
  among them to its correct place in the sequence.
- The Pflag variable isn't used outside main(), but moving it out lets
  us skip initialization and keeps it with its friends H, L and R.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43063

(cherry picked from commit 0f4467ce44)

cp: Further simplify the core logic.

If the destination file exists but we decide unlink it, set the dne
flag.  This means we don't need to re-check the conditions that would
have caused us to delete the file when we later need to decide whether
to create or replace it.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43064

(cherry picked from commit 3850927066)

cp: Move the -N flag in the manual page.

This accidentally got left out of 0f4467ce44.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, allanjude
Differential Revision:	https://reviews.freebsd.org/D43067

(cherry picked from commit 53fc8e1902)
2024-01-17 17:15:59 +01:00
..
cat Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
chflags Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
chio Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
chmod Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
cp cp: Add tests for hard link case. 2024-01-17 17:15:59 +01:00
csh Fix /root permissions after 'make installworld' 2023-12-01 08:16:38 +01:00
date date.1: Examples: Use syntax that is also compatible with csh 2023-10-04 12:51:32 +02:00
dd Remove $FreeBSD$: one-line bare tag 2023-08-23 11:43:33 -06:00
df Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
domainname Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
echo Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
ed Remove $FreeBSD$: one-line bare tag 2023-08-23 11:43:33 -06:00
expr Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
freebsd-version Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
getfacl Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
hostname Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
kenv Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
kill Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
ln Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
ls Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
mkdir Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
mv Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
nproc nproc.1: Fix "first appeared in" details 2023-06-05 12:57:17 +02:00
pax Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
pkill Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
ps Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
pwait Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
pwd Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
realpath Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
rm Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
rmail Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
rmdir Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
setfacl Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
sh Fix /root permissions after 'make installworld' 2023-12-01 08:16:38 +01:00
sleep Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
stty (s)tty: add support for IUTF8 input flag 2023-10-21 17:34:21 +03:00
sync Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
test Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
timeout sys/*/conf/*, docs: fix links to handbook 2024-01-09 22:07:46 -05:00
uuidgen Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00