summaryrefslogtreecommitdiff
path: root/source3/smbd/sesssetup.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-05-21 16:13:38 +0000
committerGerald Carter <jerry@samba.org>2003-05-21 16:13:38 +0000
commit49237d9955628764f8763d20194fb619650663a1 (patch)
tree94f47b55b5f81b385fdc7c865dbe5f36b6ef5db4 /source3/smbd/sesssetup.c
parent1a1b742ca2f6f58b807f003c416bda06352d49ab (diff)
downloadsamba-49237d9955628764f8763d20194fb619650663a1.tar.gz
samba-49237d9955628764f8763d20194fb619650663a1.tar.bz2
samba-49237d9955628764f8763d20194fb619650663a1.zip
fix for UNICODE plaintext passwords (bug #59) and fix smbclient to send the unicode plain text password if negoitated
(This used to be commit 207186e1c8ff0aac2a2aba9c4037d0be0c4819c8)
Diffstat (limited to 'source3/smbd/sesssetup.c')
-rw-r--r--source3/smbd/sesssetup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 8840d4e759..44131b1752 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -620,8 +620,11 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,
nt_resp = data_blob(p+passlen1, passlen2);
} else {
pstring pass;
+ BOOL unic;
+ unic=SVAL(inbuf, smb_flg2) & FLAGS2_UNICODE_STRINGS;
srvstr_pull(inbuf, pass, smb_buf(inbuf),
- sizeof(pass), passlen1, STR_TERMINATE);
+ sizeof(pass), unic ? passlen2 : passlen1,
+ STR_TERMINATE);
plaintext_password = data_blob(pass, strlen(pass)+1);
}