develooper Front page | perl.perl5.porters | Postings from October 2001

Re: [REPATCH] Re: [PATCH] Re: [ID 20011030.064] File::Temp tempdir (CLEANUP => 1) and -T on OpenBSD 2.9

From:
rgarciasuarez
Date:
October 31, 2001 06:49
Subject:
Re: [REPATCH] Re: [PATCH] Re: [ID 20011030.064] File::Temp tempdir (CLEANUP => 1) and -T on OpenBSD 2.9
Message ID:
slrn9u03sk.hco.rgarciasuarez@rafael.kazibao.net
Jarkko Hietaniemi wrote in perl.perl5.porters:
> 
> Uh, this doesn't work at all with blead, nine tests fail...

...lesson #1 : never edit a patch by hand...
This one should be final.


--- lib/File/Path.pm.orig	Fri Sep 21 20:11:58 2001
+++ lib/File/Path.pm	Wed Oct 31 15:41:30 2001
@@ -98,7 +98,7 @@
 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 @@
 		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 {
--- lib/File/Path.t.orig	Mon Jun 18 07:21:16 2001
+++ lib/File/Path.t	Wed Oct 31 15:33:27 2001
@@ -1,4 +1,4 @@
-#!./perl
+#!./perl -wT
 
 BEGIN {
     chdir 't' if -d 't';
--- lib/File/Temp/t/mktemp.t.orig	Thu Jun 21 16:46:53 2001
+++ lib/File/Temp/t/mktemp.t	Wed Oct 31 15:33:27 2001
@@ -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



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About