1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-30 20:23:49 +03:00

r17542: In using ldb_map, I ran across some very odd behaviours when we search

for objectClass=xyz.  The code has been warning at me 'no
covert_operator set', and indeed this is the case.  (It then proceeds to
strip this as a search expression)

In this commit, I have implemented a convert_operator for objectClass,
by pretending it is a simple MAP_CONVERT operator for the search
requests.

I also have changed the logic for when we should bail out.  I can only
see reason to bail out on the search if we have both local and remote
trees.  How can a remote-only search be un-splittable?

Andrew Bartlett
This commit is contained in:
Andrew Bartlett
2006-08-14 23:25:04 +00:00
committed by Gerald (Jerry) Carter
parent ebfb719e3d
commit 656e58672c
4 changed files with 26 additions and 5 deletions

View File

@@ -679,7 +679,7 @@ static int map_subtree_collect_remote_list(struct ldb_module *module, void *mem_
}
/* Collect a simple subtree that queries attributes in the remote partition */
static int map_subtree_collect_remote_simple(struct ldb_module *module, void *mem_ctx, struct ldb_parse_tree **new, const struct ldb_parse_tree *tree, const struct ldb_map_attribute *map)
int map_subtree_collect_remote_simple(struct ldb_module *module, void *mem_ctx, struct ldb_parse_tree **new, const struct ldb_parse_tree *tree, const struct ldb_map_attribute *map)
{
const char *attr;
struct ldb_val val;
@@ -757,8 +757,7 @@ static int map_subtree_collect_remote(struct ldb_module *module, void *mem_ctx,
map = map_attr_find_local(data, tree->u.equality.attr);
if (map->convert_operator) {
*new = map->convert_operator(data, mem_ctx, tree);
return 0;
return map->convert_operator(module, mem_ctx, new, tree);
}
if (map->type == MAP_GENERATE) {
@@ -1084,7 +1083,7 @@ int map_search(struct ldb_module *module, struct ldb_request *req)
goto failed;
}
if (((local_tree == NULL) ^ (remote_tree == NULL)) &&
if (((local_tree != NULL) && (remote_tree != NULL)) &&
(!ldb_parse_tree_check_splittable(req->op.search.tree))) {
/* The query can't safely be split, enumerate the remote partition */
local_tree = NULL;