🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #2899

Re: Judges who cancel posts that threaten to overload Netnews

#2899
From: Dave Hayes
Date: Fri, 09 Sep 1994 22:18
232 lines
7523 bytes
grobe@ins.infonet.net (Jonathan Grobe) writes:
>   The JUDGES-L list distributes messages to a panel of judges that
>   cancel multiple posts to Network News immediately.  The list is used
>   to help judges organize themselves, finalize policy, and set
>   procedures to enforce rules.  It is primarily directed to those who
>   issue cancels.  Secondarily, to those who survey cancels issued, in
>   order to ensure that the cancel facility is not being abused.
>   General policy discussion is conducted in the UseNet newsgroup
>   news.admin.policy.  A periodic post in that newsgroup gives the
>   current policy consensus.

Sigh.

Here's my answer to this. Dave's Cancel Patches. Apply if you have INN.

*** innd/art.c.orig	Mon Aug  9 15:03:43 1993
--- innd/art.c	Thu Aug 12 12:48:42 1993
***************
*** 1077,1087 ****
--- 1077,1109 ----
      register char	*local;
      char		*head;
      char		buff[SMBUF];
+     
  
      files = HISfilesfor(MessageID);
      if ((head = ARTreadheader(files)) == NULL)
  	return NULL;
  
+ /* 
+  * Dave's Cancel Patches - I wanted more control over parsing cancel messages! 
+  * So, this patch first checks to see if they are ALL disabled, and then 
+  * checks in NEWSLIB/badpaths to see if the paths header "wildmats" a line in 
+  * there.
+  */
+     /* Cancels enabled? */
+     FileGlue(buff, _PATH_NEWSLIB, '/', "cancel_enable");
+     if (access(buff,0) != 0) {
+       syslog(L_NOTICE,"Cancels are disabled: '%s'",MessageID);
+       return NULL;
+     }
+ 
+     /* Now check the paths stuff */
+     if (ARTBadCancelPath(p = HeaderFind(head,"Path",4))) {
+       syslog(L_NOTICE, "Bad cancel path detected: %s",p);
+       return NULL;
+     }
+ 
+ /* END of Dave's Cancel Patches */
+ 
      /* Get the author header. */
      if ((local = HeaderFind(head, "Sender", 6)) == NULL
       && (local = HeaderFind(head, "From", 4)) == NULL) {
***************
*** 1103,1108 ****
--- 1125,1175 ----
      DISPOSE(p);
      return files;
  }
+ 
+ static char         *badpaths = NULL;
+ 
+ ARTReloadCancelPaths() {
+   if (badpaths != NULL) { DISPOSE(badpaths); badpaths = NULL; }
+ }
+     
+ 
+ BOOL
+ ARTBadCancelPath(Path) 
+     char                *Path;
+ {
+     register char       *p,*q;
+     char		buff[SMBUF];
+     unsigned long       len;
+ 
+     /* Read in the badpaths file once if necessary. */
+     if (badpaths == NULL) {
+       FileGlue(buff, _PATH_NEWSLIB, '/', "bad_cancel_paths");
+       badpaths = ReadInFile(buff,NULL);
+       if (badpaths == NULL) return FALSE;
+     }
+ 
+     /* Now check each line against the path */
+     for (p = badpaths; (p != NULL && (*p) != '\0'); ) {
+ 
+       /* Copy pattern, stripping whitespace (and I can't use strtok) */
+       if ((q = strpbrk(p,"\n\t ")) == NULL) {
+         strcpy(buff,p);
+ 	p = NULL;
+       } else {
+ 	len = ((unsigned long) q) - ((unsigned long) p);
+ 	strncpy(buff,p,((int) len)); buff[len] = '\0';
+ 	p = strchr(p,'\n'); p++;
+       }
+ 
+       /* Ignore comments and blank lines */
+       if (buff[0] == '#' || buff[0] == '\0') continue;  
+ 
+       if (wildmat(Path,buff)) return FALSE;
+     }
+     
+     return TRUE;
+ }
+         
  #endif	/* defined(DO_VERIFY_CANCELS) */
  
  
***************
*** 1188,1198 ****
      /* See if it's a cancel message. */
      c = *Control;
      if (c == 'c' && EQn(Control, "cancel", 6)) {
! 	for (p = &Control[6]; ISWHITE(*p); p++)
! 	    continue;
! 	if (*p)
! 	    ARTcancel(Data, p, FALSE);
! 	return;
      }
  
      /* Nip off the first word into lowercase. */
--- 1255,1265 ----
      /* See if it's a cancel message. */
      c = *Control;
      if (c == 'c' && EQn(Control, "cancel", 6)) {
!       for (p = strtok(&Control[6], " \t"); p;
! 	   p = strtok((char *)NULL, " \t"))
! 	if(ARTidok(p))
! 	  ARTcancel(Data, p, FALSE);
!       return;
      }
  
      /* Nip off the first word into lowercase. */
