4 ms·
My first thought on reading the headline was "what Linux still did that in 2015"? I thought I read somewhere years ago that Sun, BSD and GNU rm all had checks i
by smhenderson 8y ago
My first thought on reading the headline was "what Linux still did that in 2015"? I thought I read somewhere years ago that Sun, BSD and GNU rm all had checks in them to spot the / or /* and refuse to run. According to this SE page[1] GNU even has an option to tell rm "no I really do want to blow away my whole root" by using "--no-preserve-root".
Apparently the "fix" only applies to the root user. The article is about a regular user who recursively lost everything he owned starting at /.
Ouch!
[1] https://unix.stackexchange.com/questions/19547/how-far-can-you-go-with-rm-rf-as-root https://unix.stackexchange.com/questions/19547/how-far-can-y...
- AnssiH 8y agoGNU rm only catches "/". The Steam issue was for /* which is expanded by the shell.
- smhenderson 8y agoThat seemed crazy to me so I spun up a VM, took a snapshot and then ran rm -rf /* as root. Sure enough it started nuking everything it could, skipping over only a few things like most of what's in proc, etc... Thanks, it's was interesting to see the difference!