Author: abartlet
Date: 2006-11-07 00:19:16 +0000 (Tue, 07 Nov 2006)
New Revision: 19595

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19595

Log:
Seperate debug messages between database failure and simple lack of
records.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/auth/gensec/schannel_state.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/gensec/schannel_state.c
===================================================================
--- branches/SAMBA_4_0/source/auth/gensec/schannel_state.c      2006-11-06 
23:25:30 UTC (rev 19594)
+++ branches/SAMBA_4_0/source/auth/gensec/schannel_state.c      2006-11-07 
00:19:16 UTC (rev 19595)
@@ -196,11 +196,18 @@
        }
 
        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;
+       }
 
        val = ldb_msg_find_ldb_val(res->msgs[0], "sessionKey");
        if (val == NULL || val->length != 16) {

Reply via email to