fix change-passphrase crashing if repository is not encrypted

This commit is contained in:
Marian Beermann 2017-01-03 17:15:59 +01:00
parent 6a5b3018c1
commit 7519bf8100
2 changed files with 4 additions and 0 deletions

View file

@ -177,6 +177,9 @@ class Archiver:
@with_repository()
def do_change_passphrase(self, args, repository, manifest, key):
"""Change repository key file passphrase"""
if not hasattr(key, 'change_passphrase'):
print('This repository is not encrypted, cannot change the passphrase.')
return EXIT_ERROR
key.change_passphrase()
logger.info('Key updated')
return EXIT_SUCCESS

View file

@ -135,6 +135,7 @@ Bug fixes:
- When running out of buffer memory when reading xattrs, only skip the current file, #1993
- Fixed "borg upgrade --tam" crashing with unencrypted repositories. Since :ref:`the issue <tam_vuln>` is
not relevant for unencrypted repositories, it now does nothing and prints an error, #1981.
- Fixed change-passphrase crashing with unencrypted repositories, #1978
Version 1.0.9 (2016-12-20)
--------------------------