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
[bug] Input dup from a bad fd is silently ignored: 'cmd <&7' runs with original stdin (GNU: '7: Bad file descriptor', rc=1) #266
Found by: wt5/audit source lane (2026-09-28), script-file-verified against WSL GNU Bash 5.3.0.
Summary:command <&7 where fd 7 is not open must fail the command with 7: Bad file descriptor (rc=1). rubash silently ignores the failed dup and runs the command with the original stdin (rc=0).
GNU C source owner:third_party/bash/redir.c:1115case r_duplicating_input in do_redirection_internal — dup2 error returns errno; reported by redir.c:135 redirection_error which for EBADF on a dup instruction prints the redirectee fd number (redir.c:149-158: filename = itos(temp->redirectee.dest)).
Reproducer (tests/fixtures/audit/a2-iso.sh case 2; raw: target/issue-suites/results/source-audit/out/a2-iso.diff):
echo badfd <&7;echo"rc=$?"
GNU 5.3.0: stderr line N: 7: Bad file descriptor, command NOT run, rc=1. rubash: prints badfd (command ran with inherited stdin), rc=0, no diagnostic.
Control: the output direction echo badfd2 >&7 errors identically on both shells, so only the input-dup error path is missing in rubash.
Activity
docs: source-audit lane (wt5/audit) — GNU C vs Rust owner gap audit, …
fd/io family: move-fd dups, <> create, empty-target diagnostics, bad-…
caomengxuan666 commentedon Sep 27, 2026
已修复并合入 master(commit 3aec2a83,lane wt6/fdio;GNU 引用与 14 探针矩阵/真基线切片验证见提交——redir/read/heredoc/procsub 全 0 差异,regression 24/24)。感谢报告!
fix(fd): compound dup preflight covers the input side; unbound dup so…