diff options
author | Michael G. Schwern <schwern@pobox.com> | 2001-09-05 11:58:21 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-05 23:16:50 +0000 |
commit | 30c4d17dfae4455bcaa451862697c332eb722d09 (patch) | |
tree | c706ef94052a3ac8df8f61fa5a41d260523bbde7 | |
parent | fa8e8936010bb1bdcbe001d0297ba7995b127cd5 (diff) | |
download | perl-30c4d17dfae4455bcaa451862697c332eb722d09.tar.gz |
(Retracted by #11908)
Subject: [PATCH] Re: [PATCH lib/File/Find.pm lib/File/Find/taint.t] Fixing those damned taint tests
Message-ID: <20010905155821.I632@blackrider>
p4raw-id: //depot/perl@11898
-rw-r--r-- | lib/File/Find.pm | 2 | ||||
-rw-r--r-- | lib/File/Find/taint.t | 18 |
2 files changed, 5 insertions, 15 deletions
diff --git a/lib/File/Find.pm b/lib/File/Find.pm index eb4b2dee28..bfcbcfd008 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -475,7 +475,7 @@ sub _find_opt { $pre_process, $post_process, $dangling_symlinks); local($dir, $name, $fullname, $prune); - my $cwd = $wanted->{bydepth} ? Cwd::fastcwd() : Cwd::cwd(); + my $cwd = $wanted->{bydepth} ? Cwd::fastcwd() : Cwd::getcwd(); my $cwd_untainted = $cwd; my $check_t_cwd = 1; $wanted_callback = $wanted->{wanted}; diff --git a/lib/File/Find/taint.t b/lib/File/Find/taint.t index e4a292be14..3d7e2367bc 100644 --- a/lib/File/Find/taint.t +++ b/lib/File/Find/taint.t @@ -44,8 +44,6 @@ use File::Spec; use Cwd; -my $NonTaintedCwd = $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'os2'; - cleanup(); find({wanted => sub { print "ok 1\n" if $_ eq 'commonsense.t'; }, @@ -333,12 +331,8 @@ eval {File::Find::find( {wanted => \&simple_wanted, untaint => 1, print "# $@" if $@; #$^D = 8; -if ($NonTaintedCwd) { - Skip("$^O does not taint cwd"); - } -else { - Check( $@ =~ m|insecure cwd| ); -} +Check( $@ =~ m|insecure cwd| ); + chdir($cwd_untainted); @@ -406,12 +400,8 @@ if ( $symlink_exists ) { eval {File::Find::find( {wanted => \&simple_wanted, untaint => 1, untaint_skip => 1, untaint_pattern => qr|^(NO_MATCH)$|}, topdir('fa') );}; - if ($NonTaintedCwd) { - Skip("$^O does not taint cwd"); - } - else { - Check( $@ =~ m|insecure cwd| ); - } + Check( $@ =~ m|insecure cwd| ); + chdir($cwd_untainted); } |