mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
PR63305: fix graceful restart crashes in LDAP
The cache destruction was not protected by the lock used by other cache callers. Pull the static cleanup function into util_ldap.c so it's convenient to use the existing locking. Submitted By: Martin Fúsek <mfusek newps.cz> Commited By: covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1856735 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -396,26 +396,6 @@ void util_ldap_dn_compare_node_display(request_rec *r, util_ald_cache_t *cache,
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
static apr_status_t util_ldap_cache_module_kill(void *data)
|
||||
{
|
||||
util_ldap_state_t *st = data;
|
||||
|
||||
util_ald_destroy_cache(st->util_ldap_cache);
|
||||
#if APR_HAS_SHARED_MEMORY
|
||||
if (st->cache_rmm != NULL) {
|
||||
apr_rmm_destroy (st->cache_rmm);
|
||||
st->cache_rmm = NULL;
|
||||
}
|
||||
if (st->cache_shm != NULL) {
|
||||
apr_status_t result = apr_shm_destroy(st->cache_shm);
|
||||
st->cache_shm = NULL;
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
apr_status_t util_ldap_cache_init(apr_pool_t *pool, util_ldap_state_t *st)
|
||||
{
|
||||
#if APR_HAS_SHARED_MEMORY
|
||||
@@ -449,8 +429,6 @@ apr_status_t util_ldap_cache_init(apr_pool_t *pool, util_ldap_state_t *st)
|
||||
|
||||
#endif
|
||||
|
||||
apr_pool_cleanup_register(st->pool, st , util_ldap_cache_module_kill, apr_pool_cleanup_null);
|
||||
|
||||
st->util_ldap_cache =
|
||||
util_ald_create_cache(st,
|
||||
st->search_cache_size,
|
||||
|
Reference in New Issue
Block a user