From: Kurt Zeilenga Date: Tue, 13 Jun 2000 17:48:51 +0000 (+0000) Subject: Fix addition of dynamic operational attributes (subschemaSubentry) X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2658 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=df4b2a443ebeeb0a4bee62dc9c8f49783b9acdcd;p=openldap Fix addition of dynamic operational attributes (subschemaSubentry) --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 8315746be1..bcb3e0424f 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -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 diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 5fcf3b7ec3..70fabc0a95 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -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,