From 97aec1a70c260f19e21d56ed08b155f80370e71b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Nov 2006 00:19:16 +0000 Subject: r19595: Seperate debug messages between database failure and simple lack of records. Andrew Bartlett (This used to be commit 163f75372792b0afa72f48d64d78d82b72d8eda5) --- source4/auth/gensec/schannel_state.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/auth/gensec/schannel_state.c') diff --git a/source4/auth/gensec/schannel_state.c b/source4/auth/gensec/schannel_state.c index 2f33b12a8d..e9c81f370c 100644 --- a/source4/auth/gensec/schannel_state.c +++ b/source4/auth/gensec/schannel_state.c @@ -196,8 +196,15 @@ NTSTATUS schannel_fetch_session_key_ldb(TALLOC_CTX *mem_ctx, } ret = ldb_search(ldb, NULL, LDB_SCOPE_SUBTREE, expr, NULL, &res); - if (ret != LDB_SUCCESS || res->count != 1) { - DEBUG(3,("schannel: Failed to find a record for client: %s\n", computer_name)); + talloc_free(expr); + 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); return NT_STATUS_INVALID_HANDLE; } -- cgit