X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fbind.c;h=646b72f657ceec50b444242951c51e4818898a6e;hb=9ba829436e33d42f918f377a7b636869f7a9c371;hp=63338b7e671798b14794d8867063b66be373c726;hpb=84fe0ad051d23fd5057254f9d26da33fe5ebee31;p=openldap diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 63338b7e67..646b72f657 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -45,7 +45,7 @@ do_bind( 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 ); @@ -231,6 +231,9 @@ do_bind( goto cleanup; } + /* Set the bindop for the benefit of in-directory SASL lookups */ + conn->c_sasl_bindop = op; + if ( method == LDAP_AUTH_SASL ) { slap_ssf_t ssf = 0; @@ -274,7 +277,7 @@ do_bind( ldap_pvt_thread_mutex_lock( &conn->c_mutex ); if ( conn->c_sasl_bind_in_progress ) { - if((ber_bvcmp(&conn->c_sasl_bind_mech, &mech) != 0)) { + if( !bvmatch( &conn->c_sasl_bind_mech, &mech ) ) { /* mechanism changed between bind steps */ slap_sasl_reset(conn); } @@ -307,7 +310,7 @@ do_bind( } if( conn->c_dn.bv_len != 0 ) { - ber_len_t max = sockbuf_max_incoming; + ber_len_t max = sockbuf_max_incoming_auth; ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max ); } @@ -538,7 +541,7 @@ do_bind( ndn.bv_len = 0; if( conn->c_dn.bv_len != 0 ) { - ber_len_t max = sockbuf_max_incoming; + ber_len_t max = sockbuf_max_incoming_auth; ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max ); } @@ -570,6 +573,8 @@ do_bind( } cleanup: + conn->c_sasl_bindop = NULL; + if( pdn.bv_val != NULL ) { free( pdn.bv_val ); }