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").
This commit is contained in:
Pierangelo Masarati 2002-08-29 16:03:38 +00:00
parent 58b860a15e
commit c2efb8788b

View File

@ -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 );
}