From: Nick Ing-Simmons Date: Fri, 22 Jun 2001 21:19:36 +0000 (+0000) Subject: Skip cwd test on Win32 ??? X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=004cc5080f573783a512f0d3ef678c4e019ac166;p=p5sagit%2Fp5-mst-13.2.git Skip cwd test on Win32 ??? p4raw-id: //depot/perlio@10841 --- diff --git a/lib/File/Find/taint.t b/lib/File/Find/taint.t index 5ee1c3d..65f6f24 100644 --- a/lib/File/Find/taint.t +++ b/lib/File/Find/taint.t @@ -17,6 +17,7 @@ BEGIN { } } + if ( $symlink_exists ) { print "1..45\n"; } else { print "1..27\n"; } @@ -76,12 +77,18 @@ sub Check($) { $case++; if ($_[0]) { print "ok $case\n"; } else { print "not ok $case\n"; } + } sub CheckDie($) { $case++; if ($_[0]) { print "ok $case\n"; } - else { print "not ok $case\n $!\n"; exit 0; } + else { print "not ok $case\n"; exit 0; } +} + +sub Skip($) { + $case++; + print "ok $case # skipped: ",$_[0],"\n"; } sub touch { @@ -235,7 +242,7 @@ sub file_path_name { -MkDir( dir_path('for_find'), 0770 ); +MkDir( dir_path('for_find'), 0777 ); CheckDie(chdir( dir_path('for_find'))); $cwd = cwd(); # save cwd @@ -305,14 +312,21 @@ chdir($cwd_untainted); # untaint pattern doesn't match, should die when we chdir to cwd -print "# check untaint_skip (no follow)\n"; +print "# check untaint_skip (No follow)\n"; undef $@; eval {File::Find::find( {wanted => \&simple_wanted, untaint => 1, untaint_skip => 1, untaint_pattern => qr|^(NO_MATCH)$|}, topdir('fa') );}; -Check( $@ =~ m|insecure cwd| ); +print "# $@" if $@; +#$^D = 8; +if ($^O eq 'MSWin32') { + Skip("$^O does not taint cwd"); + } +else { + Check( $@ =~ m|insecure cwd| ); +} chdir($cwd_untainted); @@ -360,6 +374,7 @@ if ( $symlink_exists ) { eval {File::Find::find( {wanted => \&simple_wanted, follow => 1}, topdir('fa') );}; + $^D = 8; Check( $@ =~ m|Insecure dependency| ); chdir($cwd_untainted); @@ -374,15 +389,13 @@ if ( $symlink_exists ) { chdir($cwd_untainted); # untaint pattern doesn't match, should die when we chdir to cwd - print "# check untaint_skip (follow)\n"; + print "# check untaint_skip (Follow)\n"; undef $@; eval {File::Find::find( {wanted => \&simple_wanted, untaint => 1, untaint_skip => 1, untaint_pattern => qr|^(NO_MATCH)$|}, topdir('fa') );}; - Check( $@ =~ m|insecure cwd| ); chdir($cwd_untainted); - }