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: readdir should check for access rights, fixes #294 #295

Merged
merged 3 commits into from
Apr 21, 2020

Conversation

warpdesign
Copy link

@warpdesign warpdesign commented Apr 20, 2020

This PR adds access checks to readdirand readdirSync calls.

This should fix #294

@tschaub
Copy link
Owner

tschaub commented Apr 20, 2020

Thanks for the proposed fix, @warpdesign. Now that tests are run in a GitHub workflow (see #296), you'll need to rebase.

@3cp
Copy link
Collaborator

3cp commented Apr 20, 2020

Your fixed check reminded us there are three existing this.access(..., parseInt('0002', 8)); should be refactored, or at least replace hard coded parseInt('0002', 8) with constants.W_OK.

@warpdesign
Copy link
Author

@tschaub I made the rebase and added err.code check as suggested by @3cp

@tschaub tschaub merged commit 1d13c92 into tschaub:master Apr 21, 2020
@tschaub
Copy link
Owner

tschaub commented Apr 21, 2020

Thanks, @warpdesign.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fs.readdir doesn't fail if directory cannot be accessed
3 participants