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

Return permissions error directly #130

Merged
merged 1 commit into from Nov 11, 2017
Merged

Return permissions error directly #130

merged 1 commit into from Nov 11, 2017

Conversation

rylandg
Copy link
Contributor

@rylandg rylandg commented Nov 10, 2017

We decided that we wouldn't wrap unixy errors ourselves.

@@ -123,7 +123,7 @@
steps:
- in: bn init -p /home/dockeruser/test/securedir
out: |-
bn: Permission denied writing to path: /home/dockeruser/test/securedir*
bn: EACCES: permission denied, unlink '/home/dockeruser/test/securedir/function.js'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the first privileged operation we do unlink?

Copy link
Contributor Author

@rylandg rylandg Nov 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To copy our template function.js file to the users function directory we use the copy method in fs-extra. Looking at the source code here I can see that they use fs.unlink to ensure that there is no other file handle in the location where the user wants the file copied.

Funny enough here's an issue currently in progress to replace unlink with rename

@rylandg rylandg merged commit f5a0f83 into master Nov 11, 2017
@rylandg rylandg deleted the real-permission-error branch November 11, 2017 20:34
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

2 participants