summaryrefslogtreecommitdiff
path: root/source3/lib/ldb/common
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-01-21 15:18:05 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-01-21 15:18:05 +0100
commit47951fc5d0085e124666b7667715bba98076820e (patch)
tree67216ad0d594eb5a7238327c386ba34594142118 /source3/lib/ldb/common
parentd3199276eac8caa55c8334458d156fd4badae338 (diff)
downloadsamba-47951fc5d0085e124666b7667715bba98076820e.tar.gz
samba-47951fc5d0085e124666b7667715bba98076820e.tar.bz2
samba-47951fc5d0085e124666b7667715bba98076820e.zip
Reorder arguments to ldb_search() to match what is in Samba 4.
Diffstat (limited to 'source3/lib/ldb/common')
-rw-r--r--source3/lib/ldb/common/ldb.c22
-rw-r--r--source3/lib/ldb/common/ldb_modules.c2
2 files changed, 12 insertions, 12 deletions
diff --git a/source3/lib/ldb/common/ldb.c b/source3/lib/ldb/common/ldb.c
index c8aa6afdfc..495047f3a1 100644
--- a/source3/lib/ldb/common/ldb.c
+++ b/source3/lib/ldb/common/ldb.c
@@ -166,8 +166,8 @@ static const struct ldb_dn *ldb_set_default_basedn(struct ldb_context *ldb)
}
tmp_ctx = talloc_new(ldb);
- ret = ldb_search(ldb, ldb_dn_new(tmp_ctx), LDB_SCOPE_BASE,
- "(objectClass=*)", attrs, &res);
+ ret = ldb_search(ldb, ldb, &res, ldb_dn_new(tmp_ctx), LDB_SCOPE_BASE,
+ attrs, "(objectClass=*)");
if (ret == LDB_SUCCESS) {
if (res->count == 1) {
basedn = ldb_msg_find_attr_as_dn(ldb, res->msgs[0], "defaultNamingContext");
@@ -745,12 +745,12 @@ int ldb_build_rename_req(struct ldb_request **ret_req,
note that ldb_search() will automatically replace a NULL 'base' value with the
defaultNamingContext from the rootDSE if available.
*/
-int ldb_search(struct ldb_context *ldb,
- const struct ldb_dn *base,
- enum ldb_scope scope,
- const char *expression,
- const char * const *attrs,
- struct ldb_result **_res)
+int ldb_search(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
+ struct ldb_result **_res,
+ const struct ldb_dn *base,
+ enum ldb_scope scope,
+ const char * const *attrs,
+ const char *expression)
{
struct ldb_request *req;
int ret;
@@ -758,12 +758,12 @@ int ldb_search(struct ldb_context *ldb,
*_res = NULL;
- res = talloc_zero(ldb, struct ldb_result);
+ res = talloc_zero(mem_ctx, struct ldb_result);
if (!res) {
return LDB_ERR_OPERATIONS_ERROR;
}
- ret = ldb_build_search_req(&req, ldb, ldb,
+ ret = ldb_build_search_req(&req, ldb, mem_ctx,
base?base:ldb_get_default_basedn(ldb),
scope,
expression,
@@ -819,7 +819,7 @@ int ldb_search_exp_fmt(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_
return LDB_ERR_OPERATIONS_ERROR;
}
- ret = ldb_search(ldb, base, scope, expression, attrs, &res);
+ ret = ldb_search(ldb, ldb, &res, base, scope, attrs, expression);
if (ret == LDB_SUCCESS) {
talloc_steal(mem_ctx, res);
diff --git a/source3/lib/ldb/common/ldb_modules.c b/source3/lib/ldb/common/ldb_modules.c
index fa7f685d97..8699cd8b95 100644
--- a/source3/lib/ldb/common/ldb_modules.c
+++ b/source3/lib/ldb/common/ldb_modules.c
@@ -340,7 +340,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
return -1;
}
- ret = ldb_search(ldb, mods_dn, LDB_SCOPE_BASE, "", attrs, &res);
+ ret = ldb_search(ldb, ldb, &res, mods_dn, LDB_SCOPE_BASE, attrs, "");
talloc_steal(mods_dn, res);
if (ret == LDB_SUCCESS && (res->count == 0 || res->msgs[0]->num_elements == 0)) {
ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db\n");