]> git.sur5r.net Git - openldap/commitdiff
fix objectclass mapping (to nothing)
authorPierangelo Masarati <ando@openldap.org>
Mon, 27 Jan 2003 16:07:10 +0000 (16:07 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 27 Jan 2003 16:07:10 +0000 (16:07 +0000)
servers/slapd/back-ldap/search.c
servers/slapd/back-meta/search.c

index ea47669efdbb1d994b1f137cb463b45e5d49399d..e9f7fad4abdab0fc60bfefe4226920fc3297c979 100644 (file)
@@ -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)
index 91e70bed0c184f94767cfe36366f1084844ca6d4..feea9132d8c153f38f9728905454400c2f1d7aa2 100644 (file)
@@ -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 ) {