mirror of
https://github.com/samba-team/samba.git
synced 2025-12-16 00:23:52 +03:00
r10753: don't require every ldb module to implement both a search_bytree() and
a search() function, instead each module now only implements the
bytree method, and the expression based search is handled generically
by the modules code. This makes for more consistency and less code
duplication.
fixed the tdb backend to handle BASE searches much more
efficiently. They now always only lookup one record, regardless of the
search expression
(This used to be commit 7e44f9153c)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
92da5aa6b8
commit
5fd031c97d
@@ -172,13 +172,23 @@ int ldb_search(struct ldb_context *ldb,
|
||||
const char *expression,
|
||||
const char * const *attrs, struct ldb_message ***res)
|
||||
{
|
||||
ldb_reset_err_string(ldb);
|
||||
struct ldb_parse_tree *tree;
|
||||
int ret;
|
||||
|
||||
return ldb->modules->ops->search(ldb->modules, base, scope, expression, attrs, res);
|
||||
tree = ldb_parse_tree(ldb, expression);
|
||||
if (tree == NULL) {
|
||||
ldb_set_errstring(ldb->modules, talloc_strdup(ldb, "Unable to parse search expression"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = ldb_search_bytree(ldb, base, scope, tree, attrs, res);
|
||||
talloc_free(tree);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
search the database given a LDAP-like search expression
|
||||
search the database given a search tree
|
||||
|
||||
return the number of records found, or -1 on error
|
||||
|
||||
|
||||
Reference in New Issue
Block a user