libnet_keytab: add some debug statements to libnet_keytab_search().
authorMichael Adam <obnox@samba.org>
Tue, 29 Jul 2008 15:54:01 +0000 (17:54 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 1 Aug 2008 14:04:43 +0000 (16:04 +0200)
Michael
(This used to be commit d3354c3516b56f254583f3dd065302b27d02af2b)

source3/libnet/libnet_keytab.c

index 6fe718bb81046927e2595c0ee8f359e67b1c136e..bc3163d6f6d34fe7571f92da50f1a9e032adc4cc 100644 (file)
@@ -204,6 +204,8 @@ struct libnet_keytab_entry *libnet_keytab_search(struct libnet_keytab_context *c
 
        ret = krb5_kt_start_seq_get(ctx->context, ctx->keytab, &cursor);
        if (ret) {
+               DEBUG(10, ("krb5_kt_start_seq_get failed: %s",
+                         error_message(ret)));
                return NULL;
        }
 
@@ -231,25 +233,31 @@ struct libnet_keytab_entry *libnet_keytab_search(struct libnet_keytab_context *c
 
                entry = talloc_zero(mem_ctx, struct libnet_keytab_entry);
                if (!entry) {
+                       DEBUG(3, ("talloc failed\n"));
                        goto fail;
                }
 
                entry->name = talloc_strdup(entry, princ_s);
                if (!entry->name) {
+                       DEBUG(3, ("talloc_strdup_failed\n"));
                        goto fail;
                }
 
                entry->principal = talloc_strdup(entry, princ_s);
                if (!entry->principal) {
+                       DEBUG(3, ("talloc_strdup_failed\n"));
                        goto fail;
                }
 
                entry->password = data_blob_talloc(entry, kt_entry.key.contents,
                                                   kt_entry.key.length);
                if (!entry->password.data) {
+                       DEBUG(3, ("data_blob_talloc failed\n"));
                        goto fail;
                }
 
+               DEBUG(10, ("found entry\n"));
+
                smb_krb5_kt_free_entry(ctx->context, &kt_entry);
                SAFE_FREE(princ_s);
                break;