From: Jarkko Hietaniemi Date: Sat, 23 Jun 2001 16:04:38 +0000 (+0000) Subject: cygwin needs cygwin1.dll in PATH or cwd to run external programs. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=343d3f38aaddb9ab6fe1187337ca19ffb0f71000;p=p5sagit%2Fp5-mst-13.2.git cygwin needs cygwin1.dll in PATH or cwd to run external programs. cygwin does not taint cwd, just like win32. p4raw-id: //depot/perl@10868 --- diff --git a/lib/File/Find/taint.t b/lib/File/Find/taint.t index fb3dfc2..f27c42c 100644 --- a/lib/File/Find/taint.t +++ b/lib/File/Find/taint.t @@ -34,6 +34,8 @@ foreach my $dir (split(/$sep/,$ENV{'PATH'})) } $ENV{'PATH'} = join($sep,@path); +my $NonTaintedCwd = $^O eq 'MSWin32' || $^O eq 'cygwin'; + cleanup(); find({wanted => sub { print "ok 1\n" if $_ eq 'commonsense.t'; }, @@ -321,7 +323,7 @@ eval {File::Find::find( {wanted => \&simple_wanted, untaint => 1, print "# $@" if $@; #$^D = 8; -if ($^O eq 'MSWin32') { +if ($NonTaintedCwd) { Skip("$^O does not taint cwd"); } else { @@ -394,7 +396,12 @@ if ( $symlink_exists ) { eval {File::Find::find( {wanted => \&simple_wanted, untaint => 1, untaint_skip => 1, untaint_pattern => qr|^(NO_MATCH)$|}, topdir('fa') );}; - Check( $@ =~ m|insecure cwd| ); + if ($NonTaintedCwd) { + Skip("$^O does not taint cwd"); + } + else { + Check( $@ =~ m|insecure cwd| ); + } chdir($cwd_untainted); } diff --git a/t/op/taint.t b/t/op/taint.t index c2bb2f8..effb12c 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -42,6 +42,7 @@ my $Is_VMS = $^O eq 'VMS'; my $Is_MSWin32 = $^O eq 'MSWin32'; my $Is_NetWare = $^O eq 'NetWare'; my $Is_Dos = $^O eq 'dos'; +my $Is_Cygwin = $^O eq 'cygwin'; my $Invoke_Perl = $Is_VMS ? 'MCR Sys$Disk:[]Perl.' : ($Is_MSWin32 ? '.\perl' : ($Is_NetWare ? 'perl' : './perl')); @@ -120,6 +121,12 @@ print "1..174\n"; delete @ENV{@MoreEnv}; $ENV{TERM} = 'dumb'; + if ($Is_Cygwin) { + system("/usr/bin/cp /usr/bin/cygwin1.dll .") && + die "$0: failed to cp cygwin1.dll: $!\n"; + END { unlink "cygwin1.dll" } # yes, done for all platforms... + } + test 1, eval { `$echo 1` } eq "1\n"; if ($Is_MSWin32 || $Is_NetWare || $Is_VMS || $Is_Dos) {