s3:libsmb: Only print error message if kerberos use is forced
authorAndreas Schneider <asn@samba.org>
Mon, 20 Mar 2017 15:08:20 +0000 (16:08 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 21 Mar 2017 13:25:54 +0000 (14:25 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12704

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Mar 21 14:25:54 CET 2017 on sn-devel-144

source3/libsmb/cliconnect.c

index 029c3d4760ecf3756340b2c762af309a3303db34..93f873079db223edf8680fa9fd485b87321c51c3 100644 (file)
@@ -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);