On Sun, Sep 23, 2001 at 02:39:32AM -0400, Michael G Schwern wrote:
> I just ran the taint tests. It looks like VMS's %ENV is *not* tainted.
>
> $ perl -"Twle" "my $foo = (values %ENV)[0]; open(FILE, qq{>$foo})"
> Name "main::FILE" used only once: possible typo at -e line 1.
>
> Whereas on Unix that would cause a taint error.
>
> I know environment variables are a bit different on VMS than Unix. Is
> there any reason you wouldn't want %ENV to be tainted?
This adds an explicit test to make sure %ENV is tainted. It will
fail.
--- t/op/taint.t 2001/09/23 06:30:06 1.1
+++ t/op/taint.t 2001/09/23 06:49:07
@@ -109,7 +109,7 @@
close PROG;
my $echo = "$Invoke_Perl $ECHO";
-print "1..175\n";
+print "1..176\n";
# First, let's make sure that Perl is checking the dangerous
# environment variables. Maybe they aren't set yet, so we'll
@@ -825,7 +825,8 @@
use warnings;
- $SIG{__WARN__} = sub { print "not " };
+ my $saw_warn = 0;
+ $SIG{__WARN__} = sub { $saw_warn++ };
sub fmi {
my $divnum = shift()/1;
@@ -836,7 +837,7 @@
fmi(37);
fmi(248);
- print "ok 174\n";
+ print !$saw_warn ? "ok 175\n" : "not ok 175\n"
}
@@ -871,4 +872,5 @@
}
-
+my $env_val = (values %ENV)[0];
+print tainted($env_val) ? "ok 176\n" : "not ok 176\n";
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Maybe they hooked you up with one of those ass-making magazines.
-- brian d. foy as misheard by Michael G Schwern