[Bug 277060] pax(1) hangs in copy mode under certain conditions

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 15 Feb 2024 00:59:03 UTC

            Bug ID: 277060
           Summary: pax(1) hangs in copy mode under certain conditions
           Product: Base System
           Version: 14.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: c433li@gmail.com

The issue is best illustrated with a demo first:

# mkdir demo
# cd demo
# echo '/usr/local/' | pax -rw .
(hangs forever, interrupt with Ctrl-C)
# echo '/usr/local/' | pax -rw .
(this time it completes successfully)

In other words, when `pax(1)` is operating under copy mode (the forth synopsis

pax -r -w [file ...] directory

If *all* the following conditions are met, it will hang forever:
1. the `file` operand is not specified; and
2. its has its standard input piped; and
3. the (piped) standard input contains a line that is directory (as the
conceptual equivalence of `file` operand); and
4. the `file`(which is a directory) contains at least two components ('*/*/');
5. the destination directory does not contain all the parent components of
`file`; and
6. the directory is specified with a slash (`/`) at the end.

You are receiving this mail because:
You are the assignee for the bug.