Skip to content

[bug] Over-lax: 'cat <& <(echo x)' is accepted and executed (GNU: 'ambiguous redirect', rc=1) #340

Closed

Description

@caomengxuan666

Found by gnusweep3 lane (cat3 p017; WSL GNU Bash 5.3.0 oracle, worktree 0fe8d0f).

Repro:

cat <& <(echo x)

GNU 5.3.0: line 1: <(echo x): ambiguous redirect, rc=1, no output (dup redirection target word expands to a multi-char path -> ambiguous).
rubash: prints x, rc=0, no error — accepts and dups from the procsub path.

GNU C owner: redir.c:201 redirection_expand() — the ambiguous-redirect branch (redir.c:298 redirection_expand owns redirection word expansion).
Artifacts: target/issue-suites/results/gnusweep3/cat3/case/p017.; minimal target/issue-suites/results/gnusweep3/probes/min/m06-dup-procsub.

Activity

  1. added
    bug
    gnu-baseline
    on Sep 30, 2026
  2. added a commit that references this issue on Sep 30, 2026
  3. caomengxuan666 commented on Sep 30, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by wt20/deepsweep (edda851f): cat <& <(x) and 2>& <(x) now report <(echo x): ambiguous redirect rc=1 (redir.c:784-851, the >& fd1 r_err_and_out exception at :832-838).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions