Hacker News new | past | comments | ask | show | jobs | submit login

One of the advantages of using Docker! You can safely run this code multiple times and play with it without affecting your machine.



Sure, but you could also replace "rm -rf /" with "id" or something else non destructive. Somebody is going to copy paste that snippet and have a bad day.


If someone blindly copies, pastes, compiles, and runs a random snippet of code from the internet that is specifically described as producing weird and unexpected behavior, then they deserve the harsh lesson they're about to learn.


Just because it's a harsh, cruel world doesn't mean you should be cruel.


I normally have some measure of sympathy for people who blindly run code that is unexplained or under-explained (e.g. the many "curl | bash" installers). But blindly running code that is specifically called out as having weird and unexpected behavior is like driving your car right through the bright yellow "bridge out" sign that's blocking the bridge.


It doesn't mean he should be cruel, it just means he is statistically more likely to be cruel.


I usually use "cowsay" for demonstrating that arbitrary code execution is possible. Less destructive, and more entertaining when someone actually tries to run the code. :-)


I believe "rm -rf /" illustrates the point quite well, better than id. I'm more in the common sense is more common than people give credit and in the situations where that is not the case then rm has built-in protections.

It literally says:

> That is, the compiled program executes “rm -rf /”

The next line following the code. It's not tricking anyone.


Gnu rm has built in protections. Not sure that's the case on OSX, Linux distributions that use busybox, etc.


Do you use Docker to run literally every piece of code though?


Thanks for whoever down-voted but yes, I do.


From the HN guidelines:

Please don't comment about the voting on comments. It never does any good, and it makes boring reading.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: