1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-01 04:37:34 +00:00

fix crash with relative BORG_KEY_FILE, fixes #3197

(cherry picked from commit 7136e2c93c)
This commit is contained in:
Thomas Waldmann 2017-10-20 21:13:11 +02:00
parent 40186a3ffc
commit 6d67a9f874

View file

@ -695,7 +695,7 @@ def find_key(self):
id = self.repository.id
keyfile = os.environ.get('BORG_KEY_FILE')
if keyfile:
return self.sanity_check(keyfile, id)
return self.sanity_check(os.path.abspath(keyfile), id)
keys_dir = get_keys_dir()
for name in os.listdir(keys_dir):
filename = os.path.join(keys_dir, name)
@ -708,7 +708,7 @@ def find_key(self):
def get_new_target(self, args):
keyfile = os.environ.get('BORG_KEY_FILE')
if keyfile:
return keyfile
return os.path.abspath(keyfile)
filename = args.location.to_key_filename()
path = filename
i = 1