goto return_results;
}
- if( !is_entry_objectclass( e, group_oc ) ) {
+ if( !is_entry_objectclass( e, group_oc, 0 ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"bdb_group: failed to find %s in objectClass.\n",
/*
* Now we can check for the group objectClass value
*/
- if( !is_entry_objectclass( target, group_oc ) ) {
+ if( !is_entry_objectclass( target, group_oc, 0 ) ) {
return(1);
}
goto return_results;
}
- if( !is_entry_objectclass( e, group_oc ) ) {
+ if( !is_entry_objectclass( e, group_oc, 0 ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_back_group: failed to find %s in objectClass.\n",
/*
* Now we can check for the group objectClass value
*/
- if ( !is_entry_objectclass( target, group_oc ) ) {
+ if ( !is_entry_objectclass( target, group_oc, 0 ) ) {
return 1;
}
int is_entry_objectclass(
Entry* e,
- ObjectClass *oc )
+ ObjectClass *oc,
+ int set_flags )
{
Attribute *attr;
struct berval *bv;
return 0;
}
+ if( set_flags && ( e->e_ocflags & SLAP_OC__END )) {
+ return (e->e_ocflags & oc->soc_flags);
+ }
+
/*
* find objectClass attribute
*/
for( bv=attr->a_vals; bv->bv_val; bv++ ) {
ObjectClass *objectClass = oc_bvfind( bv );
- if( objectClass == oc ) {
+ if ( objectClass == oc && !set_flags ) {
return 1;
}
- }
- return 0;
+ e->e_ocflags |= objectClass->soc_flags;
+ }
+ e->e_ocflags |= SLAP_OC__END; /* We've finished this */
+ return (e->e_ocflags & oc->soc_flags);
}
ObjectClass *sup ));
LDAP_SLAPD_F (int) is_entry_objectclass LDAP_P((
- Entry *, ObjectClass *oc ));
+ Entry *, ObjectClass *oc, int set_flags ));
#define is_entry_alias(e) \
- is_entry_objectclass((e), slap_schema.si_oc_alias)
+ ((e)->e_ocflags & SLAP_OC__END) ? ((e)->e_ocflags & SLAP_OC_ALIAS) : \
+ is_entry_objectclass((e), slap_schema.si_oc_alias, 1)
#define is_entry_referral(e) \
- is_entry_objectclass((e), slap_schema.si_oc_referral)
+ ((e)->e_ocflags & SLAP_OC__END) ? ((e)->e_ocflags & SLAP_OC_REFERRAL) : \
+ is_entry_objectclass((e), slap_schema.si_oc_referral, 1)
#define is_entry_subentry(e) \
- is_entry_objectclass((e), slap_schema.si_oc_subentry)
+ ((e)->e_ocflags & SLAP_OC__END) ? ((e)->e_ocflags & SLAP_OC_SUBENTRY) : \
+ is_entry_objectclass((e), slap_schema.si_oc_subentry, 1)
#define is_entry_collectiveAttributes(e) \
- is_entry_objectclass((e), slap_schema.si_oc_collectiveAttributes)
+ ((e)->e_ocflags & SLAP_OC__END) ? ((e)->e_ocflags & SLAP_OC_COLLECTIVEATTRIBUTES) : \
+ is_entry_objectclass((e), slap_schema.si_oc_collectiveAttributes, 1)
#define is_entry_dynamicObject(e) \
- is_entry_objectclass((e), slap_schema.si_oc_dynamicObject)
+ ((e)->e_ocflags & SLAP_OC__END) ? ((e)->e_ocflags & SLAP_OC_DYNAMICOBJECT) : \
+ is_entry_objectclass((e), slap_schema.si_oc_dynamicObject, 1)
LDAP_SLAPD_F (int) oc_schema_info( Entry *e );
return LDAP_OBJECT_CLASS_VIOLATION;
}
- if ( oc->sco_check ) {
- int rc = (oc->sco_check)( be, e, oc,
+ if ( oc->soc_check ) {
+ int rc = (oc->soc_check)( be, e, oc,
text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
return rc;
"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' ) "
"MAY ( dITStructureRules $ nameForms $ ditContentRules $ "
"objectClasses $ attributeTypes $ matchingRules $ "
"matchingRuleUse ) )",
- subentryObjectClass, 0,
+ subentryObjectClass, SLAP_OC_SUBENTRY,
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' "
{ "collectiveAttributes", "( 2.5.20.2 "
"NAME 'collectiveAttributes' "
"AUXILIARY )",
- subentryObjectClass, 0,
+ subentryObjectClass, SLAP_OC_COLLECTIVEATTRIBUTES,
offsetof(struct slap_internal_schema, si_oc_collectiveAttributes) },
{ "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 }
};
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;
struct slap_object_class **soc_sups;
AttributeType **soc_required;
AttributeType **soc_allowed;
- ObjectClassSchemaCheckFN *sco_check;
- slap_mask_t sco_flags;
+ ObjectClassSchemaCheckFN *soc_check;
+ slap_mask_t soc_flags;
#define soc_oid soc_oclass.oc_oid
#define soc_names soc_oclass.oc_names
#define soc_desc soc_oclass.oc_desc
struct slap_object_class *soc_next;
} ObjectClass;
+#define SLAP_OC_ALIAS 0x01
+#define SLAP_OC_REFERRAL 0x02
+#define SLAP_OC_SUBENTRY 0x04
+#define SLAP_OC_DYNAMICOBJECT 0x08
+#define SLAP_OC_COLLECTIVEATTRIBUTES 0x10
+#define SLAP_OC__MASK 0x1F
+#define SLAP_OC__END 0x20
+
#ifdef LDAP_EXTENDED_SCHEMA
/*
* DIT content rule
Attribute *e_attrs; /* list of attributes + values */
+ slap_mask_t e_ocflags;
+
/* for use by the backend for any purpose */
void* e_private;
} Entry;