Commit a6123ce8 authored by gerv%gerv.net's avatar gerv%gerv.net

Bug 104589 - prevent user closing window from terminating Bugzilla scripts.…

Bug 104589 - prevent user closing window from terminating Bugzilla scripts. Patch by Gerv <gerv@mozilla.org>, r=justdave, myk
parent b5cbca2f
...@@ -1321,6 +1321,12 @@ ReconnectToShadowDatabase(); ...@@ -1321,6 +1321,12 @@ ReconnectToShadowDatabase();
# to avoid "table out of space" errors on MySQL versions less than 3.23.2. # to avoid "table out of space" errors on MySQL versions less than 3.23.2.
SendSQL("SET OPTION SQL_BIG_TABLES=1") if Param('expectbigqueries'); SendSQL("SET OPTION SQL_BIG_TABLES=1") if Param('expectbigqueries');
# Normally, we ignore SIGTERM and SIGPIPE (see globals.pl) but we need to
# respond to them here to prevent someone DOSing us by reloading a query
# a large number of times.
$::SIG{TERM} = 'DEFAULT';
$::SIG{PIPE} = 'DEFAULT';
# Execute the query. # Execute the query.
SendSQL($query); SendSQL($query);
......
...@@ -91,6 +91,12 @@ delete @::ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; ...@@ -91,6 +91,12 @@ delete @::ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
# system call # system call
$::ENV{'PATH'} = ''; $::ENV{'PATH'} = '';
# Ignore SIGTERM and SIGPIPE - this prevents DB corruption. If the user closes
# their browser window while a script is running, the webserver sends these
# signals, and we don't want to die half way through a write.
$::SIG{TERM} = 'IGNORE';
$::SIG{PIPE} = 'IGNORE';
# Contains the version string for the current running Bugzilla. # Contains the version string for the current running Bugzilla.
$::param{'version'} = '2.15'; $::param{'version'} = '2.15';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment