Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Oct 2004 22:28:57 +0400 (MSD)
From:      Dmitry Morozovsky <marck@rinet.ru>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Protection from the dreaded "rm -fr /"
Message-ID:  <20041003222523.J9166@woozle.rinet.ru>
In-Reply-To: <20041003.113739.95785967.imp@bsdimp.com>
References:  <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> <20041003.113739.95785967.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 3 Oct 2004, M. Warner Losh wrote:

[snip]

MWL> rm doesn't have to live in the chroot.  Consider
MWL> 	chroot /some/path/to/a/chroot rm -rf /
MWL> in this case, everything under the /some/path/to/a/chroot would be
MWL> removed.  However, the rm that's running is outside of the chroot.

Not to be too nit-picking, but this is not true, as far as I can understand
chroot(8) and chroot(2) ;-)

However, since rm is usually statically linked and/or all needed code segments
are referenced during rm work are loaded/referenced, this operation finishes
successfully (just checked on 4-STABLE and -CURRENT).

... and no, I do *NOT* want to participate in this bikesched color discussion!
;-P


Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041003222523.J9166>