use a tmpfile for trustdb.gpg in apt-key
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 11 Aug 2013 22:19:10 +0000 (00:19 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 12 Aug 2013 16:01:37 +0000 (18:01 +0200)
commitf9e64e7bb0c125b54f0699d9e08956a88b467a7f
treecb85210daabe3dde0ec33a05de190022c1933f2e
parentc0a013221d296e97d68b4e9a66fef5c886d2bbb0
use a tmpfile for trustdb.gpg in apt-key

for some "interesting" reason gpg decides that it needs to update its
trustdb.gpg file in a --list-keys command even if right before gpg is
asked to --check-trustdb. That wouldn't be as bad if it wouldn't modify
the keyring being listed at that moment as well, which generates not
only warnings which are not a problem for us, but as the keyring
modified can be in /usr it modified files which aren't allowed to be
modified.

The suggested solution in the bugreport is running --check-trustdb
unconditionally in an 'apt-key update' call, but this command will not
be used in the future and this could still potentially bite us in
net-update or adv calls. All of this just to keep a file around, which
we do not need…

The commit therefore switches to the use of a temporary created
trusted.gpg file for everyone and asks gpg to not try to update the
trustdb after its intial creation, which seems to avoid the problem
altogether.

It is using your also faked secring btw as calling the check-trustdb
without a keyring is a lot slower …

Closes: #687611
Thanks: Andreas Beckmann for the initial patch!
cmdline/apt-key
debian/apt.postinst