summaryrefslogtreecommitdiff
path: root/tests/specs/permission/path_not_permitted
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-09-17 00:08:02 +0100
committerGitHub <noreply@github.com>2024-09-16 23:08:02 +0000
commitb0525edd6fb2fa414407ec73c981051d692d1c26 (patch)
tree0e21ef4b2667f6882d6c52f24d27cc26d3696403 /tests/specs/permission/path_not_permitted
parentf7ddea3af7a9f4dfef23aa544f05348dabbad20d (diff)
feat: warn when using `--allow-run` with no allow list (#25215)
Diffstat (limited to 'tests/specs/permission/path_not_permitted')
-rw-r--r--tests/specs/permission/path_not_permitted/main.out4
-rw-r--r--tests/specs/permission/path_not_permitted/main.ts7
-rw-r--r--tests/specs/permission/path_not_permitted/sub.ts6
3 files changed, 10 insertions, 7 deletions
diff --git a/tests/specs/permission/path_not_permitted/main.out b/tests/specs/permission/path_not_permitted/main.out
index b057d0a63..02e5b937f 100644
--- a/tests/specs/permission/path_not_permitted/main.out
+++ b/tests/specs/permission/path_not_permitted/main.out
@@ -1,10 +1,10 @@
Running...
-NotCapable: Requires run access to "deno", run again with the --allow-run flag
+NotCapable: Requires run access to "binary", run again with the --allow-run flag
[WILDCARD]
at file:///[WILDLINE]/sub.ts:15:5 {
name: "NotCapable"
}
-NotCapable: Requires run access to "deno", run again with the --allow-run flag
+NotCapable: Requires run access to "binary", run again with the --allow-run flag
[WILDCARD]
at file:///[WILDLINE]/sub.ts:23:22 {
name: "NotCapable"
diff --git a/tests/specs/permission/path_not_permitted/main.ts b/tests/specs/permission/path_not_permitted/main.ts
index 0cc141e7a..0587db916 100644
--- a/tests/specs/permission/path_not_permitted/main.ts
+++ b/tests/specs/permission/path_not_permitted/main.ts
@@ -1,4 +1,4 @@
-const binaryName = Deno.build.os === "windows" ? "deno.exe" : "deno";
+const binaryName = Deno.build.os === "windows" ? "binary.exe" : "binary";
Deno.copyFileSync(Deno.execPath(), binaryName);
console.log("Running...");
@@ -9,9 +9,12 @@ new Deno.Command(
"run",
"--allow-write",
"--allow-read",
- `--allow-run=deno`,
+ `--allow-run=binary`,
"sub.ts",
],
+ env: {
+ PATH: Deno.cwd(),
+ },
stderr: "inherit",
stdout: "inherit",
},
diff --git a/tests/specs/permission/path_not_permitted/sub.ts b/tests/specs/permission/path_not_permitted/sub.ts
index ea527a938..e501b5b7b 100644
--- a/tests/specs/permission/path_not_permitted/sub.ts
+++ b/tests/specs/permission/path_not_permitted/sub.ts
@@ -1,4 +1,4 @@
-const binaryName = Deno.build.os === "windows" ? "deno.exe" : "deno";
+const binaryName = Deno.build.os === "windows" ? "binary.exe" : "binary";
const pathSep = Deno.build.os === "windows" ? "\\" : "/";
Deno.mkdirSync("subdir");
@@ -6,7 +6,7 @@ Deno.copyFileSync(binaryName, "subdir/" + binaryName);
try {
const commandResult = new Deno.Command(
- "deno",
+ "binary",
{
env: { "PATH": Deno.cwd() + pathSep + "subdir" },
stdout: "inherit",
@@ -22,7 +22,7 @@ try {
try {
const child = Deno.run(
{
- cmd: ["deno"],
+ cmd: ["binary"],
env: { "PATH": Deno.cwd() + pathSep + "subdir" },
stdout: "inherit",
stderr: "inherit",