mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-09 23:15:58 -06:00
Fix multiple issues where PasswordExecCommand was not working in server mode and PasswordExecCommand was not loaded when importing servers. #6792
This commit is contained in:
parent
2ab419c8a5
commit
a8ab714606
@ -491,7 +491,8 @@ def dump_database_servers(output_file, selected_servers,
|
||||
add_value(attr_dict, "ConnectionParameters",
|
||||
server.connection_params)
|
||||
|
||||
# if desktop mode
|
||||
# if desktop mode or server mode with
|
||||
# ENABLE_SERVER_PASS_EXEC_CMD flag is True
|
||||
if not current_app.config['SERVER_MODE'] or \
|
||||
current_app.config['ENABLE_SERVER_PASS_EXEC_CMD']:
|
||||
add_value(attr_dict, "PasswordExecCommand",
|
||||
@ -727,8 +728,10 @@ def load_database_servers(input_file, selected_servers,
|
||||
|
||||
new_server.kerberos_conn = obj.get("KerberosAuthentication", None)
|
||||
|
||||
# if desktop mode
|
||||
if not current_app.config['SERVER_MODE']:
|
||||
# if desktop mode or server mode with
|
||||
# ENABLE_SERVER_PASS_EXEC_CMD flag is True
|
||||
if not current_app.config['SERVER_MODE'] or \
|
||||
current_app.config['ENABLE_SERVER_PASS_EXEC_CMD']:
|
||||
new_server.passexec_cmd = obj.get("PasswordExecCommand", None)
|
||||
new_server.passexec_expiration = obj.get(
|
||||
"PasswordExecExpiration", None)
|
||||
|
@ -29,7 +29,7 @@ class PasswordExec:
|
||||
self.last_result = None
|
||||
|
||||
def get(self):
|
||||
if config.SERVER_MODE:
|
||||
if config.SERVER_MODE and not config.ENABLE_SERVER_PASS_EXEC_CMD:
|
||||
# Arbitrary shell execution on server is a security risk
|
||||
raise NotImplementedError('Passexec not available in server mode')
|
||||
with self.lock:
|
||||
|
Loading…
Reference in New Issue
Block a user