summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmb_server.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-10-22 15:06:38 -0700
committerJeremy Allison <jra@samba.org>2009-10-22 15:06:38 -0700
commit843adc1981d0ad380d207bdc014209aa8dd73344 (patch)
tree07a79f9d548f5b338aa2181997bd46834fd5bf02 /source3/libsmb/libsmb_server.c
parent5c6944d33f7d4b3ec74d8ab29d344cd33583ede9 (diff)
downloadsamba-843adc1981d0ad380d207bdc014209aa8dd73344.tar.gz
samba-843adc1981d0ad380d207bdc014209aa8dd73344.tar.bz2
samba-843adc1981d0ad380d207bdc014209aa8dd73344.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 :-). Jeremy.
Diffstat (limited to 'source3/libsmb/libsmb_server.c')
-rw-r--r--source3/libsmb/libsmb_server.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index 60849c812f..18b12a1a9b 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -498,6 +498,17 @@ again:
errno = EPERM;
return NULL;
}
+ status = cli_init_creds(c, username_used,
+ *pp_workgroup, *pp_password);
+ } else {
+ 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"));