[news.groups] Patch for inews

mack@inco.UUCP (Dave Mack) (04/09/88)

I find it extremely annoying that the Backbone Cabal (and the recent
soc.sex fiasco makes it appear that there is one) refuses to create
a legitimately requested newsgroup. The rationale for this action was
that a) the name of the newsgroup would be offensive to many people,
and b) that many of them would not carry a group specifically devoted
to sexual matters regardless of the name.

This article contains a patch to News 2.11, patchlevel 14, which solves
both of these problems by allowing sites to transmit articles posted to
locally nonexistent groups.

With this patch installed, all the news administrator has to do is add
a line of the form:

newsgroupname null	[i.e. soc.sex null]

to the news aliases file, and the article posted to the group will be
junked locally, but will be added to the batchfiles for downstream
sites. Readers at the local site will not be able to either read or
post to the nullified newsgroup. (Of course, if they subscribe to "junk"
they can read it.)

Now for the bad news. This has not been tested very much, and only on
a BSD (Sun) machine. The modifications involved look pretty much
generic (a couple of uses of strncmp might have to be changed for
Sys V systems.) Also, since this machine is a leaf node, I had to fake
a downstream connection.

All of which means: INSTALL THIS AT YOUR OWN RISK!

Installation: just pipe this article into patch with a -d flag indicating
the directory which contains the inews source.

If you're not running news at patchlevel 14, trying to patch won't
do any harm, but watch for .rej files. It may be necessary to do this
by hand.

And for those of you running C News or News 3.0, sorry about that.

Miscellanea:

The files modified are inews.c and ifuncs.c.

When a site receives an article posted to a nullified newsgroup,
the software is specifically prevented from notifying you of the fact
that the article is being junked locally. I felt that this was misleading,
since the message printed was "newsgroup in active, but not in sys".
If you disagree, hack out the code in inews.c:insert() which tests for
the string "NULL:" at the beginning of nbuf. Warning: there are two
tests for "NULL:" close together. Make sure you change the right one.

If the article is cross-posted to groups which exist locally, it will
appear in the existing groups instead of junk. The nullified newsgroup
remains on the Newsgroups: line.

I have no idea what impact this change will have on NNTP sites. I would
expect none (the article would get junked on the server?), but I'm guessing.

So, Backbone Admins, how about creating soc.sex (or soc.boink or whatever)
now?

I welcome any comments, corrections or flames. If this patch turns out
to break anything, please let me know via e-mail (or post it if you
prefer.)

David Mack	{hadron,sundc,grebyn}!inco
McDonnell Dougles-INCO
8201 Greensboro Dr.
McLean, VA   22102
(703)883-3911 (voice)

------------------------------ patch begins here ------------------------------
*** old-inews.c	Sat Dec  5 18:11:41 1987
--- inews.c	Fri Apr  8 15:00:29 1988
***************
*** 1051,1056 ****
--- 1051,1057 ----
  		(void) strncpy(nextref, PATHSYSNAME, BUFLEN);
  #endif /* DOXREFS */
  		for (ptr = nbuf; *ptr;) {
+ 		  if (strncmp(ptr,"NULL:",5) != 0)
  			if (ngmatch(ptr,srec.s_nbuf) || index(ptr,'.') == NULL){
  #ifdef DOXREFS
  				while (*nextref++)
***************
*** 1064,1070 ****
--- 1065,1076 ----
  				;
  		}
  		if (firstbufname[0] == '\0') {
+ 		  /* Don't give misleading error message 
+ 		     on nullified groups
+ 		     */
+ 		  if (strncmp(nbuf,"NULL:",5) != 0) {
  			logerr("Newsgroups in active, but not sys");
+ 		      }
  			(void) localize("junk");
  		}
  #endif /* !NFSCLIENT */
*** old-ifuncs.c	Sat Dec  5 18:11:38 1987
--- ifuncs.c	Fri Apr  8 12:54:47 1988
***************
*** 817,822 ****
--- 817,824 ----
  **  2 - exact newsgroup name found in active or aliases file
  **  3 - newsgroup name found as prefix in bugs file (but not #2)
  **  4 - (2) plus name in bugs file
+ **  5 - newsgroup name aliased to "null" - pass to other sites
+ **      but don't retain locally.
  */
  
  #define NGUNSEEN 0
***************
*** 824,829 ****
--- 826,832 ----
  #define NGALIAS 2
  #define NGBUGS 3
  #define NGABUGS 4
+ #define NGNULL 5
  
  	ngcount = 0;
  	/*
***************
*** 954,959 ****
--- 957,967 ----
  				if (cp == (char *) NULL) {
  			           if (STRCMP(ngs[i], abuf) != 0)
  					continue;
+ 				   if (!STRCMP(bfr,"null")) {
+ 				     uses[i] = NGNULL;
+ 				     okcount++;
+ 				     continue;
+ 				   }
  			           if (isproc)
  					cp = "Aliased newsgroup %s to %s";
  			           else
***************
*** 1084,1091 ****
  				continue;
  			if (pass == 1)
  				j = strlen(ngsbug[i] == (char *) NULL ? ngs[i] : ngsbug[i]);
! 			else
  				j = strlen(ngs[i]);
  			if (j + 2 > avail) {
  				logerr("Redone Newsgroups too long");
  				break;
--- 1092,1102 ----
  				continue;
  			if (pass == 1)
  				j = strlen(ngsbug[i] == (char *) NULL ? ngs[i] : ngsbug[i]);
! 			else {
  				j = strlen(ngs[i]);
+ 				if (uses[i] == NGNULL)
+ 				  j += 5;
+ 			      }
  			if (j + 2 > avail) {
  				logerr("Redone Newsgroups too long");
  				break;
***************
*** 1093,1100 ****
  			if (pass == 1)
  				(void) strcpy(cp,
  					ngsbug[i] == (char *) NULL ? ngs[i] : ngsbug[i]);
! 			else
  				(void) strcpy(cp, ngs[i]);
  			cp += j;
  			*cp++ = (pass == 1) ? NGDELIM : '\0';
  			avail -= (j + 1);
--- 1104,1117 ----
  			if (pass == 1)
  				(void) strcpy(cp,
  					ngsbug[i] == (char *) NULL ? ngs[i] : ngsbug[i]);
! 			else {
! 			  if (uses[i] == NGNULL) {
! 			    strcpy(cp,"NULL:");
! 			    strcat(cp,ngs[i]);
! 			  }
! 			  else
  				(void) strcpy(cp, ngs[i]);
+ 			}
  			cp += j;
  			*cp++ = (pass == 1) ? NGDELIM : '\0';
  			avail -= (j + 1);
***************
*** 1122,1127 ****
--- 1139,1145 ----
  #undef NGALIAS 2
  #undef NGBUGS 3
  #undef NGABUGS 4
+ #undef NGNULL
  
  }
  

-- 
		  		Dave Mack
  A man whose opinions diverge radically from those of the corporation
  (nameless now forevermore) which pays him to perform rites and rituals
  beyond the comprehension of mortal man.