From 508527890adc7bedd47522a7dae0c96d2b2e4bae Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 23 Sep 2008 14:30:06 -0400 Subject: Merge ldb_search() and ldb_search_exp_fmt() into a simgle function. The previous ldb_search() interface made it way too easy to leak results, and being able to use a printf-like expression turns to be really useful. --- source4/dsdb/repl/drepl_partitions.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source4/dsdb/repl/drepl_partitions.c') diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c index 8a1c5aa31a..4f7afc0854 100644 --- a/source4/dsdb/repl/drepl_partitions.c +++ b/source4/dsdb/repl/drepl_partitions.c @@ -48,8 +48,8 @@ WERROR dreplsrv_load_partitions(struct dreplsrv_service *s) basedn = ldb_dn_new(s, s->samdb, NULL); W_ERROR_HAVE_NO_MEMORY(basedn); - ret = ldb_search(s->samdb, basedn, LDB_SCOPE_BASE, - "(objectClass=*)", attrs, &r); + ret = ldb_search(s->samdb, s, &r, basedn, LDB_SCOPE_BASE, attrs, + "(objectClass=*)"); talloc_free(basedn); if (ret != LDB_SUCCESS) { return WERR_FOOBAR; @@ -57,7 +57,6 @@ WERROR dreplsrv_load_partitions(struct dreplsrv_service *s) talloc_free(r); return WERR_FOOBAR; } - talloc_steal(s, r); el = ldb_msg_find_element(r->msgs[0], "namingContexts"); if (!el) { @@ -201,15 +200,14 @@ static WERROR dreplsrv_refresh_partition(struct dreplsrv_service *s, DEBUG(2, ("dreplsrv_refresh_partition(%s)\n", ldb_dn_get_linearized(p->dn))); - ret = ldb_search(s->samdb, p->dn, LDB_SCOPE_BASE, - "(objectClass=*)", attrs, &r); + ret = ldb_search(s->samdb, mem_ctx, &r, p->dn, LDB_SCOPE_BASE, attrs, + "(objectClass=*)"); if (ret != LDB_SUCCESS) { return WERR_FOOBAR; } else if (r->count != 1) { talloc_free(r); return WERR_FOOBAR; } - talloc_steal(mem_ctx, r); ZERO_STRUCT(p->nc); p->nc.dn = ldb_dn_alloc_linearized(p, p->dn); -- cgit From 956599975573044f5f930ef23ce54c11db156ebe Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 11 Oct 2008 21:31:42 +0200 Subject: Fix include paths to new location of libutil. --- source4/dsdb/repl/drepl_partitions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/dsdb/repl/drepl_partitions.c') diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c index 4f7afc0854..f36b735d32 100644 --- a/source4/dsdb/repl/drepl_partitions.c +++ b/source4/dsdb/repl/drepl_partitions.c @@ -27,7 +27,7 @@ #include "lib/messaging/irpc.h" #include "dsdb/repl/drepl_service.h" #include "lib/ldb/include/ldb_errors.h" -#include "lib/util/dlinklist.h" +#include "../lib/util/dlinklist.h" #include "librpc/gen_ndr/ndr_misc.h" #include "librpc/gen_ndr/ndr_drsuapi.h" #include "librpc/gen_ndr/ndr_drsblobs.h" -- cgit