mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
add "matchedDN" field when appropriate
This commit is contained in:
parent
904d86a28a
commit
ba0f3112c4
@ -103,9 +103,10 @@ meta_back_is_candidate_unique(
|
||||
/*
|
||||
* meta_back_select_unique_candidate
|
||||
*
|
||||
* returns the index of the candidate in case it is unique, otherwise -1
|
||||
* Note: dn MUST be normalized.
|
||||
* Note: if defined, the default candidate is returned in case of no match.
|
||||
* returns the index of the candidate in case it is unique, otherwise
|
||||
* META_TARGET_NONE if none matches, or
|
||||
* META_TARGET_MULTIPLE if more than one matches
|
||||
* Note: ndn MUST be normalized.
|
||||
*/
|
||||
int
|
||||
meta_back_select_unique_candidate(
|
||||
|
@ -707,6 +707,27 @@ meta_back_getconn(
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ncandidates == 0 ) {
|
||||
if ( new_conn ) {
|
||||
meta_back_conn_free( mc );
|
||||
}
|
||||
|
||||
rs->sr_err = LDAP_NO_SUCH_OBJECT;
|
||||
rs->sr_text = "Unable to select valid candidates";
|
||||
|
||||
if ( sendok & LDAP_BACK_SENDERR ) {
|
||||
if ( rs->sr_err == LDAP_NO_SUCH_OBJECT ) {
|
||||
rs->sr_matched = op->o_bd->be_suffix[ 0 ].bv_val;
|
||||
}
|
||||
send_ldap_result( op, rs );
|
||||
rs->sr_text = NULL;
|
||||
rs->sr_matched = NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -737,8 +758,12 @@ meta_back_getconn(
|
||||
|
||||
if ( rs->sr_err != LDAP_SUCCESS ) {
|
||||
if ( sendok & LDAP_BACK_SENDERR ) {
|
||||
if ( rs->sr_err == LDAP_NO_SUCH_OBJECT ) {
|
||||
rs->sr_matched = op->o_bd->be_suffix[ 0 ].bv_val;
|
||||
}
|
||||
send_ldap_result( op, rs );
|
||||
rs->sr_text = NULL;
|
||||
rs->sr_matched = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -876,8 +901,12 @@ meta_back_getconn(
|
||||
rs->sr_text = "Unable to select valid candidates";
|
||||
|
||||
if ( sendok & LDAP_BACK_SENDERR ) {
|
||||
if ( rs->sr_err == LDAP_NO_SUCH_OBJECT ) {
|
||||
rs->sr_matched = op->o_bd->be_suffix[ 0 ].bv_val;
|
||||
}
|
||||
send_ldap_result( op, rs );
|
||||
rs->sr_text = NULL;
|
||||
rs->sr_matched = NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user