]> git.sur5r.net Git - openldap/commitdiff
slapd returned "partial results and referral" even when no default
authorKurt Zeilenga <kurt@openldap.org>
Fri, 23 Oct 1998 22:20:45 +0000 (22:20 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 23 Oct 1998 22:20:45 +0000 (22:20 +0000)
referral has been configured in the server.  Fix provided by Hallvard.

servers/slapd/bind.c
servers/slapd/result.c

index 562ce5b54ab6c08665074201735a7ab76cc798a2..fbffeebc9fae67fd80dc51637beccb11ef1e99be 100644 (file)
@@ -143,10 +143,14 @@ do_bind(
                        free( cred.bv_val );
                }
                if ( cred.bv_len == 0 ) {
-                       send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL );
+                       send_ldap_result( conn, op, LDAP_SUCCESS,
+                               NULL, NULL );
+               } else if ( default_referral && *default_referral ) {
+                       send_ldap_result( conn, op, LDAP_PARTIAL_RESULTS,
+                               NULL, default_referral );
                } else {
-                       send_ldap_result( conn, op, LDAP_PARTIAL_RESULTS, NULL,
-                           default_referral );
+                       send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
+                               NULL, default_referral );
                }
                return;
        }
index 7d1396f02646006f25b769dbc8ae5ec8a1f6fca9..e8f4be47d6dd052c7edb8683c9a1c2d2057e14b5 100644 (file)
@@ -40,6 +40,9 @@ send_ldap_result2(
        int             rc, sd;
        unsigned long   tag, bytes;
 
+       if ( err == LDAP_PARTIAL_RESULTS && (text == NULL || *text == '\0') )
+               err = LDAP_NO_SUCH_OBJECT;
+
        Debug( LDAP_DEBUG_TRACE, "send_ldap_result %d:%s:%s\n", err, matched ?
            matched : "", text ? text : "" );