This is an official patch for INN; please apply it. This patch changes INN1.3 to INN1.4. If you already have the INN1.4 release, do not apply this patch. Patches must be applied in order. If you need other patches, they should be available from the same place where you got the original software. This patch updates some files that might have been modified by "subst." Before applying this patch, restore those files to their original state: cd $inn/config make CONF=config.dist Then reconfigure after applying this patch. Another option is to apply the patch directly and fix up any rejects by hand as you review any ".rej" files that get created. Or, you can restore the default config, patch, and re-install your config and rebuild the distribution: cd $inn/config mv config.data config.new cp config.dist config.data make quiet cd .. patch -p Add YACC config variable. Alias FNDELAY to O_NDELAY for systems without it Use $(SHELL) not sh in Makefiles Use "echo ...|su" not "su -c ..." in rc.news and BUILD. Document setsockopt/svr4 problems. overview.fmt.5 referenced makeoverview . Various typos in documentation , , . Add sample newsfeeds entry to overchan.8 More text for innwatch.ctl, ``make update'', news overview . inews can spool, so you need rnews; update inews.1 Add rnews explanations to Install.ms.1 Inews should not spool or email if -D given. rnews had bad fopen call rnews could not connect to remote server. rnews leaked memory in ReadRemainder. decode unpacked end wrong. decode used bad pointer comparisons. #if was backwards in syslog/syslogd.c . Remove leading space in filenames in syslog.conf Add -O flag to expireover; fix sorting bug . *** RUN "expireover -a -s" SOON ** Malloc overrun in expireover.c article.c Have overchan create needed dirs if overview dir != spool dir. Add overchan .o dependencies to backends/Makefile. avoid unneeded unlink/group in expireover Add -g to expire faster raceless expireover/overchan locking use caseEQ not EQ in CMDmode in nnrpd Two wrong CloseOnExec calls in article.c Have nnrpd's HISgetent return (char *) not (STRING). Remove STATIC from nnrpd's CMD_unimp function definition; change it to recognize slave command. Add "date" command (from nntpv2 draft) to nnrpd. Add -u flag and statistics to nntpget. Add -p flag to filechan, buffchan. buffchan shouldn't open dropped sites. Add -A flag to innxmit. newsrequeue re-used variable; coredumped if not logfile mode. expireover and fastrm need . Move functions in fastrm so STATIC declaration is okay. BUILD and makehistory no longer assume history is in NEWSLIB. Spelled Jon's name wrong in dbz.pch Use memset not bzero in local FD_ZERO macro. getlist parsed positional arguments wrong getlist did not send a QUIT to the server. Reverse order of elements in include/uio.h Have GetFQDN try to force NIS/YP to use DNS Fix date parser when hour is 12. Typo in header in send-ihave Had senduucp.log in samples/scanlogs Have innwatch not complain to console if innd dies Add logwatch into innwatch rmgroup, newgroup, checkgroup are better about updating newsgroups Spurious erroneous mail line in rmgroup. checkgroups mail message is now more clear. Convert remaining scripts in samples to use innshellvars Fix dataloss and fd leak in SITEflush Don't use strlen on mmap'd active file Used ModeReason not RejectReason in CCmode, CCreject Used wrong argv[] in CCreject Don't free NULL pointer in innd/rc.c . Set all WIP's properly to NULL SITEparsefile didn't free old ME entry innd had typo in NICE_KIDS #if test Add (void) to setsid call in innd SITEwantsgroup didn't check ME patterns Don't crash if spooling fails Don't reuse socket in innd/cc.c Protect possible NULL return from RChostname (!?). New NNTP connections to innd must clear any old WIP. Add "p" item to newsfeeds "A" flag; document slave use. rmgroups propagate like newgroups. ctlinnd 'addhist' must open history if server not running. innd clobbered memory on some reloads. Copy SetDescriptorLimit into inndstart. Make LIST case-insensitive in innd. Add hosts.nntp.nolimit Check PID file before innd starts up. Index: BUILD =================================================================== RCS file: RCS/BUILD,v retrieving revision 1.8 diff -c1 -r1.8 BUILD *** 1.8 1993/01/29 16:42:04 --- BUILD 1993/03/18 21:03:04 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.8 $ ## An interactive script to configure, build, and install InterNetNews. --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.9 $ ## An interactive script to configure, build, and install InterNetNews. *************** *** 6,7 **** --- 6,9 ---- + UMASK=${INN_UMASK-027} + if [ ! -f config/config.data ] ; then *************** *** 20,21 **** --- 22,26 ---- echo ' is "safer." This usually means recompiling.' + echo '' + echo ' You cannot install over a running system; this script will' + echo ' remind you about this later.' *************** *** 137,138 **** --- 142,147 ---- + umask ${UMASK} + echo '' + echo 'Setting umask to' `umask` + echo '' *************** *** 149,150 **** --- 158,162 ---- echo '' + echo 'You are now ready to install the INN programs and config files.' + echo 'You CANNOT DO THIS if INN is running now -- you must shut down' + echo 'your news system first.' echo 'Do you want to continue with the installation [y or n]? ' | tr -d '\012' *************** *** 165,167 **** echo 'and inndstart, for example. If the following "make" fails, do this:' ! echo ' su -c "make update"' echo 'and rerun this script.' --- 177,179 ---- echo 'and inndstart, for example. If the following "make" fails, do this:' ! echo ' echo make update | su' echo 'and rerun this script.' *************** *** 267,269 **** HERE=`/bin/pwd` ! cd ${NEWSLIB} ${NEWSBIN}/makehistory ${FLAGS} || { --- 279,282 ---- HERE=`/bin/pwd` ! HISTORYDIR=`echo ${HISTORY} | sed -e 's@\(.*\)/.*@\1@'` ! cd ${HISTORYDIR} ${NEWSBIN}/makehistory ${FLAGS} || { *************** *** 276,277 **** --- 289,292 ---- cd ${HERE} + sh ./installit.sh ${OWNERS} -m 0664 ${HISTORY}.dir ${HISTORY}.dir + sh ./installit.sh ${OWNERS} -m 0664 ${HISTORY}.pag ${HISTORY}.pag Index: Install.ms.1 =================================================================== RCS file: RCS/Install.ms.1,v retrieving revision 1.11 diff -c -c1 -r1.11 Install.ms.1 *** 1.11 1993/01/29 16:42:05 --- Install.ms.1 1993/03/19 17:50:08 *************** *** 1,2 **** ! .\" $Revision: 1.11 $ .\" Uses the -ms macro package; e.g., "nroff -ms Install.ms | col >Install.out" --- 1,2 ---- ! .\" $Revision: 1.13 $ .\" Uses the -ms macro package; e.g., "nroff -ms Install.ms | col >Install.out" *************** *** 40,42 **** .. ! .R$ $Id: Install.ms.1,v 1.11 1993/01/29 16:42:05 rsalz Exp $ .AE --- 40,42 ---- .. ! .R$ $Id: Install.ms.1,v 1.13 1993/03/19 17:49:59 rsalz Exp $ .AE *************** *** 468,470 **** This will be either a ``struct\ direct'' or a ``struct\ dirent''; ! so set this to ``DIRECT'' or ``DIRECT'' as appropriate. .PP --- 468,470 ---- This will be either a ``struct\ direct'' or a ``struct\ dirent''; ! set the parameter to ``DIRECT'' or ``DIRENT'' as appropriate. .PP *************** *** 547,548 **** --- 547,550 ---- You should at least look through the parameters up to \fIVERIFY_CANCELS\fP. + (If set to ``DO'', then \fIinnd\fP will ignore cancel messages unless + the From or Sender header match those of the original poster.) In general, however, you can leave this section pretty much alone until you *************** *** 549,552 **** have some experience running INN. .PP ! \fIInnd\fP can use memory-map the \fIactive\fP file if you set \fIACT_STYLE\fP to ``MMAP''. --- 551,555 ---- have some experience running INN. + Nevertheless, here are some comments on some of the more useful parameters. .PP ! \fIInnd\fP can memory-map the \fIactive\fP file if you set \fIACT_STYLE\fP to ``MMAP''. *************** *** 558,560 **** any new news has come in. ! The best work-around is probably an hourly cron job that touches the \fIactive\fP file. --- 561,564 ---- any new news has come in. ! (\fINnmaster\fP is part of the \fInn\fP newsreading program.) ! The best work-around is probably an hourly \fIcron\fP job that touches the \fIactive\fP file. *************** *** 561,562 **** --- 565,593 ---- .PP + There are a number of parameters that control the behavior of \fIrnews\fP. + If you set \fIRNEWS_SAVE_BAD\fP to ``DO'' then articles that \fIinnd\fP + rejects for reasons like bad headers will be saved in the \fI_PATH_BADNEWS\fP + directory; you will have to periodically scan this directory and clean + it up. + You can also control how \fIrnews\fP logs duplicates (those aren't saved + regardless of the value of \fIRNEWS_SAVE_BAD\fP), logging them through + \fIsyslog\fP, to a file, or not. + Note that if you set \fIRNEWS_LOG_DUPS\fP to ``FILE'', then you will want + to change \fI_PATH_RNEWS_DUP_LOG\fP, which appears later in the file. + If you receive news from several UUCP feeds, you might want to log duplicates + so that you can cut down your phone bills by optimizing your feeds. + The \fIRNEWSPROGS\fP parameter says whether or not to look in + \fI_PATH_NEWSPROGS\fP for commands named on the incoming ``#!'' line of + news batches. + You probably want to set this to ``DO''. + Make sure that the full pathname of \fIrnews\fP, \fI_PATH_RNEWS\fP, + does not conflict with the directory where your unpackers are put, + \fI_PATH_NEWSPROGS\fP. + .PP + If \fIIPADDR_LOG\fP is set to ``DO'' then the news log will report the IP + address of hosts that send articles, rather then what they put in the Path + line. + This can be useful if you run \fIinnd\fP with the ``\-a'' flag. + (If you do this, you might want to pick up ``hf.tar.Z'' via anonymous + FTP to ee.lbl.gov; it is a filter that turns IP addresses into host names.) + .PP The \fIxxx_TIMEOUT\fP parameters control various timers within INN; *************** *** 722,725 **** articles, and when it should start again. ! You will have to examine \fIsite/innwatch.ctl\fP and probably modify it. ! For example, the output of \fIdf\fP varies among different systems. .PP --- 753,766 ---- articles, and when it should start again. ! You will have to examine \fIsite/innwatch.ctl\fP and probably modify it, ! usually to check the amount of free space on the disks. ! For example, there is a line in the file that has this fragment in it: ! .DS ! !!! df . | awk 'NR == 2 { print $4 }' ! ... ! .DE ! This is looking at the fourth field of the second line to get the amount ! of freespace. ! You will have to change the ``2'' and ``4'' here, and on other lines, as ! appropriate for your system. ! (Changing the output of \fIdf\fP seems to be one of the things vendors like ! to do most; it is not worth my time to have INN keep track of all of them.) .PP *************** *** 753,756 **** .PP - .UL "AIX" .DS .ta \w'HAVE_ST_BLKSIZE 'u --- 794,797 ---- .PP .DS + .UL "AIX" .ta \w'HAVE_ST_BLKSIZE 'u *************** *** 776,779 **** .PP - .UL "A/UX" .DS .ta \w'HAVE_ST_BLKSIZE 'u --- 817,820 ---- .PP .DS + .UL "A/UX" .ta \w'HAVE_ST_BLKSIZE 'u *************** *** 784,787 **** .PP - .UL "BSDI" .DS ABORTVAL void --- 825,828 ---- .PP .DS + .UL "BSDI" ABORTVAL void *************** *** 802,803 **** --- 843,845 ---- _PATH_MAILCMD /usr/bin/Mail + _PATH_SENDMAIL /usr/sbin/sendmail -t PID_T pid_t *************** *** 811,826 **** .DE ! At least the pre-release versions of BSDI have a number of problems. ! You must install and use \fIbash\fP to run the \fIiftrue.sh\fP script ! (see \fIconfig/Makefile\fP and \fIlib/Makefile\fP). ! You must change \fIsamples/rc.news\fP so that it doesn't call ``su\ -c'' ! and doesn't try to run \fIinnwatch\fP. ! Finally, the default maximum data segment size is too small for \fIinnd\fP. ! Finally, you must either add a \fIsetrlimit\fP call to \fIinnd/innd.c\fP ! or add the following line to your config and rebuild your kernel: ! .DS ! options "DFLDSIZ=33554432" # 32 MB data space ! .DE .PP - .UL "HP-UX 8.0" .DS .ta \w'HAVE_ST_BLKSIZE 'u --- 853,863 ---- .DE ! Change the \fISHELL\fP variable in \fIconfig/Makefile\fP and ! \fIsite/Makefile\fP to point to \fI/usr/contrib/bin/bash\fP. ! Edit \fIlib/Makefile\fP so that the \fIinstall\fP target does not ! try to make \fI../llib-linn.ln\fP. ! You must also use the GNU \fIsed\fP; the version distributed with ! BSDI 0.9.4.1 enters an infinite loop processing newgroup messages. .PP .DS + .UL "HP-UX 8.0" .ta \w'HAVE_ST_BLKSIZE 'u *************** *** 863,866 **** .PP - .UL "SGI Indigo with IRIX 4.0.1" .DS .ta \w'HAVE_ST_BLKSIZE 'u --- 900,903 ---- .PP .DS + .UL "SGI Indigo with IRIX 4.0.1" .ta \w'HAVE_ST_BLKSIZE 'u *************** *** 894,897 **** .PP - .UL "Solaris 2.X/SunOS 5.X, using SPARCompiler C 2.X" .DS .ta \w'HAVE_ST_BLKSIZE 'u --- 931,934 ---- .PP .DS + .UL "Solaris 2.X/SunOS 5.X, using SPARCompiler C 2.X" .ta \w'HAVE_ST_BLKSIZE 'u *************** *** 938,941 **** .PP - .UL "System V Release 4" .DS .ta \w'HAVE_ST_BLKSIZE 'u --- 975,978 ---- .PP .DS + .UL "System V Release 4" .ta \w'HAVE_ST_BLKSIZE 'u *************** *** 973,976 **** .PP - .UL "Ultrix 4.x (RISC)" .DS .ta \w'HAVE_ST_BLKSIZE 'u --- 1010,1013 ---- .PP .DS + .UL "Ultrix 4.x (RISC)" .ta \w'HAVE_ST_BLKSIZE 'u *************** *** 1319,1320 **** --- 1356,1361 ---- .PP + If you are currently running C News, note that it has a directory named + \fIexpire\fP that is often the same pathname as INN's \fIexpire\fP program. + You will have to move, or remove, the directory before you can intall + the INN program. .NH 3 *************** *** 1381,1382 **** --- 1422,1433 ---- any configuration files or scripts. + This is important: in any directory (including the top-level one), a + \&``make\ install'' will install everything in that directory into + the right place. + A ``make\ update'' can only be done in the top-level directory or in the + \fIsite\fP directory, and it only replaces scripts, not configuration files. + When updating to a new INN release, you will probably want to do an ``update'' + first, and then review the changed files by doing ``make\ diff'' in the + \fIsite\fP directory, and integrate your local changes as appropriate. + The Makefile also has other targets that you might find useful, so the + comments for entries like ``most'' and ``installed-diff', for example. .PP *************** *** 1463,1467 **** .ta 1.5i ! ctlrun logwatch ! inncheck makegroup ! innwatch scanspool .DE --- 1514,1518 ---- .ta 1.5i ! ctlrun makegroup ! inncheck scanspool ! innwatch .DE *************** *** 1477,1481 **** You might have to edit it to understand your \fIdf\fP output format. - \fILogwatch\fP sends mail when a file gets new data; you can - run this from \fIrc.news\fP and configure it to watch the \fIsyslog\fP - \&``news.crit'' file which will notify you when \fIinnd\fP shuts down. \fIMakegroup\fP is a front-end to \fIrnews\fP that helps you write --- 1528,1529 ---- *************** *** 1494,1497 **** .DE .PP ! There are now only two things to check. First, make sure you have an \fIactive\fP file and a \fIhistory\fP database! --- 1542,1549 ---- .DE + Make sure you have \fIrc.news\fP installed in the right place, as explained + in the ``Paths to common programs'' section, above. + You might find it useful to read the ``First-Time Usenet or NNTP Installation'' + appendix for help on navigating through the INN configuration files. .PP ! There are now only a couple more things to check. First, make sure you have an \fIactive\fP file and a \fIhistory\fP database! *************** *** 1505,1507 **** .PP ! Once you have done that, InterNetNews is now installed, and ready to run \(em have fun! --- 1557,1559 ---- .PP ! Once you have done all of this, InterNetNews is now installed, and ready to run \(em have fun! Index: Install.ms.2 =================================================================== RCS file: RCS/Install.ms.2,v retrieving revision 1.9 diff -c1 -r1.9 Install.ms.2 *** 1.9 1993/01/29 16:42:07 --- Install.ms.2 1993/03/18 21:03:11 *************** *** 1,2 **** ! .\" $Revision: 1.9 $ .NH 1 --- 1,2 ---- ! .\" $Revision: 1.10 $ .NH 1 *************** *** 39,41 **** a sequence of ``throttle'' and ``go'' commands. ! It does not apepar to be related to the bug mentioned above, although the symptom is the same. --- 39,41 ---- a sequence of ``throttle'' and ``go'' commands. ! It does not appear to be related to the bug mentioned above, although the symptom is the same. *************** *** 88,89 **** --- 88,98 ---- .PP + On some SVR4 systems, attempting to set the socket buffer size is either + not supported or, even worse, might result in \fIinnd\fP's data size + growing. + The most noticeable symptom is ``cant setsockopt(SNDBUF)'' messages in + your \fIsyslog\fP output. + To fix this, either comment out the calls to \fIsetsockopt\fP in + \fIinnd/nc.c\fP or add ``\-USO_SNDBUF'' to your \fIDEFS\fP config + parameter. + .PP I have heard that Sony SVR4 systems have lots of problems. *************** *** 97,98 **** --- 106,120 ---- result in mail saying that they are unparseable. + .PP + Some versions of the shell in HP-UX do not properly parse a quoted ``['' + when it is in a pattern for a \fIcase\fP statement. + The most noticeable symptom is that \fInews.daily\fP does not properly + expire articles if \fIinnwatch\fP has throttled the server. + Contact HP and get a fix for SR # 5003-009811. + .PP + On some versions of AIX on the RS/6000, using memory-mapping can eat + up all the page space or crash the machine. + This will be noticeable if you have \fIACT_STYLE\fP set to ``MMAP'' and/or + have ``-DMMAP'' in \fIDBZCFLAGS\fP. + Ask your IBM representative for the ``U413090'' PTF and prerequisites to + apply it; it is believed that this will fix it. .bp *************** *** 174,176 **** Note that this will accept \fIeverything\fP. ! Because there is no subscription list, you cannot't say ``give me all of the foo hierarchy (filed into junk), but not the alt hierarchy.'' --- 196,198 ---- Note that this will accept \fIeverything\fP. ! Because there is no subscription list, you cannot say ``give me all of the foo hierarchy (filed into junk), but not the alt hierarchy.'' *************** *** 295,297 **** This includes \fIxvnews\fP, \fIxrn\fP, \fIrrn\fP and so on. ! INN implements the standard NNTP protocol. INN does not provide the extensions used by \fItrn\fP, \fItin\fP or --- 317,319 ---- This includes \fIxvnews\fP, \fIxrn\fP, \fIrrn\fP and so on. ! INN implements the standard NNTP protocol, with some extensions. INN does not provide the extensions used by \fItrn\fP, \fItin\fP or *************** *** 445,446 **** --- 467,471 ---- .DE + If you do not remove the \fIexpire\fP directory, you will probably have + problems installing INN's \fIexpire\fP, which is a program that often + has the same name as the C News directory. .PP *************** *** 641,642 **** --- 666,671 ---- .PP + Since the \fInnrpd\fP on the slave host will usually add its name to + the Path header, you should add ``Ap'' to the \fIflags\fP field of + the slave's entry on the master. + .PP Once the slave has been set up it is necessary to have the master feed it. *************** *** 743,744 **** --- 772,776 ---- up any stalled batches. + Finally, if your feeds change IP address, you might want a daily job + that does ``ctlinnd reload hosts.nntp "flush cache"''. + This is because \fIinnd\fP does not currently time-out DNS entries. .PP *************** *** 759,761 **** .SH ! Appendix V: Limited MIME Support .PP --- 791,845 ---- .SH ! Appendix V: News overview database ! .PP ! There are now many newsreaders available that are able to do ``threading.'' ! This is the ability to track a discussion within a newsgroup by using ! the References header (or other data), regardless of changes in headers ! like the Subject line. ! Examples of these readers include \fInn\fP, \fItrn\fP, and \fIgnus\fP, ! and more are becoming available. ! Until recently, a major problem with these readers is that they all ! required a specialized external database that contained the threading ! data. ! .PP ! In late 1992, Geoff Collyer released the \fInov\fP, ! or ``news overview,'' package. ! This included database tools and, and client access routines, ! that let the current threaded newsreaders use a common, textual, ! database. ! An overview database typically adds adds about 7-9% to your storage ! requirements. ! By default, the overview files are stored in the spool directory; ! you can change this to use an alternate tree that mirrors the spool ! hierarchy by changing the \fI_PATH_OVERVIEWDIR\fP parameter. ! .PP ! INN includes full support for creating and expiring news overview databases. ! To do this, add an entry like the following to your \fInewsfeeds\fP file: ! .DS ! overview:*:Tc,WO:/path/to/bin/overchan ! .DE ! (Make sure to replace \fI/path/to/bin\fP with the value of your ! \fI_PATH_NEWSBIN\fP parameter.) ! Then reload the \fInewsfeeds\fP file or restart your server. ! To create the initial database, run the following command after you have ! started \fIoverchan\fP: ! .DS ! expireover -a -s ! .DE ! You will also need to expire the overview data. ! The easiest way to do this is to add the ``expireover'' keyword to ! the \fIcron\fP job that runs \fInews.daily\fP. ! .PP ! The \fInnrpd\fP server includes two command extensions to access the database; ! they are documented in the ``protocol extensions'' part of \fIdoc/nnrpd.8\fP. ! INN does not include any client code or modifications to any newsreaders ! to use the overview data. ! Most maintainers have agreed to support the overview database, including ! the INN extensions for remote access. ! You can find prototype versions of many readers (work done by Geoff) on ! world.std.com in the directory src/news; look for files named ! \fIreader\fP.dist.tar.Z. ! .\" ! .bp ! .SH ! Appendix VI: Limited MIME Support .PP Index: MANIFEST =================================================================== RCS file: RCS/MANIFEST,v retrieving revision 1.43 diff -r1.43 MANIFEST 5,7c5,7 < BUILD 3 Script to build and install the system < COPYRIGHT 29 Legal mumbo-jumbo < HISTORY 16 Messages of historical significance --- Index: Makefile =================================================================== RCS file: RCS/Makefile,v retrieving revision 1.32 diff -c1 -r1.32 Makefile *** 1.32 1993/01/29 16:42:12 --- Makefile 1993/03/18 21:03:16 *************** *** 1,2 **** ! ## $Revision: 1.32 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.33 $ SHELL = /bin/sh *************** *** 34,36 **** directories: ! sh ./makedirs.sh --- 34,36 ---- directories: ! $(SHELL) ./makedirs.sh *************** *** 99,101 **** shar: ! makekit -m -k40 -s60k tar: --- 99,101 ---- shar: ! makekit -m -k40 -s70k tar: *************** *** 103,105 **** @rcs -l MANIFEST ! makekit -m -k40 -s60k -x tar cf inn.tar `sed $(SEDCOMMANDS) diff"; this will show you what ! changes you will have to merge in. Now merge in your changes (from ! where the files are, ie. /usr/lib/news...) into the files in ! $INN/site. (You may find that due to the bug fixes and new features in ! this release, you may not need to change any of the scripts, just the ! configuration files). Finally, doing "make install" will install ! everything. *************** *** 68,72 **** internally, if it exists, making certain commands (e.g., XHDR) much ! faster. The nov package includes patches to various newsreaders and a ! client library. It is available on world.std.com in the file ! src/news/nov.dist.tar.Z. --- 76,84 ---- internally, if it exists, making certain commands (e.g., XHDR) much ! faster. The nov package includes a newsreader library that you will need, ! and some utilities that you will not; it is available on world.std.com in ! the file src/news/nov.dist.tar.Z. Prototypes of modified newsreaders are ! in the in src/news/READER.dist.tar.Z -- most maintainers will be providing ! official support very soon. To make it explicit: if you already have a ! newsreader that can use the overview database, either via my NNTP xover ! command, or by reading directly from NFS, then INN has all you need. Index: backends/Makefile =================================================================== RCS file: backends/RCS/Makefile,v retrieving revision 1.16 diff -c1 -r1.16 backends/Makefile *** 1.16 1993/01/29 16:42:14 --- backends/Makefile 1993/03/18 21:03:19 *************** *** 1,2 **** ! ## $Revision: 1.16 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.17 $ SHELL = /bin/sh *************** *** 105,125 **** $(NEWSBIN)/archive: archive ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/batcher: batcher ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/buffchan: buffchan ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/cvtbatch: cvtbatch ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/filechan: filechan ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/nntpget: nntpget ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/innxmit: innxmit ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/overchan: overchan ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/shlock: shlock ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/shrinkfile: shrinkfile ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ --- 105,125 ---- $(NEWSBIN)/archive: archive ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/batcher: batcher ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/buffchan: buffchan ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/cvtbatch: cvtbatch ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/filechan: filechan ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/nntpget: nntpget ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/innxmit: innxmit ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/overchan: overchan ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/shlock: shlock ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/shrinkfile: shrinkfile ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ *************** *** 175,176 **** --- 175,182 ---- nntpget.o: ../include/paths.h + overchan.o: ../include/configdata.h + overchan.o: ../include/libinn.h + overchan.o: ../include/clibrary.h + overchan.o: ../include/macros.h + overchan.o: ../include/paths.h + overchan.o: ../include/qio.h shlock.o: ../include/clibrary.h Index: backends/archive.c =================================================================== RCS file: backends/RCS/archive.c,v retrieving revision 1.6 diff -c1 -r1.6 backends/archive.c *** 1.6 1993/01/29 16:42:16 --- backends/archive.c 1993/03/18 21:03:21 *************** *** 1,2 **** ! /* $Revision: 1.6 $ ** --- 1,2 ---- ! /* $Revision: 1.7 $ ** *************** *** 266,267 **** --- 266,268 ---- Redirect = TRUE; + (void)umask(NEWSUMASK); Index: backends/batcher.c =================================================================== RCS file: backends/RCS/batcher.c,v retrieving revision 1.16 diff -c1 -r1.16 backends/batcher.c *** 1.16 1993/01/29 16:42:18 --- backends/batcher.c 1993/03/18 21:03:24 *************** *** 1,2 **** ! /* $Revision: 1.16 $ ** --- 1,2 ---- ! /* $Revision: 1.17 $ ** *************** *** 242,243 **** --- 242,244 ---- Redirect = TRUE; + (void)umask(NEWSUMASK); Index: backends/buffchan.c =================================================================== RCS file: backends/RCS/buffchan.c,v retrieving revision 1.8 diff -c1 -r1.8 backends/buffchan.c *** 1.8 1993/01/29 16:42:20 --- backends/buffchan.c 1993/03/18 21:03:26 *************** *** 1,2 **** ! /* $Revision: 1.8 $ ** --- 1,2 ---- ! /* $Revision: 1.9 $ ** *************** *** 4,7 **** */ - #include - #include #include "configdata.h" --- 4,5 ---- *************** *** 8,9 **** --- 6,10 ---- #include + #include + #include + #include #include *************** *** 32,33 **** --- 33,35 ---- typedef struct _SITE { + BOOL Dropped; STRING Name; *************** *** 165,166 **** --- 167,169 ---- sp->LastClosed = Now.time; + sp->Dropped = FALSE; } *************** *** 232,234 **** } ! SITEopen(sp); } --- 235,238 ---- } ! if (!sp->Dropped) ! SITEopen(sp); } *************** *** 306,307 **** --- 310,315 ---- + if (*p == 'b' && EQn(p, "begin", 5)) + /* No-op. */ + return; + if (*p == 'f' && EQn(p, "flush", 5)) { *************** *** 326,329 **** (void)fprintf(stderr, "buffchan drop %s unknown site\n", p); ! else SITEclose(sp); return; --- 334,339 ---- (void)fprintf(stderr, "buffchan drop %s unknown site\n", p); ! else { SITEclose(sp); + sp->Dropped = TRUE; + } return; *************** *** 378,379 **** --- 388,390 ---- BOOL Redirect; + FILE *F; *************** *** 385,386 **** --- 396,398 ---- GotInterrupt = FALSE; + (void)umask(NEWSUMASK); *************** *** 394,396 **** /* Parse JCL. */ ! while ((i = getopt(ac, av, "bc:C:d:f:l:L:m:rs:u")) != EOF) switch (i) { --- 406,408 ---- /* Parse JCL. */ ! while ((i = getopt(ac, av, "bc:C:d:f:l:L:m:p:rs:u")) != EOF) switch (i) { *************** *** 426,427 **** --- 438,452 ---- MAPread(Map); + break; + case 'p': + if ((F = fopen(optarg, "w")) == NULL) { + (void)fprintf(stderr, "buffchan cant fopen %s %s\n", + optarg, strerror(errno)); + exit(1); + } + (void)fprintf(F, "%ld\n", (long)getpid()); + if (ferror(F) || fclose(F) == EOF) { + (void)fprintf(stderr, "buffchan cant fclose %s %s\n", + optarg, strerror(errno)); + exit(1); + } break; Index: backends/filechan.c =================================================================== RCS file: backends/RCS/filechan.c,v retrieving revision 1.11 diff -c1 -r1.11 backends/filechan.c *** 1.11 1992/08/14 20:36:58 --- backends/filechan.c 1993/03/18 21:03:27 *************** *** 1,2 **** ! /* $Revision: 1.11 $ ** --- 1,2 ---- ! /* $Revision: 1.12 $ ** *************** *** 33,34 **** --- 33,35 ---- BOOL Map; + FILE *F; struct stat Sb; *************** *** 43,44 **** --- 44,46 ---- myuid = geteuid(); + (void)umask(NEWSUMASK); *************** *** 45,47 **** /* Parse JCL. */ ! while ((i = getopt(ac, av, "d:f:m:")) != EOF) switch (i) { --- 47,49 ---- /* Parse JCL. */ ! while ((i = getopt(ac, av, "d:f:m:p:")) != EOF) switch (i) { *************** *** 59,60 **** --- 61,75 ---- MAPread(optarg); + break; + case 'p': + if ((F = fopen(optarg, "w")) == NULL) { + (void)fprintf(stderr, "filechan cant fopen %s %s\n", + optarg, strerror(errno)); + exit(1); + } + (void)fprintf(F, "%ld\n", (long)getpid()); + if (ferror(F) || fclose(F) == EOF) { + (void)fprintf(stderr, "filechan cant fclose %s %s\n", + optarg, strerror(errno)); + exit(1); + } break; Index: backends/innxmit.c =================================================================== RCS file: backends/RCS/innxmit.c,v retrieving revision 1.13 diff -c1 -r1.13 backends/innxmit.c *** 1.13 1993/01/29 16:42:21 --- backends/innxmit.c 1993/03/18 21:03:28 *************** *** 1,2 **** ! /* $Revision: 1.13 $ ** --- 1,2 ---- ! /* $Revision: 1.14 $ ** *************** *** 13,17 **** #include - #if defined(LOCK_LOCKF) #include - #endif /* defined(LOCK_LOCKF) */ #if defined(DO_NEED_TIME) --- 13,15 ---- *************** *** 801,806 **** register QIOSTATE *qp; - char *Article; - char *ContentEncoding; - char *ContentType; - char *MessageID; TIMEINFO Now; --- 799,800 ---- *************** *** 809,810 **** --- 803,810 ---- char buff[NNTP_STRLEN]; + char *AltSpool; + char *Article; + char *ContentEncoding; + char *ContentType; + char *MessageID; + char *AltPath; SIGHANDLER (*old)(); *************** *** 816,817 **** --- 816,819 ---- TotalTimeout = 0; + AltSpool = NULL; + (void)umask(NEWSUMASK); *************** *** 818,820 **** /* Parse JCL. */ ! while ((i = getopt(ac, av, "adMprSt:T:v")) != EOF) switch (i) { --- 820,822 ---- /* Parse JCL. */ ! while ((i = getopt(ac, av, "A:adMprSt:T:v")) != EOF) switch (i) { *************** *** 823,824 **** --- 825,830 ---- /* NOTREACHED */ + case 'A': + AltSpool = optarg; + AltPath = NEW(char, SPOOLNAMEBUFF + strlen(AltSpool)); + break; case 'a': *************** *** 874,882 **** } ! #if defined(LOCK_LOCKF) ! i = open(BATCHname, O_RDWR); ! BATCHqp = i < 0 ? NULL : QIOfdopen(i, QIO_BUFFER); ! #else ! BATCHqp = QIOopen(BATCHname, QIO_BUFFER); ! #endif /* defined(LOCK_LOCKF) */ ! if (BATCHqp == NULL) { (void)fprintf(stderr, "Can't open \"%s\", %s\n", --- 880,883 ---- } ! if ((i = open(BATCHname, O_RDWR)) < 0 ! || (BATCHqp = QIOfdopen(i, QIO_BUFFER)) == NULL) { (void)fprintf(stderr, "Can't open \"%s\", %s\n", *************** *** 1032,1034 **** /* Open the article. */ ! if ((qp = QIOopen(Article, QIO_BUFFER)) == NULL) { switch (errno) { --- 1033,1042 ---- /* Open the article. */ ! if ((qp = QIOopen(Article, QIO_BUFFER)) == NULL ! && AltSpool ! && *Article != '/') { ! (void)sprintf(AltPath, "%s/%s", AltSpool, Article); ! qp = QIOopen(AltPath, QIO_BUFFER); ! } ! ! if (qp == NULL) { switch (errno) { Index: backends/nntpget.c =================================================================== RCS file: backends/RCS/nntpget.c,v retrieving revision 1.7 diff -c1 -r1.7 backends/nntpget.c *** 1.7 1993/01/29 16:42:23 --- backends/nntpget.c 1993/03/18 21:03:29 *************** *** 1,2 **** ! /* $Revision: 1.7 $ ** Connect to a remote site, and get news from it to offer to our local --- 1,2 ---- ! /* $Revision: 1.8 $ ** Connect to a remote site, and get news from it to offer to our local *************** *** 3,5 **** ** server. Read list on stdin, or get it via NEWNEWS command. Writes ! ** list of articles stil needed to stdout. */ --- 3,5 ---- ** server. Read list on stdin, or get it via NEWNEWS command. Writes ! ** list of articles still needed to stdout. */ *************** *** 43,44 **** --- 43,48 ---- STATIC char READER[] = "mode reader"; + STATIC unsigned long STATgot; + STATIC unsigned long STAToffered; + STATIC unsigned long STATsent; + STATIC unsigned long STATrejected; *************** *** 197,199 **** (void)fprintf(stderr, ! "Usage: nntpget [ -d dist -n grps [-f file | -t time]] host\n"); exit(1); --- 201,203 ---- (void)fprintf(stderr, ! "Usage: nntpget [ -d dist -n grps [-f file | -t time -u file]] host\n"); exit(1); *************** *** 223,224 **** --- 227,229 ---- BOOL Verbose; + char *Update; char *p; *************** *** 230,231 **** --- 235,238 ---- Offer = FALSE; + Update = NULL; + (void)umask(NEWSUMASK); *************** *** 232,234 **** /* Parse JCL. */ ! while ((i = getopt(ac, av, "d:f:n:t:ov")) != EOF) switch (i) { --- 239,241 ---- /* Parse JCL. */ ! while ((i = getopt(ac, av, "d:f:n:t:ovu:")) != EOF) switch (i) { *************** *** 240,241 **** --- 247,251 ---- break; + case 'u': + Update = optarg; + /* FALLTHROUGH */ case 'f': *************** *** 242,244 **** if (Since) ! Usage("Only one -t or -f flag"); if (stat(optarg, &Sb) < 0) { --- 252,254 ---- if (Since) ! Usage("Only one -f -t or -u flag"); if (stat(optarg, &Sb) < 0) { *************** *** 300,302 **** if (distributions || Groups) ! Usage("No -d or -g when reading stdin"); } --- 310,312 ---- if (distributions || Groups) ! Usage("No -d or -n when reading stdin"); } *************** *** 376,377 **** --- 386,388 ---- while (fgets(mesgid, sizeof mesgid, F) != NULL) { + STATgot++; if ((p = strchr(mesgid, '\n')) != NULL) *************** *** 381,382 **** --- 392,394 ---- /* See if the local server wants it. */ + STAToffered++; (void)sprintf(buff, "ihave %s", mesgid); *************** *** 435,436 **** --- 447,449 ---- } + STATsent++; *************** *** 452,453 **** --- 465,467 ---- (void)fprintf(stderr, "%s to \"%s\"\n", buff, mesgid); + STATrejected++; } *************** *** 461,462 **** --- 475,477 ---- (void)printf("%s\n", mesgid); + STATgot++; } *************** *** 473,474 **** --- 488,506 ---- SITEquit(Local); + + /* Update timestamp file? */ + if (Update) { + if ((F = fopen(Update, "w")) == NULL) { + (void)fprintf(stderr, "Can't update %s, %s\n", + Update, strerror(errno)); + exit(1); + } + (void)fprintf(F, "got %ld offered %ld sent %ld rejected %ld\n", + STATgot, STAToffered, STATsent, STATrejected); + if (ferror(F) || fclose(F) == EOF) { + (void)fprintf(stderr, "Can't update %s, %s\n", + Update, strerror(errno)); + exit(1); + } + } + exit(0); Index: backends/overchan.c =================================================================== RCS file: backends/RCS/overchan.c,v retrieving revision 1.2 diff -c1 -r1.2 backends/overchan.c *** 1.2 1993/01/29 16:42:24 --- backends/overchan.c 1993/03/18 21:03:29 *************** *** 1,2 **** ! /* $Revision: 1.2 $ ** --- 1,2 ---- ! /* $Revision: 1.3 $ ** *************** *** 18,19 **** --- 18,71 ---- + STATIC BOOL InSpoolDir; + + + /* + ** Try to make one directory. Return FALSE on error. + */ + STATIC BOOL + MakeDir(Name) + char *Name; + { + struct stat Sb; + + if (mkdir(Name, GROUPDIR_MODE) >= 0) + return TRUE; + + /* See if it failed because it already exists. */ + return stat(Name, &Sb) >= 0 && S_ISDIR(Sb.st_mode); + } + + + /* + ** Make overview directory if not in spool directory. Return 0 if ok, + ** else -1. + */ + STATIC BOOL + MakeOverDir(Name) + register char *Name; + { + register char *p; + BOOL made; + + if (InSpoolDir) + return FALSE; + + /* Optimize common case -- parent almost always exists. */ + if (MakeDir(Name)) + return TRUE; + + /* Try to make each of comp and comp/foo in turn. */ + for (p = Name; *p; p++) + if (*p == '/') { + *p = '\0'; + made = MakeDir(Name); + *p = '/'; + if (!made) + return FALSE; + } + + return MakeDir(Name); + } + + /* *************** *** 31,36 **** struct iovec iov[4]; - char file[SPOOLNAMEBUFF]; - char lockfile[SPOOLNAMEBUFF]; register int fd; - register int lockfd; register int i; --- 83,85 ---- *************** *** 37,38 **** --- 86,89 ---- register BOOL ok; + char file[SPOOLNAMEBUFF]; + struct stat Sb; *************** *** 49,67 **** ! /* Get the lock. */ ! (void)sprintf(lockfile, "%s/.LCK%s", Dir, _PATH_OVERVIEW); ! if ((lockfd = open(lockfile, O_WRONLY | O_CREAT, ARTFILE_MODE)) < 0) ! return FALSE; ! (void)LockFile(lockfd, TRUE); ! ! /* Open data file, write data. */ (void)sprintf(file, "%s/%s", Dir, _PATH_OVERVIEW); ! if ((fd = open(file, O_WRONLY | O_CREAT | O_APPEND, ARTFILE_MODE)) < 0) { ! i = errno; ! if (unlink(lockfile) < 0) ! (void)fprintf(stderr, "overchan cant unlink %s %s\n", ! lockfile, strerror(errno)); ! (void)close(lockfd); ! errno = i; ! return FALSE; } ok = TRUE; --- 100,129 ---- ! /* Name the data file. */ (void)sprintf(file, "%s/%s", Dir, _PATH_OVERVIEW); ! ! /* Open and lock the file. */ ! for ( ; ; ) { ! if ((fd = open(file, O_WRONLY | O_CREAT | O_APPEND, ARTFILE_MODE)) < 0) { ! (void)fprintf(stderr, "overchan cant open %s, %s\n", ! file, strerror(errno)); ! return FALSE; ! } ! if (LockFile(fd, FALSE) < 0) ! /* Wait for it. */ ! (void)LockFile(fd, TRUE); ! else { ! /* Got the lock; make sure the file is still there. */ ! if (fstat(fd, &Sb) < 0) { ! (void)fprintf(stderr, "overchan cant fstat %s, %s\n", ! file, strerror(errno)); ! (void)close(fd); ! return FALSE; ! } ! if (Sb.st_nlink > 0) ! break; ! } ! /* Close file -- expireover might have removed it -- and try again. */ ! (void)close(fd); } + ok = TRUE; *************** *** 79,86 **** } - if (unlink(lockfile) < 0) { - (void)fprintf(stderr, "overchan cant unlink %s %s\n", - lockfile, strerror(errno)); - ok = FALSE; - } - (void)close(lockfd); return ok; --- 141,142 ---- *************** *** 132,134 **** /* Write data. */ ! if (!WriteData(Dir, Art, p)) (void)fprintf(stderr, "overchan cant update %s %s\n", --- 188,191 ---- /* Write data. */ ! if (!WriteData(Dir, Art, p) ! && (!MakeOverDir(Dir) || !WriteData(Dir, Art, p))) (void)fprintf(stderr, "overchan cant update %s %s\n", *************** *** 163,165 **** /* Write data. */ ! if (!WriteData(Dir, Art, Rest)) (void)fprintf(stderr, "overchan cant update %s %s\n", --- 220,223 ---- /* Write data. */ ! if (!WriteData(Dir, Art, Rest) ! && (!MakeOverDir(Dir) || !WriteData(Dir, Art, Rest))) (void)fprintf(stderr, "overchan cant update %s %s\n", *************** *** 185,188 **** main(ac, av) ! int ac; ! char *av[]; { --- 243,246 ---- main(ac, av) ! int ac; ! char *av[]; { *************** *** 193,196 **** ! /* Parse JCL. */ ! (void)umask(0); Dir = _PATH_OVERVIEWDIR; --- 251,253 ---- ! /* Set defaults. */ Dir = _PATH_OVERVIEWDIR; *************** *** 197,198 **** --- 254,258 ---- INNinput = TRUE; + (void)umask(NEWSUMASK); + + /* Parse JCL. */ while ((i = getopt(ac, av, "cD:")) != EOF) *************** *** 211,212 **** --- 271,273 ---- av += optind; + InSpoolDir = EQ(Dir, _PATH_SPOOL); Index: backends/shlock.c =================================================================== RCS file: backends/RCS/shlock.c,v retrieving revision 1.5 diff -c1 -r1.5 backends/shlock.c *** 1.5 1992/07/24 21:58:49 --- backends/shlock.c 1993/03/18 21:03:30 *************** *** 1,2 **** ! /* $Revision: 1.5 $ ** --- 1,2 ---- ! /* $Revision: 1.6 $ ** *************** *** 112,113 **** --- 112,114 ---- JustChecking = FALSE; + (void)umask(NEWSUMASK); Index: backends/shrinkfile.c =================================================================== RCS file: backends/RCS/shrinkfile.c,v retrieving revision 1.3 diff -c1 -r1.3 backends/shrinkfile.c *** 1.3 1993/01/29 16:42:25 --- backends/shrinkfile.c 1993/03/18 21:03:31 *************** *** 1,2 **** ! /* $Revision: 1.3 $ ** Shrink files on line boundaries. --- 1,2 ---- ! /* $Revision: 1.4 $ ** Shrink files on line boundaries. *************** *** 307,310 **** ! /* Parse JCL. */ Verbose = FALSE; while ((i = getopt(ac, av, "s:v")) != EOF) --- 307,313 ---- ! /* Set defaults. */ Verbose = FALSE; + (void)umask(NEWSUMASK); + + /* Parse JCL. */ while ((i = getopt(ac, av, "s:v")) != EOF) Index: config/Makefile =================================================================== RCS file: config/RCS/Makefile,v retrieving revision 1.25 diff -c1 -r1.25 config/Makefile *** 1.25 1993/01/29 16:42:25 --- config/Makefile 1993/03/18 21:03:31 *************** *** 1,2 **** ! ## $Revision: 1.25 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.26 $ SHELL = /bin/sh *************** *** 40,42 **** -@rm -f ../*/substtmp.new ../*/substtmp.old ! @sh ./checkconf.sh $(CONF) ./subst $(SED) -f $(CONF) $(LIST) --- 40,42 ---- -@rm -f ../*/substtmp.new ../*/substtmp.old ! @$(SHELL) ./checkconf.sh $(CONF) ./subst $(SED) -f $(CONF) $(LIST) Index: config/config.dist =================================================================== RCS file: config/RCS/config.dist,v retrieving revision 1.39 diff -c1 -r1.39 config/config.dist *** 1.39 1993/01/29 16:42:26 --- config/config.dist 1993/03/18 21:03:33 *************** *** 1,2 **** ! ## $Revision: 1.39 $ ## --- 1,2 ---- ! ## $Revision: 1.40 $ ## *************** *** 37,39 **** ## If you use the standard NNTP way of connecting, where is the library? - #NNTPLIB /usr/local/lib/clientlib.o #### =()@>()= --- 37,38 ---- *************** *** 73,74 **** --- 72,76 ---- RANLIB ranlib + ## YACC (yet another config control?) + #### =()@>()= + YACC yacc ## Ctags command. Use echo if you don't have ctags. *************** *** 120,121 **** --- 122,126 ---- PATHMASTER not-for-mail + ## Umask to set. + #### =()@>()= + NEWSUMASK 02 ## Mode that incoming articles are created under. *************** *** 268,270 **** ## What's the return type of exit? Usually int or void. ! ## (For gcc use "volatile void" in EXITVAL and _EXITVAL.) #### =()@>()= --- 273,275 ---- ## What's the return type of exit? Usually int or void. ! ## (For gcc (not pedantic ANSI) use "volatile void" in EXITVAL and _EXITVAL.) #### =()@>()= *************** *** 494,496 **** _PATH_EGREP /usr/local/bin/egnugrep ! ## Where awk lives (you might need the FSF one; see scanlogs) #### =()<_PATH_AWK @<_PATH_AWK>@>()= --- 499,501 ---- _PATH_EGREP /usr/local/bin/egnugrep ! ## Where awk lives #### =()<_PATH_AWK @<_PATH_AWK>@>()= *************** *** 592,594 **** #### =()<_PATH_SHELLVARS @<_PATH_SHELLVARS>@>()= ! _PATH_SHELLVARS /news/lib/innshellvars #### =()<_PATH_NEWSLIB @<_PATH_NEWSLIB>@>()= --- 597,601 ---- #### =()<_PATH_SHELLVARS @<_PATH_SHELLVARS>@>()= ! _PATH_SHELLVARS /usr/local/news/innshellvars ! ## Where most config and data files are usually stored; not required ! ## to the home directory of NEWSUSER. #### =()<_PATH_NEWSLIB @<_PATH_NEWSLIB>@>()= Index: doc/Makefile =================================================================== RCS file: doc/RCS/Makefile,v retrieving revision 1.24 diff -c1 -r1.24 doc/Makefile *** 1.24 1993/01/29 16:42:30 --- doc/Makefile 1993/03/18 21:03:33 *************** *** 1,2 **** ! ## $Revision: 1.24 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.25 $ SHELL = /bin/sh *************** *** 90,92 **** ## Low-level install actions. ! COPY = sh ./putman.sh $(MANPAGESTYLE) "$(MANFLAGS)" $(MAN1)/convdate.1: convdate.1 ; $(COPY) $? $@ --- 90,92 ---- ## Low-level install actions. ! COPY = $(SHELL) ./putman.sh $(MANPAGESTYLE) "$(MANFLAGS)" $(MAN1)/convdate.1: convdate.1 ; $(COPY) $? $@ Index: doc/buffchan.8 =================================================================== RCS file: doc/RCS/buffchan.8,v retrieving revision 1.6 diff -c1 -r1.6 doc/buffchan.8 *** 1.6 1993/01/29 16:42:33 --- doc/buffchan.8 1993/03/18 21:03:34 *************** *** 1,2 **** ! .\" $Revision: 1.6 $ .TH BUFFCHAN 8 --- 1,2 ---- ! .\" $Revision: 1.7 $ .TH BUFFCHAN 8 *************** *** 25,26 **** --- 25,29 ---- [ + .BI \-p " pidfile" + ] + [ .BI \-l " lines" *************** *** 119,120 **** --- 122,126 ---- .PP + If the ``\-p'' flag is used, the program will write a line containing + its process ID (in text) to the specified file. + .PP .I Buffchan *************** *** 171,173 **** .. ! .R$ $Id: buffchan.8,v 1.6 1993/01/29 16:42:33 rsalz Exp $ .SH "SEE ALSO" --- 177,179 ---- .. ! .R$ $Id: buffchan.8,v 1.7 1993/03/18 21:03:33 rsalz Exp $ .SH "SEE ALSO" Index: doc/ctlinnd.8 =================================================================== RCS file: doc/RCS/ctlinnd.8,v retrieving revision 1.29 diff -c1 -r1.29 doc/ctlinnd.8 *** 1.29 1993/01/29 16:42:36 --- doc/ctlinnd.8 1993/03/18 21:03:35 *************** *** 1,2 **** ! .\" $Revision: 1.29 $ .TH CTLINND 8 --- 1,2 ---- ! .\" $Revision: 1.30 $ .TH CTLINND 8 *************** *** 76,78 **** The angle brackets are optional. - Any existing entry with the same Message-ID is replaced. .IR Arr , --- 76,77 ---- *************** *** 83,85 **** when it was posted. ! All three values are a number indicating the number ofseconds since the epoch. --- 82,84 ---- when it was posted. ! All three values are a number indicating the number of seconds since the epoch. *************** *** 94,95 **** --- 93,96 ---- argument should be inside double quotes. + If the server is paused or throttled, this command causes it to briefly + open the history database. .TP *************** *** 117,119 **** The angle brackets are optional. ! If the server paused or throttled, this command causes it to briefly open the history database. --- 118,120 ---- The angle brackets are optional. ! If the server is paused or throttled, this command causes it to briefly open the history database. *************** *** 443,445 **** .. ! .R$ $Id: ctlinnd.8,v 1.29 1993/01/29 16:42:36 rsalz Exp $ .SH "SEE ALSO" --- 444,446 ---- .. ! .R$ $Id: ctlinnd.8,v 1.30 1993/03/18 21:03:34 rsalz Exp $ .SH "SEE ALSO" Index: doc/expire.8 =================================================================== RCS file: doc/RCS/expire.8,v retrieving revision 1.14 diff -c1 -r1.14 doc/expire.8 *** 1.14 1993/01/29 16:42:40 --- doc/expire.8 1993/03/18 21:03:35 *************** *** 1,2 **** ! .\" $Revision: 1.14 $ .TH EXPIRE 8 --- 1,2 ---- ! .\" $Revision: 1.15 $ .TH EXPIRE 8 *************** *** 13,14 **** --- 13,17 ---- [ + .BI \-g " file" + ] + [ .BI \-h " file" *************** *** 184,185 **** --- 187,192 ---- for every line processed. + If the ``\-g'' flag is given, then a one-line summary equivalent to the + output of ``\-v1'' and preceeded by the current time, will be appended to + the specified + .IR file . .SH HISTORY *************** *** 189,191 **** .. ! .R$ $Id: expire.8,v 1.14 1993/01/29 16:42:40 rsalz Exp $ .SH "SEE ALSO" --- 196,198 ---- .. ! .R$ $Id: expire.8,v 1.15 1993/03/18 21:03:35 rsalz Exp $ .SH "SEE ALSO" Index: doc/expireover.8 =================================================================== RCS file: doc/RCS/expireover.8,v retrieving revision 1.2 diff -c1 -r1.2 doc/expireover.8 *** 1.2 1993/01/29 16:42:43 --- doc/expireover.8 1993/03/18 21:03:36 *************** *** 1,2 **** ! .\" $Revision: 1.2 $ .TH EXPIREOVER 8 --- 1,2 ---- ! .\" $Revision: 1.3 $ .TH EXPIREOVER 8 *************** *** 19,20 **** --- 19,23 ---- [ + .BI \-O " overview.fmt" + ] + [ .B \-s *************** *** 76,77 **** --- 79,83 ---- .PP + The ``\-O'' flag may be used to specify an alternate location for the + .IR overview.fmt (5) + file; this is normally only useful for debugging. .SH HISTORY *************** *** 84,89 **** .. ! .R$ $Id: expireover.8,v 1.2 1993/01/29 16:42:43 rsalz Exp $ .SH "SEE ALSO" - newsoverview(5), expire(8), ! newsoverview(8). --- 90,94 ---- .. ! .R$ $Id: expireover.8,v 1.3 1993/03/18 21:03:36 rsalz Exp $ .SH "SEE ALSO" expire(8), ! overview.fmt(5). Index: doc/filechan.8 =================================================================== RCS file: doc/RCS/filechan.8,v retrieving revision 1.13 diff -c1 -r1.13 doc/filechan.8 *** 1.13 1993/01/29 16:42:45 --- doc/filechan.8 1993/03/18 21:03:37 *************** *** 1,2 **** ! .\" $Revision: 1.13 $ .TH FILECHAN 8 --- 1,2 ---- ! .\" $Revision: 1.14 $ .TH FILECHAN 8 *************** *** 15,16 **** --- 15,19 ---- ] + [ + .BI \-p " pidfile" + ] .SH DESCRIPTION *************** *** 53,54 **** --- 56,60 ---- .PP + If the ``\-p'' flag is used, the program will write a line containing + its process ID (in text) to the specified file. + .PP If *************** *** 122,124 **** .. ! .R$ $Id: filechan.8,v 1.13 1993/01/29 16:42:45 rsalz Exp $ .SH "SEE ALSO" --- 128,130 ---- .. ! .R$ $Id: filechan.8,v 1.14 1993/03/18 21:03:36 rsalz Exp $ .SH "SEE ALSO" Index: doc/hosts.nntp.5 =================================================================== RCS file: doc/RCS/hosts.nntp.5,v retrieving revision 1.16 diff -c1 -r1.16 doc/hosts.nntp.5 *** 1.16 1993/01/29 16:42:51 --- doc/hosts.nntp.5 1993/03/18 21:03:38 *************** *** 1,2 **** ! .\" $Revision: 1.16 $ .TH HOSTS.NNTP 5 --- 1,2 ---- ! .\" $Revision: 1.17 $ .TH HOSTS.NNTP 5 *************** *** 3,5 **** .SH NAME ! hosts.nntp \- list of hosts that feed NNTP news .SH DESCRIPTION --- 3,5 ---- .SH NAME ! hosts.nntp, hosts.nntp.nolimit \- list of hosts that feed NNTP news .SH DESCRIPTION *************** *** 67,68 **** --- 67,79 ---- If the file contains passwords, it should not be world-readable. + The file + .\" =()<.IR @<_PATH_INNDHOSTS>@.nolimit ,>()= + .IR /news/lib/hosts.nntp.nolimit , + if it exists is read whenever the ``hosts.nntp'' file is read. + It has the same format, although only the first field is used. + Any host mentioned in this file is not subject to the incoming connections + limit specified by + .IR innd 's + \&``\-c'' flag. + This can be used to allow local hosts or time-sensitive peers, to connect + regardless of the local conditions. .SH HISTORY *************** *** 72,74 **** .. ! .R$ $Id: hosts.nntp.5,v 1.16 1993/01/29 16:42:51 rsalz Exp $ .SH "SEE ALSO" --- 83,85 ---- .. ! .R$ $Id: hosts.nntp.5,v 1.17 1993/03/18 21:03:37 rsalz Exp $ .SH "SEE ALSO" Index: doc/inews.1 =================================================================== RCS file: doc/RCS/inews.1,v retrieving revision 1.24 diff -c1 -r1.24 doc/inews.1 *** 1.24 1993/01/29 16:42:51 --- doc/inews.1 1993/03/18 21:03:39 *************** *** 1,2 **** ! .\" $Revision: 1.24 $ .TH INEWS 1 --- 1,2 ---- ! .\" $Revision: 1.25 $ .TH INEWS 1 *************** *** 95,102 **** rather then sent to the server. - Since - .I inews - does not spool its input if the server is unavailable, programs such - as mail/news gateways might want to use this flag and pipe the output - into - .IR rnews (1). .PP --- 95,96 ---- *************** *** 146,147 **** --- 140,149 ---- or with a non-zero status if the article could not be delivered. + .PP + Since + .I inews + will spool its input if the server is unavailable, it is usually necessary + to run + .IR rnews (1) + with the ``\-U'' flag on a regular basis, usually out of + .IR cron (8). .SH HISTORY *************** *** 151,153 **** .. ! .R$ $Id: inews.1,v 1.24 1993/01/29 16:42:51 rsalz Exp $ .SH "SEE ALSO" --- 153,155 ---- .. ! .R$ $Id: inews.1,v 1.25 1993/03/18 21:03:38 rsalz Exp $ .SH "SEE ALSO" Index: doc/innd.8 =================================================================== RCS file: doc/RCS/innd.8,v retrieving revision 1.27 diff -c1 -r1.27 doc/innd.8 *** 1.27 1993/01/29 16:42:55 --- doc/innd.8 1993/03/18 21:03:40 *************** *** 1,2 **** ! .\" $Revision: 1.27 $ .TH INND 8 --- 1,2 ---- ! .\" $Revision: 1.28 $ .TH INND 8 *************** *** 276,281 **** to all sites that subscribe to ``control'' or ``news.admin.'' ! Newgroup messages receive additional special treatment. ! If the message is approved and posted to the name of the group being created, ! then the message will be sent to all sites whose subscription patterns would ! cause them to receive articles posted in that group. .\" =()<.if '@@'DO' \{\>()= --- 276,281 ---- to all sites that subscribe to ``control'' or ``news.admin.'' ! Newgroup and rmgroup messages receive additional special treatment. ! If the message is approved and posted to the name of the group being created ! or removed, then the message will be sent to all sites whose subscription ! patterns would cause them to receive articles posted in that group. .\" =()<.if '@@'DO' \{\>()= *************** *** 465,467 **** .. ! .R$ $Id: innd.8,v 1.27 1993/01/29 16:42:55 rsalz Exp $ .SH "SEE ALSO" --- 465,467 ---- .. ! .R$ $Id: innd.8,v 1.28 1993/03/18 21:03:39 rsalz Exp $ .SH "SEE ALSO" Index: doc/innxmit.8 =================================================================== RCS file: doc/RCS/innxmit.8,v retrieving revision 1.11 diff -c1 -r1.11 doc/innxmit.8 *** 1.11 1993/01/29 16:42:59 --- doc/innxmit.8 1993/03/18 21:03:41 *************** *** 1,2 **** ! .\" $Revision: 1.11 $ .TH INNXMIT 8 --- 1,2 ---- ! .\" $Revision: 1.12 $ .TH INNXMIT 8 *************** *** 7,8 **** --- 7,11 ---- [ + .BI \-A " alt_spool" + ] + [ .B \-a *************** *** 145,146 **** --- 148,153 ---- format, the article will be sent in ``quoted-printable'' form. + .PP + The ``\-A'' flag may be used to specify an alternate spool directory to + use if the article is not found; this would normally be an NFS-mounted + spool directory of a master server with longer expiration times. .SH HISTORY *************** *** 150,152 **** .. ! .R$ $Id: innxmit.8,v 1.11 1993/01/29 16:42:59 rsalz Exp $ .SH "SEE ALSO" --- 157,159 ---- .. ! .R$ $Id: innxmit.8,v 1.12 1993/03/18 21:03:40 rsalz Exp $ .SH "SEE ALSO" Index: doc/news-recovery.8 =================================================================== RCS file: doc/RCS/news-recovery.8,v retrieving revision 1.13 diff -c1 -r1.13 doc/news-recovery.8 *** 1.13 1993/01/29 16:43:03 --- doc/news-recovery.8 1993/03/18 21:03:42 *************** *** 1,2 **** ! .\" $Revision: 1.13 $ .TH NEWS-RECOVERY 8 --- 1,2 ---- ! .\" $Revision: 1.14 $ .TH NEWS-RECOVERY 8 *************** *** 348,350 **** The output is suitable for piping into ! .IR filechan (1). .SH HISTORY --- 348,350 ---- The output is suitable for piping into ! .IR filechan (8). .SH HISTORY *************** *** 354,356 **** .. ! .R$ $Id: news-recovery.8,v 1.13 1993/01/29 16:43:03 rsalz Exp $ .SH "SEE ALSO" --- 354,356 ---- .. ! .R$ $Id: news-recovery.8,v 1.14 1993/03/18 21:03:41 rsalz Exp $ .SH "SEE ALSO" *************** *** 359,362 **** dbz(3), ! filechan(1), ! find(1), history(5), --- 359,361 ---- dbz(3), ! filechan(8), history(5), *************** *** 363,365 **** innd(8), ! newsfeeds(5), ! overview.fmt(5). --- 362,363 ---- innd(8), ! newsfeeds(5). Index: doc/news.daily.8 =================================================================== RCS file: doc/RCS/news.daily.8,v retrieving revision 1.5 diff -c1 -r1.5 doc/news.daily.8 *** 1.5 1993/01/29 16:43:05 --- doc/news.daily.8 1993/03/18 21:03:43 *************** *** 11,13 **** [ ! .BI -t sleeptime ] --- 11,13 ---- [ ! .BI \-t " sleeptime" ] *************** *** 14,17 **** [ ! .BI -f controlfile ] --- 14,20 ---- [ ! .BI \-f " controlfile" ] + [ + .BI \-l " logfile" + ] *************** *** 183,190 **** It is sorted, and then fed into a pipeline responsible for doing ! the removal, either ! .IR sort / xarg / rm ! pipeline or ! .IR fastrm . ! If all the files were removed, the input file is removed. ! If not, then mail is sent to the news administrator. .PP --- 186,197 ---- It is sorted, and then fed into a pipeline responsible for doing ! the removal, normally ! .IR fastrm (8). ! If there seemed to be a problem removing the files, then mail is sent to ! the news administrator. ! If there were no problems, then ! .I file ! is renamed to ! .\" =()<.I @<_PATH_MOST_LOGS>@/expire.list>()= ! .I /var/log/news/expire.list ! where it is kept (for safety) until the next day's expiration. .PP *************** *** 200,202 **** When the condition restores, it unblocks the server. ! This script requires a local configuration file in order to run. .PP --- 207,220 ---- When the condition restores, it unblocks the server. ! In addition, on each pass through the loop it will check the specified ! .I logfile ! to see if it has been modified, and send mail to the news administrator ! if so. ! It is usually a good idea to set this to the ! .IR syslog (3) ! file that receives critical news messages. ! Upon receipt of an interrupt signal, ! .IR innwatch ! will report its status in the file ! .\" =()<.IR @<_PATH_INNWSTATUS>@ .>()= ! .IR /news/lib/innwatch.status . .PP *************** *** 237,239 **** .. ! .R$ $Id: news.daily.8,v 1.5 1993/01/29 16:43:05 rsalz Exp $ .SH "SEE ALSO" --- 255,257 ---- .. ! .R$ $Id: news.daily.8,v 1.6 1993/03/18 21:03:42 rsalz Exp $ .SH "SEE ALSO" *************** *** 242,243 **** --- 260,262 ---- expire(8), + fastrm(8), newslog(5), Index: doc/newsfeeds.5 =================================================================== RCS file: doc/RCS/newsfeeds.5,v retrieving revision 1.26 diff -c1 -r1.26 doc/newsfeeds.5 *** 1.26 1993/01/29 16:43:06 --- doc/newsfeeds.5 1993/03/18 21:03:44 *************** *** 1,2 **** ! .\" $Revision: 1.26 $ .TH NEWSFEEDS 5 --- 1,2 ---- ! .\" $Revision: 1.27 $ .TH NEWSFEEDS 5 *************** *** 89,93 **** .RE ! Note, again, that the result of the last match is the most important. ! Also, ``comp.sources.*'' could be written as ``comp.sources*'' but this ! would not have the same effect if there were a ``comp.sources-only'' group. .PP --- 89,96 ---- .RE ! There are three things to note about this example. ! The first is that the trailing ``.*'' is required. ! The second is that, again, the result of the last match is the most important. ! The third is that ``comp.sources.*'' could be written as ``comp.sources*'' ! but this would not have the same effect if there were a ! ``comp.sources-only'' group. .PP *************** *** 99,102 **** the site should or should not receive. ! The default is to send all distributions, but if an article has a ! Distribution header and any .IR distrib s --- 102,106 ---- the site should or should not receive. ! The default is to send all articles to all sites that subscribe to any of ! the groups where it has been posted , but if an article has a Distribution ! header and any .IR distrib s *************** *** 148,149 **** --- 152,154 ---- d Distribution header required + p Do not check Path header before propagating .fi *************** *** 284,286 **** The ``O'' generates input to the ! .IR overviewchan (8) program. --- 289,291 ---- The ``O'' generates input to the ! .IR overchan (8) program. *************** *** 350,352 **** .PP ! A site fed by a file is the msot common type of feed. When the site should receive an article, one line is written to the file --- 355,357 ---- .PP ! A site fed by a file is simplest type of feed. When the site should receive an article, one line is written to the file *************** *** 540,542 **** .. ! .R$ $Id: newsfeeds.5,v 1.26 1993/01/29 16:43:06 rsalz Exp $ .SH "SEE ALSO" --- 545,547 ---- .. ! .R$ $Id: newsfeeds.5,v 1.27 1993/03/18 21:03:43 rsalz Exp $ .SH "SEE ALSO" Index: doc/nnrpd.8 =================================================================== RCS file: doc/RCS/nnrpd.8,v retrieving revision 1.11 diff -c1 -r1.11 doc/nnrpd.8 *** 1.11 1993/01/29 16:43:08 --- doc/nnrpd.8 1993/03/18 21:03:45 *************** *** 1,2 **** ! .\" $Revision: 1.11 $ .TH NNRPD 8 --- 1,2 ---- ! .\" $Revision: 1.12 $ .TH NNRPD 8 *************** *** 184,185 **** --- 184,191 ---- .IR innd (8). + .IP 10. + The + .I "``date''" + command is provided; this is based on the draft NNTP protocol revision. + It returns a one-line response code of 111 followed by the GMT date + and time on the server in the form YYYYMMDDhhmmss. .SH HISTORY *************** *** 191,193 **** .. ! .R$ $Id: nnrpd.8,v 1.11 1993/01/29 16:43:08 rsalz Exp $ .SH "SEE ALSO" --- 197,199 ---- .. ! .R$ $Id: nnrpd.8,v 1.12 1993/03/18 21:03:44 rsalz Exp $ .SH "SEE ALSO" Index: doc/nntpget.1 =================================================================== RCS file: doc/RCS/nntpget.1,v retrieving revision 1.7 diff -c1 -r1.7 doc/nntpget.1 *** 1.7 1993/01/29 16:43:08 --- doc/nntpget.1 1993/03/18 21:03:45 *************** *** 1,2 **** ! .\" $Revision: 1.7 $ .TH NNTPGET 1 --- 1,2 ---- ! .\" $Revision: 1.8 $ .TH NNTPGET 1 *************** *** 22,23 **** --- 22,26 ---- [ + .BI \-u " file" + ] + [ .B \-v *************** *** 38,40 **** .I nntpget ! connects to the specified remove .I host --- 41,43 ---- .I nntpget ! connects to the specified remote .I host *************** *** 52,53 **** --- 55,59 ---- .IR file . + The ``\-u'' flag is the same except that if the transfer succeeded, the + file will be updated with a statistics line, modifying its timestamp so that + it can be used in later invocations. If the ``\-t'' flag is used, then the specified *************** *** 67,69 **** .. ! .R$ $Id: nntpget.1,v 1.7 1993/01/29 16:43:08 rsalz Exp $ .SH "SEE ALSO" --- 73,75 ---- .. ! .R$ $Id: nntpget.1,v 1.8 1993/03/18 21:03:45 rsalz Exp $ .SH "SEE ALSO" Index: doc/overchan.8 =================================================================== RCS file: doc/RCS/overchan.8,v retrieving revision 1.2 diff -c1 -r1.2 doc/overchan.8 *** 1.2 1993/01/29 16:43:10 --- doc/overchan.8 1993/03/18 21:03:46 *************** *** 1,2 **** ! .\" $Revision: 1.2 $ .TH OVERCHAN 8 --- 1,2 ---- ! .\" $Revision: 1.3 $ .TH OVERCHAN 8 *************** *** 20,22 **** or standard input if none are specified. ! (A single dash means in the file list means to read standard input.) It uses this information to update the news overview database. --- 20,22 ---- or standard input if none are specified. ! (A single dash in the file list means to read standard input.) It uses this information to update the news overview database. *************** *** 41,45 **** .IR newsfeeds (5) ! file. ! This data consists of a lien of text, separated into two parts by a tab. ! The part is a list of all relative pathnames where the article has been written, with a single space between entries. --- 41,49 ---- .IR newsfeeds (5) ! file, for example: ! .RS ! .\" =()@/overchan>()= ! overview:*:Tc,WO:/news/bin/overchan ! .RE ! This data consists of a line of text, separated into two parts by a tab. ! The first part is a list of all relative pathnames where the article has been written, with a single space between entries. *************** *** 63,65 **** .. ! .R$ $Id: overchan.8,v 1.2 1993/01/29 16:43:10 rsalz Exp $ .SH "SEE ALSO" --- 67,69 ---- .. ! .R$ $Id: overchan.8,v 1.3 1993/03/18 21:03:46 rsalz Exp $ .SH "SEE ALSO" Index: doc/overview.fmt.5 =================================================================== RCS file: doc/RCS/overview.fmt.5,v retrieving revision 1.2 diff -c1 -r1.2 doc/overview.fmt.5 *** 1.2 1993/01/29 16:43:11 --- doc/overview.fmt.5 1993/03/18 21:03:47 *************** *** 1,2 **** ! .\" $Revision: 1.2 $ .TH OVERVIEW.FMT 5 --- 1,2 ---- ! .\" $Revision: 1.3 $ .TH OVERVIEW.FMT 5 *************** *** 20,24 **** existing overview database using ! .IR makeoverview ; ! see ! .IR news-recovery (8). .PP --- 20,23 ---- existing overview database using ! .IR expireover (8) ! after removing all existing overview files. .PP *************** *** 45,46 **** .. ! .R$ $Id: overview.fmt.5,v 1.2 1993/01/29 16:43:11 rsalz Exp $ --- 44,45 ---- .. ! .R$ $Id: overview.fmt.5,v 1.3 1993/03/18 21:03:47 rsalz Exp $ Index: expire/Makefile =================================================================== RCS file: expire/RCS/Makefile,v retrieving revision 1.13 diff -c1 -r1.13 expire/Makefile *** 1.13 1993/01/29 16:43:16 --- expire/Makefile 1993/03/18 21:03:48 *************** *** 1,2 **** ! ## $Revision: 1.13 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.14 $ SHELL = /bin/sh *************** *** 122,140 **** $(NEWSBIN)/convdate: convdate ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/expire: expire ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/expireover: expireover ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/fastrm: fastrm ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/grephistory: grephistory ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/makeactive: makeactive ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/makehistory: makehistory ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/newsrequeue: newsrequeue ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/prunehistory: prunehistory ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ --- 122,140 ---- $(NEWSBIN)/convdate: convdate ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/expire: expire ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/expireover: expireover ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/fastrm: fastrm ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/grephistory: grephistory ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/makeactive: makeactive ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/makehistory: makehistory ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/newsrequeue: newsrequeue ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/prunehistory: prunehistory ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ Index: expire/expire.c =================================================================== RCS file: expire/RCS/expire.c,v retrieving revision 1.16 diff -c1 -r1.16 expire/expire.c *** 1.16 1993/01/29 16:43:19 --- expire/expire.c 1993/03/18 21:03:50 *************** *** 1,2 **** ! /* $Revision: 1.16 $ ** --- 1,2 ---- ! /* $Revision: 1.17 $ ** *************** *** 86,87 **** --- 86,88 ---- /* Statistics; for -v flag. */ + STATIC char *EXPgraph; STATIC int EXPverbose; *************** *** 804,805 **** --- 805,808 ---- { + FILE *F; + if (Server) *************** *** 831,832 **** --- 834,844 ---- + /* Append statistics to a summary file */ + if (EXPgraph) { + F = EXPfopen(FALSE, EXPgraph, "a"); + (void)fprintf(F, "%ld %ld %ld %ld %ld %ld %ld\n", + (long)Now, EXPprocessed, EXPstillhere, EXPallgone, + EXPunlinked, EXPhistdrop, EXPhistremember); + (void)fclose(F); + } + exit(x); *************** *** 887,888 **** --- 899,901 ---- UnlinkFile = FALSE; + (void)umask(NEWSUMASK); *************** *** 889,891 **** /* Parse JCL. */ ! while ((i = getopt(ac, av, "f:h:d:ilnpqr:stv:w:xz:")) != EOF) switch (i) { --- 902,904 ---- /* Parse JCL. */ ! while ((i = getopt(ac, av, "f:h:d:g:ilnpqr:stv:w:xz:")) != EOF) switch (i) { *************** *** 899,900 **** --- 912,916 ---- History = optarg; + break; + case 'g': + EXPgraph = optarg; break; Index: expire/expireover.c =================================================================== RCS file: expire/RCS/expireover.c,v retrieving revision 1.2 diff -c1 -r1.2 expire/expireover.c *** 1.2 1993/01/29 16:43:21 --- expire/expireover.c 1993/03/18 21:03:51 *************** *** 1,2 **** ! /* $Revision: 1.2 $ ** --- 1,2 ---- ! /* $Revision: 1.3 $ ** *************** *** 6,7 **** --- 6,8 ---- #include + #include #include *************** *** 80,81 **** --- 81,83 ---- STATIC char SPOOL[] = _PATH_SPOOL; + STATIC char *SCHEMA = _PATH_SCHEMA; STATIC BOOL InSpoolDir; *************** *** 114,120 **** ! if (lp->Used > 1) { ! for (ap = lp->Articles, i = lp->Used - 1; --i >= 0; ap++) ! if (ap[0] >= ap[1]) ! break; ! if (i < 0) qsort((POINTER)lp->Articles, (SIZE_T)lp->Used, --- 116,119 ---- ! for (ap = lp->Articles, i = lp->Used - 1; --i >= 0; ap++) ! if (ap[0] >= ap[1]) { qsort((POINTER)lp->Articles, (SIZE_T)lp->Used, *************** *** 121,123 **** sizeof lp->Articles[0], LISTcompare); ! } } --- 120,123 ---- sizeof lp->Articles[0], LISTcompare); ! break; ! } } *************** *** 203,213 **** } - (void)LockFile(lfd, TRUE); ! /* Open file, get it's size. */ (void)sprintf(file, "%s/%s", group, _PATH_OVERVIEW); ! if ((fd = open(file, O_RDONLY)) < 0) { ! (void)fprintf(stderr, "Can't open %s, %s\n", file, strerror(errno)); ! UnlockGroup(lfd, lockfile); ! return; } if (fstat(fd, &Sb) < 0) { --- 203,220 ---- } ! /* Open file, lock it. */ (void)sprintf(file, "%s/%s", group, _PATH_OVERVIEW); ! for ( ; ; ) { ! if ((fd = open(file, O_RDWR)) < 0) { ! (void)fprintf(stderr, "Can't open %s, %s\n", file, strerror(errno)); ! UnlockGroup(lfd, lockfile); ! return; ! } ! if (LockFile(fd, FALSE) >= 0) ! break; ! /* Wait for lock; close file -- might be unlinked -- and try again. */ ! (void)LockFile(fd, TRUE); ! (void)close(fd); } + if (fstat(fd, &Sb) < 0) { *************** *** 214,217 **** (void)fprintf(stderr, "Can't open %s, %s\n", file, strerror(errno)); - (void)close(fd); UnlockGroup(lfd, lockfile); return; --- 221,224 ---- (void)fprintf(stderr, "Can't open %s, %s\n", file, strerror(errno)); UnlockGroup(lfd, lockfile); + (void)close(fd); return; *************** *** 220,223 **** /* Empty file; done deleting. */ - (void)close(fd); UnlockGroup(lfd, lockfile); return; --- 227,230 ---- /* Empty file; done deleting. */ UnlockGroup(lfd, lockfile); + (void)close(fd); return; *************** *** 236,239 **** (void)fprintf(stderr, "Can't read %s, %s\n", file, strerror(errno)); - (void)close(fd); UnlockGroup(lfd, lockfile); return; --- 243,246 ---- (void)fprintf(stderr, "Can't read %s, %s\n", file, strerror(errno)); UnlockGroup(lfd, lockfile); + (void)close(fd); return; *************** *** 241,243 **** B.Data[Sb.st_size] = '\0'; - (void)close(fd); --- 248,249 ---- *************** *** 308,309 **** --- 314,316 ---- UnlockGroup(lfd, lockfile); + (void)close(fd); return; *************** *** 326,327 **** --- 333,335 ---- UnlockGroup(lfd, lockfile); + (void)close(fd); return; *************** *** 332,334 **** lockfile, strerror(errno)); ! UnlockGroup(lfd, lockfile); } --- 340,349 ---- lockfile, strerror(errno)); ! ! /* Don't call UnlockGroup; do it inline. */ ! if (close(lfd) < 0) ! (void)fprintf(stderr, "expireover cant close %s %s\n", ! file, strerror(errno)); ! if (close(fd) < 0) ! (void)fprintf(stderr, "expireover cant close unlinked %s %s\n", ! file, strerror(errno)); } *************** *** 342,344 **** { - static char SCHEMA[] = _PATH_SCHEMA; register FILE *F; --- 357,358 ---- *************** *** 401,402 **** --- 415,417 ---- register int size; + register int ov_size; register long lines; *************** *** 463,465 **** (void)strcpy(hp->Header, p); - hp->HasHeader = TRUE; for (p = hp->Header; *p; p++) --- 478,479 ---- *************** *** 467,468 **** --- 481,483 ---- *p = ' '; + hp->HasHeader = TRUE; } *************** *** 483,485 **** /* Calculate total size, fix hardwired headers. */ ! size = strlen(name) + ARTfieldsize + 2; for (hp = Headers, fp = ARTfields, i = ARTfieldsize; --i >= 0; hp++, fp++) { --- 498,500 ---- /* Calculate total size, fix hardwired headers. */ ! ov_size = strlen(name) + ARTfieldsize + 2; for (hp = Headers, fp = ARTfields, i = ARTfieldsize; --i >= 0; hp++, fp++) { *************** *** 490,499 **** t = lines; (void)sprintf(value, "%ld", t); ! if (hp->HasHeader) ! DISPOSE(hp->Header); ! hp->Header = COPY(value); hp->HasHeader = TRUE; ! } ! if (hp->HasHeader) ! size += strlen(hp->Header); } --- 505,522 ---- t = lines; + (void)sprintf(value, "%ld", t); ! size = strlen(value); ! if (hp->Length == 0) { ! hp->Length = size; ! hp->Header = NEW(char, hp->Length + 1); ! } ! else if (hp->Length < size) { ! hp->Length = size; ! RENEW(hp->Header, char, hp->Length + 1); ! } ! (void)strcpy(hp->Header, value); hp->HasHeader = TRUE; ! } ! if (hp->HasHeader) ! ov_size += strlen(hp->Header); } *************** *** 502,504 **** if (B.Size == 0) { ! B.Size = size; B.Data = NEW(char, B.Size + 1); --- 525,527 ---- if (B.Size == 0) { ! B.Size = ov_size; B.Data = NEW(char, B.Size + 1); *************** *** 505,508 **** } ! else if (B.Size < size) { ! B.Size = size; RENEW(B.Data, char, B.Size + 1); --- 528,531 ---- } ! else if (B.Size < ov_size) { ! B.Size = ov_size; RENEW(B.Data, char, B.Size + 1); *************** *** 517,518 **** --- 540,542 ---- } + *p = '\0'; *************** *** 606,615 **** } - (void)LockFile(lfd, TRUE); ! /* Open file, read it in. */ (void)sprintf(file, "%s/%s", group, _PATH_OVERVIEW); ! if ((fd = open(file, O_RDONLY)) >= 0) { ! if (fstat(fd, &Sb) < 0) { (void)fprintf(stderr, "Can't open %s, %s\n", file, strerror(errno)); - (void)close(fd); UnlockGroup(lfd, lockfile); --- 630,637 ---- } ! /* Open file, lock it. */ (void)sprintf(file, "%s/%s", group, _PATH_OVERVIEW); ! for ( ; ; ) { ! if ((fd = open(file, O_RDWR | O_CREAT, ARTFILE_MODE)) < 0) { (void)fprintf(stderr, "Can't open %s, %s\n", file, strerror(errno)); UnlockGroup(lfd, lockfile); *************** *** 617,658 **** } ! if (Sb.st_size != 0) { ! /* Read in the whole file. */ ! if (B.Size == 0) { ! B.Size = Sb.st_size + 1; ! B.Data = NEW(char, B.Size); ! } ! else if (B.Size < Sb.st_size) { ! B.Size = Sb.st_size + 1; ! RENEW(B.Data, char, B.Size); ! } ! if (xread(fd, B.Data, Sb.st_size) < 0) { ! (void)fprintf(stderr, "Can't read %s, %s\n", ! file, strerror(errno)); ! (void)close(fd); ! UnlockGroup(lfd, lockfile); ! return; ! } ! B.Data[Sb.st_size] = '\0'; ! (void)close(fd); ! /* Count lines, get space. */ ! for (i = 1, p = B.Data; (p = strchr(p, '\n')) != NULL && *++p; i++) ! continue; ! if (LineSize < i + 1 + LineUsed) { ! LineSize = i + 1 + LineUsed; ! RENEW(Lines, LINE, LineSize); ! } ! /* Add to lines array. */ ! for (lp = Lines + LineUsed, p = B.Data; ; p = next, lp++) { ! if ((next = strchr(p, '\n')) == NULL) ! break; ! lp->Start = p; ! lp->Length = ++next - p; ! lp->Article = atol(p); ! } ! qsort((POINTER)Lines, (SIZE_T)(lp - Lines), sizeof lp[0], ! LINEcompare); ! LineUsed = lp - Lines; } } --- 639,692 ---- } ! if (LockFile(fd, FALSE) >= 0) ! break; ! /* Wait for lock; close file -- might be unlinked -- and try again. */ ! (void)LockFile(fd, TRUE); ! (void)close(fd); ! } ! if (fstat(fd, &Sb) < 0) { ! (void)fprintf(stderr, "Can't open %s, %s\n", file, strerror(errno)); ! UnlockGroup(lfd, lockfile); ! (void)close(fd); ! return; ! } ! if (Sb.st_size != 0) { ! /* Read in the whole file. */ ! if (B.Size == 0) { ! B.Size = Sb.st_size + 1; ! B.Data = NEW(char, B.Size); ! } ! else if (B.Size < Sb.st_size) { ! B.Size = Sb.st_size + 1; ! RENEW(B.Data, char, B.Size); ! } ! if (xread(fd, B.Data, Sb.st_size) < 0) { ! (void)fprintf(stderr, "Can't read %s, %s\n", ! file, strerror(errno)); ! UnlockGroup(lfd, lockfile); ! (void)close(fd); ! return; ! } ! B.Data[Sb.st_size] = '\0'; ! ! /* Count lines, get space. */ ! for (i = 1, p = B.Data; (p = strchr(p, '\n')) != NULL && *++p; i++) ! continue; ! if (LineSize < i + 1 + LineUsed) { ! LineSize = i + 1 + LineUsed; ! RENEW(Lines, LINE, LineSize); } + + /* Add to lines array. */ + for (lp = Lines + LineUsed, p = B.Data; ; p = next, lp++) { + if ((next = strchr(p, '\n')) == NULL) + break; + lp->Start = p; + lp->Length = ++next - p; + lp->Article = atol(p); + } + qsort((POINTER)Lines, (SIZE_T)(lp - Lines), sizeof lp[0], + LINEcompare); + LineUsed = lp - Lines; } *************** *** 686,687 **** --- 720,722 ---- UnlockGroup(lfd, lockfile); + (void)close(fd); return; *************** *** 705,706 **** --- 740,742 ---- UnlockGroup(lfd, lockfile); + (void)close(fd); return; *************** *** 711,714 **** lockfile, strerror(errno)); - UnlockGroup(lfd, lockfile); } --- 747,756 ---- lockfile, strerror(errno)); + /* Don't call UnlockGroup; do it inline. */ + if (close(lfd) < 0) + (void)fprintf(stderr, "expireover cant close %s %s\n", + file, strerror(errno)); + if (close(fd) < 0) + (void)fprintf(stderr, "expireover cant close unlinked %s %s\n", + file, strerror(errno)); } *************** *** 955,957 **** BOOL ! MakeSpoolDirectory(Name) register char *Name; --- 997,999 ---- BOOL ! MakeOverDir(Name) register char *Name; *************** *** 1028,1034 **** } ! else if (MakeSpoolDirectory(line)) ! AddLines(line, Spool); else ! (void)fprintf(stderr, "expireover: cant mkdir %s, %s\n", ! line, strerror(errno)); continue; --- 1070,1080 ---- } ! else if (!InSpoolDir) { ! if (MakeOverDir(line)) ! AddLines(line, Spool); ! else ! (void)fprintf(stderr, "expireover: cant mkdir %s, %s\n", ! line, strerror(errno)); ! } else ! AddLines(line, Spool); continue; *************** *** 1076,1078 **** ! /* Parse JCL. */ Dir = _PATH_OVERVIEWDIR; --- 1122,1124 ---- ! /* Set defaults. */ Dir = _PATH_OVERVIEWDIR; *************** *** 1082,1084 **** SortedInput = FALSE; ! while ((i = getopt(ac, av, "aD:f:nsvz")) != EOF) switch (i) { --- 1128,1133 ---- SortedInput = FALSE; ! (void)umask(NEWSUMASK); ! ! /* Parse JCL. */ ! while ((i = getopt(ac, av, "aD:f:nO:svz")) != EOF) switch (i) { *************** *** 1100,1101 **** --- 1149,1153 ---- break; + case 'O': + SCHEMA = optarg; + break; case 's': *************** *** 1141 **** --- 1193,1194 ---- } + Index: expire/fastrm.c =================================================================== RCS file: expire/RCS/fastrm.c,v retrieving revision 1.2 diff -c1 -r1.2 expire/fastrm.c *** 1.2 1993/01/29 16:43:23 --- expire/fastrm.c 1993/03/18 21:03:52 *************** *** 10,11 **** --- 10,12 ---- #include + #include #include *************** *** 314,411 **** STATIC void ! unlink_dir(list, num) ! register dnode *list; ! register int num; { ! static dnode **dptrs; ! static int ndp; ! register dnode *l; ! register dnode **pl; ! register DIR *dfd; ! register DIRENTRY *d; ! register BOOL sorted; ! struct stat sb; ! ! if (!setup_dir(list->dir, num)) { ! /* The directory doesn't exist, no point attempting to ! * delete anything, just forget it all. */ ! if (list->dir) ! DISPOSE(list->dir); ! freelist(list); ! return; ! } ! ! if (list->dir) ! DISPOSE(list->dir); ! if (sortdirs == 0 || num < sortdirs) { ! if (prefix_len != 0) { ! prefix_dir[prefix_len++] = '/'; ! prefix_dir[prefix_len] = '\0'; ! } ! /* Easier to just unlink the files than worry about the ! * order we unlink them in. */ ! while ((l = list) != NULL) { ! unlink_node(l); ! list = l->next; ! if (l->longname) ! DISPOSE(l->longname); ! DISPOSE(l); ! } ! return; ! } ! ! if (ndp == 0) { ! ndp = num; ! dptrs = NEW(dnode*, ndp); ! } ! else if (num > ndp) { ! ndp = num + 16; ! RENEW(dptrs, dnode*, ndp); ! } ! ! if ((pl = dptrs) == NULL) ! err_exit("Out of mem in unlink_dir"); ! ! for (sorted = TRUE, *pl = list, l = list->next; l; l = l->next) { ! if (sorted && strcmp(NODENAME(*pl), NODENAME(l)) > 0) ! sorted = FALSE; ! *++pl = l; ! } ! ! if (!sorted) ! qsort((char *)dptrs, num, sizeof (dnode *), comp); ! ! if (prefix_len == 0) { ! if ((dfd = opendir(".")) == NULL) { ! (void)fprintf(stderr, "Can't open \".\" in directory \"%s\"\n", ! cur_dir); ! fatals++; ! freelist(list); ! return; ! } ! } ! else { ! if ((dfd = opendir(prefix_dir)) == NULL) { ! if (prefix_dir[0] == '/') ! (void)fprintf(stderr, "Can't open directory \"%s\"\n", ! prefix_dir); ! else ! (void)fprintf(stderr, "Can't open directory \"%s\" in \"%s\"\n", ! prefix_dir, cur_dir); ! if (stat(prefix_dir, &sb) >= 0 || errno != ENOENT) ! fatals++; ! freelist(list); ! return; ! } ! } ! if (prefix_len != 0) { ! prefix_dir[prefix_len++] = '/'; ! prefix_dir[prefix_len] = '\0'; ! } ! while ((d = readdir(dfd)) != NULL) ! if ((l = inlist(dptrs, num, d->d_name)) != NULL) ! unlink_node(l); ! (void)closedir(dfd); ! freelist(list); } --- 315,329 ---- STATIC void ! copynsegs(from, to, n) ! register chr *from; ! register chr *to; ! register int n; { ! register chr c; ! while ((*to++ = c = *from++) != '\0') ! if (c == '/' && --n <= 0) ! break; ! if (c == '/') ! *--to = '\0'; } *************** *** 426,444 **** - STATIC void - copynsegs(from, to, n) - register chr *from; - register chr *to; - register int n; - { - register chr c; - - while ((*to++ = c = *from++) != '\0') - if (c == '/' && --n <= 0) - break; - - if (c == '/') - *--to = '\0'; - } - - /* --- 344,345 ---- *************** *** 614,615 **** --- 515,616 ---- + STATIC void + unlink_dir(list, num) + register dnode *list; + register int num; + { + static dnode **dptrs; + static int ndp; + register dnode *l; + register dnode **pl; + register DIR *dfd; + register DIRENTRY *d; + register BOOL sorted; + struct stat sb; + + if (!setup_dir(list->dir, num)) { + /* The directory doesn't exist, no point attempting to + * delete anything, just forget it all. */ + if (list->dir) + DISPOSE(list->dir); + freelist(list); + return; + } + + if (list->dir) + DISPOSE(list->dir); + if (sortdirs == 0 || num < sortdirs) { + if (prefix_len != 0) { + prefix_dir[prefix_len++] = '/'; + prefix_dir[prefix_len] = '\0'; + } + /* Easier to just unlink the files than worry about the + * order we unlink them in. */ + while ((l = list) != NULL) { + unlink_node(l); + list = l->next; + if (l->longname) + DISPOSE(l->longname); + DISPOSE(l); + } + return; + } + + if (ndp == 0) { + ndp = num; + dptrs = NEW(dnode*, ndp); + } + else if (num > ndp) { + ndp = num + 16; + RENEW(dptrs, dnode*, ndp); + } + + if ((pl = dptrs) == NULL) + err_exit("Out of mem in unlink_dir"); + + for (sorted = TRUE, *pl = list, l = list->next; l; l = l->next) { + if (sorted && strcmp(NODENAME(*pl), NODENAME(l)) > 0) + sorted = FALSE; + *++pl = l; + } + + if (!sorted) + qsort((char *)dptrs, num, sizeof (dnode *), comp); + + if (prefix_len == 0) { + if ((dfd = opendir(".")) == NULL) { + (void)fprintf(stderr, "Can't open \".\" in directory \"%s\"\n", + cur_dir); + fatals++; + freelist(list); + return; + } + } + else { + if ((dfd = opendir(prefix_dir)) == NULL) { + if (prefix_dir[0] == '/') + (void)fprintf(stderr, "Can't open directory \"%s\"\n", + prefix_dir); + else + (void)fprintf(stderr, "Can't open directory \"%s\" in \"%s\"\n", + prefix_dir, cur_dir); + if (stat(prefix_dir, &sb) >= 0 || errno != ENOENT) + fatals++; + freelist(list); + return; + } + } + + if (prefix_len != 0) { + prefix_dir[prefix_len++] = '/'; + prefix_dir[prefix_len] = '\0'; + } + + while ((d = readdir(dfd)) != NULL) + if ((l = inlist(dptrs, num, d->d_name)) != NULL) + unlink_node(l); + (void)closedir(dfd); + freelist(list); + } + + STATIC BOOL *************** *** 668,670 **** if (dotdot >= strlen(DotDot)/(SIZE_T)3) ! dotdot = strlen(DotDot)/(SIZE_T)(3 - 1); break; --- 669,671 ---- if (dotdot >= strlen(DotDot)/(SIZE_T)3) ! dotdot = strlen(DotDot)/(SIZE_T)3 - 1; break; Index: expire/makeactive.c =================================================================== RCS file: expire/RCS/makeactive.c,v retrieving revision 1.8 diff -c1 -r1.8 expire/makeactive.c *** 1.8 1993/01/29 16:43:27 --- expire/makeactive.c 1993/03/18 21:03:53 *************** *** 1,2 **** ! /* $Revision: 1.8 $ ** --- 1,2 ---- ! /* $Revision: 1.9 $ ** *************** *** 9,10 **** --- 9,11 ---- #include + #include #include *************** *** 252,253 **** --- 253,255 ---- ComputeMarks = FALSE; + (void)umask(NEWSUMASK); Index: expire/makehistory.c =================================================================== RCS file: expire/RCS/makehistory.c,v retrieving revision 1.13 diff -c1 -r1.13 expire/makehistory.c *** 1.13 1993/01/29 16:43:28 --- expire/makehistory.c 1993/03/18 21:03:54 *************** *** 1,2 **** ! /* $Revision: 1.13 $ ** --- 1,2 ---- ! /* $Revision: 1.14 $ ** *************** *** 33,35 **** STATIC char SPOOL[] = _PATH_SPOOL; ! STATIC char NEWSLIB[] = _PATH_NEWSLIB; STATIC char HISTORY[] = _PATH_HISTORY; --- 33,35 ---- STATIC char SPOOL[] = _PATH_SPOOL; ! STATIC char *HISTORYDIR; STATIC char HISTORY[] = _PATH_HISTORY; *************** *** 97,99 **** ! xchdir(NEWSLIB); --- 97,99 ---- ! xchdir(HISTORYDIR); *************** *** 587,588 **** --- 587,589 ---- tmpdir = _PATH_TMP; + (void)umask(NEWSUMASK); *************** *** 632,633 **** --- 633,641 ---- Usage(); + if ((p = strrchr(TextFile, '/')) == NULL) + HISTORYDIR = _PATH_NEWSLIB; + else { + *p = '\0'; + HISTORYDIR = COPY(TextFile); + *p = '/'; + } *************** *** 646,648 **** /* Open history file. */ ! xchdir(NEWSLIB); --- 654,656 ---- /* Open history file. */ ! xchdir(HISTORYDIR); *************** *** 711,713 **** /* Move. */ ! xchdir(NEWSLIB); --- 719,721 ---- /* Move. */ ! xchdir(HISTORYDIR); Index: expire/newsrequeue.c =================================================================== RCS file: expire/RCS/newsrequeue.c,v retrieving revision 1.7 diff -c1 -r1.7 expire/newsrequeue.c *** 1.7 1993/01/29 16:43:29 --- expire/newsrequeue.c 1993/03/18 21:03:55 *************** *** 1,2 **** ! /* $Revision: 1.7 $ ** --- 1,2 ---- ! /* $Revision: 1.8 $ ** *************** *** 270,272 **** { - static char **save; register int i; --- 270,271 ---- *************** *** 274,278 **** register char **argv; ! ! if (save) ! DISPOSE(save); --- 273,275 ---- register char **argv; ! char **save; Index: expire/prunehistory.c =================================================================== RCS file: expire/RCS/prunehistory.c,v retrieving revision 1.6 diff -c1 -r1.6 expire/prunehistory.c *** 1.6 1992/07/24 22:00:24 --- expire/prunehistory.c 1993/03/18 21:03:56 *************** *** 1,2 **** ! /* $Revision: 1.6 $ ** --- 1,2 ---- ! /* $Revision: 1.7 $ ** *************** *** 139,141 **** } ! if ((wfd = open(History, O_WRONLY)) == NULL) { (void)fprintf(stderr, "Can't open \"%s\" for writing, %s\n", --- 139,141 ---- } ! if ((wfd = open(History, O_WRONLY)) < 0) { (void)fprintf(stderr, "Can't open \"%s\" for writing, %s\n", Index: frontends/Makefile =================================================================== RCS file: frontends/RCS/Makefile,v retrieving revision 1.18 diff -c1 -r1.18 frontends/Makefile *** 1.18 1992/07/28 16:58:03 --- frontends/Makefile 1993/03/18 21:03:57 *************** *** 1,2 **** ! ## $Revision: 1.18 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.19 $ SHELL = /bin/sh *************** *** 22,32 **** ## =()@>()= ! NEWSBIN =/usr/local/news/bin ## =()@>()= ! INEWS = /usr/local/news/inews ! ## =()@>()= ! RELAYNEWS = /usr/local/news/relaynews ## =()@>()= ! RNEWS = /usr/local/news/rnews ## =()@>()= ! RNEWSPROGS = /usr/local/news/bin/rnews ## =()@ -G @@>()= --- 22,30 ---- ## =()@>()= ! NEWSBIN =/news/bin ## =()@>()= ! INEWS = /usr/local/bin/inews.nntp ## =()@>()= ! RNEWS = /news/bin/rnews/rnews ## =()@>()= ! RNEWSPROGS = /news/bin/rnews ## =()@ -G @@>()= *************** *** 41,45 **** ! SOURCES = ctlinnd.c inews.c relaynews.c rnews.c ! ALL = inews relaynews rnews ctlinnd getlist innconfval decode encode --- 39,43 ---- ! SOURCES = ctlinnd.c inews.c rnews.c ! ALL = inews rnews ctlinnd getlist innconfval decode encode *************** *** 48,50 **** ! install: $(INEWS) $(RELAYNEWS) $(RNEWS) \ $(NEWSBIN)/ctlinnd $(NEWSBIN)/getlist $(NEWSBIN)/innconfval \ --- 46,48 ---- ! install: $(INEWS) $(RNEWS) \ $(NEWSBIN)/ctlinnd $(NEWSBIN)/getlist $(NEWSBIN)/innconfval \ *************** *** 62,65 **** $(CC) $(LDFLAGS) -o $@ inews.o $(NNTPLIB) $(LIBNEWS) $(LIBS) - relaynews: $(P) relaynews.o $(LIBNEWS) - $(CC) $(LDFLAGS) -o $@ relaynews.o $(LIBNEWS) $(LIBS) rnews: $(P) rnews.o $(LIBNEWS) --- 60,61 ---- *************** *** 87,89 **** lint $(LINTFLAGS) inews.c $(LINTLIB) $(LINTFILTER) >lint - lint $(LINTFLAGS) relaynews.c $(LINTLIB) $(LINTFILTER) >>lint lint $(LINTFLAGS) rnews.c $(LINTLIB) $(LINTFILTER) >>lint --- 83,84 ---- *************** *** 108,126 **** $(INEWS): inews ! sh ../installit.sh $(OWNER) -m 02555 -b .OLD $? $@ ! $(RELAYNEWS): relaynews ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(RNEWS): rnews ! sh ../installit.sh $(OWNER) -m 02555 -b .OLD $? $@ $(NEWSBIN)/ctlinnd: ctlinnd ! sh ../installit.sh $(OWNER) -m 0550 -b .OLD $? $@ $(NEWSBIN)/getlist: getlist ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/innconfval: innconfval ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(RNEWSPROGS)/c7unbatch: c7unbatch.sh ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(RNEWSPROGS)/decode: decode ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(RNEWSPROGS)/encode: encode ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ --- 103,119 ---- $(INEWS): inews ! $(SHELL) ../installit.sh $(OWNER) -m 02555 -b .OLD $? $@ $(RNEWS): rnews ! $(SHELL) ../installit.sh $(OWNER) -m 02555 -b .OLD $? $@ $(NEWSBIN)/ctlinnd: ctlinnd ! $(SHELL) ../installit.sh $(OWNER) -m 0550 -b .OLD $? $@ $(NEWSBIN)/getlist: getlist ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(NEWSBIN)/innconfval: innconfval ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(RNEWSPROGS)/c7unbatch: c7unbatch.sh ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(RNEWSPROGS)/decode: decode ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(RNEWSPROGS)/encode: encode ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ *************** *** 157,163 **** innconfval.o: ../include/macros.h - relaynews.o: ../include/clibrary.h - relaynews.o: ../include/configdata.h - relaynews.o: ../include/libinn.h - relaynews.o: ../include/macros.h - relaynews.o: ../include/paths.h rnews.o: ../include/clibrary.h --- 150,151 ---- Index: frontends/c7unbatch.sh =================================================================== RCS file: frontends/RCS/c7unbatch.sh,v retrieving revision 1.2 diff -c1 -r1.2 frontends/c7unbatch.sh *** 1.2 1992/09/01 15:38:36 --- frontends/c7unbatch.sh 1993/03/18 21:03:58 *************** *** 1,2 **** #! /bin/sh ! decode | /usr/ucb/compress -d | rnews $* --- 1,2 ---- #! /bin/sh ! decode | /usr/ucb/compress -d Index: frontends/decode.c =================================================================== RCS file: frontends/RCS/decode.c,v retrieving revision 1.3 diff -c1 -r1.3 frontends/decode.c *** 1.3 1993/01/29 16:43:32 --- frontends/decode.c 1993/03/18 21:04:00 *************** *** 25,28 **** */ ! #define ENDMARK1 ((90 * 91 + 90) / 91 + ' ') ! #define ENDMARK2 ((90 * 91 + 90) % 91 + ' ') --- 25,28 ---- */ ! #define ENDMARK1 ((90 * 91 + 90) / 91) ! #define ENDMARK2 ((90 * 91 + 90) % 91) *************** *** 34,37 **** static void ! pack6bit(p, n, last) ! register char *p; register int n; --- 34,36 ---- static void ! pack6(n, last) register int n; *************** *** 43,57 **** ! if (last) { ! if ((i = p[n - 1]) >= 3) { ! /* Do the best we can. */ ! (void)fprintf(stderr, "Badly-terminated file\n"); ! i = 3; ! } ! } ! else i = 3; ! b3[0] = (p[0] << 2) | ((p[1] >> 4) & 0x03); ! b3[1] = (p[1] << 4) | ((p[2] >> 2) & 0x0F); ! b3[2] = (p[2] << 6) | ( p[3] & 0x3F); for (q = b3; --i >= 0; ) --- 42,53 ---- ! i = 3; ! if (last && (i = Buffer[n - 1]) >= 3) { ! /* Do the best we can. */ ! (void)fprintf(stderr, "Badly-terminated file.\n"); i = 3; + } ! b3[0] = (Buffer[0] << 2) | ((Buffer[1] >> 4) & 0x03); ! b3[1] = (Buffer[1] << 4) | ((Buffer[2] >> 2) & 0x0F); ! b3[2] = (Buffer[2] << 6) | ( Buffer[3] & 0x3F); for (q = b3; --i >= 0; ) *************** *** 90,92 **** if (++i == 4) { ! /* Inline expansion of pack6bit. */ b3[0] = (Buffer[0] << 2) | ((Buffer[1] >> 4) & 0x03); --- 86,88 ---- if (++i == 4) { ! /* Inline expansion of pack6. */ b3[0] = (Buffer[0] << 2) | ((Buffer[1] >> 4) & 0x03); *************** *** 107,109 **** if (last || i == 4) { ! pack6bit(Buffer, i, last); i = 0; --- 103,105 ---- if (last || i == 4) { ! pack6(i, last); i = 0; *************** *** 126,127 **** --- 122,124 ---- register int cnt; + char *base; char b12[12]; *************** *** 129,131 **** ! for (p = b12, i = 12, cnt = 0, first = 1; (c = getchar()) != EOF; ) { if (c < ' ' || c >= ' ' + 91) { --- 126,129 ---- ! base = p = b12; ! for (i = 12, cnt = 0, first = 1; (c = getchar()) != EOF; ) { if (c < ' ' || c >= ' ' + 91) { *************** *** 147,149 **** first = 0; ! p = c12; } --- 145,147 ---- first = 0; ! base = p = c12; } *************** *** 151,153 **** pack12(b12, 12, 0); ! p = b12; } --- 149,151 ---- pack12(b12, 12, 0); ! base = p = b12; } *************** *** 157,159 **** ! if (p >= &b12[0] && p < &b12[12]) { if (!first) --- 155,157 ---- ! if (base == b12) { if (!first) *************** *** 164,171 **** ! if (i != 12) { ! if (p >= &b12[0] && p < &b12[12]) ! pack12(b12, 12-i, cnt); ! else ! pack12(c12, 12-i, cnt); ! } --- 162,165 ---- ! if (i != 12) ! pack12(base, 12 - i, cnt); Index: frontends/getlist.c =================================================================== RCS file: frontends/RCS/getlist.c,v retrieving revision 1.3 diff -c1 -r1.3 frontends/getlist.c *** 1.3 1993/01/29 16:43:34 --- frontends/getlist.c 1993/03/18 21:04:01 *************** *** 1,2 **** ! /* $Revision: 1.3 $ ** --- 1,2 ---- ! /* $Revision: 1.4 $ ** *************** *** 69,73 **** case 0: - break; case 1: - pattern = av[1]; break; --- 69,71 ---- *************** *** 75,76 **** --- 73,77 ---- pattern = av[1]; + break; + case 3: + pattern = av[1]; types = av[2]; *************** *** 81,85 **** else { - if (pattern != NULL || types != NULL) - Usage(); list = av[0]; } --- 82,86 ---- else { list = av[0]; + if (EQ(list, "active") && (pattern != NULL || types != NULL)) + Usage(); } *************** *** 94,96 **** if (NNTPconnect(host, &FromServer, &ToServer, buff) < 0) { ! (void)fprintf(stderr, "Can't connect to server, %s.\n", buff[0] ? buff : strerror(errno)); --- 95,97 ---- if (NNTPconnect(host, &FromServer, &ToServer, buff) < 0) { ! (void)fprintf(stderr, "Can't connect to server, %s\n", buff[0] ? buff : strerror(errno)); *************** *** 178,181 **** CAclose(); ! (void)fclose(FromServer); (void)fclose(ToServer); exit(i); --- 179,184 ---- CAclose(); ! (void)fprintf(ToServer, "quit\r\n"); (void)fclose(ToServer); + (void)fgets(buff, sizeof buff, FromServer); + (void)fclose(FromServer); exit(i); Index: frontends/inews.c =================================================================== RCS file: frontends/RCS/inews.c,v retrieving revision 1.32 diff -c1 -r1.32 frontends/inews.c *** 1.32 1993/01/29 16:43:35 --- frontends/inews.c 1993/03/18 21:04:04 *************** *** 1,2 **** ! /* $Revision: 1.32 $ ** --- 1,2 ---- ! /* $Revision: 1.33 $ ** *************** *** 47,48 **** --- 47,49 ---- + STATIC BOOL Dump; STATIC BOOL Revoked; *************** *** 977,979 **** case NF_FLAG_MODERATED: ! if (!approved) { mailed = MailArticle(group, article); --- 978,984 ---- case NF_FLAG_MODERATED: ! if (Dump) ! (void)fprintf(stderr, ! "%s is moderated -- article would be mailed\n", ! group); ! else if (!approved) { mailed = MailArticle(group, article); *************** *** 1175,1177 **** char SpoolMessage[NNTP_STRLEN + 2]; - BOOL Dump; BOOL DoSignature; --- 1180,1181 ---- *************** *** 1191,1192 **** --- 1195,1197 ---- AddOrg = TRUE; + (void)umask(NEWSUMASK); *************** *** 1348,1356 **** - if (Spooling) { - (void)fprintf(stderr, "Warning %s -- Article will be spooled.\n", - SpoolMessage); - Spoolit(article, Length, deadfile); - exit(0); - } - if (Dump) { --- 1353,1354 ---- *************** *** 1371,1372 **** --- 1369,1377 ---- QuitServer(0); + } + + if (Spooling) { + (void)fprintf(stderr, "Warning %s -- Article will be spooled.\n", + SpoolMessage); + Spoolit(article, Length, deadfile); + exit(0); } Index: frontends/rnews.c =================================================================== RCS file: frontends/RCS/rnews.c,v retrieving revision 1.23 diff -c1 -r1.23 frontends/rnews.c *** 1.23 1993/01/29 16:43:37 --- frontends/rnews.c 1993/03/18 21:04:06 *************** *** 1,2 **** ! /* $Revision: 1.23 $ ** --- 1,2 ---- ! /* $Revision: 1.24 $ ** *************** *** 98,100 **** if (i == MAX_FORKS) { ! syslog(L_ERROR, "cant fork %s %m -- spooling"); return -1; --- 98,100 ---- if (i == MAX_FORKS) { ! syslog(L_ERROR, "cant fork %s %m -- spooling", path); return -1; *************** *** 101,103 **** } ! syslog(L_NOTICE, "cant fork %s -- waiting"); (void)sleep(60); --- 101,103 ---- } ! syslog(L_NOTICE, "cant fork %s -- waiting", path); (void)sleep(60); *************** *** 164,168 **** ** Make a temporary filename that is unlikely to collide with mktemp ! ** or cause problems for sites with 14-character filename limits. ! ** Used to generate names so they would sort in time order, but there ! ** is no real need for that. */ --- 164,167 ---- ** Make a temporary filename that is unlikely to collide with mktemp ! ** or cause problems for sites with 14-character filename limits, ! ** and that hints at the sending host. */ *************** *** 173,182 **** { ! time_t now; ! ! (void)time(&now); ! now &= 0xFFFFFFFF; ! if (UUCPHost) ! (void)sprintf(buff, "%s/%.8sXXXXXX", dir, UUCPHost); ! else ! (void)sprintf(buff, "%s/%08.8lxXXXXXX", dir, (long)now); (void)mktemp(buff); --- 172,174 ---- { ! (void)sprintf(buff, "%s/%.8sXXXXXX", dir, UUCPHost ? UUCPHost : "unknown"); (void)mktemp(buff); *************** *** 311,312 **** --- 303,305 ---- #if defined(SYSLOG_RNEWS_LOG_DUPS) + *p = '\0'; syslog(L_NOTICE, "duplicate %s %s", id, path); *************** *** 314,316 **** #if defined(FILE_RNEWS_LOG_DUPS) ! if ((F = fopen(_PATH_RNEWS_DUP_LOG)) != NULL) { (void)fprintf(stderr, "duplicate %s %s", id, path); --- 307,310 ---- #if defined(FILE_RNEWS_LOG_DUPS) ! if ((F = fopen(_PATH_RNEWS_DUP_LOG, "a")) != NULL) { ! *p = '\0'; (void)fprintf(stderr, "duplicate %s %s", id, path); *************** *** 375,376 **** --- 369,371 ---- register int i; + BOOL ok; *************** *** 394,396 **** if (i < 0) { ! syslog(L_FATAL, "cant fread after %ld bytes %m", used); exit(1); --- 389,391 ---- if (i < 0) { ! syslog(L_FATAL, "cant fread after %d bytes %m", used); exit(1); *************** *** 410,412 **** ! return Process(article); } --- 405,409 ---- ! ok = Process(article); ! DISPOSE(article); ! return ok; } *************** *** 616,617 **** --- 613,615 ---- char buff[SMBUF]; + char hostname[10]; int fd; *************** *** 653,654 **** --- 651,655 ---- } + (void)strncpy(hostname, InputFile, 8); + hostname[8] = '\0'; + UUCPHost = hostname; ok = UnpackOne(&fd, &i); *************** *** 749,752 **** { /* Open the remote connection. */ ! if (NNTPconnect(server, &FromServer, &ToServer, buff) < 0) return FALSE; --- 750,759 ---- { + int i; + /* Open the remote connection. */ ! if (server) ! i = NNTPconnect(server, &FromServer, &ToServer, buff); ! else ! i = NNTPremoteopen(&FromServer, &ToServer, buff); ! if (i < 0) return FALSE; *************** *** 815,816 **** --- 822,824 ---- UUCPHost = getenv(_ENV_UUCPHOST); + (void)umask(NEWSUMASK); Index: include/clibrary.h =================================================================== RCS file: include/RCS/clibrary.h,v retrieving revision 1.16 diff -c1 -r1.16 include/clibrary.h *** 1.16 1993/01/29 16:51:09 --- include/clibrary.h 1993/03/18 21:04:07 *************** *** 1,2 **** ! /* $Revision: 1.16 $ ** --- 1,2 ---- ! /* $Revision: 1.17 $ ** *************** *** 68,70 **** #define FD_ISSET(n, p) ((p)->fds_bits[(n) / NFDBITS] & (1 << ((n) % NFDBITS))) ! #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) #endif /* defined(FD_SETSIZE) */ --- 68,70 ---- #define FD_ISSET(n, p) ((p)->fds_bits[(n) / NFDBITS] & (1 << ((n) % NFDBITS))) ! #define FD_ZERO(p) (void)memset((POINTER)(p), 0, sizeof *(p)) #endif /* defined(FD_SETSIZE) */ Index: include/configdata.h =================================================================== RCS file: include/RCS/configdata.h,v retrieving revision 1.28 diff -c1 -r1.28 include/configdata.h *** 1.28 1993/01/29 16:51:10 --- include/configdata.h 1993/03/18 21:04:11 *************** *** 1,2 **** ! /* $Revision: 1.28 $ ** --- 1,2 ---- ! /* $Revision: 1.29 $ ** *************** *** 58,59 **** --- 58,62 ---- #define PATHMASTER "not-for-mail" + /* Umask to set. */ + /* =()<#define NEWSUMASK @@>()= */ + #define NEWSUMASK 0 /* Mode that incoming articles are created under. */ *************** *** 261,263 **** /* =()<#define ICD_SYNC_COUNT @@>()= */ ! #define ICD_SYNC_COUNT 10 /* Tell resolver _res.options to be fast? */ --- 264,266 ---- /* =()<#define ICD_SYNC_COUNT @@>()= */ ! #define ICD_SYNC_COUNT 1 /* Tell resolver _res.options to be fast? */ Index: include/myserver.h =================================================================== RCS file: include/RCS/myserver.h,v retrieving revision 1.2 diff -c1 -r1.2 include/myserver.h *** 1.2 1991/11/27 17:08:06 --- include/myserver.h 1993/03/18 21:04:12 *************** *** 1,2 **** ! /* $Revision: 1.2 $ ** --- 1,2 ---- ! /* $Revision: 1.3 $ ** *************** *** 13,15 **** --- 13,18 ---- #define NNTP_CLASS_OK '2' + #define NNTP_CLASS_ERROR '4' #define NNTP_CLASS_FATAL '5' + + #define NNTP_SYNTAX_VAL 501 #define NNTP_STRLEN 512 *************** *** 19,20 **** --- 22,24 ---- #define CHAR_OK NNTP_CLASS_OK + #define CHAR_ERR NNTP_CLASS_ERROR #define CHAR_FATAL NNTP_CLASS_FATAL *************** *** 21,22 **** --- 25,27 ---- #define ERR_NOGROUP NNTP_NOSUCHGROUP_VAL + #define ERR_CMDSYN NNTP_SYNTAX_VAL Index: include/nntp.h =================================================================== RCS file: include/RCS/nntp.h,v retrieving revision 1.16 diff -c1 -r1.16 include/nntp.h *** 1.16 1993/01/29 16:51:15 --- include/nntp.h 1993/03/18 21:04:14 *************** *** 1,2 **** ! /* $Revision: 1.16 $ ** --- 1,2 ---- ! /* $Revision: 1.17 $ ** *************** *** 48,49 **** --- 48,50 ---- #define NNTP_OVERVIEW_FOLLOWS_VAL 224 + #define NNTP_DATE_FOLLOWS_VAL 111 #define NNTP_POSTOK "200" Index: include/patchlevel.h =================================================================== RCS file: include/RCS/patchlevel.h,v retrieving revision 1.13 diff -c1 -r1.13 include/patchlevel.h *** 1.13 1993/01/29 16:51:16 --- include/patchlevel.h 1993/03/18 21:04:16 *************** *** 1,2 **** ! /* $Revision: 1.13 $ ** --- 1,2 ---- ! /* $Revision: 1.14 $ ** *************** *** 3,4 **** --- 3,89 ---- ** $Log: patchlevel.h,v $ + ** Revision 1.14 1993/03/18 21:04:15 rsalz + ** patch04: Add NEWSUMASK (default 2) and have appropriate programs set it. + ** patch04: Add comment about NEWSLIB to config.dist + ** patch04: Add YACC config variable. + ** patch04: Alias FNDELAY to O_NDELAY for systems without it + ** patch04: Use $(SHELL) not sh in Makefiles + ** patch04: Use "echo ...|su" not "su -c ..." in rc.news and BUILD. + ** patch04: Document setsockopt/svr4 problems. + ** patch04: overview.fmt.5 referenced makeoverview . + ** patch04: Various typos in documentation , + ** patch04: , . + ** patch04: Add sample newsfeeds entry to overchan.8 + ** patch04: More text for innwatch.ctl, ``make update'', news overview . + ** patch04: inews can spool, so you need rnews; update inews.1 + ** patch04: Add rnews explanations to Install.ms.1 + ** patch04: Inews should not spool or email if -D given. + ** patch04: rnews had bad fopen call + ** patch04: rnews could not connect to remote server. + ** patch04: rnews leaked memory in ReadRemainder. + ** patch04: decode unpacked end wrong. + ** patch04: decode used bad pointer comparisons. + ** patch04: #if was backwards in syslog/syslogd.c . + ** patch04: Remove leading space in filenames in syslog.conf + ** patch04: Add -O flag to expireover; fix sorting bug . + ** patch04: *** RUN "expireover -a -s" SOON ** + ** patch04: Malloc overrun in expireover.c article.c + ** patch04: Have overchan create needed dirs if overview dir != spool dir. + ** patch04: Add overchan .o dependencies to backends/Makefile. + ** patch04: avoid unneeded unlink/group in expireover + ** patch04: Add -g to expire + ** patch04: faster raceless expireover/overchan locking + ** patch04: use caseEQ not EQ in CMDmode in nnrpd + ** patch04: Two wrong CloseOnExec calls in article.c + ** patch04: Have nnrpd's HISgetent return (char *) not (STRING). + ** patch04: Remove STATIC from nnrpd's CMD_unimp function definition; change + ** patch04: it to recognize slave command. + ** patch04: Add "date" command (from nntpv2 draft) to nnrpd. + ** patch04: Add -u flag and statistics to nntpget. + ** patch04: Add -p flag to filechan, buffchan. + ** patch04: buffchan shouldn't open dropped sites. + ** patch04: Add -A flag to innxmit. + ** patch04: newsrequeue re-used variable; coredumped if not logfile mode. + ** patch04: expireover and fastrm need . + ** patch04: Move functions in fastrm so STATIC declaration is okay. + ** patch04: BUILD and makehistory no longer assume history is in NEWSLIB. + ** patch04: Spelled Jon's name wrong in dbz.pch + ** patch04: Use memset not bzero in local FD_ZERO macro. + ** patch04: getlist parsed positional arguments wrong + ** patch04: getlist did not send a QUIT to the server. + ** patch04: Reverse order of elements in include/uio.h + ** patch04: Have GetFQDN try to force NIS/YP to use DNS + ** patch04: Fix date parser when hour is 12. + ** patch04: Typo in header in send-ihave + ** patch04: Had senduucp.log in samples/scanlogs + ** patch04: Have innwatch not complain to console if innd dies + ** patch04: Add logwatch into innwatch + ** patch04: rmgroup, newgroup, checkgroup are better about updating newsgroups + ** patch04: + ** patch04: Spurious erroneous mail line in rmgroup. + ** patch04: checkgroups mail message is now more clear. + ** patch04: Convert remaining scripts in samples to use innshellvars + ** patch04: Fix dataloss and fd leak in SITEflush + ** patch04: Don't use strlen on mmap'd active file + ** patch04: Used ModeReason not RejectReason in CCmode, CCreject + ** patch04: Used wrong argv[] in CCreject + ** patch04: Don't free NULL pointer in innd/rc.c . + ** patch04: Set all WIP's properly to NULL + ** patch04: SITEparsefile didn't free old ME entry + ** patch04: innd had typo in NICE_KIDS #if test + ** patch04: Add (void) to setsid call in innd + ** patch04: SITEwantsgroup didn't check ME patterns + ** patch04: + ** patch04: Don't crash if spooling fails + ** patch04: Don't reuse socket in innd/cc.c + ** patch04: Protect possible NULL return from RChostname (!?). + ** patch04: New NNTP connections to innd must clear any old WIP. + ** patch04: Add "p" item to newsfeeds "A" flag; document slave use. + ** patch04: rmgroups propagate like newgroups. + ** patch04: ctlinnd 'addhist' must open history if server not running. + ** patch04: innd clobbered memory on some reloads. + ** patch04: Copy SetDescriptorLimit into inndstart. + ** patch04: Make LIST case-insensitive in innd. + ** patch04: Add hosts.nntp.nolimit + ** patch04: Check PID file before innd starts up. + ** ** Revision 1.13 1993/01/29 16:51:16 rsalz *************** *** 284,287 **** #define RELEASE "1" ! #define PATCHLEVEL "3" ! #define DATE "29-Jan-93" --- 369,372 ---- #define RELEASE "1" ! #define PATCHLEVEL "4" ! #define DATE "20-Mar-93" Index: include/paths.h =================================================================== RCS file: include/RCS/paths.h,v retrieving revision 1.21 diff -c1 -r1.21 include/paths.h *** 1.21 1993/01/29 16:51:18 --- include/paths.h 1993/03/18 21:04:18 *************** *** 1,2 **** ! /* $Revision: 1.21 $ ** --- 1,2 ---- ! /* $Revision: 1.22 $ ** *************** *** 26,29 **** #define _PATH_COMPRESS "/usr/ucb/compress" - /* =()<#define _PATH_INEWS "@<_PATH_INEWS>@">()= */ - #define _PATH_INEWS "/usr/local/bin/inews.nntp" /* =()<#define _PATH_RNEWS "@<_PATH_RNEWS>@">()= */ --- 26,27 ---- Index: include/uio.h =================================================================== RCS file: include/RCS/uio.h,v retrieving revision 1.1 diff -c1 -r1.1 include/uio.h *** 1.1 1992/02/21 11:10:41 --- include/uio.h 1993/03/18 21:04:18 *************** *** 1,2 **** ! /* $Revision: 1.1 $ ** --- 1,2 ---- ! /* $Revision: 1.2 $ ** *************** *** 7,10 **** struct iovec { - int iov_len; char *iov_base; }; --- 7,10 ---- struct iovec { char *iov_base; + int iov_len; }; Index: innd/Makefile =================================================================== RCS file: innd/RCS/Makefile,v retrieving revision 1.20 diff -c1 -r1.20 innd/Makefile *** 1.20 1992/07/28 16:58:13 --- innd/Makefile 1993/03/18 21:04:19 *************** *** 1,2 **** ! ## $Revision: 1.20 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.21 $ SHELL = /bin/sh *************** *** 24,28 **** ## =()@>()= ! INND = /usr/local/etc/innd ## =()@>()= ! INNDSTART = /usr/local/etc/inndstart ## =()@ -G @@>()= --- 24,28 ---- ## =()@>()= ! INND = /news/bin/innd ## =()@>()= ! INNDSTART = /news/bin/inndstart ## =()@ -G @@>()= *************** *** 89,93 **** $(INND): innd ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(INNDSTART): inndstart ! sh ../installit.sh -m 0555 -b .OLD $? $@ --- 89,93 ---- $(INND): innd ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ $(INNDSTART): inndstart ! $(SHELL) ../installit.sh -m 0555 -b .OLD $? $@ Index: innd/art.c =================================================================== RCS file: innd/RCS/art.c,v retrieving revision 1.51 diff -c1 -r1.51 innd/art.c *** 1.51 1993/01/29 16:51:19 --- innd/art.c 1993/03/18 21:04:21 *************** *** 1,2 **** ! /* $Revision: 1.51 $ ** --- 1,2 ---- ! /* $Revision: 1.52 $ ** *************** *** 60,61 **** --- 60,62 ---- int Found; + BOOL Allocated; } ARTHEADER; *************** *** 149,151 **** --- 150,154 ---- { "References", HTstd }, + #define _references 16 { "Xref", HTobs }, + #define _xref 17 { "Date-Received", HTobs }, *************** *** 303,305 **** hp->Size = strlen(hp->Name); ! if (hp->Value == NULL && hp->Type != HTobs) hp->Value = NEW(char, MAXHEADERSIZE + 1); --- 306,310 ---- hp->Size = strlen(hp->Name); ! hp->Allocated = hp->Value == NULL && hp->Type != HTobs ! && hp != &ARTheaders[_bytes]; ! if (hp->Allocated) hp->Value = NEW(char, MAXHEADERSIZE + 1); *************** *** 324,325 **** --- 329,363 ---- + STATIC void + ARTfreetree(tp) + TREE *tp; + { + TREE *next; + + for ( ; tp != NULL; tp = next) { + if (tp->Before) + ARTfreetree(tp->Before); + next = tp->After; + DISPOSE(tp); + } + } + + + void + ARTclose() + { + register ARTHEADER *hp; + + /* Free space in the header table. */ + for (hp = ARTheaders; hp < ENDOF(ARTheaders); hp++) + if (hp->Allocated) + DISPOSE(hp->Value); + + if (ARTfields != NULL) { + DISPOSE(ARTfields); + ARTfields = NULL; + } + ARTfreetree(ARTheadertree); + } + + /* *************** *** 552,554 **** /* Install in header table; STRLEN("Lines: ") == 7. */ ! HDR(_lines) = Data->Lines + 7; ARTheaders[_lines].Length = i - 7; --- 590,592 ---- /* Install in header table; STRLEN("Lines: ") == 7. */ ! (void)strcpy(ARTheaders[_lines].Value, Data->Lines + 7); ARTheaders[_lines].Length = i - 7; *************** *** 558,559 **** --- 596,602 ---- if (CrossPosted) { + /* Install in header table; STRLEN("Xref: ") == 6. */ + HDR(_xref) = Xref.Data + 6; + ARTheaders[_xref].Length = Xref.Used - 6; + ARTheaders[_xref].Found = 1; + vp->iov_base = Xref.Data; *************** *** 855,857 **** for (hp = ARTheaders; hp < ENDOF(ARTheaders); hp++) { ! if (hp->Value) *hp->Value = '\0'; --- 898,900 ---- for (hp = ARTheaders; hp < ENDOF(ARTheaders); hp++) { ! if (hp->Value && hp->Type != HTobs) *hp->Value = '\0'; *************** *** 1336,1338 **** STATIC void ! ARTsendnewgroup(name) register char *name; --- 1379,1381 ---- STATIC void ! ARTsendthegroup(name) register char *name; *************** *** 1499,1501 **** ! if (ListHas(hops, sp->Name) || (sp->Hops && hopcount > sp->Hops) --- 1542,1544 ---- ! if ((!sp->IgnorePath && ListHas(hops, sp->Name)) || (sp->Hops && hopcount > sp->Hops) *************** *** 1635,1637 **** BOOL Accepted; ! BOOL IsNewgroup; BOOL CrossPosted; --- 1678,1680 ---- BOOL Accepted; ! BOOL LikeNewgroup; BOOL CrossPosted; *************** *** 1664,1665 **** --- 1707,1710 ---- Data.Feedsite = RChostname(cp); + if (Data.Feedsite == NULL) + Data.Feedsite = CHANname(cp); #else *************** *** 1741,1743 **** ControlHeader = -1; ! IsNewgroup = FALSE; } --- 1786,1788 ---- ControlHeader = -1; ! LikeNewgroup = FALSE; } *************** *** 1751,1753 **** *p = '\0'; ! IsNewgroup = EQ(ControlWord, "newgroup"); --- 1796,1799 ---- *p = '\0'; ! LikeNewgroup = EQ(ControlWord, "newgroup") ! || EQ(ControlWord, "rmgroup"); *************** *** 1778,1785 **** GroupMissing = TRUE; ! if (IsNewgroup && Approved) { ! /* Newgroup being sent to a group that doesn't exist. ! * Assume it is being sent to the group being created, ! * and send the group to all sites that would get the ! * group if it were created. */ ! ARTsendnewgroup(*groups); Accepted = TRUE; --- 1824,1831 ---- GroupMissing = TRUE; ! if (LikeNewgroup && Approved) { ! /* Newgroup/rmgroup being sent to a group that doesn't ! * exist. Assume it is being sent to the group being ! * created or removed, nd send the group to all sites that ! * would or would have had the group if it were created. */ ! ARTsendthegroup(*groups); Accepted = TRUE; *************** *** 1874,1876 **** return buff; ! #endif /* defined(DONT_WANT_TRASH) */ /* if !GroupMissing, then all the groups the article was posted --- 1920,1922 ---- return buff; ! #else /* if !GroupMissing, then all the groups the article was posted *************** *** 1886,1887 **** --- 1932,1934 ---- } + #endif /* defined(DONT_WANT_TRASH) */ } Index: innd/cc.c =================================================================== RCS file: innd/RCS/cc.c,v retrieving revision 1.40 diff -c1 -r1.40 innd/cc.c *** 1.40 1993/01/29 18:47:18 --- innd/cc.c 1993/03/18 21:04:22 *************** *** 1,2 **** ! /* $Revision: 1.40 $ ** --- 1,2 ---- ! /* $Revision: 1.41 $ ** *************** *** 68,69 **** --- 68,70 ---- STATIC CHANNEL *CCchan; + STATIC int CCwriter; STATIC CCDISPATCH CCcommands[] = { *************** *** 183,184 **** --- 184,186 ---- STRING p; + BOOL ok; *************** *** 187,188 **** --- 189,192 ---- return p; + if (HIShavearticle(Data.MessageID)) + return "1 Duplicate"; if (strspn(av[1], DIGITS) != strlen(av[1])) *************** *** 197,199 **** ! return !HISwrite(&Data, av[4]) ? "1 Write failed" : NULL; } --- 201,211 ---- ! if (Mode == OMrunning) ! ok = HISwrite(&Data, av[4]); ! else { ! /* Possible race condition, but documented in ctlinnd manpage. */ ! HISsetup(); ! ok = HISwrite(&Data, av[4]); ! HISclose(); ! } ! return ok ? NULL : "1 Write failed"; } *************** *** 213,215 **** p = av[0]; ! if (*p && !EQ(p, ModeReason)) return "1 Wrong reason"; --- 225,227 ---- p = av[0]; ! if (*p && !EQ(p, RejectReason)) return "1 Wrong reason"; *************** *** 600,604 **** *p++ = '\n'; ! if (ModeReason) { p += strlen(strcpy(p, "Rejecting ")); ! p += strlen(strcpy(p, ModeReason)); } --- 612,616 ---- *p++ = '\n'; ! if (RejectReason) { p += strlen(strcpy(p, "Rejecting ")); ! p += strlen(strcpy(p, RejectReason)); } *************** *** 663,664 **** --- 675,677 ---- register char *p; + register int count; int i; *************** *** 673,675 **** BUFFset(&CCreply, "0 ", 2); ! for (i = 0; (cp = CHANiter(&i, CTany)) != NULL; ) { if (cp->Type == CTfree) --- 686,688 ---- BUFFset(&CCreply, "0 ", 2); ! for (count = 0, i = 0; (cp = CHANiter(&i, CTany)) != NULL; ) { if (cp->Type == CTfree) *************** *** 676,677 **** --- 689,692 ---- continue; + if (++count > 1) + BUFFappend(&CCreply, NL, 1); p = CHANname(cp); *************** *** 678,680 **** BUFFappend(&CCreply, p, strlen(p)); - BUFFappend(&CCreply, NL, 1); } --- 693,694 ---- *************** *** 700,702 **** STRING who; - int mask; char buff[SMBUF]; --- 714,715 ---- *************** *** 725,727 **** * 4.1 has broken libc which can't handle fd's greater than 127. */ - mask = umask(0); if ((fd = open(TIMES, O_WRONLY | O_APPEND | O_CREAT, 0664)) < 0) { --- 738,739 ---- *************** *** 746,748 **** } - (void)umask(mask); --- 758,759 ---- *************** *** 992,994 **** return "1 Already rejecting"; ! RejectReason = COPY(av[1]); return NULL; --- 1003,1005 ---- return "1 Already rejecting"; ! RejectReason = COPY(av[0]); return NULL; *************** *** 1373,1375 **** (void)strcpy(client.sun_path, argv[0]); ! if (sendto(CCchan->fd, p, len, 0, (struct sockaddr *)&client, AF_UNIX_SOCKSIZE(client)) < 0) { --- 1384,1386 ---- (void)strcpy(client.sun_path, argv[0]); ! if (sendto(CCwriter, p, len, 0, (struct sockaddr *)&client, AF_UNIX_SOCKSIZE(client)) < 0) { *************** *** 1379,1381 **** if (i == EMSGSIZE) ! (void)sendto(CCchan->fd, TOOLONG, STRLEN(TOOLONG), 0, (struct sockaddr *)&client, AF_UNIX_SOCKSIZE(client)); --- 1390,1392 ---- if (i == EMSGSIZE) ! (void)sendto(CCwriter, TOOLONG, STRLEN(TOOLONG), 0, (struct sockaddr *)&client, AF_UNIX_SOCKSIZE(client)); *************** *** 1438,1439 **** --- 1449,1456 ---- } + + /* Create an unbound socket to reply on. */ + if ((CCwriter = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) { + syslog(L_FATAL, "%s cant socket unbound %m", LogName); + exit(1); + } #else *************** *** 1469,1470 **** --- 1486,1491 ---- syslog(L_ERROR, "%s cant unlink %s %m", LogName, CCpath); + #if defined(DO_HAVE_UNIX_DOMAIN) + if (close(CCwriter) < 0) + syslog(L_ERROR, "%s cant close unbound %m", LogName); + #endif /* defined(DO_HAVE_UNIX_DOMAIN) */ } Index: innd/chan.c =================================================================== RCS file: innd/RCS/chan.c,v retrieving revision 1.29 diff -c1 -r1.29 innd/chan.c *** 1.29 1993/01/29 16:51:22 --- innd/chan.c 1993/03/18 21:04:23 *************** *** 1,2 **** ! /* $Revision: 1.29 $ ** --- 1,2 ---- ! /* $Revision: 1.30 $ ** *************** *** 65,66 **** --- 65,69 ---- CHANtablesize = i; + CHANtable = NEW(CHANNEL, CHANtablesize); + (void)memset((POINTER)CHANtable, 0, + (SIZE_T)(CHANtablesize * sizeof *CHANtable)); CHANnull.NextLog = CHANNEL_INACTIVE_TIME; *************** *** 67,69 **** CHANnull.Address.s_addr = MyAddress.s_addr; ! for (cp = CHANtable = NEW(CHANNEL, CHANtablesize); --i >= 0; cp++) *cp = CHANnull; --- 70,72 ---- CHANnull.Address.s_addr = MyAddress.s_addr; ! for (cp = CHANtable; --i >= 0; cp++) *cp = CHANnull; Index: innd/innd.c =================================================================== RCS file: innd/RCS/innd.c,v retrieving revision 1.38 diff -c1 -r1.38 innd/innd.c *** 1.38 1993/01/29 16:51:26 --- innd/innd.c 1993/03/18 21:04:25 *************** *** 1,2 **** ! /* $Revision: 1.38 $ ** --- 1,2 ---- ! /* $Revision: 1.39 $ ** *************** *** 290,294 **** /* Try to set our permissions. */ ! #if defined(INND_NICE_KIDS) (void)nice(INND_NICE_VALUE); ! #endif /* defined(INND_NICE_KIDS) */ if (setgid(NewsGID) == -1) --- 290,294 ---- /* Try to set our permissions. */ ! #if defined(DO_INND_NICE_KIDS) (void)nice(INND_NICE_VALUE); ! #endif /* defined(DO_INND_NICE_KIDS) */ if (setgid(NewsGID) == -1) *************** *** 487,488 **** --- 487,489 ---- HISclose(); + ARTclose(); (void)sleep(1); *************** *** 748,750 **** /* Set up our permissions. */ ! (void)umask(0); if (!GetNewsOwnerships()) { --- 749,751 ---- /* Set up our permissions. */ ! (void)umask(NEWSUMASK); if (!GetNewsOwnerships()) { *************** *** 783,785 **** #if defined(DO_HAVE_SETSID) ! setsid(); #endif /* defined(DO_HAVE_SETSID) */ --- 784,786 ---- #if defined(DO_HAVE_SETSID) ! (void)setsid(); #endif /* defined(DO_HAVE_SETSID) */ *************** *** 812,814 **** #if NOFILE_LIMIT > 0 ! SetDescriptorLimit(NOFILE_LIMIT); #endif /* NOFILE_LIMIT > 0 */ --- 813,816 ---- #if NOFILE_LIMIT > 0 ! if (AmRoot) ! SetDescriptorLimit(NOFILE_LIMIT); #endif /* NOFILE_LIMIT > 0 */ *************** *** 822,824 **** /* getfdcount() - (stdio + dbz + cc + lc + rc + art + fudge) */ ! MaxOutgoing = i - ( 3 + 3 + 1 + 1 + 1 + 1 + 2 ); syslog(L_NOTICE, "%s outgoing %d", LogName, MaxOutgoing); --- 824,826 ---- /* getfdcount() - (stdio + dbz + cc + lc + rc + art + fudge) */ ! MaxOutgoing = i - ( 3 + 3 + 2 + 1 + 1 + 1 + 2 ); syslog(L_NOTICE, "%s outgoing %d", LogName, MaxOutgoing); *************** *** 826,827 **** --- 828,840 ---- + /* See if another instance is alive. */ + if ((F = fopen(PID, "r")) != NULL) { + if (fgets(buff, sizeof buff, F) != NULL + && ((pid = atoi(buff)) > 0) + && (kill((PID_T)pid, 0) > 0 || errno != ESRCH)) { + (void)syslog(L_FATAL, "%s already_running pid %d", LogName, pid); + exit(1); + } + (void)fclose(F); + } + /* Set up the various parts of the system. Channel feeds start *************** *** 850,855 **** pid = getpid(); - if ((F = fopen(PID, "r")) != NULL) { - syslog(L_ERROR, "%s exists %s", LogName, PID); - (void)fclose(F); - } if ((F = fopen(PID, "w")) == NULL) { --- 863,864 ---- Index: innd/innd.h =================================================================== RCS file: innd/RCS/innd.h,v retrieving revision 1.40 diff -c1 -r1.40 innd/innd.h *** 1.40 1993/01/29 16:51:27 --- innd/innd.h 1993/03/18 21:04:26 *************** *** 1,2 **** ! /* $Revision: 1.40 $ ** --- 1,2 ---- ! /* $Revision: 1.41 $ ** *************** *** 203,204 **** --- 203,205 ---- BOOL DistRequired; + BOOL IgnorePath; int Hops; *************** *** 425,426 **** --- 426,428 ---- extern void ARTcancel(); + extern void ARTclose(); extern void ARTsetup(); *************** *** 496,497 **** --- 498,500 ---- + extern BOOL RCnolimit(); extern BOOL RCauthorized(); Index: innd/inndstart.c =================================================================== RCS file: innd/RCS/inndstart.c,v retrieving revision 1.9 diff -c1 -r1.9 innd/inndstart.c *** 1.9 1993/01/29 16:51:28 --- innd/inndstart.c 1993/03/18 21:04:26 *************** *** 1,2 **** ! /* $Revision: 1.9 $ ** --- 1,2 ---- ! /* $Revision: 1.10 $ ** *************** *** 16,17 **** --- 16,24 ---- #include "macros.h" + #if NOFILE_LIMIT > 0 + #if defined(DO_NEED_TIME) + #include + #endif /* defined(DO_NEED_TIME) */ + #include + #include + #endif /* NOFILE_LIMIT > 0 */ *************** *** 19,20 **** --- 26,52 ---- + + #if NOFILE_LIMIT > 0 + /* + ** Set the limit on the number of open files we can have. I don't + ** like having to do this. + */ + STATIC void + SetDescriptorLimit(i) + int i; + { + struct rlimit rl; + + if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { + syslog(L_ERROR, "inndstart cant getrlimit(NOFILE) %m"); + return; + } + rl.rlim_cur = i; + if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { + syslog(L_ERROR, "inndstart cant setrlimit(NOFILE) %d %m", i); + return; + } + } + #endif /* NOFILE_LIMIT > 0 */ + + int *************** *** 49,50 **** --- 81,86 ---- NewsGID = Sb.st_gid; + + #if NOFILE_LIMIT > 0 + SetDescriptorLimit(NOFILE_LIMIT); + #endif /* NOFILE_LIMIT > 0 */ Index: innd/nc.c =================================================================== RCS file: innd/RCS/nc.c,v retrieving revision 1.34 diff -c1 -r1.34 innd/nc.c *** 1.34 1993/01/29 16:51:29 --- innd/nc.c 1993/03/18 21:04:28 *************** *** 1,2 **** ! /* $Revision: 1.34 $ ** --- 1,2 ---- ! /* $Revision: 1.35 $ ** *************** *** 10,12 **** #define BAD_COMMAND_COUNT 10 ! #define WIP_CHECK (5 * 60) #define SAVE_AMT 10 --- 10,12 ---- #define BAD_COMMAND_COUNT 10 ! #define WIP_CHECK (1 * 60) #define SAVE_AMT 10 *************** *** 59,60 **** --- 59,61 ---- STATIC WIP *NCwip; /* Work-in-progress */ + STATIC WIP NCnullwip; STATIC NCDISPATCH NCcommands[] = { *************** *** 560,562 **** continue; ! if (*p == 'n' && EQ(p, "newsgroups")) { trash = p = ReadInFile(_PATH_NEWSGROUPS, (struct stat *)NULL); --- 561,563 ---- continue; ! if (caseEQ(p, "newsgroups")) { trash = p = ReadInFile(_PATH_NEWSGROUPS, (struct stat *)NULL); *************** *** 564,566 **** } ! else if (*p == 'a' && EQ(p, "active.times")) { trash = p = ReadInFile(_PATH_ACTIVETIMES, (struct stat *)NULL); --- 565,567 ---- } ! else if (caseEQ(p, "active.times")) { trash = p = ReadInFile(_PATH_ACTIVETIMES, (struct stat *)NULL); *************** *** 568,570 **** } ! else if (*p == '\0' || (*p == 'a' && EQ(p, "active"))) { p = ICDreadactive(&end); --- 569,571 ---- } ! else if (*p == '\0' || (caseEQ(p, "active"))) { p = ICDreadactive(&end); *************** *** 967,972 **** /* Set up the work-in-progress structure. */ ! for (wp = NCwip = NEW(WIP, i), NCwipsize = i; --i >= 0; wp++) { ! wp->MessageID = NULL; ! wp->Replic.Data = NULL; ! } --- 968,971 ---- /* Set up the work-in-progress structure. */ ! for (wp = NCwip = NEW(WIP, i), NCwipsize = i; --i >= 0; wp++) ! *wp = NCnullwip; *************** *** 1024,1025 **** --- 1023,1025 ---- NCreader, NCwritedone); + NCclearwip(&NCwip[cp->fd]); #if defined(SOL_SOCKET) && defined(SO_SNDBUF) && defined(SO_RCVBUF) *************** *** 1044,1046 **** /* See if we have too many channels. */ ! if (MaxIncoming && NCcount >= MaxIncoming) { /* Recount, just in case we got out of sync. */ --- 1044,1046 ---- /* See if we have too many channels. */ ! if (MaxIncoming && NCcount >= MaxIncoming && !RCnolimit(cp)) { /* Recount, just in case we got out of sync. */ Index: innd/newsfeeds.c =================================================================== RCS file: innd/RCS/newsfeeds.c,v retrieving revision 1.30 diff -c1 -r1.30 innd/newsfeeds.c *** 1.30 1993/01/29 16:51:30 --- innd/newsfeeds.c 1993/03/18 21:04:29 *************** *** 1,2 **** ! /* $Revision: 1.30 $ ** --- 1,2 ---- ! /* $Revision: 1.31 $ ** *************** *** 233,234 **** --- 233,235 ---- case 'd': sp->DistRequired = TRUE; break; + case 'p': sp->IgnorePath = TRUE; break; } *************** *** 383,388 **** ngp->Sites[j] = isp; ! /* Note the continue! */ ! continue; ! } ! ngp->Sites[ngp->nSites++] = isp; } --- 384,389 ---- ngp->Sites[j] = isp; ! break; ! } ! if (j == ngp->nSites) ! ngp->Sites[ngp->nSites++] = isp; } *************** *** 434,435 **** --- 435,437 ---- result = FALSE; + continue; } *************** *** 439,440 **** --- 441,443 ---- result = FALSE; + continue; } *************** *** 444,445 **** --- 447,449 ---- result = FALSE; + continue; } *************** *** 482,483 **** --- 486,488 ---- DISPOSE(Sites); + SITEfree(&ME); } Index: innd/ng.c =================================================================== RCS file: innd/RCS/ng.c,v retrieving revision 1.18 diff -c1 -r1.18 innd/ng.c *** 1.18 1993/01/29 16:51:32 --- innd/ng.c 1993/03/18 21:04:30 *************** *** 1,2 **** ! /* $Revision: 1.18 $ ** --- 1,2 ---- ! /* $Revision: 1.19 $ ** *************** *** 180,182 **** * element, but it is definitely easier on the system. */ ! i = strlen(active); NGdirs.Size = i; --- 180,182 ---- * element, but it is definitely easier on the system. */ ! i = end - active; NGdirs.Size = i; Index: innd/rc.c =================================================================== RCS file: innd/RCS/rc.c,v retrieving revision 1.30 diff -c1 -r1.30 innd/rc.c *** 1.30 1993/01/29 16:51:34 --- innd/rc.c 1993/03/18 21:04:31 *************** *** 1,2 **** ! /* $Revision: 1.30 $ ** --- 1,2 ---- ! /* $Revision: 1.31 $ ** *************** *** 38,40 **** STATIC char RCnntpd[] = _PATH_NNTPD; - STATIC char RChostpath[] = _PATH_INNDHOSTS; STATIC CHANNEL *RCchan; --- 38,39 ---- *************** *** 42,43 **** --- 41,44 ---- STATIC int RCnpeerlist; + STATIC REMOTEHOST *RCnolimitlist; + STATIC int RCnnolimitlist; *************** *** 74,75 **** --- 75,94 ---- /* + ** See if a host is in the "nolimit" file. + */ + BOOL + RCnolimit(cp) + register CHANNEL *cp; + { + register REMOTEHOST *rp; + register int i; + + for (rp = RCnolimitlist, i = RCnnolimitlist; --i >= 0; rp++) + /* SUPPRESS 112 *//* Retrieving long where char is stored */ + if (cp->Address.s_addr == rp->Address.s_addr) + return TRUE; + return FALSE; + } + + + /* ** Is this an address of the master? *************** *** 206,209 **** */ ! void ! RCreadlist() { --- 225,231 ---- */ ! STATIC void ! RCreadfile(list, count, filename) ! REMOTEHOST **list; ! int *count; ! char *filename; { *************** *** 222,225 **** /* Free anything that might have been there. */ ! if (RCpeerlist) { ! for (rp = RCpeerlist, i = RCnpeerlist; --i >= 0; rp++) { DISPOSE(rp->Name); --- 244,247 ---- /* Free anything that might have been there. */ ! if (*list) { ! for (rp = *list, i = *count; --i >= 0; rp++) { DISPOSE(rp->Name); *************** *** 226,232 **** DISPOSE(rp->Password); ! DISPOSE(rp->Patterns); } ! DISPOSE(RCpeerlist); ! RCpeerlist = NULL; ! RCnpeerlist = 0; } --- 248,255 ---- DISPOSE(rp->Password); ! if (rp->Patterns) ! DISPOSE(rp->Patterns); } ! DISPOSE(*list); ! *list = NULL; ! *count = 0; } *************** *** 234,237 **** /* Open the server file, count the lines. */ ! if ((F = fopen(RChostpath, "r")) == NULL) { ! syslog(L_FATAL, "%s cant read %s %m", LogName, RChostpath); exit(1); --- 257,260 ---- /* Open the server file, count the lines. */ ! if ((F = fopen(filename, "r")) == NULL) { ! syslog(L_FATAL, "%s cant read %s %m", LogName, filename); exit(1); *************** *** 238,240 **** } ! for (i = 0; fgets(buff, sizeof buff, F) != NULL; ) if (buff[0] != COMMENT_CHAR && buff[0] != '\n') --- 261,263 ---- } ! for (i = 1; fgets(buff, sizeof buff, F) != NULL; ) if (buff[0] != COMMENT_CHAR && buff[0] != '\n') *************** *** 241,248 **** i++; #if !defined(DO_HAVE_UNIX_DOMAIN) - i++; - #endif /* !defined(DO_HAVE_UNIX_DOMAIN) */ - RCnpeerlist = i; - rp = RCpeerlist = NEW(REMOTEHOST, RCnpeerlist); - #if !defined(DO_HAVE_UNIX_DOMAIN) rp->Address.s_addr = inet_addr(LOOPBACK_HOST); --- 264,268 ---- i++; + *count = i; + rp = *list = NEW(REMOTEHOST, *count); #if !defined(DO_HAVE_UNIX_DOMAIN) rp->Address.s_addr = inet_addr(LOOPBACK_HOST); *************** *** 312,317 **** /* Note the relative position, grow the array, and restore it. */ ! j = rp - RCpeerlist; ! RCnpeerlist += i - 1; ! RENEW(RCpeerlist, REMOTEHOST, RCnpeerlist); ! rp = &RCpeerlist[j]; --- 332,337 ---- /* Note the relative position, grow the array, and restore it. */ ! j = rp - *list; ! *count += i - 1; ! RENEW(*list, REMOTEHOST, *count); ! rp = *list + j; *************** *** 334,335 **** --- 354,356 ---- } + *count = rp - *list; *************** *** 336,338 **** if (fclose(F) == EOF) ! syslog(L_ERROR, "%s cant fclose %s %m", LogName, RChostpath); --- 357,359 ---- if (fclose(F) == EOF) ! syslog(L_ERROR, "%s cant fclose %s %m", LogName, filename); *************** *** 339,341 **** if (errors) ! syslog(L_ERROR, "%s bad_hosts %d in %s", LogName, errors, RChostpath); } --- 360,376 ---- if (errors) ! syslog(L_ERROR, "%s bad_hosts %d in %s", LogName, errors, filename); ! } ! ! ! void ! RCreadlist() ! { ! static char INNDHOSTS[] = _PATH_INNDHOSTS; ! char name[sizeof _PATH_INNDHOSTS + sizeof ".nolimit"]; ! struct stat Sb; ! ! RCreadfile(&RCpeerlist, &RCnpeerlist, INNDHOSTS); ! FileGlue(name, INNDHOSTS, '.', "nolimit"); ! if (stat(name, &Sb) >= 0) ! RCreadfile(&RCnolimitlist, &RCnnolimitlist, name); } *************** *** 343,344 **** --- 378,380 ---- + /* *************** *** 503,505 **** DISPOSE(rp->Password); ! DISPOSE(rp->Patterns); } --- 539,542 ---- DISPOSE(rp->Password); ! if (rp->Patterns) ! DISPOSE(rp->Patterns); } Index: innd/site.c =================================================================== RCS file: innd/RCS/site.c,v retrieving revision 1.33 diff -c1 -r1.33 innd/site.c *** 1.33 1993/01/29 16:51:36 --- innd/site.c 1993/03/18 21:04:32 *************** *** 1,2 **** ! /* $Revision: 1.33 $ ** --- 1,2 ---- ! /* $Revision: 1.34 $ ** *************** *** 26,28 **** else ! STATIC int SITEcount; --- 26,28 ---- else ! STATIC int SITEcount; *************** *** 241,243 **** ! bp = sp->Buffered ? &sp->Buffer : &sp->Channel->Out; for (Dirty = FALSE, p = sp->FileFlags; *p; p++) { --- 241,252 ---- ! if (sp->Buffered) ! bp = &sp->Buffer; ! else { ! /* This should not happen, but if we tried to spool and failed, ! * e.g., because of a bad F param for this site, we can get ! * into this state. We already logged a message so give up. */ ! if (sp->Channel == NULL) ! return; ! bp = &sp->Channel->Out; ! } for (Dirty = FALSE, p = sp->FileFlags; *p; p++) { *************** *** 655,657 **** register CHANNEL *cp; ! register BOOL lost; --- 664,669 ---- register CHANNEL *cp; ! register BUFFER *out; ! ! if (sp->Name == NULL) ! return; *************** *** 686,688 **** (void)WCHANflush(cp); - sp->Channel = NULL; --- 698,699 ---- *************** *** 692,695 **** syslog(L_ERROR, "%s cant restart %m", sp->Name); ! else if (cp != NULL) ! WCHANsetfrombuffer(sp->Channel, &cp->Out); } --- 703,714 ---- syslog(L_ERROR, "%s cant restart %m", sp->Name); ! else if (cp != NULL) { ! if (sp->Buffered) { ! /* SITEsetup had to buffer us; save any residue. */ ! out = &sp->Channel->Out; ! if (out->Left) ! BUFFset(&sp->Buffer, &out->Data[out->Used], out->Left); ! } ! else ! WCHANsetfrombuffer(sp->Channel, &cp->Out); ! } } *************** *** 696,711 **** else if (cp != NULL && cp->Out.Left) { ! /* Try to spool pending data; assume that we failed. */ ! lost = TRUE; ! if (!sp->Spooling && sp->Process < 0) { ! syslog(L_ERROR, "%s saving to batchfile %s", ! sp->Name, sp->SpoolName); ! if (close(cp->fd) < 0) ! syslog(L_ERROR, "%s cant close fd %d %m", sp->Name, cp->fd); ! if (!SITEspool(sp, cp)) ! syslog(L_ERROR, "%s cant open %s %m", sp->Name, sp->SpoolName); ! else if (WCHANflush(cp)) ! lost = FALSE; ! } ! if (lost) ! syslog(L_ERROR, "%s dataloss %d", sp->Name, cp->Out.Left); } --- 715,726 ---- else if (cp != NULL && cp->Out.Left) { ! if (sp->Type == FTfile || sp->Spooling) { ! /* Can't flush a file? Hopeless. */ ! syslog(L_ERROR, "%s dataloss %d", sp->Name, cp->Out.Left); ! return; ! } ! /* Must be a working channel; spool and retry. */ ! syslog(L_ERROR, "%s spooling %d bytes", sp->Name, cp->Out.Left); ! if (SITEspool(sp, cp)) ! SITEflush(sp, FALSE); ! return; } *************** *** 714,715 **** --- 729,733 ---- if (cp != NULL) { + /* Make sure we have no dangling pointers to it. */ + if (!Restart) + sp->Channel = NULL; CHANclose(cp, sp->Name); *************** *** 751,753 **** ! for (match = SUB_DEFAULT, argv = sp->Patterns; (pat = *argv++) != NULL; ) { subvalue = *pat != SUB_NEGATE; --- 769,781 ---- ! match = SUB_DEFAULT; ! if (ME.Patterns) { ! for (argv = ME.Patterns; (pat = *argv++) != NULL; ) { ! subvalue = *pat != SUB_NEGATE; ! if (!subvalue) ! pat++; ! if (wildmat(name, pat)) ! match = subvalue; ! } ! } ! for (argv = sp->Patterns; (pat = *argv++) != NULL; ) { subvalue = *pat != SUB_NEGATE; *************** *** 811,812 **** --- 839,841 ---- } + sp->Name = NULL; if (sp->Process > 0) { *************** *** 819,821 **** sp->Entry = NULL; - sp->Name = NULL; } --- 848,849 ---- *************** *** 882,883 **** --- 910,913 ---- fsp = sp; + if (sp->Name == NULL || fsp->Name == NULL) + return; if (fsp->Funnel != NOSITE) Index: lib/Makefile =================================================================== RCS file: lib/RCS/Makefile,v retrieving revision 1.25 diff -c1 -r1.25 lib/Makefile *** 1.25 1993/01/29 16:51:40 --- lib/Makefile 1993/03/18 21:04:33 *************** *** 1,2 **** ! ## $Revision: 1.25 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.26 $ SHELL = /bin/sh *************** *** 15,17 **** ## =()@>()= ! DBZCFLAGS = $(CFLAGS) ## =()@>()= --- 15,17 ---- ## =()@>()= ! DBZCFLAGS = $(CFLAGS) -DMMAP ## =()@>()= *************** *** 24,25 **** --- 24,27 ---- LINTFILTER = | sed -n -f ../sedf.sun + ## =()@>()= + YACC = yacc ## =()@>()= *************** *** 75,77 **** llib-linn.ln: lint ! sh ./makellib.sh $(LINTLIBSTYLE) "$(LINTFLAGS)" $(SOURCES) --- 77,79 ---- llib-linn.ln: lint ! $(SHELL) ./makellib.sh $(LINTLIBSTYLE) "$(LINTFLAGS)" $(SOURCES) *************** *** 95,97 **** @echo Expect 6 shift/reduce conflicts ! yacc parsedate.y @mv y.tab.c parsedate.c --- 97,99 ---- @echo Expect 6 shift/reduce conflicts ! $(YACC) parsedate.y @mv y.tab.c parsedate.c Index: lib/clientlib.c =================================================================== RCS file: lib/RCS/clientlib.c,v retrieving revision 1.5 diff -c1 -r1.5 lib/clientlib.c *** 1.5 1993/01/29 16:51:42 --- lib/clientlib.c 1993/03/18 21:04:34 *************** *** 1,2 **** ! /* $Revision: 1.5 $ ** --- 1,2 ---- ! /* $Revision: 1.6 $ ** *************** *** 59,61 **** put_server("mode reader"); ! if (get_server(line2, sizeof line2) < 0) return -1; --- 59,61 ---- put_server("mode reader"); ! if (get_server(line2, (int)sizeof line2) < 0) return -1; *************** *** 159,161 **** ! (void)get_server(buff, sizeof buff); (void)fclose(ser_rd_fp); --- 159,161 ---- ! (void)get_server(buff, (int)sizeof buff); (void)fclose(ser_rd_fp); Index: lib/getfqdn.c =================================================================== RCS file: lib/RCS/getfqdn.c,v retrieving revision 1.7 diff -c1 -r1.7 lib/getfqdn.c *** 1.7 1993/01/29 16:51:48 --- lib/getfqdn.c 1993/03/18 21:04:35 *************** *** 1,2 **** ! /* $Revision: 1.7 $ ** --- 1,2 ---- ! /* $Revision: 1.8 $ ** *************** *** 21,22 **** --- 21,23 ---- char *p; + char temp[SMBUF + 2]; *************** *** 35,38 **** return NULL; ! if (strchr(hp->h_name, '.') != NULL) { ! if (strlen(hp->h_name) < sizeof hp->h_name - 1) return strcpy(buff, hp->h_name); --- 36,45 ---- return NULL; ! if (strchr(hp->h_name, '.') == NULL) { ! /* Try to force DNS lookup if NIS/whatever gets in the way. */ ! (void)strncpy(temp, buff, sizeof buff); ! (void)strcat(temp, "."); ! hp = gethostbyname(temp); ! } ! if (hp != NULL && strchr(hp->h_name, '.') != NULL) { ! if (strlen(hp->h_name) < sizeof buff - 1) return strcpy(buff, hp->h_name); *************** *** 46,48 **** return NULL; ! if (strlen(hp->h_name) + 1 + strlen(p) > sizeof buff - 1) /* Doesn't fit. */ --- 53,55 ---- return NULL; ! if (strlen(buff) + 1 + strlen(p) > sizeof buff - 1) /* Doesn't fit. */ Index: lib/inndcomm.c =================================================================== RCS file: lib/RCS/inndcomm.c,v retrieving revision 1.17 diff -c1 -r1.17 lib/inndcomm.c *** 1.17 1993/01/29 16:51:49 --- lib/inndcomm.c 1993/03/18 21:04:36 *************** *** 1,2 **** ! /* $Revision: 1.17 $ ** --- 1,2 ---- ! /* $Revision: 1.18 $ ** *************** *** 192,193 **** --- 192,200 ---- + /* Is server there? */ + pid = ICCserverpid(); + if (!ICCserveralive(pid)) { + ICCfailure = "dead server"; + return -1; + } + /* Get the length of the buffer. */ *************** *** 215,217 **** ICCfailure = NULL; - pid = ICCserverpid(); len = p - buff; --- 222,223 ---- *************** *** 225,227 **** #else ! if ((fd = open(_PATH_NEWSCONTROL, O_WRONLY | O_NDELAY)) < 0) { DISPOSE(buff); --- 231,233 ---- #else ! if ((fd = open(_PATH_NEWSCONTROL, O_WRONLY)) < 0) { DISPOSE(buff); Index: lib/lockfile.c =================================================================== RCS file: lib/RCS/lockfile.c,v retrieving revision 1.3 diff -c1 -r1.3 lib/lockfile.c *** 1.3 1992/04/03 06:33:24 --- lib/lockfile.c 1993/03/18 21:04:37 *************** *** 1,2 **** ! /* $Revision: 1.3 $ ** --- 1,2 ---- ! /* $Revision: 1.4 $ ** *************** *** 50,52 **** ! fl.l_type = F_RDLCK; fl.l_whence = SEEK_SET; --- 50,52 ---- ! fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; Index: lib/nonblocking.c =================================================================== RCS file: lib/RCS/nonblocking.c,v retrieving revision 1.5 diff -c1 -r1.5 lib/nonblocking.c *** 1.5 1992/09/14 19:21:28 --- lib/nonblocking.c 1993/03/18 21:04:37 *************** *** 1,2 **** ! /* $Revision: 1.5 $ ** --- 1,2 ---- ! /* $Revision: 1.6 $ ** *************** *** 30,31 **** --- 30,36 ---- #include + + #if !defined(FNDELAY) + #define FNDELAY O_NDELAY + #endif /* !defined(FNDELAY) */ + Index: lib/parsedate.y =================================================================== RCS file: lib/RCS/parsedate.y,v retrieving revision 1.12 diff -c1 -r1.12 lib/parsedate.y *** 1.12 1992/09/14 19:21:29 --- lib/parsedate.y 1993/03/18 21:04:38 *************** *** 1,3 **** %{ ! /* $Revision: 1.12 $ ** --- 1,3 ---- %{ ! /* $Revision: 1.13 $ ** *************** *** 466,467 **** --- 466,469 ---- return -1; + if (Hours == 12) + Hours = 0; if (Meridian == MERpm) Index: makedirs.sh =================================================================== RCS file: RCS/makedirs.sh,v retrieving revision 1.5 diff -c1 -r1.5 makedirs.sh *** 1.5 1992/07/28 16:58:40 --- makedirs.sh 1993/03/18 21:04:39 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.5 $ ## Script to make INN directories. --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.6 $ ## Script to make INN directories. *************** *** 26,32 **** ## =()@>()= ! SPOOL=/var/spool/news ## =()@>()= ! ARCHIVEDIR=/var/spool/news/news.archive ## =()@>()= ! BATCHDIR=/var/spool/news/out.going ## =()@>()= --- 26,32 ---- ## =()@>()= ! SPOOL=/news/spool ## =()@>()= ! ARCHIVEDIR=/news/spool/news.archive ## =()@>()= ! BATCHDIR=/news/spool/out.going ## =()@>()= *************** *** 41,51 **** ## =()@>()= ! NEWSLIB=/usr/local/news ## =()@>()= ! NEWSBIN=/usr/local/news/bin ## =()@>()= ! CONTROLPROGS=/usr/local/news/bin/control ## =()@>()= ! RNEWSPROGS=/usr/local/news/bin/rnews ## =()@>()= ! INNDDIR=/usr/local/news/innd ## =()@>()= --- 41,51 ---- ## =()@>()= ! NEWSLIB=/news/lib ## =()@>()= ! NEWSBIN=/news/bin ## =()@>()= ! CONTROLPROGS=/news/bin/control ## =()@>()= ! RNEWSPROGS=/news/bin/rnews ## =()@>()= ! INNDDIR=/news/lib/innd ## =()@>()= *************** *** 58,59 **** --- 58,60 ---- + PFLAG="$1" umask 0 *************** *** 69,71 **** if [ ! -d ${F} ] ; then ! mkdir ${F} || exit 1 ${CHOWN} ${NEWSUSER} ${F} || exit 1 --- 70,72 ---- if [ ! -d ${F} ] ; then ! mkdir ${PFLAG} ${F} || exit 1 ${CHOWN} ${NEWSUSER} ${F} || exit 1 Index: nnrpd/Makefile =================================================================== RCS file: nnrpd/RCS/Makefile,v retrieving revision 1.15 diff -c1 -r1.15 nnrpd/Makefile *** 1.15 1992/08/19 16:34:13 --- nnrpd/Makefile 1993/03/18 21:04:40 *************** *** 1,2 **** ! ## $Revision: 1.15 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.16 $ SHELL = /bin/sh *************** *** 24,26 **** ## =()@>()= ! NNRPD = /usr/local/etc/in.nnrpd ## =()@ -G @@>()= --- 24,26 ---- ## =()@>()= ! NNRPD = /news/bin/nnrpd ## =()@ -G @@>()= *************** *** 47,49 **** $(NNRPD): nnrpd ! sh ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ --- 47,49 ---- $(NNRPD): nnrpd ! $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD $? $@ *************** *** 51,53 **** rm -f *.o $(ALL) ! rm -f nnrpd profiled rm -f all install lint --- 51,53 ---- rm -f *.o $(ALL) ! rm -f nnrpd nnrpdp profiled rm -f all install lint Index: nnrpd/article.c =================================================================== RCS file: nnrpd/RCS/article.c,v retrieving revision 1.12 diff -c1 -r1.12 nnrpd/article.c *** 1.12 1993/01/29 16:51:53 --- nnrpd/article.c 1993/03/18 21:04:41 *************** *** 1,2 **** ! /* $Revision: 1.12 $ ** --- 1,2 ---- ! /* $Revision: 1.13 $ ** *************** *** 177,179 **** } ! CloseOnExec(TRUE, QIOfileno(ARTqp)); --- 177,179 ---- } ! CloseOnExec(QIOfileno(ARTqp), TRUE); *************** *** 203,205 **** return NULL; ! CloseOnExec(TRUE, QIOfileno(qp)); if ((q = strrchr(p, '/')) != NULL) --- 203,205 ---- return NULL; ! CloseOnExec(QIOfileno(qp), TRUE); if ((q = strrchr(p, '/')) != NULL) *************** *** 651,653 **** /* Skip leading headers. */ ! for (fp = &ARTfields[field - 1]; --field >= 0; p++) if ((p = strchr(p, '\t')) == NULL) --- 651,653 ---- /* Skip leading headers. */ ! for (fp = &ARTfields[field - 1]; --field >= 0 && *p; p++) if ((p = strchr(p, '\t')) == NULL) *************** *** 654,655 **** --- 654,657 ---- return NULL; + if (*p == '\0') + return NULL; *************** *** 656,658 **** if (fp->HasHeader) ! p += fp->Length; --- 658,660 ---- if (fp->HasHeader) ! p += fp->Length + 2; *************** *** 766,767 **** --- 768,770 ---- register int size; + register int ov_size; register long lines; *************** *** 778,781 **** /* Set up place to store headers. */ ! if (Headers == NULL) Headers = NEW(ARTOVERFIELD, ARTfieldsize); for (hp = Headers, i = ARTfieldsize; --i >= 0; hp++) --- 781,787 ---- /* Set up place to store headers. */ ! if (Headers == NULL) { Headers = NEW(ARTOVERFIELD, ARTfieldsize); + for (hp = Headers, i = ARTfieldsize; --i >= 0; hp++) + hp->Length = 0; + } for (hp = Headers, i = ARTfieldsize; --i >= 0; hp++) *************** *** 825,827 **** (void)strcpy(hp->Header, p); - hp->HasHeader = TRUE; for (p = hp->Header; *p; p++) --- 831,832 ---- *************** *** 829,830 **** --- 834,836 ---- *p = ' '; + hp->HasHeader = TRUE; } *************** *** 845,847 **** /* Calculate total size, fix hardwired headers. */ ! size = strlen(name) + ARTfieldsize + 2; for (hp = Headers, fp = ARTfields, i = ARTfieldsize; --i >= 0; hp++, fp++) { --- 851,853 ---- /* Calculate total size, fix hardwired headers. */ ! ov_size = strlen(name) + ARTfieldsize + 2; for (hp = Headers, fp = ARTfields, i = ARTfieldsize; --i >= 0; hp++, fp++) { *************** *** 852,857 **** t = lines; (void)sprintf(value, "%ld", t); ! if (hp->HasHeader) ! DISPOSE(hp->Header); ! hp->Header = COPY(value); hp->HasHeader = TRUE; --- 858,871 ---- t = lines; + (void)sprintf(value, "%ld", t); ! size = strlen(value); ! if (hp->Length == 0) { ! hp->Length = size; ! hp->Header = NEW(char, hp->Length + 1); ! } ! else if (hp->Length < size) { ! hp->Length = size; ! RENEW(hp->Header, char, hp->Length + 1); ! } ! (void)strcpy(hp->Header, value); hp->HasHeader = TRUE; *************** *** 859,861 **** if (hp->HasHeader) ! size += strlen(hp->Header); } --- 873,875 ---- if (hp->HasHeader) ! ov_size += strlen(hp->Header); } *************** *** 864,866 **** if (buffsize == 0) { ! buffsize = size; buff = NEW(char, buffsize + 1); --- 878,880 ---- if (buffsize == 0) { ! buffsize = ov_size; buff = NEW(char, buffsize + 1); *************** *** 867,870 **** } ! else if (buffsize < size) { ! buffsize = size; RENEW(buff, char, buffsize + 1); --- 881,884 ---- } ! else if (buffsize < ov_size) { ! buffsize = ov_size; RENEW(buff, char, buffsize + 1); *************** *** 879,880 **** --- 893,895 ---- } + *p = '\0'; *************** *** 942,947 **** /* Get it from the overview? */ ! if (Overview ! && (p = OVERfind(i)) != NULL ! && (p = OVERGetHeader(p, Overview)) != NULL) { ! Printf("%d %s\r\n", i, p); continue; --- 957,961 ---- /* Get it from the overview? */ ! if (Overview && (p = OVERfind(i)) != NULL) { ! p = OVERGetHeader(p, Overview); ! Printf("%d %s\r\n", i, p && *p ? p : "(none)"); continue; Index: nnrpd/commands.c =================================================================== RCS file: nnrpd/RCS/commands.c,v retrieving revision 1.13 diff -c1 -r1.13 nnrpd/commands.c *** 1.13 1993/01/29 16:51:54 --- nnrpd/commands.c 1993/03/18 21:04:42 *************** *** 1,2 **** ! /* $Revision: 1.13 $ ** --- 1,2 ---- ! /* $Revision: 1.14 $ ** *************** *** 5,6 **** --- 5,7 ---- #include "nnrpd.h" + #include *************** *** 92,93 **** --- 93,117 ---- /* + ** The "DATE" command. Part of NNTPv2. + */ + /* ARGSUSED0 */ + FUNCTYPE + CMDdate(ac, av) + int ac; + char *av[]; + { + TIMEINFO t; + struct tm *gmt; + + if (GetTimeInfo(&t) < 0 || (gmt = gmtime(&t.time)) == NULL) { + Reply("%d Can't get time, %s\r\n", NNTP_TEMPERR_VAL, strerror(errno)); + return; + } + Reply("%d %04.4d%02.2d%02.2d%02.2d%02.2d%02.2d\r\n", + NNTP_DATE_FOLLOWS_VAL, + gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday, + gmt->tm_hour, gmt->tm_min, gmt->tm_sec); + } + + + /* ** List active newsgroups, newsgroup descriptions, and distributions. *************** *** 183,185 **** { ! if (EQ(av[1], "reader")) Reply("%d %s InterNetNews NNRP server %s ready (%s).\r\n", --- 207,209 ---- { ! if (caseEQ(av[1], "reader")) Reply("%d %s InterNetNews NNRP server %s ready (%s).\r\n", Index: nnrpd/misc.c =================================================================== RCS file: nnrpd/RCS/misc.c,v retrieving revision 1.13 diff -c1 -r1.13 nnrpd/misc.c *** 1.13 1993/01/29 16:51:58 --- nnrpd/misc.c 1993/03/18 21:04:43 *************** *** 1,2 **** ! /* $Revision: 1.13 $ ** --- 1,2 ---- ! /* $Revision: 1.14 $ ** *************** *** 247,249 **** */ ! STRING HISgetent(msg_id, fulldata) --- 247,249 ---- */ ! char * HISgetent(msg_id, fulldata) Index: nnrpd/nnrpd.c =================================================================== RCS file: nnrpd/RCS/nnrpd.c,v retrieving revision 1.17 diff -c1 -r1.17 nnrpd/nnrpd.c *** 1.17 1993/01/29 16:52:01 --- nnrpd/nnrpd.c 1993/03/18 21:04:44 *************** *** 1,2 **** ! /* $Revision: 1.17 $ ** --- 1,2 ---- ! /* $Revision: 1.18 $ ** *************** *** 46,47 **** --- 46,48 ---- extern FUNCTYPE CMDauthinfo(); + extern FUNCTYPE CMDdate(); extern FUNCTYPE CMDfetch(); *************** *** 74,75 **** --- 75,78 ---- CMDfetchhelp }, + { "date", CMDdate, FALSE, 1, 1, + NULL }, { "group", CMDgroup, FALSE, 2, 2, *************** *** 149,152 **** } - - /* --- 152,153 ---- *************** *** 175,177 **** /* ! ** Unimplemented catch-all. Only needed for IHAVE right now. */ --- 176,178 ---- /* ! ** Unimplemented catch-all. */ *************** *** 178,180 **** /* ARGSUSED0 */ ! STATIC FUNCTYPE CMD_unimp(ac, av) --- 179,181 ---- /* ARGSUSED0 */ ! FUNCTYPE CMD_unimp(ac, av) *************** *** 185,187 **** Reply("%d Transfer permission denied\r\n", NNTP_AUTH_NEEDED_VAL); ! else if (caseEQ(av[0], "ihave")) Reply("%d Unsupported\r\n", NNTP_SLAVEOK_VAL); --- 186,189 ---- Reply("%d Transfer permission denied\r\n", NNTP_AUTH_NEEDED_VAL); ! else if (caseEQ(av[0], "slave")) ! /* Somebody sends us this? I don't believe it! */ Reply("%d Unsupported\r\n", NNTP_SLAVEOK_VAL); *************** *** 188,191 **** else ! Reply("%d %s not implemented; try help\r\n", av[0], ! NNTP_BAD_COMMAND_VAL); } --- 190,193 ---- else ! Reply("%d %s not implemented; try help\r\n", ! NNTP_BAD_COMMAND_VAL, av[0]); } *************** *** 334,335 **** --- 336,338 ---- continue; + /* Matching for a specific user or just the host? */ if (user && (!EQ(user, fields[2]) || !EQ(pass, fields[3]))) Index: nnrpd/nnrpd.h =================================================================== RCS file: nnrpd/RCS/nnrpd.h,v retrieving revision 1.14 diff -c1 -r1.14 nnrpd/nnrpd.h *** 1.14 1993/01/29 16:52:02 --- nnrpd/nnrpd.h 1993/03/18 21:04:45 *************** *** 1,2 **** ! /* $Revision: 1.14 $ ** --- 1,2 ---- ! /* $Revision: 1.15 $ ** *************** *** 49,51 **** ** The XTHREAD command is too ugly to talk about, but if you want it ! ** change DONT_DO_XTRHEAD to DONT_DO_XTRHEAD, below. */ --- 49,51 ---- ** The XTHREAD command is too ugly to talk about, but if you want it ! ** change DONT_DO_XTRHEAD to DO_DO_XTRHEAD, below. */ *************** *** 139,141 **** extern GROUPENTRY *GRPfind(); ! extern STRING HISgetent(); extern long LOCALtoGMT(); --- 139,141 ---- extern GROUPENTRY *GRPfind(); ! extern char *HISgetent(); extern long LOCALtoGMT(); Index: samples/checkgroups =================================================================== RCS file: samples/RCS/checkgroups,v retrieving revision 1.12 diff -c1 -r1.12 samples/checkgroups *** 1.12 1993/01/29 16:52:04 --- samples/checkgroups 1993/03/18 21:04:46 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.12 $ ## Checkgroups control-message handler. --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.13 $ ## Checkgroups control-message handler. *************** *** 13,21 **** ( ! echo "${FROM} posted the following checkgroups message." echo 'If you want to process it, then feed the body of the' ! echo 'message below into' ! echo " ${CONTROLPROGS}/docheckgroups" ! echo "as the \"${NEWSUSER}\" userid." echo '' ! cat ${ARTICLE} ) | ${MAILCMD} -s "checkgroups by ${FROM}" ${NEWSMASTER} --- 13,24 ---- ( ! echo "${FROM} posted the following checkgroups message:" ! ${SED} -e '/^$/q' -e 's/^/ /' <${ARTICLE} ! echo '' echo 'If you want to process it, then feed the body of the' ! echo 'message into docheckgroups while running as the' ! echo "\"${NEWSUSER}\" userid:" echo '' ! echo "${CONTROLPROGS}/docheckgroups <<-EOF-" ! ${SED} -e '1,/^$/d' <${ARTICLE} ! echo '-EOF-' ) | ${MAILCMD} -s "checkgroups by ${FROM}" ${NEWSMASTER} Index: samples/ctlrun =================================================================== RCS file: samples/RCS/ctlrun,v retrieving revision 1.5 diff -c1 -r1.5 samples/ctlrun *** 1.5 1992/09/14 19:21:34 --- samples/ctlrun 1993/03/18 21:04:47 *************** *** 1,3 **** #!/bin/sh ! ## $Revision: 1.5 $ ## Run all control messages named on the command line, or in the spool --- 1,3 ---- #!/bin/sh ! ## $Revision: 1.6 $ ## Run all control messages named on the command line, or in the spool *************** *** 5,17 **** ! ## =()@>()= ! NEWSMASTER=usenet ! ## =()@>()= ! SPOOL=/var/spool/news ! ## =()@>()= ! CONTROLPROGS=/usr/local/news/bin/control ! ## =()@>()= ! SED=sed ! INP=${TMPDIR-/tmp}/inp$$ ! TEMP=${TMPDIR-/tmp}/ctl$$ case "$#" in --- 5,11 ---- ! ## =()<. @<_PATH_SHELLVARS>@>()= ! . /news/lib/innshellvars ! INP=${TMPDIR}/inp$$ ! TEMP=${TMPDIR}/ctl$$ case "$#" in Index: samples/docheckgroups =================================================================== RCS file: samples/RCS/docheckgroups,v retrieving revision 1.3 diff -c1 -r1.3 samples/docheckgroups *** 1.3 1993/01/29 16:52:09 --- samples/docheckgroups 1993/03/18 21:04:49 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.3 $ ## Script to execute checkgroups text; results to stdout. --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.4 $ ## Script to execute checkgroups text; results to stdout. *************** *** 30,34 **** ! ${EGREP} "${PATS}" ${ACTIVE} | ${SED} -n "/m\$/s/ .*//p" | sort >${T}/$$amod.all ${EGREP} "${PATS}" ${T}/$$msg | ! ${SED} -n "/Moderated/s/[ ][ ]*.*//p" | sort >${T}/$$ng.mod --- 30,34 ---- ! ${EGREP} "${PATS}" ${ACTIVE} | ${SED} -n '/ m$/s/ .*//p' | sort >${T}/$$amod.all ${EGREP} "${PATS}" ${T}/$$msg | ! ${SED} -n '/(Moderated)$/s/[ ].*//p' | sort >${T}/$$ng.mod *************** *** 50,51 **** --- 50,52 ---- echo " ctlinnd rmgroup $i" + ${EGREP} "^$i " ${NEWSGROUPS} >>${T}/$$ngdel done *************** *** 61,63 **** for i in `cat ${T}/$$add.unmod` ; do ! echo " ctlinnd newgroup $i y ''" done --- 62,65 ---- for i in `cat ${T}/$$add.unmod` ; do ! echo " ctlinnd newgroup $i y ${FROM}" ! ${EGREP} "^$i " ${T}/$$msg >>${T}/$$ngadd done *************** *** 64,66 **** for i in `cat ${T}/$$add.mod` ; do ! echo " ctlinnd newgroup $i m ''" done --- 66,69 ---- for i in `cat ${T}/$$add.mod` ; do ! echo " ctlinnd newgroup $i m ${FROM}" ! ${EGREP} "^$i " ${T}/$$msg >>${T}/$$ngadd done *************** *** 77,78 **** --- 80,82 ---- echo " ctlinnd changegroup $i y" + ${EGREP} "^$i " ${T}/$$msg >>${T}/$$ngchng done *************** *** 89,90 **** --- 93,95 ---- echo " ctlinnd changegroup $i m" + ${EGREP} "^$i " ${T}/$$msg >>${T}/$$ngchng done *************** *** 94,99 **** ! if [ -s ${T}/$$out ] ; then cat ${T}/$$out ! echo "And remember to update ${NEWSGROUPS}." ! fi --- 99,120 ---- ! test -s ${T}/$$out && { cat ${T}/$$out ! echo 'exit # so you can feed this message into the shell' ! echo "# And remember to update ${NEWSGROUPS}." ! test -s ${T}/$$ngdel && { ! echo "# Remove these lines:" ! ${SED} "s/^/# /" ${T}/$$ngdel ! echo '' ! } ! test -s ${T}/$$ngadd && { ! echo "# Add these lines:" ! ${SED} "s/^/# /" ${T}/$$ngadd ! echo '' ! } ! test -s ${T}/$$ngchng && { ! echo "# Change these lines:" ! ${SED} "s/^/# /" ${T}/$$ngchng ! echo '' ! } ! } Index: samples/inncheck =================================================================== RCS file: samples/RCS/inncheck,v retrieving revision 1.9 diff -c1 -r1.9 samples/inncheck *** 1.9 1993/01/29 16:52:11 --- samples/inncheck 1993/03/18 21:04:51 *************** *** 1,3 **** ! #! /usr/bin/perl -- # -*-Perl-*- ! ## $Revision: 1.9 $ ## Sanity-check the configuration of an INN system --- 1,3 ---- ! #!/usr/bin/perl -- ! ## $Revision: 1.10 $ ## Sanity-check the configuration of an INN system *************** *** 230,232 **** print "$file:$line: unknown action `$act'\n" ! if !defined $control'actions{$1}; } --- 230,232 ---- print "$file:$line: unknown action `$act'\n" ! if !defined $control'actions{$act}; } *************** *** 424,426 **** '<', '^\d+$', ! 'A', '^d$', 'B', '^\d+(/\d+)?$', --- 424,426 ---- '<', '^\d+$', ! 'A', '^[dp]+$', 'B', '^\d+(/\d+)?$', *************** *** 608,611 **** ! print "$file:$line: unknown header `$header'\n" ! if !defined $overview_fmtheaders{$header}; if ( $mode eq "full" ) { --- 608,611 ---- ! #print "$file:$line: unknown header `$header'\n" ! # if !defined $overview_fmtheaders{$header}; if ( $mode eq "full" ) { Index: samples/innshellvars =================================================================== RCS file: samples/RCS/innshellvars,v retrieving revision 1.1 diff -c1 -r1.1 samples/innshellvars *** 1.1 1993/01/20 21:37:40 --- samples/innshellvars 1993/03/18 21:04:52 *************** *** 1,5 **** #! /bin/sh ! ## $Revision: 1.1 $ ## Set up any and all shell variables that an INN shell script ! ## might need. --- 1,5 ---- #! /bin/sh ! ## $Revision: 1.2 $ ## Set up any and all shell variables that an INN shell script ! ## might need. Also sets umask. *************** *** 11,13 **** ## =()@>()= ! AWK=/usr/local/bin/gawk ## =()@>()= --- 11,13 ---- ## =()@>()= ! AWK=/bin/gawk ## =()@>()= *************** *** 25,29 **** ## =()@>()= ! EGREP=/usr/local/bin/egnugrep ! ## =()@>()= ! EGREP=/usr/local/bin/egnugrep ## =()@>()= --- 25,27 ---- ## =()@>()= ! EGREP=/bin/egnugrep ## =()@>()= *************** *** 62,65 **** NEWSBIN=/news/bin - ## =()@>()= - NEWSBIN=/news/bin ## =()@>()= --- 60,61 ---- *************** *** 94,95 **** --- 90,93 ---- TEMPSOCK=`basename /news/lib/innd/ctlinndXXXXXX | ${SED} -e 's/XXXXXX$/*/'` + ## =()@ | ${SED} -e 's@/[^/]*$@@'`>()= + TEMPSOCKDIR=`echo /news/lib/innd/ctlinndXXXXXX | ${SED} -e 's@/[^/]*$@@'` ## =()@>()= *************** *** 106 **** --- 104,107 ---- export PATH + + ## =()@>()= + umask 0 Index: samples/innwatch =================================================================== RCS file: samples/RCS/innwatch,v retrieving revision 1.10 diff -c1 -r1.10 samples/innwatch *** 1.10 1993/01/29 16:52:14 --- samples/innwatch 1993/03/18 21:04:53 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.10 $ ## Watch the state of the system relative to the news subsystem. --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.11 $ ## Watch the state of the system relative to the news subsystem. *************** *** 9,10 **** --- 9,14 ---- ## Extensively modified by . + ## Watch a log file and send mail when it gets new output by + ## Steve Groom + ## Steve's extensions merged in innwatch by + ## *************** *** 16,18 **** --- 20,27 ---- DAILY=${LOCKS}/LOCK.news.daily + ## Where to put the timestamp file (directory and filename). + TIMESTAMP=${LOCKS}/${PROGNAME}.time + ## Logfile to watch. Comment out if no logwatch. + LOGFILE=${MOST_LOGS}/news.crit + ## Parse JCL. *************** *** 21,23 **** X-f) ! FILE="$2" shift --- 30,32 ---- X-f) ! FILE=$2 shift *************** *** 27,30 **** ;; X-t) ! SLEEPTIME="$2" shift --- 36,46 ---- ;; + X-l) + LOGFILE=$2 + shift + ;; + X-l*) + LOGFILE=`expr "$1" : '-s\(.*\)'` + ;; X-t) ! SLEEPTIME=$2 shift *************** *** 71,75 **** ! trap ' ! (echo "${PROGNAME} waiting for INND to start (pid: $$)"; date) >${STATUS} ! ' 2 --- 87,92 ---- ! trap '( ! echo "${PROGNAME} waiting for INND to start (pid: $$)" ! date ! ) >${INNWSTATUS}' 2 *************** *** 78,80 **** while PID=`cat ${SERVERPID} 2>/dev/null`; test -z "${PID}"; do ! sleep "${SLEEPTIME}" done --- 95,97 ---- while PID=`cat ${SERVERPID} 2>/dev/null`; test -z "${PID}"; do ! sleep ${SLEEPTIME} done *************** *** 82,91 **** trap '( ! if [ -z "${STATE}" ]; then X=RUN; else X="${STATE}"; fi; ! echo "${PROGNAME} state: ${X} (pid: $$)"; ! if [ -z "${INND}" ]; then X=GO; else X="${INND}"; fi; ! if [ -n "${REASON}" ]; then R=": ${REASON}"; else R=""; fi; ! echo "Controlled INND state: ${X}${R}"; ! echo "${PROGNAME} examination interval: ${SLEEPTIME} seconds"; ! date; ! ) >${STATUS}' 2 --- 99,114 ---- trap '( ! if [ -z "${STATE}" ]; then ! echo "${PROGNAME} state RUN interval ${SLEEPTIME} pid $$" ! else ! echo "${PROGNAME} state ${STATE} interval ${SLEEPTIME} pid $$" ! fi ! if [ -z "${INND}" ]; then ! X=GO ! else ! X="${INND}" ! fi ! test -n "${REASON}" && X="${X}: ${REASON}" ! echo "INND state ${X}" ! date ! ) >${INNWSTATUS}' 2 *************** *** 96,99 **** ! while { sleep "${NEXTSLEEP}" & wait; } ; : ; do ! NEXTSLEEP="${SLEEPTIME}" --- 119,122 ---- ! while { sleep ${NEXTSLEEP} & wait; } ; : ; do ! NEXTSLEEP=${SLEEPTIME} *************** *** 106,108 **** ## Notify NEWSMASTER if it has stopped or just restarted. ! if ctlinnd -s -t 120 mode ; then ${HASEXITED} && { --- 129,131 ---- ## Notify NEWSMASTER if it has stopped or just restarted. ! if ctlinnd -s -t 120 mode 2>/dev/null ; then ${HASEXITED} && { *************** *** 164,166 **** for X in a b; do # meaningless trash because we have no goto ! if [ -z "${CND}" ]; then X=- ; else X="${CND}"; fi set -$- X ${X}; shift --- 187,193 ---- for X in a b; do # meaningless trash because we have no goto ! if [ -z "${CND}" ]; then ! X=- ! else ! X="${CND}" ! fi set -$- X ${X}; shift *************** *** 269,270 **** --- 296,322 ---- + if [ -n "${LOGFILE}" -a -f "${LOGFILE}" ]; then + if [ ! -f ${TIMESTAMP} ]; then + DOIT=${LOGFILE} + else + # use ls to print most recently modified file first. + # If that's ${LOGFILE}, it's changed since the last pass. + DOIT="`ls -t ${TIMESTAMP} ${LOGFILE} | sed -e 1q | grep ${LOGFILE}`" + fi + + # If the file has been modified more recently than the timestamp, + # and the file has length greater than 0, send the warning. + if [ -n "${DOIT}" -a -s ${LOGFILE} ]; then + date >${TIMESTAMP} + ( + ls -l ${LOGFILE} + echo "-----" + ctlinnd -t120 mode + echo "-----" + cat ${LOGFILE} + ) 2>&1 \ + | ${MAILCMD} -s "${PROGNAME} warning: messages in ${LOGFILE}" \ + ${NEWSMASTER} + fi + fi + done *************** *** 271,272 **** ! rm -f "${LOCK}" --- 323,324 ---- ! rm -f ${LOCK} Index: samples/newgroup =================================================================== RCS file: samples/RCS/newgroup,v retrieving revision 1.19 diff -c1 -r1.19 samples/newgroup *** 1.19 1993/01/29 16:52:17 --- samples/newgroup 1993/03/18 21:04:55 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.19 $ ## Newgroup control-message handler --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.20 $ ## Newgroup control-message handler *************** *** 44,45 **** --- 44,46 ---- ## Kill the chefs; from . + ## That is, turn "alt.foo.bar.bar.bar" into an "x" group. #case `echo $1 | awk -F. '{ *************** *** 57,58 **** --- 58,60 ---- ## Compare group against active file. + SUFFIX="" LINE=`grep "^$1 " <${ACTIVE} 2>/dev/null` *************** *** 76,77 **** --- 78,80 ---- WORD="made moderated" + SUFFIX=" (Moderated)" ;; *************** *** 110,123 **** ! ## Try to update the newsgroups file? ! case $WORD in ! created) ! ;; ! *) ! exit ! ;; ! esac ! ! ## We're sending to a file. ! LOCK=${LOCKS}/LOCK.newgroup PID=$$ --- 113,136 ---- ! ## Get a description of the newsgroup; first from the article, and ! ## then from the newsgroups file. ! DESC=`${SED} <${ARTICLE} -n -e " ! :top ! /^For your newsgroups file:\$/b scan ! n ! b top ! :scan ! n ! /$1[ ]/ { ! p ! q ! } ! b scan"` ! test -z "${DESC}" && { ! DESC=`${EGREP} "^$1 " ${NEWSGROUPS} | ${SED} "s/[ ]*(Moderated)//"` ! test -z "${DESC}" && DESC="$1 ?" ! } ! DESC="${DESC}${SUFFIX}" ! ## Lock so we can update newsgroups ! LOCK=${LOCKS}/LOCK.newsgroups PID=$$ *************** *** 138,153 **** ! ${SED} <${ARTICLE} >>${NEWSGROUPS} -n -e " ! :top ! /^For your newsgroups file:\$/b scan ! n ! b top ! :scan ! n ! /$1[ ]/ { ! p ! q ! } ! b scan" ! ! rm -f ${LOCK} exit --- 151,156 ---- ! ${EGREP} -v "^$1[ ]" <${NEWSGROUPS} >${TEMP} ! cat ${TEMP} >${NEWSGROUPS} ! echo "${DESC}" >>${NEWSGROUPS} ! rm ${TEMP} ${LOCK} exit Index: samples/news.daily =================================================================== RCS file: samples/RCS/news.daily,v retrieving revision 1.21 diff -c1 -r1.21 samples/news.daily *** 1.21 1993/01/29 16:52:18 --- samples/news.daily 1993/03/18 21:04:57 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.21 $ ## Daily news maintenance. --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.22 $ ## Daily news maintenance. *************** *** 262,264 **** ## Remove old sockets. ! ${DORM} && find ${INNDDIR} -name "${TEMPSOCK}" -mtime +2 -exec rm -f '{}' ';' --- 262,265 ---- ## Remove old sockets. ! ${DORM} && ! find ${TEMPSOCKDIR} -name "${TEMPSOCK}" -mtime +2 -exec rm -f '{}' ';' Index: samples/newsfeeds =================================================================== RCS file: samples/RCS/newsfeeds,v retrieving revision 1.11 diff -c1 -r1.11 samples/newsfeeds *** 1.11 1993/01/29 16:52:19 --- samples/newsfeeds 1993/03/18 21:04:58 *************** *** 1,2 **** ! ## $Revision: 1.11 $ ## newsfeeds - determine where Usenet articles get sent --- 1,2 ---- ! ## $Revision: 1.12 $ ## newsfeeds - determine where Usenet articles get sent *************** *** 9,11 **** ## @ "$@">()= ! . /usr/local/news/parsecontrol "$@" --- 7,9 ---- ## =()<. @<_PATH_PARSECTL>@ "$@">()= ! . /news/bin/control/parsecontrol "$@" *************** *** 52,59 **** ${WRITELOG} ${LOGFILE} "rmgroup $1 by ${FROM}" <${ARTICLE} ! grep -v "^$1[ ]" <${NEWSGROUPS} >${TEMP} ! cat ${TEMP} >${NEWSGROUPS} ! #I don't know about this: ! #${SED} -e "s/^$1 /# `date` $1 /" <${ACTIVETIMES} >${TEMP} ! #cat ${TEMP} >${ACTIVETIMES} exit --- 52,75 ---- ${WRITELOG} ${LOGFILE} "rmgroup $1 by ${FROM}" <${ARTICLE} ! ! ## We're sending to a file. ! LOCK=${LOCKS}/LOCK.newsgroups ! PID=$$ ! TRY=0 ! MAXTRY=60 ! export LOCK MAXTRY PID LOGFILE TRY ! while [ ${TRY} -lt ${MAXTRY} ]; do ! shlock -p ${PID} -f ${LOCK} && break ! sleep 2 ! TRY=`expr ${TRY} + 1` ! done ! ! ## If we got the lock, update the file; otherwise, give up. ! test ${TRY} -lt ${MAXTRY} || { ! echo "Newgroup cannot update newsgroups. Locked by" `cat ${LOCK}` 1>&2 ! exit ! } + ${EGREP} -v "^$1[ ]" <${NEWSGROUPS} >${TEMP} + cat ${TEMP} >${NEWSGROUPS} + rm ${TEMP} ${LOCK} exit Index: samples/scanlogs =================================================================== RCS file: samples/RCS/scanlogs,v retrieving revision 1.20 diff -c1 -r1.20 samples/scanlogs *** 1.20 1993/01/29 16:52:22 --- samples/scanlogs 1993/03/18 21:05:02 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.20 $ ## Summarize INN log files. --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.21 $ ## Summarize INN log files. *************** *** 23,26 **** NNTPSEND=${MOST_LOGS}/nntpsend.log - ## Where uucpsend, if used, writes its log information. - UUCPSEND=${MOST_LOGS}/uucpsend.log ## Where news.daily places expire output, unless noexplog was used. --- 23,24 ---- *************** *** 47,49 **** test -n "${NNTPSEND}" -a -f "${NNTPSEND}" && LOGS="${LOGS} ${NNTPSEND}" - test -n "${UUCPSEND}" -a -f "${UUCPSEND}" && LOGS="${LOGS} ${UUCPSEND}" test -n "${CONTROL_DATA}" && LOGS="${LOGS} ${CONTROL_LOG}" --- 45,46 ---- *************** *** 130,132 **** ## These are live files, so use link rather than copy. ! for F in ${NNTPSEND} ${UUCPSEND}; do if [ -f ${F} ]; then --- 127,129 ---- ## These are live files, so use link rather than copy. ! for F in ${NNTPSEND} ; do if [ -f ${F} ]; then *************** *** 289,291 **** ## if so, complain to your vendor and try GNU egrep. ! P1='No body|EOF in headers|"Message-ID"' P2='Missing ".*" header|Linecount|Bad Date|Too old' --- 286,288 ---- ## if so, complain to your vendor and try GNU egrep. ! P1='No body|EOF in headers|"Message-ID"|No colon-space in ' P2='Missing ".*" header|Linecount|Bad Date|Too old' Index: samples/send-ihave =================================================================== RCS file: samples/RCS/send-ihave,v retrieving revision 1.5 diff -c1 -r1.5 samples/send-ihave *** 1.5 1992/09/14 19:21:45 --- samples/send-ihave 1993/03/18 21:05:03 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.5 $ ## SH script to send IHAVE batches out. --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.6 $ ## SH script to send IHAVE batches out. *************** *** 4,23 **** ! ## =()@>()= ! NEWSBIN=/usr/local/news/bin ! PATH=${NEWSBIN}:${PATH}:/bin:/usr/bin:/usr/ucb ; export PATH ! ## =()@>()= ! SED=sed ! ! ## =()@>()= ! MOST_LOGS=/var/log/news ! ## =()@>()= ! BATCH=/var/spool/news/out.going ! ## =()@>()= ! INEWS=/usr/local/news/inews ! ## =()@>()= ! NEWSLIB=/usr/local/news ! ## =()@>()= ! LOCKS=/usr/local/news ! ## =()@}>()= ! TMPDIR=${TMPDIR-/tmp} --- 4,7 ---- ! ## =()<. @<_PATH_SHELLVARS>@>()= ! . /news/lib/innshellvars *************** *** 44,73 **** ! ## Who are we sending to? ! if [ -n "$1" ] ; then ! LIST="$*" ! else ! LIST="" ! case `date +%H` in ! 01|04|07|21|23) ! LIST="kurz-ai aoa clsib21 leafusa metasoft" ! ;; ! 06|12|15|17|20) ! LIST="esca" ! ;; ! esac ! fi - ## Do the work... - for SITE in ${LIST}; do - ## See if any data is ready for host. ! BATCHFILE=${SITE}.ihave ! if [ -f ${SITE}.work ] ; then ! cat ${SITE}.work >>${BATCHFILE} ! rm -f ${SITE}.work fi ! mv ${SITE} ${SITE}.work ! ctlinnd -s -t30 flush ${SITE} || continue ! cat ${SITE}.work >>${BATCHFILE} ! rm -f ${SITE}.work echo "${PROGNAME}: [$$] begin ${SITE}" --- 28,42 ---- ! ## Do the work. ! for SITE in $* ; do ## See if any data is ready for host. ! BATCHFILE=${SITE}.ihave.batch ! if [ -f ${SITE}.iwork ] ; then ! cat ${SITE}.iwork >>${BATCHFILE} ! rm -f ${SITE}.iwork fi ! mv ${SITE}.ihave ${SITE}.iwork ! ctlinnd -s -t30 flush ${SITE}.ihave || continue ! cat ${SITE}.iwork >>${BATCHFILE} ! rm -f ${SITE}.iwork echo "${PROGNAME}: [$$] begin ${SITE}" *************** *** 76,81 **** export SITE PERMESSAGE BATCHFILE ! while -s ${BATCHFILE} ; do ( ! echo Newsgroup: to.${SITE} ! echo Control: ihave `hostname` echo '' --- 45,50 ---- export SITE PERMESSAGE BATCHFILE ! while test -s ${BATCHFILE} ; do ( ! echo Newsgroups: to.${SITE} ! echo Control: ihave `innconfval pathhost` echo '' Index: samples/tally.control =================================================================== RCS file: samples/RCS/tally.control,v retrieving revision 1.4 diff -c1 -r1.4 samples/tally.control *** 1.4 1992/09/14 19:21:50 --- samples/tally.control 1993/03/18 21:05:04 *************** *** 1,3 **** #!/bin/sh ! ## $Revision: 1.4 $ ## Tally/update the newgroup/rmgroup control log. --- 1,3 ---- #!/bin/sh ! ## $Revision: 1.5 $ ## Tally/update the newgroup/rmgroup control log. *************** *** 9,22 **** ! ## =()@>()= ! NEWSBIN=/usr/local/news/bin ! PATH=${NEWSBIN}:${PATH}:/bin:/usr/bin:/usr/ucb ; export PATH ! ## =()@>()= ! AWK=/usr/local/bin/gawk ! ## =()@>()= ! SED=sed - ## =()@>()= - LOCKS=/usr/local/news - ## =()@>()= - MOST_LOGS=/var/log/news CONTROL=${MOST_LOGS}/control.log --- 9,13 ---- ! ## =()<. @<_PATH_SHELLVARS>@>()= ! . /news/lib/innshellvars CONTROL=${MOST_LOGS}/control.log Index: samples/tally.unwanted =================================================================== RCS file: samples/RCS/tally.unwanted,v retrieving revision 1.3 diff -c1 -r1.3 samples/tally.unwanted *** 1.3 1992/09/14 19:21:51 --- samples/tally.unwanted 1993/03/18 21:05:05 *************** *** 1,3 **** #!/bin/sh ! ## $Revision: 1.3 $ ## Tally/update the unwanted newsgroup log --- 1,3 ---- #!/bin/sh ! ## $Revision: 1.4 $ ## Tally/update the unwanted newsgroup log *************** *** 7,20 **** ! ## =()@>()= ! NEWSBIN=/usr/local/news/bin ! PATH=${NEWSBIN}:${PATH}:/bin:/usr/bin:/usr/ucb ; export PATH ! ## =()@>()= ! AWK=/usr/local/bin/gawk ! ## =()@>()= ! SED=sed ! ! ## =()@>()= ! LOCKS=/usr/local/news ! ## =()@>()= ! MOST_LOGS=/var/log/news --- 7,10 ---- ! ## =()<. @<_PATH_SHELLVARS>@>()= ! . /news/lib/innshellvars Index: samples/version =================================================================== RCS file: samples/RCS/version,v retrieving revision 1.22 diff -c1 -r1.22 samples/version *** 1.22 1993/01/29 16:52:28 --- samples/version 1993/03/18 21:05:06 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.22 $ ## Version control-message handler --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.23 $ ## Version control-message handler *************** *** 9,11 **** ! VERSION="INN 1.3" --- 9,11 ---- ! VERSION="INN 1.4" Index: samples/writelog =================================================================== RCS file: samples/RCS/writelog,v retrieving revision 1.2 diff -c1 -r1.2 samples/writelog *** 1.2 1992/09/14 19:21:52 --- samples/writelog 1993/03/18 21:05:08 *************** *** 1,3 **** #! /bin/sh ! ## $Revision: 1.2 $ ## Write a log file entry, by either mailing it or writing it safely. --- 1,3 ---- #! /bin/sh ! ## $Revision: 1.3 $ ## Write a log file entry, by either mailing it or writing it safely. *************** *** 8,21 **** ! ## =()@>()= ! NEWSBIN=/usr/local/news/bin ! PATH=${NEWSBIN}:${PATH}:/bin:/usr/bin:/usr/ucb ; export PATH ! ## =()@>()= ! SED=sed ! ! ## =()@>()= ! LOCKS=/usr/local/news ! ## =()@>()= ! NEWSMASTER=usenet ! ## =()@>()= ! MAILCMD=/usr/ucb/Mail --- 8,11 ---- ! ## =()<. @<_PATH_SHELLVARS>@>()= ! . /news/lib/innshellvars Index: site/Makefile =================================================================== RCS file: site/RCS/Makefile,v retrieving revision 1.14 diff -c1 -r1.14 site/Makefile *** 1.14 1993/01/29 16:52:30 --- site/Makefile 1993/03/18 21:05:09 *************** *** 1,2 **** ! ## $Revision: 1.14 $ SHELL = /bin/sh --- 1,2 ---- ! ## $Revision: 1.15 $ SHELL = /bin/sh *************** *** 62,65 **** ctlrun inncheck innstat \ ! innwatch logwatch \ ! innlog.awk innshellvars MOST_INSTALLED = \ --- 62,64 ---- ctlrun inncheck innstat \ ! innwatch innlog.awk innshellvars MOST_INSTALLED = \ *************** *** 75,78 **** $(NEWSBIN)/ctlrun $(NEWSBIN)/inncheck $(NEWSBIN)/innstat \ ! $(NEWSBIN)/innwatch $(NEWSBIN)/logwatch \ ! $(NEWSLIB)/innlog.awk $(PATH_SHELLVARS) --- 74,76 ---- $(NEWSBIN)/ctlrun $(NEWSBIN)/inncheck $(NEWSBIN)/innstat \ ! $(NEWSBIN)/innwatch $(NEWSLIB)/innlog.awk $(PATH_SHELLVARS) *************** *** 95,96 **** --- 93,95 ---- + ## Get new versions of everything from samples directory. all: $(P) $(ALL) config *************** *** 97,98 **** --- 96,98 ---- + ## Get only scripts, not per-host config files. most: $(MOST) *************** *** 99,100 **** --- 99,101 ---- + ## Show changes between files here and ones in samples. diff: *************** *** 101,102 **** --- 102,109 ---- @$(MAKE) COPY=-diff all + + ## Show changes between files here and installed versions. + diff-installed: + @$(MAKE) COPY_RPRI=-diff COPY_RPUB=-diff COPY_XPRI=-diff COPY_XPUB=-diff $(ALL_INSTALLED) + + ## Show what would be copied from samples directory. what: *************** *** 105,107 **** config: $(ALL) ! sh ./do-subst.sh $? date >config --- 112,114 ---- config: $(ALL) ! $(SHELL) ./do-subst.sh $? date >config *************** *** 113,114 **** --- 120,122 ---- + ## Install scripts, not per-host config files. update: $(MOST_INSTALLED) *************** *** 136,141 **** ## Commands to make private or public, read or executable files. ! COPY_RPRI = sh ../installit.sh $(OWNER) -m 0440 -b .OLD ! COPY_RPUB = sh ../installit.sh $(OWNER) -m 0444 -b .OLD ! COPY_XPRI = sh ../installit.sh $(OWNER) -m 0550 -b .OLD ! COPY_XPUB = sh ../installit.sh $(OWNER) -m 0555 -b .OLD --- 144,149 ---- ## Commands to make private or public, read or executable files. ! COPY_RPRI = $(SHELL) ../installit.sh $(OWNER) -m 0440 -b .OLD ! COPY_RPUB = $(SHELL) ../installit.sh $(OWNER) -m 0444 -b .OLD ! COPY_XPRI = $(SHELL) ../installit.sh $(OWNER) -m 0550 -b .OLD ! COPY_XPUB = $(SHELL) ../installit.sh $(OWNER) -m 0555 -b .OLD *************** *** 182,184 **** $(NEWSBIN)/innwatch: innwatch ; $(COPY_XPRI) $? $@ - $(NEWSBIN)/logwatch: logwatch ; $(COPY_XPRI) $? $@ $(PATH_SHELLVARS): innshellvars ; $(COPY_RPRI) $? $@ --- 190,191 ---- *************** *** 198,200 **** ## Get files from the samples directory. ! COPY = @sh ./getsafe.sh checkgroups: ../samples/checkgroups ; $(COPY) $? $@ --- 205,207 ---- ## Get files from the samples directory. ! COPY = @$(SHELL) ./getsafe.sh checkgroups: ../samples/checkgroups ; $(COPY) $? $@ *************** *** 215,217 **** innshellvars: ../samples/innshellvars ; $(COPY) $? $@ - logwatch: ../samples/logwatch ; $(COPY) $? $@ makegroup: ../samples/makegroup ; $(COPY) $? $@ --- 222,223 ---- Index: syslog/syslog.c =================================================================== RCS file: syslog/RCS/syslog.c,v retrieving revision 1.9 diff -c1 -r1.9 syslog/syslog.c *** 1.9 1993/01/29 16:52:34 --- syslog/syslog.c 1993/03/18 21:05:11 *************** *** 1,2 **** ! /* $Revision: 1.9 $ ** Modified by Rich $alz to be more portable to older --- 1,2 ---- ! /* $Revision: 1.10 $ ** Modified by Rich $alz to be more portable to older *************** *** 56,60 **** #include ! #if !defined(INET_SYSLOG) #include ! #endif /* !defined(INET_SYSLOG) */ --- 56,60 ---- #include ! #if defined(INET_SYSLOG) #include ! #endif /* defined(INET_SYSLOG) */ Index: syslog/syslog.conf =================================================================== RCS file: syslog/RCS/syslog.conf,v retrieving revision 1.4 diff -c1 -r1.4 syslog/syslog.conf *** 1.4 1992/07/24 22:04:29 --- syslog/syslog.conf 1993/03/18 21:05:11 *************** *** 1,2 **** ! ## $Header: /usr/local/src/inn/syslog/RCS/syslog.conf,v 1.4 1992/07/24 22:04:29 rsalz Exp $ ## Sample syslog.conf file for folks not used to the new syslog. --- 1,2 ---- ! ## $Header: /usr/local/src/inn/syslog/RCS/syslog.conf,v 1.5 1993/03/18 21:05:11 rsalz Exp $ ## Sample syslog.conf file for folks not used to the new syslog. *************** *** 15,21 **** ## Note that each level includes all of the above it. ! ## =()@/news.crit>()= ! news.crit /var/log/news/news.crit ! ## =()@/news.err>()= ! news.err /var/log/news/news.err ! ## =()@/news.notice>()= ! news.notice /var/log/news/news.notice --- 15,21 ---- ## Note that each level includes all of the above it. ! ## =()@/news.crit>()= ! news.crit /var/log/news/news.crit ! ## =()@/news.err>()= ! news.err /var/log/news/news.err ! ## =()@/news.notice>()= ! news.notice /var/log/news/news.notice