diff options
Diffstat (limited to 'lib/Text/ParseWords/taint.t')
-rw-r--r-- | lib/Text/ParseWords/taint.t | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Text/ParseWords/taint.t b/lib/Text/ParseWords/taint.t new file mode 100644 index 0000000000..27f6de50cb --- /dev/null +++ b/lib/Text/ParseWords/taint.t @@ -0,0 +1,23 @@ +#!./perl -Tw +# [perl #33173] shellwords.pl and tainting + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; + require Config; + if ($Config::Config{extensions} !~ /\bList\/Util\b/) { + print "1..0 # Skip: Scalar::Util was not built\n"; + exit 0; + } +} + +use Text::ParseWords qw(shellwords old_shellwords); +use Scalar::Util qw(tainted); + +print "1..2\n"; + +print "not " if grep { not tainted($_) } shellwords("$0$^X"); +print "ok 1\n"; + +print "not " if grep { not tainted($_) } old_shellwords("$0$^X"); +print "ok 2\n"; |