mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Don't try to set permissions on Windows. It won't work anyway. Fixes #4276
This commit is contained in:
@@ -338,6 +338,7 @@ def create_app(app_name=None):
|
||||
set_version(CURRENT_SCHEMA_VERSION)
|
||||
db.session.commit()
|
||||
|
||||
if os.name != 'nt':
|
||||
os.chmod(config.SQLITE_PATH, 0o600)
|
||||
|
||||
Mail(app)
|
||||
|
||||
@@ -25,6 +25,7 @@ def create_app_data_directory(config):
|
||||
# Try to set the permissions on the direectory, but don't complain
|
||||
# if we can't. This may be the case on a mounted directory, e.g. in
|
||||
# OpenShift. We'll still secure the config database anyway.
|
||||
if os.name != 'nt':
|
||||
try:
|
||||
os.chmod(os.path.dirname(config.SQLITE_PATH), 0o700)
|
||||
except Exception as e:
|
||||
@@ -37,6 +38,7 @@ def create_app_data_directory(config):
|
||||
|
||||
# Create the session directory (if not present).
|
||||
_create_directory_if_not_exists(config.SESSION_DB_PATH)
|
||||
if os.name != 'nt':
|
||||
os.chmod(os.path.dirname(config.SESSION_DB_PATH), 0o700)
|
||||
|
||||
# Create the storage directory (if not present).
|
||||
|
||||
@@ -369,6 +369,7 @@ def setup_db():
|
||||
version.value = CURRENT_SCHEMA_VERSION
|
||||
db.session.commit()
|
||||
|
||||
if os.name != 'nt':
|
||||
os.chmod(config.SQLITE_PATH, 0o600)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user