Fix file permissions#470
Merged
HelloZeroNet merged 2 commits intoHelloZeroNet:masterfrom May 27, 2016
Merged
Conversation
added 2 commits
May 26, 2016 15:59
Files users.json and sites.json contains private key
Only the owner of these files should have access to them
Current coverage is 48.46%@@ master #470 diff @@
==========================================
Files 55 55
Lines 6573 6579 +6
Methods 0 0
Messages 0 0
Branches 1385 1379 -6
==========================================
+ Hits 3177 3188 +11
Misses 2993 2993
+ Partials 403 398 -5
|
Owner
|
Thanks! |
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.
I noticed that the files
data/users.jsonanddata/sites.jsonhave the permissions644which means everybody can read them, even if they contain private keys. So I changed these files' permissions to600to ensure that only their owner can read them (as ssh does for its private keys).I also modified the function
atomicWriteso that the file permissions are preserved (they were reset to644each time).