summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_cache.c10
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c11
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c30
3 files changed, 6 insertions, 45 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_cache.c b/source4/lib/ldb/ldb_tdb/ldb_cache.c
index 0b7ddad5db..be76f7085b 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_cache.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_cache.c
@@ -39,9 +39,8 @@
#define LTDB_FLAG_CASE_INSENSITIVE (1<<0)
#define LTDB_FLAG_INTEGER (1<<1)
-#define LTDB_FLAG_WILDCARD (1<<2)
-#define LTDB_FLAG_HIDDEN (1<<3)
-#define LTDB_FLAG_OBJECTCLASS (1<<4)
+#define LTDB_FLAG_HIDDEN (1<<2)
+#define LTDB_FLAG_OBJECTCLASS (1<<3)
/* valid attribute flags */
static const struct {
@@ -50,7 +49,6 @@ static const struct {
} ltdb_valid_attr_flags[] = {
{ "CASE_INSENSITIVE", LTDB_FLAG_CASE_INSENSITIVE },
{ "INTEGER", LTDB_FLAG_INTEGER },
- { "WILDCARD", LTDB_FLAG_WILDCARD },
{ "HIDDEN", LTDB_FLAG_HIDDEN },
{ "NONE", 0 },
{ NULL, 0 }
@@ -138,10 +136,6 @@ static int ltdb_attributes_load(struct ldb_module *module)
case 0:
syntax = LDB_SYNTAX_OCTET_STRING;
break;
- case LTDB_FLAG_WILDCARD:
- case LTDB_FLAG_WILDCARD | LTDB_FLAG_CASE_INSENSITIVE:
- syntax = LDB_SYNTAX_WILDCARD;
- break;
case LTDB_FLAG_CASE_INSENSITIVE:
syntax = LDB_SYNTAX_DIRECTORY_STRING;
break;
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index a3317a8765..03ad0612d4 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -188,13 +188,6 @@ static int ltdb_index_dn_simple(struct ldb_module *module,
list->count = 0;
list->dn = NULL;
- /*
- if the value is a wildcard then we can't do a match via indexing
- */
- if (ltdb_has_wildcard(module, tree->u.simple.attr, &tree->u.simple.value)) {
- return -1;
- }
-
/* if the attribute isn't in the list of indexed attributes then
this node needs a full search */
if (ldb_msg_find_idx(index_list, tree->u.simple.attr, NULL, LTDB_IDXATTR) == -1) {
@@ -581,6 +574,8 @@ static int ltdb_index_dn(struct ldb_module *module,
ret = ltdb_index_dn_leaf(module, tree, index_list, list);
break;
+ case LDB_OP_PRESENT:
+ case LDB_OP_SUBSTRING:
case LDB_OP_EXTENDED:
/* we can't index with fancy bitops yet */
ret = -1;
@@ -638,7 +633,7 @@ static int ldb_index_filter(struct ldb_module *module, struct ldb_parse_tree *tr
}
ret = 0;
- if (ldb_match_message(module->ldb, msg, tree, base, scope) == 1) {
+ if (ldb_match_msg(module->ldb, msg, tree, base, scope) == 1) {
ret = ltdb_add_attr_results(module, msg, attrs, &count, res);
}
talloc_free(msg);
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index e48043da88..3ecb2d9b39 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -188,34 +188,6 @@ static struct ldb_message *ltdb_pull_attrs(struct ldb_module *module,
}
-
-/*
- see if a ldb_val is a wildcard
- return 1 if yes, 0 if no
-*/
-int ltdb_has_wildcard(struct ldb_module *module, const char *attr_name,
- const struct ldb_val *val)
-{
- const struct ldb_attrib_handler *h;
-
- /* all attribute types recognise the "*" wildcard */
- if (val->length == 1 && strncmp((char *)val->data, "*", 1) == 0) {
- return 1;
- }
-
- if (strpbrk(val->data, "*?") == NULL) {
- return 0;
- }
-
- h = ldb_attrib_handler(module->ldb, attr_name);
- if (h->flags & LDB_ATTR_FLAG_WILDCARD) {
- return 1;
- }
-
- return 0;
-}
-
-
/*
search the database for a single simple dn, returning all attributes
in a single message
@@ -416,7 +388,7 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi
}
/* see if it matches the given expression */
- if (!ldb_match_message(sinfo->module->ldb, msg, sinfo->tree,
+ if (!ldb_match_msg(sinfo->module->ldb, msg, sinfo->tree,
sinfo->base, sinfo->scope)) {
talloc_free(msg);
return 0;