summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/slapi-plugin.h
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-02-16 15:56:59 -0700
committerRich Megginson <rmeggins@redhat.com>2010-02-17 15:05:40 -0700
commitecf93e699b04d45fdfa07b12094adaab0233c47a (patch)
treec8725f13871e4d45cd97aec529417289234c8676 /ldap/servers/slapd/slapi-plugin.h
parent6adbad044ef95411882ec546281a0df6d0816673 (diff)
downloadds-ecf93e699b04d45fdfa07b12094adaab0233c47a.tar.gz
ds-ecf93e699b04d45fdfa07b12094adaab0233c47a.tar.xz
ds-ecf93e699b04d45fdfa07b12094adaab0233c47a.zip
change syntax plugins to register required matching rule plugins
https://bugzilla.redhat.com/show_bug.cgi?id=559315 Resolves: 559315 Description: Searching some attributes are now case sensitive when they were previously case-insensitive Reviewed by: nhosoi (Thanks!) - also added some suggested comments I added code to allow the syntax plugins to register corresponding matching rules. That is, the functions that the syntax plugins use for filter matching and key generation can also be used for matching rules with the new wrapper code. I added some convenience functions and structures in the syntax plugin code to make it easier to add matching rules in the future. I also added a new feature to the matching rule code - in the LDAP spec definition of matching rule, the syntax provided in the matching rule definition is the syntax for the _assertion value_ used with the matching rule, which is not necessarily the same as the syntax of the _attribute values_ to which the matching rule can be applied. For example, matching rules that apply to syntax DirectoryString can also be applied in some cases to PrintableString, CountryString, and IA5String. There are several other cases like this as well. I also introduced the concept of a compat syntax that can be used with a matching rule. The server will now check, when reading in the schema, if the syntax and matching rules for an attribute are consistent. Finally, for 05rfc4523.ldif, I changed the attributes to use octetStringMatch instead of one of the unimplemented certificate matching rules.
Diffstat (limited to 'ldap/servers/slapd/slapi-plugin.h')
-rw-r--r--ldap/servers/slapd/slapi-plugin.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index 5f0fc47f..5f97c055 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -4466,12 +4466,13 @@ int slapi_berval_cmp(const struct berval* L, const struct berval* R);
! memcmp ((L)->bv_val, (R)->bv_val, (L)->bv_len))
typedef struct slapi_matchingRuleEntry {
- char *mr_oid;
- char *mr_oidalias;
- char *mr_name;
- char *mr_desc;
- char *mr_syntax;
- int mr_obsolete;
+ char *mr_oid; /* the official oid */
+ char *mr_oidalias; /* not currently used */
+ char *mr_name; /* the official name */
+ char *mr_desc; /* a description */
+ char *mr_syntax; /* the assertion syntax OID */
+ int mr_obsolete; /* is mr obsolete? */
+ char **mr_compat_syntax; /* list of OIDs of other syntaxes that can use this matching rule */
} slapi_matchingRuleEntry;
typedef struct slapi_matchingRuleEntry Slapi_MatchingRuleEntry;
@@ -4482,8 +4483,30 @@ int slapi_matchingrule_get(Slapi_MatchingRuleEntry *mr, int arg, void *value);
int slapi_matchingrule_set(Slapi_MatchingRuleEntry *mr, int arg, void *value);
int slapi_matchingrule_register(Slapi_MatchingRuleEntry *mrEntry);
int slapi_matchingrule_unregister(char *oid);
+
+/**
+ * Is the given matching rule an ordering matching rule and is it
+ * compatible with the given syntax?
+ *
+ * \param name_or_oid Name or OID of a matching rule
+ * \param syntax_oid OID of a syntax
+ * \return \c TRUE if the matching rule is an ordering rule and can be used by the given syntax
+ * \return \c FALSE otherwise
+ */
int slapi_matchingrule_is_ordering(const char *oid_or_name, const char *syntax_oid);
+/**
+ * Can the given syntax OID use the given matching rule name/OID? A
+ * matching rule can apply to more than one syntax. Use this function
+ * to determine if the given syntax can use the given matching rule.
+ *
+ * \param mr_name_or_oid Name or OID of a matching rule
+ * \param syntax_oid OID of a syntax
+ * \return \c TRUE if the syntax can be used with the matching rule
+ * \return \c FALSE otherwise
+ */
+int slapi_matchingrule_is_compat(const char *mr_oid_or_name, const char *syntax_oid);
+
/*
* access control
*/