mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 22:32:30 +01:00
681fd2bed8
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 |
||
---|---|---|
.. | ||
tests | ||
ar_io.c | ||
ar_subs.c | ||
buf_subs.c | ||
cache.c | ||
cache.h | ||
cpio.c | ||
cpio.h | ||
extern.h | ||
file_subs.c | ||
ftree.c | ||
ftree.h | ||
gen_subs.c | ||
getoldopt.c | ||
Makefile | ||
Makefile.depend | ||
options.c | ||
options.h | ||
pat_rep.c | ||
pat_rep.h | ||
pax.1 | ||
pax.c | ||
pax.h | ||
sel_subs.c | ||
sel_subs.h | ||
tables.c | ||
tables.h | ||
tar.c | ||
tar.h | ||
tty_subs.c |