mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 17:57:59 +00:00
Merge pull request #2576 from enkore/pr/2573+split
BORG_PASSCOMMAND: use same cmd-string splitting as BORG_RSH
This commit is contained in:
commit
1b66d8d109
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import configparser
|
||||
import getpass
|
||||
import os
|
||||
import shlex
|
||||
import sys
|
||||
import textwrap
|
||||
import subprocess
|
||||
|
@ -430,7 +431,7 @@ def env_passcommand(cls, default=None):
|
|||
passcommand = os.environ.get('BORG_PASSCOMMAND', None)
|
||||
if passcommand is not None:
|
||||
try:
|
||||
passphrase = subprocess.check_output(passcommand.split(), universal_newlines=True)
|
||||
passphrase = subprocess.check_output(shlex.split(passcommand), universal_newlines=True)
|
||||
except (subprocess.CalledProcessError, FileNotFoundError) as e:
|
||||
raise PasscommandFailure(e)
|
||||
return cls(passphrase.rstrip('\n'))
|
||||
|
|
Loading…
Reference in a new issue