pretty the DN as well

This commit is contained in:
Pierangelo Masarati 2005-09-06 17:19:36 +00:00
parent 4687de2062
commit a1ff59f436

View file

@ -867,9 +867,11 @@ meta_send_entry(
Entry ent = { 0 };
BerElement ber = *e->lm_ber;
Attribute *attr, **attrp;
struct berval *bv, bdn;
struct berval bdn,
dn = BER_BVNULL;
const char *text;
dncookie dc;
int rc;
if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
return LDAP_DECODING_ERROR;
@ -883,7 +885,7 @@ meta_send_entry(
dc.rs = rs;
dc.ctx = "searchResult";
rs->sr_err = ldap_back_dn_massage( &dc, &bdn, &ent.e_name );
rs->sr_err = ldap_back_dn_massage( &dc, &bdn, &dn );
if ( rs->sr_err != LDAP_SUCCESS) {
return rs->sr_err;
}
@ -895,9 +897,14 @@ meta_send_entry(
*
* FIXME: should we log anything, or delegate to dnNormalize?
*/
if ( dnNormalize( 0, NULL, NULL, &ent.e_name, &ent.e_nname,
op->o_tmpmemctx ) != LDAP_SUCCESS )
{
rc = dnPrettyNormal( NULL, &dn, &ent.e_name, &ent.e_nname,
op->o_tmpmemctx );
if ( dn.bv_val != bdn.bv_val ) {
free( dn.bv_val );
}
BER_BVZERO( &dn );
if ( rc != LDAP_SUCCESS ) {
return LDAP_INVALID_DN_SYNTAX;
}
@ -992,6 +999,8 @@ meta_send_entry(
if ( attr->a_desc == slap_schema.si_ad_objectClass
|| attr->a_desc == slap_schema.si_ad_structuralObjectClass )
{
struct berval *bv;
for ( bv = attr->a_vals; !BER_BVISNULL( bv ); bv++ ) {
ldap_back_map( &mi->mi_targets[ target ].mt_rwmap.rwm_oc,
bv, &mapped, BACKLDAP_REMAP );
@ -1084,9 +1093,7 @@ next_attr:;
rs->sr_attrs = NULL;
if ( !BER_BVISNULL( &ent.e_name ) ) {
if ( ent.e_name.bv_val != bdn.bv_val ) {
free( ent.e_name.bv_val );
}
free( ent.e_name.bv_val );
BER_BVZERO( &ent.e_name );
}
if ( !BER_BVISNULL( &ent.e_nname ) ) {