[mod.computers.masscomp] nntp 1.3 fixes for masscomp

masscomp-request@soma.UUCP (03/31/87)

Here are some patches needed to install nntp 1.3a on 
the Masscomp computer (with hooks added to allow
easy modification for other SYSV-like machines that
have had Berkeley-like network code added).

cd the nntp root directory and apply this patch
using patch.

NOTE: The version number are NOT updated in the files
following this patch. Hopefully, Phil will integrate
these into the "official" release and update the 
version numbers appropriately.

Stan

Index: common/conf.h
*** /tmp/,RCSt1020498	Mon Mar 30 15:53:14 1987
--- /tmp/,RCSt2020498	Mon Mar 30 15:53:15 1987
***************
*** 7,13
   * Compile time options.
   */
  
! #undef	MASSCOMP	/* True if you have a masscomp machine */
  #undef	PYRAMID		/* True if you have a pyramid */
  #undef	ALONE		/* True if we're running without inetd */
  #undef	FASTFORK	/* True if we don't want to read active file on start */

--- 7,14 -----
   * Compile time options.
   */
  
! #define	MASSCOMP	/* True if you have a masscomp machine */
! #define SYSV		/* True if you have a SYSV machine with 4.2 network code */
  #undef	PYRAMID		/* True if you have a pyramid */
  #undef	ALONE		/* True if we're running without inetd */
  #undef	FASTFORK	/* True if we don't want to read active file on start */
***************
*** 11,16
  #undef	PYRAMID		/* True if you have a pyramid */
  #undef	ALONE		/* True if we're running without inetd */
  #undef	FASTFORK	/* True if we don't want to read active file on start */
  #undef	BSD_42		/* 4.2 compatability code -- if this is defined, */
  			/* DBM probably wants to be defined as well. */
  #undef	DBM		/* True if we want to use the old dbm(3x) libraries */

--- 12,18 -----
  #undef	PYRAMID		/* True if you have a pyramid */
  #undef	ALONE		/* True if we're running without inetd */
  #undef	FASTFORK	/* True if we don't want to read active file on start */
+ #define NDIR		/* True if ndir directory emulation routines are needed */
  #undef	BSD_42		/* 4.2 compatability code -- if this is defined, */
  			/* DBM probably wants to be defined as well. */
  #define	DBM		/* True if we want to use the old dbm(3x) libraries */
***************
*** 13,19
  #undef	FASTFORK	/* True if we don't want to read active file on start */
  #undef	BSD_42		/* 4.2 compatability code -- if this is defined, */
  			/* DBM probably wants to be defined as well. */
! #undef	DBM		/* True if we want to use the old dbm(3x) libraries */
  			/* If you define this, change CFLAGS in makefile to */
  			/* be -ldbm */
  #define	SYSLOG		/* True if you have the syslog facility */

--- 15,21 -----
  #define NDIR		/* True if ndir directory emulation routines are needed */
  #undef	BSD_42		/* 4.2 compatability code -- if this is defined, */
  			/* DBM probably wants to be defined as well. */
! #define	DBM		/* True if we want to use the old dbm(3x) libraries */
  			/* If you define this, change CFLAGS in makefile to */
  			/* be -ldbm */
  #undef	SYSLOG		/* True if you have the syslog facility */
***************
*** 16,22
  #undef	DBM		/* True if we want to use the old dbm(3x) libraries */
  			/* If you define this, change CFLAGS in makefile to */
  			/* be -ldbm */
! #define	SYSLOG		/* True if you have the syslog facility */
  
  #ifdef SYSLOG		/* Define LOG if you want copious logging info */
  #	define LOG	/* undef it if you don't */

--- 18,24 -----
  #define	DBM		/* True if we want to use the old dbm(3x) libraries */
  			/* If you define this, change CFLAGS in makefile to */
  			/* be -ldbm */
! #undef	SYSLOG		/* True if you have the syslog facility */
  
  #ifdef SYSLOG		/* Define LOG if you want copious logging info */
  #	define LOG	/* undef it if you don't */
***************
*** 22,27
  #	define LOG	/* undef it if you don't */
  #endif			/* but you can only have LOG if you have SYSLOG */
  
  #ifdef BSD_42		/* This is a logical, warranted assumption */
  #   ifndef DBM		/* which will probably get me in trouble. */
  #	define DBM	/* Kill it if you have 4.2 *and* ndbm.  */

