fix: do special file permission check for check_read_path (#27989)

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Divy Srivastava 2025-02-12 21:16:21 +05:30 committed by GitHub
parent 7253820764
commit cda0c5b3ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 116 additions and 33 deletions

View file

@ -1692,6 +1692,15 @@ Deno.test({ permissions: { read: false } }, async function fetchFilePerm() {
}, Deno.errors.NotCapable);
});
Deno.test(
{ permissions: { read: true }, ignore: Deno.build.os !== "linux" },
async function fetchSpecialFilePerm() {
await assertRejects(async () => {
await fetch("file:///proc/self/environ");
}, Deno.errors.NotCapable);
},
);
Deno.test(
{ permissions: { read: false } },
async function fetchFilePermDoesNotExist() {