summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2002-09-27 16:51:22 +0000
committerVolker Lendecke <vlendec@samba.org>2002-09-27 16:51:22 +0000
commit208b4be14b3b6ad7d76cae98c7bdd42c8af4f698 (patch)
tree23c8e73ac6e3a748977ddf219f656d73eb3e33de
parent789ccf3094a577f08c379b6d45f81326beef1630 (diff)
downloadsamba-208b4be14b3b6ad7d76cae98c7bdd42c8af4f698.tar.gz
samba-208b4be14b3b6ad7d76cae98c7bdd42c8af4f698.tar.bz2
samba-208b4be14b3b6ad7d76cae98c7bdd42c8af4f698.zip
Touching somebody else's code again... Sorry, Richard.
smbclient would announce that it can send UNICODE, but would send the plain text password in ASCII. This confused Samba HEAD somewhat. This change has been tested against Samba HEAD of today and Samba 2.2.1a. I do not have any other servers that do plain text passwords. Anybody? Volker (This used to be commit c7de62d839634a85295d1a0ef5a48270ef30aa93)
-rw-r--r--source3/libsmb/cliconnect.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 62acccdfb7..ebadafd5f0 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -188,7 +188,14 @@ static BOOL cli_session_setup_plaintext(struct cli_state *cli, char *user,
int passlen;
char *p;
- passlen = clistr_push(cli, pword, pass, sizeof(pword), STR_TERMINATE|STR_ASCII);
+ int push_flags = STR_TERMINATE;
+
+ if (capabilities & CAP_UNICODE)
+ push_flags |= STR_UNICODE;
+ else
+ push_flags |= STR_ASCII;
+
+ passlen = clistr_push(cli, pword, pass, sizeof(pword), push_flags);
set_message(cli->outbuf,13,0,True);
SCVAL(cli->outbuf,smb_com,SMBsesssetupX);
@@ -202,7 +209,7 @@ static BOOL cli_session_setup_plaintext(struct cli_state *cli, char *user,
SSVAL(cli->outbuf,smb_vwv8,0);
SIVAL(cli->outbuf,smb_vwv11,capabilities);
p = smb_buf(cli->outbuf);
- p += clistr_push(cli, p, pword, -1, STR_TERMINATE); /* password */
+ p += clistr_push(cli, p, pass, -1, push_flags); /* password */
SSVAL(cli->outbuf,smb_vwv7,PTR_DIFF(p, smb_buf(cli->outbuf)));
p += clistr_push(cli, p, user, -1, STR_TERMINATE); /* username */
p += clistr_push(cli, p, workgroup, -1, STR_TERMINATE); /* workgroup */