-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: permission prompt stuffing (#11931)
Fixes #9750
- Loading branch information
Showing
10 changed files
with
170 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
const status1 = | ||
(await Deno.permissions.request({ name: "run", command: "ls" })).state; | ||
if (status1 != "granted") { | ||
throw Error(`unexpected status1 ${status1}`); | ||
} | ||
const status2 = | ||
(await Deno.permissions.query({ name: "run", command: "cat" })).state; | ||
if (status2 != "prompt") { | ||
throw Error(`unexpected status2 ${status2}`); | ||
} | ||
const status3 = | ||
(await Deno.permissions.request({ name: "run", command: "cat" })).state; | ||
if (status3 != "denied") { | ||
throw Error(`unexpected status3 ${status3}`); | ||
} | ||
console.log(status1); | ||
console.log(status2); | ||
console.log(status3); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Run without permissions. | ||
const buf = new Uint8Array(1); | ||
console.log("Enter 'yy':"); | ||
await Deno.stdin.read(buf); | ||
await Deno.permissions.request({ "name": "env" }); | ||
console.log("\n\nOwned", Deno.env.get("SECRET")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters