]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema.c
Kill lber_debug
[openldap] / servers / slapd / schema.c
index 8c5b5f749366082d3ea8ea30a551c71355be5cf1..c7bafd9b8a51b2e5f068915c6b5c2d4901ca7f54 100644 (file)
@@ -1120,15 +1120,19 @@ schema_info( Connection *conn, Operation *op, char **attrs, int attrsonly )
        (void) dn_normalize_case( e->e_ndn );
        e->e_private = NULL;
 
-       val.bv_val = ch_strdup( "top" );
-       val.bv_len = strlen( val.bv_val );
-       attr_merge( e, "objectClass", vals );
-       ldap_memfree( val.bv_val );
+       {
+               char *rdn = ch_strdup( SLAPD_SCHEMA_DN );
+               val.bv_val = strchr( rdn, '=' );
 
-       val.bv_val = ch_strdup( "subschema" );
-       val.bv_len = strlen( val.bv_val );
-       attr_merge( e, "objectClass", vals );
-       ldap_memfree( val.bv_val );
+               if( val.bv_val != NULL ) {
+                       *val.bv_val = '\0';
+                       val.bv_len = strlen( ++val.bv_val );
+
+                       attr_merge( e, rdn, vals );
+               }
+
+               free( rdn );
+       }
 
        if ( syn_schema_info( e ) ) {
                /* Out of memory, do something about it */
@@ -1151,8 +1155,20 @@ schema_info( Connection *conn, Operation *op, char **attrs, int attrsonly )
                return;
        }
        
+       val.bv_val = "top";
+       val.bv_len = sizeof("top")-1;
+       attr_merge( e, "objectClass", vals );
+
+       val.bv_val = "subschema";
+       val.bv_len = sizeof("subschema")-1;
+       attr_merge( e, "objectClass", vals );
+
+       val.bv_val = "extensibleObject";
+       val.bv_len = sizeof("extensibleObject")-1;
+       attr_merge( e, "objectClass", vals );
+
        send_search_entry( &backends[0], conn, op,
-               e, attrs, attrsonly, 0, NULL );
+               e, attrs, attrsonly, NULL );
        send_search_result( conn, op, LDAP_SUCCESS,
                NULL, NULL, NULL, NULL, 1 );