summaryrefslogtreecommitdiff
path: root/t/op/taint.t
diff options
context:
space:
mode:
authorRick Delaney <rick@consumercontact.com>2002-02-24 06:35:00 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2002-02-24 18:28:31 +0000
commitbbd7eb8a53bc08e89eb3e0f43d60d3871e87f6fa (patch)
tree43027f0ab7e5888e61f0d32226f7a07e9c21fcc4 /t/op/taint.t
parent7f16dd3dd4311e49439b9f212f1519735a88c199 (diff)
downloadperl-bbd7eb8a53bc08e89eb3e0f43d60d3871e87f6fa.tar.gz
Re: taint news
Message-ID: <m3d6yuvnwr.fsf@cs839290-a.mtth.phub.net.cable.rogers.com> p4raw-id: //depot/perl@14853
Diffstat (limited to 't/op/taint.t')
-rwxr-xr-xt/op/taint.t32
1 files changed, 30 insertions, 2 deletions
diff --git a/t/op/taint.t b/t/op/taint.t
index 8591b347e0..b045c493e1 100755
--- a/t/op/taint.t
+++ b/t/op/taint.t
@@ -119,7 +119,7 @@ print PROG 'print "@ARGV\n"', "\n";
close PROG;
my $echo = "$Invoke_Perl $ECHO";
-print "1..183\n";
+print "1..203\n";
# First, let's make sure that Perl is checking the dangerous
# environment variables. Maybe they aren't set yet, so we'll
@@ -837,7 +837,7 @@ else {
use warnings;
- $SIG{__WARN__} = sub { print "not " };
+ local $SIG{__WARN__} = sub { print "not " };
sub fmi {
my $divnum = shift()/1;
@@ -927,3 +927,31 @@ else
eval { system { "echo" } "/arg0", "arg1" };
test 183, $@ =~ /^Insecure \$ENV/;
}
+{
+ # bug 20020208.005 plus some extras
+ # single arg exec/system are tests 80-83
+ use if $] lt '5.009', warnings => FATAL => 'taint';
+ my $err = $] ge '5.009' ? qr/^Insecure dependency/
+ : qr/^Use of tainted arguments/;
+ test 184, eval { exec $TAINT, $TAINT } eq '', 'exec';
+ test 185, $@ =~ $err, $@;
+ test 186, eval { exec $TAINT $TAINT } eq '', 'exec';
+ test 187, $@ =~ $err, $@;
+ test 188, eval { exec $TAINT $TAINT, $TAINT } eq '', 'exec';
+ test 189, $@ =~ $err, $@;
+ test 190, eval { exec $TAINT 'notaint' } eq '', 'exec';
+ test 191, $@ =~ $err, $@;
+ test 192, eval { exec {'notaint'} $TAINT } eq '', 'exec';
+ test 193, $@ =~ $err, $@;
+
+ test 194, eval { system $TAINT, $TAINT } eq '', 'system';
+ test 195, $@ =~ $err, $@;
+ test 196, eval { system $TAINT $TAINT } eq '', 'exec';
+ test 197, $@ =~ $err, $@;
+ test 198, eval { system $TAINT $TAINT, $TAINT } eq '', 'exec';
+ test 199, $@ =~ $err, $@;
+ test 200, eval { system $TAINT 'notaint' } eq '', 'exec';
+ test 201, $@ =~ $err, $@;
+ test 202, eval { system {'notaint'} $TAINT } eq '', 'exec';
+ test 203, $@ =~ $err, $@;
+}