Skip Menu |

This queue is for tickets about the Data-Walk CPAN distribution.

Report information
The Basics
Id: 41245
Status: rejected
Priority: 0/
Queue: Data-Walk

People
Owner: Nobody in particular
Requestors: FANY [...] cpan.org
Cc: 460423 [...] rt.noris.net
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.00
Fixed in: (no value)



CC: 460423 [...] rt.noris.net
Subject: modifications do not work
The untaint example from the documentation does not work: $ perl -Tw -MData::Walk -MDevel::Peek -e 'sub untaint { s/(.*)/$1/s unless ref $_ }; my $data = \@ARGV; walk \&untaint, $data; Dump($data)' foo bar SV = RV(0x7c92b8) at 0x7c92a8 REFCNT = 1 FLAGS = (PADMY,ROK) RV = 0x7b7810 SV = PVAV(0x798078) at 0x7b7810 REFCNT = 2 FLAGS = () ARRAY = 0x7b54d8 FILL = 1 MAX = 3 ARYLEN = 0x0 FLAGS = (REAL) Elt No. 0 SV = PVMG(0x7aedd8) at 0x7b7840 REFCNT = 1 FLAGS = (GMG,SMG,pPOK) IV = 0 NV = 0 PV = 0x7b5458 "foo"\0 CUR = 3 LEN = 8 MAGIC = 0x7b5488 MG_VIRTUAL = &PL_vtbl_taint MG_TYPE = PERL_MAGIC_taint(t) MG_LEN = 1 Elt No. 1 SV = PVMG(0x7aee08) at 0x7b7858 REFCNT = 1 FLAGS = (GMG,SMG,pPOK) IV = 0 NV = 0 PV = 0x7bcf08 "bar"\0 CUR = 3 LEN = 8 MAGIC = 0x7bcf38 MG_VIRTUAL = &PL_vtbl_taint MG_TYPE = PERL_MAGIC_taint(t) MG_LEN = 1 So the data is still tainted. In fact, I cannot achieve any modification of the data, e.g.: $ perl -TMData::Dump=pp -MData::Walk -le 'my$data={foo=>"bar"};walk(sub{$_=~tr/a-z/A-Z/},$data);print pp$data' I tested this with perl, v5.10.0 built for x86_64-linux-thread-multi and perl, v5.8.8 built for i486-linux-gnu-thread-multi. Regards, fany
On Mi. 26. Nov. 2008, 11:07:49, FANY wrote: Show quoted text
> $ perl -TMData::Dump=pp -MData::Walk -le > 'my$data={foo=>"bar"};walk(sub{$_=~tr/a-z/A-Z/},$data);print pp$data'
I forgot to mention the result, which is: { foo => "bar" }
I can confirm this. Attempting to taint or untaint data using the wanted() subroutine does not work.
Yes, true, the example does not work and I removed it from the documentation. In general allowing to modify data would cause a major rewrite. If that is needed, you have to copy the data structure while iterating over it.