[Bps-public-commit] r18544 - Shipwright/trunk/lib/Shipwright/Util

jesse at bestpractical.com jesse at bestpractical.com
Mon Feb 23 20:59:20 EST 2009


Author: jesse
Date: Mon Feb 23 20:59:19 2009
New Revision: 18544

Modified:
   Shipwright/trunk/lib/Shipwright/Util/CleanINC.pm

Log:
* Untaint everything under the sun, so that cpan modules like TAP::Harness which expect to be tested under a 'pristine' Perl don't flip out when tested

Modified: Shipwright/trunk/lib/Shipwright/Util/CleanINC.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Util/CleanINC.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Util/CleanINC.pm	Mon Feb 23 20:59:19 2009
@@ -14,7 +14,7 @@
     my @inc_libs = grep {/inc$/}  split( /:/,($ENV{'PERL5LIB'} ||''));
     # if the libs are explicitly specified, don't pull them from @INC
     my @new_base_inc = grep { !$skip_lib_path{$_}++ } (  @explicit_libs, @INC, at inc_libs);
-    @INC = ( @new_base_inc, $Config::Config{privlibexp}, $Config::Config{archlibexp});
+    @INC = map { /^(.*)$/ ; $1 }  ( @new_base_inc, $Config::Config{privlibexp}, $Config::Config{archlibexp});
 }
 
 
@@ -33,11 +33,10 @@
         local $ENV{PERL5DB} = '';
         local $ENV{PERL5OPT} = '';
         local $ENV{PERL5ENV} = '';
-
-
-        my $perl =  $^X;
+        local $ENV{PATH} = $1 if $ENV{PATH} =~ /^(.*)$/;
+        my $perl =  $1 if $^X =~ /^(.*)$/;
         # Avoid using -l for the benefit of Perl 6
-        chomp( @inc = `$perl -e "print join qq[\\n], \@INC, q[]"` );
+        chomp( @inc = map { /^(.*)$/ && $1 }  `$perl -e "print join qq[\\n], \@INC, q[]"` );
         return @inc;
     }
 }



More information about the Bps-public-commit mailing list