Repository navigation
Fix regression: Allow FIFO / process substitution for --read-batch - #1060
Conversation
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? |
|
@steadytao Actually, I just tested KornShell and it uses standard pipes (pipe:[). Looking at the man pages, it says it uses normal pipes. but on ksh93 it may uses socketpair instead on pipeline not process substitution
But this will be handled well without adding anything in the source due to this check The only thing could fail is things like sockets or anon_inodes that won't come directly from standard bash process substitution and is being explicitly prepared first. I think we better keep it stricter to FIFOs if a legit case of socket is already handled. |
|
I'll rebase and fix the test |
|
Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting. Reviewed at head
Memory-safety / untrusted-input: no concern — it's a one-condition change with no new read loop or length handling. |
50b3bf8 to
61430e4
Compare
3c25631 to
a449843
Compare
Updated batch file checks to allow FIFO pipes while rejecting non-regular files to support bash process substitution.
e195e2b to
0810240
Compare
--dry-run does every pre-flight and stops, printing the command it would have run. It takes no lock, writes no log, moves no latest- symlink, takes no usage reading and publishes no dashboard row, so it is safe to run while a real run is in flight and leaves no trace that a run happened. It exists because until now the only way to exercise the guards was to start a review and interrupt it, and on 2026-09-16 that twice started one for real - once against an ArduPilot PR, once against an rsync PR - because the guard being tested did not fire. Neither reached the posting stage, but neither should have started. Two bugs it found on its first use: A single PR could never be reviewed. review-now.sh resolves an argument to ArduPilot/ardupilot#34206 and passes it as the mode, which went straight into the log filename - the slash names a directory that does not exist, so exec >>"$LOG" failed, and a redirection error on exec exits a non-interactive shell. With MAILTO empty the run died before its first line of output, in silence; no PR-mode log has ever existed on the box. The mode is now flattened for the filename only, leaving every other mode's name unchanged. A PR in the rsync project asked for by hand ran on the main Claude subscription. The account switch tested `$MODE = rsync`, which RsyncProject/rsync#1060 is not. Both now select that project's account. review-now.sh also sources review-env.sh, so its gh pre-check uses the same account as the run it starts.
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.