summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-30 06:12:13 +0000
committerJeremy Allison <jra@samba.org>2002-12-30 06:12:13 +0000
commit266c1ece1242e9e7b32eede8d5e1d1c81a6eb619 (patch)
treecb63e9362819b9cdce9d37992c605116206cd906 /source3/libsmb
parentaf9599e3c4fa203421a34bef91ca4c8c2193077e (diff)
downloadsamba-266c1ece1242e9e7b32eede8d5e1d1c81a6eb619.tar.gz
samba-266c1ece1242e9e7b32eede8d5e1d1c81a6eb619.tar.bz2
samba-266c1ece1242e9e7b32eede8d5e1d1c81a6eb619.zip
Merge Richard's write > 4Gb fix.
Jeremy. (This used to be commit 5431bae8944496f44d8cc6d2c4de86e9feb60f32)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clireadwrite.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 7780c93cc4..187a40cade 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -252,6 +252,7 @@ static BOOL cli_issue_write(struct cli_state *cli, int fnum, off_t offset, uint1
size_t size, int i)
{
char *p;
+ BOOL bigoffset = False;
if (size > cli->bufsize) {
cli->outbuf = realloc(cli->outbuf, size + 1024);
@@ -264,7 +265,10 @@ static BOOL cli_issue_write(struct cli_state *cli, int fnum, off_t offset, uint1
memset(cli->outbuf,'\0',smb_size);
memset(cli->inbuf,'\0',smb_size);
- if (size > 0xFFFF)
+ if ((SMB_BIG_UINT)offset >> 32)
+ bigoffset = True;
+
+ if (bigoffset)
set_message(cli->outbuf,14,0,True);
else
set_message(cli->outbuf,12,0,True);
@@ -277,14 +281,20 @@ static BOOL cli_issue_write(struct cli_state *cli, int fnum, off_t offset, uint1
SSVAL(cli->outbuf,smb_vwv2,fnum);
SIVAL(cli->outbuf,smb_vwv3,offset);
- SIVAL(cli->outbuf,smb_vwv5,(mode & 0x0008) ? 0xFFFFFFFF : 0);
+ SIVAL(cli->outbuf,smb_vwv5,0);
SSVAL(cli->outbuf,smb_vwv7,mode);
+ /*
+ * THe following is still wrong ...
+ */
SSVAL(cli->outbuf,smb_vwv8,(mode & 0x0008) ? size : 0);
SSVAL(cli->outbuf,smb_vwv9,((size>>16)&1));
SSVAL(cli->outbuf,smb_vwv10,size);
SSVAL(cli->outbuf,smb_vwv11,
smb_buf(cli->outbuf) - smb_base(cli->outbuf));
+
+ if (bigoffset)
+ SIVAL(cli->outbuf,smb_vwv12,(offset>>32) & 0xffffffff);
p = smb_base(cli->outbuf) + SVAL(cli->outbuf,smb_vwv11);
memcpy(p, buf, size);