summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/common/ldb_match.c13
-rw-r--r--lib/ldb/include/ldb_module.h3
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/ldb/common/ldb_match.c b/lib/ldb/common/ldb_match.c
index 7918aec65f..3087d34c46 100644
--- a/lib/ldb/common/ldb_match.c
+++ b/lib/ldb/common/ldb_match.c
@@ -395,6 +395,16 @@ static int ldb_comparator_false(const char *oid, const struct ldb_val *v1, const
return LDB_SUCCESS;
}
+/*
+ always return true
+*/
+static int ldb_comparator_true(const char *oid, const struct ldb_val *v1, const struct ldb_val *v2,
+ bool *matched)
+{
+ *matched = true;
+ return LDB_SUCCESS;
+}
+
/*
extended match, handles things like bitops
@@ -411,7 +421,8 @@ static int ldb_match_extended(struct ldb_context *ldb,
} rules[] = {
{ LDB_OID_COMPARATOR_AND, ldb_comparator_bitmask},
{ LDB_OID_COMPARATOR_OR, ldb_comparator_bitmask},
- { SAMBA_LDAP_MATCH_ALWAYS_FALSE, ldb_comparator_false}
+ { SAMBA_LDAP_MATCH_ALWAYS_FALSE, ldb_comparator_false},
+ { SAMBA_LDAP_MATCH_ALWAYS_TRUE, ldb_comparator_true}
};
int (*comp)(const char *,const struct ldb_val *, const struct ldb_val *, bool *) = NULL;
struct ldb_message_element *el;
diff --git a/lib/ldb/include/ldb_module.h b/lib/ldb/include/ldb_module.h
index be50c09210..20c2a0f316 100644
--- a/lib/ldb/include/ldb_module.h
+++ b/lib/ldb/include/ldb_module.h
@@ -55,6 +55,9 @@ struct ldb_module;
/* an extended match rule that always fails to match */
#define SAMBA_LDAP_MATCH_ALWAYS_FALSE "1.3.6.1.4.1.7165.4.5.1"
+/* an extended match rule that always matches */
+#define SAMBA_LDAP_MATCH_ALWAYS_TRUE "1.3.6.1.4.1.7165.4.5.2"
+
/* The const char * const * pointer to a list of secret (password)
* attributes, not to be printed in trace messages */
#define LDB_SECRET_ATTRIBUTE_LIST_OPAQUE "LDB_SECRET_ATTRIBUTE_LIST"