struct berval match = { 0, NULL }, mmatch = { 0, NULL };
BerVarray v2refs = NULL;
- int i, last = 0, candidates = 0;
+ int i, last = 0, candidates = 0, initial_candidates = 0,
+ candidate_match = 0;
struct slap_limits_set *limit = NULL;
int isroot = 0;
dncookie dc;
new_candidate:;
}
+ initial_candidates = candidates;
+
/* We pull apart the ber result, stuff it into a slapd entry, and
* let send_search_entry stuff it back into ber format. Slow & ugly,
* but this is necessary for version matching, and for ACL processing.
"match=\"%s\" err=\"%s\"\n",
i, match.bv_val, err );
#endif /* !NEW_LOGGING */
-
+ candidate_match++;
last = i;
rc = 0;
*
* FIXME: only the last one gets caught!
*/
- if ( match.bv_val != NULL && *match.bv_val ) {
+ if ( candidate_match == initial_candidates
+ && match.bv_val != NULL && *match.bv_val ) {
dc.ctx = "matchedDn";
dc.rwmap = &li->targets[ last ]->rwmap;
slap_schema.si_syn_distinguishedName ) {
ldap_dnattr_result_rewrite( &dc, attr->a_vals );
}
-next_attr:;
*attrp = attr;
attrp = &attr->a_next;