[news.admin] 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.

farren@gethen.UUCP (Michael J. Farren) (04/13/88)

In article <2216@inco.UUCP> mack@inco.UUCP (Dave Mack) writes:
>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.

I'm sorry - I don't quite understand what this gains you.  If the 
upstream site has decided not to carry a full feed, wouldn't they
be rather leery of installing such a patch?  There are many reasons
other than censorship for limiting a feed, you know - I don't carry
soc.all or talk.all because I simply do not have enough disk space
for them.  If someone downstream from me tried to make an end-run
around my limitation by using your patch, I can assure you that two
things would happen right away: first, their articles would vanish
into thin air as soon as they hit my machine (I expire junk daily,
and will continue to do so); and second, their status as a feed would
vanish as soon as I caught on to what they were trying to do.
If they were courteous enough to call and ask first, they might not
want to put in the patch at all - because it wouldn't do them a bit
of good.

I also have to put in a comment here - the content of alt.sex so far
indicates to me that the backbone sites were quite correct in their
decision.  Whatever happened to the newsgroup that was supposed to
have serious talk about sexuality issues?

-- 
Michael J. Farren             | "INVESTIGATE your point of view, don't just 
{ucbvax, uunet, hoptoad}!     | dogmatize it!  Reflect on it and re-evaluate
        unisoft!gethen!farren | it.  You may want to change your mind someday."
gethen!farren@lll-winken.llnl.gov ----- Tom Reingold, from alt.flame 

merlin@hqda-ai.UUCP (David S. Hayes) (04/14/88)

     Some poeple here have missed the point.  The patch is to be
installed at the feeding site, not at the leaf.  This allows a
feed site to pass a group along to their downstream neighbors,
even if they don't want to make it available for their local
users.

     This still means that the feed site is receiving, storing,
and transmitting the group, but it does keep "objectionable"
groups from being read by overly-sensitive local readers.
-- 
David S. Hayes, The Merlin of Avalon	PhoneNet:  (202) 694-6900
UUCP:  *!uunet!cos!hqda-ai!merlin	ARPA:  ai01@hios-pent.arpa

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

In article <862@gethen.UUCP> farren@gethen.UUCP (Michael J. Farren) writes:
>In article <2216@inco.UUCP> mack@inco.UUCP (Dave Mack) writes:
>>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.
>
>I'm sorry - I don't quite understand what this gains you.  

This patch is aimed primarily at backbone sites, although I believe
that smaller feed sites could benefit from using it. It allows two
things: 1) you can pass groups to your downstream sites which, for
whatever reason, you don't want to be available locally, and 
2) you can reduce the amount of disk space needed to store news.

The first item is simply a courtesy to the sites you feed, and if
you don't want to pass a group on, you don't have to.

The second item is a result of the fact that, like you, many sites
expire the junk directory more frequently than the active group
directories. Suppose, for example, that you want to feed all of
the comp groups to a downstream site, but no one at your site is
interested in reading comp.binaries.atari.st. If you add the line

comp.binaries.atari.st null

to your /usr/lib/news/aliases file and rmgroup the newsgroup, it
will be fed to the sites downstream, but the articles will be placed
in your junk directory. Of course, things will get a little weird
when a checkgroups message comes in, but...

>							    If the 
>upstream site has decided not to carry a full feed, wouldn't they
>be rather leery of installing such a patch?  There are many reasons
>other than censorship for limiting a feed, you know - I don't carry
>soc.all or talk.all because I simply do not have enough disk space
>for them.  If someone downstream from me tried to make an end-run
>around my limitation by using your patch, I can assure you that two
>things would happen right away: first, their articles would vanish
>into thin air as soon as they hit my machine (I expire junk daily,
>and will continue to do so); and second, their status as a feed would
>vanish as soon as I caught on to what they were trying to do.

There is absolutely no way that installing this patch would allow
one of your downstream sites to do an end run. First, if one of
your downstream sites installs this patch, it doesn't change anything
that happens on your machine. The patch doesn't alter the newsgroups
line in the message or anything like that. Second, if you install the
patch, it doesn't mean you have to carry anything you don't want to.
Unless you insert lines in your aliases file aliasing unlocalized 
newsgroups to null, the software behaves exactly as it did before.
*Only* the newsgroups that the news administrator aliases to null are
affected, and then only if they aren't localized.

Here's the approximate PDL for the sequence of events in inews when
it receives an article: (this is with the patch installed)
.
.
.
parse the Newsgroups: line
foreach newsgroup do
top:
	if newsgroup is not in the active file then
		if the newsgroup is not in the buggroup file then
			if the newsgroup is in the aliases file then
				if the alias is "null" then
					add the name NULL:newsgroup to
					the list of newsgroups in nbuf;
					continue;
				else
					add the name newsgroup to the
					list of newsgroups in nbuf;
				endif
				substitute the alias for the newsgroup
				name;
				goto top;
			else
				continue;
			endif
		else
			buggroup processing;
			continue;
		endif
	else
		add the name newsgroup to the list of groups in nbuf;
	endif
endloop
if the article isn't posted to a localized or nullified group then
	put it in junk;
else
	rewrite the Newsgroups line, omitting newsgroups which
	are neither localized nor aliased to null;
endif
.
.
.
foreach newsgroup listed in nbuf do
	if newsgroup is prefixed with "NULL:" then
		if this is the only name in nbuf then
			put article in junk;
		endif
	else
		if this is the first name in nbuf then
			copy the article to the appropriate directory;
		else
			make a link in the appropriate directory;
		endif
	endif
	foreach downstream site which accepts this newsgroup do
		if this article hasn't already been added to the batchfile then
			append the pathname to the article to the
			batchfile for this site;
		endif
	endloop
endloop
		
>If they were courteous enough to call and ask first, they might not
>want to put in the patch at all - because it wouldn't do them a bit
>of good.

>I also have to put in a comment here - the content of alt.sex so far
>indicates to me that the backbone sites were quite correct in their
>decision.  Whatever happened to the newsgroup that was supposed to
>have serious talk about sexuality issues?

I have to agree that the contents of alt.sex haven't been very
substantive, but give it a little time. And of course, if soc.sex
had been created, the forum would be open to many more people, and
might actually improve in quality.

My reason for posting this patch was less an interest in seeing soc.sex
created than my annoyance over the rationale given for not creating it.
The attitude of the backbone sites (as expressed primarily by Greg Woods)
was that, while they were not opposed to having such a group, they 
couldn't carry it locally, and therefore it wouldn't propagate to the
sites they feed. This patch fixes that flaw in the news software.
-- 
  Herr Professor Doktor Kent...errr, David Mack, Ph.D., L.L.D, D.M.A
  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.