🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
8 messages
8 total messages Started by John T. Stapleton Thu, 16 May 1996 00:00
A patch for INN to stop sending unwanted newsgroups
#7671
Author: John T. Stapleton
Date: Thu, 16 May 1996 00:00
672 lines
19417 bytes

Here are patches to prevent unwanted newsgroups being sent to your news
neighbors even when the article is cross-posted to a subscribed newsgroup.
It is indicated by prefixing the newsgroup pattern with two exclamation
marks as was suggested in this newsgroup at some earlier time.

For example:

	alt.*,!!alt.binaries.*

will not send the article if it is posted to an alt.binaries newsgroup
and cross-posted to another alt group which is not an alt.binaries
newsgroup.  As with other patterns in the subscription list, the order
is important if the patterns overlap.  It is not important if the
patterns don't overlap.  The order doesn't matter in the following
example because the patterns don't overlap:

	biz.*,!!clari.*

I have been running this for only a few days on one of my two servers.
One of my servers is for distributing news only (i.e. no readers) and
the other is fed exclusively by the first server.

Stapes

*** doc/newsfeeds.5.orig	Thu May 16 15:39:42 EDT 1996
--- doc/newsfeeds.5	Thu May 16 16:00:42 EDT 1996
***************
*** 94,99 ****
--- 94,123 ----
  but this would not have the same effect if there were a
  ``comp.sources-only'' group.
  .PP
+ If a pattern begins with two exclamation marks, it means that any article
+ posted to a group matching the pattern will not be sent even though the
+ article may be cross-posted to a group which is subscribed.  For example, to
+ send all "biz" groups, but do not send articles posted in a "biz" group if 
+ it is cross-posted to a "clari" group, the following set of patterns can be
+ used:
+ .RS
+ .nf
+ biz.*,!!clari.*
+ .fi
+ .RE
+ The order of the above does not matter because the two patterns can never
+ overlap.  The following would matter:
+ .RS
+ .nf
+ alt.*,!!alt.binaries.warez.*,misc.*
+ .fi
+ .RE
+ If you reverse the alt.* and alt.binaries.warez.* patterns, it would
+ nullify the double exclamation marks because the result of the last
+ match is the one that counts.  Using the above example, if an article
+ is posted to one or more of the alt.binaries.warez.* groups and is
+ cross-posted to misc.test, then the article is not sent.
+ .PP
  See
  .IR innd (8)
  for details on the propagation of control messages.
*** innd/art.c.orig	Thu Mar 18 16:04:21 EST 1993
--- innd/art.c	Sun Apr 14 15:54:45 EDT 1996
***************
*** 1392,1397 ****
--- 1392,1414 ----
  
  
  /*
+ **  Check is site doesn't want this group even if it's crossposted
+ **  to a wanted group.
+ */
+ STATIC void
+ ARTunwantthegroup(name)
+     register char	*name;
+ {
+     register SITE	*sp;
+     register int	i;
+ 
+     for (sp = Sites, i = nSites; --i >= 0; sp++)
+ 	if (sp->Name != NULL && SITEunwantsgroup(sp, name))
+ 	    sp->Unwant = TRUE;
+ }
+ 
+ 
+ /*
  ** Assign article numbers to the article and create the Xref line.
  ** If we end up not being able to write the article, we'll get "holes"
  ** in the directory and active file.
***************
*** 1766,1771 ****
--- 1783,1789 ----
      for (i = nGroups, ngp = Groups; --i >= 0; ngp++)
  	ngp->PostCount = 0;
      for (i = nSites, sp = Sites; --i >= 0; sp++) {
+ 	sp->Unwant = FALSE;
  	sp->Sendit = FALSE;
  	sp->Seenit = FALSE;
  	sp->FNLnames.Used = 0;
***************
*** 1830,1835 ****
--- 1848,1854 ----
  		ARTsendthegroup(*groups);
  		Accepted = TRUE;
  	    }
+ 	    ARTunwantthegroup(*groups);
  
  #if	defined(DO_MERGE_TO_GROUPS)
  	    /* Try to collapse all "to" newsgroups. */
