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/clifile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/clifile.c') diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 4002a43c1b..42454b306f 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -243,7 +243,7 @@ int cli_nt_create_full(struct cli_state *cli, char *fname, uint32 DesiredAccess, p = smb_buf(cli->outbuf); /* this alignment and termination is critical for netapp filers. Don't change */ - p += clistr_align(cli->outbuf, p); + p += clistr_align(cli, p, STR_CONVERT); len = clistr_push(cli, p, fname, -1, STR_CONVERT); p += len; SSVAL(cli->outbuf,smb_ntcreate_NameLength, len); @@ -786,7 +786,7 @@ int cli_ctemp(struct cli_state *cli, char *path, char **tmp_path) memset(cli->outbuf,'\0',smb_size); memset(cli->inbuf,'\0',smb_size); - set_message(cli->outbuf,1,strlen(path)+2,True); + set_message(cli->outbuf,1,0,True); CVAL(cli->outbuf,smb_com) = SMBctemp; SSVAL(cli->outbuf,smb_tid,cli->cnum); @@ -798,6 +798,8 @@ int cli_ctemp(struct cli_state *cli, char *path, char **tmp_path) *p++ = 4; p += clistr_push(cli, p, path, -1, STR_TERMINATE | STR_CONVERT); + cli_setup_bcc(cli, p); + cli_send_smb(cli); if (!cli_receive_smb(cli)) { return -1; -- cgit