Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Create directories with execute permissions so they can be opened #395

Merged
merged 2 commits into from
Aug 27, 2018

Conversation

arafferty
Copy link
Contributor

get-certs currently fails with a permission denied after it creates new directories because MkdirAll is using 0644 instead of 0755. This PR resolves that.

@captncraig
Copy link
Contributor

captncraig commented Aug 25, 2018 via email

@arafferty
Copy link
Contributor Author

Ubuntu 16.04 on ext4. Same behavior on OS X. My bet is that your tests are being run with root permissions (docker? Windows?). The execute bit has to be set on directories in order for users to be able to enter and access files inside that directory (https://superuser.com/questions/168578/why-must-a-folder-be-executable). root obviously gets to ignore this detail.

What this means is that the MkdirAll call creates the certs directory but then subsequently fails when run as a non-root user when it tries to do anything inside of that directory (I haven't checked but my guess is that it tries to list the contents of the directory to see if it needs to create the next directory in the tree and fails).

0700 seems like a perfectly reasonable setting so that non-root users can still interact with the directory. I was just copying the generally permissive setting on the files themselves. While I'm fiddling with permissions should I also change it so that the files themselves are created as 0600?

@tlimoncelli
Copy link
Contributor

0700 seems reasonable to me.

@tlimoncelli tlimoncelli merged commit 402fc44 into StackExchange:master Aug 27, 2018
rblenkinsopp pushed a commit to rblenkinsopp/dnscontrol that referenced this pull request Aug 21, 2020
…ned (StackExchange#395)

* Create directories with execute permissions so they can be opened
* Use 0700 permissions on certificate directories instead of 0755
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants