From 18c57070565d1218935168b437f4adcfe9b38ce4 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 1 Aug 2006 05:15:55 +0000 Subject: Bug 346483: Fix up param-updating code in checksetup.pl to all be in a module. Patch By Max Kanat-Alexander (module owner) a=myk --- Bugzilla.pm | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index 0ffa1d1b9..3d8215937 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -25,6 +25,7 @@ package Bugzilla; use strict; +use Bugzilla::Config; use Bugzilla::Constants; use Bugzilla::Auth; use Bugzilla::Auth::Persist::Cookie; @@ -147,7 +148,7 @@ sub cgi { sub params { my $class = shift; - request_cache()->{params} ||= _load_param_values(); + request_cache()->{params} ||= Bugzilla::Config::read_param_file(); return request_cache()->{params}; } @@ -346,27 +347,6 @@ sub _cleanup { undef $_request_cache; } -sub _load_param_values { - my %params; - my $datadir = bz_locations()->{'datadir'}; - if (-e "$datadir/params") { - # Note that checksetup.pl sets file permissions on '$datadir/params' - - # Using Safe mode is _not_ a guarantee of safety if someone does - # manage to write to the file. However, it won't hurt... - # See bug 165144 for not needing to eval this at all - my $s = new Safe; - - $s->rdo("$datadir/params"); - die "Error reading $datadir/params: $!" if $!; - die "Error evaluating $datadir/params: $@" if $@; - - # Now read the param back out from the sandbox - %params = %{$s->varglob('param')}; - } - return \%params; -} - sub END { _cleanup(); } -- cgit v1.2.3-24-g4f1b