}
}
+
if ( $symlink_exists ) { print "1..45\n"; }
else { print "1..27\n"; }
$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 {
-MkDir( dir_path('for_find'), 0770 );
+MkDir( dir_path('for_find'), 0777 );
CheckDie(chdir( dir_path('for_find')));
$cwd = cwd(); # save cwd
# 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);
eval {File::Find::find( {wanted => \&simple_wanted, follow => 1},
topdir('fa') );};
+ $^D = 8;
Check( $@ =~ m|Insecure dependency| );
chdir($cwd_untainted);
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);
-
}