fault toleratant shell scripts

Bill Vermillion fp at wjv.com
Mon Mar 15 10:36:04 PST 2004


On Mon, Mar 15, 2004 at 10:16:09AM -0800, Bill Campbell thus spoke:
> On Mon, Mar 15, 2004, Bill Vermillion wrote:
> ...
> >So when the cd /lost+found failed, the following command
> >rm -r * was performed on / with the resultant anguish.

> One of the more interesting bugs I found was on the old Radio
> Shack Model 16 Xenix systems. If one was at the ``/'' directory
> and typed ``lpr *'', the printing routines actually linked
> all the directories under root under /usr/spool/lpd (I may
> have the print command and directory wrong as it's been years
> since I ran Xenix). Needless to say it didn't print very well,
> but if one attempted an ``rm -r /usr/spool/lpd/*'' it removed
> everything on the system. The only workaround I found was to
> rename the print spool directory, and make a new directory.

I've had to recover more than one of those.  But it was more
insidious that you mention above.

You didn't have to be in root directory to do cause the problem,
and it did involve the lpr command.

What it did was link directories in a loop - sort of like a
mobius strip.  As you descend further down you were actually higher
up,  Maybe you could call it recursive linking.

You did NOT have to type   rm -r /usr/spool/lpd/* to nuke the
system.

You could change to /usr/spool and perform rm -r lpd and do the
job, no * neeed, since the -r informed the system you wanted to
remove lpd and all that was under it.

And you didn't remove everything in the system.  Since could could
not remove the directory you were in, the only thing it left
was the /usr/spool/lpd/<whatever> loop as it tried to descend
furhter and further.  It was just like a hoop snake in that
respect.  [If you reember the stories of the hoop snake from your
youth]


Bill

-- 
Bill Vermillion - bv @ wjv . com


More information about the Filepro-list mailing list