Tarsnap / tarsnap

Command-line client code for Tarsnap.
https://tarsnap.com
Other
867 stars 60 forks source link

cachedir should warn about using the wrong key #137

Open gperciva opened 8 years ago

gperciva commented 8 years ago

First mentioned in http://mail.tarsnap.com/tarsnap-users/msg00294.html

Test case:

$ ./tarsnap --keyfile ~/wrong-keys.txt -c -f wrong-keys ~/backup
tarsnap: Sequence number mismatch: Run --fsck
tarsnap: Error creating new archive
tarsnap: Error exit delayed from previous errors.

We should have a more useful error -- in this case, running --fsck isn't actually the best fix, since that'll wreck the cache directory for the real key. Instead, we should be warning that it's the wrong keyfile.

cperciva commented 8 years ago

This isn't currently possible, since there's nothing in the cache directory which identifies which keyfile was used. But it may be possible to fix this at the same time as we gain support for sharing a cache directory between keys.