On Mon 03 Sep 2001 17:24, Nicholas Clark <nick@ccl4.org> wrote:
> I'd suggest the patch below, to remove any heuristics and inherent assumptions.
> Passes with PATH= on Debian (ie no pwd in my path, so non-tainting cwd)
10.20:
All tests successful.
u=5.03 s=1.6 cu=321.69 cs=26.38 scripts=429 tests=25467
> > IMHO just change that logic to
> >
> > my $cwd = $wanted->{bydepth} ? Cwd::fastcwd() : Cwd::getcwd();
>
> I'd be loathe to change it as I suspect it's something subtle based on when
> File::Find executes chdir.
>
> Nicholas Clark
>
> --- lib/File/Find/taint.t.orig Mon Jul 2 15:26:41 2001
> +++ lib/File/Find/taint.t Mon Sep 3 16:19:07 2001
> @@ -43,8 +43,17 @@
> use File::Spec;
> use Cwd;
>
> -
> -my $NonTaintedCwd = $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'os2';
> +my $NonTaintedCwd;
> +{
> + my $cwd = cwd;
> + die "cwd failed: $!" unless defined $cwd;
> + my $cwd = substr($cwd, 0, 0); # zero-length
> + local $@;
> + # Rather than guess based on $^O, actually check to see if the return from
> + # cwd is tainted. Same OS can vary depending on whether pwd is in $PATH
> + eval { eval "# $cwd" };
> + $NonTaintedCwd = length($@) == 0;
> +}
>
> cleanup();
>
--
H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl-5.6.1, 5.7.1 & 628 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
WinNT 4, Win2K pro & WinCE 2.11. Smoking perl CORE: smokers@perl.org
http://archives.develooper.com/daily-build@perl.org/ perl-qa@perl.org
send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org
Thread Previous
|
Thread Next