From 4ff011d88ef5b79b92d2cea1abe32c93bc03f724 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 21 Jun 2001 05:38:28 +0000 Subject: Added STR_NOALIGN flags to clistr and srvstr fns. Yes, NT actually does send unaligned unicode strings sometimes! Fixed our handling of the workgroup name tacked on the end of the NT1 negprot response (a unaligned unicode) fixed a couple of places where we should be using the message_end fns instead of pre-calculated buffer lengths (This used to be commit 86613493a9b2e56523153486931d0bf8d39beb7a) --- source3/libsmb/climessage.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source3/libsmb/climessage.c') diff --git a/source3/libsmb/climessage.c b/source3/libsmb/climessage.c index 87f8175459..d46986bfd6 100644 --- a/source3/libsmb/climessage.c +++ b/source3/libsmb/climessage.c @@ -71,7 +71,7 @@ BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp) char *p; memset(cli->outbuf,'\0',smb_size); - set_message(cli->outbuf,1,len+3,True); + set_message(cli->outbuf,1,0,True); CVAL(cli->outbuf,smb_com) = SMBsendtxt; SSVAL(cli->outbuf,smb_tid,cli->cnum); cli_setup_packet(cli); @@ -79,9 +79,12 @@ BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp) SSVAL(cli->outbuf,smb_vwv0,grp); p = smb_buf(cli->outbuf); - *p = 1; - SSVAL(p,1,len); - memcpy(p+3,msg,len); + *p++ = 1; + SSVAL(p,0,len); p += 2; + memcpy(p,msg,len); + p += len; + + cli_setup_bcc(cli, p); cli_send_smb(cli); if (!cli_receive_smb(cli)) { -- cgit