From: James.FitzGibbon <Jam...@ta...> - 2003-05-05 16:21:16
|
Looks good, with a couple of minor nits: 1. In a couple of sections of the POD, ->allowed_code_ops_convenience_map is referred to as ->allowed_code_ops: > Log::Log4perl::Config-E<gt>allowed_code_ops() accepts a convenience map > of names to opcode masks. > For convenience, if Log::Log4perl::Config-E<gt>allow_code() is called with a > value which is a key of the map previously defined with > Log::Log4perl::Config-E<gt>allowed_code_ops(), then the allowed 2. I had a thought over the weekend that the accessors for ->allowed_code_ops_convenience_map should allow for the following invocation styles: ->allowed_code_ops_convenience_map() Returns entire map as a hashref or hash per context ->allowed_code_ops_convenience_map( \% ) Replaces entire map with supplied hashref ->allowed_code_ops_convenience_map( $ ) Returns the value for the given key ->allowed_code_ops_convenience_map( $, $ ) Inserted into the map the key/val pair So that if someone wants to add a single convenience map in a wrapper function around Log4perl, they don't have to pull in the entire hash, modify it, then replace it. I've attached a patch that fixes #1, implements #2 and adds 13 more tests to t/041SafeEval.t. I also added the same type of accessors to ->vars_shared_with_safe_compartment() and changed the functions that use the globals to use the accessors to make subclassing a bit easier should anyone choose to go down that path. The patch should be applied on top of your log_log4perl_safe_patch2. It only patches these files: lib/Log/Log4perl.pm lib/Log/Log4perl/Config.pm t/041SafeEval.t If you think it looks good, then I think this is ready to go. -- j. James FitzGibbon Consultant, Ajilon Services, TTS-3D@CC-950 jam...@ta... voice/fax 612-304-6121/3277 > -----Original Message----- > From: msc...@ao... [mailto:msc...@ao...] > Sent: Saturday, May 03, 2003 12:49 AM > To: Jam...@ta...; log...@li... > Subject: Re: [log4perl-devel] For consideration: patch to use Safe > compart ments in Log::Log4per l::Config > > > In a message dated 5/2/2003 11:22:09 AM Eastern Standard > Time, Jam...@ta... writes: > > > > > Definately a good idea. Do you want me to integrate that > in, or will you? > > Done :) ... Please review the attached patch for check in. > > -- Mike > > ############################ > # Mike Schilli # > # log...@pe... # > # http://perlmeister.com # > # log4perl.sourceforge.net # > ############################ > |