Commit 243bea00 authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

Fix CONFIG_DELETE crash

Closing a connection can abandon its ops without going thru the threadpool,
so make sure to lock the si_ops_mutex before walking the list.
parent f70ae7a9
......@@ -3172,6 +3172,7 @@ syncprov_db_close(
#ifdef SLAP_CONFIG_DELETE
if ( !slapd_shutdown ) {
ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
for ( so=si->si_ops, sonext=so; so; so=sonext ) {
SlapReply rs = {REP_RESULT};
rs.sr_err = LDAP_UNAVAILABLE;
......@@ -3180,6 +3181,7 @@ syncprov_db_close(
syncprov_drop_psearch( so, 0);
}
si->si_ops=NULL;
ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
}
overlay_unregister_control( be, LDAP_CONTROL_SYNC );
#endif /* SLAP_CONFIG_DELETE */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment