[Petal] Repeat object and Safe compartment
William McKee
william at knowmad.com
Tue Aug 12 10:52:32 BST 2003
A bit more on the Taintmode stuff now that I've had a bit of sleep <g>.
As I said in my original message, I spent quite a bit of time trying to
get the existing code to work inside the Safe compartment. I tried many
variations on the share_from format that Jean-Michael had tried but to
no avail--the $CUR/$MAX variables in Petal::Hash_Repeat were not being
seen when the code was evaluated.
I then went to messing with how CodeGenerator.pm built the code that was
being put into the Safe compartment. It appears that there are some
definite issues with using local inside of a Safe compartment. The only
way I could get the code to run w/o errs was to change the global
scalars from $Petal::Hash_Repeat::CUR to $CUR. Of course, this makes
them no longer global and breaks the ability to set that value from
other packages.
I did come across an interesting thread about Safe in perl5-porters
between Tom C., Sarathy and Matt S. dated 8-Mar-2000 and titled "Re: [ID
20000308.006] use in Safe compartments" [1]. Tom brings up several
issues which discuss the brokenness of Safe. Of course this was a couple
years before the current 2.09 release, but I think some of these issues
are still hanging around.
William
[1] http://groups.yahoo.com/group/perl5-porters/message/64279?source=1
--
Knowmad Services Inc.
http://www.knowmad.com
More information about the Petal
mailing list