From 849d042dd88e8e7de2748524b054b350af06a859 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Aug 2011 17:16:44 +1000 Subject: ldb: added a new always-fail ldap extended match OID this is used when rewriting filter rules to replace a filter rule with one that is guaranteed not to match Pair-Programmed-With: Andrew Bartlett --- lib/ldb/common/ldb_match.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/ldb/common') diff --git a/lib/ldb/common/ldb_match.c b/lib/ldb/common/ldb_match.c index c23e80478a..5eee02dea3 100644 --- a/lib/ldb/common/ldb_match.c +++ b/lib/ldb/common/ldb_match.c @@ -380,6 +380,16 @@ static int ldb_comparator_bitmask(const char *oid, const struct ldb_val *v1, con return LDB_SUCCESS; } +/* + always return false +*/ +static int ldb_comparator_false(const char *oid, const struct ldb_val *v1, const struct ldb_val *v2, + bool *matched) +{ + *matched = false; + return LDB_SUCCESS; +} + /* extended match, handles things like bitops @@ -395,7 +405,8 @@ static int ldb_match_extended(struct ldb_context *ldb, int (*comparator)(const char *, const struct ldb_val *, const struct ldb_val *, bool *); } rules[] = { { LDB_OID_COMPARATOR_AND, ldb_comparator_bitmask}, - { LDB_OID_COMPARATOR_OR, ldb_comparator_bitmask} + { LDB_OID_COMPARATOR_OR, ldb_comparator_bitmask}, + { SAMBA_LDAP_MATCH_ALWAYS_FALSE, ldb_comparator_false} }; int (*comp)(const char *,const struct ldb_val *, const struct ldb_val *, bool *) = NULL; struct ldb_message_element *el; -- cgit