X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Ftaint.t;h=7c83019e7cfc5f0e0f07a08fa8c182b41a63dd49;hb=0bc0ad857ef0ded50c72fba42503c958a1579a5a;hp=4e75c54d2668e1e4c546ad51ac6a7cb4ad7e24e8;hpb=c212f17ff77261a4792bfbd46a1471e8c17417e0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/taint.t b/t/op/taint.t index 4e75c54..7c83019 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -123,7 +123,7 @@ print PROG 'print "@ARGV\n"', "\n"; close PROG; my $echo = "$Invoke_Perl $ECHO"; -print "1..179\n"; +print "1..183\n"; # First, let's make sure that Perl is checking the dangerous # environment variables. Maybe they aren't set yet, so we'll @@ -577,7 +577,7 @@ else { # Test for system/library calls returning string data of dubious origin. { # No reliable %Config check for getpw* - if (eval { setpwent(); getpwent(); 1 }) { + if (eval { setpwent(); getpwent() }) { setpwent(); my @getpwent = getpwent(); die "getpwent: $!\n" unless (@getpwent); @@ -906,3 +906,26 @@ ok( ${^TAINT}, '$^TAINT is not assignable' ); ok( $@ =~ /^Modification of a read-only value attempted/, 'Assigning to ${^TAINT} fails' ); +{ + # bug 20011111.105 + + my $re1 = qr/x$TAINT/; + test 180, tainted $re1; + + my $re2 = qr/^$re1\z/; + test 181, tainted $re2; + + my $re3 = "$re2"; + test 182, tainted $re3; +} + +if ($Is_MSWin32) { + print "ok 183 # Skipped: system {} has different semantics\n"; +} +else +{ + # bug 20010221.005 + local $ENV{PATH} .= $TAINT; + eval { system { "echo" } "/arg0", "arg1" }; + test 183, $@ =~ /^Insecure \$ENV/; +}