***************
*** 1860,1871 ****
  	    return buff;
  	}
  
  	/* Valid group, feed it to that group's sites. */
  	Accepted = TRUE;
  	for (isp = ngp->Sites, i = ngp->nSites; --i >= 0; isp++)
  	    if (*isp >= 0) {
  		sp = &Sites[*isp];
! 		SITEmark(sp, ngp);
  	    }
  
  	/* If it's excluded, don't file it. */
--- 1879,1896 ----
  	    return buff;
  	}
  
+ 	/* See if any of this group's sites unwants this group. */
+ 	for (isp = ngp->Unwant, i = ngp->nUnwant; --i >= 0; isp++)
+ 	    if (*isp >= 0)
+ 		Sites[*isp].Unwant = TRUE;
+ 
  	/* Valid group, feed it to that group's sites. */
  	Accepted = TRUE;
  	for (isp = ngp->Sites, i = ngp->nSites; --i >= 0; isp++)
  	    if (*isp >= 0) {
  		sp = &Sites[*isp];
! 		if (!sp->Unwant)
! 		    SITEmark(sp, ngp);
  	    }
  
  	/* If it's excluded, don't file it. */
***************
*** 1880,1885 ****
--- 1905,1915 ----
  	j += ngp->NameLength + 1 + MAXARTFNAME + 1;
      }
  
+     /* Loop over sites to find Unwants and undo Sendit flags. */
+     for (i = nSites, sp = Sites; --i >= 0; sp++)
+ 	if (sp->Unwant)
+ 	    sp->Sendit = FALSE;		
+ 
      /* Control messages not filed in "to" get filed only in controlname
       * or control. */
      if (ControlHeader >= 0 && Accepted && !ToGroup) {
***************
*** 1941,1947 ****
  	for (isp = ngp->Sites, i = ngp->nSites; --i >= 0; isp++)
  	    if (*isp >= 0) {
  		sp = &Sites[*isp];
! 		SITEmark(sp, ngp);
  	    }
      }
      *ngptr = NULL;
--- 1971,1978 ----
  	for (isp = ngp->Sites, i = ngp->nSites; --i >= 0; isp++)
  	    if (*isp >= 0) {
  		sp = &Sites[*isp];
! 		if (!sp->Unwant)
! 		    SITEmark(sp, ngp);
  	    }
      }
      *ngptr = NULL;
*** innd/cc.c.orig	Thu Mar 18 16:04:22 EST 1993
--- innd/cc.c	Sun Apr 14 13:46:03 EDT 1996
***************
*** 246,251 ****
--- 246,252 ----
      register NEWSGROUP	*ngp;
      STRING		error;
      char		*subbed;
+     char		*unwanted;
  
      /* If site already exists, drop it. */
      if (SITEfind(av[0]) != NULL && (p = CCdrop(av)) != NULL)
***************
*** 274,281 ****
  	    nSites++;
  	    RENEW(Sites, SITE, nSites);
  	    sp = &Sites[nSites - 1];
! 	    for (i = nGroups, ngp = Groups; --i >= 0; ngp++)
  		RENEW(ngp->Sites, int, nSites);
  	}
  	SITElinkall();
      }
--- 275,284 ----
  	    nSites++;
  	    RENEW(Sites, SITE, nSites);
  	    sp = &Sites[nSites - 1];
! 	    for (i = nGroups, ngp = Groups; --i >= 0; ngp++) {
  		RENEW(ngp->Sites, int, nSites);
+ 		RENEW(ngp->Unwant, int, nSites);
+ 	    }
  	}
  	SITElinkall();
      }
***************
*** 282,289 ****
  
      /* Parse. */
      subbed = NEW(char, nGroups);
