Date: Fri, 07 Jun 2024 17:00:19 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 277060] pax(1) hangs in copy mode under certain conditions Message-ID: <bug-277060-227-xUd3NDgSBm@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-277060-227@https.bugs.freebsd.org/bugzilla/> References: <bug-277060-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277060 Ganael LAPLANCHE <martymac@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martymac@FreeBSD.org Status|New |In Progress --- Comment #1 from Ganael LAPLANCHE <martymac@FreeBSD.org> --- Hello, I am facing the same bug too : $ 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_crea= t() 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... A possible fix is to make node_creat() detect trailing slashes so it does N= OT create a leaf directory but only intermediate ones. I've added a simple che= ck in that way in the attached patch. Best regards, Ganael. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-277060-227-xUd3NDgSBm>