summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-10-22 15:35:59 -0700
committerKarolin Seeger <kseeger@samba.org>2010-01-13 14:00:52 +0100
commit26cc0331a3776d5b4ec9e4e5a65211968d3598b7 (patch)
tree8a15efec3c95bdae6f4f09c712695e5555adef51
parentb516f88218b83f3ed222ae78f6546aeab0960ea5 (diff)
downloadsamba-26cc0331a3776d5b4ec9e4e5a65211968d3598b7.tar.gz
samba-26cc0331a3776d5b4ec9e4e5a65211968d3598b7.tar.xz
samba-26cc0331a3776d5b4ec9e4e5a65211968d3598b7.zip
Fix bug 6829 - smbclient does not show special characters properly. All successful calls to cli_session_setup() *must* be followed by calls to cli_init_creds() to stash the credentials we successfully connected with. There were 2 codepaths where this was missing. This caused smbclient to be unable to open the \srvsvc pipe to do an RPC netserverenum, and cause it to fall back to a RAP netserverenum, which uses DOS codepage conversion rather than the full UCS2 of RPC, so the returned characters were not correct (unless the DOS codepage was set correctly). Phew. That was fun to track down :-). Includes logic simplification in libsmb_server.c Jeremy.
(cherry picked from commit bbeda1398687b79596769a5d046e1e0f249bd382)
-rw-r--r--source/libsmb/clidfs.c3
-rw-r--r--source/libsmb/libsmb_server.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/source/libsmb/clidfs.c b/source/libsmb/clidfs.c
index 5379ff9893a..1b17679c80b 100644
--- a/source/libsmb/clidfs.c
+++ b/source/libsmb/clidfs.c
@@ -235,6 +235,9 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx,
return NULL;
}
d_printf("Anonymous login successful\n");
+ cli_init_creds(c, "", lp_workgroup(), "");
+ } else {
+ cli_init_creds(c, username, lp_workgroup(), password);
}
if ( show_sessetup ) {
diff --git a/source/libsmb/libsmb_server.c b/source/libsmb/libsmb_server.c
index 6880f5c3426..dfb56b0a3ba 100644
--- a/source/libsmb/libsmb_server.c
+++ b/source/libsmb/libsmb_server.c
@@ -497,6 +497,8 @@ again:
return NULL;
}
}
+
+ cli_init_creds(c, username_used, *pp_workgroup, *pp_password);
DEBUG(4,(" session setup ok\n"));