Subject: | [PATCH] 2 cygwin failures with 1.001 |
cygwin fails
1. with the tainted test
$ENV{PATH} = $1; # for taint mode
which is /usr/local/bin for my perls, but /usr/bin must be included also
to be able to load the shared libraries dependent on the shared libperl.
I haven't tested win32, but I guess the Win32 loader is not so strict.
2. cygwin prints an error message
at lib/File/pushd.pm:42
eval { $tainted_dest = $target_dir ? abs_path( $target_dir ) : $orig
};
my $dest;
if ( $tainted_dest =~ $options->{untaint_pattern} ) {
when $target_dir does not exist, so $tainted_dest is empty.
I moved the check upwards.
--
Reini Urban
Subject: | File-pushd-1.001-cygwin.patch |
difforig File-pushd-1.001-JElyDI
diff -u File-pushd-1.001-JElyDI/lib/File/pushd.pm.orig
--- File-pushd-1.001-JElyDI/lib/File/pushd.pm.orig 2011-12-07 09:45:31.679118900 -0600
+++ File-pushd-1.001-JElyDI/lib/File/pushd.pm 2011-12-07 09:44:13.132243900 -0600
@@ -39,6 +39,7 @@
my $tainted_dest;
eval { $tainted_dest = $target_dir ? abs_path( $target_dir ) : $orig };
+ croak "Can't locate directory $target_dir: $@" if $@;
my $dest;
if ( $tainted_dest =~ $options->{untaint_pattern} ) {
@@ -48,8 +49,6 @@
$dest = $tainted_dest;
}
- croak "Can't locate directory $target_dir: $@" if $@;
-
if ($dest ne $orig) {
chdir $dest or croak "Can't chdir to $dest\: $!";
}
diff -u File-pushd-1.001-JElyDI/t/File_pushd.t.orig
--- File-pushd-1.001-JElyDI/t/File_pushd.t.orig 2011-12-07 09:54:47.585368900 -0600
+++ File-pushd-1.001-JElyDI/t/File_pushd.t 2011-12-07 09:54:47.538493900 -0600
@@ -196,6 +196,7 @@
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
$^X =~ m{(.*)[\\/]perl.*$};
$ENV{PATH} = $1; # for taint mode
+ $ENV{PATH} = "$1:/usr/bin" if $^O eq 'cygwin';
$temp_dir = `$^X $program_file`;
}