]> git.sur5r.net Git - openldap/commitdiff
bind should not return noSuchObject
authorKurt Zeilenga <kurt@openldap.org>
Fri, 24 Sep 1999 02:19:31 +0000 (02:19 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 24 Sep 1999 02:19:31 +0000 (02:19 +0000)
servers/slapd/back-bdb2/bind.c
servers/slapd/back-ldbm/bind.c

index 40652e55792cbdf08b6b6c79b211a768ec92c510..7455b1fc8cbc4193136d13d4c0b312229064336c 100644 (file)
@@ -113,9 +113,13 @@ bdb2i_back_bind_internal(
                                *edn = ch_strdup( be_root_dn( be ) );
                                rc = 0;
 
-                       } else {
+                       } else if ( refs != NULL ) {
                                send_ldap_result( conn, op, LDAP_REFERRAL,
                                        matched_dn, NULL, refs, NULL );
+
+                       } else {
+                               send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
+                                       NULL, NULL, NULL, NULL );
                        }
 
                } else if ( method == LDAP_AUTH_SASL ) {
@@ -129,10 +133,13 @@ bdb2i_back_bind_internal(
                                        NULL, NULL, NULL, NULL );
                        }
 
-               } else {
+               } else if ( refs != NULL ) {
                        send_ldap_result( conn, op, LDAP_REFERRAL,
                                matched_dn, NULL, refs, NULL );
-                       rc = 1;
+
+               } else {
+                       send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
+                               NULL, NULL, NULL, NULL );
                }
 
                if ( matched != NULL ) {
@@ -157,7 +164,7 @@ bdb2i_back_bind_internal(
 
        if ( is_entry_alias( e ) ) {
                /* entry is a alias, don't allow bind */
-               Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
+               Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0,
                        0, 0 );
 
                send_ldap_result( conn, op, LDAP_ALIAS_PROBLEM,
@@ -176,8 +183,13 @@ bdb2i_back_bind_internal(
                Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
                        0, 0 );
 
-               send_ldap_result( conn, op, LDAP_REFERRAL,
-                       e->e_dn, NULL, refs, NULL );
+               if( refs != NULL ) {
+                       send_ldap_result( conn, op, LDAP_REFERRAL,
+                               e->e_dn, NULL, refs, NULL );
+               } else {
+                       send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
+                               NULL, NULL, NULL, NULL );
+               }
 
                ber_bvecfree( refs );
 
index aa6013372594cd89fcf35f2058738f899af9cdaa..52234e336a97c7b926842b9bfc797c2158b5c90b 100644 (file)
@@ -120,9 +120,13 @@ ldbm_back_bind(
                                *edn = ch_strdup( be_root_dn( be ) );
                                rc = 0; /* front end will send result */
 
-                       } else {
+                       } else if ( refs != NULL ) {
                                send_ldap_result( conn, op, LDAP_REFERRAL,
                                        matched_dn, NULL, refs, NULL );
+
+                       } else {
+                               send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
+                                       NULL, NULL, NULL, NULL );
                        }
 
                } else if ( method == LDAP_AUTH_SASL ) {
@@ -136,9 +140,13 @@ ldbm_back_bind(
                                        NULL, NULL, NULL, NULL );
                        }
 
-               } else {
+               } else if ( refs != NULL ) {
                        send_ldap_result( conn, op, LDAP_REFERRAL,
                                matched_dn, NULL, refs, NULL );
+
+               } else {
+                       send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
+                               NULL, NULL, NULL, NULL );
                }
 
                if ( matched != NULL ) {
@@ -181,8 +189,14 @@ ldbm_back_bind(
                Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
                    0, 0 );
 
-               send_ldap_result( conn, op, LDAP_REFERRAL,
-                   e->e_dn, NULL, refs, NULL );
+               if( refs != NULL ) {
+                       send_ldap_result( conn, op, LDAP_REFERRAL,
+                               e->e_dn, NULL, refs, NULL );
+
+               } else {
+                       send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
+                               NULL, NULL, NULL, NULL );
+               }
 
                ber_bvecfree( refs );