mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Set PGPASSWORD environment variable from the process executor before running
the external utility.
This commit is contained in:
@@ -289,10 +289,17 @@ def execute(configs):
|
||||
# Update start time
|
||||
update_configs(args)
|
||||
|
||||
if args['pid'] in os.environ:
|
||||
os.environ['PGPASSWORD'] = os.environ[args['pid']]
|
||||
|
||||
process = Popen(
|
||||
command, stdout=PIPE, stderr=PIPE, stdin=PIPE,
|
||||
shell=(os.name == 'nt'), close_fds=(os.name != 'nt')
|
||||
)
|
||||
try:
|
||||
del(os.environ['PGPASSWORD'])
|
||||
except:
|
||||
pass
|
||||
|
||||
# Attach the stream to the process logger, and start logging.
|
||||
process_stdout.attach_process_stream(process, process.stdout)
|
||||
|
||||
Reference in New Issue
Block a user