From c2efb8788b733833fb4efc31e1278e14d5cc4fd4 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 29 Aug 2002 16:03:38 +0000 Subject: [PATCH] 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"). --- libraries/libldap/cyrus.c | 4 ++++ 1 file changed, 4 insertions(+) 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 ); } -- 2.39.5