summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-02-09 23:46:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:36 -0500
commit2257618d7f282ebc7b99279728b4f05c6593c02b (patch)
treeb062b46d02a541301004e97d954e08278c6acc95 /source3
parenta572700531aeca75c62d1a189efd4606dfa8b354 (diff)
downloadsamba-2257618d7f282ebc7b99279728b4f05c6593c02b.tar.gz
samba-2257618d7f282ebc7b99279728b4f05c6593c02b.tar.bz2
samba-2257618d7f282ebc7b99279728b4f05c6593c02b.zip
r5290: Fix for bug #2323 - plaintext problem with WinXP.
Jeremy. (This used to be commit 3e10c36cb50462d1f220029e8fa64c3b6e554e6c)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/sesssetup.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index cff7d7371c..40ea28a86d 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -755,10 +755,18 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,
pstring pass;
BOOL unic=SVAL(inbuf, smb_flg2) & FLAGS2_UNICODE_STRINGS;
+#if 0
+ /* This was the previous fix. Not sure if it's still valid. JRA. */
if ((ra_type == RA_WINNT) && (passlen2 == 0) && unic && passlen1) {
/* NT4.0 stuffs up plaintext unicode password lengths... */
srvstr_pull(inbuf, pass, smb_buf(inbuf) + 1,
sizeof(pass), passlen1, STR_TERMINATE);
+#endif
+
+ if (unic && (passlen2 == 0) && passlen1) {
+ /* Only a ascii plaintext password was sent. */
+ srvstr_pull(inbuf, pass, smb_buf(inbuf), sizeof(pass),
+ passlen1, STR_TERMINATE|STR_ASCII);
} else {
srvstr_pull(inbuf, pass, smb_buf(inbuf),
sizeof(pass), unic ? passlen2 : passlen1,