diff options
author | Simo Sorce <idra@samba.org> | 2006-12-05 04:25:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:28:51 -0500 |
commit | ea212eb00fd358e7335648b9cd556227e53df367 (patch) | |
tree | 6ae2ea6e14f0439e5e367937f289d97f5e0bb839 /source4/auth/gensec | |
parent | 07b7d84f0601c7047341c33493fcc9695e5e703b (diff) | |
download | samba-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/auth/gensec')
-rw-r--r-- | source4/auth/gensec/schannel_state.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/source4/auth/gensec/schannel_state.c b/source4/auth/gensec/schannel_state.c index 4969e9aeaa..466df33b67 100644 --- a/source4/auth/gensec/schannel_state.c +++ b/source4/auth/gensec/schannel_state.c @@ -183,27 +183,19 @@ NTSTATUS schannel_fetch_session_key_ldb(TALLOC_CTX *mem_ctx, struct ldb_result *res; int ret; const struct ldb_val *val; - char *expr=NULL; *creds = talloc_zero(mem_ctx, struct creds_CredentialState); if (!*creds) { return NT_STATUS_NO_MEMORY; } - expr = talloc_asprintf(mem_ctx, "(&(computerName=%s)(flatname=%s))", - computer_name, domain); - if (expr == NULL) { - return NT_STATUS_NO_MEMORY; - } - - ret = ldb_search(ldb, NULL, LDB_SCOPE_SUBTREE, expr, NULL, &res); - talloc_free(expr); + ret = ldb_search_exp_fmt(ldb, mem_ctx, &res, + NULL, LDB_SCOPE_SUBTREE, NULL, + "(&(computerName=%s)(flatname=%s))", computer_name, domain); if (ret != LDB_SUCCESS) { DEBUG(3,("schannel: Failed to find a record for client %s: %s\n", computer_name, ldb_errstring(ldb))); - talloc_free(res); return NT_STATUS_INVALID_HANDLE; } - talloc_steal(mem_ctx, res); if (res->count != 1) { DEBUG(3,("schannel: Failed to find a record for client: %s (found %d records)\n", computer_name, res->count)); talloc_free(res); |