diff --git a/docs/en_US/release_notes_4_7.rst b/docs/en_US/release_notes_4_7.rst index 0f7e718e4..2c044047e 100644 --- a/docs/en_US/release_notes_4_7.rst +++ b/docs/en_US/release_notes_4_7.rst @@ -24,4 +24,5 @@ Bug fixes | `Bug #4246 `_ - Fixed console error when subnode control is used in panels. | `Bug #4261 `_ - Stop using application/x-javascript as a mime type and use the RFC-compliant application/javascript instead. | `Bug #4262 `_ - Fixed error on displaying table properties of a table partitioned by list having a default partition. -| `Bug #4269 `_ - Fix navigation of switch cells in grids. \ No newline at end of file +| `Bug #4269 `_ - Fix navigation of switch cells in grids. +| `Bug #4276 `_ - Relax the permission check on the directory containing the config database, as it may fail in some environments such as OpenShift. \ No newline at end of file diff --git a/web/pgadmin/setup/data_directory.py b/web/pgadmin/setup/data_directory.py index 8e9ca3211..300dc7847 100644 --- a/web/pgadmin/setup/data_directory.py +++ b/web/pgadmin/setup/data_directory.py @@ -8,6 +8,7 @@ ########################################################################## import os +from flask import current_app def _create_directory_if_not_exists(_path): @@ -21,7 +22,15 @@ 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) + # 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. + try: + os.chmod(os.path.dirname(config.SQLITE_PATH), 0o700) + except Exception as e: + # The flask app isn't setup yet, so we can't use the logger + print('WARNING: Failed to set ACL on the directory containing the ' + 'configuration database: {}'.format(e)) # Create the directory containing the log file (if not present). _create_directory_if_not_exists(os.path.dirname(config.LOG_FILE))