"NAME 'extensibleObject' "
"DESC 'RFC2252: extensible object' "
"SUP top AUXILIARY )",
- 0, 0, offsetof(struct slap_internal_schema, si_oc_extensibleObject) },
+ 0, SLAP_OC_OPERATIONAL,
+ offsetof(struct slap_internal_schema, si_oc_extensibleObject) },
{ "alias", "( 2.5.6.1 NAME 'alias' "
"DESC 'RFC2256: an alias' "
"SUP top STRUCTURAL "
"MUST aliasedObjectName )",
- aliasObjectClass, SLAP_OC_ALIAS,
+ aliasObjectClass, SLAP_OC_ALIAS|SLAP_OC_OPERATIONAL,
offsetof(struct slap_internal_schema, si_oc_alias) },
{ "referral", "( 2.16.840.1.113730.3.2.6 NAME 'referral' "
"DESC 'namedref: named subordinate referral' "
"SUP top STRUCTURAL MUST ref )",
- referralObjectClass, SLAP_OC_REFERRAL,
+ referralObjectClass, SLAP_OC_REFERRAL|SLAP_OC_OPERATIONAL,
offsetof(struct slap_internal_schema, si_oc_referral) },
{ "LDAProotDSE", "( 1.3.6.1.4.1.4203.1.4.1 "
"NAME ( 'OpenLDAProotDSE' 'LDAProotDSE' ) "
"DESC 'OpenLDAP Root DSE object' "
"SUP top STRUCTURAL MAY cn )",
- rootDseObjectClass, 0,
+ rootDseObjectClass, SLAP_OC_OPERATIONAL,
offsetof(struct slap_internal_schema, si_oc_rootdse) },
{ "subentry", "( 2.5.20.0 NAME 'subentry' "
"SUP top STRUCTURAL "
"MUST ( cn $ subtreeSpecification ) )",
- subentryObjectClass, SLAP_OC_SUBENTRY,
+ subentryObjectClass, SLAP_OC_SUBENTRY|SLAP_OC_OPERATIONAL,
offsetof(struct slap_internal_schema, si_oc_subentry) },
{ "subschema", "( 2.5.20.1 NAME 'subschema' "
"DESC 'RFC2252: controlling subschema (sub)entry' "
"MAY ( dITStructureRules $ nameForms $ ditContentRules $ "
"objectClasses $ attributeTypes $ matchingRules $ "
"matchingRuleUse ) )",
- subentryObjectClass, 0,
+ subentryObjectClass, SLAP_OC_OPERATIONAL,
offsetof(struct slap_internal_schema, si_oc_subschema) },
{ "monitor", "( 1.3.6.1.4.1.4203.666.3.2 NAME 'monitor' "
"DESC 'OpenLDAP system monitoring' "
"STRUCTURAL "
"MUST cn )",
- 0, 0, offsetof(struct slap_internal_schema, si_oc_monitor) },
+ 0, SLAP_OC_OPERATIONAL,
+ offsetof(struct slap_internal_schema, si_oc_monitor) },
{ "collectiveAttributeSubentry", "( 2.5.20.2 "
"NAME 'collectiveAttributeSubentry' "
"AUXILIARY )",
- subentryObjectClass, SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY,
+ subentryObjectClass,
+ SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY|SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
offsetof(struct slap_internal_schema, si_oc_collectiveAttributeSubentry) },
{ "dynamicObject", "( 1.3.6.1.4.1.1466.101.119.2 "
"NAME 'dynamicObject' "
"DESC 'RFC2256: object classes of the entity' "
"EQUALITY objectIdentifierMatch "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
- NULL, 0, objectClassMatch, NULL, NULL,
+ NULL, SLAP_AT_FINAL, objectClassMatch, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_objectClass) },
/* user entry operational attributes */
"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' "
"EQUALITY octetStringMatch "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
- NULL, 0, NULL, NULL, NULL,
+ NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_entryUUID) },
{ "entryCSN", "( 1.3.6.1.4.1.4203.666.1.7 NAME 'entryCSN' "
"DESC 'LCUP/LDUP: change sequence number' "
"EQUALITY octetStringMatch "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
- NULL, 0, NULL, NULL, NULL,
+ NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_entryCSN) },
/* root DSE attributes */
"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 */
"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' "
"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' "
"DESC 'RFC2256: name of aliased object' "
"EQUALITY distinguishedNameMatch "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )",
- aliasAttribute, 0, NULL, NULL, NULL,
+ aliasAttribute, SLAP_AT_FINAL, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_aliasedObjectName) },
{ "ref", "( 2.16.840.1.113730.3.1.34 NAME 'ref' "
"DESC 'namedref: subordinate referral URL' "
"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) },
+ { "saslAuthzTo", "( 1.3.6.1.4.1.4203.666.1.8 "
+ "NAME 'saslAuthzTo' "
+ "DESC 'SASL proxy authorization targets' "
+ "EQUALITY caseExactMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
+ "USAGE distributedOperation )",
+ NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
+ offsetof(struct slap_internal_schema, si_ad_saslAuthzTo) },
+ { "saslAuthzFrom", "( 1.3.6.1.4.1.4203.666.1.9 "
+ "NAME 'saslAuthzFrom' "
+ "DESC 'SASL proxy authorization sources' "
+ "EQUALITY caseExactMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
+ "USAGE distributedOperation )",
+ NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
+ offsetof(struct slap_internal_schema, si_ad_saslAuthzFrom) },
#ifdef SLAPD_ACI_ENABLED
{ "OpenLDAPaci", "( 1.3.6.1.4.1.4203.666.1.5 "
"NAME 'OpenLDAPaci' "
"DESC 'RFC2256: common supertype of DN attributes' "
"EQUALITY distinguishedNameMatch "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )",
- NULL, 0, NULL, NULL, NULL,
+ NULL, SLAP_AT_ABSTRACT, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_distinguishedName) },
{ "name", "( 2.5.4.41 NAME 'name' "
"DESC 'RFC2256: common supertype of name attributes' "
"EQUALITY caseIgnoreMatch "
"SUBSTR caseIgnoreSubstringsMatch "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )",
- NULL, 0, NULL, NULL, NULL,
+ NULL, SLAP_AT_ABSTRACT, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_name) },
{ "cn", "( 2.5.4.3 NAME ( 'cn' 'commonName' ) "
"DESC 'RFC2256: common name(s) for which the entity is known by' "
NULL, /* subtypes */
NULL, NULL, NULL, NULL, /* matching rules */
NULL, /* syntax (this may need to be defined) */
- (AttributeTypeSchemaCheckFN *) 0, 0, /* schema check function/mask */
+ (AttributeTypeSchemaCheckFN *) 0, /* schema check function */
+ SLAP_AT_ABSTRACT|SLAP_AT_FINAL, /* mask */
NULL, /* next */
NULL /* attribute description */
/* mutex (don't know how to initialize it :) */
char *sssm_name;
size_t sssm_offset;
} syn_map[] = {
+ { "1.3.6.1.4.1.1466.115.121.1.40",
+ offsetof(struct slap_internal_schema, si_syn_octetString) },
{ "1.3.6.1.4.1.1466.115.121.1.12",
offsetof(struct slap_internal_schema, si_syn_distinguishedName) },
{ "1.3.6.1.4.1.1466.115.121.1.27",
slap_schema_load( void )
{
int i;
+
+ for( i=0; syn_map[i].sssm_name; i++ ) {
+ Syntax ** synp = (Syntax **)
+ &(((char *) &slap_schema)[syn_map[i].sssm_offset]);
+
+ assert( *synp == NULL );
+
+ *synp = syn_find( syn_map[i].sssm_name );
+
+ if( *synp == NULL ) {
+ fprintf( stderr, "slap_schema_check: "
+ "No syntax \"%s\" defined in schema\n",
+ syn_map[i].sssm_name );
+ return LDAP_INVALID_SYNTAX;
+ }
+ }
+
+ for( i=0; mr_map[i].ssmm_name; i++ ) {
+ MatchingRule ** mrp = (MatchingRule **)
+ &(((char *) &slap_schema)[mr_map[i].ssmm_offset]);
+
+ assert( *mrp == NULL );
+
+ *mrp = mr_find( mr_map[i].ssmm_name );
+
+ if( *mrp == NULL ) {
+ fprintf( stderr, "slap_schema_check: "
+ "No matching rule \"%s\" defined in schema\n",
+ mr_map[i].ssmm_name );
+ return LDAP_INAPPROPRIATE_MATCHING;
+ }
+ }
+
for( i=0; ad_map[i].ssam_name; i++ ) {
- if( ad_map[i].ssam_defn != NULL ) {
+ assert( ad_map[i].ssam_defn != NULL );
+ {
LDAPAttributeType *at;
int code;
const char *err;
}
ldap_memfree( at );
}
+ {
+ int rc;
+ const char *text;
+
+ AttributeDescription ** adp = (AttributeDescription **)
+ &(((char *) &slap_schema)[ad_map[i].ssam_offset]);
+
+ assert( *adp == NULL );
+
+ rc = slap_str2ad( ad_map[i].ssam_name, adp, &text );
+ if( rc != LDAP_SUCCESS ) {
+ fprintf( stderr, "slap_schema_check: "
+ "No attribute \"%s\" defined in schema\n",
+ ad_map[i].ssam_name );
+ return rc;
+ }
+
+ if( ad_map[i].ssam_check ) {
+ /* install check routine */
+ (*adp)->ad_type->sat_check = ad_map[i].ssam_check;
+ }
+ /* install flags */
+ (*adp)->ad_type->sat_flags |= ad_map[i].ssam_flags;
+
+ if( ad_map[i].ssam_match ) {
+ /* install custom matching routine */
+ (*adp)->ad_type->sat_equality->smr_match = ad_map[i].ssam_match;
+ }
+ }
}
for( i=0; oc_map[i].ssom_name; i++ ) {
- if( oc_map[i].ssom_defn != NULL ) {
+ assert( oc_map[i].ssom_defn != NULL );
+ {
LDAPObjectClass *oc;
int code;
const char *err;
return LDAP_OTHER;
}
- code = oc_add(oc,&err);
+ code = oc_add(oc,0,&err);
if ( code ) {
fprintf( stderr, "slap_schema_load: "
"%s: %s: \"%s\"\n",
ldap_memfree(oc);
}
+ {
+ ObjectClass ** ocp = (ObjectClass **)
+ &(((char *) &slap_schema)[oc_map[i].ssom_offset]);
+
+ assert( *ocp == NULL );
+
+ *ocp = oc_find( oc_map[i].ssom_name );
+ if( *ocp == NULL ) {
+ fprintf( stderr, "slap_schema_check: "
+ "No objectClass \"%s\" defined in schema\n",
+ oc_map[i].ssom_name );
+ return LDAP_OBJECT_CLASS_VIOLATION;
+ }
+
+ if( oc_map[i].ssom_check ) {
+ /* install check routine */
+ (*ocp)->soc_check = oc_map[i].ssom_check;
+ }
+ /* install flags */
+ (*ocp)->soc_flags |= oc_map[i].ssom_flags;
+ }
}
+ slap_at_undefined.sat_syntax = slap_schema.si_syn_distinguishedName;
+ slap_schema.si_at_undefined = &slap_at_undefined;
+
return LDAP_SUCCESS;
}
int
slap_schema_check( void )
{
- int i;
/* we should only be called once after schema_init() was called */
assert( schema_init_done == 1 );
- for( i=0; syn_map[i].sssm_name; i++ ) {
- Syntax ** synp = (Syntax **)
- &(((char *) &slap_schema)[syn_map[i].sssm_offset]);
-
- assert( *synp == NULL );
-
- *synp = syn_find( syn_map[i].sssm_name );
-
- if( *synp == NULL ) {
- fprintf( stderr, "slap_schema_check: "
- "No syntax \"%s\" defined in schema\n",
- syn_map[i].sssm_name );
- return LDAP_INVALID_SYNTAX;
- }
- }
-
- for( i=0; mr_map[i].ssmm_name; i++ ) {
- MatchingRule ** mrp = (MatchingRule **)
- &(((char *) &slap_schema)[mr_map[i].ssmm_offset]);
-
- assert( *mrp == NULL );
-
- *mrp = mr_find( mr_map[i].ssmm_name );
-
- if( *mrp == NULL ) {
- fprintf( stderr, "slap_schema_check: "
- "No matching rule \"%s\" defined in schema\n",
- mr_map[i].ssmm_name );
- return LDAP_INAPPROPRIATE_MATCHING;
- }
- }
-
- slap_at_undefined.sat_syntax = syn_find( SLAPD_OCTETSTRING_SYNTAX );
- if( slap_at_undefined.sat_syntax == NULL ) {
- fprintf( stderr, "slap_schema_check: "
- "No octetString syntax \"" SLAPD_OCTETSTRING_SYNTAX "\"\n" );
- return LDAP_INVALID_SYNTAX;
- }
- slap_schema.si_at_undefined = &slap_at_undefined;
-
- for( i=0; ad_map[i].ssam_name; i++ ) {
- int rc;
- const char *text;
-
- AttributeDescription ** adp = (AttributeDescription **)
- &(((char *) &slap_schema)[ad_map[i].ssam_offset]);
-
- assert( *adp == NULL );
-
- rc = slap_str2ad( ad_map[i].ssam_name, adp, &text );
- if( rc != LDAP_SUCCESS ) {
- fprintf( stderr, "slap_schema_check: "
- "No attribute \"%s\" defined in schema\n",
- ad_map[i].ssam_name );
- return rc;
- }
-
- if( ad_map[i].ssam_check ) {
- /* install check routine */
- (*adp)->ad_type->sat_check = ad_map[i].ssam_check;
- }
- /* install flags */
- (*adp)->ad_type->sat_flags |= ad_map[i].ssam_flags;
-
- if( ad_map[i].ssam_match ) {
- /* install custom matching routine */
- (*adp)->ad_type->sat_equality->smr_match = ad_map[i].ssam_match;
- }
- }
-
- for( i=0; oc_map[i].ssom_name; i++ ) {
- ObjectClass ** ocp = (ObjectClass **)
- &(((char *) &slap_schema)[oc_map[i].ssom_offset]);
-
- assert( *ocp == NULL );
-
- *ocp = oc_find( oc_map[i].ssom_name );
- if( *ocp == NULL ) {
- fprintf( stderr, "slap_schema_check: "
- "No objectClass \"%s\" defined in schema\n",
- oc_map[i].ssom_name );
- return LDAP_OBJECT_CLASS_VIOLATION;
- }
-
- if( oc_map[i].ssom_check ) {
- /* install check routine */
- (*ocp)->soc_check = oc_map[i].ssom_check;
- }
- /* install flags */
- (*ocp)->soc_flags |= oc_map[i].ssom_flags;
- }
-
++schema_init_done;
return LDAP_SUCCESS;
}