Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

rm -rf /

Using this type of code to show unintended consequences is itself a hotbed of unintended consequences!

Just put in code that prints "pwned" instead of running code that would delete someone's system or home folder.



Do any up-to-date operating systems actually run this without the --no-preserve-root flag?


btw, this would work with slightly older rm from GNU coreutils:

  rm -rf --n /
any GNU long option (getopt_long) for any command can be shortened as much as there isn't any ambiguity. And hence the above (this is fixed in latest GNU coreutils release).


The busybox rm does.


Anyone who would compile and run random code from the internet without thinking about whether it's subtly malicious (let alone overtly destructive) has a lesson to be learned that's probably worth the data on their hard drive. If they don't have backups, that's two lessons.


Agreed. But, that's not a reason for telling people to run code that would delete the entire drive.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: