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/utils | |
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/utils')
-rw-r--r-- | source4/utils/ad2oLschema.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source4/utils/ad2oLschema.c b/source4/utils/ad2oLschema.c index e229bd104b..3c2ffe7a00 100644 --- a/source4/utils/ad2oLschema.c +++ b/source4/utils/ad2oLschema.c @@ -75,18 +75,16 @@ static struct ldb_dn *find_schema_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ct } /* Search for rootdse */ - ldb_ret = ldb_search(ldb, basedn, LDB_SCOPE_BASE, NULL, rootdse_attrs, &rootdse_res); + ldb_ret = ldb_search(ldb, mem_ctx, &rootdse_res, + basedn, LDB_SCOPE_BASE, rootdse_attrs, NULL); if (ldb_ret != LDB_SUCCESS) { - ldb_ret = ldb_search(ldb, basedn, LDB_SCOPE_SUBTREE, - "(&(objectClass=dMD)(cn=Schema))", - NULL, &schema_res); + ldb_ret = ldb_search(ldb, mem_ctx, &schema_res, basedn, LDB_SCOPE_SUBTREE, + NULL, "(&(objectClass=dMD)(cn=Schema))"); if (ldb_ret) { printf("cn=Schema Search failed: %s\n", ldb_errstring(ldb)); return NULL; } - talloc_steal(mem_ctx, schema_res); - if (schema_res->count != 1) { talloc_free(schema_res); printf("Failed to find rootDSE"); |