]> git.sur5r.net Git - openldap/commitdiff
Fix addition of dynamic operational attributes (subschemaSubentry)
authorKurt Zeilenga <kurt@openldap.org>
Tue, 13 Jun 2000 17:48:51 +0000 (17:48 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 13 Jun 2000 17:48:51 +0000 (17:48 +0000)
servers/slapd/backend.c
servers/slapd/result.c

index 8315746be1acf4f6f051ad8d17012392006756db..bcb3e0424fbce5895f88c6c4142ca42e78b9793b 100644 (file)
@@ -643,12 +643,14 @@ backend_group(
        return LDAP_UNWILLING_TO_PERFORM;
 }
 
-#ifdef SLAPD_SCHEMA_DN
 Attribute *backend_operational(
        Backend *be,
        Entry *e )
 {
-       Attribute *a = ch_malloc( sizeof( Attribute ) );
+       Attribute *a = NULL;
+
+#ifdef SLAPD_SCHEMA_DN
+       a = ch_malloc( sizeof( Attribute ) );
        a->a_desc = ad_dup( slap_schema.si_ad_subschemaSubentry );
 
        /* Should be backend specific */
@@ -657,7 +659,7 @@ Attribute *backend_operational(
        a->a_vals[1] = NULL;
 
        a->a_next = NULL;
+#endif
 
        return a;
 }
-#endif
index 5fcf3b7ec3c5a9f54f4bc1bdfa0d16b5e4a3970c..70fabc0a9533f25e51afdd911f080d4d23a9773b 100644 (file)
@@ -760,20 +760,18 @@ send_search_entry(
        /* only have subschemaSubentry implemented */
        aa = backend_operational( be, e );
        
-       for (a = aa ; a == NULL; a = a->a_next ) {
+       for (a = aa ; a != NULL; a = a->a_next ) {
                AttributeDescription *desc = a->a_desc;
 
                if ( attrs == NULL ) {
                        /* all addrs request, skip operational attributes */
-                       if( is_at_operational( desc->ad_type ) )
-                       {
+                       if( is_at_operational( desc->ad_type ) ) {
                                continue;
                        }
 
                } else {
                        /* specific addrs requested */
-                       if( is_at_operational( desc->ad_type ) )
-                       {
+                       if( is_at_operational( desc->ad_type ) ) {
                                if( !opattrs && !ad_inlist( desc, attrs ) )
                                {
                                        continue;
@@ -792,7 +790,8 @@ send_search_entry(
                        continue;
                }
 
-               if (( rc = ber_printf( ber, "{s[" /*]}*/ , desc )) == -1 ) {
+               rc = ber_printf( ber, "{s[" /*]}*/ , desc->ad_cname->bv_val );
+               if ( rc == -1 ) {
                        Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
                        ber_free( ber, 1 );
                        send_ldap_result( conn, op, LDAP_OTHER,