*** innd/cc.c.orig	Tue Aug 10 19:48:20 1993
--- innd/cc.c	Tue Aug 10 19:52:39 1993
***************
*** 1024,1029 ****
--- 1024,1030 ----
  	HISsetup();
  	ICDwrite();
  	ICDsetup(TRUE);
+ 	ARTReloadCancelPaths();
  	if (!ARTreadschema())
  	    return BADSCHEMA;
  	p = "all";
***************
*** 1039,1044 ****
--- 1040,1047 ----
      }
      else if (EQ(p, "hosts.nntp"))
  	RCreadlist();
+     else if (EQ(p, "bad_cancel_paths"))
+ 	ARTReloadCancelPaths();
      else if (EQ(p, "overview.fmt")) {
  	if (!ARTreadschema())
  	    return BADSCHEMA;
*** site/innlog.awk.orig	Mon Aug 16 10:55:13 1993
--- site/innlog.awk	Mon Aug 16 10:54:21 1993
***************
*** 15,20 ****
--- 15,22 ----
      innd_bad_msgids = 0;
      innd_bad_sendmes = 0;
      innd_blockeds = 0;
+     innd_cancel_rejects = 0;
+     innd_cancel_paths = 0;
      innd_change_groups = 0;
      innd_newgroups = 0;
      innd_pauses = 0;
***************
*** 196,201 ****
--- 198,220 ----
  	next;
      }
  
+ #
+ # Dave's cancel stuff
+     if ( $6 == "Cancels" && $7 == "are" && $8 == "disabled:") {
+ 	innd_cancel_rejects++;
+ 	next;
+     }
+ 
+     if ( $6 == "Bad" && $7 == "cancel" && $8 == "path") {
+ 	innd_cancel_rejects++;
+ 	innd_cancel_paths++;
+ 	badpath = $10;
+ 	cancel_rejects[badpath]++; 
+ 	next;
+     }
+ # 
+ #
+ 
      if ( $6 ~ /.*:.*/ ) {
  	n = split($6, path, ":");
  	host = path[1];
***************
*** 865,870 ****
--- 884,908 ----
      }
  
      ##  Miscellaneous innd statistics.
+     if (innd_cancel_rejects) {
+ 	printf("INND rejected %d cancels.\n",innd_cancel_rejects);
+ 	if (innd_cancel_paths) {
+ 		for ( ; ; ) {	
+ 			s = invalid;
+ 		    for (sortindex in cancel_rejects)
+ 			if (cancel_rejects[sortindex] >= 0 && sortindex < s)
+ 			    s = sortindex;
+ 		    if (s == invalid)
+ 			break;
+ 	
+ 		    printf("%5d with path %s\n", cancel_rejects[s],s);
+ 	
+ 		    cancel_rejects[s] = -1;
+ 		}
+         }
+ 	printf("\n");
+     }
+ 
      if (innd_bad_msgids) {
  	printf("Bad Message-ID's offered\n");
  	for ( ; ; ) {
-- 
Dave Hayes - Institutional Network & Communications - JPL/NASA - Pasadena CA
dave@elxr.jpl.nasa.gov       dave@jato.jpl.nasa.gov         ...usc!elroy!dxh

A certain conqueror said to Nasrudin: "Mulla, all the great rulers of the 
past had honorific titles with the name of God in them: there was, for
instance, God-Gifted, God-Accepted, God-Sent, and so on. How about such a
name for me?"
"God Forbid." said Nasrudin. 
Technical Details
Message-ID: <34qmvq$110@elxr.jpl.nasa.gov>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.misc.mbox.zip!nntp.gmd.de!xlink.net!howland.reston.ans.net!paladin.american.edu!europa.eng.gtefsd.com!gatech!swrinde!elroy.jpl.nasa.gov!netline-fddi.jpl.nasa.gov!usenet
References: <34ooaq$51h@insosf1.infonet.net>

Show Full Headers
Complete Article Headers
Message-ID: <34qmvq$110@elxr.jpl.nasa.gov>
Subject: Re: Judges who cancel posts that threaten to overload Netnews
Date: Fri, 09 Sep 1994 22:18:34 +0000
From: dave@elxr.jpl.nasa.gov (Dave Hayes)
References: <34ooaq$51h@insosf1.infonet.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.misc.mbox.zip!nntp.gmd.de!xlink.net!howland.reston.ans.net!paladin.american.edu!europa.eng.gtefsd.com!gatech!swrinde!elroy.jpl.nasa.gov!netline-fddi.jpl.nasa.gov!usenet
Newsgroups: news.admin.misc,news.software.nntp
Organization: Jet Propulsion Laboratory - Pasadena CA
Lines: 231
Distribution: inet
NNTP-Posting-Host: elxr-fddi.jpl.nasa.gov
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit