rick@seismo.CSS.GOV (Rick Adams) (11/04/87)
Description: This is patch #12 for news 2.11 src. Fixes from Stan Barber for the NNTP server code: 1. The mailpaths file is no longer needed for posting to moderated groups. The article will be sent to the server host which will do the mailing. 2. The 'L' and 'l' commands did not work in readnews and vnews. They will work with either nntp 1.3 or nntp 1.4 now. 3. Modifications were made to the nntp initialization code to allow the use of nntp clientlib from either nntp 1.3 or nntp 1.4. Some functions still require nntp 1.4, but as originally written, the version 1.3 nntp clientlib would not work. Now it will. 4. postnews was modified to cleanup all the temporary files it creates when using nntp. It will also work correctly for followups. It did not do this correctly in the original release. 5. As distributed, the nntp code would not compile unless you had already moved the code needed to create nntpxmit into the news src directory. That is now no longer necessary. Various minor cleanups. Sendbatch now is a lot smarter about how much it will queue up at once. If MAXBATCH is set, it will only queue up that many bytes per invocation. Default is 100,000,000 for backwards compatibility. checkgroups output now has some lines preceeded by # so you could just run the output through "sh" if you agreeded with it. Fix expire to run correctly on non-DBM systems. Fullname now should understand ATT style GCOS fields better. Add -v flag to inews to print message-id (useful with Superceeds line) Fix PREFIX macro to be case independent like prefix subroutine. Fix recnews -a to work on machines that don't allow null dereferencing. Fix: cd to the src directory and apply the following patch. Index: Makefile.dst Prereq: 1.26 *** .d/Makefile.dst Sun Oct 18 18:02:45 1987 --- Makefile.dst Wed Nov 4 12:49:14 1987 *************** *** 1,2 **** ! # '@(#)Makefile.dst 1.26 10/15/87' # Generic Makefile. --- 1,2 ---- ! # '@(#)Makefile.dst 1.27 11/4/87' # Generic Makefile. *************** *** 30,32 **** --- 30,35 ---- UUXFLAGS = -r -z + MAXPERBATCH = 1000000000 + #NNTP NNTPDIR = NNTPSRC + LNRNEWS = ln *************** *** 36,38 **** ! #NNTP SERVER= -DSERVER --- 39,41 ---- ! #NNTP SERVER= -DSERVER -I$(NNTPDIR)/common *************** *** 96,98 **** ! #NNTP CSRCS = NNTPSRC/common/clientlib.c nntp.c --- 99,101 ---- ! #NNTP CSRCS = $(NNTPDIR)/common/clientlib.c nntp.c *************** *** 189,192 **** ! #NNTP clientlib.o: NNTPSRC/common/clientlib.c ! #NNTP $(CC) $(CFLAGS) -c NNTPSRC/common/clientlib.c --- 192,195 ---- ! #NNTP clientlib.o: $(NNTPDIR)/common/clientlib.c ! #NNTP $(CC) $(CFLAGS) -c $(NNTPDIR)/common/clientlib.c *************** *** 307,308 **** --- 310,312 ---- -e "s%UUXFLAGS%$(UUXFLAGS)%g" \ + -e "s%MAXPERBATCH%$(MAXPERBATCH)%g" \ -e "s%BATCHDIR%$(BATCHDIR)%g" sendbatch.sh > sendbatch Index: checkgroups.sh Prereq: 1.23 *** .d/checkgroups.sh Wed Oct 7 16:48:31 1987 --- checkgroups.sh Wed Nov 4 12:49:15 1987 *************** *** 1,3 **** : check active file for missing or extra newsgroups ! : '@(#)checkgroups 1.23 9/24/87' --- 1,3 ---- : check active file for missing or extra newsgroups ! : '@(#)checkgroups 1.24 11/4/87' *************** *** 69,74 **** ( ! echo "The following newsgroups are non-standard." ! sed "s/^/ /" /tmp/$$remove echo "" ! echo "You can remove them by executing the commands:" echo \ LIBDIR/rmgroup `cat /tmp/$$remove` --- 69,74 ---- ( ! echo "# The following newsgroups are non-standard." ! sed "s/^/# /" /tmp/$$remove echo "" ! echo "# You can remove them by executing the commands:" echo \ LIBDIR/rmgroup `cat /tmp/$$remove` *************** *** 81,86 **** ( ! echo "The following newsgroups were missing and should be added." ! sed "s/^/ /" /tmp/$$add echo "" ! echo "You can do this by executing the command(s):" for i in `cat /tmp/$$add.unmod` --- 81,86 ---- ( ! echo "# The following newsgroups were missing and should be added." ! sed "s/^/# /" /tmp/$$add echo "" ! echo "# You can do this by executing the command(s):" for i in `cat /tmp/$$add.unmod` *************** *** 100,105 **** ( ! echo "The following newsgroups are not moderated and are marked moderated." ! sed "s/^/ /" /tmp/$$ismod echo "" ! echo "You can correct this by executing the command(s):" for i in `cat /tmp/$$ismod` --- 100,105 ---- ( ! echo "# The following newsgroups are not moderated and are marked moderated." ! sed "s/^/# /" /tmp/$$ismod echo "" ! echo "# You can correct this by executing the command(s):" for i in `cat /tmp/$$ismod` *************** *** 115,120 **** ( ! echo "The following newsgroups are moderated and not marked so." ! sed "s/^/ /" /tmp/$$notmod echo "" ! echo "You can correct this by executing the command(s):" for i in `cat /tmp/$$notmod` --- 115,120 ---- ( ! echo "# The following newsgroups are moderated and not marked so." ! sed "s/^/# /" /tmp/$$notmod echo "" ! echo "# You can correct this by executing the command(s):" for i in `cat /tmp/$$notmod` *************** *** 134,135 **** --- 134,136 ---- then + PATH=/bin:$PATH mail $1 *************** *** 142,143 **** rm -f /tmp/$$* - --- 143 ---- Index: control.c Prereq: 2.55 *** .d/control.c Thu Oct 8 00:19:19 1987 --- control.c Wed Nov 4 12:49:17 1987 *************** *** 21,23 **** #ifdef SCCSID ! static char *SccsId = "@(#)control.c 2.55 10/7/87"; #endif /* SCCSID */ --- 21,23 ---- #ifdef SCCSID ! static char *SccsId = "@(#)control.c 2.56 11/4/87"; #endif /* SCCSID */ *************** *** 26,28 **** ! #define eq(msg) (msg[0] == cargv[0][0] && strcmp(msg, cargv[0]) == 0) --- 26,28 ---- ! #define eq(msg) (STRCMP(msg, cargv[0]) == 0) *************** *** 65,67 **** ! if (strncmp(h->title, "cmsg ", 5) == 0) { register char *cp1, *cp2; --- 65,67 ---- ! if (STRNCMP(h->title, "cmsg ", 5) == 0) { register char *cp1, *cp2; *************** *** 171,173 **** error("ihave: Too few arguments."); ! if (strncmp(PATHSYSNAME, argv[argc - 1], SNLN) == 0) return 0; --- 171,173 ---- error("ihave: Too few arguments."); ! if (STRNCMP(PATHSYSNAME, argv[argc - 1], SNLN) == 0) return 0; *************** *** 256,258 **** error("sendme: Too few arguments."); ! if (strncmp(PATHSYSNAME, argv[argc - 1], SNLN) == 0) return 0; --- 256,258 ---- error("sendme: Too few arguments."); ! if (STRNCMP(PATHSYSNAME, argv[argc - 1], SNLN) == 0) return 0; *************** *** 348,351 **** /* local or ORGDISTRIB */ ! int can_change = (strcmp(header.distribution, "local") == 0) || ! (strcmp(header.distribution, ORGDISTRIB) == 0); # else /* ! ORGDISTRIB */ --- 348,351 ---- /* local or ORGDISTRIB */ ! int can_change = (STRCMP(header.distribution, "local") == 0) || ! (STRCMP(header.distribution, ORGDISTRIB) == 0); # else /* ! ORGDISTRIB */ *************** *** 352,354 **** /* local only */ ! int can_change = strcmp(header.distribution, "local") == 0; # endif /* ORGDISTRIB */ --- 352,354 ---- /* local only */ ! int can_change = STRCMP(header.distribution, "local") == 0; # endif /* ORGDISTRIB */ *************** *** 379,381 **** p -= 3; ! if (argc > 2 && strcmp(argv[2], "moderated") == 0) { if (*p == 'm') { --- 379,381 ---- p -= 3; ! if (argc > 2 && STRCMP(argv[2], "moderated") == 0) { if (*p == 'm') { *************** *** 462,464 **** fprintf(actfp, "%s 00000 00001 %c\n", argv[1], ! (argc > 2 && strcmp(argv[2], "moderated") == 0) ? 'm' : 'y'); --- 462,464 ---- fprintf(actfp, "%s 00000 00001 %c\n", argv[1], ! (argc > 2 && STRCMP(argv[2], "moderated") == 0) ? 'm' : 'y'); *************** *** 546,551 **** */ ! if (!strcmp(ORGDISTRIB, header.distribution) ! || !strcmp("local", header.distribution)) #else /* !ORGDISTRIB */ ! if (!strcmp("local", header.distribution)) #endif /* !ORGDISTRIB */ --- 546,551 ---- */ ! if (!STRCMP(ORGDISTRIB, header.distribution) ! || !STRCMP("local", header.distribution)) #else /* !ORGDISTRIB */ ! if (!STRCMP("local", header.distribution)) #endif /* !ORGDISTRIB */ *************** *** 644,646 **** } ! if (strcmp(p, "cancelled") == 0) { *q = '\0'; --- 644,646 ---- } ! if (STRCMP(p, "cancelled") == 0) { *q = '\0'; *************** *** 652,656 **** #ifdef ORGDISTRIB ! strcmp(header.distribution, ORGDISTRIB) == 0 || #endif /* ORGDISTRIB */ ! strcmp(header.distribution, "local") == 0)) su = 1; --- 652,656 ---- #ifdef ORGDISTRIB ! STRCMP(header.distribution, ORGDISTRIB) == 0 || #endif /* ORGDISTRIB */ ! STRCMP(header.distribution, "local") == 0)) su = 1; *************** *** 684,686 **** *r = '\0'; ! if (!su && strncmp(whatsisname, poster,strlen(poster))) { error("Not contributor: posted by %s, and you are %s", poster, whatsisname); --- 684,686 ---- *r = '\0'; ! if (!su && STRNCMP(whatsisname, poster, strlen(poster))) { error("Not contributor: posted by %s, and you are %s", poster, whatsisname); *************** *** 867,869 **** #endif /* MMDF */ - execl("/usr/bin/mailx", "mail", sendto, (char *)NULL); execl("/usr/bin/mail", "mail", sendto, (char *)NULL); --- 867,868 ---- *************** *** 871,872 **** --- 870,872 ---- execl("/bin/mail", "mail", sendto, (char *)NULL); + execl("/usr/bin/mailx", "mail", sendto, (char *)NULL); _exit(1); *************** *** 990,1007 **** ! if (strcmp(msg, "ihave") == 0 || strcmp(msg, "sendbad") == 0 || ! strcmp(msg, "sendme") == 0) { return; /* no restrictions */ ! } else if (strcmp(msg, "newgroup") == 0) { suser(); ! } else if (strcmp(msg, "rmgroup") == 0) { suser(); ! } else if (strcmp(msg, "sendsys") == 0) { suser(); ! } else if (strcmp(msg, "checkgroups") == 0) { suser(); ! } else if (strcmp(msg, "version") == 0) { return; /* no restrictions */ ! } else if (strcmp(msg, "cancel") == 0) { return; /* no restrictions at this level */ ! } else if (strcmp(msg, "delsub") == 0) { if (!PREFIX(header.nbuf, "to.")) { --- 990,1007 ---- ! if (STRCMP(msg, "ihave") == 0 || STRCMP(msg, "sendbad") == 0 || ! STRCMP(msg, "sendme") == 0) { return; /* no restrictions */ ! } else if (STRCMP(msg, "newgroup") == 0) { suser(); ! } else if (STRCMP(msg, "rmgroup") == 0) { suser(); ! } else if (STRCMP(msg, "sendsys") == 0) { suser(); ! } else if (STRCMP(msg, "checkgroups") == 0) { suser(); ! } else if (STRCMP(msg, "version") == 0) { return; /* no restrictions */ ! } else if (STRCMP(msg, "cancel") == 0) { return; /* no restrictions at this level */ ! } else if (STRCMP(msg, "delsub") == 0) { if (!PREFIX(header.nbuf, "to.")) { Index: expire.c Prereq: 2.55 *** .d/expire.c Sun Oct 18 18:03:26 1987 --- expire.c Wed Nov 4 12:49:18 1987 *************** *** 19,21 **** #ifdef SCCSID ! static char *SccsId = "@(#)expire.c 2.55 10/15/87"; #endif /* SCCSID */ --- 19,21 ---- #ifdef SCCSID ! static char *SccsId = "@(#)expire.c 2.56 11/4/87"; #endif /* SCCSID */ *************** *** 363,364 **** --- 363,365 ---- ohfd = xfopen(ARTFILE, "r"); + nhfd = xfopen(NARTFILE, "w"); #else *************** *** 365,368 **** ohfd = nexthistfile((FILE *)NULL); #endif /* DBM */ - nhfd = xfopen(NARTFILE, "w"); } --- 366,369 ---- ohfd = nexthistfile((FILE *)NULL); + nhfd = xfopen(ARTFILE, "w"); #endif /* DBM */ } Index: fullname.c Prereq: 1.12 *** .d/fullname.c Wed Oct 7 16:50:45 1987 --- fullname.c Wed Nov 4 12:49:19 1987 *************** *** 16,18 **** #ifdef SCCSID ! static char *SccsId = "@(#)fullname.c 1.12 9/24/87"; #endif /* SCCSID */ --- 16,18 ---- #ifdef SCCSID ! static char *SccsId = "@(#)fullname.c 1.13 11/4/87"; #endif /* SCCSID */ *************** *** 127,129 **** { ! if (*p == '-' && isspace(p[1])) { bp = buf; --- 127,129 ---- { ! if (*p == '-' && (isdigit(p[-1]) || isspace(p[-1]))) { bp = buf; Index: funcs2.c Prereq: 1.22 *** .d/funcs2.c Sun Oct 18 18:03:38 1987 --- funcs2.c Wed Nov 4 12:49:20 1987 *************** *** 19,21 **** #ifdef SCCSID ! static char *SccsId = "@(#)funcs2.c 1.22 10/15/87"; #endif /* SCCSID */ --- 19,21 ---- #ifdef SCCSID ! static char *SccsId = "@(#)funcs2.c 1.23 11/4/87"; #endif /* SCCSID */ *************** *** 203,211 **** lasttime = getdate(datestr, &Now); ! if (lasttime < 0 && ! sscanf(datestr, "%s %s %s %s %s", junk, month, day, tod, year) == 5) { ! (void) sprintf(bfr, "%s %s, %s %s", month, day, year, tod); ! lasttime = getdate(bfr, &Now); if (lasttime < 0) { ! logerr("Unparsable date \"%s\"", datestr); ! datestr = "now"; /* better than nothing */ lasttime = Now.time; --- 203,214 ---- lasttime = getdate(datestr, &Now); ! if (lasttime < 0) { ! logerr("Unparsable date \"%s\"", datestr); ! if (sscanf(datestr, "%s %s %s %s %s", junk, month, day, tod, ! year) == 5) { ! (void) sprintf(bfr, "%s %s, %s %s", month, day, year, ! tod); ! lasttime = getdate(bfr, &Now); ! } if (lasttime < 0) { ! datestr = "now"; /* better than nothing */ lasttime = Now.time; *************** *** 340,342 **** ptr = hptr->replyto; ! #endif (void) strcpy(tbuf, ptr); --- 343,345 ---- ptr = hptr->replyto; ! #endif /* !INTERNET */ (void) strcpy(tbuf, ptr); *************** *** 348,349 **** --- 351,353 ---- } + #ifndef SERVER #ifdef SunIII *************** *** 350,352 **** if (ptr = rindex(tbuf, '.')) { ! if (PREFIX(++ptr, "OZ")) { /* some people only allow it in lower case ... */ --- 354,356 ---- if (ptr = rindex(tbuf, '.')) { ! if (prefix(++ptr, "OZ")) { /* some people only allow it in lower case ... */ *************** *** 406,408 **** if (sscanf(mbuf, "%*s %s", modadd) != 1) ! xerror("backbone address corrupted"); (void) fclose(mfd); --- 410,412 ---- if (sscanf(mbuf, "%*s %s", modadd) != 1) ! xerror("internet address corrupted"); (void) fclose(mfd); *************** *** 429,430 **** --- 433,435 ---- #endif /* !SunIII */ + #endif /* !SERVER */ return tbuf; Index: inews.c Prereq: 2.82 *** .d/inews.c Sun Oct 18 18:03:53 1987 --- inews.c Wed Nov 4 12:49:22 1987 *************** *** 19,21 **** #ifdef SCCSID ! static char *SccsId = "@(#)inews.c 2.82 10/15/87"; #endif /* SCCSID */ --- 19,21 ---- #ifdef SCCSID ! static char *SccsId = "@(#)inews.c 2.83 11/4/87"; #endif /* SCCSID */ *************** *** 93,94 **** --- 93,96 ---- 'r', '\0', FALSE, UNPROC, UNKNOWN, header.replyto, + #define vflag options[17].flag + 'v', '\0', FALSE, UNPROC, UNKNOWN, filename, '\0', '\0', 0, 0, 0, (char *)NULL *************** *** 159,161 **** #ifdef SPOOLNEWS ! if (argc > 1 && !strcmp(*(argv+1), "-S")) { argc--; --- 161,163 ---- #ifdef SPOOLNEWS ! if (argc > 1 && !STRCMP(*(argv+1), "-S")) { argc--; *************** *** 180,182 **** } else { /* expire is running */ ! if (argc > 1 && !strcmp(*(argv+1), "-S")) exit(42); /* inform rnews -U by exit status */ --- 182,184 ---- } else { /* expire is running */ ! if (argc > 1 && !STRCMP(*(argv+1), "-S")) exit(42); /* inform rnews -U by exit status */ *************** *** 183,185 **** } ! if (argc > 1 && !strcmp(*(argv+1), "-U")) { /* can't unspool while things are locked */ --- 185,187 ---- } ! if (argc > 1 && !STRCMP(*(argv+1), "-U")) { /* can't unspool while things are locked */ *************** *** 1031,1032 **** --- 1033,1038 ---- if(exitcode == 0) { + if (vflag) { + printf("%s\n", header.ident); + fflush(stdout); + } /* article has passed all the checks, so work in background */ *************** *** 1093,1095 **** if ((cp = rindex(header.title, '-')) != NULL ! && !strcmp(--cp, " - (nf)")) *cp = '\0'; --- 1099,1101 ---- if ((cp = rindex(header.title, '-')) != NULL ! && !STRCMP(--cp, " - (nf)")) *cp = '\0'; *************** *** 1268,1270 **** /* stop when get to last known good parent */ ! if (strcmp(sysbuf, parent) == 0) break; --- 1274,1276 ---- /* stop when get to last known good parent */ ! if (STRCMP(sysbuf, parent) == 0) break; Index: nntp.c Prereq: 2.2 *** .d/nntp.c Sun Oct 18 18:04:03 1987 --- nntp.c Wed Nov 4 12:49:23 1987 *************** *** 16,18 **** #ifdef SCCSID ! static char *SccsId = "@(#)nntp.c 2.2 10/15/87"; #endif /* SCCSID */ --- 16,18 ---- #ifdef SCCSID ! static char *SccsId = "@(#)nntp.c 2.3 11/4/87"; #endif /* SCCSID */ *************** *** 21,22 **** --- 21,25 ---- + /* from nntp's common directory */ + #include "conf.h" + static char *nntpserver; *************** *** 34,36 **** /* open connection to nntpserver if appropriate */ ! nntpserver = getserverbyfile(SERVER_FILE); --- 37,41 ---- /* open connection to nntpserver if appropriate */ ! #ifdef SERVER_HOST ! nntpserver = SERVER_HOST; ! #else /* !SERVER_HOST */ nntpserver = getserverbyfile(SERVER_FILE); *************** *** 42,43 **** --- 47,49 ---- } + #endif /* !SERVER_HOST */ response = server_init(nntpserver); *************** *** 48,49 **** --- 54,56 ---- } + #ifndef SERVER_HOST if (handle_server_response(response, nntpserver) < 0) { *************** *** 52,53 **** --- 59,61 ---- } + #endif /* !SERVER_HOST */ return 0; *************** *** 114,123 **** return NULL; ! if (strcmp(newsgroup, last_group)) { ! (void) sprintf(nntpbfr, "GROUP %s", newsgroup); ! put_server(nntpbfr); ! (void) get_server(ser_line, sizeof(ser_line)); ! if (*ser_line != CHAR_OK) ! return NULL; ! strcpy(last_group, newsgroup); ! } return &ser_line[0]; --- 122,129 ---- return NULL; ! (void) sprintf(nntpbfr, "GROUP %s", newsgroup); ! put_server(nntpbfr); ! (void) get_server(ser_line, sizeof(ser_line)); ! if (*ser_line != CHAR_OK) ! return NULL; ! strcpy(last_group, newsgroup); return &ser_line[0]; *************** *** 137,140 **** bzero(article_file_name, sizeof(article_file_name)); ! if (set_group(newsgroup) == NULL) ! return NULL; strcpy(article_file_name, "/tmp/nsart.XXXXXX"); --- 143,148 ---- bzero(article_file_name, sizeof(article_file_name)); ! if (strcmp(newsgroup,last_group)){ ! if (set_group(newsgroup) == NULL) ! return NULL; ! } strcpy(article_file_name, "/tmp/nsart.XXXXXX"); *************** *** 228,230 **** */ - sync_server() --- 236,237 ---- Index: params.h Prereq: 2.25 *** .d/params.h Sun Oct 18 18:04:06 1987 --- params.h Wed Nov 4 12:49:23 1987 *************** *** 4,6 **** ! /* @(#)params.h 2.25 10/15/87 */ --- 4,6 ---- ! /* @(#)params.h 2.26 11/4/87 */ *************** *** 159,161 **** #define STRNCMP(a,b,n) ((*(a) != *(b)) ? (*(a)-*(b)) : strncmp(a, b, n)) ! #define PREFIX(a,b) ((*(a) != *(b)) ? FALSE : prefix((a)+1, (b)+1)) --- 159,162 ---- #define STRNCMP(a,b,n) ((*(a) != *(b)) ? (*(a)-*(b)) : strncmp(a, b, n)) ! extern char charmap[]; ! #define PREFIX(a,b) ((charmap[*(a)] != charmap[*(b)]) ? FALSE : prefix((a)+1, (b)+1)) Index: postnews.c Prereq: 1.33 *** .d/postnews.c Sun Oct 18 18:04:16 1987 --- postnews.c Wed Nov 4 12:49:24 1987 *************** *** 19,21 **** #ifdef SCCSID ! static char *SccsId = "@(#)postnews.c 1.33 10/15/87"; #endif /* SCCSID */ --- 19,21 ---- #ifdef SCCSID ! static char *SccsId = "@(#)postnews.c 1.34 11/4/87"; #endif /* SCCSID */ *************** *** 26,28 **** extern int ROOTID; ! # endif #define APPEND 1 --- 26,28 ---- extern int ROOTID; ! # endif /* !ROOTID */ #define APPEND 1 *************** *** 74,75 **** --- 74,96 ---- xerror("Can only followup to articles in %s", SPOOL); + #ifdef SERVER + { + int artnum; + char * group, *p; + strcpy (buf,argv[1]); + if ((group = rindex(buf,'/')) == NULL) + xerror("Can't get article number"); + *group = '\0'; + artnum = atoi(++group); + if (artnum == 0) + xerror("Can't get article number"); + group = &buf[strlen(SPOOL) + 1]; + for (p=group; *p ;++p) + if (*p == '/') + *p = '.'; + if (getarticle(group,artnum,"ARTICLE") == NULL) + xerror("Can't find article"); + } + followup(article_name()); + (void) strcpy(original, article_name()); + #else /* !SERVER */ followup(argv[1]); *************** *** 76,77 **** --- 97,99 ---- (void) strcpy(original, argv[1]); + #endif /* !SERVER */ } else *************** *** 110,112 **** #ifdef SERVER ! if (getarticle(ng, num, "ARTICLE") == NULL) goto nothere; --- 132,134 ---- #ifdef SERVER ! if (getarticle(ng, atoi(num), "ARTICLE") == NULL) goto nothere; *************** *** 123,125 **** --- 145,151 ---- (void) close(fd); + #ifdef SERVER + printf("\narticle %s in %s\n", num, ng); + #else /* !SERVER */ printf("\narticle %s\n", original); + #endif /* !SERVER */ if (article_line(original, "From: ", buf)) *************** *** 157,159 **** if (pre_checks()) ! exit(1); --- 183,185 ---- if (pre_checks()) ! xxit(1); *************** *** 175,177 **** (void) UNLINK(tempfname); ! exit(1); } --- 201,203 ---- (void) UNLINK(tempfname); ! xxit(1); } *************** *** 495,497 **** (void) UNLINK(tempfname); ! exit(1); } --- 521,523 ---- (void) UNLINK(tempfname); ! xxit(1); } *************** *** 500,502 **** (void) UNLINK(tempfname); ! exit(1); } --- 526,528 ---- (void) UNLINK(tempfname); ! xxit(1); } *************** *** 506,508 **** (void) UNLINK(tempfname); ! exit(1); } --- 532,534 ---- (void) UNLINK(tempfname); ! xxit(1); } *************** *** 520,522 **** (void) UNLINK(tempfname); ! exit(1); } --- 546,548 ---- (void) UNLINK(tempfname); ! xxit(1); } *************** *** 534,536 **** (void) UNLINK(tempfname); ! exit(1); } --- 560,562 ---- (void) UNLINK(tempfname); ! xxit(1); } *************** *** 715,719 **** } - (void) UNLINK(tempfname); ! exit(0); } --- 741,744 ---- } (void) UNLINK(tempfname); ! xxit(0); } *************** *** 738,740 **** fprintf(stderr,"You're not in /etc/passwd\n"); ! exit(1); } --- 763,765 ---- fprintf(stderr,"You're not in /etc/passwd\n"); ! xxit(1); } *************** *** 828,830 **** fprintf(stderr,"Too many EOFs\n"); ! exit(1); } --- 853,855 ---- fprintf(stderr,"Too many EOFs\n"); ! xxit(1); } *************** *** 838,840 **** printf("%s\n", mesg); ! exit(1); } --- 863,865 ---- printf("%s\n", mesg); ! xxit(1); } *************** *** 1097,1099 **** printf("encoding failed"); ! exit(2); } --- 1122,1124 ---- printf("encoding failed"); ! xxit(2); } *************** *** 1148,1149 **** --- 1173,1178 ---- { + #ifdef SERVER + (void) UNLINK(original); + (void) UNLINK(active_name()); + #endif /* SERVER */ exit(i); Index: readr.c Prereq: 2.64 *** .d/readr.c Fri Oct 16 18:22:16 1987 --- readr.c Wed Nov 4 12:49:26 1987 *************** *** 18,20 **** #ifdef SCCSID ! static char *SccsId = "@(#)readr.c 2.64 10/16/87"; #endif /* SCCSID */ --- 18,20 ---- #ifdef SCCSID ! static char *SccsId = "@(#)readr.c 2.65 11/4/87"; #endif /* SCCSID */ *************** *** 98,100 **** fprintf(stderr, "readr()\n"); ! #endif if (aflag) { --- 98,100 ---- fprintf(stderr, "readr()\n"); ! #endif /* DEBUG */ if (aflag) { *************** *** 136,138 **** fp, ftell(fp), bit, groupdir, filename); ! #endif #ifndef SERVER --- 136,138 ---- fp, ftell(fp), bit, groupdir, filename); ! #endif /* DEBUG */ #ifndef SERVER *************** *** 160,162 **** int (*ocont)(); ! #endif (void) setjmp(sigjmpbuf); --- 160,162 ---- int (*ocont)(); ! #endif /* SIGCONT */ (void) setjmp(sigjmpbuf); *************** *** 185,187 **** ocont = signal(SIGCONT, catchcont); ! #endif pp = fgets(bptr, BUFLEN, stdin); --- 185,187 ---- ocont = signal(SIGCONT, catchcont); ! #endif /* SIGCONT */ pp = fgets(bptr, BUFLEN, stdin); *************** *** 191,193 **** (void) signal(SIGCONT, ocont); ! #endif if (pp != NULL) --- 191,193 ---- (void) signal(SIGCONT, ocont); ! #endif /* SIGCONT */ if (pp != NULL) *************** *** 198,200 **** if (SigTrap != SIGCONT) ! #endif fprintf(ofp, "\n"); --- 198,200 ---- if (SigTrap != SIGCONT) ! #endif /* SIGCONT */ fprintf(ofp, "\n"); *************** *** 455,457 **** /* mail reply */ ! #endif case 'r': --- 455,457 ---- /* mail reply */ ! #endif /* !NOSHELL */ case 'r': *************** *** 581,583 **** --- 581,588 ---- tfilename = filename; + #ifdef SERVER + (void) sprintf(bfr,"%s/%s %s/%s/%ld", BIN, "postnews", + SPOOL,groupdir,bit); + #else /* !SERVER */ (void) sprintf(bfr,"%s/%s %s", BIN, "postnews", tfilename); + #endif /* !SERVER */ (void) system(bfr); *************** *** 962,964 **** else ! #endif tprint(fd, ofp, FALSE); --- 967,969 ---- else ! #endif /* PAGE */ tprint(fd, ofp, FALSE); *************** *** 1033,1035 **** fprintf(stderr, "article: %s/%ld\n", groupdir, bit); ! #endif if (rcreadok) --- 1038,1040 ---- fprintf(stderr, "article: %s/%ld\n", groupdir, bit); ! #endif /* DEBUG */ if (rcreadok) *************** *** 1037,1039 **** #ifdef SERVER ! if ((fp = getarticle(groupdir, bit, "ARTICLE")) == NULL) goto badart; --- 1042,1044 ---- #ifdef SERVER ! if (bit == 0 || (fp = getarticle(groupdir, bit, "ARTICLE")) == NULL) goto badart; *************** *** 1062,1064 **** fprintf(stderr, "filename = '%s'\n", filename); ! #endif /* Decide if we want to show this article. */ --- 1067,1069 ---- fprintf(stderr, "filename = '%s'\n", filename); ! #endif /* DEBUG */ /* Decide if we want to show this article. */ Index: recnews.c Prereq: 2.14 *** .d/recnews.c Sun Oct 18 18:04:27 1987 --- recnews.c Wed Nov 4 12:49:27 1987 *************** *** 48,50 **** #ifdef SCCSID ! static char *SccsId = "@(#)recnews.c 2.14 10/15/87"; #endif /* SCCSID */ --- 48,50 ---- #ifdef SCCSID ! static char *SccsId = "@(#)recnews.c 2.15 11/4/87"; #endif /* SCCSID */ *************** *** 111,115 **** sprintf(inews, "%s/%s/%s", logdir(HOME), LIBDIR, "inews"); ! #else sprintf(inews, "%s/%s", LIBDIR, "inews"); ! #endif --- 111,115 ---- sprintf(inews, "%s/%s/%s", logdir(HOME), LIBDIR, "inews"); ! #else /* !LOGDIR */ sprintf(inews, "%s/%s", LIBDIR, "inews"); ! #endif /* !LOGDIR */ *************** *** 120,123 **** if (argc > 3 && *argv[3]) { ! sprintf(approved,"-a %s", argv[3]); ! } --- 120,124 ---- if (argc > 3 && *argv[3]) { ! sprintf(approved," -a \"%s\"", argv[3]); ! } else ! approved[0] = '\0'; *************** *** 195,199 **** sprintf(cmdbuf, ! "exec %s -t \"%s\" -n \"%s\" -f \"%s\" %s", inews, *subject ? subject : "(none)", ! newsgroup, from, *approved ? approved : 0); #ifdef debug --- 196,200 ---- sprintf(cmdbuf, ! "exec %s -t \"%s\" -n \"%s\" -f \"%s\"%s", inews, *subject ? subject : "(none)", ! newsgroup, from, approved); #ifdef debug *************** *** 223,227 **** sprintf(cmdbuf, ! "exec \"%s\" -t \"%s\" -n \"%s\" -f \"%s\" %s", ! inews, subject, newsgroup, from, ! *approved ? approved : 0); #ifdef debug --- 224,227 ---- sprintf(cmdbuf, ! "exec \"%s\" -t \"%s\" -n \"%s\" -f \"%s\"%s", ! inews, subject, newsgroup, from, approved); #ifdef debug Index: rfuncs.c Prereq: 2.42 *** .d/rfuncs.c Sun Oct 18 18:04:33 1987 --- rfuncs.c Wed Nov 4 12:49:29 1987 *************** *** 18,20 **** #ifdef SCCSID ! static char *SccsId = "@(#)rfuncs.c 2.42 10/15/87"; #endif /* SCCSID */ --- 18,20 ---- #ifdef SCCSID ! static char *SccsId = "@(#)rfuncs.c 2.43 11/4/87"; #endif /* SCCSID */ *************** *** 35,37 **** fprintf(stderr, "nextng()\n"); ! #endif curpos = ftell(actfp); --- 35,37 ---- fprintf(stderr, "nextng()\n"); ! #endif /* DEBUG */ curpos = ftell(actfp); *************** *** 41,43 **** fprintf(stderr, "next:\n"); ! #endif if (actdirect == BACKWARD) { --- 41,43 ---- fprintf(stderr, "next:\n"); ! #endif /* DEBUG */ if (actdirect == BACKWARD) { *************** *** 61,63 **** fprintf(stderr, "bfr = '%s'\n", bfr); ! #endif --- 61,63 ---- fprintf(stderr, "bfr = '%s'\n", bfr); ! #endif /* DEBUG */ *************** *** 111,113 **** name, ngsize, minartno); ! #endif (void) strcpy(groupdir, name); --- 111,113 ---- name, ngsize, minartno); ! #endif /* DEBUG */ (void) strcpy(groupdir, name); *************** *** 161,163 **** fprintf(stderr, "Group: %s, all read\n", groupdir); ! #endif groupdir[0] = 0; --- 161,163 ---- fprintf(stderr, "Group: %s, all read\n", groupdir); ! #endif /* DEBUG */ groupdir[0] = 0; *************** *** 282,284 **** fprintf(stderr, "Bad article '%s'\n", filename); ! #endif if (fp != NULL) { --- 282,284 ---- fprintf(stderr, "Bad article '%s'\n", filename); ! #endif /* DEBUG */ if (fp != NULL) { *************** *** 306,308 **** h.from[0] ? h.from : ! #endif h.path, ctime(&h.subtime)); --- 306,308 ---- h.from[0] ? h.from : ! #endif /* INTERNET */ h.path, ctime(&h.subtime)); *************** *** 365,367 **** } ! #endif --- 365,367 ---- } ! #endif /* TMAIL */ *************** *** 777,783 **** int lowgp,highgp; ! char workspace[256]; ! if (*lgroup == ' ' || *lgroup == '\0') return; ! strcpy(workspace, set_group(lgroup)); ! if (*workspace != CHAR_OK) { ! printf("Group %s is invalid: \n%s\n", lgroup, workspace); return; --- 777,782 ---- int lowgp,highgp; ! char *workspace; ! if (*lgroup == ' ' || *lgroup == '\0' || ! (workspace = set_group(lgroup)) == NULL) { ! printf("Group %s is invalid.\n", lgroup); return; Index: sendbatch.sh Prereq: 1.13 *** .d/sendbatch.sh Sun Oct 18 18:04:35 1987 --- sendbatch.sh Wed Nov 4 12:49:29 1987 *************** *** 1,2 **** ! : '@(#)sendbatch.sh 1.13 10/15/87' --- 1,2 ---- ! : '@(#)sendbatch.sh 1.14 11/4/87' *************** *** 4,5 **** --- 4,6 ---- LIM=50000 + MAXBATCH=MAXPERBATCH CMD='LIBDIR/batch BATCHDIR/$rmt $BLIM' *************** *** 33,34 **** --- 34,37 ---- continue;; + -m*) MAXBATCH=`expr "$rmt" : '-m\(.*\)'` + continue;; esac *************** *** 35,36 **** --- 38,49 ---- + if [ -s /tmp/uuq.output ] ; then + q=`echo "$rmt" | sed 's/\(.......\).*/\1/'` + q=`awk "\\$1 == \\"$q:\\" { print \\$4;exit}" </tmp/uuq.output` + if [ ! -z "$q" -a \( "$q" -gt $MAXBATCH \) ] ; + then + echo $rmt already has $q bytes queued + continue + fi + fi + if test -n "$COMP" *************** *** 43,46 **** : make sure $? is zero ! testit="yes" ! while test $? -eq 0 -a \( \( -n "$testit" -a -s BATCHDIR/$rmt \) -o -s BATCHDIR/$rmt.work -o \( -n "$DOIHAVE" -a -s BATCHDIR/$rmt.ihave \) \) do --- 56,62 ---- : make sure $? is zero ! sentbytes=0 ! while test $? -eq 0 -a $sentbytes -le $MAXBATCH -a \ ! \( \( $sentbytes -eq 0 -a -s BATCHDIR/$rmt \) -o \ ! -s BATCHDIR/$rmt.work -o \ ! \( -n "$DOIHAVE" -a -s BATCHDIR/$rmt.ihave \) \) do *************** *** 61,63 **** fi ! testit= fi --- 77,79 ---- fi ! sentbytes=`expr $sentbytes + $LIM` fi Index: visual.c Prereq: 1.38 *** .d/visual.c Sun Oct 18 18:04:51 1987 --- visual.c Wed Nov 4 12:49:32 1987 *************** *** 6,8 **** #ifdef SCCSID ! static char *SccsId = "@(#)visual.c 1.38 10/15/87"; #endif /* SCCSID */ --- 6,8 ---- #ifdef SCCSID ! static char *SccsId = "@(#)visual.c 1.39 11/4/87"; #endif /* SCCSID */ *************** *** 42,44 **** #define SECPRLEN 81 /* length of secondary prompter */ ! #else #define PRLINE (ROWS-1)/* prompter line */ --- 42,44 ---- #define SECPRLEN 81 /* length of secondary prompter */ ! #else /* !STATTOP */ #define PRLINE (ROWS-1)/* prompter line */ *************** *** 47,49 **** #define SECPRLEN 100 /* length of secondary prompter */ ! #endif --- 47,49 ---- #define SECPRLEN 100 /* length of secondary prompter */ ! #endif /* !STATTOP */ *************** *** 134,136 **** static int endsuba; /* end of sub-article in digest */ ! #endif --- 134,136 ---- static int endsuba; /* end of sub-article in digest */ ! #endif /* DIGPAGE */ *************** *** 138,140 **** FILE *debugf; /* file to write debugging info on */ ! #endif --- 138,140 ---- FILE *debugf; /* file to write debugging info on */ ! #endif /* MYDEBUG */ *************** *** 154,155 **** --- 154,156 ---- #endif /* !SERVER */ + static char ogroupdir[BUFLEN]; /* last groupdir */ *************** *** 179,181 **** setbuf(debugf, (char *)NULL); ! #endif if (aflag) { --- 180,182 ---- setbuf(debugf, (char *)NULL); ! #endif /* MYDEBUG */ if (aflag) { *************** *** 202,204 **** } ! #endif ttysave(); --- 203,205 ---- } ! #endif /* MYDB */ ttysave(); *************** *** 252,256 **** || endsuba > 0 && endsuba < artlines ! #else if (artlines > dlinno + ARTWLEN ! #endif || (prflags & HDRONLY) && artlines > hdrend) { --- 253,257 ---- || endsuba > 0 && endsuba < artlines ! #else /* !DIGPAGE */ if (artlines > dlinno + ARTWLEN ! #endif /* !DIGPAGE */ || (prflags & HDRONLY) && artlines > hdrend) { *************** *** 299,303 **** if (c == ckill || c == cwerase) { ! #else if (c == ckill) { ! #endif if (countset == 0) --- 300,304 ---- if (c == ckill || c == cwerase) { ! #else /* !TIOCGLTC */ if (c == ckill) { ! #endif /* !TIOCGLTC */ if (countset == 0) *************** *** 390,392 **** } ! #endif else if ((appfile(fp, dlinno + 2 * ARTWLEN), artread) --- 391,393 ---- } ! #endif /* DIGPAGE */ else if ((appfile(fp, dlinno + 2 * ARTWLEN), artread) *************** *** 794,796 **** } ! #endif if (h->followid[0] == '\0') { --- 795,797 ---- } ! #endif /* MYDB */ if (h->followid[0] == '\0') { *************** *** 900,902 **** #ifdef SERVER ! (void) sprintf(bfr, "%s/%s", BIN, "postnews"); #else /* !SERVER */ --- 901,904 ---- #ifdef SERVER ! (void) sprintf(bfr, "%s/%s %s/%s/%ld", BIN, "postnews", ! SPOOL,groupdir,bit); #else /* !SERVER */ *************** *** 938,940 **** if (c != cwerase) ! #endif { --- 940,942 ---- if (c != cwerase) ! #endif /* TIOCGLTC */ { *************** *** 1037,1039 **** putc('\n', rfp); ! #endif /* !SERVER */ } --- 1039,1041 ---- putc('\n', rfp); ! #endif /* !SERVER */ } *************** *** 1196,1198 **** #ifdef SERVER ! if ((fp = getarticle(groupdir, bit, "ARTICLE")) == NULL) goto badart; --- 1198,1200 ---- #ifdef SERVER ! if (bit == 0 || (fp = getarticle(groupdir, bit, "ARTICLE")) == NULL) goto badart; *************** *** 1473,1477 **** (void) sprintf(linebuf, "From: %s", hp->from); ! #else (void) sprintf(linebuf, "Path: %s", tailpath(hp)); ! #endif if (fname[0] || (hp->organization[0] && !hflag)) { --- 1475,1479 ---- (void) sprintf(linebuf, "From: %s", hp->from); ! #else /* !INTERNET */ (void) sprintf(linebuf, "Path: %s", tailpath(hp)); ! #endif /* !INTERNET */ if (fname[0] || (hp->organization[0] && !hflag)) { *************** *** 1546,1548 **** ! #endif --- 1548,1550 ---- ! #endif /* MYDB */ *************** *** 1703,1705 **** } ! #endif } else { --- 1705,1707 ---- } ! #endif /* TIOCGLTC */ } else { *************** *** 1751,1753 **** (void) signal(SIGTTOU, SIG_DFL); ! #endif } --- 1753,1755 ---- (void) signal(SIGTTOU, SIG_DFL); ! #endif /* SIGTSTP */ } *************** *** 1770,1772 **** (void) signal(SIGTTOU, SIG_IGN); ! #endif (void) close(0); --- 1772,1774 ---- (void) signal(SIGTTOU, SIG_IGN); ! #endif /* SIGTSTP */ (void) close(0); *************** *** 1810,1812 **** (void) signal(SIGTTOU, onstop); ! #endif return retval; --- 1812,1814 ---- (void) signal(SIGTTOU, onstop); ! #endif /* SIGTSTP */ return retval; *************** *** 1842,1844 **** ! #endif --- 1844,1846 ---- ! #endif /* DIGPAGE */ *************** *** 1986,1988 **** count = endsuba - dlinno; ! #endif if ((prflags & NEWART) == 0) --- 1988,1990 ---- count = endsuba - dlinno; ! #endif /* DIGPAGE */ if ((prflags & NEWART) == 0) *************** *** 2004,2006 **** mvaddstr(PRLINE, 0, prompt); ! #else if (strlen(secpr) <= COLS) --- 2006,2008 ---- mvaddstr(PRLINE, 0, prompt); ! #else /* !STATOP */ if (strlen(secpr) <= COLS) *************** *** 2007,2009 **** mvaddstr(PRLINE, 0, prompt); ! #endif mvaddstr(PRLINE, 59, timestr); --- 2009,2011 ---- mvaddstr(PRLINE, 0, prompt); ! #endif /* !STATOP */ mvaddstr(PRLINE, 59, timestr); *************** *** 2052,2054 **** alflag++; ! #endif } --- 2054,2056 ---- alflag++; ! #endif /* !SIGTSTP */ } *************** *** 2140,2142 **** int oflags; /* fcntl flags (for nodelay read) */ ! #endif --- 2142,2144 ---- int oflags; /* fcntl flags (for nodelay read) */ ! #endif /* USG */ *************** *** 2149,2153 **** register c; ! #if defined(BSD4_2) || defined(BSD4_1C) int readfds, exceptfds; ! #endif --- 2151,2155 ---- register c; ! #ifdef BSD4_2 int readfds, exceptfds; ! #endif /* BSD4_2 */ *************** *** 2169,2171 **** } ! #endif #ifdef SIGTSTP --- 2171,2173 ---- } ! #endif /* USG */ #ifdef SIGTSTP *************** *** 2177,2179 **** #endif /* SIGTSTP */ ! #if defined(BSD4_2) || defined(BSD4_1C) /* Use a select because it can be interrupted. */ --- 2179,2181 ---- #endif /* SIGTSTP */ ! #ifdef BSD4_2 /* Use a select because it can be interrupted. */ *************** *** 2183,2185 **** break; ! #endif innleft = read(0, inbuf, INBUFSIZ); --- 2185,2187 ---- break; ! #endif /* BSD4_2 */ innleft = read(0, inbuf, INBUFSIZ); *************** *** 2210,2213 **** xxit(0); ! #endif ! #endif if (c == '\f') { --- 2212,2215 ---- xxit(0); ! #endif /* !CBREAK */ ! #endif /* !USG */ if (c == '\f') { *************** *** 2243,2245 **** int count; ! #endif #ifdef STATTOP --- 2245,2247 ---- int count; ! #endif /* FIONREAD */ #ifdef STATTOP *************** *** 2246,2250 **** if (innleft > 0) ! #else if (innleft > 0 || alflag) ! #endif return 1; --- 2248,2252 ---- if (innleft > 0) ! #else /* !STATOP */ if (innleft > 0 || alflag) ! #endif /* !STATOP */ return 1; *************** *** 2265,2267 **** } ! #endif #ifdef FIONREAD --- 2267,2269 ---- } ! #endif /* USG */ #ifdef FIONREAD *************** *** 2271,2274 **** return 1; ! #endif ! #endif return 0; --- 2273,2276 ---- return 1; ! #endif /* FIONREAD */ ! #endif /* USG || FIONREAD */ return 0; *************** *** 2286,2288 **** (void) ioctl(0, TCFLSH, (char *)0); ! #else #ifdef TIOCFLUSH --- 2288,2290 ---- (void) ioctl(0, TCFLSH, (char *)0); ! #else /* !USG */ #ifdef TIOCFLUSH *************** *** 2289,2291 **** (void) ioctl(0, TIOCFLUSH, (char *)0); ! #else struct sgttyb tty; --- 2291,2293 ---- (void) ioctl(0, TIOCFLUSH, (char *)0); ! #else /* !TIOCFLUSH */ struct sgttyb tty; *************** *** 2293,2296 **** (void) ioctl(0, TIOCSETP, &tty); ! #endif ! #endif innleft = 0; --- 2295,2298 ---- (void) ioctl(0, TIOCSETP, &tty); ! #endif /* !TIOCFLUSH */ ! #endif /* !USG */ innleft = 0; *************** *** 2317,2321 **** int mask; ! #else unsigned oalarm; ! #endif --- 2319,2323 ---- int mask; ! #else /* !BSD4_2 */ unsigned oalarm; ! #endif /* !BSD4_2 */ *************** *** 2323,2327 **** mask = sigblock(1 << (SIGALRM-1)); ! #else oalarm = alarm(0); ! #endif for (p = outbuf ; p < outnext ; p += i) { --- 2325,2329 ---- mask = sigblock(1 << (SIGALRM-1)); ! #else /* !BSD4_2 */ oalarm = alarm(0); ! #endif /* !BSD4_2 */ for (p = outbuf ; p < outnext ; p += i) { *************** *** 2337,2341 **** sigsetmask(mask); ! #else (void) alarm(oalarm); ! #endif } --- 2339,2343 ---- sigsetmask(mask); ! #else /* !BSD4_2 */ (void) alarm(oalarm); ! #endif /* !BSD4_2 */ } *************** *** 2406,2408 **** static struct ltchars oldltchars, newltchars; ! #endif --- 2408,2410 ---- static struct ltchars oldltchars, newltchars; ! #endif /* TIOCGLTC */ *************** *** 2416,2418 **** struct tchars tchars; /* special characters, including interrupt */ ! #endif #ifdef SIGTSTP --- 2418,2420 ---- struct tchars tchars; /* special characters, including interrupt */ ! #endif /* CBREAK */ #ifdef SIGTSTP Index: patchlevel.h Prereq: 11 *** .d/patchlevel.h Fri Oct 16 18:22:11 1987 --- patchlevel.h Wed Nov 4 12:49:32 1987 *************** *** 1,3 **** ! #define PATCHLEVEL 11 ! #define NEWS_VERSION "B 2.11 10/15/87" --- 1,3 ---- ! #define PATCHLEVEL 12 ! #define NEWS_VERSION "B 2.11 11/04/87"