]> granicus.if.org Git - apache/commitdiff
Fix the rest of the apr_pool_userdata_setn() bogosity w.r.t. DSO modules.
authorCliff Woolley <jwoolley@apache.org>
Sat, 25 May 2002 20:10:55 +0000 (20:10 +0000)
committerCliff Woolley <jwoolley@apache.org>
Sat, 25 May 2002 20:10:55 +0000 (20:10 +0000)
It's totally unsafe to use apr_pool_userdata_setn() in the post_config
phase of a module, since on some platforms when the DSO gets reloaded
between phases, the data segment will be at a different address on the
second phase and the userdata_get() call will fail.

PR: 9413
Submitted by: Tsuyoshi Sasamoto <nazonazo@super.win.ne.jp>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95287 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/generators/mod_suexec.c
modules/ssl/ssl_scache.c

diff --git a/CHANGES b/CHANGES
index b1947482b8943a8f26760c73610fa73d16d8e500..0861f4b4fb41e65df6387a2db045f858bf1cb7d0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
 Changes with Apache 2.0.37
 
+  *) Fix segfaults at startup on some platforms when mod_auth_digest,
+     mod_suexec, or mod_ssl were used as DSO's due to the way they
+     were tracking the current init phase since DSO's get completely
+     unloaded and reloaded between phases.  PR 9413.
+     [Tsuyoshi Sasamoto <nazonazo@super.win.ne.jp>, Brad Nicholes]
+
   *) Fix mod_include's handling of regular expressions in
      "<!--#if" directives [Julius Gawlas <julius_gawlas@hp.com>]
 
index 0191955279456d1ab20af6fbbce98ea3541e5ca8..b868ae9f3ed47ae26ece27db113d25dd9e617f5b 100644 (file)
@@ -141,8 +141,8 @@ static int suexec_post_config(apr_pool_t *p, apr_pool_t *plog,
         ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s,
                      "suEXEC mechanism enabled (wrapper: %s)", SUEXEC_BIN);
 
-        apr_pool_userdata_setn((void *)1, SUEXEC_POST_CONFIG_USERDATA,
-                               apr_pool_cleanup_null, s->process->pool);
+        apr_pool_userdata_set((void *)1, SUEXEC_POST_CONFIG_USERDATA,
+                              apr_pool_cleanup_null, s->process->pool);
     }
 
     return OK;
index 9f7f8513efd640f00592792f7455788448e2bc55..9406c38e282ec30465f89f6b7c760f1f650620e7 100644 (file)
@@ -94,8 +94,8 @@ void ssl_scache_init(server_rec *s, apr_pool_t *p)
 
         apr_pool_userdata_get(&data, userdata_key, s->process->pool);
         if (!data) {
-            apr_pool_userdata_setn((const void *)1, userdata_key,
-                                   apr_pool_cleanup_null, s->process->pool);
+            apr_pool_userdata_set((const void *)1, userdata_key,
+                                  apr_pool_cleanup_null, s->process->pool);
             return;
         }
         if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT)