mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 16:02:33 +03:00
Only warn about config.py perms if there's sensitive info
This commit is contained in:
parent
3825e5aebe
commit
f0b66cee92
1 changed files with 5 additions and 4 deletions
|
@ -47,10 +47,6 @@ def read_config(opts, config_file='config.py'):
|
|||
print "Missing config file - is this a repo directory?"
|
||||
sys.exit(2)
|
||||
|
||||
st = os.stat(config_file)
|
||||
if st.st_mode & stat.S_IRWXG or st.st_mode & stat.S_IRWXO:
|
||||
print "WARNING: unsafe permissions on {0} (should be 0600)!".format(config_file)
|
||||
|
||||
options = opts
|
||||
if not hasattr(options, 'verbose'):
|
||||
options.verbose = False
|
||||
|
@ -72,6 +68,11 @@ def read_config(opts, config_file='config.py'):
|
|||
print "Reading %s..." % config_file
|
||||
execfile(config_file, config)
|
||||
|
||||
if any(k in config for k in ["keystore", "keystorepass", "keypass"]):
|
||||
st = os.stat(config_file)
|
||||
if st.st_mode & stat.S_IRWXG or st.st_mode & stat.S_IRWXO:
|
||||
print "WARNING: unsafe permissions on {0} (should be 0600)!".format(config_file)
|
||||
|
||||
# Expand environment variables
|
||||
for k, v in config.items():
|
||||
if type(v) != str:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue