From: Kurt Zeilenga Date: Wed, 24 May 2000 06:38:02 +0000 (+0000) Subject: objectclass needs a special equality match. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2881 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=12acffa96ec566d473cf26e8fa83899a82f3b3ea;p=openldap objectclass needs a special equality match. --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 945eb5bd78..02beabc58c 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -329,6 +329,20 @@ caseIgnoreIA5Match( ((struct berval *) assertedValue)->bv_val ); } +static int +objectClassMatch( + unsigned use, + Syntax *syntax, + MatchingRule *mr, + struct berval *value, + void *assertedValue ) +{ + ObjectClass *oc = oc_find( value->bv_val ); + ObjectClass *asserted = oc_find( ((struct berval *) assertedValue)->bv_val ); + + return oc == NULL || oc != asserted; +} + struct syntax_defs_rec { char *sd_desc; int sd_flags; @@ -731,66 +745,67 @@ struct slap_schema_oc_map { struct slap_schema_ad_map { char *ssam_name; + slap_mr_match_func *ssam_match; size_t ssam_offset; } ad_map[] = { - { "objectClass", + { "objectClass", objectClassMatch, offsetof(struct slap_internal_schema, si_ad_objectClass) }, - { "creatorsName", + { "creatorsName", NULL, offsetof(struct slap_internal_schema, si_ad_creatorsName) }, - { "createTimestamp", + { "createTimestamp", NULL, offsetof(struct slap_internal_schema, si_ad_createTimestamp) }, - { "modifiersName", + { "modifiersName", NULL, offsetof(struct slap_internal_schema, si_ad_modifiersName) }, - { "modifyTimestamp", + { "modifyTimestamp", NULL, offsetof(struct slap_internal_schema, si_ad_modifyTimestamp) }, - { "subschemaSubentry", + { "subschemaSubentry", NULL, offsetof(struct slap_internal_schema, si_ad_subschemaSubentry) }, - { "namingContexts", + { "namingContexts", NULL, offsetof(struct slap_internal_schema, si_ad_namingContexts) }, - { "supportedControl", + { "supportedControl", NULL, offsetof(struct slap_internal_schema, si_ad_supportedControl) }, - { "supportedExtension", + { "supportedExtension", NULL, offsetof(struct slap_internal_schema, si_ad_supportedExtension) }, - { "supportedLDAPVersion", + { "supportedLDAPVersion", NULL, offsetof(struct slap_internal_schema, si_ad_supportedLDAPVersion) }, #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND - { "supportedACIMechanisms", + { "supportedACIMechanisms", NULL, offsetof(struct slap_internal_schema, si_ad_supportedACIMechanisms) }, #endif - { "supportedSASLMechanisms", + { "supportedSASLMechanisms", NULL, offsetof(struct slap_internal_schema, si_ad_supportedSASLMechanisms) }, - { "attributeTypes", + { "attributeTypes", NULL, offsetof(struct slap_internal_schema, si_ad_attributeTypes) }, - { "ldapSyntaxes", + { "ldapSyntaxes", NULL, offsetof(struct slap_internal_schema, si_ad_ldapSyntaxes) }, - { "matchingRules", + { "matchingRules", NULL, offsetof(struct slap_internal_schema, si_ad_matchingRules) }, - { "objectClasses", + { "objectClasses", NULL, offsetof(struct slap_internal_schema, si_ad_objectClasses) }, - { "ref", + { "ref", NULL, offsetof(struct slap_internal_schema, si_ad_ref) }, - { "entry", + { "entry", NULL, offsetof(struct slap_internal_schema, si_ad_entry) }, - { "children", + { "children", NULL, offsetof(struct slap_internal_schema, si_ad_children) }, - { "userPassword", + { "userPassword", NULL, offsetof(struct slap_internal_schema, si_ad_userPassword) }, - { "authPassword", + { "authPassword", NULL, offsetof(struct slap_internal_schema, si_ad_authPassword) }, #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND - { "krbName", + { "krbName", NULL, offsetof(struct slap_internal_schema, si_ad_krbName) }, #endif - { NULL, 0 } + { NULL, NULL, 0 } }; #endif @@ -836,6 +851,11 @@ schema_prep( void ) ad_map[i].ssam_name ); return rc; } + + if( ad_map[i].ssam_match ) { + /* install custom matching routine */ + (*adp)->ad_type->sat_equality->smr_match = ad_map[i].ssam_match; + } } #endif