arnold@skeeve.UUCP (Arnold D. Robbins) (11/10/89)
Here is patch #19 for B News 2.11. Note that there is a bug for which the next article will have an unofficial fix -- keep the original copy of sendbatch.sh for patch #20 (if and when). Arnold -------------------------------------------------------------------- Path: emory!ctrsol!cica!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!rick From: rick@uunet.UU.NET (Rick Adams) Newsgroups: news.software.b Subject: Patch 19 for B news 2.11 src Message-ID: <71135@uunet.UU.NET> Date: 31 Oct 89 04:10:04 GMT Organization: UUNET Communications Services, Falls Church, VA Lines: 648 Description: This is patch 19 for news 2.11. It addresses the following problems: Fixes buffering problem with rnews. Several typos introduced in patch 18 fixed. If no articles are in a group, minarticle will be one more than maxarticle in active file (like C news) expire -I and -i now work version control message no longer includes header of message in response. version control message NOTIFYs usenet if NOTIFY is enabled. new localize.xenix if cancel control message arrives and is not propagated (due to cancel failing), dont save the control message, only the history of it. Fix: cd src and make install Index: control.c Prereq: 2.60 diff -c1 onews/control.c news/control.c *** onews/control.c Tue Sep 12 17:56:08 1989 --- news/control.c Sun Oct 29 20:44:14 1989 *************** *** 21,23 #ifdef SCCSID ! static char *SccsId = "@(#)control.c 2.60 9/5/89"; #endif /* SCCSID */ --- 21,23 ----- #ifdef SCCSID ! static char *SccsId = "@(#)control.c 2.61 10/29/89"; #endif /* SCCSID */ *************** *** 476,478 (void) fseek(actfp, 0L, 2); clearerr(actfp); ! fprintf(actfp, "%s 0000000 0000000 %c\n", argv[1], (argc > 2 && STRCMP(argv[2], "moderated") == 0) --- 476,478 ----- (void) fseek(actfp, 0L, 2); clearerr(actfp); ! fprintf(actfp, "%s 0000000 0000001 %c\n", argv[1], (argc > 2 && STRCMP(argv[2], "moderated") == 0) *************** *** 787,788 f = mailhdr(&header, "Our news version"); --- 787,799 ----- + #ifdef NOTIFY + if (argc < 2) { + f = mailhdr((struct hbuf *)NULL, "version control message"); + if (f != NULL) { + fprintf(f, "%s requested your news version.\n", header.path); + fprintf(f, "It has been sent.\n"); + fprintf(f, "\n\n%s says:\n", header.path); + controlmail = f; + } + } + #endif /* NOTIFY */ f = mailhdr(&header, "Our news version"); *************** *** 791,794 fprintf(f, "Currently running news version %s.\n\n", news_version); - fprintf(f, "The header of your message follows:\n\n"); - (void) hwrite(&header, f); (void) mclose(f); --- 802,803 ----- fprintf(f, "Currently running news version %s.\n\n", news_version); (void) mclose(f); Index: expire.c Prereq: 2.63 diff -c1 onews/expire.c news/expire.c *** onews/expire.c Tue Sep 12 17:56:10 1989 --- news/expire.c Sun Oct 29 20:44:14 1989 *************** *** 19,21 #ifdef SCCSID ! static char *SccsId = "@(#)expire.c 2.63 9/1/89"; #endif /* SCCSID */ --- 19,21 ----- #ifdef SCCSID ! static char *SccsId = "@(#)expire.c 2.64 10/29/89"; #endif /* SCCSID */ *************** *** 468,470 rectime = cgtdate(recdate); ! exptime = atol(p3); } else { --- 468,474 ----- rectime = cgtdate(recdate); ! exptime = rectime + expincr; ! newtime = atol(p3); ! if (ignorexp == 0 ! || (ignorexp == 1 && newtime < exptime) ) ! exptime = newtime; } else { *************** *** 927,929 if (minart > maxart) ! minart = maxart; --- 931,933 ----- if (minart > maxart) ! minart = maxart + 1; Index: ifuncs.c Prereq: 2.77 diff -c1 onews/ifuncs.c news/ifuncs.c *** onews/ifuncs.c Tue Sep 12 17:56:19 1989 --- news/ifuncs.c Sun Oct 29 20:44:15 1989 *************** *** 18,20 #ifdef SCCSID ! static char *SccsId = "@(#)ifuncs.c 2.77 9/12/89"; #endif /* SCCSID */ --- 18,20 ----- #ifdef SCCSID ! static char *SccsId = "@(#)ifuncs.c 2.78 10/29/89"; #endif /* SCCSID */ *************** *** 27,28 extern long localize(); --- 27,29 ----- extern long localize(); + extern char *infpbuf; *************** *** 401,405 ofp = fopen(sp->s_xmit, "a"); - #ifdef F_SETFL - (void) fcntl(fileno(ofp), F_SETFL, O_APPEND); - #endif /* F_SETFL */ if (ofp == NULL) --- 402,403 ----- ofp = fopen(sp->s_xmit, "a"); if (ofp == NULL) *************** *** 406,407 xerror("Cannot append to %s", sp->s_xmit); if (appfile && appmsgid) --- 404,409 ----- xerror("Cannot append to %s", sp->s_xmit); + #if defined(F_SETFL) && !defined(MULTICAST) + (void) fcntl(fileno(ofp), F_SETFL, O_APPEND); + #endif /* F_SETFL */ + #ifdef MULTICAST if (appfile && appmsgid) *************** *** 411,413 firstbufname); - #ifdef MULTICAST while (--mc >= 0) --- 413,414 ----- firstbufname); while (--mc >= 0) *************** *** 414,416 fprintf(ofp, " %s", *sysnames++); - #endif /* !MULTICAST */ putc('\n', ofp); --- 415,416 ----- fprintf(ofp, " %s", *sysnames++); putc('\n', ofp); *************** *** 416,417 putc('\n', ofp); (void) fclose(ofp); --- 416,424 ----- putc('\n', ofp); + #else /* !MULTICAST */ + if (appfile && appmsgid) + fprintf(ofp, "%s\t%s\n", firstbufname, hh.ident); + else + fprintf(ofp, "%s\n", appmsgid ? hh.ident : + firstbufname); + #endif /* !MULTICAST */ (void) fclose(ofp); *************** *** 1333,1335 int c; - char *cp; --- 1340,1341 ----- int c; *************** *** 1365,1369 tfilename = 0; ! cp = malloc((unsigned)BUFSIZ); ! if (cp != NULL) ! setbuf(infp, cp); do { --- 1371,1375 ----- tfilename = 0; ! infpbuf = malloc((unsigned)BUFSIZ); ! if (infpbuf != NULL) ! setbuf(infp, infpbuf); do { *************** *** 1454,1456 setbuf(infp, (char *) NULL); ! (void) free(cp); return; /* from checkbatch as if --- 1460,1463 ----- setbuf(infp, (char *) NULL); ! (void) free(infpbuf); ! infpbuf = NULL; return; /* from checkbatch as if *************** *** 1480,1484 } /* while a batch */ ! cp = malloc((unsigned)BUFSIZ); ! if (cp != NULL) ! setbuf(infp, cp); if (c != EOF) --- 1487,1491 ----- } /* while a batch */ ! infpbuf = malloc((unsigned)BUFSIZ); ! if (infpbuf != NULL) ! setbuf(infp, infpbuf); if (c != EOF) Index: inews.c Prereq: 2.92 diff -c1 onews/inews.c news/inews.c *** onews/inews.c Tue Sep 12 17:56:22 1989 --- news/inews.c Sun Oct 29 20:44:17 1989 *************** *** 19,21 #ifdef SCCSID ! static char *SccsId = "@(#)inews.c 2.92 9/1/89"; #endif /* SCCSID */ --- 19,21 ----- #ifdef SCCSID ! static char *SccsId = "@(#)inews.c 2.93 10/29/89"; #endif /* SCCSID */ *************** *** 103,104 extern int errno, xxit(); --- 103,105 ----- extern int errno, xxit(); + char *infpbuf = NULL; *************** *** 239,241 if (space()) { /* check disk space */ ! spool_news = DOSPOOL; logerr("Out of space in %s.", SPOOLDIR); --- 240,242 ----- if (space()) { /* check disk space */ ! spool_news = DO_SPOOL; logerr("Out of space in %s.", SPOOLDIR); *************** *** 524,525 checkbatch(); (void) signal(SIGHUP, SIG_IGN); --- 525,531 ----- checkbatch(); + if (infpbuf == NULL) { /* make sure do buffered reads */ + infpbuf = malloc((unsigned)BUFSIZ); + if (infpbuf != NULL) + setbuf(infp, infpbuf); + } (void) signal(SIGHUP, SIG_IGN); *************** *** 1088,1090 #ifndef NFSCLIENT ! if (localize("control") && exitcode != 0) savehist(histline); --- 1094,1096 ----- #ifndef NFSCLIENT ! if (exitcode != 0) savehist(histline); *************** *** 1090,1091 savehist(histline); } else { --- 1096,1099 ----- savehist(histline); + else + localize("control"); } else { *************** *** 1183,1184 (void) fclose(infp); if(exitcode == 0) { --- 1191,1196 ----- (void) fclose(infp); + if (infpbuf) { + (void) free(infpbuf); + infpbuf = NULL; + } if(exitcode == 0) { *************** *** 1297,1299 } ! if (*filename) (void) fclose(infp); --- 1309,1311 ----- } ! if (*filename) { (void) fclose(infp); *************** *** 1299,1300 (void) fclose(infp); if (mode != PROC && --- 1311,1317 ----- (void) fclose(infp); + if (infpbuf) { + (void) free(infpbuf); + infpbuf = NULL; + } + } if (mode != PROC && Index: localize.xenix diff -c1 onews/localize.xenix news/localize.xenix *** onews/localize.xenix Fri Oct 16 18:22:08 1987 --- news/localize.xenix Sun Oct 29 20:44:17 1989 *************** *** 1,2 - # # This is correct for the --- 1 ----- # This is correct for the *************** *** 2,4 # This is correct for the ! # XENIX (empty) 5.0 iAPX286 1 1006 (empty) # version. There are so many versions of xenix out there --- 1,3 ----- # This is correct for the ! # SCO XENIX 286 release 2.2.3 # version. There are so many versions of xenix out there *************** *** 11,12 ed - Makefile <<'EOF' g/^#USG /s/// --- 10,23 ----- ed - Makefile <<'EOF' + /^HOME/s/^HOME/#HOME/ + /^UUXFLAGS/s/ -r -z/ -r/ + /^SPOOL_DISK/s/\/usr\/spool// + /^DEFS/;a + -DMAILPROGRAM=\"/usr/bin/mail\" \ + . + /^fullinstall:/+3;a + -test -d $(DESTDIR)$(BATCHDIR) || mkdir $(DESTDIR)$(BATCHDIR) + chmod 777 $(DESTDIR)$(BATCHDIR) + chown $(NEWSUSR) $(DESTDIR)$(BATCHDIR) + chgrp $(NEWSGRP) $(DESTDIR)$(BATCHDIR) + . g/^#USG /s/// *************** *** 17,19 g/^MISC *=/s/$/ uname.o/ - g/^UUXFLAGS/s//UUXFLAGS =/ g/^IBMFLAGS/s/$/ -M2l -LARGE -DM_XENIX/ --- 28,29 ----- g/^MISC *=/s/$/ uname.o/ g/^IBMFLAGS/s/$/ -M2l -LARGE -DM_XENIX/ *************** *** 25,28 g/-o readnews/s/-o/-m readnews.map -F 3000 -o/ ! g/-o vnews /s/-o/-F 5000 -m vnews.map -o / ! g/-o checknews/s/-o/-F E000 -o/ g/-o expire/s/-o/-F A000 -o/ --- 35,38 ----- g/-o readnews/s/-o/-m readnews.map -F 3000 -o/ ! /^vnews:/+1;s/-o $@ /-F 5000 -m vnews.map -o vnews/ ! /^checknews:/+1;s/$(LFLAGS)/$(LFLAGS) -F E000/ g/-o expire/s/-o/-F A000 -o/ *************** *** 40,41 ed - defs.h <<'EOF' g/#define TMAIL/s//\/\* #define TMAIL/ --- 50,54 ----- ed - defs.h <<'EOF' + /ROOTID/s/10/100/ + /N_UMASK/s/000/022/ + /DFLTSUB/s/general,all.announce/all/ g/#define TMAIL/s//\/\* #define TMAIL/ *************** *** 41,44 g/#define TMAIL/s//\/\* #define TMAIL/ ! g/\/usr\/ucb\/more/s//\/usr\/bin\/more/ ! g/uux - -r -z/s//uux - / g/uucpname/s//systemid/ --- 54,58 ----- g/#define TMAIL/s//\/\* #define TMAIL/ ! /PAGE/s/\/usr\/ucb\/more/\/usr\/bin\/more/ ! /DFTXMIT/s/uux - -r -z/uux - -r/ ! /UXMIT/s/uux -r -z -c/uux -r/ g/uucpname/s//systemid/ *************** *** 46,47 g/\/\* #define UUNAME/s/...// w --- 60,62 ----- g/\/\* #define UUNAME/s/...// + /MYORG/s/Frobozz Inc., St. Louis/My Organization, Inc., Hometown, ST/ w Index: postnews.c Prereq: 1.40 diff -c1 onews/postnews.c news/postnews.c *** onews/postnews.c Tue Sep 12 17:56:28 1989 --- news/postnews.c Sun Oct 29 20:44:18 1989 *************** *** 19,21 #ifdef SCCSID ! static char *SccsId = "@(#)postnews.c 1.40 9/1/89"; #endif /* SCCSID */ --- 19,21 ----- #ifdef SCCSID ! static char *SccsId = "@(#)postnews.c 1.41 10/29/89"; #endif /* SCCSID */ *************** *** 777,779 register char *p; ! int i; char *getenv(); --- 777,779 ----- register char *p; ! int i = 0; char *getenv(); Index: readr.c Prereq: 2.70 diff -c1 onews/readr.c news/readr.c *** onews/readr.c Sun Jan 22 22:18:21 1989 --- news/readr.c Sun Oct 29 20:44:19 1989 *************** *** 18,20 #ifdef SCCSID ! static char *SccsId = "@(#)readr.c 2.70 1/22/89"; #endif /* SCCSID */ --- 18,20 ----- #ifdef SCCSID ! static char *SccsId = "@(#)readr.c 2.71 10/29/89"; #endif /* SCCSID */ *************** *** 75,76 /* to match declaration in visual.c */ --- 75,79 ----- /* to match declaration in visual.c */ + #ifdef SERVER + static int clrtmp = 0; + #endif *************** *** 144,145 xxit(0); /* kludge! drop when qfflush works */ return; --- 147,153 ----- xxit(0); /* kludge! drop when qfflush works */ + #ifdef SERVER + if (clrtmp) + (void) unlink(filename); + clrtmp = 0; + #endif return; *************** *** 191,193 break; ! if (!SigTrap) return; --- 199,206 ----- break; ! if (!SigTrap) { ! #ifdef SERVER ! if (clrtmp) ! (void) unlink(filename); ! clrtmp = 0; ! #endif return; *************** *** 193,194 return; #ifdef SIGCONT --- 206,208 ----- return; + } #ifdef SIGCONT *************** *** 209,210 cout(ofp); } --- 223,229 ----- cout(ofp); + #ifdef SERVER + if (clrtmp) + (void) unlink(filename); + clrtmp = 0; + #endif } *************** *** 1045,1046 #ifdef SERVER if (bit == 0 || (fp = getarticle(groupdir, bit, "ARTICLE")) == NULL) --- 1064,1068 ----- #ifdef SERVER + if (clrtmp) + unlink(filename); + clrtmp = 0; if (bit == 0 || (fp = getarticle(groupdir, bit, "ARTICLE")) == NULL) *************** *** 1047,1048 goto badart; strcpy(filename, article_name()); --- 1069,1071 ----- goto badart; + clrtmp = 1; strcpy(filename, article_name()); *************** *** 1178,1182 obit = bit; - #ifdef SERVER - (void) unlink(filename); - #endif /* SERVER */ return 0; --- 1201,1202 ----- obit = bit; return 0; Index: sendbatch.sh Prereq: 1.21 diff -c1 onews/sendbatch.sh news/sendbatch.sh *** onews/sendbatch.sh Tue Sep 12 17:56:35 1989 --- news/sendbatch.sh Sun Oct 29 20:44:19 1989 *************** *** 1,2 ! : '@(#)sendbatch.sh 1.21 9/1/89' --- 1,2 ----- ! : '@(#)sendbatch.sh 1.22 10/29/89' *************** *** 26,27 continue;; -r*) RNEWS=`expr "$rmt" : '-r\(.*\)'` --- 26,31 ----- continue;; + -p*) MAXPERRUN=`expr "$rmt" : '-p\(.*\)'` + continue;; + +p*) MAXPERRUN='' + continue;; -r*) RNEWS=`expr "$rmt" : '-r\(.*\)'` *************** *** 64,65 esac --- 68,73 ----- esac + if test ! -n "$MAXPERRUN" + then + MAXPERRUN=$MAXBATCH + fi *************** *** 108,110 sentbytes=0 ! while test $? -eq 0 -a $sentbytes -le "$MAXBATCH" -a \ \( \( $sentbytes -eq 0 -a -s $BATCH/$rmt \) -o \ --- 116,123 ----- sentbytes=0 ! bytes_this_batch=`expr $MAXBATCH - $du` ! if test $bytes_this_batch -gt $MAXPERRUN ! then ! bytes_this_batch=$MAXPERRUN ! fi ! while test $? -eq 0 -a $sentbytes -le $bytes_this_batch -a \ \( \( $sentbytes -eq 0 -a -s $BATCH/$rmt \) -o \ Index: patchlevel.h Prereq: 18 diff -c1 onews/patchlevel.h news/patchlevel.h *** onews/patchlevel.h Tue Sep 12 17:56:27 1989 --- news/patchlevel.h Thu Oct 12 23:28:00 1989 *************** *** 1,2 ! #define PATCHLEVEL 18 --- 1,2 ----- ! #define PATCHLEVEL 19 *************** *** 2,3 ! #define NEWS_VERSION "B 2.11 9/12/89" --- 2,3 ----- ! #define NEWS_VERSION "B 2.11.19 10/30/89" -- Arnold Robbins -- The Basement Computer | Laundry increases Internet: arnold@skeeve.ATL.GA.US | exponentially in the UUCP: { gatech, gladys, emory }!skeeve!arnold | number of children. Bitnet: Forget it. Get on a real network. | -- Miriam Hartholz