From: bsh on
dkco...(a)panix.com (David Combs) wrote:
> bsh  <brian_hi...(a)rocketmail.com> wrote:
> > Sven Mascheck <masch...(a)email.invalid> wrote:
> > > Houghi wrote:
> > > ...

Amusingly, after some research completely unrelated to this
thread, I happened to come across the following trivia on
John Beck's blog, a notable Solaris networking guru. He
states on his blog at:

http://blogs.sun.com/jbeck/category/General

.... that he finagled the local POSIX dweebs to patch
rm(1) under Solaris 10 (build 36+) to disallow the
construct "-rf /".

# /bin/rm -rf /
rm of / is not allowed
#

You will probably, in context of what I have said about the
matter thus so far, be surprised that I think this "fix" quite
wrong-headed, insofar as it violates Rule 3 of my Three
Laws of Language Design -- even if what we are talking
about here is system administration Best Practises.
I have to nevertheless add that the rationale he gives
is compelling.

To wit:

(1) What _should_ work, _will_ work!
(2) Provide _functionality_, not _features_, at well-defined
levels of abstraction.
(3) In context of the above, the language writer should never,
_ever_ tell the programmer what he can or can't do.

=Brian
From: Kenny McCormack on
In article <a093269f-6c6d-4cde-b5fc-c7babd742516(a)v29g2000prb.googlegroups.com>,
bsh <brian_hiles(a)rocketmail.com> wrote:
....
>... that he finagled the local POSIX dweebs to patch
>rm(1) under Solaris 10 (build 36+) to disallow the
>construct "-rf /".
>
># /bin/rm -rf /
>rm of / is not allowed
>#

Wrong error message. It should say: Please use mkfs instead.

Incidentally, what's really insidious about this "rm -rf /" command is
not so much that it trashes the local system (*), but that it trashes any
mounted (NFS or Samba) other systems (**). The nice thing about the "mkfs"
alternative is that it only trashes the system disk. And there actually
are times when reformatting the disk is desirable.

----------------------------------------------------------------------------
(*) To be fully explicit here, I should have said "the local system disk
as well as any (local) mounted disks".

(**) To be fully explicit here, I should have said "to which we have
write/delete rights".

--
(This discussion group is about C, ...)

Wrong. It is only OCCASIONALLY a discussion group
about C; mostly, like most "discussion" groups, it is
off-topic Rorsharch [sic] revelations of the childhood
traumas of the participants...