Protection from the dreaded "rm -fr /"

M. Warner Losh imp at bsdimp.com
Sat Oct 2 19:07:53 PDT 2004


In message: <20041003015321.GA3190 at gothmog.gr>
            Giorgos Keramidas <keramida at freebsd.org> writes:
: On 2004-10-02 19:29, "M. Warner Losh" <imp at bsdimp.com> wrote:
: > In message: <20041002210554.GS35869 at seekingfire.com>
: >             Tillman Hodgson <tillman at seekingfire.com> writes:
: > : It'll never work, though, that's the thing. At some point it'll rm
: > : something it itself needs and error out. There isn't a way to use `rm
: > : -rf /` that /doesn't/ result in foot-shooting.
: >
: > No.  You are wrong.  if you rm -rf in a chroot, then it won't result
: > in foot shooting, necessarily, like it would outside a chroot.
: 
: Since a chroot can always be rm -fr deleted from outside the chroot,
: this isn't really a great problem, is it?

You miss the point.

You said it was always a foot-shooting move.  I gave you a concrete
example of where it wasn't a foot-shooting move (or even when you
could use newfs instead).  You reply with a workaround (which may be a
valid way to deal, maybe not).  My point still stands: it isn't always
a foot-shooting move.

It isn't a valid work around if you want to delete the chroot from
inside the chroot...

Warner



More information about the freebsd-hackers mailing list