summaryrefslogtreecommitdiff
path: root/obnamlib/encryption.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@sid>2013-12-01 19:30:50 +0000
committerLars Wirzenius <liw@sid>2013-12-01 19:30:50 +0000
commit872bc7581f4d9ad326acf6965a6f43f19328991d (patch)
treea19478064afa26119eeb090c5b86a32d3e562340 /obnamlib/encryption.py
parent5808b7ef98e189b37171158e7ca95ff055b14864 (diff)
downloadobnam-872bc7581f4d9ad326acf6965a6f43f19328991d.tar.gz
Create a trustdb.gpg in temp GNUPGHOME
From version 2.0.22 or so, gpg insists on having a trustdb.gpg in the GNUPGHOME. Create it when we set up the temporary GNUPHOME during encryption operations, by importing an empty ownertrust file.
Diffstat (limited to 'obnamlib/encryption.py')
-rw-r--r--obnamlib/encryption.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/obnamlib/encryption.py b/obnamlib/encryption.py
index 9fa849a9..1d7643bc 100644
--- a/obnamlib/encryption.py
+++ b/obnamlib/encryption.py
@@ -168,6 +168,10 @@ class Keyring(object):
f = open(self._keyring, 'wb')
f.write(self._encoded)
f.close()
+ _gpg(['--import-ownertrust'], stdin='''\
+# List of assigned trustvalues, created Sun 01 Dec 2013 19:13:26 GMT
+# (Use "gpg --import-ownertrust" to restore them)
+''', gpghome=self._gpghome)
def _cleanup(self):
shutil.rmtree(self._gpghome)