summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-12-05 04:25:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:51 -0500
commitea212eb00fd358e7335648b9cd556227e53df367 (patch)
tree6ae2ea6e14f0439e5e367937f289d97f5e0bb839 /source4/param
parent07b7d84f0601c7047341c33493fcc9695e5e703b (diff)
downloadsamba-ea212eb00fd358e7335648b9cd556227e53df367.tar.gz
samba-ea212eb00fd358e7335648b9cd556227e53df367.tar.bz2
samba-ea212eb00fd358e7335648b9cd556227e53df367.zip
r20034: Start using ldb_search_exp_fmt()
(This used to be commit 4f07542143ddf5066f0360d965f26a8470504047)
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/share_ldb.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/source4/param/share_ldb.c b/source4/param/share_ldb.c
index 8db3a02f1c..451d003a0d 100644
--- a/source4/param/share_ldb.c
+++ b/source4/param/share_ldb.c
@@ -211,7 +211,6 @@ static NTSTATUS sldb_get_config(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb;
struct ldb_result *res;
TALLOC_CTX *tmp_ctx;
- char *filter;
tmp_ctx = talloc_new(mem_ctx);
if (!tmp_ctx) {
@@ -221,14 +220,9 @@ static NTSTATUS sldb_get_config(TALLOC_CTX *mem_ctx,
ldb = talloc_get_type(ctx->priv_data, struct ldb_context);
- filter = talloc_asprintf(tmp_ctx,"(name=%s)", name);
- if (!filter) {
- DEBUG(0,("ERROR: Out of memory!\n"));
- talloc_free(tmp_ctx);
- return NT_STATUS_NO_MEMORY;
- }
- ret = ldb_search(ldb, ldb_dn_new(tmp_ctx, ldb, "CN=SHARES"), LDB_SCOPE_SUBTREE, filter, NULL, &res);
- talloc_steal(tmp_ctx, res);
+ ret = ldb_search_exp_fmt(ldb, tmp_ctx, &res,
+ ldb_dn_new(tmp_ctx, ldb, "CN=SHARES"), LDB_SCOPE_SUBTREE, NULL,
+ "(name=%s)", name);
if (ret != LDB_SUCCESS || res->count != 1) {
talloc_free(tmp_ctx);
return NT_STATUS_BAD_NETWORK_NAME;