]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Update server cred handling
authorKurt Zeilenga <kurt@openldap.org>
Wed, 17 Jan 2001 02:33:46 +0000 (02:33 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 17 Jan 2001 02:33:46 +0000 (02:33 +0000)
libraries/libldap/cyrus.c

index 6d213f3da4fded78810dd8e165e09e183caf341f..4eb6bf0ee4273962212abbeb99ae84f7119be6ae 100644 (file)
@@ -563,7 +563,7 @@ ldap_int_sasl_bind(
                }
 
                if ( rc != LDAP_SUCCESS && rc != LDAP_SASL_BIND_IN_PROGRESS ) {
-                       if( scred ) {
+                       if( scred && scred->bv_len ) {
                                /* and server provided us with data? */
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
@@ -575,7 +575,7 @@ ldap_int_sasl_bind(
 
                if( rc == LDAP_SUCCESS && saslrc == SASL_OK ) {
                        /* we're done, no need to step */
-                       if( scred ) {
+                       if( scred && scred->bv_len ) {
                                /* but server provided us with data! */
                                Debug( LDAP_DEBUG_TRACE,
                                        "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
@@ -661,9 +661,15 @@ ldap_int_sasl_external(
        ber_len_t ssf )
 {
        int sc;
-       sasl_conn_t *ctx = ld->ld_defconn->lconn_sasl_ctx;
+       sasl_conn_t *ctx;
        sasl_external_properties_t extprops;
-    
+
+       if( ld->ld_defconn == NULL ) {
+               return LDAP_LOCAL_ERROR;
+       }
+
+       ctx = ld->ld_defconn->lconn_sasl_ctx;
+
        if ( ctx == NULL ) {
                return LDAP_LOCAL_ERROR;
        }