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

dir_ensure and file_ensure do securely create the given path with the given mode. #171

Open
thanatos opened this issue Mar 7, 2014 · 0 comments

Comments

@thanatos
Copy link

thanatos commented Mar 7, 2014

When creating potentially sensitive directories, dir_ensure and file_ensure do not create the file with the passed mode; instead, the create it and then chmod it to the appropriate attributes.

For directories, mkdir accepts -m, such as mkdir foo -m 700. For files, the umask can be temporarily changed with (umask 077 && cat >> new_file), though this is a bit more hacky.

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

No branches or pull requests

1 participant