]> granicus.if.org Git - apache/commitdiff
Merge r1824811 from trunk:
authorYann Ylavic <ylavic@apache.org>
Tue, 20 Feb 2018 13:02:54 +0000 (13:02 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 20 Feb 2018 13:02:54 +0000 (13:02 +0000)
10 years after r567503 , fix this properly.

The lock is created in post_config, so we can't copy it
around in a merge_server_config() callback.

Submitted by: covener
Reviewed by: covener, rpluem, jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1824872 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/ldap/util_ldap.c

diff --git a/CHANGES b/CHANGES
index 01ac798c0987fe3ac0133596e7ee9b07434b6c66..3ab0b273763053e3f87b81fd2616fd794bd2f323 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.31
 
+  *) mod_ldap: Avoid possible crashes, hangs, and busy loops due to
+     improper merging of the cache lock in vhost config.
+     PR 43164 [Eric Covener]
+
   *) mpm_event: Do lingering close in worker(s).  [Yann Ylavic]
 
   *) mpm_queue: Put fdqueue code in common for MPMs event and worker.
index 9df71134cf7d6117bd2b9b5bc47d1b7c1c31d0a0..08f986c3723b2f8cfac188b47373afa76e3f7768 100644 (file)
@@ -2858,7 +2858,6 @@ static void *util_ldap_merge_config(apr_pool_t *p, void *basev,
     st->search_cache_size = base->search_cache_size;
     st->compare_cache_ttl = base->compare_cache_ttl;
     st->compare_cache_size = base->compare_cache_size;
-    st->util_ldap_cache_lock = base->util_ldap_cache_lock;
 
     st->connections = NULL;
     st->ssl_supported = 0; /* not known until post-config and re-merged */
@@ -2977,12 +2976,12 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
             st_vhost = (util_ldap_state_t *)
                        ap_get_module_config(s_vhost->module_config,
                                             &ldap_module);
-
+            st_vhost->util_ldap_cache = st->util_ldap_cache;
+            st_vhost->util_ldap_cache_lock = st->util_ldap_cache_lock;
 #if APR_HAS_SHARED_MEMORY
             st_vhost->cache_shm = st->cache_shm;
             st_vhost->cache_rmm = st->cache_rmm;
             st_vhost->cache_file = st->cache_file;
-            st_vhost->util_ldap_cache = st->util_ldap_cache;
             ap_log_error(APLOG_MARK, APLOG_DEBUG, result, s, APLOGNO(01316)
                          "LDAP merging Shared Cache conf: shm=0x%pp rmm=0x%pp "
                          "for VHOST: %s", st->cache_shm, st->cache_rmm,