--- 24,36 -----
  #	define LOG	/* undef it if you don't */
  #endif			/* but you can only have LOG if you have SYSLOG */
  
+ 
+ #ifdef MASSCOMP		/* MASSCOMP is like SYSV */
+ #  ifndef SYSV		/* so define it if it isn't defined */
+ #     define SYSV       /* This will eventually make nntp run on */
+ #endif                  /* SYS V machines that have BSD-line networking code */
+ #endif
+ 
  #ifdef BSD_42		/* This is a logical, warranted assumption */
  #   ifndef DBM		/* which will probably get me in trouble. */
  #	define DBM	/* Kill it if you have 4.2 *and* ndbm.  */
***************
*** 28,34
  #   endif
  #endif
  
! #define	SUBNET		/* If you have 4.3 subnetting */
  #undef	DAMAGED_NETMASK	/* If your subnet mask is not a multiple of */
  			/* four bits (e.g., UCSD) */
  

--- 37,43 -----
  #   endif
  #endif
  
! #undef	SUBNET		/* If you have 4.3 subnetting */
  #undef	DAMAGED_NETMASK	/* If your subnet mask is not a multiple of */
  			/* four bits (e.g., UCSD) */
  
***************
*** 32,38
  #undef	DAMAGED_NETMASK	/* If your subnet mask is not a multiple of */
  			/* four bits (e.g., UCSD) */
  
! #undef	GHNAME		/* Define if you have gethostname() */
  #undef	UUNAME		/* Define to use /etc/uucpname */
  			/* If neither of these are defined, */
  			/* inews will use the contents of */

--- 41,47 -----
  #undef	DAMAGED_NETMASK	/* If your subnet mask is not a multiple of */
  			/* four bits (e.g., UCSD) */
  
! #define	GHNAME		/* Define if you have gethostname() */
  #undef	UUNAME		/* Define to use /etc/uucpname */
  			/* If neither of these are defined, */
  			/* inews will use the contents of */
***************
*** 48,54
   * e.g.  #define	DOMAIN		"berkeley.edu"
   */
  
! #define	DOMAIN	"uucp"
  
  /*
   * The host which is actually running the server; this is for

--- 57,63 -----
   * e.g.  #define	DOMAIN		"berkeley.edu"
   */
  
! #define	DOMAIN	"bcm.tmc.edu"
  
  /*
   * The host which is actually running the server; this is for
***************
*** 55,61
   * inews, so it knows where to send the articles.
   */
  
! #define	SERVER_HOST	"titan"
  
  /*
   * Person (user name) to post news as.

--- 64,70 -----
   * inews, so it knows where to send the articles.
   */
  
! #define	SERVER_HOST	"soma"
  
  /*
   * Person (user name) to post news as.
***************
*** 62,67
   */
  
  #define	POSTER		"usenet"
  
  /*
   * Logging facility; normally this will be LOG_DAEMON, but

--- 71,81 -----
   */
  
  #define	POSTER		"usenet"
+ /*
+  * These defines make lint happier on the Masscomp
+  * (and on SYSV machine that have 4.2BSD network code added)
+  *
+  */
  
  #ifdef SYSV
  #define rindex strrchr
***************
*** 63,68
  
  #define	POSTER		"usenet"
  
  /*
   * Logging facility; normally this will be LOG_DAEMON, but
   * if you have LOG defined, you can get a large amount of

--- 77,91 -----
   *
   */
  
+ #ifdef SYSV
+ #define rindex strrchr
+ #define index strchr
+ #   ifndef NDIR
+ #       define NDIR
+ #   endif
+ #endif
+ 
+ 
  /*
   * Logging facility; normally this will be LOG_DAEMON, but
   * if you have LOG defined, you can get a large amount of
***************
*** 92,99
   * have the sypport programs run under.
   */
  
! #define STAT_FILE	"/usr/spool/news/lib/mgdstats"
! #define NGDATE_FILE	"/usr/spool/news/lib/groupdates"
  
  /*
   * Some commonly used programs and files.

--- 115,122 -----
   * have the sypport programs run under.
   */
  
! #define STAT_FILE	"/usr/lib/news/mgdstats"
! #define NGDATE_FILE	"/usr/lib/news/groupdates"
  
  /*
   * Some commonly used programs and files.
***************
*** 99,107
   * Some commonly used programs and files.
   */
  
