From 01ae4bd54a66ff873e6c0e2d090f3d04469e5d14 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 20 Mar 2017 16:08:20 +0100 Subject: [PATCH] s3:libsmb: Only print error message if kerberos use is forced BUG: https://bugzilla.samba.org/show_bug.cgi?id=12704 Signed-off-by: Andreas Schneider Reviewed-by: Ralph Boehme Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Tue Mar 21 14:25:54 CET 2017 on sn-devel-144 (cherry picked from commit c0e196b2238914f88015c0f8a9073beee473120b) --- source3/libsmb/cliconnect.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 55768bfd6e7..a2362ceb863 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -349,9 +349,15 @@ NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli, 0 /* no time correction for now */, NULL); if (ret != 0) { - DEBUG(0, ("Kinit for %s to access %s failed: %s\n", - user_principal, target_hostname, - error_message(ret))); + int dbglvl = DBGLVL_WARNING; + + if (krb5_state == CRED_MUST_USE_KERBEROS) { + dbglvl = DBGLVL_ERR; + } + + DEBUG(dbglvl, ("Kinit for %s to access %s failed: %s\n", + user_principal, target_hostname, + error_message(ret))); if (krb5_state == CRED_MUST_USE_KERBEROS) { TALLOC_FREE(frame); return krb5_to_nt_status(ret); -- 2.12.0