News for hackers. Stuff that matters.
Re:How do I prevent accidental rm -rf /*? by mahyarm on Saturday December 03, 2011 @03:39PM (#3308748)
Create a version of rm that detects if you try to delete the root filesystem, deny it, and makes you put a --really-delete-filesystem-root flag to do so.
Re:How do I prevent accidental rm -rf /*? by sliverstorm on Saturday December 03, 2011 @03:55PM (#3308784)
It does seem like this would be appropriate. All *nix systems share the desire to not accidentally rm -rf /, and it should be easy to check for inside rm.
Re:How do I prevent accidental rm -rf /*? by Dylan16807 on Saturday December 03, 2011 @07:35PM (#3309399)
There's already a flag to preserve /, but that won't help you with /*.
Re:How do I prevent accidental rm -rf /*? by mahyarm on Monday December 05, 2011 @12:00AM (#3313171)
a flag you have to type all the time, or a default that you have to flag out? You can write code to detect /* too.
Re:How do I prevent accidental rm -rf /*? by Dylan16807 on Monday December 05, 2011 @01:24AM (#3313438)
It might be default in some distros but there is no reason not to put it in an alias. The point is that it's already there and you don't have to modify your rm binary.

And how can you detect /* if the shell expands it?