diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-10-31 08:01:17 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-10-31 09:29:13 +0100 |
commit | 9c2a04b460f1972c258bb0d1fc124338e1d922a1 (patch) | |
tree | 200cf9df9b769e97d08306f1c2f471f87367118c /lib | |
parent | 9dac02cabe41babfe16c7b1b003ed60277c4f799 (diff) | |
download | samba-9c2a04b460f1972c258bb0d1fc124338e1d922a1.tar.gz samba-9c2a04b460f1972c258bb0d1fc124338e1d922a1.tar.bz2 samba-9c2a04b460f1972c258bb0d1fc124338e1d922a1.zip |
ldb: Add SAMBA_LDAP_MATCH_ALWAYS_TRUE
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ldb/common/ldb_match.c | 13 | ||||
-rw-r--r-- | lib/ldb/include/ldb_module.h | 3 |
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" |