From: Kurt Zeilenga Date: Mon, 15 May 2000 22:07:10 +0000 (+0000) Subject: SLAPD_SCHEMA_NOT_COMPAT: simple Root DSE search WORKS! X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2962 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aa08287e29ed6e9a9543c4fcd5a1b2cad162b9d0;p=openldap SLAPD_SCHEMA_NOT_COMPAT: simple Root DSE search WORKS! --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 317805f156..abeac6f4dc 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -32,8 +32,13 @@ AttributeDescription *ad_dup( *ad = *desc; - ad->ad_cname = ber_bvdup( ad->ad_cname ); - ad->ad_lang = ch_strdup( ad->ad_lang ); + if( ad->ad_cname != NULL ) { + ad->ad_cname = ber_bvdup( ad->ad_cname ); + } + + if( ad->ad_lang != NULL ) { + ad->ad_lang = ch_strdup( ad->ad_lang ); + } return ad; } @@ -43,7 +48,10 @@ ad_free( AttributeDescription *ad, int freeit ) { if( ad == NULL ) return; - ber_bvfree( ad->ad_cname ); + if( ad->ad_cname != NULL ) { + ber_bvfree( ad->ad_cname ); + } + free( ad->ad_lang ); if( freeit ) free( ad ); diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 48c91566cd..60873f7a11 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -657,7 +657,7 @@ Attribute *backend_operational( { Attribute *a = ch_malloc( sizeof( Attribute ) ); #ifdef SLAPD_SCHEMA_NOT_COMPAT - /* not yet implemented */ + a->a_desc = slap_schema.si_ad_subschemaSubentry; #else a->a_type = ch_strdup("subschemasubentry"); a->a_syntax = SYNTAX_DN | SYNTAX_CIS; diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 67d3109acb..e143286824 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -677,8 +677,10 @@ send_search_entry( for ( a = e->e_attrs; a != NULL; a = a->a_next ) { #ifdef SLAPD_SCHEMA_NOT_COMPAT AttributeDescription *desc = a->a_desc; + char *type = desc->ad_cname->bv_val; #else char *desc = a->a_type; + char *type = a->a_type; #endif if ( attrs == NULL ) { @@ -716,7 +718,7 @@ send_search_entry( continue; } - if (( rc = ber_printf( ber, "{s[" /*]}*/ , desc )) == -1 ) { + if (( rc = ber_printf( ber, "{s[" /*]}*/ , type )) == -1 ) { Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); ber_free( ber, 1 ); send_ldap_result( conn, op, LDAP_OTHER, diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 6dd12ae5df..349d17aea7 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -635,6 +635,10 @@ struct slap_schema_ad_map { offsetof(struct slap_internal_schema, si_ad_modifiersName) }, { "modifyTimestamp", offsetof(struct slap_internal_schema, si_ad_modifyTimestamp) }, + + { "subschemaSubentry", + offsetof(struct slap_internal_schema, si_ad_subschemaSubentry) }, + { "namingContexts", offsetof(struct slap_internal_schema, si_ad_namingContexts) }, { "supportedControl",