]> git.sur5r.net Git - openldap/commitdiff
Hide some yet-to-be-implemented schema
authorKurt Zeilenga <kurt@openldap.org>
Wed, 29 May 2002 06:14:55 +0000 (06:14 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 29 May 2002 06:14:55 +0000 (06:14 +0000)
servers/slapd/at.c
servers/slapd/oc.c
servers/slapd/schema_prep.c
servers/slapd/slap.h

index 45ff44600e39154b9890cc3e5185eb493a632388..b12d25eb28a17bb7c5093eb8a89da186aa14aba8 100644 (file)
@@ -464,6 +464,9 @@ at_schema_info( Entry *e )
                if ( ldap_attributetype2bv( &at->sat_atype, vals ) == NULL ) {
                        return -1;
                }
+
+               if( at->sat_flags & SLAP_AT_HIDE ) continue;
+
 #if 0
                Debug( LDAP_DEBUG_TRACE, "Merging at [%ld] %s\n",
                       (long) vals[0].bv_len, vals[0].bv_val, 0 );
index 7163f1aa5f025eb2504e9e251c5563cd548230e6..4e0adde93aa24109668961f5ee61c7955f1e0f8d 100644 (file)
@@ -61,7 +61,7 @@ int is_entry_objectclass(
        }
 
        if( set_flags && ( e->e_ocflags & SLAP_OC__END )) {
-               return (e->e_ocflags & oc->soc_flags);
+               return (e->e_ocflags & oc->soc_flags) ? 1 : 0;
        }
 
        /*
@@ -480,6 +480,9 @@ oc_schema_info( Entry *e )
                if ( ldap_objectclass2bv( &oc->soc_oclass, vals ) == NULL ) {
                        return -1;
                }
+
+               if( oc->soc_flags & SLAP_OC_HIDE ) continue;
+
 #if 0
                Debug( LDAP_DEBUG_TRACE, "Merging oc [%ld] %s\n",
               (long) vals[0].bv_len, vals[0].bv_val, 0 );
index 8097a10315b4299e6304d22f6d4b7846989f7ab5..6d85cc83bced0548473e36128d65acdfb843f495 100644 (file)
@@ -201,7 +201,7 @@ static struct slap_schema_oc_map {
        { "collectiveAttributeSubentry", "( 2.5.20.2 "
                        "NAME 'collectiveAttributeSubentry' "
                        "AUXILIARY )",
-               subentryObjectClass, SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY,
+               subentryObjectClass, SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY|SLAP_OC_HIDE,
                offsetof(struct slap_internal_schema, si_oc_collectiveAttributeSubentry) },
        { "dynamicObject", "( 1.3.6.1.4.1.1466.101.119.2 "
                        "NAME 'dynamicObject' "
@@ -293,13 +293,13 @@ static struct slap_schema_ad_map {
                        "EQUALITY distinguishedNameMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
                        "NO-USER-MODIFICATION USAGE directoryOperation )",
-               NULL, 0, NULL, NULL, NULL,
+               NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_collectiveSubentries) },
        { "collectiveExclusions", "( 2.5.18.7 NAME 'collectiveExclusions' "
                        "EQUALITY objectIdentifierMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 "
                        "USAGE directoryOperation )",
-               NULL, 0, NULL, NULL, NULL,
+               NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_collectiveExclusions) },
 
        { "entryUUID", "( 1.3.6.1.4.1.4203.666.1.6 NAME 'entryUUID' "   
@@ -383,13 +383,13 @@ static struct slap_schema_ad_map {
                        "EQUALITY objectIdentifierMatch "
                        "USAGE directoryOperation "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
-               administrativeRoleAttribute, 0, NULL, NULL, NULL,
+               administrativeRoleAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_administrativeRole) },
        { "subtreeSpecification", "( 2.5.18.6 NAME 'subtreeSpecification' "
                        "SINGLE-VALUE "
                        "USAGE directoryOperation "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.45 )",
-               subentryAttribute, 0, NULL, NULL, NULL,
+               subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_subtreeSpecification) },
 
        /* subschema subentry attributes */
@@ -398,13 +398,13 @@ static struct slap_schema_ad_map {
                        "EQUALITY integerFirstComponentMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.17 "
                        "USAGE directoryOperation ) ",
-               subentryAttribute, 0, NULL, NULL, NULL,
+               subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_ditStructureRules) },
        { "ditContentRules", "( 2.5.21.2 NAME 'dITContentRules' "
                        "DESC 'RFC2252: DIT content rules' "
                        "EQUALITY objectIdentifierFirstComponentMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.16 USAGE directoryOperation )",
-               subentryAttribute, 0, NULL, NULL, NULL,
+               subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_ditContentRules) },
        { "matchingRules", "( 2.5.21.4 NAME 'matchingRules' "
                        "DESC 'RFC2252: matching rules' "
@@ -428,13 +428,13 @@ static struct slap_schema_ad_map {
                        "DESC 'RFC2252: name forms ' "
                        "EQUALITY objectIdentifierFirstComponentMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.35 USAGE directoryOperation )",
-               subentryAttribute, 0, NULL, NULL, NULL,
+               subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_nameForms) },
        { "matchingRuleUse", "( 2.5.21.8 NAME 'matchingRuleUse' "
                        "DESC 'RFC2252: matching rule uses' "
                        "EQUALITY objectIdentifierFirstComponentMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.31 USAGE directoryOperation )",
-               subentryAttribute, 0, NULL, NULL, NULL,
+               subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_matchingRuleUse) },
 
        { "ldapSyntaxes", "( 1.3.6.1.4.1.1466.101.120.16 NAME 'ldapSyntaxes' "
@@ -466,14 +466,14 @@ static struct slap_schema_ad_map {
                        "DESC 'OpenLDAP ACL entry pseudo-attribute' "
                        "SYNTAX 1.3.6.1.4.1.4203.1.1.1 "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )",
-               NULL, 0, NULL, NULL, NULL,
+               NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_entry) },
        { "children", "( 1.3.6.1.4.1.4203.1.3.2 "
                        "NAME 'children' "
                        "DESC 'OpenLDAP ACL children pseudo-attribute' "
                        "SYNTAX 1.3.6.1.4.1.4203.1.1.1 "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )",
-               NULL, 0, NULL, NULL, NULL,
+               NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_children) },
 #ifdef SLAPD_ACI_ENABLED
        { "OpenLDAPaci", "( 1.3.6.1.4.1.4203.666.1.5 "
index fa4b345ed842a5db494a5563864243fe3afb9165..9f7a91ffd726aff3d4235458b32fac6d4284dc13 100644 (file)
@@ -431,6 +431,9 @@ typedef struct slap_attribute_type {
        Syntax                                  *sat_syntax;
 
        AttributeTypeSchemaCheckFN      *sat_check;
+
+#define SLAP_AT_NONE   0x0000U
+#define SLAP_AT_HIDE   0x0001U /* hide attribute */
        slap_mask_t                                     sat_flags;
 
        struct slap_attribute_type      *sat_next;
@@ -496,6 +499,7 @@ typedef struct slap_object_class {
 #define        SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY     0x10
 #define        SLAP_OC__MASK           0x1F
 #define        SLAP_OC__END            0x20
+#define SLAP_OC_HIDE           0x80
 
 #ifdef LDAP_EXTENDED_SCHEMA
 /*