Newsgroups: comp.unix.admin Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!menudo.uh.edu!buster!rli From: rli@buster.stafford.tx.us (Buster Irby) Subject: Re: Help - we lost all our files! Message-ID: <1991Jul01.030750.717@buster.stafford.tx.us> Reply-To: rli@buster.stafford.tx.us Organization: Buster irby References: <1347@escob1.UUCP> <1991Jun30.145153.27975@buster.stafford.tx.us> <14158@mentor.cc.purdue.edu> Date: Mon, 01 Jul 1991 03:07:50 GMT Lines: 22 asg@sage.cc.purdue.edu (The Grand Master) writes: >In article <1991Jun30.145153.27975@buster.stafford.tx.us> rli@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.