From: Pierangelo Masarati Date: Mon, 27 Jan 2003 16:07:10 +0000 (+0000) Subject: fix objectclass mapping (to nothing) X-Git-Tag: NO_SLAP_OP_BLOCKS~492 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a62249ed27b11d7c72517b9e54e7d175d2fa9967;p=openldap fix objectclass mapping (to nothing) --- diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index ea47669efd..e9f7fad4ab 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -492,7 +492,7 @@ ldap_send_entry( while ( ber_scanf( &ber, "{m", &a ) != LBER_ERROR ) { ldap_back_map(&li->at_map, &a, &mapped, 1); - if (mapped.bv_val == NULL) + if (mapped.bv_val == NULL || mapped.bv_val[0] == '\0') continue; attr = (Attribute *)ch_malloc( sizeof(Attribute) ); if (attr == NULL) @@ -537,7 +537,7 @@ ldap_send_entry( for ( last = 0; attr->a_vals[last].bv_val; last++ ) ; for ( i = 0, bv = attr->a_vals; bv->bv_val; bv++, i++ ) { ldap_back_map(&li->oc_map, bv, &mapped, 1); - if (mapped.bv_val == NULL) { + if (mapped.bv_val == NULL || mapped.bv_val[0] == '\0') { LBER_FREE(bv->bv_val); bv->bv_val = NULL; if (--last < 0) diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 91e70bed0c..feea9132d8 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -727,7 +727,7 @@ meta_send_entry( while ( ber_scanf( &ber, "{m", &a ) != LBER_ERROR ) { ldap_back_map( &li->targets[ target ]->at_map, &a, &mapped, 1 ); - if ( mapped.bv_val == NULL ) { + if ( mapped.bv_val == NULL || mapped.bv_val[0] == '\0' ) { continue; } attr = ( Attribute * )ch_malloc( sizeof( Attribute ) ); @@ -771,7 +771,7 @@ meta_send_entry( for ( i = 0, bv = attr->a_vals; bv->bv_val; bv++, i++ ) { ldap_back_map( &li->targets[ target]->oc_map, bv, &mapped, 1 ); - if ( mapped.bv_val == NULL ) { + if ( mapped.bv_val == NULL || mapped.bv_val[0] == '\0') { free( bv->bv_val ); bv->bv_val = NULL; if ( --last < 0 ) {