Create XDG_CONFIG_HOME with safe permissions

"If, when attempting to write a file, the destination directory is non-existant an attempt should be made to create it with permission 0700."

https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
This commit is contained in:
Tobias Umbach 2018-12-06 11:34:40 +01:00 committed by GitHub
parent 6f840e4b4c
commit 4362f1f372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -352,7 +352,7 @@ class ConfigurationGetter(object):
def _getXdgConfigHome(self):
path = os.getenv('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
if not os.path.isdir(path):
os.mkdir(path, 0o755)
os.mkdir(path, 0o700)
return path
def _parseConfigFile(self, iniPath, createConfig=True):