[PATCH] gpg: Need to init the trustdb for import.

Kristian Fiskerstrand kristian.fiskerstrand at sumptuouscapital.com
Wed Aug 13 16:16:50 CEST 2014

* g10/trustdb.c (clear_ownertrusts): Init trustdb.

- --
This was fixed in 1.4 branch in commit
23191d7851eae2217ecdac6484349849a24fd94a but was not applied to the
2.0 branch that exhibits the same problem. This is actually a hack
to fix a bug introduced with commit 2528178.

GnuPG-bug-id: 1622

- --

This can e.g. be imported using a test case such as A=$(mktemp -d);
export A; echo ${A} && gpg2 --export 0x0B7F8B60E3EDFAE3 | gpg2
--trust-model=always --homedir ${A} --import

which caused issues with caff for some users. Although it fixes this
case I notice that something is still wrong when trying to generate a
new key in this scenario

$ A=$(mktemp -d); export A; gpg2 --trust-model=always --homedir ${A}
--batch --gen-key <<EOF
> Key-Type: RSA
> Key-Length: 1024
> Name-Real: Joe Tester
> Name-Email: joe at foo.bar
> %commit
gpg: keyring `/tmp/tmp.9WKDtaTkg5/secring.gpg' created
gpg: keyring `/tmp/tmp.9WKDtaTkg5/pubring.gpg' created
gpg: Fatal: can't open `/tmp/tmp.9WKDtaTkg5/trustdb.gpg': No such file
or directory

I havent tested if this is also an issue for the 1.4 branch for these
purposes, but will see if I can around to that later this week.

Kristian Fiskerstrand
Blog: http://blog.sumptuouscapital.com
Twitter: @krifisk
Public OpenPGP key 0xE3EDFAE3 at hkp://pool.sks-keyservers.net
fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3
Aut dosce, aut disce, aut discede
Either teach, or study, or leave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnupg-2.0.26-Need-to-init-the-trustdb-for-import.patch
Type: text/x-patch
Size: 895 bytes
Desc: not available
URL: </pipermail/attachments/20140813/964d7351/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20140813/964d7351/attachment.sig>

More information about the Gnupg-devel mailing list