From 239188a96b8492b3154f31559cd65406ffcd3116 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 21 Mar 2011 22:36:45 +0000 Subject: [PATCH] * server/mpm/prefork/prefork.c (set_signals): Ignore SIGXFSZ; have a write() beyond 2GB fail with E2BIG rather than killing the process in the now hopefully rare case of non-LFS file usage on LFS systems. * server/mpm/worker/worker.c (set_signals): Likewise. * server/mpm/event/event.c (set_signals): Likewise. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1084000 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/event/event.c | 7 +++++-- server/mpm/prefork/prefork.c | 7 +++++-- server/mpm/worker/worker.c | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index fb38bf6f072..4b0cf39e619 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -551,7 +551,10 @@ static void set_signals(void) "sigaction(SIGXCPU)"); #endif #ifdef SIGXFSZ - sa.sa_handler = SIG_DFL; + /* For systems following the LFS standard, ignoring SIGXFSZ allows + * a write() beyond the 2GB limit to fail gracefully with E2BIG + * rather than terminate the process. */ + sa.sa_handler = SIG_IGN; if (sigaction(SIGXFSZ, &sa, NULL) < 0) ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGXFSZ)"); @@ -580,7 +583,7 @@ static void set_signals(void) apr_signal(SIGXCPU, SIG_DFL); #endif /* SIGXCPU */ #ifdef SIGXFSZ - apr_signal(SIGXFSZ, SIG_DFL); + apr_signal(SIGXFSZ, SIG_IGN); #endif /* SIGXFSZ */ } diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 7175287c840..1dec7c41df4 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -400,7 +400,10 @@ static void set_signals(void) ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGXCPU)"); #endif #ifdef SIGXFSZ - sa.sa_handler = SIG_DFL; + /* For systems following the LFS standard, ignoring SIGXFSZ allows + * a write() beyond the 2GB limit to fail gracefully with E2BIG + * rather than terminate the process. */ + sa.sa_handler = SIG_IGN; if (sigaction(SIGXFSZ, &sa, NULL) < 0) ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGXFSZ)"); #endif @@ -426,7 +429,7 @@ static void set_signals(void) apr_signal(SIGXCPU, SIG_DFL); #endif /* SIGXCPU */ #ifdef SIGXFSZ - apr_signal(SIGXFSZ, SIG_DFL); + apr_signal(SIGXFSZ, SIG_IGN); #endif /* SIGXFSZ */ } diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index b5f6b860eee..39efd5e0c67 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -499,7 +499,10 @@ static void set_signals(void) "sigaction(SIGXCPU)"); #endif #ifdef SIGXFSZ - sa.sa_handler = SIG_DFL; + /* For systems following the LFS standard, ignoring SIGXFSZ allows + * a write() beyond the 2GB limit to fail gracefully with E2BIG + * rather than terminate the process. */ + sa.sa_handler = SIG_IGN; if (sigaction(SIGXFSZ, &sa, NULL) < 0) ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGXFSZ)"); @@ -528,7 +531,7 @@ static void set_signals(void) apr_signal(SIGXCPU, SIG_DFL); #endif /* SIGXCPU */ #ifdef SIGXFSZ - apr_signal(SIGXFSZ, SIG_DFL); + apr_signal(SIGXFSZ, SIG_IGN); #endif /* SIGXFSZ */ } -- 2.47.2