3 ms·
This is absolutely right. And I'd definitely much rather be able to do dangerous things if I want to, than be told that I need to be protected from them. I do
by dejawu 10y ago
This is absolutely right.
And I'd definitely much rather be able to do dangerous things if I want to, than be told that I need to be protected from them. I do appreciate that rm -rf requires "--no-preserve-root" for that extra level of certainty, but the author of the OP should not be surprised at what happened.
- Houshalter 10y agoThat's fine until 4chan starts distributing images telling people to run this cool command to speed up their computer or something stupid. Ala delete system 32. They will have to lock this down like they did with system 32. Users do need to be protected from their own stupidity.
- Zardoz84 10y agoMan, you remember how do a TriForce?
- userbinator 10y agoUsers do need to be protected from their own stupidity. I think they definitely don't; instead, they need to learn from it. Mollycoddling them will only encourage such stupidity and help it proliferate. If taking a few seconds to search online for more information is beyond their ability, then they deserve everything that happens to them.
- Houshalter 10y agoLook see my above comment. There's no need to downvote me, I'm just making a prediction based on a very similar situation that happened in the past exactly the way I describe. Whether or not users "need" to be protected from stupidity is an opinion of course. But it's in Microsoft's interest to protect their users, and users want to be protected. So who is to say they are wrong to do so? I find your assertion that the world would be a better place if more people made serious mistakes, really hard to believe. A 10 year old ruining his parents computer might teach him a lesson. But how much does he gain from that lesson, really? And at what cost? Would you personally help distribute malicious advice memes, if you really believe this is a good thing?
- JoshTriplett 10y agoRunning a random shell command from the Internet without understanding it can do any number of terrible things; removing all your files and making your system unbootable is not the worst that could happen. --no-preserve-root seems like a sufficient safeguard here.
- Houshalter 10y agoI'm just making predictions. That this will become a malicious advice meme. That lots of people will lose all their files over it. And that microsoft will probably disable it. This exact thing happened with system32. And deleting a system file somehow seems much more obviously dangerous than entering a command you don't understand. "rm" looks pretty harmless, and someone could come up with a backronym that even makes it seem sensible. In fact I wonder if this is the reason pasting into console is disabled, or at least hard to figure out, on Windows.
- mafuy 10y agoWhy do you think this is the reason system32 was protected? I think it was simply protected for the same reason the program files folder was, which is security. Not to prevent user mistakes.
- Houshalter 10y agoNo, deleting system files was only disabled on the user interface. You could still do it with a bat script or the windows api. They also got rid of deltree, which is the Windows equivalent of rm -rf, and was abused in a similar way.
- Oletros 10y agoIf an user has the Linux subsystem installed, that user knows what rm -rf does
- Houshalter 10y agoI thought they were planning on making it universal.
- JoshTriplett 10y agoIn particular, the underlying translation layer can't prevent this without completely breaking the ability to operate on Windows files from the Linux compatibility subsystem. "rm -rf" just recurses through the directory tree and calls unlink() on every file and rmdir() on every directory. Making rmdir() refuse to work on /mnt/c wouldn't help; by the time that syscall occurs, rm has removed every other file and directory. "find / -delete" would have the same effect. And if you prevent unlink() or rmdir() from working on files within /mnt/c or other Windows drives, you would not only break the ability to do normal file management with rm or other Linux tools; you'd also break every application that creates and removes temporary files, or otherwise manages files programmatically. You couldn't, for instance, use "git checkout", because that unlinks files and rmdirs directories present in the current HEAD but not present in the new target to check out. rm (without --no-preserve-root) specifically checks for an attempt to remove / before it starts recursing. You could potentially improve rm to preserve a few more directories by default; some tools exist to do exactly that, such as safe-rm. rm's default --preserve-root behavior mostly exists to help catch cases like "rm -rf $VAR/$VAR2", which with VAR and VAR2 unset would turn into "rm -rf /". (Personally, I'd like to have rm add and default to a --preserve-home option too, to catch things like "rm -rf $HOME/$VAR" or "rm -rf ~/$VAR" or "rm -rf ~ /foo".)