Fix bug 6829 - smbclient does not show special characters properly. All successful...
authorJeremy Allison <jra@samba.org>
Thu, 22 Oct 2009 22:30:47 +0000 (15:30 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 26 Oct 2009 10:52:33 +0000 (11:52 +0100)
(cherry picked from commit 587ca743bf1491e97c984ce4bec5a9bd0a1ae69a)

source3/libsmb/clidfs.c
source3/libsmb/libsmb_server.c

index 5e944f1aaad29d6a3a98ff0780cc54275b5b7fa7..53dc6d7984434ddc78effeb4d60ecc2a11a7d667 100644 (file)
@@ -216,6 +216,15 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx,
                        return NULL;
                }
                d_printf("Anonymous login successful\n");
+               status = cli_init_creds(c, "", lp_workgroup(), "");
+       } else {
+               status = cli_init_creds(c, username, lp_workgroup(), password);
+       }
+
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(10,("cli_init_creds() failed: %s\n", nt_errstr(status)));
+               cli_shutdown(c);
+               return NULL;
        }
 
        if ( show_sessetup ) {
index 60849c812fe6130000bf66b6c468ec238ca758f3..cf2d1d57867215b6cf69c635a2668cd0b11937ad 100644 (file)
@@ -500,6 +500,14 @@ again:
                 }
        }
 
+       status = cli_init_creds(c, username_used,
+                       *pp_workgroup, *pp_password);
+       if (!NT_STATUS_IS_OK(status)) {
+               errno = map_errno_from_nt_status(status);
+               cli_shutdown(c);
+               return NULL;
+       }
+
        DEBUG(4,(" session setup ok\n"));
 
        status = cli_tcon_andx(c, share, "?????", *pp_password,