Help - we lost all our files!

Buster Irby rli at buster.stafford.tx.us
Mon Jul 1 13:07:50 AEST 1991


asg at sage.cc.purdue.edu (The Grand Master) writes:

>In article <1991Jun30.145153.27975 at buster.stafford.tx.us> rli at buster.stafford.tx.us writes:
>%'/'.  If you would take a more defensive posture and always cd to
>%one of the tmp directories, this could not have happened.
>%
>%45 3 * * * cd /tmp; find /tmp/* /usr/tmp/* -mtime +1 -print | xargs rm -r
>%
>%In this case, the worst that would have happened is it would have 
>%erased everything in /tmp.
>Not.
>what if I do :
>touch "/tmp/hi .."
>then .. will be passwd to xargs and........

Bruce, ".." from "/tmp" is root, and if you let just anyone on
your system touch the root directory, then a minor bug in xargs
is the least of your problems.  Secondly, ".." is never printed
by find unless you specifically ask for it using the -name
option.  This is a reasonable solution, for those of us who
follow reasonable system maintenance and security precautions.




More information about the Comp.unix.admin mailing list