Fix setting c_authz_backend for SASL binds:

in slap_sasl2dn, make sure it's set for base DN searches as well.
  in do_bind, don't zero it during multi-stage binds.
This commit is contained in:
Howard Chu 2002-07-13 00:11:03 +00:00
parent 7fdb38bca9
commit a073e28510
2 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,9 @@ do_bind(
* Force to connection to "anonymous" until bind succeeds. * Force to connection to "anonymous" until bind succeeds.
*/ */
ldap_pvt_thread_mutex_lock( &conn->c_mutex ); ldap_pvt_thread_mutex_lock( &conn->c_mutex );
if ( conn->c_sasl_bind_in_progress ) be = conn->c_authz_backend;
connection2anonymous( conn ); connection2anonymous( conn );
if ( conn->c_sasl_bind_in_progress ) conn->c_authz_backend = be;
ldap_pvt_thread_mutex_unlock( &conn->c_mutex ); ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
if ( op->o_dn.bv_val != NULL ) { if ( op->o_dn.bv_val != NULL ) {

View File

@ -495,11 +495,10 @@ void slap_sasl2dn( Connection *conn, struct berval *saslname, struct berval *dn
uri.scope, LDAP_DEREF_NEVER, 1, 0, uri.scope, LDAP_DEREF_NEVER, 1, 0,
filter, NULL, NULL, 1 ); filter, NULL, NULL, 1 );
FINISHED:
if( dn->bv_len ) { if( dn->bv_len ) {
conn->c_authz_backend = be; conn->c_authz_backend = be;
} }
FINISHED:
if( uri.dn.bv_len ) ch_free( uri.dn.bv_val ); if( uri.dn.bv_len ) ch_free( uri.dn.bv_val );
if( uri.filter.bv_len ) ch_free( uri.filter.bv_val ); if( uri.filter.bv_len ) ch_free( uri.filter.bv_val );
if( filter ) filter_free( filter ); if( filter ) filter_free( filter );