int rc = LDAP_SUCCESS;
const char *text;
struct berval cred = { 0, NULL };
- Backend *be;
+ Backend *be = NULL;
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ENTRY, "do_bind: conn %d\n", conn->c_connid, 0, 0 );
goto cleanup;
}
+ /* Set the bindop for the benefit of in-directory SASL lookups */
+ ldap_pvt_thread_mutex_lock( &conn->c_sasl_bindmutex );
+ conn->c_sasl_bindop = op;
+
if ( method == LDAP_AUTH_SASL ) {
slap_ssf_t ssf = 0;
LBER_SB_OPT_SET_MAX_INCOMING, &max );
}
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, DETAIL1,
+ "do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
+ conn->c_authmech.bv_val, conn->c_dn.bv_val, ssf );
+#else
+ Debug( LDAP_DEBUG_TRACE,
+ "do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
+ conn->c_authmech.bv_val, conn->c_dn.bv_val, ssf );
+#endif
+
} else if ( rc == LDAP_SASL_BIND_IN_PROGRESS ) {
conn->c_sasl_bind_in_progress = 1;
}
cleanup:
+ if( conn->c_sasl_bindop != NULL ) {
+ conn->c_sasl_bindop = NULL;
+ ldap_pvt_thread_mutex_unlock( &conn->c_sasl_bindmutex );
+ }
+
if( pdn.bv_val != NULL ) {
free( pdn.bv_val );
}