! #define	ACTIVE_FILE	"/usr/spool/news/lib/active"
! #define ACCESS_FILE	"/usr/spool/news/lib/nntp_access"
! #define HISTORY_FILE	"/usr/spool/news/lib/history"
  #define	SPOOLDIR	"/usr/spool/news/"		/* Need trailing / */
  #define INEWS		"/usr/spool/news/lib/inews"
  #define RNEWS		"/usr/bin/rnews"		/* Link to inews? */

--- 122,130 -----
   * Some commonly used programs and files.
   */
  
! #define	ACTIVE_FILE	"/usr/lib/news/active"
! #define ACCESS_FILE	"/usr/lib/news/nntp_access"
! #define HISTORY_FILE	"/usr/lib/news/history"
  #define	SPOOLDIR	"/usr/spool/news/"		/* Need trailing / */
  #define INEWS		"/usr/lib/news/inews"
  #define RNEWS		"/usr/bin/rnews"		/* Link to inews? */
***************
*** 103,109
  #define ACCESS_FILE	"/usr/spool/news/lib/nntp_access"
  #define HISTORY_FILE	"/usr/spool/news/lib/history"
  #define	SPOOLDIR	"/usr/spool/news/"		/* Need trailing / */
! #define INEWS		"/usr/spool/news/lib/inews"
  #define RNEWS		"/usr/bin/rnews"		/* Link to inews? */
  
  /*

--- 126,132 -----
  #define ACCESS_FILE	"/usr/lib/news/nntp_access"
  #define HISTORY_FILE	"/usr/lib/news/history"
  #define	SPOOLDIR	"/usr/spool/news/"		/* Need trailing / */
! #define INEWS		"/usr/lib/news/inews"
  #define RNEWS		"/usr/bin/rnews"		/* Link to inews? */
  
  /*

Index: server/common.h
Prereq: 1.7
*** /tmp/,RCSt1020826	Mon Mar 30 16:49:30 1987
--- /tmp/,RCSt2020826	Mon Mar 30 16:49:30 1987
***************
*** 4,9
   * @(#)common.h	1.7	(Berkeley) 7/30/86
   */
  
  #include <sys/types.h>
  #include <sys/dir.h>
  #include <sys/stat.h>

