Change 11898 by jhi@alpha on 2001/09/05 23:16:50

        Subject: [PATCH] Re: [PATCH lib/File/Find.pm lib/File/Find/taint.t] Fixing 
those damned taint tests
        From: Michael G Schwern <[EMAIL PROTECTED]>
        Date: Wed, 5 Sep 2001 15:58:21 -0400
        Message-ID: <20010905155821.I632@blackrider>

Affected files ...

... //depot/perl/lib/File/Find.pm#47 edit
... //depot/perl/lib/File/Find/taint.t#10 edit

Differences ...

==== //depot/perl/lib/File/Find.pm#47 (text) ====
Index: perl/lib/File/Find.pm
--- perl/lib/File/Find.pm.~1~   Wed Sep  5 17:30:07 2001
+++ perl/lib/File/Find.pm       Wed Sep  5 17:30:07 2001
@@ -475,7 +475,7 @@
        $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};

==== //depot/perl/lib/File/Find/taint.t#10 (text) ====
Index: perl/lib/File/Find/taint.t
--- perl/lib/File/Find/taint.t.~1~      Wed Sep  5 17:30:07 2001
+++ perl/lib/File/Find/taint.t  Wed Sep  5 17:30:07 2001
@@ -44,8 +44,6 @@
 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 @@
 
 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 @@
     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);
 } 
 
End of Patch.

Reply via email to