dist/Cwd/t/Functions.t See if File::Spec::Functions works
dist/Cwd/t/rel2abs2rel.t See if File::Spec->rel2abs/abs2rel works
dist/Cwd/t/Spec.t See if File::Spec works
+dist/Cwd/t/Spec-taint.t See if File::Spec works with taint
dist/Cwd/t/taint.t See if Cwd works with taint
dist/Cwd/t/tmpdir.t See if File::Spec->tmpdir() works
dist/Cwd/t/win32.t See if Cwd works on Win32
use strict;
use vars qw($VERSION);
-$VERSION = '3.34';
+$VERSION = '3.35';
$VERSION = eval $VERSION;
=head1 NAME
$ENV{TMPDIR}
/tmp
-Since perl 5.8.0, if running under taint mode, and if $ENV{TMPDIR}
+If running under taint mode, and if $ENV{TMPDIR}
is tainted, it is not used.
=cut
require Scalar::Util;
@dirlist = grep { ! Scalar::Util::tainted($_) } @dirlist;
}
+ elsif ($] < 5.007) { # No ${^TAINT} before 5.8
+ @dirlist = grep { eval { eval('1'.substr $_,0,0) } } @dirlist;
+ }
}
foreach (@dirlist) {
next unless defined && -d && -w _;
--- /dev/null
+#!./perl -Tw
+# Testing File::Spec under taint mode.
+
+use strict;
+
+chdir 't' unless $ENV{PERL_CORE};
+
+use File::Spec;
+use lib File::Spec->catdir('t', 'lib');
+use Test::More tests => 2;
+
+use Scalar::Util qw/tainted/;
+
+my $ret;
+eval { $ret = File::Spec->tmpdir };
+is( $@, '', "tmpdir should not explode under taint mode" );
+ok( !tainted($ret), "its return value should not be tainted" );