← Back to team overview

duplicity-team team mailing list archive

[Bug 379386] Re: Fix 'list-current-files' with missing archive dir

 

** Branch linked: lp:duplicity

-- 
Fix 'list-current-files' with missing archive dir
https://bugs.launchpad.net/bugs/379386
You received this bug notification because you are a member of
duplicity-team, which is subscribed to duplicity.

Status in duplicity - Bandwidth Efficient Encrypted Backup: Fix Committed

Bug description:
When running 'list-current-files' using '--archive-dir' when the archive dir doesn't exist, the commands fails with an encryption error.

Steps to reproduce;

 $ mkdir source
 $ touch source/test
 $ duplicity source backup
 $ mkdir cache
 $ duplicity list-current-files --archive-dir ./cache backup
  ===== Begin GnuPG log =====
  gpg: CAST5 encrypted data
  gpg: encrypted with 1 passphrase
  gpg: decryption failed: bad key
  ===== End GnuPG log ====

This is because there is an 'early out' in the password handling that checks to see if we are running 'list-current-files' with a local archive, in which case it doesn't ask for the password. This is wrong in this case because even though the archive exists, it doesn't have any signature files.

The attached patch moves the password querying to separate module which only asks the user for the password when it is required. As the signature file class correctly falls back to the backend when the files aren't available in the cache, this fixes the bug (as well as removes a bunch of special case checks for when the password needs to be read).