From: Mike Guy Date: Fri, 29 Jun 2001 14:56:49 +0000 (+0100) Subject: Re: perl@10967, File::Find, and Cwd X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a1b073b760deba4c7afc6baaa2225bd385906390;p=p5sagit%2Fp5-mst-13.2.git Re: perl@10967, File::Find, and Cwd Message-Id: p4raw-id: //depot/perl@11025 --- diff --git a/lib/File/Find/taint.t b/lib/File/Find/taint.t index cdd75de..1e1258e 100644 --- a/lib/File/Find/taint.t +++ b/lib/File/Find/taint.t @@ -24,6 +24,16 @@ else { print "1..27\n"; } use File::Find; use File::Spec; use Cwd; +use Config; + +# Remove insecure directories from PATH +my @path; +my $sep = $Config{path_sep}; +foreach my $dir (split(/$sep/,$ENV{'PATH'})) + { + push(@path,$dir) unless (stat $dir)[2] & 0002; + } +$ENV{'PATH'} = join($sep,@path); my $NonTaintedCwd = $^O eq 'MSWin32' || $^O eq 'cygwin';