Page MenuHome GnuPG

gpg --always-trust --quick-gen-key fails to create a trust database
Closed, ResolvedPublic

Description

obj $ export GNUPGHOME=$(mktemp -d) ; echo pinentry-program $(readlink -f
tests/openpgp/fake-pinentry) > $GNUPGHOME/gpg-agent.conf ; gpg2 --batch
--always-trust --quick-gen-key foo@bar.org
gpg: keybox '/tmp/tmp.tCwLVG661i/pubring.kbx' created
gpg: Fatal: can't open '/tmp/tmp.tCwLVG661i/trustdb.gpg': No such file or directory

Details

Version
2.1.15, master

Event Timeline

justus set Version to 2.1.15, master.
justus added a subscriber: justus.

actually it was a feature request that a trustdb is not created in case of
--always-trust. But sure, it should not error out.

justus claimed this task.

I have to refine my statement. We store the 'ultimateley trusted flag in the
trustdb and thus we require a trustdb when creating a new key. That is so that
we know the key has been created by us and is not an imported key.
Thus for most commands the trustdb should not be created but for key generation
it is better to safe that ultimately trusted flag in the trustdb.