summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/syntaxes/nameoptuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldap/servers/plugins/syntaxes/nameoptuid.c')
-rw-r--r--ldap/servers/plugins/syntaxes/nameoptuid.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/ldap/servers/plugins/syntaxes/nameoptuid.c b/ldap/servers/plugins/syntaxes/nameoptuid.c
index b46ac533..8a76e05d 100644
--- a/ldap/servers/plugins/syntaxes/nameoptuid.c
+++ b/ldap/servers/plugins/syntaxes/nameoptuid.c
@@ -66,6 +66,46 @@ static char *names[] = { "Name And Optional UID", "nameoptuid", NAMEANDOPTIONALU
static Slapi_PluginDesc pdesc = { "nameoptuid-syntax", VENDOR, DS_PACKAGE_VERSION,
"Name And Optional UID attribute syntax plugin" };
+static const char *uniqueMemberMatch_names[] = {"uniqueMemberMatch", "2.5.13.23", NULL};
+static struct mr_plugin_def mr_plugin_table[] = {
+{{"2.5.13.23", NULL, "uniqueMemberMatch", "The uniqueMemberMatch rule compares an assertion value of the Name "
+"And Optional UID syntax to an attribute value of a syntax (e.g., the "
+"Name And Optional UID syntax) whose corresponding ASN.1 type is "
+"NameAndOptionalUID. "
+"The rule evaluates to TRUE if and only if the <distinguishedName> "
+"components of the assertion value and attribute value match according "
+"to the distinguishedNameMatch rule and either, (1) the <BitString> "
+"component is absent from both the attribute value and assertion "
+"value, or (2) the <BitString> component is present in both the "
+"attribute value and the assertion value and the <BitString> component "
+"of the assertion value matches the <BitString> component of the "
+"attribute value according to the bitStringMatch rule. "
+"Note that this matching rule has been altered from its description in "
+"X.520 [X.520] in order to make the matching rule commutative. Server "
+"implementors should consider using the original X.520 semantics "
+"(where the matching was less exact) for approximate matching of "
+"attributes with uniqueMemberMatch as the equality matching rule.",
+NAMEANDOPTIONALUID_SYNTAX_OID, 0, NULL /* no other syntaxes supported */}, /* matching rule desc */
+ {"uniqueMemberMatch-mr", VENDOR, DS_PACKAGE_VERSION, "uniqueMemberMatch matching rule plugin"}, /* plugin desc */
+ uniqueMemberMatch_names, /* matching rule name/oid/aliases */
+ NULL, NULL, nameoptuid_filter_ava, NULL, nameoptuid_values2keys,
+ nameoptuid_assertion2keys_ava, NULL, nameoptuid_compare},
+};
+
+static size_t mr_plugin_table_size = sizeof(mr_plugin_table)/sizeof(mr_plugin_table[0]);
+
+static int
+matching_rule_plugin_init(Slapi_PBlock *pb)
+{
+ return syntax_matching_rule_plugin_init(pb, mr_plugin_table, mr_plugin_table_size);
+}
+
+static int
+register_matching_rule_plugins()
+{
+ return syntax_register_matching_rule_plugins(mr_plugin_table, mr_plugin_table_size, matching_rule_plugin_init);
+}
+
int
nameoptuid_init( Slapi_PBlock *pb )
{
@@ -99,6 +139,7 @@ nameoptuid_init( Slapi_PBlock *pb )
rc |= slapi_pblock_set( pb, SLAPI_PLUGIN_SYNTAX_VALIDATE,
(void *) nameoptuid_validate );
+ rc |= register_matching_rule_plugins();
LDAPDebug( LDAP_DEBUG_PLUGIN, "<= nameoptuid_init %d\n", rc, 0, 0 );
return( rc );
}