summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-10-07 05:54:49 +0200
committerlpsolit%gmail.com <>2005-10-07 05:54:49 +0200
commit518df535b020606f1357e706bbd23f3a43e15f96 (patch)
tree82801df3e9e6a03058d22d740f53dde507692733 /Bugzilla.pm
parent3c457877d82dd27ab2090e04e12c4a10031f3bf0 (diff)
downloadbugzilla-518df535b020606f1357e706bbd23f3a43e15f96.tar.gz
bugzilla-518df535b020606f1357e706bbd23f3a43e15f96.tar.xz
Bug 309796: Whining needs to check for shutdown (silently) before trying database access - Patch by Frédéric Buclin <LpSolit@gmail.com> r=joel a=justdave
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 99e5c3add..71e29a222 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -49,6 +49,11 @@ use constant SHUTDOWNHTML_EXEMPT => [
'checksetup.pl',
];
+# Non-cgi scripts that should silently exit.
+use constant SHUTDOWNHTML_EXIT_SILENTLY => [
+ 'whine.pl'
+];
+
#####################################################################
# Global Code
#####################################################################
@@ -62,6 +67,15 @@ use constant SHUTDOWNHTML_EXEMPT => [
if (Param("shutdownhtml")
&& lsearch(SHUTDOWNHTML_EXEMPT, basename($0)) == -1)
{
+ # Allow non-cgi scripts to exit silently (without displaying any
+ # message), if desired. At this point, no DBI call has been made
+ # yet, and no error will be returned if the DB is inaccessible.
+ if (lsearch(SHUTDOWNHTML_EXIT_SILENTLY, basename($0)) > -1
+ && !i_am_cgi())
+ {
+ exit;
+ }
+
# For security reasons, log out users when Bugzilla is down.
# Bugzilla->login() is required to catch the logincookie, if any.
my $user = Bugzilla->login(LOGIN_OPTIONAL);