Seems like a big overhead. You should be checking you own variables for tainted'ness.
From the perlfaq7:
Here's an example (which doesn't use any system calls, because the kil
+l() is given no processes to signal).
Tainting occurs if you try and pass any uncontrolled information to the system interpreter. The use of
kill 0 attempts to trick the perl interpreter into thinking that you are passing sensitive information (@_) to the system. If tainting fails, it will cause the script to halt execution right then and there -- so the block is wrapped in an eval block. If the data is safe, the
join('',@_),kill 0; will not die and the block will return the last value of "1" signifying that the data is not tainted, this is negated with the "!" and returned as the value. If the data was tainted, the block would haved died and the eval would return undef.
That said, this might be a nice generic way to do it, but really you should be checking anything that you are passing to the interpreter yourself (using regex or other methods). This way you can already be preparing passed information for safe passage to the system level.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.