opnsense-src/bin
Dag-Erling Smørgrav d514cadacc 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 1fead66b64822f3f8106ad09bef0b9656836fa1a)

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 d3a8e9b43b4cef5b80e3845dfa8fd1fec6e568f9)

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 d002316fd7bf0b359ea2f5518f3c10f6ad89a9ac)

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 ac56b9d83c75f548667912ffe422be6bd4f5c27e)

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 0f4467ce444b201468d2268958130f495951ca3c)

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 38509270663f336103273878cc8ddc88a225b9d8)

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

This accidentally got left out of 0f4467ce444b.

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

(cherry picked from commit 53fc8e190241233d94e183f8a39ec39f2154dfa8)
2024-01-17 19:28:22 +01:00
..
cat cat: fallback on EISDIR with copy_file_range(2) 2023-11-26 01:24:42 +01:00
chflags Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
chio Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
chmod Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
cp cp: Add tests for hard link case. 2024-01-17 19:28:22 +01:00
cpuset Use proper convention for relative path linking 2023-08-18 04:20:32 -07:00
csh Fix /root permissions after 'make installworld' 2023-12-01 08:15:25 +01:00
date Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
dd Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
df Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
domainname Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
echo Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
ed Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
expr Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
freebsd-version bsdinstall: rename "Live CD" to "Live System" 2024-01-07 14:31:10 -05:00
getfacl Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
hostname Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
kenv Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kill Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
ln Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
ls Fix "version introduced" in numerous manual pages 2024-01-15 10:20:56 -05:00
mkdir Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
mv Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
nproc nproc.1: Fix "first appeared in" details 2023-06-02 18:53:55 +02:00
pax Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
pkill Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
ps ps: s/kern.max_pid/kern.pid_max/ in a comment 2023-12-13 23:08:50 +00:00
pwait Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
pwd Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
realpath Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
rm Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
rmail Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rmdir Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
setfacl Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
sh Fix /root permissions after 'make installworld' 2023-12-01 08:15:25 +01:00
sleep Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
stty (s)tty: add support for IUTF8 input flag 2023-10-21 17:28:34 +03:00
sync Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
test Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
timeout Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
uuidgen pkgbase: Move uuidgen to runtime package 2023-10-18 16:36:30 +02:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00