Repository navigation
Conversation
btcd.log is created with mode 0644 by the logrotate package, so it is readable by other local users wherever its directory allows it. The log holds peer addresses. Set the process umask to 077 on Unix before any file is created, as Bitcoin Core does. New files are then created private to the user. Existing files keep their modes. This includes rpc.cert, which umask 022 made 0644 until now. A client running as another user needs access to it some other way, such as a copy or group permissions.
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.
btcd creates
btcd.logwith mode 0644 through the logrotate package, so other local users can read it wherever its directory allows, and the log holds peer addresses.rpc.certis 0644 for the same reason.This sets the process umask to 077 in an
init()on Unix, before any file is created, as Bitcoin Core does. New files are then created private to the user, and existing files keep their modes. This includesrpc.cert, which becomes 0600, so a client running as another user then needs access to it some other way, such as a copy or group permissions.TestFileModescreates the log and the RPC key and certificate in a child process started under umask 022, so the result does not depend on the caller's umask, and asserts each file is 0600.Closes #2645