[Samba] Re: smbclient and large file support

Richard Sharpe rsharpe at richardsharpe.com
Mon Dec 30 03:02:50 GMT 2002

On Sun, 29 Dec 2002, Adnan Olia wrote:

> Hi Herb,
> I made the changes with this patch on Samba 2.2.7a and then re-compiled it
> with
> ./configure --with-libsmbclient
> After the new samba install, I tried to "get" a file from Win2000 Advanced
> Server to Mandrake Linux 8.2 server using SMBCLIENT and was successfully
> able to transfer a 6.63GB file.  Then I tried to "put" a file from Mandrake
> Linux 8.2 server to the Win2000 Advanced Server and the file completed at
> 4GB rather than 6.63 GB.  Is this normal?

OK, I have finally found the problem :-)

cli_issue_write, in libsmb/clireadwrite.c has a bug.

It does not properly code the WriteX SMB. If the offset is larger than 
32-bit, it should code the WordCount as 14 and should include the upper 32 
bits of the offset later in the parameters portion of the SMB.

Since this is not done, all offsets are 32-bits and anything beyond 4GB is 
written to the segment just before or beyond 4GB :-)

The fix will take a small while to code.

Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com

More information about the samba mailing list