denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
95.48k stars 5.3k forks source link

Permissions incorrectly treat `\\?\` paths as distinct #18597

Open wojpawlik opened 1 year ago

wojpawlik commented 1 year ago

This can be easily seen on Windows by running

> deno repl --allow-read=.
Deno 1.32.3
exit using ctrl+d, ctrl+c, or close()
> // lists current directory; no permission prompt
> Array.from(Deno.readDirSync(Deno.cwd()))
[]
>
> // lists the same directory; unexpected permission prompt
> Array.from(Deno.readDirSync('\\\\?\\' + Deno.cwd()))
✅ Granted read access to "\\?\C:\Users\Student\Empty".
[]

It becomes a problem (https://github.com/fromdeno/deno2node/pull/39) right here: https://github.com/denoland/deno/blob/34d596e04f49400ed6460e03461e21c441bcb5dd/ext/node/polyfills/_fs/_fs_chmod.ts#L28

ghost commented 1 year ago

This seems to be a none issue in 1.33.3 on Windows 11 with the replication steps.