diff options
author | Richard Sharpe <sharpe@samba.org> | 2002-12-30 04:25:30 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@samba.org> | 2002-12-30 04:25:30 +0000 |
commit | b68e6c99103fd0f1e8a25b2fafe14d7540b2ab10 (patch) | |
tree | 0f6476adff0b7cd769e20ba7ed743e1ce211d11a /source3/libsmb/clireadwrite.c | |
parent | 72caa1fc8d7161da65ddad011d7d624fe0d9fe0b (diff) | |
download | samba-b68e6c99103fd0f1e8a25b2fafe14d7540b2ab10.tar.gz samba-b68e6c99103fd0f1e8a25b2fafe14d7540b2ab10.tar.bz2 samba-b68e6c99103fd0f1e8a25b2fafe14d7540b2ab10.zip |
Port the fix to cli_setup_write to handle offsets greater than 32-bits from
Samba 2.2.x ...
(This used to be commit 4201038588bab8674b73371a5eac70a412c5dd6c)
Diffstat (limited to 'source3/libsmb/clireadwrite.c')
-rw-r--r-- | source3/libsmb/clireadwrite.c | 14 |
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); |