summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Guy <mjtg@cam.ac.uk>2001-06-29 15:56:49 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-29 13:07:57 +0000
commita1b073b760deba4c7afc6baaa2225bd385906390 (patch)
treeecbf35cecf05bc302d03b9e7bf7df94ffd0bd2ca /lib
parent0661e9a4f58f56c330261e7c3fa4dc38e42204b1 (diff)
downloadperl-a1b073b760deba4c7afc6baaa2225bd385906390.tar.gz
Re: perl@10967, File::Find, and Cwd
Message-Id: <E15FylN-0004LT-00@draco.cus.cam.ac.uk> p4raw-id: //depot/perl@11025
Diffstat (limited to 'lib')
-rw-r--r--lib/File/Find/taint.t10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/File/Find/taint.t b/lib/File/Find/taint.t
index cdd75de7d8..1e1258e184 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';