|There's more than one way to do things|
Re^2: magic-diamond <> behavior -- WHAT?!by repellent (Priest)
|on Oct 30, 2008 at 00:17 UTC||Need Help??|
Allowing arbitrary execution of shell commands is a cardinal sin in security. Not only that, the magic-diamond does it implicitly. This goes beyond the realm of making "easy things easy, and hard things possible". This is a security-hole, IMHO.
Sure, the current magic makes it great for some useful (albeit uncommon) operation that you would induce by naming your ARGVs (most likely, filenames) in a certain special way. But consider the more common usage of the diamond: to write filters.
For example, would you ever expect the following to execute shell commands? Currently, it can.
I certainly don't. I see this as a read-only operation that prints to STDOUT, and I'd like to be able to assume so.
Does this mean I have to put in effort now to ensure * does not contain any magic, just because I'd like to do the common unmagical operation of reading the files? "Magic open" is too dangerous "a form of easy".
Let's lessen that impact -- the security and robustness benefits will exceed the gains of the obscure magic. Just my opinion.
P/S - Doesn't it seem ridiculous to have ARGV::readonly instead of the inverse-situation of having (the fictional) ARGV::magical?