You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[cli][P1] -s stdin-script pre-buffers the whole stream: $(exec cat) hits EOF and unconsumed data lines execute as code (#583 -c/-s gap) #586
Repro: niu.exe -s < repro.sh where repro.sh = echo one / v=$(exec cat) / echo "v=[$v]" / MARKER-DATA-1 / MARKER-DATA-2.
GNU: prints one then eats the remaining 3 lines as data (v=[MARKER-DATA-1 MARKER-DATA-2]), rc 0
niu: one / v=[] / then MARKER-DATA-1 and MARKER-DATA-2 execute as commands (rc 127)
Same for bare read -r l (EOF instead of the next script line) and top-level exec cat. -c + piped stdin is correct — the gap is the -s (stdin-script) entry reading the whole stream up front. Data-as-code: curl | bash -s shaped install scripts are a correctness AND safety hazard. Found by the 1.4.0 pre-release semantic sweep (rubash b5e1a2f).
fixed by #593 — the -s stdin-script on-demand reader is now the canonical library driver (rubash::script_driver::run_stdin_script) with the GNU input.c stream-position contract documented at the definition and the full consumer matrix pinned in tests/issue586_stdin_script_on_demand_regressions.rs (comsub exec cat / plain cat / bare read / top-level exec cat / code-resume / seekable-file). Host -s routes must run this driver instead of pre-buffering stdin; the niu product follow-up is [email protected]:612-614 swapping its read_to_string slurp for this API. CI on #593 fully green.
Activity
caomengxuan666 commentedon Oct 13, 2026
fixed by #593 — the -s stdin-script on-demand reader is now the canonical library driver (rubash::script_driver::run_stdin_script) with the GNU input.c stream-position contract documented at the definition and the full consumer matrix pinned in tests/issue586_stdin_script_on_demand_regressions.rs (comsub exec cat / plain cat / bare read / top-level exec cat / code-resume / seekable-file). Host -s routes must run this driver instead of pre-buffering stdin; the niu product follow-up is [email protected]:612-614 swapping its read_to_string slurp for this API. CI on #593 fully green.
fix(#586): -s stdin-script driver becomes the canonical library reader (
docs(changelog): fold the post-0d99ae2c wave into the 1.4.0 section (#…