Commit 7b0c1bd3 authored by Joe Orton's avatar Joe Orton
Browse files

* 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
parent 800a2929
Loading
Loading
Loading
Loading
+5 −2
Changes for server/mpm/event/event.c: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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 */
    }

+5 −2
Changes for server/mpm/prefork/prefork.c: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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 */
    }

+5 −2
Changes for server/mpm/worker/worker.c: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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 */
    }