summaryrefslogtreecommitdiffstats
path: root/lib/ldb/include
diff options
context:
space:
mode:
authorSamuel Cabrero <samuelcabrero@kernevil.me>2014-11-05 11:02:25 +0100
committerGarming Sam <garming@samba.org>2014-12-22 00:18:09 +0100
commitfaa4be0535fd41bf282b1afc749a05412f4ee96c (patch)
tree4fd1ca1202bb024991fe63cf4d09a3578d647926 /lib/ldb/include
parent172aa0ee3885720464e8eacd728eb1a1342fc9b4 (diff)
downloadsamba-faa4be0535fd41bf282b1afc749a05412f4ee96c.tar.gz
samba-faa4be0535fd41bf282b1afc749a05412f4ee96c.tar.xz
samba-faa4be0535fd41bf282b1afc749a05412f4ee96c.zip
ldb: Allow to register extended match rules
This allows to extend LDB by registering extended match rules from outside the library itself. This is necessary when the implementation requires knowledge about syntaxes implemented in samba extensions, like the LDAP_MATCHING_RULE_TRANSITIVE_EVAL match. Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me> Singed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'lib/ldb/include')
-rw-r--r--lib/ldb/include/ldb_module.h13
-rw-r--r--lib/ldb/include/ldb_private.h6
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/ldb/include/ldb_module.h b/lib/ldb/include/ldb_module.h
index be50c09210..34e33c0ec5 100644
--- a/lib/ldb/include/ldb_module.h
+++ b/lib/ldb/include/ldb_module.h
@@ -162,6 +162,8 @@ int ldb_match_msg_error(struct ldb_context *ldb,
int ldb_match_msg_objectclass(const struct ldb_message *msg,
const char *objectclass);
+int ldb_register_extended_match_rules(struct ldb_context *ldb);
+
/* The following definitions come from lib/ldb/common/ldb_modules.c */
struct ldb_module *ldb_module_new(TALLOC_CTX *memctx,
@@ -369,4 +371,15 @@ bool ldb_msg_element_equal_ordered(const struct ldb_message_element *el1,
const struct ldb_message_element *el2);
+struct ldb_extended_match_rule
+{
+ const char *oid;
+ int (*callback)(struct ldb_context *, const char *oid,
+ const struct ldb_message *, const char *,
+ const struct ldb_val *, bool *);
+};
+
+int ldb_register_extended_match_rule(struct ldb_context *ldb,
+ const struct ldb_extended_match_rule *rule);
+
#endif
diff --git a/lib/ldb/include/ldb_private.h b/lib/ldb/include/ldb_private.h
index 526bf5e491..797744875a 100644
--- a/lib/ldb/include/ldb_private.h
+++ b/lib/ldb/include/ldb_private.h
@@ -100,6 +100,12 @@ struct ldb_context {
/* debugging operations */
struct ldb_debug_ops debug_ops;
+ /* extended matching rules */
+ struct ldb_extended_match_entry {
+ const struct ldb_extended_match_rule *rule;
+ struct ldb_extended_match_entry *prev, *next;
+ } *extended_match_rules;
+
/* custom utf8 functions */
struct ldb_utf8_fns utf8_fns;