s3:smbspool: Print the principal we use to authenticate with
authorAndreas Schneider <asn@samba.org>
Thu, 16 May 2019 11:41:02 +0000 (13:41 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 23 May 2019 09:41:17 +0000 (09:41 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13939

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/client/smbspool.c

index 220716136779b9c3e63e3d6885d871589be82e3c..efbdd418fdb92944f093f20a7de89defe2d52258 100644 (file)
@@ -616,6 +616,7 @@ static bool kerberos_ccache_is_valid(void) {
                return false;
        } else {
                krb5_principal default_princ = NULL;
+               char *princ_name = NULL;
 
                code = krb5_cc_get_principal(ctx,
                                             ccache,
@@ -625,6 +626,16 @@ static bool kerberos_ccache_is_valid(void) {
                        krb5_free_context(ctx);
                        return false;
                }
+
+               code = krb5_unparse_name(ctx,
+                                        default_princ,
+                                        &princ_name);
+               if (code == 0) {
+                       fprintf(stderr,
+                               "DEBUG: Try to authenticate as %s\n",
+                               princ_name);
+                       krb5_free_unparsed_name(ctx, princ_name);
+               }
                krb5_free_principal(ctx, default_princ);
        }
        krb5_cc_close(ctx, ccache);