]> git.sur5r.net Git - openldap/commitdiff
more fixes/updates
authorPierangelo Masarati <ando@openldap.org>
Fri, 4 Jan 2002 19:23:10 +0000 (19:23 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 4 Jan 2002 19:23:10 +0000 (19:23 +0000)
servers/slapd/back-ldap/map.c
servers/slapd/back-meta/search.c

index 888b61df4a5310b6a99611d92727e257175dc34f..5e0dc55026ba4d8de7b137f0068b259bc5c642f0 100644 (file)
@@ -236,6 +236,8 @@ ldap_back_map_attrs(
                        i++;
                }
        }
+       na[i] = NULL;
+
        return(na);
 }
 
index 699f6e8b0643bc35773d374c9daeeecfc8a231d0..9b9f1cabea3f30de4a94165cda1a43254c8ab353 100644 (file)
@@ -347,7 +347,7 @@ meta_back_search(
                if ( mapped_filter == NULL ) {
                        mapped_filter = ( char * )mfilter.bv_val;
                } else {
-                       ber_memfree( mfilter.bv_val );
+                       free( mfilter.bv_val );
                }
                mfilter.bv_val = NULL;
                mfilter.bv_len = 0;
@@ -641,6 +641,9 @@ meta_send_entry(
        while ( ber_scanf( &ber, "{o", &a ) != LBER_ERROR ) {
                ldap_back_map( &li->targets[ target ]->at_map, 
                                &a, &mapped, 1 );
+               if ( mapped.bv_val != a.bv_val ) {
+                       free( a.bv_val );
+               }
                if ( mapped.bv_val == NULL ) {
                        continue;
                }
@@ -668,9 +671,16 @@ meta_send_entry(
                        }
                }
 
+               /* no subschemaSubentry */
+               if ( attr->a_desc == slap_schema.si_ad_subschemaSubentry ) {
+                       ch_free(attr);
+                       continue;
+               }
+
                if ( ber_scanf( &ber, "[W]", &attr->a_vals ) == LBER_ERROR ) {
                        attr->a_vals = &dummy;
-               } else if ( strcasecmp( mapped.bv_val, "objectClass" ) == 0 ) {
+               } else if ( attr->a_desc == slap_schema.si_ad_objectClass
+                               || attr->a_desc == slap_schema.si_ad_structuralObjectClass ) {
                        int i, last;
                        for ( last = 0; attr->a_vals[ last ].bv_val; ++last );
                        for ( i = 0, bv = attr->a_vals; bv->bv_val; bv++, i++ ) {