mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
* modules/ldap/util_ldap.c (util_ldap_child_init): Don't segfault if
the cache has been disabled (when _cache_lock == NULL). (util_ldap_post_config): Set mutex permissions if necessary. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105412 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -40,6 +40,10 @@
|
|||||||
|
|
||||||
#if !APR_HAS_LDAP
|
#if !APR_HAS_LDAP
|
||||||
#error mod_ldap requires APR-util to have LDAP support built in
|
#error mod_ldap requires APR-util to have LDAP support built in
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef AP_NEED_SET_MUTEX_PERMS
|
||||||
|
#include "unixd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* defines for certificate file types
|
/* defines for certificate file types
|
||||||
@@ -1196,6 +1200,15 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AP_NEED_SET_MUTEX_PERMS
|
||||||
|
result = unixd_set_global_mutex_perms(st->util_ldap_cache_lock);
|
||||||
|
if (result != APR_SUCCESS) {
|
||||||
|
ap_log_error(APLOG_MARK, APLOG_CRIT, result, s,
|
||||||
|
"LDAP cache: failed to set mutex permissions");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* merge config in all vhost */
|
/* merge config in all vhost */
|
||||||
s_vhost = s->next;
|
s_vhost = s->next;
|
||||||
while (s_vhost) {
|
while (s_vhost) {
|
||||||
@@ -1271,8 +1284,9 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
|
|||||||
static void util_ldap_child_init(apr_pool_t *p, server_rec *s)
|
static void util_ldap_child_init(apr_pool_t *p, server_rec *s)
|
||||||
{
|
{
|
||||||
apr_status_t sts;
|
apr_status_t sts;
|
||||||
util_ldap_state_t *st =
|
util_ldap_state_t *st = ap_get_module_config(s->module_config, &ldap_module);
|
||||||
(util_ldap_state_t *)ap_get_module_config(s->module_config, &ldap_module);
|
|
||||||
|
if (!st->util_ldap_cache_lock) return;
|
||||||
|
|
||||||
sts = apr_global_mutex_child_init(&st->util_ldap_cache_lock, st->lock_file, p);
|
sts = apr_global_mutex_child_init(&st->util_ldap_cache_lock, st->lock_file, p);
|
||||||
if (sts != APR_SUCCESS) {
|
if (sts != APR_SUCCESS) {
|
||||||
|
Reference in New Issue
Block a user