Commit aa08287e authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

SLAPD_SCHEMA_NOT_COMPAT: simple Root DSE search WORKS!

parent 19becc61
......@@ -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 );
......
......@@ -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;
......
......@@ -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,
......
......@@ -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",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment