Fix 'list-current-files' with missing archive dir

Bug #379386 reported by Henry Ludemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

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).

Revision history for this message
Henry Ludemann (misc-hl) wrote :
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

This was fixed in 0.6.1 with the addition of automatic archive sync at startup.

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.6.1
status: New → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
Revision history for this message
Henry Ludemann (misc-hl) wrote :

Just tested with a clean version of 0.6.01; this is still broken (follow the steps listed in the initial comment, but fix the url used for the backup path). eg:

 $ mkdir source
 $ touch source/test
 $ duplicity source file://`pwd`/backup
 $ mkdir cache
 $ duplicity list-current-files --archive-dir ./cache file://`pwd`/backup

The password handling code in 0.6.01 still does the early out when running 'list-current-files', which is incorrect when the archive dir doesn't exist.

The previously attached fix no longer applies due to the changes in the password handling in 0.6.01.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Will take another look at your patch and see if there are other problems. We've been down the password problem road a bunch in previous revisions, lots of borked releases due to password complexity issues.

Changed in duplicity:
assignee: nobody → Kenneth Loafman (kenneth-loafman)
milestone: 0.6.01 → 0.6.02
status: Fix Released → Confirmed
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote : Re: [Bug 379386] Re: Fix 'list-current-files' with missing archive dir

This will fix this issue and others that have empty archive dirs and
encrypted remote storage.

Changed in duplicity:
assignee: Kenneth Loafman (kenneth-loafman) → nobody
status: Confirmed → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.