s3:libsmb: Add some useful debug output to cliconnect
authorAndreas Schneider <asn@samba.org>
Wed, 27 Mar 2019 15:45:39 +0000 (16:45 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 2 Apr 2019 01:12:09 +0000 (01:12 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13861

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/libsmb/cliconnect.c

index fcc8e0b67b8a0475ed51b43657e14e42cb543e51..3a116b6c7e6a613cfa8d0b4092d82c2d34f94b30 100644 (file)
@@ -346,6 +346,8 @@ NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli,
                return NT_STATUS_OK;
        }
 
+       DBG_INFO("Doing kinit for %s to access %s\n",
+                user_principal, target_hostname);
 
        /*
         * TODO: This should be done within the gensec layer
@@ -375,6 +377,11 @@ NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli,
                 */
        }
 
+       DBG_DEBUG("Successfully authenticated as %s to access %s using "
+                 "Kerberos\n",
+                 user_principal,
+                 target_hostname);
+
        TALLOC_FREE(frame);
        return NT_STATUS_OK;
 }
@@ -1351,6 +1358,10 @@ static struct tevent_req *cli_session_setup_spnego_send(
                return tevent_req_post(req, ev);
        }
 
+       DBG_INFO("Connect to %s as %s using SPNEGO\n",
+                target_hostname,
+                cli_credentials_get_principal(creds, talloc_tos()));
+
        subreq = cli_session_setup_gensec_send(state, ev, cli, creds,
                                               target_service, target_hostname);
        if (tevent_req_nomem(subreq, req)) {
@@ -1554,6 +1565,8 @@ struct tevent_req *cli_session_setup_creds_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
+       DBG_INFO("Connect to %s as %s using NTLM\n", domain, username);
+
        if ((sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) == 0) {
                bool use_unicode = smbXcli_conn_use_unicode(cli->conn);
                uint8_t *bytes = NULL;