Description: [PATCH] Merge r1824811 from trunk:

 00:00:00 2001 From: Yann Ylavic <ylavic@apache.org> Date: Tue, 20 Feb 2018
 13:02:54 +0000 Subject: [PATCH] Merge r1824811 from trunk:

 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

Origin: upstream, http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c?r1=1824811&r2=1824810&pathrev=1824811
Origin: upstream, commit: 39ae6cd642689c20b599727ee1fb95233faabb05
Bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=58483
Bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=60296
Bug-Debian: https://bugs.debian.org/814980
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1752683
Reviewed-by: Rafael David Tinoco <rafael.tinoco@canonical.com>
Last-Update: 2018-03-01
Index: apache2-2.4.29/modules/ldap/util_ldap.c
===================================================================
--- apache2-2.4.29.orig/modules/ldap/util_ldap.c
+++ apache2-2.4.29/modules/ldap/util_ldap.c
@@ -2858,7 +2858,6 @@ static void *util_ldap_merge_config(apr_
     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_poo
             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,
