Gpgverify assumes wrong default gnupg setup (with patch)

Toon van der Pas toon at hout.vanvergehaald.nl
Sat Feb 28 12:08:07 UTC 2004


Hi,

I'm running inn-STABLE-20040118.
The way gpgverify is programmed, everybody will have to edit it
in order to get it working, even when the gnupg setup is completely
standard. However, a comment line in gpgverify suggests that it was
meant to function out-of-the-box in case of a standard gnupg setup.
Here is that comment:

# if you keep your keyring somewhere that is not the default used by gpg,
# set appropriately the next line.

Well, I had to set the next line in spite of my default gnupg setup.
Below is a patch that should make gpgverify work in the default case.
Two things are changed in the modified line:

- We assume that the keyring directory is a subdirectory of the
  home directory of user news, instead of a subdirectory of newsetc.

- The default name of the keyring directory is '.gnupg', instead of
  'pgp'

This is the gpgverify debug output before the patch:

news at news checkgroups $ /usr/local/news/bin/gpgverify < 1177
gpgv: keyblock resource `/usr/local/news/etc/pgp/pubring.gpg': file open error
gpgv: Signature made Sun Feb 15 17:00:02 2004 CET using RSA key ID B88DA9C1
[GNUPG:] ERRSIG C25D3AD3B88DA9C1 1 1 01 1076860802 9
[GNUPG:] NO_PUBKEY C25D3AD3B88DA9C1
gpgv: Can't check signature: public key not found

This is the gpgverify debug output after the patch:

news at news checkgroups $ /usr/local/news/bin/gpgverify < 1177
gpgv: Signature made Sun Feb 15 17:00:02 2004 CET using RSA key ID B88DA9C1
[GNUPG:] SIG_ID MTAJJXdVmJ7O+prpJCJ2pxxUvsA 2004-02-15 1076860802
[GNUPG:] GOODSIG C25D3AD3B88DA9C1 news.announce.newgroups
gpgv: Good signature from "news.announce.newgroups"
[GNUPG:] VALIDSIG F53558D35564101407C69553136FD407 2004-02-15 1076860802 0 3 0 1 1 01 F53558D35564101407C69553136FD407
news.announce.newgroups

Regards,
Toon.

Note: the patch is possibly damaged by copy/paste.

--- gpgverify.org       2004-02-28 12:36:24.422563361 +0100
+++ gpgverify   2004-02-28 12:39:18.813535672 +0100
@@ -17,7 +17,7 @@
  
 # if you keep your keyring somewhere that is not the default used by gpg,
 # set appropriately the next line.
-my $keyring = ($inn::newsetc ? $inn::newsetc . '/pgp/' : '') . 'pubring.gpg';
+my $keyring = ($inn::newshome ? $inn::newshome . '/.gnupg/' : '') . 'pubring.gpg';
  
 # If you have INN and the script is able to successfully include your
 # innshellvars.pl file, the value of the next two variables will be

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan


More information about the inn-workers mailing list