Ensure sanity of the permissions on the storage and session directories and the config database. Fixes #4182

This commit is contained in:
Dave Page
2019-04-17 16:57:34 +01:00
parent 1a192109d6
commit d728ee7436
5 changed files with 43 additions and 1 deletions
+2
View File
@@ -21,12 +21,14 @@ def create_app_data_directory(config):
"""
# Create the directory containing the configuration file (if not present).
_create_directory_if_not_exists(os.path.dirname(config.SQLITE_PATH))
os.chmod(os.path.dirname(config.SQLITE_PATH), 0o700)
# Create the directory containing the log file (if not present).
_create_directory_if_not_exists(os.path.dirname(config.LOG_FILE))
# Create the session directory (if not present).
_create_directory_if_not_exists(config.SESSION_DB_PATH)
os.chmod(os.path.dirname(config.SESSION_DB_PATH), 0o700)
# Create the storage directory (if not present).
_create_directory_if_not_exists(config.STORAGE_DIR)