🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #5241

INN: fix: handle bogus Message-IDs in cancel/supersedes

#5241
From: James Crawford Ralston
Date: Sat, 24 Feb 1996 00:00
59 lines
2557 bytes
In article <4gi617$l1e@augusta.math.psu.edu>,
Dave Barr <barr@math.psu.edu> wrote:
> Looks like some bozo tried to cancel multiple articles with one post.
> Someone want to fix art.c and post a patch?

I've tested the following patch, and it appears to work.

There are probably other places where INN's treatment of Message-IDs
is a bit more lax than it should be, but corrupting the history file
is a showstopper.

Note that this patch *doesn't* allow INN to handle multiple
Message-IDs in the Supersedes header.  This is arguably broken.  But
then again, INN couldn't handle multiple Message-IDs in the Supersedes
header before, either, and making it do so isn't trivial.

*** art.c.old	Sat May 21 23:25:42 1994
--- art.c	Fri Feb 23 19:52:18 1996
***************
*** 1191,1196 ****
  	for (p = &Control[6]; ISWHITE(*p); p++)
  	    continue;
! 	if (*p)
  	    ARTcancel(Data, p, FALSE);
  	return;
      }
--- 1191,1202 ----
  	for (p = &Control[6]; ISWHITE(*p); p++)
  	    continue;
! 	if (*p) {
! 	    if (!ARTidok(p)) {
! 		syslog(L_NOTICE, "%s bad Message-ID \"%s\" %s",
! 		       LogName, Control, Data->Name);
! 		return;
! 	    }
  	    ARTcancel(Data, p, FALSE);
+ 	}
  	return;
      }
***************
*** 2076,2079 ****
--- 2082,2091 ----
  	p = HDR(_supersedes);
  	if (*p)
+ 	  /* XXX  This does not handle Supersedes headers with
+            * multiple Message-IDs.  It probably should. */
+ 	  if (!ARTidok(p)) 
+ 	    syslog(L_NOTICE, "%s bad Supersedes Message-ID \"%s\" %s",
+ 		   LogName, p, Data.Name);
+ 	  else
  	    ARTcancel(&Data, p, FALSE);
      }

-- 
James Crawford Ralston \ Newsmaster for the University of Pittsburgh [CIS/S&N]
news+@pitt.edu \ http://www.pitt.edu/~news/ \ +1 412 624 2717 (voice)
+1 412 624 8888 (Problem Reporting) \ +1 412 624 9356 (User Consulting)

Technical Details
Message-ID: <4glod6$lhi@usenet.srv.cis.pitt.edu>
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: <312C76E6.11B7@cc.in2p3.fr> <4gi617$l1e@augusta.math.psu.edu>

Show Full Headers
Complete Article Headers
Message-ID: <4glod6$lhi@usenet.srv.cis.pitt.edu>
Subject: INN: fix: handle bogus Message-IDs in cancel/supersedes
Date: Sat, 24 Feb 1996 00:00:00 +0000
From: qralston+@pitt.edu (James Crawford Ralston)
References: <312C76E6.11B7@cc.in2p3.fr> <4gi617$l1e@augusta.math.psu.edu>
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: 140801046
Distribution: inet
Organization: University of Pittsburgh [CIS]
Reply-to: news+@pitt.edu (Usenet News Administrators)
Newsgroups: news.software.nntp