3 ms·
One of the advantages of using Docker! You can safely run this code multiple times and play with it without affecting your machine.
by csomar 9y ago
One of the advantages of using Docker! You can safely run this code multiple times and play with it without affecting your machine.
- tyingq 9y agoSure, 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.
- dmix 9y agoI 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.
- tyingq 9y agoGnu rm has built in protections. Not sure that's the case on OSX, Linux distributions that use busybox, etc.
- jwilk 9y agoI usually use "cowsay" for demonstrating that arbitrary code execution is possible. Less destructive, and more entertaining when someone actually tries to run the code. :-)
- rcthompson 9y agoIf 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.
- andrewflnr 9y agoJust because it's a harsh, cruel world doesn't mean you should be cruel.
- nurettin 9y agoIt doesn't mean he should be cruel, it just means he is statistically more likely to be cruel.
- rcthompson 9y agoI 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.
- nv-vn 9y agoDo you use Docker to run literally every piece of code though?