This is patch #1 to nntp 1.5. Most of these patches deal with compatibility with System V. Problems: 1. strcascmp.c will not compile on System V if there is no typedef for an unsigned char. This is a common problem with many versions of System V. 2. main.c will not compile under EXCELAN because a structure is used before it is defined. 3. SIGCLD in System V is NOT the same as SIGCHLD under BSD. 4. actbuf must be explicitly defined under System V or free(actbuf) will core dump. 5. System V compilers do not tolerate including the same include file more than once. Repeat-By: Most of these manifest themselves in various compile-time errors. The SIGCHLD/SIGCLD problem manifest itself by the appearance of many zombie nntpd's whan doing a ps on the computer running nntpd. The actbuf problem is seen when many core files are found laying in the news spool directory of the news administrative directory for no obvious reason. Fix: Change directory to the nntp.1.5 server sources directory (the server subdirectory off the root directory) and use patch to apply these patches. Rebuild and reinstall nntpd once this is complete. Index: globals.c *** globals.c Sat Jul 18 01:38:30 1987 --- /mnt/crc/sob/src/nntp.1.5/server/globals.c Fri May 6 18:36:15 1988 *************** *** 25,30 **** --- 25,31 ---- */ char **group_array; + char *actbuf; int num_groups; int ingroup = 0; int art_ptr; Index: main.c *** main.c Sat Feb 6 17:45:07 1988 --- /mnt/crc/sob/src/nntp.1.5/server/main.c Sun Sep 18 21:40:34 1988 *************** *** 1,6 **** - #ifdef EXCELAN - struct sockaddr_in current_peer = { AF_INET, IPPORT_NNTP }; - #endif #ifndef lint static char *sccsid = "@(#)main.c 1.10 (Berkeley) 2/6/88"; #endif --- 1,3 ---- *************** *** 18,23 **** --- 15,22 ---- #include #ifndef EXCELAN #include + #else + struct sockaddr_in current_peer = { AF_INET, IPPORT_NNTP }; #endif #include *************** *** 50,62 **** #ifndef EXCELAN sockt = get_socket(); /* should be fd 4 or 5 */ ! #endif ! ! #ifndef USG (void) signal(SIGCHLD, reaper); #endif - #ifndef EXCELAN if (listen(sockt, SOMAXCONN) < 0) { #ifdef SYSLOG syslog(LOG_ERR, "main: listen: %m"); --- 49,60 ---- #ifndef EXCELAN sockt = get_socket(); /* should be fd 4 or 5 */ ! #ifdef USG ! (void) signal(SIGCLD, SIG_IGN); ! #else (void) signal(SIGCHLD, reaper); #endif if (listen(sockt, SOMAXCONN) < 0) { #ifdef SYSLOG syslog(LOG_ERR, "main: listen: %m"); *************** *** 64,76 **** exit(1); } #endif - for (;;) { #ifdef EXCELAN int status; sockt = get_socket(); if (sockt < 0) continue; client = accept(sockt, &from); #else length = sizeof (from); --- 62,78 ---- exit(1); } #endif for (;;) { #ifdef EXCELAN int status; + sockt = 3; sockt = get_socket(); if (sockt < 0) continue; + #ifdef USG + (void) signal(SIGCLD, SIG_IGN); + #endif + bzero((char *)&from,sizeof(from)); client = accept(sockt, &from); #else length = sizeof (from); *************** *** 78,84 **** --- 80,90 ---- #endif EXCELAN if (client < 0) { #ifdef SYSLOG + #ifdef EXCELAN + if (errno != EINTR && errno != 60 ) + #else if (errno != EINTR) + #endif syslog(LOG_ERR, "accept: %m\n"); #endif #ifdef EXCELAN *************** *** 109,114 **** --- 115,123 ---- (void) close(sockt); make_stdio(client); #endif + #ifdef USG + (void) signal(SIGCLD,SIG_DFL); + #endif serve(); break; *************** *** 115,121 **** default: #ifdef EXCELAN (void) close(sockt); - (void) wait(&status); #else (void) close(client); #endif --- 124,129 ---- Index: common.h *** common.h Wed Feb 10 10:37:41 1988 --- /mnt/crc/sob/src/nntp.1.5/server/common.h Fri May 6 18:36:14 1988 *************** *** 114,119 **** --- 114,120 ---- extern char rnews[]; extern char **group_array; + extern char *actbuf; extern int num_groups; extern char *homedir; extern int ingroup; Index: access_dnet.c *** access_dnet.c Sun Jan 24 00:52:44 1988 --- /mnt/crc/sob/src/nntp.1.5/server/access_dnet.c Fri May 6 18:36:14 1988 *************** *** 1,9 **** - #include - #include - #include - #include "common.h" ! #ifdef DECNET #ifndef lint --- 1,5 ---- #include "common.h" ! #include #ifdef DECNET #ifndef lint Index: active.c *** active.c Tue Jan 12 01:53:08 1988 --- /mnt/crc/sob/src/nntp.1.5/server/active.c Fri May 6 18:36:14 1988 *************** *** 32,38 **** { register int i; register int act_fd; ! register char *actbuf, *cp, *end; char *malloc(); struct stat statbuf; --- 32,38 ---- { register int i; register int act_fd; ! register char *cp, *end; char *malloc(); struct stat statbuf; *************** *** 42,48 **** */ if (num_groups != 0) { ! (void) free(group_array[0]); /* Assume [0] -> actbuf */ (void) free(group_array); } --- 42,48 ---- */ if (num_groups != 0) { ! (void) free(actbuf); (void) free(group_array); } Index: misc.c *** misc.c Sun Feb 7 00:29:33 1988 --- /mnt/crc/sob/src/nntp.1.5/server/misc.c Sun Sep 18 21:40:29 1988 *************** *** 2,9 **** static char *sccsid = "@(#)misc.c 1.25 (Berkeley) 2/6/88"; #endif - #include "../common/conf.h" - #include "common.h" /* --- 2,7 ---- *************** *** 292,299 **** } } (void) rewind(fp); ! if (ngcount == 0) /* Either no newgroups or null entry */ return (1); --- 290,300 ---- } } + #ifndef USG (void) rewind(fp); ! #else ! rewind(fp); ! #endif if (ngcount == 0) /* Either no newgroups or null entry */ return (1); *************** *** 416,428 **** --- 417,437 ---- (void) strcpy(id, cp + 1); if ((cp = index(id, '\n')) != NULL) *cp = '\0'; + #ifndef USG (void) rewind(art_fp); + #else + rewind(art_fp); + #endif return; } } } } + #ifndef USG (void) rewind(art_fp); + #else + rewind(art_fp); + #endif (void) strcpy(id, "<0>"); } *************** *** 541,547 **** /* the following is from news 2.11 */ ! #ifdef USG /* ** Generate the appropriate history subfile name */ --- 550,556 ---- /* the following is from news 2.11 */ ! #ifdef USGHIST /* ** Generate the appropriate history subfile name */ *************** *** 572,577 **** --- 581,588 ---- chr = '0'; return chr; } + #endif USGHIST + #ifdef USG bcopy(s, d, l) register char *s, *d; register int l; Index: spawn.c *** spawn.c Sat Feb 6 17:45:12 1988 --- /mnt/crc/sob/src/nntp.1.5/server/spawn.c Fri May 6 18:36:18 1988 *************** *** 2,9 **** static char *sccsid = "@(#)spawn.c 1.6 (Berkeley) 2/6/88"; #endif - #include "../common/conf.h" - #include "common.h" #include --- 2,7 ---- Index: strcasecmp.c *** strcasecmp.c Sun Feb 7 01:38:45 1988 --- /mnt/crc/sob/src/nntp.1.5/server/strcasecmp.c Sun Sep 18 21:41:24 1988 *************** *** 15,20 **** --- 15,23 ---- #endif /* LIBC_SCCS and not lint */ #include + #ifndef u_char + #define u_char unsigned char; + #endif /* * This array is designed for mapping upper and lower case letter