Blame SOURCES/httpd-2.4.43-corelimit.patch
|
|
906948 |
diff --git a/server/core.c b/server/core.c
|
|
|
906948 |
index 79b2a82..dc0f17a 100644
|
|
|
906948 |
--- a/server/core.c
|
|
|
906948 |
+++ b/server/core.c
|
|
|
906948 |
@@ -4996,6 +4996,25 @@ static int core_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pte
|
|
|
906948 |
}
|
|
|
906948 |
apr_pool_cleanup_register(pconf, NULL, ap_mpm_end_gen_helper,
|
|
|
906948 |
apr_pool_cleanup_null);
|
|
|
906948 |
+
|
|
|
906948 |
+#ifdef RLIMIT_CORE
|
|
|
906948 |
+ if (ap_coredumpdir_configured) {
|
|
|
906948 |
+ struct rlimit lim;
|
|
|
906948 |
+
|
|
|
906948 |
+ if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) {
|
|
|
906948 |
+ lim.rlim_cur = lim.rlim_max;
|
|
|
906948 |
+ if (setrlimit(RLIMIT_CORE, &lim) == 0) {
|
|
|
906948 |
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
|
|
|
906948 |
+ "core dump file size limit raised to %lu bytes",
|
|
|
906948 |
+ lim.rlim_cur);
|
|
|
906948 |
+ } else {
|
|
|
906948 |
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL,
|
|
|
906948 |
+ "core dump file size is zero, setrlimit failed");
|
|
|
906948 |
+ }
|
|
|
906948 |
+ }
|
|
|
906948 |
+ }
|
|
|
906948 |
+#endif
|
|
|
906948 |
+
|
|
|
906948 |
return OK;
|
|
|
906948 |
}
|
|
|
906948 |
|