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:
@@ -174,7 +174,7 @@ class BackupMessage(IProcessDesc):
|
||||
res += ' ' + arg
|
||||
elif replace_next:
|
||||
res += ' "' + cgi.escape(
|
||||
os.path.join('<STORAGE_DIR>', self.bfile)
|
||||
self.bfile
|
||||
).encode('ascii', 'xmlcharrefreplace') + '"'
|
||||
else:
|
||||
if arg == '--file':
|
||||
@@ -299,6 +299,7 @@ def create_backup_job(sid):
|
||||
),
|
||||
cmd=utility, args=args
|
||||
)
|
||||
manager.export_password_env(p.id)
|
||||
p.start()
|
||||
jid = p.id
|
||||
except Exception as e:
|
||||
@@ -443,6 +444,7 @@ def create_backup_objects_job(sid):
|
||||
BACKUP.OBJECT, sid, data['file'], database=data['database']
|
||||
),
|
||||
cmd=utility, args=args)
|
||||
manager.export_password_env(p.id)
|
||||
p.start()
|
||||
jid = p.id
|
||||
except Exception as e:
|
||||
|
||||
@@ -120,9 +120,9 @@ class RestoreMessage(IProcessDesc):
|
||||
idx += 1
|
||||
|
||||
if no_args > 1:
|
||||
res += ' "' + cgi.escape(
|
||||
os.path.join('<STORAGE_DIR>', self.bfile) + '"'
|
||||
).encode('ascii', 'xmlcharrefreplace')
|
||||
res += ' "' + cgi.escape(self.bfile).encode(
|
||||
'ascii', 'xmlcharrefreplace'
|
||||
) + '"'
|
||||
|
||||
res += '</i></div>'
|
||||
|
||||
@@ -300,6 +300,7 @@ def create_restore_job(sid):
|
||||
desc=RestoreMessage(sid, data['file']),
|
||||
cmd=utility, args=args
|
||||
)
|
||||
manager.export_password_env(p.id)
|
||||
p.start()
|
||||
jid = p.id
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user