From aecf4033f65d1f973801db4f62be04a1f56d9453 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 29 May 2002 06:14:55 +0000 Subject: [PATCH] Hide some yet-to-be-implemented schema --- servers/slapd/at.c | 3 +++ servers/slapd/oc.c | 5 ++++- servers/slapd/schema_prep.c | 22 +++++++++++----------- servers/slapd/slap.h | 4 ++++ 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/servers/slapd/at.c b/servers/slapd/at.c index 45ff44600e..b12d25eb28 100644 --- a/servers/slapd/at.c +++ b/servers/slapd/at.c @@ -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 ); diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index 7163f1aa5f..4e0adde93a 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -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 ); diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index 8097a10315..6d85cc83bc 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -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 " diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index fa4b345ed8..9f7a91ffd7 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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 /* -- 2.39.5