From 3d75111fd61d57d2a2fb9e19bf587effb0816339 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Oct 2010 20:02:18 +1100 Subject: s4-ldb: added an optional operator_fn in the schema syntax this function takes the operator being invoked, which will allow schema functions to provide more fine grained control over comparisons. The key bug this was introduced to fix is the incorrect handling of the LDB_OP_PRESENT test for deleted linked attributes. The backends are unaware of the deleted state of these links, so they cannot do a LDB_OP_PRESENT test on their own. Pair-Programmed-With: Andrew Bartlett --- source4/lib/ldb/include/ldb.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/lib/ldb/include') diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index d29aed491a..c53cb7a6bf 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -353,6 +353,10 @@ char *ldb_binary_encode_string(TALLOC_CTX *mem_ctx, const char *string); */ typedef int (*ldb_attr_handler_t)(struct ldb_context *, TALLOC_CTX *mem_ctx, const struct ldb_val *, struct ldb_val *); typedef int (*ldb_attr_comparison_t)(struct ldb_context *, TALLOC_CTX *mem_ctx, const struct ldb_val *, const struct ldb_val *); +struct ldb_schema_attribute; +typedef int (*ldb_attr_operator_t)(struct ldb_context *, enum ldb_parse_op operation, + const struct ldb_schema_attribute *a, + const struct ldb_val *, const struct ldb_val *, bool *matched); /* attribute handler structure @@ -370,6 +374,7 @@ struct ldb_schema_syntax { ldb_attr_handler_t ldif_write_fn; ldb_attr_handler_t canonicalise_fn; ldb_attr_comparison_t comparison_fn; + ldb_attr_operator_t operator_fn; }; struct ldb_schema_attribute { -- cgit