httpd-2.2.11-corelimit.patch 883 B

1234567891011121314151617181920212223242526272829
  1. --- httpd-2.2.11/server/core.c.corelimit
  2. +++ httpd-2.2.11/server/core.c
  3. @@ -3777,6 +3779,25 @@ static int core_post_config(apr_pool_t *
  4. set_banner(pconf);
  5. ap_setup_make_content_type(pconf);
  6. +
  7. +#ifdef RLIMIT_CORE
  8. + if (ap_coredumpdir_configured) {
  9. + struct rlimit lim;
  10. +
  11. + if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) {
  12. + lim.rlim_cur = lim.rlim_max;
  13. + if (setrlimit(RLIMIT_CORE, &lim) == 0) {
  14. + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
  15. + "core dump file size limit raised to %lu bytes",
  16. + lim.rlim_cur);
  17. + } else {
  18. + ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL,
  19. + "core dump file size is zero, setrlimit failed");
  20. + }
  21. + }
  22. + }
  23. +#endif
  24. +
  25. return OK;
  26. }