HardenedBSD/bin
Kyle Evans 848263aad1 cp: fix some cases with infinite recursion
As noted in the PR, cp -R has some surprising behavior.  Typically, when
you `cp -R foo bar` where both foo and bar exist, foo is cleanly copied
to foo/bar.  When you `cp -R foo foo` (where foo clearly exists), cp(1)
goes a little off the rails as it creates foo/foo, then discovers that
and creates foo/foo/foo, so on and so forth, until it eventually fails.

POSIX doesn't seem to disallow this behavior, but it isn't very useful.
GNU cp(1) will detect the recursion and squash it, but emit a message in
the process that it has done so.

This change seemingly follows the GNU behavior, but it currently doesn't
warn about the situation -- the author feels that the final product is
about what one might expect from doing this and thus, doesn't need a
warning.  The author doesn't feel strongly about this.

PR:		235438
Reviewed by:	bapt
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D33944
2022-01-27 12:02:17 -06:00
..
cat cat: style nits 2021-01-20 18:46:26 +01:00
chflags
chio pkgbase: Put chio in utilities 2021-06-19 17:49:44 +02:00
chmod
cp cp: fix some cases with infinite recursion 2022-01-27 12:02:17 -06:00
csh pkgbase: Create a FreeBSD-csh package 2021-12-21 10:17:50 +01:00
date date: Capitalize seconds string in synopses 2021-11-03 14:09:36 +01:00
dd
df df: remove the unused fstype var 2021-07-20 19:00:50 +02:00
domainname pkgbase: Put yellow pages programs to its own package 2021-12-21 10:17:22 +01:00
echo echo(1): Replace errexit() with err(3) 2021-11-09 22:12:19 +01:00
ed ed(1): Add two references in the SEE ALSO section 2021-04-09 09:43:49 +02:00
expr
freebsd-version freebsd-version(1): Add -j flag to support jails 2021-10-01 13:50:56 -05:00
getfacl Fix build of bin/getfacl after libc changes. 2021-08-27 11:52:18 +03:00
hostname hostname: avoid strcpy() overlap in -d flag handling 2021-09-25 00:03:50 -05:00
kenv kenv: allow listing of static kernel environments 2021-07-18 23:06:19 -05:00
kill
ln
ls ls(1): Allow LSCOLORS to specify an underline 2021-09-19 13:52:12 +02:00
mkdir src/bin/mkdir: Spell occur correctly. 2021-10-02 10:39:31 -06:00
mv
pax src/bin/pax: Fix spelling error 2021-10-02 10:39:34 -06:00
pkill bin/pkill: Fix {pgrep,pkill}-j_test.sh 2021-02-13 13:53:51 +00:00
ps src/bin/ps: Fix spelling error 2021-10-02 10:39:37 -06:00
pwait Fix typo in pwait.c introduced in 5bdce6ff54 2021-01-21 21:43:27 +00:00
pwd
realpath
rm
rmail
rmdir
setfacl Remove unused headers. 2020-12-12 02:26:43 +00:00
sh sh: Don't add something to a null pointer 2022-01-26 23:13:20 +01:00
sleep Soften caveat about fractional seconds for sleep(1) 2020-12-31 19:18:20 -08:00
stty Replace sscanf() by strtoul() 2020-12-27 22:32:22 +01:00
sync
test Remove unused includes. 2020-12-22 21:04:36 -08:00
tests
uuidgen
Makefile
Makefile.inc