Skip to content

Commit

Permalink
Set permission to 600 for some files
Browse files Browse the repository at this point in the history
    Files users.json and sites.json contains private key
    Only the owner of these files should have access to them
  • Loading branch information
Thibaut Broggi committed May 26, 2016
1 parent a10e803 commit 9e9832a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Included modules
import os
import sys
import stat
import time
import logging

Expand Down Expand Up @@ -33,8 +34,10 @@
os.mkdir(config.data_dir)
if not os.path.isfile("%s/sites.json" % config.data_dir):
open("%s/sites.json" % config.data_dir, "w").write("{}")
os.chmod("%s/sites.json" % config.data_dir, stat.S_IRUSR | stat.S_IWUSR)
if not os.path.isfile("%s/users.json" % config.data_dir):
open("%s/users.json" % config.data_dir, "w").write("{}")
os.chmod("%s/users.json" % config.data_dir, stat.S_IRUSR | stat.S_IWUSR)

# Setup logging
if config.action == "main":
Expand Down

0 comments on commit 9e9832a

Please sign in to comment.