From: Kurt Zeilenga Date: Fri, 24 Sep 1999 02:19:31 +0000 (+0000) Subject: bind should not return noSuchObject X-Git-Tag: UCDATA_2_4~381 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5c876f85e609b55dea00c6eed1fa31bf7f08cd49;p=openldap bind should not return noSuchObject --- diff --git a/servers/slapd/back-bdb2/bind.c b/servers/slapd/back-bdb2/bind.c index 40652e5579..7455b1fc8c 100644 --- a/servers/slapd/back-bdb2/bind.c +++ b/servers/slapd/back-bdb2/bind.c @@ -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 ); diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index aa60133725..52234e336a 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -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 );