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: fix EACCES error on access by root user #369

Merged
merged 1 commit into from Oct 28, 2022

Conversation

danielkatz
Copy link
Contributor

This PR comes to fix an error with the access function what does not implement a check for a root user. To fix this I'm reusing the logic already implemented in canRead, canWrite and canExecute functions (I've also added tests for those cases in item.spec.js).
I've added test for the error case to bindings.spec.js.

P.S. Since, there is no mocking library currently used in the project, so i've used a manual method to mock process.getuid and process.getgid functions which can easily be replaced by any mocking library.

@3cp
Copy link
Collaborator

3cp commented Oct 28, 2022

Thx!
LGTM.

@3cp 3cp requested a review from tschaub October 28, 2022 07:29
@3cp 3cp unassigned tschaub Oct 28, 2022
@tschaub tschaub merged commit 642863a into tschaub:main Oct 28, 2022
@tschaub
Copy link
Owner

tschaub commented Oct 28, 2022

Thanks, @danielkatz. Your fix is available in the v5.2.0 release.

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.

None yet

3 participants