fix normalizable/non-normalizable attr mapping \& merging (ITS#5624)

This commit is contained in:
Pierangelo Masarati 2008-08-04 21:20:06 +00:00
parent 785fafa36e
commit 80df2a2906

View File

@ -107,9 +107,14 @@ rwm_op_cleanup( Operation *op, SlapReply *rs )
case LDAP_REQ_BIND:
if ( rs->sr_err == LDAP_SUCCESS ) {
#if 0
/* too late, conn_mutex released */
ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
/* too late, c_mutex released */
fprintf( stderr, "*** DN: \"%s\" => \"%s\"\n",
op->o_conn->c_ndn.bv_val,
op->o_req_ndn.bv_val );
ber_bvreplace( &op->o_conn->c_ndn,
&op->o_req_ndn );
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
#endif
}
break;
@ -1058,11 +1063,12 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first, int stripEntryDN )
/* try to normalize mapped Attributes if the original
* AttributeType was not normalized */
if ((rwmap->rwm_flags & RWM_F_NORMALIZE_MAPPED_ATTRS) &&
(!(*ap)->a_desc->ad_type->sat_equality ||
if ( (!(*ap)->a_desc->ad_type->sat_equality ||
!(*ap)->a_desc->ad_type->sat_equality->smr_normalize) &&
mapping->m_dst_ad->ad_type->sat_equality &&
mapping->m_dst_ad->ad_type->sat_equality->smr_normalize )
{
if ((rwmap->rwm_flags & RWM_F_NORMALIZE_MAPPED_ATTRS))
{
int i = 0;
@ -1090,6 +1096,12 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first, int stripEntryDN )
}
BER_BVZERO( &(*ap)->a_nvals[i] );
}
} else {
assert( (*ap)->a_nvals == (*ap)->a_vals );
(*ap)->a_nvals = NULL;
ber_bvarray_dup_x( &(*ap)->a_nvals, (*ap)->a_vals, NULL );
}
}
/* rewrite the attribute description */