]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 407402: Make Bugzilla die when data/params doesn't exist, if we're in a CGI.
authormkanat%bugzilla.org <>
Fri, 18 Jan 2008 11:04:19 +0000 (11:04 +0000)
committermkanat%bugzilla.org <>
Fri, 18 Jan 2008 11:04:19 +0000 (11:04 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=justdave, a=mkanat

Bugzilla/Config.pm

index b1b0d66675d695ec48d943aa4df6d96b00f5f6c9..d84970e8cf34b991afe332e2429750a969a56f90 100644 (file)
@@ -318,6 +318,17 @@ sub read_param_file {
         # Now read the param back out from the sandbox
         %params = %{$s->varglob('param')};
     }
+    elsif ($ENV{'SERVER_SOFTWARE'}) {
+       # We're in a CGI, but the params file doesn't exist. We can't
+       # Template Toolkit, or even install_string, since checksetup
+       # might not have thrown an error. Bugzilla::CGI->new
+       # hasn't even been called yet, so we manually use CGI::Carp here
+       # so that the user sees the error.
+       require CGI::Carp;
+       CGI::Carp->import('fatalsToBrowser');
+       die "The $datadir/params file does not exist."
+           . ' You probably need to run checksetup.pl.',
+    }
     return \%params;
 }