--- 4,10 -----
   * @(#)common.h	1.7	(Berkeley) 7/30/86
   */
  
+ #include "../common/conf.h"
  #include <sys/types.h>
  #ifdef NDIR
  #include <ndir.h>
***************
*** 5,10
   */
  
  #include <sys/types.h>
  #include <sys/dir.h>
  #include <sys/stat.h>
  #include <errno.h>

--- 6,14 -----
  
  #include "../common/conf.h"
  #include <sys/types.h>
+ #ifdef NDIR
+ #include <ndir.h>
+ #else
  #include <sys/dir.h>
  #endif
  #include <sys/stat.h>
***************
*** 6,11
  
  #include <sys/types.h>
  #include <sys/dir.h>
  #include <sys/stat.h>
  #include <errno.h>
  #include <ctype.h>

--- 10,16 -----
  #include <ndir.h>
  #else
  #include <sys/dir.h>
+ #endif
  #include <sys/stat.h>
  #include <errno.h>
  #include <ctype.h>
***************
*** 12,17
  #include <pwd.h>
  #include <sys/wait.h>
  #include <sys/file.h>
  #include <syslog.h>
  #include <strings.h>
  #include "../common/response_codes.h"

--- 17,23 -----
  #include <pwd.h>
  #include <sys/wait.h>
  #include <sys/file.h>
+ #ifdef SYSLOG
  #include <syslog.h>
  #endif
  #ifdef SYSV
***************
*** 13,18
  #include <sys/wait.h>
  #include <sys/file.h>
  #include <syslog.h>
  #include <strings.h>
  #include "../common/response_codes.h"
  #include "../common/conf.h"

--- 19,29 -----
  #include <sys/file.h>
  #ifdef SYSLOG
  #include <syslog.h>
+ #endif
+ #ifdef SYSV
+ #include <string.h>
+ #include <fcntl.h>
+ #else
  #include <strings.h>
  #endif
  #include "../common/response_codes.h"
***************
*** 14,19
  #include <sys/file.h>
  #include <syslog.h>
  #include <strings.h>
  #include "../common/response_codes.h"
  #include "../common/conf.h"
  #ifdef DBM

--- 25,31 -----
  #include <fcntl.h>
  #else
  #include <strings.h>
+ #endif
  #include "../common/response_codes.h"
  #ifdef DBM
  #undef NULL			/* Such Joe Code ... */
***************
*** 15,21
  #include <syslog.h>
  #include <strings.h>
  #include "../common/response_codes.h"
- #include "../common/conf.h"
  #ifdef DBM
  #undef NULL			/* Such Joe Code ... */
  #include <dbm.h>

--- 27,32 -----
  #include <strings.h>
  #endif
  #include "../common/response_codes.h"
  #ifdef DBM
  #undef NULL			/* Such Joe Code ... */
  #include <dbm.h>

Index: server/parsit.c
Prereq: 1.1
*** /tmp/,RCSt1020427	Mon Mar 30 15:47:34 1987
--- /tmp/,RCSt2020427	Mon Mar 30 15:47:34 1987
***************
*** 47,53
  	argv = *array;
  	if (argv != (char **) NULL) {  /* Check to see if we should */
  		i = 0;		       /* free up the old array */
! 		do {
  			free(argv[i]);	/* If so, free each member */
  		} while (argv[i++] != (char *) NULL);
  		free((char *) argv);	/* and then free the ptr itself */

--- 47,53 -----
  	argv = *array;
  	if (argv != (char **) NULL) {  /* Check to see if we should */
  		i = 0;		       /* free up the old array */
! 		while (argv[i] != (char *) NULL){
  			free(argv[i]);	/* If so, free each member */
  			i++;
  		}
***************
*** 49,55
  		i = 0;		       /* free up the old array */
  		do {
  			free(argv[i]);	/* If so, free each member */
! 		} while (argv[i++] != (char *) NULL);
  		free((char *) argv);	/* and then free the ptr itself */
  	}
  

--- 49,56 -----
  		i = 0;		       /* free up the old array */
  		while (argv[i] != (char *) NULL){
  			free(argv[i]);	/* If so, free each member */
! 			i++;
! 		}
  		free((char *) argv);	/* and then free the ptr itself */
  	}
  
Index: server/newgroups.c
Prereq: 1.5
*** /tmp/,RCSt1020438	Mon Mar 30 15:48:04 1987
--- /tmp/,RCSt2020438	Mon Mar 30 15:48:04 1987
***************
*** 19,25
  {
  	char		line[MAX_STRLEN];
  	register char	*cp, *temp;
- 	static char	**dist_list = (char **) NULL;
  	int		distcount = 0;
  	int		i;
  	long		date;

--- 19,24 -----
  {
  	char		line[MAX_STRLEN];
  	register char	*cp, *temp;
  	int		distcount = 0;
  	int		i;
  	long		date;
***************
*** 25,30
  	long		date;
  	register FILE	*date_fp;
  	long		dtol();
  
  	if (argc < 3) {
  		printf("%d NEWGROUPS requires at least two arguments.\r\n",

--- 24,30 -----
  	long		date;
  	register FILE	*date_fp;
  	long		dtol();
+ 	char	**dist_list = (char **) NULL;
  
  	if (argc < 3) {
  		printf("%d NEWGROUPS requires at least two arguments.\r\n",

Index: server/newnews.c
Prereq: 1.7
*** /tmp/,RCSt1020463	Mon Mar 30 15:50:35 1987
--- /tmp/,RCSt2020463	Mon Mar 30 15:50:35 1987
***************
*** 484,490
  {
  	register int	histcount;
  	register char	*cp;
! 	static	char	**hist_list = (char **) NULL;
  
  	cp = index(list, '\n');
  	if (cp)

--- 484,490 -----
  {
  	register int	histcount;
  	register char	*cp;
! 	char	**hist_list = (char **) NULL;
  
  	cp = index(list, '\n');
  	if (cp)
***************
*** 515,521
  {
  	register char	*cp;
  	register int	ngcount;
! 	static	char	**ng_list = (char **) NULL;
  
  	for (cp = list; *cp != '\0'; ++cp)
  		if (*cp == ',')

--- 515,521 -----
  {
  	register char	*cp;
  	register int	ngcount;
! 	char	**ng_list = (char **) NULL;
  
  	for (cp = list; *cp != '\0'; ++cp)
  		if (*cp == ',')