🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.admin
Article #4075

Bug in insertbatch, and fix

#4075
From: howard
Date: Tue, 10 Feb 1987 23:08
38 lines
2052 bytes
We just got USENET running at our site.  Every time insertbatch
was run manually it worked fine.  Every time it was run from
/usr/lib/crontab, it deleted all the new news without adding the
data to the appropriate directories.  I finally tracked down the
problem and thought someone should know.

There is a serious bug in our version of insertbatch (we got it
from intelca!mipos3; it may be the standard version or not, I don't
know) which is triggered when the default path for user root does not
include the directory where rnews resides.  The effect is that
insertbatch deletes all NEWSBATCH files without unbatching them!

Here's the distributed code (yes I KNOW this is probably copyrighted
but I don't know how else to explain this, and anyway it's WRONG!).

	for i in /usr/spool/newsbatch/decnet/NEWSBATCH.*; do
	    rnews < $i
	    rm $i
	done

If rnews is not found, that DOES NOT PREVENT THE rm FROM EXECUTING!
A correct version might be:

	for i in /usr/spool/newsbatch/decnet/NEWSBATCH.*; do
	    rnews < $i  &&  rm $i
	done
	# modified by Howard A. Landman, 10 Feb 1987, to add '&&'.

In this script, if rnews is not found, the rm will not execute.
Insertbatch will still fail, but you won't lose any news.

I hereby place this fix into the public domain; note that this does not
release you from the copyright (if any) on the original code.
-- 

	Howard A. Landman
	...!intelca!mipos3!cpocd2!howard
Technical Details
Message-ID: <413@cpocd2.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!sri-unix!hplabs!cae780!amdcad!amd!intelca!mipos3!cpocd2!howard

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!sri-unix!hplabs!cae780!amdcad!amd!intelca!mipos3!cpocd2!howard
From: howard@cpocd2.UUCP
Newsgroups: news.admin,news.software.b,news.sysadmin
Subject: Bug in insertbatch, and fix
Message-ID: <413@cpocd2.UUCP>
Date: Tue, 10-Feb-87 18:08:57 EST
Article-I.D.: cpocd2.413
Posted: Tue Feb 10 18:08:57 1987
Date-Received: Thu, 12-Feb-87 07:27:02 EST
Reply-To: howard@cpocd2.UUCP (Howard Landman)
Organization: Intel Corp. ASIC Services Organization, Chandler AZ
Lines: 38
Keywords: insertbatch bug fix