diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-07-30 15:03:14 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-07-30 15:03:14 +0000 |
commit | 9edc1cd4cfd3c02cfb1b867f8450384c446e8b60 (patch) | |
tree | 4b041804db2b9e9da316f1137e5c6260ba5458a3 /source3/smbd/sesssetup.c | |
parent | 28f4463c8b6608dce02311ea7271fc983aa76d56 (diff) | |
download | samba-9edc1cd4cfd3c02cfb1b867f8450384c446e8b60.tar.gz samba-9edc1cd4cfd3c02cfb1b867f8450384c446e8b60.tar.bz2 samba-9edc1cd4cfd3c02cfb1b867f8450384c446e8b60.zip |
this fixes plaintext passwords with win2000
there were 2 bugs:
1) we were sending a null challenge when we should have sent an empty
challenge
2) the password can be in unicode if unicode is negotiated. This means
our client code was wrong too :(
(This used to be commit 1a6dfddf6788b30fc81794b1bfe749693183b2c1)
Diffstat (limited to 'source3/smbd/sesssetup.c')
-rw-r--r-- | source3/smbd/sesssetup.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 867b00ff5c..9d05e3f98a 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -699,9 +699,10 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf, lm_resp = data_blob(p, passlen1); nt_resp = data_blob(p+passlen1, passlen2); } else { - plaintext_password = data_blob(p, passlen1+1); - /* Ensure null termination */ - plaintext_password.data[passlen1] = 0; + pstring pass; + srvstr_pull_buf(inbuf, pass, smb_buf(inbuf), + sizeof(pass), STR_TERMINATE); + plaintext_password = data_blob(pass, strlen(pass)); } p += passlen1 + passlen2; |