!     error = SITEparseone(p, sp, subbed);
      DISPOSE(subbed);
      if (error != NULL) {
  	DISPOSE(p);
  	syslog(L_ERROR, "%s bad_newsfeeds %s", av[0], error);
--- 285,294 ----
  
      /* Parse. */
      subbed = NEW(char, nGroups);
!     unwanted = NEW(char, nGroups);
!     error = SITEparseone(p, sp, subbed, unwanted);
      DISPOSE(subbed);
+     DISPOSE(unwanted);
      if (error != NULL) {
  	DISPOSE(p);
  	syslog(L_ERROR, "%s bad_newsfeeds %s", av[0], error);
***************
*** 400,406 ****
      fake.Buffer.Size = 0;
      fake.Buffer.Data = NULL;
      for (errors = 0, i = 0; (p = strings[i]) != NULL; i++) {
! 	if ((error = SITEparseone(p, &fake, (char *)NULL)) != NULL) {
  	    syslog(L_ERROR, "%s bad_newsfeeds %s", MaxLength(p, p), error);
  	    errors++;
  	}
--- 405,411 ----
      fake.Buffer.Size = 0;
      fake.Buffer.Data = NULL;
      for (errors = 0, i = 0; (p = strings[i]) != NULL; i++) {
! 	if ((error = SITEparseone(p, &fake, (char *)NULL, (char *)NULL)) != NULL) {
  	    syslog(L_ERROR, "%s bad_newsfeeds %s", MaxLength(p, p), error);
  	    errors++;
  	}
***************
*** 436,446 ****
      SITEdrop(sp);
  
      /* Loop over all groups, and if the site is in a group, clobber it. */
!     for (idx = sp - Sites, i = nGroups, ngp = Groups; --i >= 0; ngp++)
  	for (j = ngp->nSites, ip = ngp->Sites; --j >= 0; ip++)
  	    if (*ip == idx)
  		*ip = NOSITE;
! 
  	return NULL;
  }
  
--- 441,454 ----
      SITEdrop(sp);
  
      /* Loop over all groups, and if the site is in a group, clobber it. */
!     for (idx = sp - Sites, i = nGroups, ngp = Groups; --i >= 0; ngp++) {
  	for (j = ngp->nSites, ip = ngp->Sites; --j >= 0; ip++)
  	    if (*ip == idx)
  		*ip = NOSITE;
! 	for (j = ngp->nUnwant, ip = ngp->Unwant; --j >= 0; ip++)
! 	    if (*ip == idx)
! 		*ip = NOSITE;
!     }
  	return NULL;
  }
  
*** innd/innd.h.orig	Wed Jun 14 11:48:27 EDT 1995
--- innd/innd.h	Sun Apr 14 15:49:30 EDT 1996
***************
*** 170,175 ****
--- 170,177 ----
      char		*Rest;
      int			nSites;
      int			*Sites;
+     int			nUnwant;
+     int			*Unwant;
      struct _NEWSGROUP	*Alias;
  } NEWSGROUP;
  
***************
*** 199,204 ****
--- 201,207 ----
      char		**Exclusions;
      char		**Distributions;
      char		**Patterns;
+     BOOL		Unwant;
      BOOL		Sendit;
      BOOL		Seenit;
      BOOL		DistRequired;
***************
*** 510,515 ****
--- 513,519 ----
  extern BOOL		SITEfunnelpatch();
  extern BOOL		SITEsetup();
  extern BOOL		SITEwantsgroup();
+ extern BOOL		SITEunwantsgroup();
  extern char		**SITEreadfile();
  extern SITE		*SITEfind();
  extern SITE		*SITEfindnext();
*** innd/newsfeeds.c.orig	Thu Mar 18 16:04:29 EST 1993
--- innd/newsfeeds.c	Sun Apr 14 17:39:30 EDT 1996
***************
*** 104,123 ****
  **  Modify "subbed" according to the patterns in "patlist."
  */
  STATIC void
! SITEsetlist(patlist, subbed)
      char		**patlist;
      char		*subbed;
  {
      register char	*pat;
      register char	*p;
      register char	subvalue;
      register NEWSGROUP	*ngp;
      register int	i;
  
      while ((pat = *patlist++) != NULL) {
  	subvalue = *pat != SUB_NEGATE;
! 	if (!subvalue)
  	    pat++;
  
  	/* See if pattern is a simple newsgroup name.  If so, set the
  	 * right subbed element for that one group (if found); if not,
--- 104,131 ----
  **  Modify "subbed" according to the patterns in "patlist."
  */
  STATIC void
! SITEsetlist(patlist, subbed, unwanted)
      char		**patlist;
      char		*subbed;
+     char		*unwanted;
  {
      register char	*pat;
      register char	*p;
+     register char	*u;
      register char	subvalue;
+     register char	unwantvalue;
      register NEWSGROUP	*ngp;
      register int	i;
  
      while ((pat = *patlist++) != NULL) {
  	subvalue = *pat != SUB_NEGATE;
! 	unwantvalue = FALSE;
! 	if (!subvalue) {
  	    pat++;
+ 	    unwantvalue = *pat == SUB_NEGATE;
+ 	    if (unwantvalue)
+ 		pat++;
+ 	}
  
  	/* See if pattern is a simple newsgroup name.  If so, set the
  	 * right subbed element for that one group (if found); if not,
***************
*** 127,139 ****
  		break;
  	if (*p == '\0') {
  	    /* Simple string; look it up, set it. */
! 	    if ((ngp = NGfind(pat)) != NULL)
  		subbed[ngp - Groups] = subvalue;
  	}
  	else
! 	    for (p = subbed, ngp = Groups, i = nGroups; --i >= 0; ngp++, p++)
! 		if (wildmat(ngp->Name, pat))
  		    *p = subvalue;
      }
  }
  
--- 135,152 ----
  		break;
  	if (*p == '\0') {
  	    /* Simple string; look it up, set it. */
! 	    if ((ngp = NGfind(pat)) != NULL) {
  		subbed[ngp - Groups] = subvalue;
+ 		unwanted[ngp - Groups] = unwantvalue;
+ 	    }
  	}
  	else
! 	    for (p = subbed, u = unwanted, ngp = Groups, i = nGroups;
! 			--i >= 0; ngp++, p++, u++)
! 		if (wildmat(ngp->Name, pat)) {
  		    *p = subvalue;
+ 		    *u = unwantvalue;
+ 		}
      }
  }
  
