From: Mike S. <log...@pe...> - 2003-07-08 17:05:33
|
On Tue, 8 Jul 2003, James.FitzGibbon wrote: > So $0 would not be available unless explicitly shared. If this is > a problem, $0 could always be added to > %VARS_SHARED_WITH_SAFE_COMPARTMENT in Log/Log4perl.pm Well, I think it's a problem with 041SafeEval.t, because your test case runs a stat($0) which always fails because $0 isn't shared explicitely -- right? I just noticed it yesterday because the test suite spit out some warnings. Here's a patch: Index: 041SafeEval.t =================================================================== RCS file: /cvsroot/log4perl/Log-Log4perl/t/041SafeEval.t,v retrieving revision 1.3 diff -a -u -r1.3 041SafeEval.t --- 041SafeEval.t 31 May 2003 18:20:34 -0000 1.3 +++ 041SafeEval.t 8 Jul 2003 17:04:26 -0000 @@ -14,6 +14,10 @@ my $example_log = "example" . (stat($0))[9] . ".log"; unlink($example_log); +Log::Log4perl::Config->vars_shared_with_safe_compartment( + main => [ '$0' ], +); + # test that unrestricted code works properly Log::Log4perl::Config::allow_code(1); my $config = <<'END'; -- Mike Mike Schilli log...@pe... http://perlmeister.com http://log4perl.sourceforge.net |