diff --git a/borg/archiver.py b/borg/archiver.py index 973ea6f7a..1adbba895 100644 --- a/borg/archiver.py +++ b/borg/archiver.py @@ -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 diff --git a/docs/changes.rst b/docs/changes.rst index ae471af86..301246004 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -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 ` 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) --------------------------