Aucbarpa.1178 net.sources utzoo!decvax!ucbvax!ARPAVAX:usenet Tue Apr 20 19:44:04 1982 2.3-2.6.e ed - README << '-*-END-*-' 80a If you want expired articles kept around, create the directory /usr/spool/oldnews. The expire program will create a hierarchy under this location, if present, similar to the one under /usr/spool/news. The expire program will delete all articles in the history file which are past their expiration date. It will remove both the article and the line in history. This mechanism should keep your history file down to a manageable size. The trimlib script in the misc directory can be used to keep you log file down in size. Both expire and trimlib should be run once a night from crontab. . 20c the net. Other useful tools contributed by other sites are added to this directory for optional use by USENET sites. . w q -*-END-*- ed - doc/howto.ms << '-*-END-*-' 7c Columbus, Ohio 43213 . w q -*-END-*- ed - doc/install.ms << '-*-END-*-' 980c to see what they subscribe to on the old system, and then create a file in their . 956a (Actually, this will prevent the bitfile from being updated, so it may not be a good idea.) . 177a .NH 3 MANUALLY .PP If this is defined, incoming .B rmgroup messages will not remove the subdirectories, but rather just remove the group line from your active file. You should have NOTIFY on if you use this. Note that on a USG system the subdirectory will not be removed anyway unless you have an unsecure (mode 777 directory) system. . w q -*-END-*- ed - man/checknews.1 << '-*-END-*-' 14a .TP 10 .B q causes checknews to be quiet. Instead of printing a message, the exit status indicates news. A status of 0 means no news, 1 means there is news. . 5c checknews [ynqevv] [readnews options] . w q -*-END-*- ed - man/expire.8 << '-*-END-*-' 19a .PP The .B \-v option causes expire to be more verbose. It can be given a verbosity level (default 1) as in .B \-v3 for even more output. This is useful if articles aren't being expired and you want to know why. .PP The .B \-e flag gives the number of days to use for a default expiration date. If not given, an installation dependent default (often 2 weeks) is used. .PP The .B \-i and .B \-I flags tell .B expire to ignore any expiration date explicitly given on articles. This can be used when disk space is really tight. The .B \-I flag will always ignore expiration dates, while the .B \-i flag will only ignore the date if ignoring it would expire the article sooner. .I WARNING: If you have articles archived by giving them expiration dates far into the future, these options might remove these files anyway. . 5c /usr/lib/news/expire [ .B \-n .I newsgroups ] [ .B \-i ] [ .B \-I ] [ .B \-v [ .I level ] ] [ .B \-e .I days ] . w q -*-END-*- ed - man/inews.1 << '-*-END-*-' 41c .B \-f . 32c .B \-n . w q -*-END-*- ed - man/news.5 << '-*-END-*-' 124c .B "old2:net.all,fa.all:A:/usr/lib/sendnews \-o old2\\:rnews" . 122c .B "arpasys:net.all,arpa.all::/usr/lib/news/sendnews \-a rnews@arpasys" . 120c .B "berksys:net.all,ucb.all::/usr/lib/news/sendnews \-b berksys\\:rnews" . 118c .B "oldsys:net.all,fa.all,to.oldsys:A" . 113c .BI "uux \- \-z \-r " sysname !rnews. . 81,82d 67a .TP 15 .B Reply-To: .I Address for mail replies .TP 15 .B References: .I Article ID of article this is a follow-up to. .TP 15 .B Control: .I Text of a control message . 15c .BI A article-ID . w q -*-END-*- ed - man/newsrc.5 << '-*-END-*-' 34c .B "options \-c \-r" . 32c .B "options \-n all !fa.sf-lovers !fa.human-nets \-r" . 9c .IR readnews(1) " and " checknews(1). . 3c newsrc \- information file for readnews(1) and checknews(1) . w q -*-END-*- ed - man/postnews.1 << '-*-END-*-' 47c For more sophisticated uses, such as specifying an expiration date, . 45d 42c the user should type the body of the article. To end the article, type control D at the beginning of a line. If the environment variable EDITOR is set to the pathname of an editor, the user will be placed in that editor instead of typing in the article by hand. Optionally, the article . w q -*-END-*- ed - man/readnews.1 << '-*-END-*-' 177a If the first character of the file name is `|', the rest of the file name is taken as the name of a program, which is executed with the text of the article as standard input. . w q -*-END-*- ed - man/sendnews.8 << '-*-END-*-' 38c .B \-n . 29c .B \-b . 20c .B \-a . 16c .B \-o . 5c sendnews [ .B \-o ] [ .B \-a ] [ .B \-b ] [ .B \-n newsgroups ] destination . w q -*-END-*- ed - misc/adm << '-*-END-*-' 146,159c cat <<"blart" Please give the network names of the people that you talk to on the uucp network. This information is desired for a database of UUCP connections from which UUCP aliasing files can be built through a program written by unc!smb. List each site to which you have a uucp connection that you wish to make public. To list a site, give its UUCP name, followed by a value describing how useful the connection is in parentheses. Your cost can be given as a standard arithmetic expression. The lower the number, the better the line is. The following 'manifests' are known to the program with the following values: (If you don't give an expression, 3000 is default) LOCAL = 10 ARPA = 31 DED = 95 DEDICATED = 95 DIRECT = 200 DEMAND = 300 DIAL = 300 DIALED = 300 HOURLY = 500 POLLED = 5000 DAILY = 5000 WEEKLY = 30000 DEAD = INF/2 HIGH = -5 /* baud rate bonus */ LOW = 5 /* baud rate penalty */ Delimit your entries with commas. Type as many lines as you like, (naturally, don't put a comma after the last entry) and enter a null line when you are done. Here is an example: decvax(2*HOURLY), watcgl(DIRECT), watarts(DEMAND), hcr(POLLED), cbosg(WEEKLY) blart while { read uupart; test -n "$uupart"; } do echo Partners: $uupart >>$san done . 74a Eventually, best paths will be pulled out of the UUCP link entries in your directory. . 30c site. If you want it to put the entry in a private one file per site directory, the change is fairly obvious. . 23a One of the things the script asks for is a list of your uucp connections in the format required by unc!smb's cheapest path uucp alias generator. If all sites provide the public paths they have, this will allow the generator to produce the best routings, saving everybody money and phone time. . 4,11c Subject: net.adm.site stuff Via: cbosgd.uucp (V3.73 [1/5/82]); 2-Mar-82 20:01:48-EST (Tue) Mail-From: cbosg received by cbosgd at 2-Mar-82 20:01:45-EST (Tue) To: decvax!cbosg!cbosgd!mark decvax!duke!unc!smb decvax!ittvax!swatt decvax!shannon decvax!ucbvax!ARPAVAX:glickman watarts!eric ::::::::::::::::::::::::::::::::::::::::::::::::::: . 1,2c From cbosg!decvax!watmath!bstempleton Tue Mar 2 20:01:49 1982 Date: Mon Mar 1 19:37:04 1982 . w q -*-END-*- ed - src/Makefile.usg << '-*-END-*-' 97c recnews: recnews.c defs.h . 94c uurec: uurec.c defs.h . 92a control.o: control.c defs.h $(CC) $(CFLAGS) -c control.c . 40c rm -f $(COMMANDS) *.o . 18c OTHERS = uurec recnews expire sendnews . 1c # @(#) Makefile.usg 2.3 4/18/82 . w q -*-END-*- ed - src/Makefile.v7 << '-*-END-*-' 96c recnews: recnews.c defs.h . 93c uname.o: uname.c defs.h $(CC) $(CFLAGS) -c uname.c uurec: uurec.c defs.h . 91a control.o: control.c defs.h $(CC) $(CFLAGS) -c control.c . 39c rm -f $(COMMANDS) *.o . 1c # @(#) Makefile.v7 2.3 4/18/82 . w q -*-END-*- ed - src/checknews.c << '-*-END-*-' 325c if (q) exit(1); else exit(0); . 108c if (!n && !e && !y && !q) . 94a case 'q': q++; break; . 92d 87a q = 0; . 63c char newsrc[BUFLEN],*rcline[LINES],rcbuf[LBUFLEN],*argvrc[LINES]; . 60c int line = -1, y, e, n, q; . 5c static char *SccsId = "@(#) checknews.c 2.7 4/4/82"; . w q -*-END-*- ed - src/control.c << '-*-END-*-' 384c log("UNKNOWN Ctl Msg %s from %s", ctlmsgtext, h->path); . 380a char *ctlmsgtext; . 379c c_unknown(h, ctlmsgtext) . 323c fprintf(f, "Subject: response to your sendsys request\n\n"); . 318c f = mailhdr(NOTIFY, "sendsys control message"); . 282c if (!su && strcmp(r, s)) { . 266a } . 265c if (r == 0) { . 263a if((uid==ROOTID||uid==0) && strncmp(msgng,"to.",3) == 0) su = 1; . 245a strcpy(msgng, header.nbuf); . 243a char msgng[64]; int su = 0; . 229a #endif . 222a #ifndef MANUALLY . 211a if (groupname[0] == '.') xerror("Illegal group name in rmgroup"); . 51c c_unknown(h, ctlmsgtext); . 34c argparse(ctlmsgtext); . 23,24c if (*h->ctlmsg) ctlmsgtext = h->ctlmsg; else ctlmsgtext = h->title; log("Ctl Msg %s from %s: %s", h->nbuf, h->path, ctlmsgtext); . 20a register char *ctlmsgtext; . 6c static char *SccsId = "@(#) control.c 2.6 4/18/82"; . w q -*-END-*- ed - src/defs.h << '-*-END-*-' 26a /* #define MANUALLY /* Don't execute rmgroups, just notify. */ /* #define BERKNAME "ARPAVAX" /* name of local host on Berknet */ . 10c static char *Defs = "@(#) defs.h 2.6 4/18/82"; . 7a * * By convention, the version of the software you are running is taken * to be the version of control.c. . w q -*-END-*- ed - src/expire.c << '-*-END-*-' 127a } mkdir(groupdir) register char *groupdir; { char buf[BUFLEN]; register struct passwd *pw; extern char *NEWSU; int rc; if (access(OLDNEWS, 2) < 0) return -1; sprintf(buf, "mkdir %s/%s", OLDNEWS, groupdir); rc = system(buf); sprintf(buf, "%s/%s", OLDNEWS, groupdir); if (verbose) printf("mkdir %s, rc %d\n", buf, rc); chmod(buf, 0755); if ((pw = getpwnam(NEWSU)) != NULL) chown(buf, pw->pw_uid, pw->pw_gid); return rc; . 126d 124a printf("expire: %s.\n", message); . 121a ulall(artlist) char *artlist; { char *p; int last = 0; char newname[BUFLEN]; while (*artlist == ' ' || *artlist == '\n') artlist++; if (*artlist == 0) return; p = index(artlist, ' '); if (p == 0) { last = 1; p = index(artlist, '\n'); } if (p == 0) { last = 1; unlink(artlist); return; } if (p) *p = 0; if (access(OLDNEWS, 0) == 0) { sprintf(newname, "%s/%s", OLDNEWS, artlist); printf("link %s to %s\n", newname, filename); if (link(artlist, newname) == -1) { if (mkdir(groupdir) == 0) link(artlist, newname); } } if (verbose) printf("unlink %s\n", artlist); unlink(artlist); if (!last) ulall(p+1); } . 118a unlink(OARTFILE); link(ARTFILE, OARTFILE); unlink(ARTFILE); link(NARTFILE, ARTFILE); unlink(NARTFILE); . 117a else { fputs(afline, nhfd); if (verbose > 2) printf("Good article %s\n", rcbuf); } fclose(fp); . 112,116d 107,110c if (verbose) printf("cancel %s\n", filename); ulall(p2); . 105c printf("cancel %s\n", filename); . 85,103c } if (hread(&h, fp) == NULL) { if (verbose) printf("Garbled article %s.\n", filename); fclose(fp); continue; } h.exptime = cgtdate(h.expdate); if (!h.expdate[0] || ignorexp==2 || (ignorexp==1 && newtime < h.exptime)) h.exptime = newtime; if (now >= h.exptime) { . 77,83c strcpy(filename, p2); p1 = index(filename, ' '); if (p1 == 0) p1 = index(filename, '\n'); if (p1) *p1 = 0; if (access(filename, 4) || (fp = fopen(filename, "r")) == NULL) { if (verbose > 3) printf("Can't open %s.\n", filename); . 75a } . 74c if (!ngmatch(groupdir, ngpat)) { fputs(afline, nhfd); . 66,72c newtime = now + expincr; if (chdir(SPOOL)) xerror("Cannot chdir %s", SPOOL); sprintf(OARTFILE, "%s/%s", LIB, "ohistory"); sprintf(ARTFILE, "%s/%s", LIB, "history"); ohfd = xfopen(ARTFILE, "r"); sprintf(NARTFILE, "%s/%s", LIB, "nhistory"); nhfd = xfopen(NARTFILE, "w"); while (fgets(afline, BUFLEN, ohfd) != NULL) { if (verbose > 1) printf("article: %s", afline); p1 = index(afline, '\t'); if (p1) p2 = index(p1+1, '\t'); else continue; if (!p2) continue; p2++; strcpy(groupdir, p2); p1 = index(groupdir, '/'); if (p1) *p1 = 0; else continue; if (verbose > 1) printf("newsgroup %s\n", groupdir); . 58c printf("Usage: expire [ -v [level] ] [-e days ] [-i] [-n newsgroups]\n"); . 42a case 'e': /* Use this as default expiration time */ if (argc > 2 && argv[2][0] != '-') { argv++; argc--; expincr = atol(argv[1]) * DAYS; } break; case 'I': /* Ignore any existing expiration date */ ignorexp = 2; break; case 'i': /* Ignore any existing expiration date */ ignorexp = 1; break; . 33a expincr = DFLTEXP; . 32a char afline[BUFLEN]; char *p1, *p2; FILE *ohfd, *nhfd; . 30,31c register time_t now, newtime; . 19c char ARTFILE[BUFSIZ], NARTFILE[BUFSIZ], OARTFILE[BUFSIZ]; char filename[BUFSIZ]; char *OLDNEWS = "/usr/spool/oldnews"; int verbose = 0; int ignorexp = 0; long expincr; long atol(); . 15c extern char groupdir[BUFSIZ], rcbuf[BUFLEN]; . 8,13c #include "params.h" . 6c static char *SccsId = "@(#) expire.c 2.8 4/20/82"; . w q -*-END-*- ed - src/ftime.c << '-*-END-*-' 1c static char *SccsId = "@(#) ftime.c 2.2 3/14/82"; . w q -*-END-*- ed - src/funcs.c << '-*-END-*-' 337,338d 188c extern char **environ; . 5c static char *SccsId = "@(#) funcs.c 2.4 4/3/82"; . w q -*-END-*- ed - src/getdate.y << '-*-END-*-' 6c /* @(#) getdate.y 2.4 4/3/82 */ . w q -*-END-*- ed - src/header.c << '-*-END-*-' 232a if (*hp->ctlmsg) fprintf(fp, "Control: %s\n", hp->ctlmsg); . 230,231c if (*hp->followid) . 227,228c fprintf(fp, "Posted: %s\n", hp->subdate); if (wr == 1) fprintf(fp, "Received: %s\n", hp->recdate); if (*hp->expdate) fprintf(fp, "Expires: %s\n", hp->expdate); if (*hp->replyto) . 225c if (wr == 2) fprintf(fp, "From: %s\nNewsgroups: %s\n", hp->path, bfr); else fprintf(fp, "From: %s!%s\nNewsgroups: %s\n", SYSNAME, hp->path, bfr); . 223a ihwrite(hp, fp, 1); } /* * Write header at 'hp' on stream 'fp' in B format. Include received date * if wr is 1. Leave off sysname if wr is 2. */ ihwrite(hp, fp, wr) register struct hbuf *hp; register FILE *fp; int wr; { . 219d 202,212c ihwrite(hp, fp, 0); . 191a if (!strncmp(ptr, "Control: ", 12)) return CONTROL; . 126a break; case CONTROL: if (!ctlflag) getfield(&ctlflag, hp->ctlmsg); break; . 78a int ctlflag = FALSE; . 69a #define CONTROL 10 . 5c static char *SccsId = "@(#) header.c 2.6 4/18/82"; . w q -*-END-*- ed - src/header.h << '-*-END-*-' 20a char ctlmsg[PATHLEN]; /* control message */ . 5c static char *Header = "@(#) header.h 2.4 4/18/82"; . w q -*-END-*- ed - src/help << '-*-END-*-' 11a s |program Run program with article as standard input. . w q -*-END-*- ed - src/ifuncs.c << '-*-END-*-' 117c if (noshell) { if (pid = fork()) fwait(pid); else { close(0); open(TRANS, 0); ptr = sp->s_xmit; for (pid = 0; pid < 19; pid++) { while (isspace(*ptr)) *ptr++ = 0; argv[pid] = ptr; while (!isspace(*++ptr) && *ptr) ; if (!*ptr) break; } argv[++pid] = 0; execv(sp->s_xmit, argv); xerror("Can't execv\n"); } } else fwait(fsubr(pshell, bfr, (char *)NULL)); . 102c else . 99a #ifdef BERKNAME gobbledygook; if (berknet) { ptr = index(h.path, '!'); sprintf(bfr, "%s:%s", BERKNAME, ++ptr); strcpy(h.path, bfr); } if (berknet) ihwrite(&h, ofp, 2); else #endif . 69a /* noshell: don't fork a shell to execute the xmit command */ int noshell = (index(sp->s_flags, 'S') != NULL); #ifdef BERKNAME /* berknet: change sysname in path to berknet name */ int berknet = (index(sp->s_flags, 'U') != NULL); #endif . 65a char *argv[20]; register int pid, fd; . 63a register char *ptr; . 5c static char *SccsId = "@(#) ifuncs.c 2.7 4/19/82"; . w q -*-END-*- ed - src/inews.c << '-*-END-*-' 476c if ((pid = fork()) <= 0) { . 289c i = fork(); if (i <= 0) . 235c } is_ctl = mode != CREATENG && (ngmatch(header.nbuf, "all.all.ctl,") || *header.ctlmsg); if (mode == PROC) { . 222d 5c static char *SccsId = "@(#) inews.c 2.8 4/20/82"; . w q -*-END-*- ed - src/newsinstall.sh << '-*-END-*-' 72c chmod 755 $SPOOLDIR/.canned . 70c if test -d $SPOOLDIR/.canned . 40c touch $LIBDIR/history $LIBDIR/active $LIBDIR/log $LIBDIR/users chmod 666 $LIBDIR/users . w q -*-END-*- ed - src/postnews.usg << '-*-END-*-' 27,30d 24c inews -t "$title" -n $ng < $1 & . 20,21c if [ x$EDITOR = x ] then echo "Type news, end with control D" inews -t "$title" -n $ng else t=/tmp/pn$$ trap "rm -f $t; exit" 0 1 2 $EDITOR $t inews -t "$title" -n $ng <$t & fi . 13c echo "Newsgroups (general): " \\c . 11c echo "Title: " \\c . 1,2c : '@(#) postnews.usg 2.3 4/18/82' . w q -*-END-*- ed - src/postnews.v7 << '-*-END-*-' 26,29d 23c inews -t "$title" -n $ng < $1 & . 19,20c if [ x$EDITOR = x ] then echo "Type news, end with control D" inews -t "$title" -n $ng else t=/tmp/pn$$ trap "rm -f $t; exit" 0 1 2 $EDITOR $t inews -t "$title" -n $ng <$t & fi . 12c echo -n "Newsgroups (general): " . 10c echo -n "Title: " . 1c : '@(#) postnews.v7 2.3 4/18/82' . w q -*-END-*- ed - src/process.c << '-*-END-*-' 5c static char *SccsId = "@(#) process.c 2.2 3/14/82"; . w q -*-END-*- ed - src/readnews.c << '-*-END-*-' 216c if (xflag || lflag || tflag) . 82a #else PAGER = ""; #endif . 80a #ifdef PAGE . 5c static char *SccsId = "@(#) readnews.c 2.4 4/3/82"; . w q -*-END-*- ed - src/readr.c << '-*-END-*-' 980,981c *dest++ = '"', src++; else *dest++ = *src++; . 971a /* * like strcat but be careful with quotes. since there appears to be no way * to quote an apostrophe in sh, we change them to double quotes. */ . 921,924c else pclose(inews); if (pid == 0) exit(0); return 0; . 913,919c fflush(stdout); pid = fork(); if (pid > 0) return 0; uname(&me); strcpy(distgroup, hp->nbuf); p = index(distgroup, '.'); q = index(p+1, '.'); if (notauthor) sprintf(distgroup, "to.%s.ctl", me.nodename); else if (p == 0) sprintf(distgroup, "%s.msg.ctl", distgroup); else if (q == 0) strcat(distgroup, ".ctl"); else strcpy(q, ".ctl"); sprintf(bfr, "%s -t 'cancel %s' -n %s < /dev/null", INEWS, hp->ident, distgroup); if ((inews = popen(bfr, "w")) == NULL) . 911c struct utsname me; char *p, *q; char distgroup[64]; int pid; . 908a int notauthor; . 905,906c /* * Cancel the article whose header is in hp, by posting a control message * to cancel it. The scope of the control message depends on who would * really be willing to cancell it. It is sent as far as it will do any good. * notauthor is true iff the person posting the article is the real author. */ cancel(ofp, hp, notauthor) . 767c fclose(ufp); if (isnew && !isprogram) printf("%s: %s\n", to, isnew ? "New file": "Appended"); . 743a ufp = fopen(to, "r"); if (ufp != NULL) { fclose(ufp); isnew = 0; } . 734a int isnew = 1; . 641c fprintf(ofp, "Last article is %ld.\n", statbuf.st_size); . 605c printf("%s\n", rcbuf); . 596a if (access(tf, 4)) { fprintf(stderr, "Article not posted: no input file.\n"); break; } . 576c if (index("\\", *ptr2)) . 560c sprintf(bfr, "%s -F %s -n %s -t \'", INEWS, ptr3, ptr2); . 549a ptr3 = hbuf1.ident; . 545a ptr3 = h.ident; . 369,370c } else if (i) fprintf(ofp, "Not contributor: cancelling locally only.\n"); if (!cancel(ofp, hptr, i)) { . 366c i = strcmp(username, hptr->path); if (i && uid != ROOTID && uid) { . 283,284c if(*bptr != '|' && index(bptr,'/') == NULL) { char hetyped[BUFLEN]; char *boxptr; strcpy(hetyped,bptr); if((boxptr=getenv("NEWSBOX"))!=NULL) strcpy(bptr,boxptr); else sprintf(bptr,"%s",userhome); strcat(bptr,"/"); if(hetyped[0] != '\0') strcat(bptr, hetyped); else strcat(bptr, "Articles"); } . 250a if (hflag) fprintf(ofp, "From: %s\n", h.path); . 176c } . 32c char *ptr1, *ptr2, *ptr3; /* for reply manipulation */ . 5c static char *SccsId = "@(#) readr.c 2.8 4/18/82"; . w q -*-END-*- ed - src/recnews.c << '-*-END-*-' 314,315d 34c static char *SccsId = "@(#) recnews.c 2.3 4/3/82"; . w q -*-END-*- ed - src/rfuncs.c << '-*-END-*-' 306a /* * Given an article ID, return TRUE if we have already seen that article ID * in this readnews session. This should only be called for articles * with commas in the newsgroup name, and prevents the same article, which * was submitted to multiple newsgroups, from being shown to the same * person more than once. Bug: if the user quits after seeing the first * copy, he'll see it again next time in the other newsgroup. */ #define NART 100 /* max # articles on multiple newsgroups */ #define IDSIZE 14 /* max size of an article ID */ seenbefore(artid) char *artid; { static int nbef = 0; static char histbuf[NART][IDSIZE]; register int i; for (i=0; i= IDSIZE) { fprintf(stderr, "Article id '%s' too long\n", artid); return FALSE; } if (nbef >= NART-1) { fprintf(stderr, "Too many multiple newsgroup articles\n"); return FALSE; } strcpy(histbuf[nbef++], artid); return FALSE; } . 303a if (index(hp->nbuf, ',') && seenbefore(hp->ident)) return FALSE; . 5c static char *SccsId = "@(#) rfuncs.c 2.5 4/18/82"; . w q -*-END-*- ed - src/sendnews.c << '-*-END-*-' 94a punct--; . 89a punct--; . 5c static char *SccsId = "@(#) sendnews.c 2.3 4/3/82"; . w q -*-END-*-