🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #37444

Re: INN 2.2-stable path verification patch

#37444
From: Andrew Gierth
Date: Thu, 13 May 1999 00:00
41 lines
2195 bytes
>>>>> "AG" == Andrew Gierth <andrew@erlenstar.demon.co.uk> writes:

 AG> + 
 AG> +     switch (RCpathmismatch(cp, hops[0]))
 AG> +     {
 AG> + 	case 0:
 AG> + 	    /* all kosher. */
 AG> + 	    Data.PathExtraLength = 0;
 AG> + 	    break;
 AG> + 
 AG> + 	case 1:
 AG> + 	{
 AG> + 	    /* expected a match; got none. Complain (but only once per connect) */
 AG> + 	    char *adr = inet_ntoa(cp->Address);
 AG> + 	    if (!cp->Mismatches++)
 AG> + 		syslog(L_NOTICE, "path mismatch from %s (claimed to be %s)", adr, hops[0]);
 AG> + 	    sprintf(Data.PathExtra, "%s.MISMATCH!", adr);
 AG> + 	    Data.PathExtraLength = strlen(Data.PathExtra);
 AG> + 	    break;
 AG> + 	}
 AG> + 
 AG> + 	default:
 AG> + 	    /* didn't expect a match, so add a plain IP address. */
 AG> + 	    sprintf(Data.PathExtra, "%s!", inet_ntoa(cp->Address));
 AG> + 	    Data.PathExtraLength = strlen(Data.PathExtra);
 AG> + 	    break;
 AG> +     }
 AG> + 

It turns out that I had put this block of code too soon; posts with
duplicate Path headers (which are rejected of course) tend to cause
spurious 'path mismatch' warnings. I've moved it down to just before
the Perl filter now.

Incidentally, the handling of Path headers in INN seems to be getting
very crufty (and this patch of course doesn't improve that).

-- 
Andrew.

Technical Details
Message-ID: <87ogjp7pfy.fsf@erlenstar.demon.co.uk>
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: <87n1zgnfu6.fsf@erlenstar.demon.co.uk>

Show Full Headers
Complete Article Headers
Message-ID: <87ogjp7pfy.fsf@erlenstar.demon.co.uk>
Subject: Re: INN 2.2-stable path verification patch
Date: Thu, 13 May 1999 00:00:00 +0000
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
References: <87n1zgnfu6.fsf@erlenstar.demon.co.uk>
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: 477236100
X-Mayan-Date: Long count = 12.19.6.3.7; tzolkin = 10 Manik; haab = 15 Uo
X-Complaints-To: andrew@erlenstar.demon.co.uk
Organization: disorganised
X-Attribution: AG
X-Pgp-0x0E9FFBE9: 87 25 7F 14 41 24 B3 51 E0 19 8B DE 49 74 0C 29
X-P-Persistent-Headers: are a bad idea.
Newsgroups: news.software.nntp
X-Post-Filter: postfilter v0.6 alpha