backups: Don't send passphrase on the command line

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
Sunil Mohan Adapa authored and Joseph Nuthalapati committed 2019-07-03 12:44:54 +05:30
1 parent fa3e2ea86b
commit dd5d93637f
4 files changed
+66 -85

No files matched your search

+1 -4
View File
@@ -146,10 +146,7 @@ def _append_borg_arguments(arguments, credentials):
kwargs = {}
passphrase = credentials.get('encryption_passphrase', None)
if passphrase:
arguments += ['--encryption-passphrase', passphrase]
if 'ssh_password' in credentials and credentials['ssh_password']:
kwargs['input'] = credentials['ssh_password'].encode()
kwargs['input'] = json.dumps({'encryption_passphrase': passphrase})
if 'ssh_keyfile' in credentials and credentials['ssh_keyfile']:
arguments += ['--ssh-keyfile', credentials['ssh_keyfile']]