[news.sysadmin] netnews cancer FIX!

dhp@att.ATT.COM (Price) (10/11/88)

As many of you are aware, there are, at the time of this posting, three
rouge articles ping-ponging around the net.  These articles are cancerous.
That is, they replicate without limit due to a tab character embedded in the
article ID.  A tab is also the field separator in the history file, causing
the article recognition code to continue to accept the duplicate article.

The articles in question are generating thousands of duplicate articles
in rec.games.hack, misc.test and sci.space.shuttle.

Here follows an EMERGENCY PATCH for header.c that corrects the weakness
in the netnews history mechanism that permits this to happen.

At approximately line 160 of header.c, insert the declaration for char *cp:

register struct hbuf *hp;
{
	int	unreccnt = 0;
	register int	i;
> 	register char *cp;

	i = type(bfr);

At approximately line 200, insert the for() loop code after getfield has
collected the article ID from the header:

		case MESSAGEID:
			getfield(hp->ident, sizeof(hp->ident));
> 			for (cp = hp->ident; *cp != '\0'; cp++)
> 				if (*cp == '\t')
> 					*cp = ' ';
			break;

This will translate all tabs in the message ID into spaces, which will 
prevent the history mechanism from failing to note the duplicate article.

Hopefully, an official patch will follow from the POWERS THAT BE.
-- 

						Douglas H. Price
						Postmaster, att
						att!dhp

gdb@ninja.UUCP (David Butler) (10/12/88)

In article <165@att.ATT.COM> dhp@att.ATT.COM (Price) writes:
->At approximately line 200, insert the for() loop code after getfield has
->collected the article ID from the header:
->
->		case MESSAGEID:
->			getfield(hp->ident, sizeof(hp->ident));
->> 			for (cp = hp->ident; *cp != '\0'; cp++)
->> 				if (*cp == '\t')
->> 					*cp = ' ';
->			break;
->
->This will translate all tabs in the message ID into spaces, which will 
->prevent the history mechanism from failing to note the duplicate article.

DO NOT DO THIS!!  I've tried this one and then other things break that
depend on spaces to seperate parts of commands, like cancel messages!!!

You will find my fix else where in this group (news.software.b).

I should have also logged the action (space removal)
or perhaps just junked the article altogether!! :-)

====================|==========================================================
G. David Butler II  | "There is nothing good or bad, but thinking makes it so."
gdb@ninja.UUCP      | -Shakespeare

eric@snark.UUCP (Eric S. Raymond) (10/12/88)

In article <165@att.att.com>, dhp@att.ATT.COM (Price) writes:
> Here follows an EMERGENCY PATCH for header.c that corrects the weakness
> in the netnews history mechanism that permits this to happen.
> 
> Hopefully, an official patch will follow from the POWERS THAT BE.

The *permanent* fix that will go into 3.0 is to smash tabs and spaces out
of the ID field entirely. There's no reason to leave the space in there.
-- 
      Eric S. Raymond                     (the mad mastermind of TMN-Netnews)
      UUCP: ...!{uunet,att,rutgers}!snark!eric = eric@snark.UUCP
      Post: 22 S. Warren Avenue, Malvern, PA 19355      Phone: (215)-296-5718

dhp@att.ATT.COM (Price) (10/13/88)

In article <14854@ninja.UUCP>, gdb@ninja.UUCP (David Butler) writes:
> In article <165@att.ATT.COM> dhp@att.ATT.COM (Price) writes:
> ->This will translate all tabs in the message ID into spaces,
> 
> DO NOT DO THIS!!  I've tried this one and then other things break that
> depend on spaces to seperate parts of commands, like cancel messages!!!

Luckily, while true, this will only break cancels for articles with message
IDs that contain tabs.  Meanwhile, this fix held off the worst of the damage
on the AT&T part of the backbone.  I await the official patch with 
Antici---------Pation!
-- 

						Douglas H. Price
						Postmaster, att
						att!dhp