--- servers/slapd/root_dse.c 2001/12/09 01:01:58 1.45 +++ servers/slapd/root_dse.c 2001/12/25 18:48:26 1.49 @@ -1,4 +1,4 @@ -/* $OpenLDAP: pkg/ldap/servers/slapd/root_dse.c,v 1.44 2001/12/06 00:02:11 kurt Exp $ */ +/* $OpenLDAP: pkg/ldap/servers/slapd/root_dse.c,v 1.48 2001/12/21 03:44:35 kurt Exp $ */ /* root_dse.c - Provides the ROOT DSA-Specific Entry * * Copyright 1999-2000 The OpenLDAP Foundation. @@ -39,14 +39,24 @@ root_dse_info( int i, j; char ** supportedSASLMechanisms; - AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass; - AttributeDescription *ad_namingContexts = slap_schema.si_ad_namingContexts; - AttributeDescription *ad_supportedControl = slap_schema.si_ad_supportedControl; - AttributeDescription *ad_supportedExtension = slap_schema.si_ad_supportedExtension; - AttributeDescription *ad_supportedLDAPVersion = slap_schema.si_ad_supportedLDAPVersion; - AttributeDescription *ad_supportedSASLMechanisms = slap_schema.si_ad_supportedSASLMechanisms; - AttributeDescription *ad_supportedFeatures = slap_schema.si_ad_supportedFeatures; - AttributeDescription *ad_ref = slap_schema.si_ad_ref; + AttributeDescription *ad_structuralObjectClass + = slap_schema.si_ad_structuralObjectClass; + AttributeDescription *ad_objectClass + = slap_schema.si_ad_objectClass; + AttributeDescription *ad_namingContexts + = slap_schema.si_ad_namingContexts; + AttributeDescription *ad_supportedControl + = slap_schema.si_ad_supportedControl; + AttributeDescription *ad_supportedExtension + = slap_schema.si_ad_supportedExtension; + AttributeDescription *ad_supportedLDAPVersion + = slap_schema.si_ad_supportedLDAPVersion; + AttributeDescription *ad_supportedSASLMechanisms + = slap_schema.si_ad_supportedSASLMechanisms; + AttributeDescription *ad_supportedFeatures + = slap_schema.si_ad_supportedFeatures; + AttributeDescription *ad_ref + = slap_schema.si_ad_ref; Attribute *a; @@ -61,6 +71,10 @@ root_dse_info( (void) dn_normalize( e->e_ndn ); e->e_private = NULL; + val.bv_val = "OpenLDAProotDSE"; + val.bv_len = sizeof("OpenLDAProotDSE")-1; + attr_merge( e, ad_structuralObjectClass, vals ); + val.bv_val = "top"; val.bv_len = sizeof("top")-1; attr_merge( e, ad_objectClass, vals ); @@ -70,11 +84,10 @@ root_dse_info( attr_merge( e, ad_objectClass, vals ); for ( i = 0; i < nbackends; i++ ) { - if ( backends[i].be_glueflags ) + if ( backends[i].be_glueflags & SLAP_GLUE_SUBORDINATE ) continue; for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) { - val.bv_val = backends[i].be_suffix[j]; - val.bv_len = strlen( val.bv_val ); + val = *backends[i].be_suffix[j]; attr_merge( e, ad_namingContexts, vals ); } } @@ -103,7 +116,7 @@ root_dse_info( /* supportedLDAPVersion */ for ( i=LDAP_VERSION_MIN; i<=LDAP_VERSION_MAX; i++ ) { - if (( global_disallows & SLAP_DISALLOW_BIND_V2 ) && + if (!( global_allows & SLAP_ALLOW_BIND_V2 ) && ( i < LDAP_VERSION3 ) ) { /* version 2 and lower are disallowed */