Bug 277060 - pax(1) hangs in copy mode under certain conditions
Summary: pax(1) hangs in copy mode under certain conditions
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-15 00:59 UTC by c433li
Modified: 2024-02-15 00:59 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description c433li 2024-02-15 00:59:03 UTC
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 form):

----
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 ('*/*/'); and
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.