~mwilck/duplicity/duplicity

Viewing all changes in revision 1150.

  • Committer: Martin Wilck
  • Date: 2016-09-21 12:42:37 UTC
  • Revision ID: mwilck@freenet.de-20160921124237-d903pl7jzrguz52d
GPG: enable truly non-interactive operation with gpg2


GPG always tries to grab a passphrase from the gpg agent, even
if is run with "--batch --no-tty" (as enforced by the
meta_interactive = 0 setting of gpginterface.py).

Sometimes this behavior is not intended. I would like to be able
to run a backup job truly interactively. This would be possible,
but duplicity's check_manifests() function calls gpg to compare
the remote (encrypted) and local manifest, which, with gpg2,
will pop up the gpg agent pinentry every time I try to save backup
(with gpg1, duplicity will just give up on the verification).

I found that it's possible to force gpg2 to behave like gpg1 by
using the command line option "--pinentry-mode=cancel". My patch
applies this option if duplicity's "--use-agent" option is unset.

Now, even with gpg2, backups can be saved without any passphrase
dialog, at the cost of not being able to verify the manifests. Users
who want the verification would just need to use "--use-agent", as
with gpg1.

For restore, this change has no effect, as duplicity will ask for the
passphrase anyway if "--use-agent" is not specirfied.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: