]> git.sur5r.net Git - openldap/commitdiff
Move cn=config from namingContexts to configContext
authorHoward Chu <hyc@openldap.org>
Mon, 14 Mar 2005 23:21:00 +0000 (23:21 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 14 Mar 2005 23:21:00 +0000 (23:21 +0000)
servers/slapd/bconfig.c
servers/slapd/root_dse.c
servers/slapd/schema_prep.c
servers/slapd/slap.h

index 171b688354f6411bacc82addfedea4d0bf0e40bf..577b3309535737e5d79c921514957bc92f980c09 100644 (file)
@@ -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;
 }
 
index 8d18760abea0ecb53ed64d4c39a7a1f52e280f05..dbe4f371c6abdf5907af62938be800397170115b 100644 (file)
@@ -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;
                }
index fbf322efbb0513d48b0c15befeb24b7377d93e93..2b11d0ff34e9664247c7abac6fd372cf9621f288 100644 (file)
@@ -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 "
index 2214f0cb8e3247086e1e8f8b01724ac3f932a0d4..127ac5a45ba417c25e489f4cfa14a8b0ab794663 100644 (file)
@@ -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)