From: Pierangelo Masarati Date: Thu, 29 Aug 2002 16:03:38 +0000 (+0000) Subject: when shutting down a server with open connections (back-{ldap,meta}), X-Git-Tag: NO_SLAP_OP_BLOCKS~1105 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c2efb8788b733833fb4efc31e1278e14d5cc4fd4;p=openldap when shutting down a server with open connections (back-{ldap,meta}), the backend attempts a ldap_unbind() that results in calling ldap_pvt_sasl_mutex_lock() with a NULL argument, causing a SIGSEGV. I added a few assert() to catch this (I wonder if this might be related to ITS#1982 "kill -INT corrupts database"). --- diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index f2491f3c38..b0dce244d0 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -1103,23 +1103,27 @@ void *ldap_pvt_sasl_mutex_new(void) if ( ldap_pvt_thread_mutex_init( mutex ) == 0 ) { return mutex; } + assert( 0 ); return NULL; } int ldap_pvt_sasl_mutex_lock(void *mutex) { + assert( mutex ); return ldap_pvt_thread_mutex_lock( (ldap_pvt_thread_mutex_t *)mutex ) ? SASL_FAIL : SASL_OK; } int ldap_pvt_sasl_mutex_unlock(void *mutex) { + assert( mutex ); return ldap_pvt_thread_mutex_unlock( (ldap_pvt_thread_mutex_t *)mutex ) ? SASL_FAIL : SASL_OK; } void ldap_pvt_sasl_mutex_dispose(void *mutex) { + assert( mutex ); (void) ldap_pvt_thread_mutex_destroy( (ldap_pvt_thread_mutex_t *)mutex ); LDAP_FREE( mutex ); }