Subject: | pl_file_ok() method to execute perl doesn't work under taint mode |
Instead of trying to explain the issue I'll let the IRC conversation I
had with Matt S. Trout speak for itself.
<robinsmidsrod> mst: I had a look in Test::Compile::pl_file_ok() - it
uses my $out = `$^X -cw $file 2>&1`;
<mst> oh wow
<mst> that's completely broken
<robinsmidsrod> mst: how else would you check if your script compiles
without letting your current perl environment possibly clobber the test?
<mst> that's -ish- fine but it'll fail to work under taint for e.g.
<mst> you need to do something like
<mst> system($^X, (map { "-I$_" } split ':', $ENV{PERL5LIB}), '-c', $file);
<robinsmidsrod> maybe you should file a bug report on Test::Compile ;)
<mst> maybe you should, since you're the one using it :)
<robinsmidsrod> mst: well, I don't know how to quite articulate why that
piece of code is broken
<mst> make one of your scripts to #!perl -T
<mst> that loads a module
<mst> watch it blow up