mapped_at = op->orc_ava->aa_desc->ad_cname;
} else {
- rwm_map( &rwmap->rwm_at, &op->orc_ava->aa_desc->ad_cname,
- &mapped_at, RWM_MAP );
- if ( BER_BVISNULL( &mapped_at ) || BER_BVISEMPTY( &mapped_at ) )
- {
- op->o_bd->bd_info = (BackendInfo *)on->on_info;
- send_ldap_error( op, rs, LDAP_OTHER, "compare attributeType map error" );
- return -1;
+ struct ldapmapping *mapping = NULL;
+ AttributeDescription *ad = op->orc_ava->aa_desc;
+
+ ( void )rwm_mapping( &rwmap->rwm_at, &op->orc_ava->aa_desc->ad_cname,
+ &mapping, RWM_MAP );
+ if ( mapping == NULL ) {
+ if ( rwmap->rwm_at.drop_missing ) {
+ op->o_bd->bd_info = (BackendInfo *)on->on_info;
+ send_ldap_error( op, rs, LDAP_OTHER, "compare attributeType map error" );
+ return -1;
+ }
+
+ } else {
+ ad = mapping->m_dst_ad;
}
+
if ( op->orc_ava->aa_desc->ad_type->sat_syntax == slap_schema.si_syn_distinguishedName )
{
struct berval *mapped_valsp[2];
op->orc_ava->aa_value = mapped_vals[0];
}
+ op->orc_ava->aa_desc = ad;
}
return SLAP_CB_CONTINUE;
struct ldapmapping *mapping;
BER_BVZERO( bv );
- rwm_mapping( map, s, &mapping, remap );
+ ( void )rwm_mapping( map, s, &mapping, remap );
if ( mapping != NULL ) {
if ( !BER_BVISNULL( &mapping->m_dst ) ) {
*bv = mapping->m_dst;
switch ( rewrite_session( fdc.rwmap->rwm_rw, fdc.ctx,
( !BER_BVISEMPTY( &ftmp ) ? ftmp.bv_val : "" ),
- fdc.conn, &fstr->bv_val )) {
+ fdc.conn, &fstr->bv_val ) )
+ {
case REWRITE_REGEXEC_OK:
if ( !BER_BVISNULL( fstr ) ) {
fstr->bv_len = strlen( fstr->bv_val );
Debug( LDAP_DEBUG_ARGS,
"[rw] %s: \"%s\" -> \"%s\"\n",
- dc->ctx, ftmp.bv_val, fstr->bv_val );
+ fdc.ctx, ftmp.bv_val, fstr->bv_val );
rc = LDAP_SUCCESS;
break;
* legal to trim values when adding/modifying;
* it should be when searching (e.g. ACLs).
*/
- ch_free( &a_vals[i].bv_val );
+ ch_free( a_vals[i].bv_val );
if ( last > i ) {
a_vals[i] = a_vals[last];
}
BER_BVZERO( &a_vals[last] );
last--;
+ i--;
break;
default:
* legal to trim values when adding/modifying;
* it should be when searching (e.g. ACLs).
*/
- ch_free( &a_vals[i].bv_val );
+ ch_free( a_vals[i].bv_val );
if ( last > i ) {
a_vals[i] = a_vals[last];
}