]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 104589 - prevent user closing window from terminating Bugzilla scripts. Patch...
authorgerv%gerv.net <>
Thu, 28 Mar 2002 15:57:02 +0000 (15:57 +0000)
committergerv%gerv.net <>
Thu, 28 Mar 2002 15:57:02 +0000 (15:57 +0000)
buglist.cgi
globals.pl

index 747fab520b18bb35322e5fdb59419e96505c0831..ff31feb1fe8735b7076ab8054cafefa4ddd263e5 100755 (executable)
@@ -1321,6 +1321,12 @@ ReconnectToShadowDatabase();
 # 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');
 
+# 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.
 SendSQL($query);
 
index cac9669a54b7d365d2790b19cacdf19806ded713..2b35a45ccbacafb2cb3da6e529f8ff973f290bbc 100644 (file)
@@ -91,6 +91,12 @@ delete @::ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
 # system call
 $::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.
 $::param{'version'} = '2.15';