Skip to content
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

Fix path normalization in resolve_from_cwd() #2875

Merged
merged 4 commits into from Sep 7, 2019

Conversation

@nayeemrmn
Copy link
Contributor

commented Sep 7, 2019

Fixes #2718.

test.js:

Deno.readDirSync("..");
console.log("OK");

deno --no-prompt --allow-read="." test.js
Before: OK
After: error: Uncaught PermissionDenied: permission denied ...

@nayeemrmn nayeemrmn force-pushed the nayeemrmn:path-normalization branch from a93a8e7 to 23424c7 Sep 7, 2019
@ry

This comment has been minimized.

Copy link
Collaborator

commented Sep 7, 2019

Cool - but is there some way we can get a unit test for this?

@nayeemrmn nayeemrmn force-pushed the nayeemrmn:path-normalization branch 2 times, most recently from edde8dc to abc5e9b Sep 7, 2019
@nayeemrmn nayeemrmn force-pushed the nayeemrmn:path-normalization branch from abc5e9b to d0ff8e3 Sep 7, 2019
@nayeemrmn

This comment has been minimized.

Copy link
Contributor Author

commented Sep 7, 2019

@ry Done. I wanted to add something to permissions.rs as well, but the whitelist checker in there assumes paths that are already normalised (which is handled prior in individual ops via resolve_from_cwd()) so they'd still fail. This could do with a refactor.

cli/fs.rs Outdated Show resolved Hide resolved
cli/fs.rs Show resolved Hide resolved
@ry

This comment has been minimized.

Copy link
Collaborator

commented Sep 7, 2019

Looks good - just a few comments --^

@ry
ry approved these changes Sep 7, 2019
Copy link
Collaborator

left a comment

LGTM

@ry ry merged commit 718c8c4 into denoland:master Sep 7, 2019
3 checks passed
3 checks passed
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
@nayeemrmn nayeemrmn deleted the nayeemrmn:path-normalization branch Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.