6 ms·
I think the alternative being suggested is that rm shouldn't accept a string that magically can reference anything in the filesystem... In our capability-based
by thinkmoore 9y ago
I think the alternative being suggested is that rm shouldn't accept a string that magically can reference anything in the filesystem...
In our capability-based shell scripting language Shill (shill-lang.org) for example, you could prevent this sort of bug by giving the script a capability for just the diaspora_home directory, and deriving the child directories from that capability. (Of course, you still need to make sure you pass in the right directory in the first place.)
- tremon 9y agoI think the alternative being suggested is that rm shouldn't accept a string that magically can reference anything in the filesystem... That suggestion fails to grasp the basics of Unix shells however: parameter expansion as well as globbing is performed by the shell, rm "sees" nothing but fully-expanded paths.
- rwmj 9y agoCoreutils 'rm' has a --preserve-root option (the default) which does exactly this. https://www.gnu.org/software/coreutils/manual/html_node/Treating-_002f-specially.html https://www.gnu.org/software/coreutils/manual/html_node/Trea...