]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
fix buglet in previously-committed prctl() feature
authorJeff Trawick <trawick@apache.org>
Thu, 5 Feb 2004 17:39:28 +0000 (17:39 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 5 Feb 2004 17:39:28 +0000 (17:39 +0000)
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

src/include/http_conf_globals.h
src/main/http_core.c
src/main/http_main.c

index e102481f695bb182b45ec71cc395636e75211dec..d6a5e222428085108f6cd0ccd263f2f9add5eb79 100644 (file)
@@ -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
 }
index 80c36a88688e09a07793439e3e7bdce137b4fc05..f229968ef976fdb2cc85a4b9cf442f29731088a8 100644 (file)
@@ -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;
 }
 
index 9b6142a94a69d7444bfd4df1ca3a0758c7692edd..e27815f32a6023401708bd1abf41738ad84dd496 100644 (file)
@@ -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)) {