"DESC 'RFC2256: an alias' "
"SUP top STRUCTURAL "
"MUST aliasedObjectName )",
- aliasObjectClass, 0,
+ aliasObjectClass, SLAP_OC_ALIAS,
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, 0,
+ referralObjectClass, SLAP_OC_REFERRAL,
offsetof(struct slap_internal_schema, si_oc_referral) },
{ "LDAProotDSE", "( 1.3.6.1.4.1.4203.1.4.1 "
"NAME ( 'OpenLDAProotDSE' 'LDAProotDSE' ) "
{ "subentry", "( 2.5.20.0 NAME 'subentry' "
"SUP top STRUCTURAL "
"MUST ( cn $ subtreeSpecification ) )",
- subentryObjectClass, 0,
+ subentryObjectClass, SLAP_OC_SUBENTRY,
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,
+ subentryObjectClass, 0,
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) },
- { "collectiveAttributes", "( 2.5.20.2 "
- "NAME 'collectiveAttributes' "
+ { "collectiveAttributeSubentry", "( 2.5.20.2 "
+ "NAME 'collectiveAttributeSubentry' "
"AUXILIARY )",
- subentryObjectClass, 0,
- offsetof(struct slap_internal_schema, si_oc_collectiveAttributes) },
+ subentryObjectClass, SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY,
+ offsetof(struct slap_internal_schema, si_oc_collectiveAttributeSubentry) },
{ "dynamicObject", "( 1.3.6.1.4.1.1466.101.119.2 "
"NAME 'dynamicObject' "
"DESC 'RFC2589: Dynamic Object' "
"SUP top AUXILIARY )",
- dynamicObjectClass, 0,
+ dynamicObjectClass, SLAP_OC_DYNAMICOBJECT,
offsetof(struct slap_internal_schema, si_oc_dynamicObject) },
{ NULL, NULL, NULL, 0, 0 }
};
static AttributeTypeSchemaCheckFN aliasAttribute;
static AttributeTypeSchemaCheckFN referralAttribute;
static AttributeTypeSchemaCheckFN subentryAttribute;
+static AttributeTypeSchemaCheckFN administrativeRoleAttribute;
static AttributeTypeSchemaCheckFN dynamicAttribute;
static struct slap_schema_ad_map {
"SINGLE-VALUE USAGE directoryOperation )",
NULL, 0, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_subschemaSubentry) },
- { "collectiveAttributeSubentry", "( 2.5.18.12 "
- "NAME 'collectiveAttributeSubentry' "
+ { "collectiveAttributeSubentries", "( 2.5.18.12 "
+ "NAME 'collectiveAttributeSubentries' "
"EQUALITY distinguishedNameMatch "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
"USAGE directoryOperation NO-USER-MODIFICATION )",
NULL, 0, NULL, NULL, NULL,
- offsetof(struct slap_internal_schema, si_ad_collectiveSubentry) },
+ 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 "
"EQUALITY objectIdentifierMatch "
"USAGE directoryOperation "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
- NULL, 0, NULL, NULL, NULL,
+ administrativeRoleAttribute, 0, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_administrativeRole) },
{ "subtreeSpecification", "( 2.5.18.6 NAME 'subtreeSpecification' "
"SINGLE-VALUE "
NULL, NULL, NULL, NULL, /* matching rules */
NULL, /* syntax (this may need to be defined) */
(AttributeTypeSchemaCheckFN *) 0, 0, /* schema check function/mask */
- NULL /* next */
- NULL, /* attribute description */
+ NULL, /* next */
+ NULL /* attribute description */
/* mutex (don't know how to initialize it :) */
};
if( oc_map[i].ssom_check ) {
/* install check routine */
- (*ocp)->sco_check = oc_map[i].ssom_check;
+ (*ocp)->soc_check = oc_map[i].ssom_check;
}
/* install flags */
- (*ocp)->sco_flags |= oc_map[i].ssom_flags;
+ (*ocp)->soc_flags |= oc_map[i].ssom_flags;
}
++schema_init_done;
return LDAP_SUCCESS;
}
+static int administrativeRoleAttribute (
+ Backend *be,
+ Entry *e,
+ Attribute *attr,
+ const char** text,
+ char *textbuf, size_t textlen )
+{
+ *text = textbuf;
+
+ if( !SLAP_SUBENTRIES(be) ) {
+ snprintf( textbuf, textlen,
+ "attribute \"%s\" not supported in context",
+ attr->a_desc->ad_cname.bv_val );
+ return LDAP_OBJECT_CLASS_VIOLATION;
+ }
+
+ snprintf( textbuf, textlen,
+ "attribute \"%s\" not supported!",
+ attr->a_desc->ad_cname.bv_val );
+ return LDAP_OBJECT_CLASS_VIOLATION;
+}
+
static int dynamicAttribute (
Backend *be,
Entry *e,