From a49215d4bf2fa8ff16b018cfb9e3a04199ef01b1 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 14 Mar 2005 23:21:00 +0000 Subject: [PATCH] Move cn=config from namingContexts to configContext --- servers/slapd/bconfig.c | 7 ++++++- servers/slapd/root_dse.c | 10 ++++++++++ servers/slapd/schema_prep.c | 10 ++++++++++ servers/slapd/slap.h | 3 +++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 171b688354..577b330953 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -578,7 +578,7 @@ static ConfigOCs cf_ocs[] = { "NAME 'olcDatabaseConfig' " "DESC 'OpenLDAP Database-specific options' " "SUP olcConfig STRUCTURAL " - "MAY ( olcDatabase $ olcLastMod $ olcLimits $ " + "MAY ( olcDatabase $ olcAccess $ olcLastMod $ olcLimits $ " "olcMaxDerefDepth $ olcPlugin $ olcReadOnly $ olcReplica $ " "olcReplogFile $ olcRequires $ olcRestrict $ olcRootDN $ olcRootPW $ " "olcSchemaDN $ olcSecurity $ olcSizeLimit $ olcSuffix $ olcSyncrepl $ " @@ -2862,6 +2862,7 @@ config_back_db_open( BackendDB *be ) oprev = ce; } } +#if 0 /* Set up ACLs */ if ( bptr->be_acl ) { Entry *ae; @@ -2880,6 +2881,7 @@ config_back_db_open( BackendDB *be ) } opar->ce_kids = ce; } +#endif } return 0; @@ -2909,6 +2911,9 @@ config_back_db_init( Backend *be ) ber_dupbv( &dn, &be->be_rootdn ); ber_bvarray_add( &be->be_nsuffix, &dn ); + /* Hide from namingContexts */ + SLAP_BFLAGS(be) |= SLAP_BFLAG_CONFIG; + return 0; } diff --git a/servers/slapd/root_dse.c b/servers/slapd/root_dse.c index 8d18760abe..dbe4f371c6 100644 --- a/servers/slapd/root_dse.c +++ b/servers/slapd/root_dse.c @@ -73,6 +73,8 @@ root_dse_info( = slap_schema.si_ad_supportedFeatures; AttributeDescription *ad_monitorContext = slap_schema.si_ad_monitorContext; + AttributeDescription *ad_configContext + = slap_schema.si_ad_configContext; AttributeDescription *ad_ref = slap_schema.si_ad_ref; @@ -128,6 +130,14 @@ root_dse_info( } continue; } + if ( SLAP_CONFIG( &backends[i] )) { + vals[0] = backends[i].be_suffix[0]; + nvals[0] = backends[i].be_nsuffix[0]; + if( attr_merge( e, ad_configContext, vals, nvals ) ) { + return LDAP_OTHER; + } + continue; + } if ( SLAP_GLUE_SUBORDINATE( &backends[i] ) && !SLAP_GLUE_ADVERTISE( &backends[i] ) ) { continue; } diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index fbf322efbb..2b11d0ff34 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -689,6 +689,16 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_monitorContext) }, + { "configContext", "( 1.3.6.1.4.1.4203.666.11.1.1 " + "NAME 'configContext' " + "DESC 'config context' " + "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 " + "SINGLE-VALUE NO-USER-MODIFICATION " + "USAGE dSAOperation )", + rootDseAttribute, SLAP_AT_HIDE, + NULL, NULL, + NULL, NULL, NULL, NULL, NULL, + offsetof(struct slap_internal_schema, si_ad_configContext) }, { "vendorName", "( 1.3.6.1.1.4 NAME 'vendorName' " "DESC 'RFC3045: name of implementation vendor' " "EQUALITY caseExactMatch " diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 2214f0cb8e..127ac5a45b 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -822,6 +822,7 @@ struct slap_internal_schema { AttributeDescription *si_ad_monitorContext; AttributeDescription *si_ad_vendorName; AttributeDescription *si_ad_vendorVersion; + AttributeDescription *si_ad_configContext; /* subentry attribute descriptions */ AttributeDescription *si_ad_administrativeRole; @@ -2029,6 +2030,7 @@ struct slap_backend_info { slap_mask_t bi_flags; /* backend flags */ #define SLAP_BFLAG_MONITOR 0x0001U /* a monitor backend */ +#define SLAP_BFLAG_CONFIG 0x0002U /* a config backend */ #define SLAP_BFLAG_NOLASTMODCMD 0x0010U #define SLAP_BFLAG_INCREMENT 0x0100U #define SLAP_BFLAG_ALIASES 0x1000U @@ -2038,6 +2040,7 @@ struct slap_backend_info { #define SLAP_BFLAGS(be) ((be)->bd_info->bi_flags) #define SLAP_MONITOR(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_MONITOR) +#define SLAP_CONFIG(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_CONFIG) #define SLAP_INCREMENT(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_INCREMENT) #define SLAP_ALIASES(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_ALIASES) #define SLAP_REFERRALS(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_REFERRALS) -- 2.39.5