]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9201 fix LDAP_THREAD_DEBUG
authorHoward Chu <hyc@openldap.org>
Thu, 3 Sep 2020 11:37:32 +0000 (12:37 +0100)
committerHoward Chu <hyc@openldap.org>
Thu, 3 Sep 2020 11:37:32 +0000 (12:37 +0100)
Add missing defs to ldap_thr_debug.h.
slap tools must init libldap so internal mutexes get inited.

libraries/libldap/init.c
libraries/libldap/ldap_thr_debug.h
servers/slapd/slapcommon.c

index 05a81c554bd8c7f1e8b6e3c4d0fb9fcdf761aa3f..93ff9713eea115718dfcb69224c64b7ffa64fb76 100644 (file)
@@ -604,6 +604,9 @@ void ldap_int_initialize_global_options( struct ldapoptions *gopts, int *dbglvl
        gopts->ldo_keepalive_interval = 0;
        gopts->ldo_keepalive_idle = 0;
 
+#ifdef LDAP_R_COMPILE
+       ldap_pvt_thread_mutex_init( &gopts->ldo_mutex );
+#endif
        gopts->ldo_valid = LDAP_INITIALIZED;
        return;
 }
index dd47986030cb7fd635d468aa4d50e7519a8e7621..cef2411c05cba6d60100b00791983150b37b7393 100644 (file)
@@ -83,6 +83,7 @@
 #define        ldap_pvt_thread_cond_broadcast  ldap_int_thread_cond_broadcast
 #define        ldap_pvt_thread_cond_wait               ldap_int_thread_cond_wait
 #define        ldap_pvt_thread_mutex_init              ldap_int_thread_mutex_init
+#define        ldap_pvt_thread_mutex_recursive_init            ldap_int_thread_mutex_recursive_init
 #define        ldap_pvt_thread_mutex_destroy   ldap_int_thread_mutex_destroy
 #define        ldap_pvt_thread_mutex_lock              ldap_int_thread_mutex_lock
 #define        ldap_pvt_thread_mutex_trylock   ldap_int_thread_mutex_trylock
 #define        ldap_pvt_thread_pool_pause              ldap_int_thread_pool_pause
 #define        ldap_pvt_thread_pool_resume             ldap_int_thread_pool_resume
 #define        ldap_pvt_thread_pool_destroy    ldap_int_thread_pool_destroy
+#define        ldap_pvt_thread_pool_close              ldap_int_thread_pool_close
+#define        ldap_pvt_thread_pool_free               ldap_int_thread_pool_free
 #define        ldap_pvt_thread_pool_getkey             ldap_int_thread_pool_getkey
 #define        ldap_pvt_thread_pool_setkey     ldap_int_thread_pool_setkey
 #define        ldap_pvt_thread_pool_purgekey   ldap_int_thread_pool_purgekey
  */
 #undef ldap_pvt_thread_pool_destroy
 #define        ldap_pvt_thread_pool_destroy(p,r) ldap_int_thread_pool_destroy(p,r)
+#if 0
 #define        ldap_pvt_thread_pool_close(p,r) ldap_int_thread_pool_close(p,r)
 #define        ldap_pvt_thread_pool_free(p) ldap_int_thread_pool_free(p)
 #endif
+#endif
 
 #ifdef LDAP_THREAD_DEBUG_IMPLEMENTATION        /* thr_debug.c */
 #undef ldap_pvt_thread_mutex_t
 #undef ldap_pvt_thread_cond_broadcast
 #undef ldap_pvt_thread_cond_wait
 #undef ldap_pvt_thread_mutex_init
+#undef ldap_pvt_thread_mutex_recursive_init
 #undef ldap_pvt_thread_mutex_destroy
 #undef ldap_pvt_thread_mutex_lock
 #undef ldap_pvt_thread_mutex_trylock
 #undef ldap_pvt_thread_pool_pause
 #undef ldap_pvt_thread_pool_resume
 #undef ldap_pvt_thread_pool_destroy
+#undef ldap_pvt_thread_pool_close
+#undef ldap_pvt_thread_pool_free
 #undef ldap_pvt_thread_pool_getkey
 #undef ldap_pvt_thread_pool_setkey
 #undef ldap_pvt_thread_pool_purgekey
index 303c9defb5d3f7b168e05ae8c37d1ee45d25f5b0..1dba2fbd49a3828a394818db130c44e7b5b06421 100644 (file)
@@ -294,6 +294,8 @@ slap_tool_init(
        ldif_debug = slap_debug;
 #endif
        ldap_syslog = 0;
+       /* make sure libldap gets init'd */
+       ldap_set_option( NULL, LDAP_OPT_DEBUG_LEVEL, &slap_debug );
 
 #ifdef CSRIMALLOC
        leakfilename = malloc( strlen( progname ) + STRLENOF( ".leak" ) + 1 );