Protection from the dreaded "rm -fr /"

soralx at cydem.org soralx at cydem.org
Sat Oct 2 15:11:19 PDT 2004


> > We could add a new flag "srunlnk", or maybe even "srm-r".  The "rm"
> > command will always have to stat() the file it is given (just to
> > see if it is a directory), so it could check to see if this flag
> > is turned on.  If it is turned on, then 'rm' could refuse to honor
> > any '-rf' request on that directory.

Why not to just add a flag to 'rm'? For example, `rm -rf /` or 
`cd; rm -rf .././` will fail, but `rm -rF /` will succeed.

Timestamp: 0x415F2702
[SorAlx]  http://cydem.org.ua/
ridin' VN1500-B2



More information about the freebsd-hackers mailing list