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