develooper Front page | perl.perl5.porters | Postings from October 2005

[PATCH] Todo - fix tainting checks #1

Thread Next
From:
Steven Schubiger
Date:
October 3, 2005 16:19
Subject:
[PATCH] Todo - fix tainting checks #1
Message ID:
20051003202107.GA32026@accognoscere.homeunix.org
Many warnings emitted during 'make test.taintwarn' seem
to have $^X involved often to determine the Perl executable. 
Is it reasonable to change it to a static default, such as 
'../perl' while we reside in the chdired 't' or will that 
introduce some danger to code reliability?

Some code seems rather difficult to untaint, though.

Patch in question attached.

--- perl-blead/t/base/term.t	Mon Oct  3 22:02:10 2005
+++ perl-local/t/base/term.t	Mon Oct  3 22:03:08 2005
@@ -18,10 +18,12 @@
 else {print "not ok 1\n";}
 
 # check `` processing
-
-$x = `$^X -le "print 'hi there'"`;
-if ($x eq "hi there\n") {print "ok 2\n";} else {print "not ok 2\n";}
-
+{
+    local %ENV; 
+    $ENV{PATH} = '';
+    $x = `../perl -le "print 'hi there'"`;
+    if ($x eq "hi there\n") {print "ok 2\n";} else {print "not ok 2\n";}
+}
 # check $#array
 
 $x[0] = 'foo';


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About