1
0
Fork 0
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:
enkore 2017-05-31 19:41:42 +02:00 committed by GitHub
commit 1b66d8d109

View file

@ -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'))