🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #17113

Re: Odd Behavior with PGP verify

#17113
From: Julio Sanchez
Date: Fri, 18 Apr 1997 00:00
96 lines
3284 bytes
James Brister <brister@vix.com> writes:

> 
> Wolfgang Rupprecht <wolfgang@dailyplanet.wsrcc.com> writes:
> > cdent@kold.kiva.net (Chris Dent) writes:
> > > I'm using pgp 2.6.2 on Linux 2.0.29 (with Redhat 4.1) with INN 1.5.1 to
> > > verify control messages for the Big 8.
> > > Incoming control messages are dumped to badpgp.log and not run,
> > > however when I run the control message against ctlrun the message is
> > > accepted and the newgroup or rmgroup runs.
> > 
> > I'm seeing the same thing here.
> > 
> > I'm assuming its a $HOME/.pgp/pubring.pgp problem.  Perhaps INN-1.5.1
> > doesn't set $HOME?
> 
> It (inndstart) does, using the value of _PATH_NEWSHOME in config.data. If
> that's wrong, then PGP probably won't be happy.

In RedHat, it is /usr/lib/news.  So putting it there should work.

What I did, however, was to put it in /etc/news/.pgp and make links
from /usr/lib/news/.pgp *and* /var/lib/news/.pgp to that.  I didn't
really know which one fixed it, but one of them did.

The following script can be used to retry a control message that
failed.  It tries to reexecute as if it was newly received, so it is
useful to retry a control message after changing control.ctl or if you
have PGP path problems, but will not authorize a control message that
is forbidden by control-ctl.  Sanity checks should be better, since it
is vulnerable to traps in e-mail addresses and Path:, so be careful:

#!/usr/bin/perl

$path = $ARGV[0];

open (ART, $path) || die "Cannot open $path\n";
while (<ART>) {
	last if /^$/;
	if (/^path:\s*[^!]+!([^!]+)!/i) {
		$pathhost = $1;
		next;
	}
	if (/^from:\s*(.+)$/i) {
		$from = $1;
		next;
	}
	if (/^reply-to:\s*(.+)$/i) {
		$reply = $1;
		next;
	}
	if (/^control:\s*(\S+)/i) {
		$control = $1;
		next;
	}
}
close (ART);

if ( ! $reply ) {
	$reply = $from;
}

# Sanitize addresses

$from =~ s/\s*\(.+\)\s*//;
$from =~ s/\s*\".+\"\s*//;
$from =~ s/\s*<(.+)>\s*/$1/;
$reply =~ s/\s*\(.+\)\s*//;
$reply =~ s/\s*\".+\"\s*//;
$reply =~ s/\s*<(.+)>\s*/$1/;

# Check control trap

if ( $control !~ /^[A-Za-z]+$/ ) {
	print "Invalid control field: $control\n";
	exit 1
}

print "$control $from $reply $path $pathhost\n";

if ( -x "/usr/lib/news/bin/control/$control" ) {
	system("/usr/lib/news/bin/control/$control", $from, $reply,
		$path, $pathhost);
} else {
	printf "Unknown control $control\n";
	exit 1;
}

-- 
Julio Sanchez, SGI Soluciones Globales Internet
Tel: (91) 804 28 37 Fax: (91) 804 14 05  WWW: http://www.esegi.es
jsanchez@esegi.es jsanchez@gmv.es
 PGP Key fingerprint =  E5 29 93 6F 41 4E 00 E2  90 11 A1 8C 72 D0 DE 71 

Technical Details
Message-ID: <x0lo6glonl.fsf@pcjjsf.gmv.es>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <5j2sj6$q60$1@kold.kiva.net> <x7lo6i4pxf.fsf@capsicum.wsrcc.com>

Show Full Headers
Complete Article Headers
Message-ID: <x0lo6glonl.fsf@pcjjsf.gmv.es>
Subject: Re: Odd Behavior with PGP verify
Date: Fri, 18 Apr 1997 00:00:00 +0000
From: Julio Sanchez <jsanchez@esegi.es>
References: <5j2sj6$q60$1@kold.kiva.net> <x7lo6i4pxf.fsf@capsicum.wsrcc.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 235656767
Sender: jjsf@pcjjsf.gmv.es
Organization: GMV, SA., Tres Cantos, Spain
Newsgroups: news.software.nntp