From cad453abcd702e8e34eb3a8e8a312c9cb5b53aae Mon Sep 17 00:00:00 2001 From: CSRG Date: Sun, 19 Jan 1986 20:57:34 -0800 Subject: [PATCH] BSD 4_3 development Work on file usr/contrib/news/README Work on file usr/contrib/news/Makefile Work on file usr/contrib/news/uucp/=batch Work on file usr/contrib/news/uucp/uux.minus.c Work on file usr/contrib/news/uucp/minus.z.5 Work on file usr/contrib/news/uucp/gename.s5 Work on file usr/contrib/news/uucp/cpu.speedup Work on file usr/contrib/news/uucp/minus.z.v7 Work on file usr/contrib/news/uucp/bugfix Synthesized-from: CSRG/cd1/4.3 --- usr/contrib/news/Makefile | 26 ++++ usr/contrib/news/README | 28 ++++ usr/contrib/news/uucp/=batch | 191 +++++++++++++++++++++++++++ usr/contrib/news/uucp/bugfix | 40 ++++++ usr/contrib/news/uucp/cpu.speedup | 207 ++++++++++++++++++++++++++++++ usr/contrib/news/uucp/gename.s5 | 143 +++++++++++++++++++++ usr/contrib/news/uucp/minus.z.5 | 77 +++++++++++ usr/contrib/news/uucp/minus.z.v7 | 172 +++++++++++++++++++++++++ usr/contrib/news/uucp/uux.minus.c | 141 ++++++++++++++++++++ 9 files changed, 1025 insertions(+) create mode 100644 usr/contrib/news/Makefile create mode 100644 usr/contrib/news/README create mode 100644 usr/contrib/news/uucp/=batch create mode 100644 usr/contrib/news/uucp/bugfix create mode 100644 usr/contrib/news/uucp/cpu.speedup create mode 100644 usr/contrib/news/uucp/gename.s5 create mode 100644 usr/contrib/news/uucp/minus.z.5 create mode 100644 usr/contrib/news/uucp/minus.z.v7 create mode 100644 usr/contrib/news/uucp/uux.minus.c diff --git a/usr/contrib/news/Makefile b/usr/contrib/news/Makefile new file mode 100644 index 0000000000..51813a77ff --- /dev/null +++ b/usr/contrib/news/Makefile @@ -0,0 +1,26 @@ +# %W% (Berkeley) %G% +# +DESTDIR= +CFLAGS= -O + +# Programs that live in subdirectories, and have makefiles of their own. +# +SUBDIR= src man + +all: src/Makefile ${SUBDIR} + +${SUBDIR}: FRC + cd $@; make ${MFLAGS} + +src/Makefile: + @echo assuming src/localize.sh is correct... + cd src; make -f Makefile.dst Makefile + +install: + -for i in ${SUBDIR}; do \ + (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done + +clean: + -for i in ${SUBDIR}; do (echo $$i; cd $$i; make ${MFLAGS} clean); done + +FRC: diff --git a/usr/contrib/news/README b/usr/contrib/news/README new file mode 100644 index 0000000000..7015b3a6d2 --- /dev/null +++ b/usr/contrib/news/README @@ -0,0 +1,28 @@ +Warning: The compression scheme provided here is not compatible with the +2.10.2 version. You must get all the sites you communicate with to run +this version of unbatch.c. Otherwise, your compressed news will +be thrown away. On the otherhand, you no longer need to have cunbatch +on the remote system. + +Compress V4.0 is provided with this release. It is not compatible with +the 2.0 compress, however, if the -C flag is given to sendbatch, compress +will generate V2.0 output. This program can decompress either format +automatically. + +Note that sendbatch -c has replaced csendbatch. sendbatch now takes +several flags. See the man page for details. + +Disclaimer: + +This release (2.10.3 4.3bsd) is for the 4.3bsd tape. The code is known +to work on 4.[123]bsd vaxes. It seems works on USG & V7 systems but has not +been extensively tested. There are certainly problems on Eunice systems. +DO NOT use this with VMS defined, you will regret it. + +In any case, please mail me any problems you have. + +---rick +rick@seismo.CSS.GOV +seismo!rick +January 17, 1986 + diff --git a/usr/contrib/news/uucp/=batch b/usr/contrib/news/uucp/=batch new file mode 100644 index 0000000000..0c89f82858 --- /dev/null +++ b/usr/contrib/news/uucp/=batch @@ -0,0 +1,191 @@ +*** chkpth.c Sun May 27 20:55:39 1979 +--- chkpth.c.new Sat Apr 2 21:34:39 1983 +*************** +*** 40,45 + char c; + int ret, i; + + if (Uptfirst) { + ret = rdpth(Upt); + ASSERT(ret == 0, "INIT USERFILE %d", Nbrusers); + +--- 40,48 ----- + char c; + int ret, i; + ++ if (prefix("=/usr/lib/news/batch", path)) ++ return(0); ++ + if (Uptfirst) { + ret = rdpth(Upt); + ASSERT(ret == 0, "INIT USERFILE %d", Nbrusers); +*** cntrl.c Sun May 27 20:56:46 1979 +--- cntrl.c.new Sat Apr 2 21:37:03 1983 +*************** +*** 82,87 + char Wfile[MAXFULLNAME] = {'\0'}; + char Dfile[MAXFULLNAME]; + + /******* + * cntrl(role, wkpre) + * int role; + +--- 82,89 ----- + char Wfile[MAXFULLNAME] = {'\0'}; + char Dfile[MAXFULLNAME]; + ++ FILE *pfopen(); ++ + /******* + * cntrl(role, wkpre) + * int role; +*************** +*** 164,170 + if (index(W_OPTNS, 'c') == NULL) + fp = fopen(Dfile, "r"); + if (fp == NULL && +! (fp = fopen(filename, "r")) == NULL) { + /* can not read data file */ + logent("CAN'T READ DATA", "FAILED"); + unlinkdf(Dfile); + +--- 166,172 ----- + if (index(W_OPTNS, 'c') == NULL) + fp = fopen(Dfile, "r"); + if (fp == NULL && +! (fp = pfopen(filename, "r")) == NULL) { + /* can not read data file */ + logent("CAN'T READ DATA", "FAILED"); + unlinkdf(Dfile); +*************** +*** 282,288 + notify(mailopt, W_USER, W_FILE1, Rmtname, &msg[1]); + ASSERT(role == MASTER, + "role - %d", role); +! fclose(fp); + unlinkdf(W_DFILE); + goto top; + } + +--- 284,290 ----- + notify(mailopt, W_USER, W_FILE1, Rmtname, &msg[1]); + ASSERT(role == MASTER, + "role - %d", role); +! pfclose(fp); + unlinkdf(W_DFILE); + goto top; + } +*************** +*** 292,298 + ASSERT(role == MASTER, + "role - %d", role); + ret = (*Wrdata)(fp, Ofn); +! fclose(fp); + if (ret != 0) { + (*Turnoff)(); + return(FAIL); + +--- 294,300 ----- + ASSERT(role == MASTER, + "role - %d", role); + ret = (*Wrdata)(fp, Ofn); +! pfclose(fp); + if (ret != 0) { + (*Turnoff)(); + return(FAIL); +*** expfile.c Sun May 27 20:57:47 1979 +--- expfile.c.new Sat Apr 2 21:39:05 1983 +*************** +*** 19,24 + int uid; + + switch(file[0]) { + case '/': + return; + case '~': + +--- 19,25 ----- + int uid; + + switch(file[0]) { ++ case '=': + case '/': + return; + case '~': +*** uux.c Wed Aug 19 16:56:29 1981 +--- uux.c.new Sat Apr 2 21:40:01 1983 +*************** +*** 231,240 + expfile(rest); + gename(DATAPRE, xsys, 'A', dfile); + DEBUG(4, "rest %s\n", rest); +! if ((chkpth(User, "", rest) || anyread(rest)) != 0) { +! fprintf(stderr, "permission denied %s\n", rest); +! cleanup(1); +! } + if (xcp(rest, dfile) != 0) { + fprintf(stderr, "can't copy %s to %s\n", rest, dfile); + cleanup(1); + +--- 231,241 ----- + expfile(rest); + gename(DATAPRE, xsys, 'A', dfile); + DEBUG(4, "rest %s\n", rest); +! if (rest[0] == '/') +! if ((chkpth(User, "", rest) || anyread(rest)) != 0) { +! fprintf(stderr, "permission denied %s\n", rest); +! cleanup(1); +! } + if (xcp(rest, dfile) != 0) { + fprintf(stderr, "can't copy %s to %s\n", rest, dfile); + cleanup(1); +****************** +pfopen.c: +------------------ +/* + * Routine like fopen, but checks for processes to open. + * The process name begins with =, and any underscores + * are translated into blanks. We don't do things in the + * obvious way (start with | or !, use blanks as themselves) + * because getargs can't parse strings containing blanks in + * all versions of uucp. + */ + +#include + +static FILE *prevval = NULL; + +FILE *popen(); + +FILE * +pfopen(name, mode) +char *name, *mode; +{ + char cmdbuf[256]; + register char *p; + + if (*name != '=') { + prevval = NULL; + return fopen(name, mode); + } + + strcpy(cmdbuf, name); + for (p=cmdbuf; *p; p++) + if (*p == '_') + *p = ' '; + p = cmdbuf+1; + prevval = popen(p, mode); + return prevval; +} + +pfclose(fd) +FILE *fd; +{ + if (fd == prevval) { + pclose(fd); + prevval = NULL; + } else + fclose(fd); +} +**************** +Also be sure to add pfopen.o to the list of .o files in the makefile. diff --git a/usr/contrib/news/uucp/bugfix b/usr/contrib/news/uucp/bugfix new file mode 100644 index 0000000000..acb101a6e5 --- /dev/null +++ b/usr/contrib/news/uucp/bugfix @@ -0,0 +1,40 @@ +Date: 19 Apr 1983 6:31-PST +From: Jim Rees +Subject: Re: news 2.10 +Message-Id: <83/04/19 0631.950@uw-beaver> + +Meanwhile, I thought of something else you may want to include in the +distribution. I know that there are lots of bugs in uucp, and that it +would be impossible to list them all in a reasonable amount of space, +but news will not work at all on a 4.1bsd system unless this bug is +fixed. This bug is still in even the latest tape from Berkeley, and is +not traceable with a debugger because of other bugs in uucp. This bug +causes uucico to core-dump after transferring some small (~20) number +of files. + +The fix is easy. In anlwrk.c, routine iswrk(): + +*** anlwrk.c_o Wed Mar 9 07:53:09 1983 +--- anlwrk.c Wed Sep 22 10:21:43 1982 +*************** +*** 64,70 + { + static char **listp, *list[LLEN]; + +! if (listp == NULL || *listp == NULL || listp > (list + LLEN) + || !prefix(pre, *listp)) { + int i; + for (i = 0, listp = list; i < LLEN; i++) { + +--- 64,70 ----- + { + static char **listp, *list[LLEN]; + +! if (listp == NULL || *listp == NULL || listp >= (list + LLEN) + || !prefix(pre, *listp)) { + int i; + for (i = 0, listp = list; i < LLEN; i++) { + + +[uucp is fully of nasty bugs. watch net.bugs.uucp for them and +hopefully their fixes.] diff --git a/usr/contrib/news/uucp/cpu.speedup b/usr/contrib/news/uucp/cpu.speedup new file mode 100644 index 0000000000..d2716f1964 --- /dev/null +++ b/usr/contrib/news/uucp/cpu.speedup @@ -0,0 +1,207 @@ +Under certain circumstances, you may find that when 2 or 3 uucicos +are running on your system, they are eating up all the CPU time, +and system performance suffers horribly. If this is your problem, +you can do a "vmstat 5" and watch the system calls and context switches +counters. If they are both very high whenever 2 or more uucicos +are running (100-200 system calls/second, over 100 context switches), +chances are that the problem is as follows: + +When another system is sending you a file, your uucico reads characters +from the line. The read returns whatever is there waiting, or if +nothing is waiting, waits for one character and returns. Since uucico +usually wants 64 characters at a time, at 1200 baud it's quite common +to read these in 1 or 2 character pieces. Each uucico will read 1 or +2 characters, wake up the user process, go back for more, there won't +be any, so it hangs and gives up the CPU. A very short time later, +(often within the same clock tick) there will be a character available, +the process will wake up, read one character, and try again. + +This modification is very simple. If the first read returned fewer +characters than requested, before doing another read, the process +will sleep for one second. Then, when it wakes up, there will probably +be as many characters waiting as it needs. + +This modification makes a big difference when you are RECEIVING a file +from another system. It won't make much difference when you are +SENDING a file, because the user process doesn't usually have to hang +to write to the line, and when it does, the high/low water mark +mechanism in the tty driver keeps it from waking up too often. +This change is intended for a V7 or 4BSD system. It may not +help much on System V, because uucp uses a USG tty driver feature +to make it wake up only every 6 characters. + +The amount this fix helps depends a LOT on the baud rate. Since it +is sleeping while it had been reading characters, it is reasonable +to expect the file to get transferred more slowly than before. This +might, in turn, lead to increased phone bills. Some experimentation +receiving a file over a hardwired link is detailed here. The file +received is /etc/termcap, which is 66405 bytes long. The local system +is a 4.1BSD VAX 11/750, the remote system is a UNIX 5.0 VAX 11/750. +The link is over a develcon dataswitch. Both systems were almost +idle, although when another uucico did start up, it didn't seem to +affect the numbers. The commands + uucp -r othersys!~/termcap ~uucp/termcap + time /usr/lib/uucp/uucico -r1 -sothersys +were given. + +"type" is the type of uucico run: "old" is without the sleep, "sleep" +has a sleep(1) added after every short read, "nap" is the same as +sleep except that at 4800 baud and higher the sleep is for less than +one second (the parameter is the number of milliseconds). "user" and +"sys" are the user and system CPU times from the time command, in +seconds. "elapsed" is the time, in seconds, to transfer the file, +taken from /usr/spool/uucp/SYSLOG. (Elapsed time does not include time to +get the connection going or close it down, just to transfer the file.) +"%" is the percentage of the system the uucico command took, from the +time command. + +type speed user sys elapsed % + +old 1200 35.3 120.8 606 21% +sleep 1200 14.2 35.9 609 7% + +old 2400 27.4 115.8 305 31% +sleep 2400 13.2 35.0 351 9% + +old 4800 23.9 116.0 152 57% +sleep 4800 14.4 40.3 338 12% + +old 9600 14.4 68.1 79 42% +nap 60 9600 14.6 52.7 97 39% +nap 100 9600 14.9 48.5 113 32% +nap 200 9600 15.0 47.1 127 37% +sleep 9600 12.0 46.1 279 15% + +It is clear that at 2400 baud or less, the load on the system was +cut considerably, while the penalty in slower transfer speed is +negligible. At 9600 baud, the sleep version (equivalent to nap 1000) +cut the system load by about 1/3, the elapsed time shot way up. +(It takes much less than 1 second to accumulate 64 characters at +9600 baud.) At 4800 baud the results are somewhere in between. +The system time was cut by a factor of 3, but the elapsed time doubled. + +Putting in shorter naps at 9600 baud brought the elapsed time down, while +increasing the system load moderately. Essentially, the system time +remained constant when any sleeping was done. The difference in +percentage of the system used shows that, in effect, the same work +was spread out over different lengths of time. This results in a tradeoff +that can only be evaluated by each system in terms of their priorities. + +An added complication is that most V7 and 4BSD systems do not have +a way to sleep for less than a second. 4.2BSD has the select system +call, or you may have installed a nap system call or the Cornell fast +timer driver. Otherwise, your only choices are either sleep(1) or +nothing. The napms call below calls a routine in the new curses, to +sleep for around 1 clock tick (60 ms). + +If your top priority is to keep system response good, it is recommended +that you do the sleep(1) no matter what the baud rate is. If your top +priority is to make 9600 baud transfers go as quickly as possible, you +should do the sleep for 1200 baud or less, and otherwise do nothing. +If you want a well balanced compromise and have a high resolution sleep +or nap or select available, the changes shown here are appropriate. + +This change is trivial except for the change to conn.c to make the +baud rate available to the packet driver. The code dealing with the +speed is different in different versions of UUCP. If you have trouble +with conn.c, search for the string "speed" and look for a conveniently +available integer version of the speed. The variable linebaudrate is +a global integer, exported to pk1.c for purposes of this test. The +changes shown here are for the 4.1BSD version of UUCP. + +*** conn.c Wed Jun 4 01:47:12 1980 +--- conn.c.new Sat Apr 2 18:13:25 1983 +*************** +*** 85,90 + char *D_calldev; + int D_speed; + } Devs [MAXDEV]; + + char Devbuff[MAXDCH]; + + +--- 85,91 ----- + char *D_calldev; + int D_speed; + } Devs [MAXDEV]; ++ int linebaudrate; + + char Devbuff[MAXDCH]; + +*************** +*** 344,349 + alarm(0); + fflush(stdout); + fixline(dcf, pd->D_speed); + DEBUG(4, "Forked %d ", pid); + DEBUG(4, "Wait got %d ", nw); + DEBUG(4, "Status %o\n", lt); + +--- 345,351 ----- + alarm(0); + fflush(stdout); + fixline(dcf, pd->D_speed); ++ linebaudrate = pd->D_speed; + DEBUG(4, "Forked %d ", pid); + DEBUG(4, "Wait got %d ", nw); + DEBUG(4, "Status %o\n", lt); +*** pk1.c Mon May 28 00:44:06 1979 +--- pk1.c.new Sat Apr 2 18:16:02 1983 +[This is routine pkcget, near the end of pk1.c.] +*************** +*** 335,340 + char *b; + { + int nchars, ret; + + if (setjmp(Getjbuf)) { + Ntimeout++; + +--- 335,341 ----- + char *b; + { + int nchars, ret; ++ extern int linebaudrate; + + if (setjmp(Getjbuf)) { + Ntimeout++; +*************** +*** 343,349 + } + signal(SIGALRM, cgalarm); + +! for (nchars = 0; nchars < n; nchars += ret) { + alarm(PKTIME); + ret = read(fn, b, n - nchars); + if (ret == 0) { + +--- 344,350 ----- + } + signal(SIGALRM, cgalarm); + +! for (nchars = 0; nchars < n; ) { + alarm(PKTIME); + ret = read(fn, b, n - nchars); + if (ret == 0) { +*************** +*** 352,357 + } + PKASSERT(ret > 0, "PKCGET READ %d", ret); + b += ret; + } + alarm(0); + return(0); + +--- 353,364 ----- + } + PKASSERT(ret > 0, "PKCGET READ %d", ret); + b += ret; ++ nchars += ret; ++ if (nchars < n) ++ if (linebaudrate > 0 && linebaudrate < 4800) ++ sleep(1); ++ else ++ napms(60); + } + alarm(0); + return(0); diff --git a/usr/contrib/news/uucp/gename.s5 b/usr/contrib/news/uucp/gename.s5 new file mode 100644 index 0000000000..7f4493f4e8 --- /dev/null +++ b/usr/contrib/news/uucp/gename.s5 @@ -0,0 +1,143 @@ +From burl!lda Tue Apr 5 12:50:04 1983 +Date: 5-Apr-83 12:49:57-EST (Tue) +From: burl!lda +Subject: base 62 sequencing on USG 5.0 uucp +Via: cbosgd.UUCP (V3.94 [3/6/82]); 5-Apr-83 12:50:00-EST (Tue) +To: teklabs!stevenm +Status: R + +This is a listing of the changes made to USG 5.0 uucp to support the +base 62 numbering scheme submitted to the 'uucp.buglist' by Alan S. Watt, +ittvax!swatt. Simply changing the gename routine was not enough. +These changes were made by Curtis Jackson, burl!rcj. + +Note: The diff here on 'ogename.c gename.c' is for Alan's gename.c + + Larry Auton + burl!lda +[Caution - a few weeks later, burl's UUCP started behaving very +strangely. UUCP would record that it xqt'ed rnews, but rnews was +never started up. Access time on /usr/bin/rnews was unchanged. +We don't know if this change had anything to do with it, but if +you see this symptom, be suspicious of this change.] +_________________________________________________________________________ +**** ocntrl.c cntrl.c +135c135 +< jobid = 0; +--- +> strcpy(jobid,"0000"); + +**** ogename.c gename.c +29c29,30 +< sprintf(file, "%c.%.7s%c%.4s", pre, sys, grade, sqnum); +--- +> strcpy(jobid,sqnum); +> updjb(); sprintf(file, "%c.%.6s%c%.1s%.4s", pre, sys, grade, subjob, jobid); + +**** ogtcfile.c gtcfile.c +57c57 +< if(jobid == 0){ +--- +> if(!strcmp(jobid,"0000")){ +60c60 +< DEBUG(4,"gtcfile2: sqnm - %d\n",sqnm); +--- +> DEBUG(4,"gtcfile2: sqnm - %s\n",sqnm); +62,63c62,63 +< updjb(); sprintf(Cfile, "%c.%.6s%c%.1s%.4d", CMDPRE, sys, Grade, subjob, jobid); +< DEBUG(4,"gtcfile3: jobid - %d\n",jobid); +--- +> updjb(); sprintf(Cfile, "%c.%.6s%c%.1s%.4s", CMDPRE, sys, Grade, subjob, jobid); +> DEBUG(4,"gtcfile3: jobid - %s\n",jobid); +70c70 +< sprintf(Cfile, "%c.%.6s%c%.1s%.4d", CMDPRE, sys, Grade, p->pre_id, jobid); +--- +> sprintf(Cfile, "%c.%.6s%c%.1s%.4s", CMDPRE, sys, Grade, p->pre_id, jobid); +81c81 +< static int jid = 0; +--- +> static char jid[5] = "0000"; +83,85c83,85 +< if(jobid != jid){ +< DEBUG(4,"csys0 - jobid: %d\n",jobid); +< jid = jobid; +--- +> if(strcmp(jobid,jid)){ +> DEBUG(4,"csys0 - jobid: %s\n",jobid); +> strcpy(jid,jobid); + +**** ouucp.c uucp.c +597c597 +< updjb(); sprintf(dfile, "%c.%.6s%c%.1s%.4d", DATAPRE, s2, Grade, subjob, jobid); +--- +> updjb(); sprintf(dfile, "%c.%.6s%c%.1s%.4s", DATAPRE, s2, Grade, subjob, jobid); +754c754 +< fprintf(stdout,"uucp job %d\n", jobid); +--- +> fprintf(stdout,"uucp job %s\n", jobid); +756c756 +< updjb(); sprintf(Cfile, "%c.%.6s%c%.1s%.4d", CMDPRE, sys, Grade, subjob, jobid); +--- +> updjb(); sprintf(Cfile, "%c.%.6s%c%.1s%.4s", CMDPRE, sys, Grade, subjob, jobid); +764c764 +< sprintf(Cfile, "%c.%.6s%c%.1s%.4d", CMDPRE, sys, Grade, p->pre_id, jobid); +--- +> sprintf(Cfile, "%c.%.6s%c%.1s%.4s", CMDPRE, sys, Grade, p->pre_id, jobid); +775c775 +< static int jid = 0; +--- +> static char jid[5] = "0000"; +777,778c777,778 +< if(jobid != jid){ +< jid = jobid; +--- +> if(strcmp(jobid,jid)){ +> strcpy(jid,jobid); + +**** ouucp.h uucp.h +201c201 +< extern int jobid; +--- +> extern char jobid[5]; + +**** ouucpdefs.c uucpdefs.c +26c26 +< int jobid; +--- +> char jobid[5]; + +**** ouux.c uux.c +216c216 +< updjb(); sprintf(tcfile, "%c.%.6s%c%.1s%.4d", DATAPRE, local, 'T', subjob, jobid); +--- +> updjb(); sprintf(tcfile, "%c.%.6s%c%.1s%.4s", DATAPRE, local, 'T', subjob, jobid); +303c303 +< updjb(); sprintf(dfile, "%c.%.6s%c%.1s%.4d", DATAPRE, xsys, 'B', subjob, jobid); +--- +> updjb(); sprintf(dfile, "%c.%.6s%c%.1s%.4s", DATAPRE, xsys, 'B', subjob, jobid); +345c345 +< fprintf(stdout,"uucp job %d\n", jobid); +--- +> fprintf(stdout,"uucp job %s\n", jobid); +505c505 +< updjb(); sprintf(dfile, "%c.%.6s%c%.1s%.4d", DATAPRE, xsys, 'A', subjob, jobid); +--- +> updjb(); sprintf(dfile, "%c.%.6s%c%.1s%.4s", DATAPRE, xsys, 'A', subjob, jobid); +570c570 +< updjb(); sprintf(tfile, "%c.%.6s%c%.1s%.4d", CMDPRE, syspart, 'R', subjob, jobid); +--- +> updjb(); sprintf(tfile, "%c.%.6s%c%.1s%.4s", CMDPRE, syspart, 'R', subjob, jobid); +644c644 +< updjb(); sprintf(dfile, "%c.%.6s%c%.1s%.4d", DATAPRE, syspart, 'R', subjob, jobid); +--- +> updjb(); sprintf(dfile, "%c.%.6s%c%.1s%.4s", DATAPRE, syspart, 'R', subjob, jobid); +655c655 +< updjb(); sprintf(t2file, "%c.%.6s%c%.1s%.4d", DATAPRE, xsys, 'T', subjob, jobid); +--- +> updjb(); sprintf(t2file, "%c.%.6s%c%.1s%.4s", DATAPRE, xsys, 'T', subjob, jobid); +767c767 +< updjb(); sprintf(cfile, "%c.%.6s%c%.1s%.4d", CMDPRE, xsys, 'A', subjob, jobid); +--- +> updjb(); sprintf(cfile, "%c.%.6s%c%.1s%.4s", CMDPRE, xsys, 'A', subjob, jobid); + + diff --git a/usr/contrib/news/uucp/minus.z.5 b/usr/contrib/news/uucp/minus.z.5 new file mode 100644 index 0000000000..a80e61383a --- /dev/null +++ b/usr/contrib/news/uucp/minus.z.5 @@ -0,0 +1,77 @@ +This shows the changes needed to a System V or UNIX 5.0 UUCP to +implement the -z option. The -n option is in the standard system, +but you usually want to be notified if something goes wrong. + +I looked at the 4.0 sources and compared them to the 5.0. The programs +have changed but the changes aren't many. Only uucp.h, uux.c, and uuxqt.c +need be changed. I'll be putting in the changes once I get permission from +our systems people. + +============================================================== +---- uucp.h ---- 137,139 ---- + #define X_USER 'U' + #define X_NONOTI 'N' + > #define X_NONZERO 'Z' /* don't notify if zero return */ + #define X_SENDFILE 'S' +============================================================== +---- uux.c ---- 54, 55 ---- + int nonoti = 0; + > #ifdef X_NONZERO + > int nonzero = 0; + > #endif + int uid, ret; +---- uux.c ---- 146,149 ---- + case 'n': + nonoti = 1; + break; + > #ifdef X_NONZERO + > case 'z': + > nonzero = 1; + > break; + > #endif + default: +---- uux.c ---- 218,221 ---- + if (nonoti) + fprintf(fprx,"%c\n", X_NONOTI); + > #ifdef X_NONZERO + > if (nonzero) + > fprintf(fprx,"%c\n", X_NONZERO); + > #endif + if (statop) + fprintf(fprx,"%c %s\n", X_MAILF, Sfile); +============================================================== +---- uuxqt.c ---- 185,188 ---- + int stcico = 0; + int argnok; + > #ifdef X_NONZERO + > int nonzero = 0; + > #endif + char xcmd[200]; +---- uuxqt.c ---- 43, 45 ---- + case X_NONOTI: + notiok = 0; + break; + > #ifdef X_NONZERO + > /* + > * notify only if non-zero status return + > */ + > case X_NONZERO: + > nonzero = 1; + > break; + > #endif + default: +---- uuxqt.c ---- 273,278 ---- + if (strcmp(xcmd, "rmail") != SAME + > #ifndef X_NONZERO + && strcmp(xcmd, "mail") != SAME) { + > #else + > && strcmp(xcmd, "mail") != SAME + > && (!nonzero || (nonzero && ret != 0)) { + > #endif + + /* + * see if user wants respcifiction + */ +============================================================== + + diff --git a/usr/contrib/news/uucp/minus.z.v7 b/usr/contrib/news/uucp/minus.z.v7 new file mode 100644 index 0000000000..8963c7c868 --- /dev/null +++ b/usr/contrib/news/uucp/minus.z.v7 @@ -0,0 +1,172 @@ +Script started on Wed Feb 24 13:41:52 1982 +Comet }{ foreach i (uucp.h uux.c uuxqt.c) +? echo $i +? diff -c $i.1.1 $i.1.2 +? end +uucp.h +*** uucp.h.1.1 Wed Feb 24 13:40:04 1982 +--- uucp.h.1.2 Wed Feb 24 13:40:14 1982 +*************** +*** 114,119 + #define X_CMD 'C' + #define X_USER 'U' + #define X_SENDFILE 'S' + #define X_LOCK "LCK.XQT" + #define X_LOCKTIME 3600 + + +--- 114,121 ----- + #define X_CMD 'C' + #define X_USER 'U' + #define X_SENDFILE 'S' ++ #define X_NONOTI 'N' ++ #define X_NONZERO 'Z' + #define X_LOCK "LCK.XQT" + #define X_LOCKTIME 3600 + +uux.c +*** uux.c.1.1 Wed Feb 24 13:40:34 1982 +--- uux.c.1.2 Wed Feb 24 13:40:54 1982 +*************** +*** 51,56 + extern FILE *ufopen(); + int uid, ret; + char redir = '\0'; + + strcpy(Progname, "uux"); + uucpname(Myname); + +--- 51,58 ----- + extern FILE *ufopen(); + int uid, ret; + char redir = '\0'; ++ int nonoti = 0; ++ int nonzero = 0; + + strcpy(Progname, "uux"); + uucpname(Myname); +*************** +*** 71,76 + if (Debug <= 0) + Debug = 1; + break; + default: + fprintf(stderr, "unknown flag %s\n", argv[1]); + break; + +--- 73,84 ----- + if (Debug <= 0) + Debug = 1; + break; ++ case 'n': ++ nonoti = 1; ++ break; ++ case 'z': ++ nonzero = 1; ++ break; + default: + fprintf(stderr, "unknown flag %s\n", argv[1]); + break; +*************** +*** 107,112 + fpc = ufopen(tcfile, "w"); + ASSERT(fpc != NULL, "CAN'T OPEN", tcfile, 0); + fprintf(fprx, "%c %s %s\n", X_USER, User, local); + + /* find remote system name */ + ap = inargs; + +--- 115,124 ----- + fpc = ufopen(tcfile, "w"); + ASSERT(fpc != NULL, "CAN'T OPEN", tcfile, 0); + fprintf(fprx, "%c %s %s\n", X_USER, User, local); ++ if (nonoti) ++ fprintf(fprx,"%c\n", X_NONOTI); ++ if (nonzero) ++ fprintf(fprx,"%c\n", X_NONZERO); + + /* find remote system name */ + ap = inargs; +uuxqt.c +*** uuxqt.c.1.1 Wed Feb 24 13:41:14 1982 +--- uuxqt.c.1.2 Wed Feb 24 13:41:39 1982 +*************** +*** 22,27 + void exit(); + char *strcpy(); + + #define PATH "PATH=/bin:/usr/bin;" + /* to remove restrictions from uuxqt + * define ALLOK 1 + +--- 22,29 ----- + void exit(); + char *strcpy(); + ++ int notiok = 1; ++ int nonzero = 0; + #define PATH "PATH=/bin:/usr/bin;" + /* to remove restrictions from uuxqt + * define ALLOK 1 +*************** +*** 117,122 + if (*(cmd + strlen(cmd) - 1) == '\n') + *(cmd + strlen(cmd) - 1) = '\0'; + break; + default: + break; + } + +--- 119,130 ----- + if (*(cmd + strlen(cmd) - 1) == '\n') + *(cmd + strlen(cmd) - 1) = '\0'; + break; ++ case X_NONOTI: ++ notiok = 0; ++ break; ++ case X_NONZERO: ++ nonzero = 1; ++ break; + default: + break; + } +*************** +*** 180,186 + sprintf(retstat, "exit %d, signal %d", ret & 0377, + (ret>>8) & 0377); + if (strcmp(xcmd, "rmail") != SAME +! && strcmp(xcmd, "mail") != SAME) + notify(user, Rmtname, cmd, retstat); + else if (ret != 0) { + /* mail failed - return letter to sender */ + +--- 188,195 ----- + sprintf(retstat, "exit %d, signal %d", ret & 0377, + (ret>>8) & 0377); + if (strcmp(xcmd, "rmail") != SAME +! && strcmp(xcmd, "mail") != SAME +! && notiok && (!nonzero || (nonzero && ret != 0))) + notify(user, Rmtname, cmd, retstat); + else if (ret != 0 && strcmp(xcmd, "rmail") == SAME) { + /* mail failed - return letter to sender */ +# I think this change doesn't apply to all systems - it can be safely ignored. +*************** +*** 182,188 + if (strcmp(xcmd, "rmail") != SAME + && strcmp(xcmd, "mail") != SAME) + notify(user, Rmtname, cmd, retstat); +! else if (ret != 0) { + /* mail failed - return letter to sender */ + retosndr(user, Rmtname, fin, buf); + sprintf(buf, "ret (%o) from %s!%s", ret, Rmtname, user); + +--- 191,197 ----- + && strcmp(xcmd, "mail") != SAME + && notiok && (!nonzero || (nonzero && ret != 0))) + notify(user, Rmtname, cmd, retstat); +! else if (ret != 0 && strcmp(xcmd, "rmail") == SAME) { + /* mail failed - return letter to sender */ + retosndr(user, Rmtname, fin, buf); + sprintf(buf, "ret (%o) from %s!%s", ret, Rmtname, user); +Comet }{ +script done on Wed Feb 24 13:42:39 1982 diff --git a/usr/contrib/news/uucp/uux.minus.c b/usr/contrib/news/uucp/uux.minus.c new file mode 100644 index 0000000000..a91d12f964 --- /dev/null +++ b/usr/contrib/news/uucp/uux.minus.c @@ -0,0 +1,141 @@ +*** /tmp/uux.c.old Sat Apr 2 20:16:45 1983 +--- /tmp/uux.c.new Sat Apr 2 20:16:54 1983 +*************** +*** 11,18 + *cmdp++ = ' ';\ + *cmdp = '\0';} + +! #define GENSEND(f, a, b, c, d) {\ +! fprintf(f, "S %s %s %s - %s 0666\n", a, b, c, d);\ + } + #define GENRCV(f, a, b, c) {\ + fprintf(f, "R %s %s %s - \n", a, b, c);\ + +--- 11,18 ----- + *cmdp++ = ' ';\ + *cmdp = '\0';} + +! #define GENSEND(f, a, b, c, d, e) {\ +! fprintf(f, "S %s %s %s -%s %s 0666\n", a, b, c, d, e);\ + } + #define GENRCV(f, a, b, c) {\ + fprintf(f, "R %s %s %s - \n", a, b, c);\ +*************** +*** 36,41 + char inargs[BUFSIZ]; + int pipein = 0; + int startjob = 1; + char path[MAXFULLNAME]; + char cmd[BUFSIZ]; + char *ap, *cmdp; + +--- 36,42 ----- + char inargs[BUFSIZ]; + int pipein = 0; + int startjob = 1; ++ int Copy = 1; + char path[MAXFULLNAME]; + char cmd[BUFSIZ]; + char *ap, *cmdp; +*************** +*** 65,70 + case 'r': + startjob = 0; + break; + case 'x': + Debug = atoi(&argv[1][2]); + if (Debug <= 0) + +--- 66,74 ----- + case 'r': + startjob = 0; + break; ++ case 'c': ++ Copy = 0; ++ break; + case 'x': + Debug = atoi(&argv[1][2]); + if (Debug <= 0) +*************** +*** 148,154 + } + fclose(fpd); + if (strcmp(local, xsys) != SAME) { +! GENSEND(fpc, dfile, dfile, User, dfile); + cflag++; + } + fprintf(fprx, "%c %s\n", X_RQDFILE, dfile); + +--- 152,158 ----- + } + fclose(fpd); + if (strcmp(local, xsys) != SAME) { +! GENSEND(fpc, dfile, dfile, User, "", dfile); + cflag++; + } + fprintf(fprx, "%c %s\n", X_RQDFILE, dfile); +*************** +*** 230,240 + fprintf(stderr, "permission denied %s\n", rest); + cleanup(1); + } +! if (xcp(rest, dfile) != 0) { +! fprintf(stderr, "can't copy %s to %s\n", rest, dfile); +! cleanup(1); +! } +! GENSEND(fpc, rest, dfile, User, dfile); + cflag++; + if (redir == '<') { + fprintf(fprx, "%c %s\n", X_STDIN, dfile); + +--- 234,247 ----- + fprintf(stderr, "permission denied %s\n", rest); + cleanup(1); + } +! if (Copy) { +! if (xcp(rest, dfile) != 0) { +! fprintf(stderr, "can't copy %s to %s\n", rest, dfile); +! cleanup(1); +! } +! GENSEND(fpc, rest, dfile, User, "", dfile); +! } else +! GENSEND(fpc, rest, dfile, User, "c", dfile); + cflag++; + if (redir == '<') { + fprintf(fprx, "%c %s\n", X_STDIN, dfile); +*************** +*** 288,294 + gename(DATAPRE, xsys, 'T', t2file); + GENRCV(fpd, rest, t2file, User); + fclose(fpd); +! GENSEND(fpc, dfile, tfile, User, dfile); + cflag++; + if (redir == '<') { + fprintf(fprx, "%c %s\n", X_RQDFILE, t2file); + +--- 295,301 ----- + gename(DATAPRE, xsys, 'T', t2file); + GENRCV(fpd, rest, t2file, User); + fclose(fpd); +! GENSEND(fpc, dfile, tfile, User, "", dfile); + cflag++; + if (redir == '<') { + fprintf(fprx, "%c %s\n", X_RQDFILE, t2file); +*************** +*** 332,338 + xuuxqt(); + } + else { +! GENSEND(fpc, rxfile, tfile, User, rxfile); + cflag++; + } + + +--- 339,345 ----- + xuuxqt(); + } + else { +! GENSEND(fpc, rxfile, tfile, User, "", rxfile); + cflag++; + } + -- 2.20.1