From: Jeremy Allison Date: Wed, 9 Feb 2005 23:46:14 +0000 (+0000) Subject: r5290: Fix for bug #2323 - plaintext problem with WinXP. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5278 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3e10c36cb50462d1f220029e8fa64c3b6e554e6c;p=thirdparty%2Fsamba.git r5290: Fix for bug #2323 - plaintext problem with WinXP. Jeremy. --- diff --git a/source/smbd/sesssetup.c b/source/smbd/sesssetup.c index cff7d7371c6..40ea28a86d5 100644 --- a/source/smbd/sesssetup.c +++ b/source/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,