]> 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:05:04 +0000 (11:05 +0000)
committermkanat%bugzilla.org <>
Fri, 18 Jan 2008 11:05:04 +0000 (11:05 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=justdave, a=mkanat

Bugzilla/Config.pm

index 85c9d6decbe6514582c072a2f895e2396136a471..11ffe4d9ac9bc922fdd6fdd02b06895d077956ab 100644 (file)
@@ -315,6 +315,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;
 }