s3:client: use cli_session_setup_creds() in smbspool.c
authorStefan Metzmacher <metze@samba.org>
Fri, 28 Oct 2016 11:33:58 +0000 (13:33 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 15 Nov 2016 10:00:29 +0000 (11:00 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/client/smbspool.c

index 1e68f090eb86d9d0bbacfb22a51ed36840a2a7f9..7448b479fae1f94ff8039dfd33df4b9ef5643097 100644 (file)
@@ -405,6 +405,7 @@ smb_complete_connection(const char *myname,
 {
        struct cli_state *cli;  /* New connection */
        NTSTATUS        nt_status;
+       struct cli_credentials *creds = NULL;
 
        /* Start the SMB connection */
        *need_auth = false;
@@ -424,9 +425,22 @@ smb_complete_connection(const char *myname,
                return NULL;
        }
 
-       nt_status = cli_session_setup(cli, username,
-                                     password,
-                                     workgroup);
+       creds = cli_session_creds_init(cli,
+                                      username,
+                                      workgroup,
+                                      NULL, /* realm */
+                                      password,
+                                      cli->use_kerberos,
+                                      cli->fallback_after_kerberos,
+                                      cli->use_ccache,
+                                      cli->pw_nt_hash);
+       if (creds == NULL) {
+               fprintf(stderr, "ERROR: cli_session_creds_init failed\n");
+               cli_shutdown(cli);
+               return NULL;
+       }
+
+       nt_status = cli_session_setup_creds(cli, creds);
        if (!NT_STATUS_IS_OK(nt_status)) {
                fprintf(stderr, "ERROR: Session setup failed: %s\n", nt_errstr(nt_status));