***************
*** 146,155 ****
  **  doing syntax checking.
  */
  STRING
! SITEparseone(Entry, sp, subbed)
      char		*Entry;
      SITE		*sp;
      char		*subbed;
  {
      static char		BATCH[] = _PATH_BATCHDIR;
      register int	i;
--- 159,169 ----
  **  doing syntax checking.
  */
  STRING
! SITEparseone(Entry, sp, subbed, unwanted)
      char		*Entry;
      SITE		*sp;
      char		*subbed;
+     char		*unwanted;
  {
      static char		BATCH[] = _PATH_BATCHDIR;
      register int	i;
***************
*** 156,161 ****
--- 170,176 ----
      register int	j;
      register NEWSGROUP	*ngp;
      register char	*p;
+     register char	*u;
      char		*f2;
      char		*f3;
      char		*f4;
***************
*** 203,211 ****
      if (subbed) {
  	/* Read the subscription patterns and set the bits. */
  	(void)memset((POINTER)subbed, SUB_DEFAULT, (SIZE_T)nGroups);
  	if (ME.Patterns)
! 	    SITEsetlist(ME.Patterns, subbed);
! 	SITEsetlist(sp->Patterns, subbed);
      }
  
      /* Get the third field, the flags. */
--- 218,227 ----
      if (subbed) {
  	/* Read the subscription patterns and set the bits. */
  	(void)memset((POINTER)subbed, SUB_DEFAULT, (SIZE_T)nGroups);
+ 	(void)memset((POINTER)unwanted, SUB_DEFAULT, (SIZE_T)nGroups);
  	if (ME.Patterns)
! 	    SITEsetlist(ME.Patterns, subbed, unwanted);
! 	SITEsetlist(sp->Patterns, subbed, unwanted);
      }
  
      /* Get the third field, the flags. */
***************
*** 377,383 ****
      /* Now tell the groups this site gets that they should feed this site. */
      if (sp != &ME && subbed) {
  	isp = sp - Sites;
! 	for (p = subbed, ngp = Groups, i = nGroups; --i >= 0; ngp++)
  	    if (*p++) {
  		for (j = 0; j < ngp->nSites; j++)
  		    if (ngp->Sites[j] == NOSITE) {
--- 393,400 ----
      /* Now tell the groups this site gets that they should feed this site. */
      if (sp != &ME && subbed) {
  	isp = sp - Sites;
! 	for (p = subbed, u = unwanted, ngp = Groups, i = nGroups;
! 		--i >= 0; ngp++)
  	    if (*p++) {
  		for (j = 0; j < ngp->nSites; j++)
  		    if (ngp->Sites[j] == NOSITE) {
***************
*** 387,392 ****
--- 404,418 ----
  		if (j == ngp->nSites)
  		    ngp->Sites[ngp->nSites++] = isp;
  	    }
+ 	    if (*u++) {
+ 		for (j = 0; j < ngp->nUnwant; j++)
+ 		    if (ngp->Unwant[j] == NOSITE) {
+ 			ngp->Unwant[j] = isp;
+ 			break;
+ 		    }
+ 		if (j == ngp->nUnwant)
+ 		    ngp->Unwant[ngp->nUnwant++] = isp;
+ 	    }
      }
  
      /* If this is a duplicate name, find the master. */
***************
*** 474,479 ****
--- 500,506 ----
      char		**strings;
      SITE		*sp;
      char		*subbed;
+     char		*unwanted;
      STRING		error;
      int			errors;
  
***************
*** 498,514 ****
  
      /* Set up scratch subscription list. */
      subbed = NEW(char, nGroups);
  
      for (sp = Sites, errors = 0, i = 0; i < nSites; i++) {
  	p = strings[i];
  	if (p[0] == 'M' && p[1] == 'E' && p[2] == NF_FIELD_SEP) {
! 	    if ((error = SITEparseone(p, &ME, subbed)) != NULL) {
  		syslog(L_FATAL, "%s bad_newsfeeds %s", MaxLength(p, p), error);
  		errors++;
  	    }
  	    continue;
  	}
! 	if ((error = SITEparseone(p, sp, subbed)) != NULL) {
  	    syslog(L_FATAL, "%s bad_newsfeeds %s", MaxLength(p, p), error);
  	    errors++;
  	    continue;
--- 525,542 ----
  
      /* Set up scratch subscription list. */
      subbed = NEW(char, nGroups);
+     unwanted = NEW(char, nGroups);
  
      for (sp = Sites, errors = 0, i = 0; i < nSites; i++) {
  	p = strings[i];
  	if (p[0] == 'M' && p[1] == 'E' && p[2] == NF_FIELD_SEP) {
! 	    if ((error = SITEparseone(p, &ME, subbed, unwanted)) != NULL) {
  		syslog(L_FATAL, "%s bad_newsfeeds %s", MaxLength(p, p), error);
  		errors++;
  	    }
  	    continue;
  	}
! 	if ((error = SITEparseone(p, sp, subbed, unwanted)) != NULL) {
  	    syslog(L_FATAL, "%s bad_newsfeeds %s", MaxLength(p, p), error);
  	    errors++;
  	    continue;
***************
*** 531,536 ****
--- 559,565 ----
      /* Free our scratch array, set up the funnel links. */
      nSites = sp - Sites;
      DISPOSE(subbed);
+     DISPOSE(unwanted);
      DISPOSE(strings);
      if (!SITEfunnelpatch()) {
  	JustCleanup();
*** innd/ng.c.orig	Thu Mar 18 16:04:30 EST 1993
--- innd/ng.c	Sun Apr 14 12:40:29 EDT 1996
***************
*** 119,124 ****
--- 119,126 ----
      ngp->Last = atol(ngp->LastString);
      ngp->nSites = 0;
      ngp->Sites = NEW(int, NGHcount);
+     ngp->nUnwant = 0;
+     ngp->Unwant = NEW(int, NGHcount);
      ngp->Alias = NULL;
  
      /* Find the right bucket for the group, make sure there is room. */
***************
*** 158,165 ****
  
      /* If re-reading, remove anything we might have had. */
      if (Groups) {
! 	for (i = nGroups, ngp = Groups; --i >= 0; ngp++)
  	    DISPOSE(ngp->Sites);
  	DISPOSE(Groups);
  	DISPOSE(GroupPointers);
  	DISPOSE(NGdirs.Data);
--- 160,169 ----
  
      /* If re-reading, remove anything we might have had. */
      if (Groups) {
! 	for (i = nGroups, ngp = Groups; --i >= 0; ngp++) {
  	    DISPOSE(ngp->Sites);
+ 	    DISPOSE(ngp->Unwant);
+ 	}
  	DISPOSE(Groups);
  	DISPOSE(GroupPointers);
  	DISPOSE(NGdirs.Data);
*** innd/site.c.orig	Thu Mar 18 16:04:32 EST 1993
--- innd/site.c	Sun Apr 14 12:28:41 EDT 1996
***************
*** 771,778 ****
      if (ME.Patterns) {
  	for (argv = ME.Patterns; (pat = *argv++) != NULL; ) {
  	    subvalue = *pat != SUB_NEGATE;
! 	    if (!subvalue)
  		pat++;
  	    if (wildmat(name, pat))
  		match = subvalue;
  	}
--- 771,781 ----
      if (ME.Patterns) {
  	for (argv = ME.Patterns; (pat = *argv++) != NULL; ) {
  	    subvalue = *pat != SUB_NEGATE;
! 	    if (!subvalue) {
  		pat++;
+ 		if (*pat == SUB_NEGATE)
+ 		    pat++;
+ 	    }
  	    if (wildmat(name, pat))
  		match = subvalue;
  	}
***************
*** 779,788 ****
      }
      for (argv = sp->Patterns; (pat = *argv++) != NULL; ) {
  	subvalue = *pat != SUB_NEGATE;
! 	if (!subvalue)
  	    pat++;
  	if (wildmat(name, pat))
  	    match = subvalue;
      }
      return match;
  }
--- 782,837 ----
      }
      for (argv = sp->Patterns; (pat = *argv++) != NULL; ) {
  	subvalue = *pat != SUB_NEGATE;
! 	if (!subvalue) {
  	    pat++;
+ 	    if (*pat == SUB_NEGATE)
+ 		pat++;
+ 	}
  	if (wildmat(name, pat))
  	    match = subvalue;
+     }
+     return match;
+ }
+ 
+ 
+ /*
+ **  Run down the site's pattern list and see if it unwants the specified
+ **  newsgroup.
+ */
+ BOOL
+ SITEunwantsgroup(sp, name)
+     register SITE	*sp;
+     register char	*name;
+ {
+     register BOOL	match;
+     register BOOL	unwantvalue;
+     register char	*pat;
+     register char	**argv;
+ 
+     match = SUB_DEFAULT;
+     if (ME.Patterns) {
+ 	for (argv = ME.Patterns; (pat = *argv++) != NULL; ) {
+ 	    unwantvalue = *pat == SUB_NEGATE;
+ 	    if (unwantvalue) {
+ 		pat++;
+ 		unwantvalue = *pat == SUB_NEGATE;
+ 		if (unwantvalue)
+ 		    pat++;
+ 	    }
+ 	    if (wildmat(name, pat))
+ 		match = unwantvalue;
+ 	}
+     }
+     for (argv = sp->Patterns; (pat = *argv++) != NULL; ) {
+ 	unwantvalue = *pat == SUB_NEGATE;
+ 	if (unwantvalue) {
+ 	    pat++;
+ 	    unwantvalue = *pat == SUB_NEGATE;
+ 	    if (unwantvalue)
+ 		pat++;
+ 	}
+ 	if (wildmat(name, pat))
+ 	    match = unwantvalue;
      }
      return match;
  }

Re: A patch for INN to stop sending unwanted newsgroups
#7691
Author: Brad Templeton
Date: Fri, 17 May 1996 00:00
18 lines
1304 bytes
In article <4ngqoq$q1o@blazing.mro.dec.com>,
John T. Stapleton <stapes@blazing.mro.dec.com> wrote:
>patterns don't overlap.  The order doesn't matter in the following
>example because the patterns don't overlap:
>
>	biz.*,!!clari.*

We would not want customers to do this.  We post articles crossposted
to the group biz.clarinet.sample and this would block our intention,
which is they go out.  Ditto our stock report crossposted to
misc.invest.stocks, and the odd crossposts in our unmoderated
group clari.net.talk
-- 
Brad Templeton, publisher, ClariNet Communications Corp.	 info@clari.net
The net's #1 E-Newspaper (1,400,000 paid sbscrbrs.)  http://www.clari.net/brad/

Re: A patch for INN to stop sending unwanted newsgroups
#7737
Author: Mark Turner
Date: Sun, 19 May 1996 00:00
27 lines
1746 bytes
In article <4nn8ni$33c@paperboy.osf.org>, Rich Salz <rsalz@osf.org> wrote:
> Hmm...  Perhaps, then, the "poison-pill crosspost" should be a
> newsfeeds flag and not mixed into the subscription list.

If it is a newsfeeds flag rather than some sort of magic token in the
subscription list then it wouldn't be as flexible.

Consider this.... customer specifies that they want uk.* but not
uk.politics.* except that crossposts should get through so that threads
don't get holes in.  However, that same customer has a very strict
policy on porn so asks that under no circumstances should an article
posted to uk.porn (no, it doesn't exist!) ever be offered to his site
whether it be crossposted or not.  Using the newsfeeds flag method I
don't see how this could be coded, but with the magic token idea it could
be coded as "uk.*,!uk.politics.*,!!uk.porn".

To satisfy Brad's requirements for distribution of sample Clarinet
articles whilst still ensuring that they do not propogate something they
choose to not let through at all, a site could code something like....
"*,!clari.*,!!*warez*".

Cheers,

Mark.

Re: A patch for INN to stop sending unwanted newsgroups
#7740
Author: T. William Wells
Date: Sun, 19 May 1996 00:00
12 lines
1076 bytes
In article <4ngqoq$q1o@blazing.mro.dec.com>,
John T. Stapleton <stapes@blazing.mro.dec.com> wrote:
: Here are patches to prevent unwanted newsgroups being sent to your news
: neighbors even when the article is cross-posted to a subscribed newsgroup.

I did this with a small patch to nntpsend that lets me run
arbitrary filters on the outgoing batch file; then I used the WR
flag in newsfeeds and filtered based on the newsgroups.  This is
like a four line change and far more versatile.

Re: A patch for INN to stop sending unwanted newsgroups
#7749
Author: Rich Salz
Date: Sun, 19 May 1996 00:00
6 lines
736 bytes
Hmm...  Perhaps, then, the "poison-pill crosspost" should be a
newsfeeds flag and not mixed into the subscription list.
	/r$

Re: A patch for INN to stop sending unwanted newsgroups
#7755
Author: Rich Salz
Date: Mon, 20 May 1996 00:00
22 lines
1395 bytes
In <4no004$1d3@clio.kram.org> mark@kram.org (Mark Turner) writes:
>In article <4nn8ni$33c@paperboy.osf.org>, Rich Salz <rsalz@osf.org> wrote:
>> Hmm...  Perhaps, then, the "poison-pill crosspost" should be a
>> newsfeeds flag and not mixed into the subscription list.
>
>If it is a newsfeeds flag rather than some sort of magic token in the
>subscription list then it wouldn't be as flexible.

Why not?
	Puk.porn.*,Puk.jobs.*
is equivalent to "!!uk.porn.*,uk.jobs.*" appearing in the subscription list.

I really dislike the fact that "!!foo"
	1.  Duplicates an existing meta-char
	2.  Has no ordering.
#1 is easily fixed.  #2 leads me to think it doesn't belong in the
order-dependent subscription list.

	/r$

BugFix - was: A patch for INN to stop sending unwanted newsgroups
#11019
Author: John T. Stapleton
Date: Fri, 20 Sep 1996 00:00
64 lines
2851 bytes
Here is a bug fix for a patch which I posted on 16-May-1996.  The
patch was for INN to stop sending unwanted newsgroups to downstream
neighbors by prefixing newsgroups with a double exclamation mark (!!).
Since then the patch has been completely rewritten to use a single
atsign (@), and has been converted to INN 1.5.

The Message-ID of the original was <4ngqoq$q1o@blazing.mro.dec.com>
which I put in the references header.

A note of warning to people who grab patches off DejaNews.  Your
browser is probably clipping off spaces at the end of a line.  Well
guess what!  Context diffs rely on things like "+ " at the beginning
of a line to mean add this line, "! " to mean change this line, and so
forth.  If a patch contains blank lines, they can show up in the
article as a single line starting with "+" and ending with space.  The
space will get truncated thereby confusing the patch program.

It also appears that the tab characters may be converted to spaces
Apply the patch if you must, but don't criticize the author for not
lining up to the proper indentation.

Be careful when getting patches from DejaNews and which browser you
use.

Anyway here is what is wrong with my original patch:

I added an ``if'' to a ``for'' loop which did not have curly braces
wrapping the one ``if'' in the ``for'' loop.  It's a pretty small fix
in newsfeeds.c.  

Change the line that is marked with the ``*'' in column one by adding
the ``{'' and add the ``}'' to the end of the ``for'' loop signified
by the ``+'' in column one.

    /* Now tell the groups this site gets that they should feed this site. */
    if (sp != &ME && subbed) {
	isp = sp - Sites;
	for (p = subbed, u = unwanted, ngp = Groups, i = nGroups;
*		--i >= 0; ngp++) {
	    if (*p++) {
		for (j = 0; j < ngp->nSites; j++)
		    if (ngp->Sites[j] == NOSITE) {
			ngp->Sites[j] = isp;
			break;
		    }
		if (j == ngp->nSites)
		    ngp->Sites[ngp->nSites++] = isp;
	    }
	    if (*u++) {
		for (j = 0; j < ngp->nUnwant; j++)
		    if (ngp->Unwant[j] == NOSITE) {
			ngp->Unwant[j] = isp;
			break;
		    }
		if (j == ngp->nUnwant)
		    ngp->Unwant[ngp->nUnwant++] = isp;
	    }
+	}
    }

Stapes

Re: BugFix - was: A patch for INN to stop sending unwanted newsgroups
#11073
Author: Alan Brown
Date: Mon, 23 Sep 1996 00:00
15 lines
1164 bytes
In article <51up41$192$1@ryn.mro.dec.com>,
John T. Stapleton <stapes@ryn.mro.dec.com> wrote:
>Here is a bug fix for a patch which I posted on 16-May-1996.  The

Is there any chance of reposting the complete patch (with bugfix),
sending it to Dave Barr or posting a URL for it?

AB

-- 
One net to rule them all, one net to find them, one net to bring them all,
using Unix to bind them.

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads