From: Rafael Garcia-Suarez Date: Wed, 31 Oct 2001 14:49:37 +0000 (+0000) Subject: Re: [REPATCH] Re: [PATCH] Re: [ID 20011030.064] File::Temp tempdir(CLEANUP => 1)... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7068481feb3366fc94b17a90a2eed90f87afc5a0;p=p5sagit%2Fp5-mst-13.2.git Re: [REPATCH] Re: [PATCH] Re: [ID 20011030.064] File::Temp tempdir(CLEANUP => 1) and -T on OpenBSD 2.9 Message-Id: p4raw-id: //depot/perl@12791 --- diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 3560a97..10ae398 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -98,7 +98,7 @@ use Exporter (); use strict; use warnings; -our $VERSION = "1.0405"; +our $VERSION = "1.05"; our @ISA = qw( Exporter ); our @EXPORT = qw( mkpath rmtree ); @@ -180,7 +180,13 @@ sub rmtree { unless $safe; if (opendir my $d, $root) { - @files = readdir $d; + no strict 'refs'; + if (!defined ${"\cTAINT"} or ${"\cTAINT"}) { + # Blindly untaint dir names + @files = map { /^(.*)$/s ; $1 } readdir $d; + } else { + @files = readdir $d; + } closedir $d; } else { diff --git a/lib/File/Path.t b/lib/File/Path.t index 42e0ae9..6e1414e 100755 --- a/lib/File/Path.t +++ b/lib/File/Path.t @@ -1,4 +1,4 @@ -#!./perl +#!./perl -wT BEGIN { chdir 't' if -d 't'; diff --git a/lib/File/Temp/t/mktemp.t b/lib/File/Temp/t/mktemp.t index 4e31d01..2ca1a1f 100755 --- a/lib/File/Temp/t/mktemp.t +++ b/lib/File/Temp/t/mktemp.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -wT # Test for mktemp family of commands in File::Temp # Use STANDARD safe level for these tests