- for ( i = 0; i < mi->mi_ntargets; i++ ) {
- struct berval mdn = BER_BVNULL;
- struct berval mapped_attr = op->orc_ava->aa_desc->ad_cname;
- struct berval mapped_value = op->orc_ava->aa_value;
- metatarget_t *mt = mi->mi_targets[ i ];
- LDAPControl **ctrls = NULL;
-
- if ( ! META_IS_CANDIDATE( &candidates[ i ] ) ) {
- msgid[ i ] = -1;
- continue;
- }
-
- /*
- * Rewrite the compare dn, if needed
- */
- dc.target = mt;
-
- switch ( ldap_back_dn_massage( &dc, &op->o_req_dn, &mdn ) ) {
- case LDAP_UNWILLING_TO_PERFORM:
- rc = 1;
- goto finish;
-
- default:
- break;
- }
-
- /*
- * if attr is objectClass, try to remap the value
- */
- if ( op->orc_ava->aa_desc == slap_schema.si_ad_objectClass ) {
- ldap_back_map( &mt->mt_rwmap.rwm_oc,
- &op->orc_ava->aa_value,
- &mapped_value, BACKLDAP_MAP );
-
- if ( BER_BVISNULL( &mapped_value ) || mapped_value.bv_val[0] == '\0' ) {
- continue;
- }
- /*
- * else try to remap the attribute
- */
- } else {
- ldap_back_map( &mt->mt_rwmap.rwm_at,
- &op->orc_ava->aa_desc->ad_cname,
- &mapped_attr, BACKLDAP_MAP );
- if ( BER_BVISNULL( &mapped_attr ) || mapped_attr.bv_val[0] == '\0' ) {
- continue;
- }
-
- if ( op->orc_ava->aa_desc->ad_type->sat_syntax == slap_schema.si_syn_distinguishedName )
- {
- dc.ctx = "compareAttrDN";