[news.software.b] News 2.11

stephen@comp.lancs.ac.uk (Stephen J. Muir) (03/13/87)

Here are some patches (relative to the above) to 2.11 to do the following:

1) The domain name is now the complete domain name, where your UUCP/HIDDENNET
   name may be interpolated using "%s".  For example, instead of using
   ".CSS.GOV", you would use "%s.CSS.GOV".  This allows sites whose UUCP name
   is not part of their internet name to use 2.11.

2) It is now possible to specify, in a checkgroups control message, that no
   newsgroups with a given top-level name should exist.  E.g., if the line:

!talk

   were present, it would indicate that no talk.* newsgroups should exist.

I hope Rick Adams will put these in patch #6.
----------------------------------- Cut Here ----------------------------------
#!/bin/sh
echo 'Start of pack.out, part 01 of 01:'
echo 'x - src.Makefile.dst.diff'
sed 's/^X//' > src.Makefile.dst.diff << '/'
X*** Makefile.dst.orig	Wed Mar 11 22:41:36 1987
X--- Makefile.dst	Thu Mar 12 00:37:35 1987
X***************
X*** 238,245
X  	$(CC) $(CFLAGS) $(LFLAGS) recnews.c -o recnews
X  #VMS 	mv recnews.exe recnews
X  
X! sendnews:  sendnews.o uname.o
X! 	$(CC) $(LFLAGS) sendnews.o uname.o -o sendnews
X  #VMS 	mv sendnews.exe sendnews
X  
X  batch:  batch.c Makefile
X
X--- 238,245 -----
X  	$(CC) $(CFLAGS) $(LFLAGS) recnews.c -o recnews
X  #VMS 	mv recnews.exe recnews
X  
X! sendnews:  sendnews.o
X! 	$(CC) $(LFLAGS) sendnews.o -o sendnews
X  #VMS 	mv sendnews.exe sendnews
X  
X  batch:  batch.c Makefile
/
echo 'x - src.checkgroups.sh.diff'
sed 's/^X//' > src.checkgroups.sh.diff << '/'
X*** checkgroups.sh.orig	Sun Mar  1 03:51:13 1987
X--- checkgroups.sh	Sun Mar  1 03:52:47 1987
X***************
X*** 27,33
X  	echo "${line}" > /tmp/$$msg
X  	cat >> /tmp/$$msg
X  	cp /dev/null /tmp/$$b
X! 	cat /tmp/$$msg | sed -e "s;[ 	].*;;" -e "s;\..*;;" | sort -u |
X  		while read dist
X  		do
X  			group=`cat /tmp/$$b`
X
X--- 27,33 -----
X  	echo "${line}" > /tmp/$$msg
X  	cat >> /tmp/$$msg
X  	cp /dev/null /tmp/$$b
X! 	sed -e "s;[ 	].*;;" -e "s;\..*;;" -e "s;^!;;" /tmp/$$msg | sort -u |
X  		while read dist
X  		do
X  			group=`cat /tmp/$$b`
X***************
X*** 37,43
X  	group=`cat /tmp/$$b`
X  	egrep -v "${group}" LIBDIR/newsgroups > /tmp/$$a
X  	cat /tmp/$$a > LIBDIR/newsgroups
X! 	cat /tmp/$$msg >> LIBDIR/newsgroups
X  	rm -f /tmp/$$b /tmp/$$msg
X  	;;
X  esac
X
X--- 37,43 -----
X  	group=`cat /tmp/$$b`
X  	egrep -v "${group}" LIBDIR/newsgroups > /tmp/$$a
X  	cat /tmp/$$a > LIBDIR/newsgroups
X! 	sed -e "/^!/d" /tmp/$$msg >> LIBDIR/newsgroups
X  	rm -f /tmp/$$b /tmp/$$msg
X  	;;
X  esac
/
echo 'x - src.control.c.diff'
sed 's/^X//' > src.control.c.diff << '/'
X*** control.c.orig	Wed Mar 11 22:48:29 1987
X--- control.c	Wed Mar 11 23:05:43 1987
X***************
X*** 215,221
X  	(void) sprintf(header.title, "sendme%s %s", list, FULLSYSNAME);
X  	(void) strcpy(header.ctlmsg, header.title);
X  	getident(&header);
X! 	(void) sprintf(header.from, "%s@%s%s", "usenet", FULLSYSNAME, mydomain());
X  	(void) strcpy(header.path, NEWSUSR);
X  	header.subdate[0] = header.expdate[0] = '\0';
X  	dates(&header);
X
X--- 215,221 -----
X  	(void) sprintf(header.title, "sendme%s %s", list, FULLSYSNAME);
X  	(void) strcpy(header.ctlmsg, header.title);
X  	getident(&header);
X! 	(void) sprintf(header.from, "%s@%s", "usenet", mydomain());
X  	(void) strcpy(header.path, NEWSUSR);
X  	header.subdate[0] = header.expdate[0] = '\0';
X  	dates(&header);
X***************
X*** 916,923
X  		(void) time(&now);
X  		fprintf(fp, "Date: %s\n", arpadate(&now));
X  #ifdef MMDF
X! 		fprintf(fp, "From: The News System <usenet@%s%s>\n",
X! 				FULLSYSNAME, mydomain());
X  #endif /* MMDF */
X  		fprintf(fp, "To: %s\n", to);
X  		fprintf(fp, "Subject: %s\n", subject);
X
X--- 916,922 -----
X  		(void) time(&now);
X  		fprintf(fp, "Date: %s\n", arpadate(&now));
X  #ifdef MMDF
X! 		fprintf(fp, "From: The News System <usenet@%s>\n", mydomain());
X  #endif /* MMDF */
X  		fprintf(fp, "To: %s\n", to);
X  		fprintf(fp, "Subject: %s\n", subject);
X***************
X*** 923,930
X  		fprintf(fp, "Subject: %s\n", subject);
X  #ifdef HIDDENNET
X  		if (strcmp(LOCALSYSNAME, FULLSYSNAME))
X! 			fprintf(fp, "Responding-System: %s.%s%s\n\n",
X! 				LOCALSYSNAME, FULLSYSNAME, mydomain());
X  		else
X  #endif /* !HIDDENNET */
X  			fprintf(fp, "Responding-System: %s%s\n\n",
X
X--- 922,929 -----
X  		fprintf(fp, "Subject: %s\n", subject);
X  #ifdef HIDDENNET
X  		if (strcmp(LOCALSYSNAME, FULLSYSNAME))
X! 			fprintf(fp, "Responding-System: %s.%s\n\n",
X! 				LOCALSYSNAME, mydomain());
X  		else
X  #endif /* !HIDDENNET */
X  			fprintf(fp, "Responding-System: %s\n\n",
X***************
X*** 927,934
X  				LOCALSYSNAME, FULLSYSNAME, mydomain());
X  		else
X  #endif /* !HIDDENNET */
X! 			fprintf(fp, "Responding-System: %s%s\n\n",
X! 				FULLSYSNAME, mydomain());
X  	}
X  	return fp;
X  }
X
X--- 926,933 -----
X  				LOCALSYSNAME, mydomain());
X  		else
X  #endif /* !HIDDENNET */
X! 			fprintf(fp, "Responding-System: %s\n\n",
X! 				mydomain());
X  	}
X  	return fp;
X  }
/
echo 'x - src.ifuncs.c.diff'
sed 's/^X//' > src.ifuncs.c.diff << '/'
X*** ifuncs.c.orig	Wed Mar 11 22:48:50 1987
X--- ifuncs.c	Thu Mar 12 00:16:00 1987
X***************
X*** 788,794
X  	unlock();
X  #ifdef HIDDENNET
X  	if (strcmp(LOCALSYSNAME, FULLSYSNAME))
X! 		(void) sprintf(hp->ident, "<%ld@%s.%s%s>", seqn, LOCALSYSNAME, FULLSYSNAME,
X  		mydomain());
X  	else
X  #endif /* !HIDDENNET */
X
X--- 788,794 -----
X  	unlock();
X  #ifdef HIDDENNET
X  	if (strcmp(LOCALSYSNAME, FULLSYSNAME))
X! 		(void) sprintf(hp->ident, "<%ld@%s.%s>", seqn, LOCALSYSNAME,
X  		mydomain());
X  	else
X  #endif /* !HIDDENNET */
X***************
X*** 792,798
X  		mydomain());
X  	else
X  #endif /* !HIDDENNET */
X! 	(void) sprintf(hp->ident, "<%ld@%s%s>", seqn, FULLSYSNAME, mydomain());
X  }
X  
X  /*
X
X--- 792,798 -----
X  		mydomain());
X  	else
X  #endif /* !HIDDENNET */
X! 	(void) sprintf(hp->ident, "<%ld@%s>", seqn, mydomain());
X  }
X  
X  /*
X***************
X*** 1013,1019
X  		fn = fullname(logname);
X  
X  	(void) sprintf(hp->path, "%s", logname);
X! 	(void) sprintf(hp->from, "%s@%s%s (%s)", logname, FULLSYSNAME, mydomain(), fn);
X  }
X  
X  /*
X
X--- 1013,1019 -----
X  		fn = fullname(logname);
X  
X  	(void) sprintf(hp->path, "%s", logname);
X! 	(void) sprintf(hp->from, "%s@%s (%s)", logname, mydomain(), fn);
X  }
X  
X  /*
/
echo 'x - src.inews.c.diff'
sed 's/^X//' > src.inews.c.diff << '/'
X*** inews.c.orig	Wed Mar 11 22:48:25 1987
X--- inews.c	Wed Mar 11 23:10:10 1987
X***************
X*** 364,371
X  					*p1 = '\0';
X  			}
X  			if (!Mflag && !strpbrk(forgedname, "@ (<"))
X! 				(void) sprintf(header.from,"%s@%s%s",
X! 					forgedname, FULLSYSNAME, mydomain());
X  			else
X  				(void) strncpy(header.from, forgedname, BUFLEN);
X  
X
X--- 364,371 -----
X  					*p1 = '\0';
X  			}
X  			if (!Mflag && !strpbrk(forgedname, "@ (<"))
X! 				(void) sprintf(header.from,"%s@%s",
X! 					forgedname, mydomain());
X  			else
X  				(void) strncpy(header.from, forgedname, BUFLEN);
X  
X***************
X*** 369,376
X  			else
X  				(void) strncpy(header.from, forgedname, BUFLEN);
X  
X! 			(void) sprintf(header.sender, "%s@%s%s",
X! 				username, FULLSYSNAME, mydomain());
X  		} else {
X  			gensender(&header, username);
X  		}
X
X--- 369,376 -----
X  			else
X  				(void) strncpy(header.from, forgedname, BUFLEN);
X  
X! 			(void) sprintf(header.sender, "%s@%s",
X! 				username, mydomain());
X  		} else {
X  			gensender(&header, username);
X  		}
X***************
X*** 651,658
X  		*cp = '\0';
X  
X  	if (header.approved[0] == '\0')
X! 		(void) sprintf(header.approved, "%s@%s%s",
X! 				username, FULLSYSNAME, mydomain());
X  	(void) sprintf(bfr, "%s/inews -n %s.ctl -c newgroup %s -d %s -a \"%s\"",
X  		LIB, header.nbuf, header.ctlmsg, header.distribution,
X  		header.approved);
X
X--- 651,658 -----
X  		*cp = '\0';
X  
X  	if (header.approved[0] == '\0')
X! 		(void) sprintf(header.approved, "%s@%s",
X! 				username, mydomain());
X  	(void) sprintf(bfr, "%s/inews -n %s.ctl -c newgroup %s -d %s -a \"%s\"",
X  		LIB, header.nbuf, header.ctlmsg, header.distribution,
X  		header.approved);
/
echo 'x - src.uname.c.diff'
sed 's/^X//' > src.uname.c.diff << '/'
X*** uname.c.orig	Wed Mar 11 22:48:42 1987
X--- uname.c	Thu Mar 12 00:16:13 1987
X***************
X*** 98,104
X  }
X  #endif
X  
X- 
X  /*
X   * At sites where the are many mail domains within the support area of a single
X   * news administrator, it is much nicer to be able to read the local domain of
X
X--- 98,103 -----
X  }
X  #endif
X  
X  /*
X   * At sites where there are many mail domains within the support area of a
X   * single news administrator, it is much nicer to be able to read the local
X***************
X*** 100,108
X  
X  
X  /*
X!  * At sites where the are many mail domains within the support area of a single
X!  * news administrator, it is much nicer to be able to read the local domain of
X!  * a machine from a file.  What we do here is:
X   * 1)	Check for the presence of a LIBDIR/localdomain file.  If it doesn't 
X   * 	exist,assume that MYDOMAIN should be used instead.
X   * 2)	If it does exist, we make the following assumptions:
X
X--- 99,107 -----
X  #endif
X  
X  /*
X!  * At sites where there are many mail domains within the support area of a
X!  * single news administrator, it is much nicer to be able to read the local
X!  * domain of a machine from a file.  What we do here is:
X   * 1)	Check for the presence of a LIBDIR/localdomain file.  If it doesn't 
X   * 	exist,assume that MYDOMAIN should be used instead.
X   * 2)	If it does exist, we make the following assumptions:
X***************
X*** 107,113
X   * 	exist,assume that MYDOMAIN should be used instead.
X   * 2)	If it does exist, we make the following assumptions:
X   *	a)  If it is empty, has only comments, or only blank lines; we assume
X!  *	    the domain is desired to be a zero length string ( ie "").  (this
X   *	    implies that the domain name is contained in the hostname.)
X   *	b)  If it is not empty, we assume the first line not beginning with a
X   *	    '#', blank/tab, or newline is the desired domain name.
X
X--- 106,112 -----
X   * 	exist,assume that MYDOMAIN should be used instead.
X   * 2)	If it does exist, we make the following assumptions:
X   *	a)  If it is empty, has only comments, or only blank lines; we assume
X!  *	    the domain is desired to be a zero length string (ie "").  (this
X   *	    implies that the domain name is contained in the hostname.)
X   *	b)  If it is not empty, we assume the first line not beginning with a
X   *	    '#', blank/tab, or newline is the desired domain name.
X***************
X*** 114,119
X   *	    A like '.UUCP' or '.TEK.COM' should be used.  We could insure that
X   *	    the line begin with a '.' to be a valid domain name, but I don't 
X   *	    think it is necessary to put that restriction on it.
X   */
X  char *
X  mydomain()
X
X--- 113,119 -----
X   *	    A like '.UUCP' or '.TEK.COM' should be used.  We could insure that
X   *	    the line begin with a '.' to be a valid domain name, but I don't 
X   *	    think it is necessary to put that restriction on it.
X+  * 3)   Replace the string %s by FULLSYSNAME.
X   */
X  char *
X  mydomain()
X***************
X*** 118,125
X  char *
X  mydomain()
X  {
X! 	static char *md = NULL;
X! 	register char *cp;
X  	FILE *fp = NULL;
X  	char fbuf[BUFLEN];
X  	extern char *malloc(), *strcpy(), *index();
X
X--- 118,125 -----
X  char *
X  mydomain()
X  {
X! 	static char *mfd = NULL;
X! 	register char *cp, *md = NULL;
X  	FILE *fp = NULL;
X  	char fbuf[BUFLEN], mfdbuf[BUFLEN];
X  	extern char *malloc(), *strcpy(), *index();
X***************
X*** 121,127
X  	static char *md = NULL;
X  	register char *cp;
X  	FILE *fp = NULL;
X! 	char fbuf[BUFLEN];
X  	extern char *malloc(), *strcpy(), *index();
X  
X  	if(md)	/* we've been here before, so just return what we found */
X
X--- 121,127 -----
X  	static char *mfd = NULL;
X  	register char *cp, *md = NULL;
X  	FILE *fp = NULL;
X! 	char fbuf[BUFLEN], mfdbuf[BUFLEN];
X  	extern char *malloc(), *strcpy(), *index();
X  
X  	if(mfd)	/* we've been here before, so just return what we found */
X***************
X*** 124,131
X  	char fbuf[BUFLEN];
X  	extern char *malloc(), *strcpy(), *index();
X  
X! 	if(md)	/* we've been here before, so just return what we found */
X! 		return(md);
X  
X  	(void) sprintf(fbuf,"%s/localdomain", LIBDIR);
X  	if ( (fp = fopen(fbuf,"r")) == NULL) {
X
X--- 124,131 -----
X  	char fbuf[BUFLEN], mfdbuf[BUFLEN];
X  	extern char *malloc(), *strcpy(), *index();
X  
X! 	if(mfd)	/* we've been here before, so just return what we found */
X! 		return(mfd);
X  
X  	(void) sprintf(fbuf,"%s/localdomain", LIBDIR);
X  	if ( (fp = fopen(fbuf,"r")) == NULL) {
X***************
X*** 139,148
X  			if( cp = index(fbuf, '\n') )
X  				*cp = '\0';
X  	
X! 			if ( (md = malloc(strlen(fbuf) + 1)) == NULL)
X! 				md = MYDOMAIN;	/* punt here */
X! 			else
X! 				(void)strcpy(md, fbuf);
X  			break;
X  		}
X  	}
X
X--- 139,145 -----
X  			if( cp = index(fbuf, '\n') )
X  				*cp = '\0';
X  	
X! 			md = fbuf;
X  			break;
X  		}
X  	}
X***************
X*** 152,157
X  
X  	if( md == NULL)
X  		md = "";
X! 	
X! 	return(md);
X  }
X
X--- 149,159 -----
X  
X  	if( md == NULL)
X  		md = "";
X! 
X! 	sprintf(mfdbuf, md, FULLSYSNAME);
X! 	if ( (mfd = malloc(strlen(mfdbuf) + 1)) == NULL)
X! 		mfd = MYDOMAIN;	/* punt here */
X! 	else
X! 		strcpy(mfd, mfdbuf);
X! 	return (mfd);
X  }
/
echo 'Part 01 of pack.out complete.'
exit
----------------------------------- Cut Here ----------------------------------
-- 
EMAIL:	stephen@comp.lancs.ac.uk	| Post: University of Lancaster,
UUCP:	...!mcvax!ukc!dcl-cs!stephen	|	Department of Computing,
Phone:	+44 524 65201 Ext. 4120		|	Bailrigg, Lancaster, UK.
Project:Alvey ECLIPSE Distribution	|	LA1 4YR