httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: httpd-2.0/modules/ldap util_ldap.c
Date Tue, 12 Oct 2004 12:16:42 GMT
jorton      2004/10/12 05:16:42

  Modified:    modules/ldap util_ldap.c
  Log:
  * 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.
  
  Revision  Changes    Path
  1.15      +16 -2     httpd-2.0/modules/ldap/util_ldap.c
  
  Index: util_ldap.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ldap/util_ldap.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -d -w -u -r1.14 -r1.15
  --- util_ldap.c	3 Oct 2004 16:44:06 -0000	1.14
  +++ util_ldap.c	12 Oct 2004 12:16:42 -0000	1.15
  @@ -42,6 +42,10 @@
   #error mod_ldap requires APR-util to have LDAP support built in
   #endif
   
  +#ifdef AP_NEED_SET_MUTEX_PERMS
  +#include "unixd.h"
  +#endif
  +
       /* defines for certificate file types
       */
   #define LDAP_CA_TYPE_UNKNOWN            0
  @@ -1196,6 +1200,15 @@
               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 */
           s_vhost = s->next;
           while (s_vhost) {
  @@ -1271,8 +1284,9 @@
   static void util_ldap_child_init(apr_pool_t *p, server_rec *s)
   {
       apr_status_t sts;
  -    util_ldap_state_t *st =
  -        (util_ldap_state_t *)ap_get_module_config(s->module_config, &ldap_module);
  +    util_ldap_state_t *st = 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);
       if (sts != APR_SUCCESS) {
  
  
  

Mime
View raw message