From babc62e9ea9a6b8f2f2dcd4518961db329583bf9 Mon Sep 17 00:00:00 2001 From: George Wang Date: Sun, 21 Sep 2008 02:34:48 +0000 Subject: [PATCH] disable core dump by default --- sapi/litespeed/lsapilib.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index 145ed0a973..9092533a5c 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -66,7 +66,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include +#include #include #include #include @@ -2120,7 +2122,16 @@ void LSAPI_Init_Env_Parameters( fn_select_t fp ) if ( p ) { avoidFork = atoi( p ); } - + +#if defined( RLIMIT_CORE ) + p = getenv( "LSAPI_ALLOW_CORE_DUMP" ); + if ( !p ) + { + struct rlimit limit = { 0, 0 }; + setrlimit( RLIMIT_CORE, &limit ); + } +#endif + p = getenv( "LSAPI_MAX_IDLE" ); if ( p ) { n = atoi( p ); -- 2.50.1