1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-27 08:00:11 +00:00
freebsd/bin
Ganael Laplanche 681fd2bed8 pax: Terminate loop for empty directory names
Pax can sometimes loop forever. For example:

$ mkdir -p /tmp/src/foo/bar
$ rm -rf /tmp/dst ; mkdir -p /tmp/dst
$ cd /tmp/src
$ echo 'foo/bar/' | /bin/pax -r -w -d -pe "/tmp/dst"
<looping infinitely>

Here, pax(1) infinitely deletes and re-creates /tmp/dst/foo/bar/.

The problem is that chk_path() (bin/pax/file_subs.c), called from
node_creat() also creates the leaf directory when a trailing '/' appears
in the directory name to create. When the execution goes back from
chk_path() to node_creat(), the function still cannot create the leaf
directory (it has been created by chk_path()), so it unlinks it and
calls node_creat() again. The function re-creates it, and so on...

In node_creat() detect trailing slashes and not create a leaf directory,
but only intermediate ones.

PR: 277060
Reviewed by: imp
2024-06-21 10:39:09 -06:00
..
cat cat: Missed a couple. 2024-05-10 13:05:45 +02:00
chflags chflags(1): obey siginfo request on chflagsat(2) failure 2024-01-30 22:21:55 +02:00
chio chio(8): Fix typo in the copyright section 2024-02-13 12:38:27 +08:00
chmod Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
cp cp: avoid a resource leak 2024-05-23 12:04:43 -06:00
cpuset Use proper convention for relative path linking 2023-08-18 04:20:32 -07:00
csh csh: Remove hardlink /.cshrc 2024-05-29 09:56:58 +02:00
date date.1: Note that nanosecond support is to appear first in 14.1 2024-05-02 22:48:08 +02:00
dd bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
df df(1): Fix grammar 2024-02-13 18:31:05 +08:00
domainname domainname(1): Grammar fix 2024-02-13 19:13:33 +08:00
echo echo(1): Add EXAMPLES 2024-04-08 18:35:40 +02:00
ed ed(1): Fix grammar in comment 2024-02-13 17:55:54 +08: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" 2023-12-29 15:24:25 -05:00
getfacl bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
hostname tests: Fixing incomplete atf_skip if missing jail condition 2024-02-23 13:08:09 +01:00
kenv bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kill Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
ln ln: Improve link(1) variant of ln(1). 2024-04-04 16:14:50 +02:00
ls ls.1: Mention CLICOLOR environment variable 2024-02-21 11:54:58 +01:00
mkdir Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
mv mv: Set file flags after setting file times 2024-04-16 09:18:15 -04:00
nproc nproc: Prefer sys/cdefs.h __unreachable over the builtin 2024-04-12 16:39:05 -06:00
pax pax: Terminate loop for empty directory names 2024-06-21 10:39:09 -06:00
pkill bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
ps man filesystems: fix xrefs after move to section 4 2024-05-16 10:25:29 -06:00
pwait pwait.1: add missing prompt and command in examples 2023-11-27 10:59:52 -06:00
pwd Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
realpath bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
rm Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
rmail bin: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
rmdir /bin/rmdir: Exit with status 2 for invalid arguments 2024-05-11 13:13:28 -06:00
setfacl bin/setfacl: remove unreachable break after usage() 2024-01-03 12:05:50 -07:00
sh sh(1): Grammar fix in jobs.c 2024-02-13 14:13:08 +08:00
sleep sleep: Overhaul. 2024-03-25 16:59:02 +01:00
stty bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
sync sync.8: Document that the "sync dance" is not a thing 2024-04-25 11:49:50 +02:00
test bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
timeout bin/timeout: remove unreachable break after usage() 2024-01-03 12:05:50 -07:00
uuidgen uuidgen(1): Add EXAMPLES to manual page 2024-04-27 20:53:59 +02:00
Makefile bin: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
Makefile.inc bin: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00