Re: Directory name problem...

Brandon S. Allbery KF8NH (allbery@kf8nh.apk.net)
Sun, 25 Oct 1998 15:17:36 -0500


This whole thread seems rather more appropriate for alt.sysadmin.recovery....

In message <Pine.LNX.3.96.981025194244.10779B-100000@ps.cus.umist.ac.uk>,
Riley
Williams writes:
+-----
| >> % Q> #!/bin/sh
| >> % Q> XYZZY="`find / -name core`"
| >> % Q> for LOOP in `find $XYZZY | sort -ru` ; do
| >> % Q> rm -fr $LOOP
| >> % Q> done
|
| > You have GOT to be kidding me!?!?!
| Crazy as it sounds, nope...
+--->8

It's only a matter of time before that system is toast. The only question
is whether someone decides to take advantage of the giveaway of root
permissions for a while before toasting it.

(Oh, Tim --- why he sorted it: if you try it when there's a path like
`/foo/core/bar/baz/core', it'll complain because /foo/core will get `rm
-rf'-ed and then later it will try to `rm -rf /foo/core/bar/baz/core'. I
can think of another `find' option or two that would make more sense as an
alternative, if he really wants to include directories named `core'.)

I'll say this much: if I caught anyone running this on one of ECE's
supported boxes, they'd gain a few broken fingers and quite possibly *lose*
their accounts in ECE. (Yeah, some of these folks get --- and need ---
root.) Oy.

-- 
brandon s. allbery	[os/2][linux][solaris][japh]	 allbery@kf8nh.apk.net
system administrator	     [WAY too many hats]	   allbery@ece.cmu.edu
electrical and computer engineering					 KF8NH
carnegie mellon university

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/