From: Jeff Trawick Date: Thu, 5 Feb 2004 17:39:28 +0000 (+0000) Subject: fix buglet in previously-committed prctl() feature X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa46974b4359431df564f007f5fd06c87696a894;p=thirdparty%2Fapache%2Fhttpd.git fix buglet in previously-committed prctl() feature before this patch, prctl() would be issued even if CoreDumpDirectory was not coded... no big deal, but not intended now the behavior matches that of httpd 2.* Submitted by: Jeff Trawick Reviewed by: Bill Stoddard, Greg Ames git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@102514 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/include/http_conf_globals.h b/src/include/http_conf_globals.h index e102481f695..d6a5e222428 100644 --- a/src/include/http_conf_globals.h +++ b/src/include/http_conf_globals.h @@ -127,6 +127,7 @@ extern API_VAR_EXPORT array_header *ap_server_config_defines; * is some memory corruption, so we allocate it statically. */ extern API_VAR_EXPORT char ap_coredump_dir[MAX_STRING_LEN]; +extern int ap_coredump_dir_configured; #ifdef __cplusplus } diff --git a/src/main/http_core.c b/src/main/http_core.c index 80c36a88688..f229968ef97 100644 --- a/src/main/http_core.c +++ b/src/main/http_core.c @@ -2723,6 +2723,7 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg) " does not exist or is not a directory", NULL); } ap_cpystrn(ap_coredump_dir, arg, sizeof(ap_coredump_dir)); + ap_coredump_dir_configured = 1; return NULL; } diff --git a/src/main/http_main.c b/src/main/http_main.c index 9b6142a94a6..e27815f32a6 100644 --- a/src/main/http_main.c +++ b/src/main/http_main.c @@ -315,8 +315,8 @@ static listen_rec *head_listener; API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]=""; API_VAR_EXPORT char ap_server_confname[MAX_STRING_LEN]=""; -#define DEFAULT_COREDUMP_DIR "" -API_VAR_EXPORT char ap_coredump_dir[MAX_STRING_LEN]=DEFAULT_COREDUMP_DIR; +API_VAR_EXPORT char ap_coredump_dir[MAX_STRING_LEN]=""; +int ap_coredump_dir_configured=0; API_VAR_EXPORT array_header *ap_server_pre_read_config=NULL; API_VAR_EXPORT array_header *ap_server_post_read_config=NULL; @@ -4347,7 +4347,7 @@ static void child_main(int child_num_arg) #endif #ifdef HAVE_SET_DUMPABLE - if (strcmp(ap_coredump_dir, DEFAULT_COREDUMP_DIR)) { + if (ap_coredump_dir_configured) { /* user set CoredumpDirectory, so they want to get core dumps */ if (prctl(PR_SET_DUMPABLE, 1)) {