corrupt trustdb caused by commandline?

Atom Smasher atom at
Tue May 9 03:11:49 CEST 2006

this is weird...

i can run this:
 	gpg --list-public-keys smasher ; echo $?
all day long, and everything is fine (returns 0).

but when i close stdout:
 	gpg --list-public-keys smasher 1>&- ; echo $?

it works once and corrupts my trustdb. running it again returns "2".

   gpg: /home/atom/.gnupg/trustdb.gpg: invalid record type 112 at recnum 1

if i change the "1" to a "2" (closing stderr instead of stdout), it works 
fine. if i omit the "1" and leave it implied (still closing stdout) it 
still causes problems.

this is even weirder... this works fine:
 	{ gpg --list-public-keys smasher ; } ; echo $?
but this causes problems:
 	{ gpg --list-public-keys smasher ; } >&- ; echo $?

why on earth would gpg choke because i'm redirecting stdout *outside* of 
the curly braces??

i've only noticed this since upgrading to 1.4.3. i was previously running 
1.4.2 and the didn't have any problems with the exact same command.

gnupg-1.4.3 (libiconv-1.9.2_2, gettext-0.14.5_2)


  762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808

 	"Be who you are and say what you feel, because those who
 	 mind don't matter and those who matter don't mind."
 		-- Dr. Seuss

More information about the Gnupg-devel mailing list