gozer 2004/09/20 22:39:23
Modified: perl-framework/Apache-Test Changes perl-framework/Apache-Test/lib/Apache TestConfig.pm Log: In open_cmd, sanitize PATH instead of clearing it Revision Changes Path 1.168 +2 -0 httpd-test/perl-framework/Apache-Test/Changes Index: Changes =================================================================== RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v retrieving revision 1.167 retrieving revision 1.168 diff -u -r1.167 -r1.168 --- Changes 17 Sep 2004 18:24:14 -0000 1.167 +++ Changes 21 Sep 2004 05:39:23 -0000 1.168 @@ -8,6 +8,8 @@ =item 1.14-dev +In open_cmd, sanitize PATH instead of clearing it [Gozer] + Allow / \ and \\ path delimiters in SKIP file [Markus Wichitill <[EMAIL PROTECTED]>] 1.246 +6 -1 httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm Index: TestConfig.pm =================================================================== RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v retrieving revision 1.245 retrieving revision 1.246 diff -u -r1.245 -r1.246 --- TestConfig.pm 16 Sep 2004 21:36:13 -0000 1.245 +++ TestConfig.pm 21 Sep 2004 05:39:23 -0000 1.246 @@ -1013,8 +1013,13 @@ sub open_cmd { my($self, $cmd) = @_; # untaint some %ENV fields - local @ENV{ qw(PATH IFS CDPATH ENV BASH_ENV) }; + local @ENV{ qw(IFS CDPATH ENV BASH_ENV) }; + # Temporarly untaint PATH + (local $ENV{PATH}) = ( $ENV{PATH} =~ /(.*)/ ); + # -T doesn't like . in the PATH + $ENV{PATH} =~ s#(^|:)\.[/\\]?(:|$)##; + my $handle = Symbol::gensym(); open $handle, "$cmd|" or die "$cmd failed: $!";