-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Deno.cwd() permission problems #27080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Moreover, there is already a way (related to Node compatibility) to get the path to the CWD without any permissions, so having |
@0f-0b What's that way to get the CWD without any permissions that you're referring to? Both |
import Module from "node:module";
console.log(Module._nodeModulePaths("a")[0].slice(0, -15)); |
Yeah, we know about this one. We were supposed to get rid of the |
Version: Deno 2.1.1
cwd.ts:
This requires
--allow-read
permission (which I already think is a stretch):But if I deny even a single file in the same directory, I cannot use it anymore:
Actually a lot of scenarios don't work..
This messes up file permissions pretty badly, because
path.resolve()
will trigger this, so any library that calls it (a lot of them) will force you to remove granular permissions and just use-A
.Why does cwd get this treatment? It's not reading the contents of any file. It's not even listing files within a directory. In its current state it would be better to remove the
--allow-read
requirement all-together than keeps its current behavior, because the current behavior forces you to compromise your other permissions.The text was updated successfully, but these errors were encountered: