Open
Conversation
…c and private keys - and drop the hardcoded chgrp certpull
Contributor
Author
|
Friendly nudge @srhb :) |
Contributor
|
Sorry I missed and/or forgot this. My only comment is that,
Since we're not really using this backend I don't really have strong opinions, but since you're using modes now, maybe you do. The only safe way to do this is to set the mode on the open() call on a new file. iirc any handle obtained between open() and writing to the file will be able to read the contents as if the mode were whatever it was on the initial open(). Do you care about this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow being explicit about ownership and perms for public and private keys, and drop the hardcoded
chgrp certpull.It is now possible to set
cert_file_permsandkey_file_permsrespectively. Perms includeuser,groupandmode.If not set, defaults are:
644 (rw-r--r--), private key:600 (rw-------)cert_file_permsandkey_file_permswill not break existing setups, since if omitted, they will default to unchanged ownership and secure permissions. Private key mode is more restrictive than previously, since it is no longer assumed that the group (certpull) needs read-access.EDIT: oh, and also, file contents are now not flushed to the files until after permissions and ownership has been changed/set on the files.
Possible improvements of this PR:
We could change flat attributes:
_file_permsand_file_nametofile.permissionsandfile.name, e.g.We could also consider allowing
rwxrwxrwxstring syntax in the config file. Currently, only octal strings are accepted.Feel free to challenge my choices and defaults.