diff options
author | Simo Sorce <idra@samba.org> | 2008-09-23 14:30:06 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-09-23 18:17:46 -0400 |
commit | 508527890adc7bedd47522a7dae0c96d2b2e4bae (patch) | |
tree | 77e510421ff8eb98c0a9b0836905ca2f67eaf42f /source4/dsdb/repl | |
parent | d275cc762dad1985045d381ca211e92234d9d77d (diff) | |
download | samba-508527890adc7bedd47522a7dae0c96d2b2e4bae.tar.gz samba-508527890adc7bedd47522a7dae0c96d2b2e4bae.tar.bz2 samba-508527890adc7bedd47522a7dae0c96d2b2e4bae.zip |
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.
Diffstat (limited to 'source4/dsdb/repl')
-rw-r--r-- | source4/dsdb/repl/drepl_partitions.c | 10 |
1 files changed, 4 insertions, 6 deletions
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); |