Fix regression: Allow FIFO / process substitution for --read-batch - #1060
Fix regression: Allow FIFO / process substitution for --read-batch#1060seks99x wants to merge 2 commits into
Conversation
Updated batch file checks to allow FIFO pipes while rejecting non-regular files.
a1250e1 to
9ec4992
Compare
9ec4992 to
0580585
Compare
|
the PR wont pass the CI without merging PR #1054 |
|
Actually this would still break on a I think we should not strict a certain file type and only check for |
|
Sorry for the late response. Very busy weekend. Best to keep this limited to regular files and FIFOs. Sockets, devices and anonymous inodes are outside the process-substitution use case and removing the type check would undo the original hardening. The test should also clear dest after generating the batch so the read-batch run itself has to recreate the payload. Rebase this after #1054 is resolved of course. |
|
@steadytao Unfortunately we could break a legit case or just receive another regression issue if we strict the file type. Sockets can be used also with certain shell types like KornShell. Do you have any specific reason why we should strict the file type here on the read-batch? |
|
If KornShell produces a socket for a real --read-batch invocation, please provide the exact shell version and reproducer so we can test that case. Without one, I merely do not want to remove the type restriction and allow every object that happens to pass The test also needs to remove the destination after generating the batch so the --read-batch operation must recreate it. |
|
Trying to be minimal but that could be a concern so perhaps some testing is justified? |
V3.5.0 in batch.c commit 1604890 introduced a strict S_ISREG check for --read-batch argument paths. This inadvertently breaks bash process substitution (e.g., <(...)), which passes file descriptors as FIFOs (S_IFIFO).
Testing against the 3.4 branch succeeds, but fails on the current 3.5.0dev branch:
Bash
The Fix:
Modified the check in batch.c open_batch_file() to permit S_ISFIFO alongside S_ISREG.