summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-15 01:25:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:37 -0500
commit9e3453459c9166e71f483d67c04be2e49da6c561 (patch)
treecb7bfb829bf29c8502c1f772d29842c66cde847e /source3/libsmb
parent6d3abcf3ab8a4b232593529c2a79c264e3cd8d87 (diff)
downloadsamba-9e3453459c9166e71f483d67c04be2e49da6c561.tar.gz
samba-9e3453459c9166e71f483d67c04be2e49da6c561.tar.bz2
samba-9e3453459c9166e71f483d67c04be2e49da6c561.zip
r4212: Ensure we only look at the bottom bit of large_readx.
Set the 14 word version of write if size > 0xffff as well as 64-bit offset. Jeremy. (This used to be commit 94779ccb39560bf5eecab77d70f1fa04bfcf1456)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clireadwrite.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 1785905ff2..9e52ed3594 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -259,7 +259,7 @@ static BOOL cli_issue_write(struct cli_state *cli, int fnum, off_t offset,
size_t size, int i)
{
char *p;
- BOOL bigoffset = False;
+ BOOL large_writex = False;
if (size > cli->bufsize) {
cli->outbuf = SMB_REALLOC(cli->outbuf, size + 1024);
@@ -272,10 +272,11 @@ static BOOL cli_issue_write(struct cli_state *cli, int fnum, off_t offset,
memset(cli->outbuf,'\0',smb_size);
memset(cli->inbuf,'\0',smb_size);
- if ((SMB_BIG_UINT)offset >> 32)
- bigoffset = True;
+ if (((SMB_BIG_UINT)offset >> 32) || (size > 0xFFFF)) {
+ large_writex = True;
+ }
- if (bigoffset)
+ if (large_writex)
set_message(cli->outbuf,14,0,True);
else
set_message(cli->outbuf,12,0,True);
@@ -303,7 +304,7 @@ static BOOL cli_issue_write(struct cli_state *cli, int fnum, off_t offset,
SSVAL(cli->outbuf,smb_vwv11,
smb_buf(cli->outbuf) - smb_base(cli->outbuf));
- if (bigoffset)
+ if (large_writex)
SIVAL(cli->outbuf,smb_vwv12,(offset>>32) & 0xffffffff);
p = smb_base(cli->outbuf) + SVAL(cli->outbuf,smb_vwv11);