diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-05-10 11:21:36 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-10 11:21:36 -0600 |
commit | adc7b3de2695a1371a5179329b4a5aa90a3aef84 (patch) | |
tree | cce4a582c39d834f54b60c4d8dd7c09d24971ccc /tests/specs/permission/proc_self_fd/main.js | |
parent | a9708037c9e333104bfdfe0ccadbc40395809c39 (diff) |
fix(runtime): Allow opening /dev/fd/XXX for unix (#23743)
`deno run script.ts <(some command)` is a valid use case -- let's allow
this to work without `--allow-all`.
Fixes #23703
Diffstat (limited to 'tests/specs/permission/proc_self_fd/main.js')
-rw-r--r-- | tests/specs/permission/proc_self_fd/main.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/specs/permission/proc_self_fd/main.js b/tests/specs/permission/proc_self_fd/main.js new file mode 100644 index 000000000..86d8334cb --- /dev/null +++ b/tests/specs/permission/proc_self_fd/main.js @@ -0,0 +1,18 @@ +// This test is Linux/Darwin only +if (Deno.build.os !== "linux" && Deno.build.os !== "darwin") { + console.log("hi\n\n0"); + Deno.exit(123); +} + +const cmd = new Deno.Command("/usr/bin/env", { + args: [ + "bash", + "-c", + [Deno.execPath(), "run", "--allow-read", "reader.ts", '<(echo "hi")'].join( + " ", + ), + ], +}).spawn(); + +console.log((await cmd.status).code); +Deno.exit(123); |