]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/bind.c
Fix typo
[openldap] / servers / slapd / bind.c
index 63338b7e671798b14794d8867063b66be373c726..1129fa6f43793cff77935abd925be92935440582 100644 (file)
@@ -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 );
                        }
@@ -416,7 +419,7 @@ do_bind(
                        goto cleanup;
 
                } else if (( global_disallows & SLAP_DISALLOW_BIND_SIMPLE_UNPROTECTED )
-                       && ( op->o_ssf < global_ssf_set.sss_ssf ))
+                       && ( op->o_ssf <= 1 ))
                {
                        rc = LDAP_CONFIDENTIALITY_REQUIRED;
                        text = "unwilling to perform simple authentication "
@@ -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 );
        }