EvanCarroll has asked for the wisdom of the Perl Monks concerning the following question:
Here is a what a say for $cdir, $wdir, $1 on :387 returns.377 # create COMPILE_DIR and sub-directories representing each IN +CLUDE_PATH 378 # element in which to store compiled files 379 if ($cdir) { 380 require File::Path; 381 foreach my $dir (@$path) { 382 next if ref $dir; 383 my $wdir = $dir; 384 $wdir =~ s[:][]g if $^O eq 'MSWin32'; 385 $wdir =~ /(.*)/; # untaint 386 $wdir = $1; 387 $wdir = File::Spec->catfile($cdir, $1); 388 File::Path::mkpath($wdir) unless -d $wdir; 389 } 390 }
The problem is, as the code stands, the call to File::Spec->catfile returns:C:/strawberry/cpan/build/Template-Toolkit-2.19-J1f5an/t/test/tmp/cache C/strawberry/cpan/build/Template-Toolkit-2.19-J1f5an/t/test/src C/strawberry/cpan/build/Template-Toolkit-2.19-J1f5an/t/test/src
When it should returnC:\strawberry\cpan\build\Template-Toolkit-2.19-J1f5an\t\test\tmp\cache +\C:
This is because the above code doesn't work but if you patch it with the following it'll work:C:\strawberry\cpan\build\Template-Toolkit-2.19-J1f5an\t\test\tmp\cache +\C\strawberry\cpan\build\Template-Toolkit-2.19-J1f5an\t\test\src
The following also works:386 $wdir = $1; 387 $wdir = File::Spec->catfile($cdir, $wdir);
With a Devel::Peek, Dump( $wdir ), Dump( $1 ) before the $wdir=$1, I get386 #deleted 387 $wdir = File::Spec->catfile($cdir, $wdir);
With it after I getC:\strawberry\cpan\build\Template-Toolkit-2.19-J1f5an>perl -Ilib .\t\c +ompile4.t 1..11 ok 1 - running test_expect() SV = PV(0xbda53c) at 0xa44534 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0xba8754 "C/strawberry/cpan/build/Template-Toolkit-2.19-J1f5an/ +t/test/src "\0 CUR = 63 LEN = 64 SV = PVMG(0x9b36ec) at 0xa52adc REFCNT = 1 FLAGS = (GMG,SMG,pPOK) IV = 0 NV = 0 PV = 0x9c460c "p"\0 CUR = 1 LEN = 56 MAGIC = 0xa53c0c MG_VIRTUAL = &PL_vtbl_sv MG_TYPE = PERL_MAGIC_sv(\0) MG_OBJ = 0xa52a9c MG_LEN = 1 MG_PTR = 0x9e2234 "1" Died at lib/Template/Provider.pm line 389, <DATA> line 1.
while not to exact this is my cpanp r (modules that aren't totally up-to-date, everything else is to be assumed latest stable release). This is with the newest version of File::Spec (not sure this might be the problem) 3.2701. http://rafb.net/p/lPSey721.html <-- full info on not-up to date versions.1..11 ok 1 - running test_expect() SV = PVMG(0xa652e4) at 0xa44534 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) IV = 0 NV = 0 PV = 0xba8754 "C/strawberry/cpan/build/Template-Toolkit-2.19-J1f5an/ +t/test/src "\0 CUR = 63 LEN = 64 SV = PVMG(0x9b36ec) at 0xa52adc REFCNT = 1 FLAGS = (GMG,SMG,pPOK) IV = 0 NV = 0 PV = 0xba87ac "C/strawberry/cpan/build/Template-Toolkit-2.19-J1f5an/ +t/test/src "\0 CUR = 63 LEN = 64 MAGIC = 0xa53c0c MG_VIRTUAL = &PL_vtbl_sv MG_TYPE = PERL_MAGIC_sv(\0) MG_OBJ = 0xa52a9c MG_LEN = 1 MG_PTR = 0x9e2234 "1" Died at lib/Template/Provider.pm line 390, <DATA> line 1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tainting problem on Strawberry perl
by ysth (Canon) on Feb 29, 2008 at 02:06 UTC | |
|
Re: Tainting problem on Strawberry perl
by ikegami (Patriarch) on Feb 28, 2008 at 22:32 UTC | |
by EvanCarroll (Chaplain) on Feb 28, 2008 at 22:43 UTC | |
by ikegami (Patriarch) on Feb 28, 2008 at 23:04 UTC | |
by EvanCarroll (Chaplain) on Feb 28, 2008 at 23:09 UTC | |
by ikegami (Patriarch) on Feb 28, 2008 at 23:33 UTC | |
by syphilis (Archbishop) on Feb 28, 2008 at 23:42 UTC | |
by ikegami (Patriarch) on Feb 28, 2008 at 23:52 UTC |