From 238f7361d66d6920c47f9c478f2dba87e276c55d Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 23 Oct 1998 22:20:45 +0000 Subject: [PATCH] slapd returned "partial results and referral" even when no default referral has been configured in the server. Fix provided by Hallvard. --- servers/slapd/bind.c | 10 +++++++--- servers/slapd/result.c | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 562ce5b54a..fbffeebc9f 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -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; } diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 7d1396f026..e8f4be47d6 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -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 : "" );