The Samba-Bugzilla – Attachment 4097 Details for
Bug 6302
read request from file of 0 bytes not passed to file system drive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 3.2 and 3.3
look1 (text/plain), 1.81 KB, created by
Jeremy Allison
on 2009-05-01 18:05:45 UTC
(
hide
)
Description:
Patch for 3.2 and 3.3
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2009-05-01 18:05:45 UTC
Size:
1.81 KB
patch
obsolete
>diff --git a/source/smbd/reply.c b/source/smbd/reply.c >index 46653cd..5cd8633 100644 >--- a/source/smbd/reply.c >+++ b/source/smbd/reply.c >@@ -3210,14 +3210,20 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, > return; > } > >- if (startpos > sbuf.st_size) { >- smb_maxcnt = 0; >- } else if (smb_maxcnt > (sbuf.st_size - startpos)) { >- smb_maxcnt = (sbuf.st_size - startpos); >- } >+ if (S_ISREG(sbuf.st_mode)) { >+ /* Only change the client values for a normal file. */ >+ if (startpos > sbuf.st_size) { >+ smb_maxcnt = 0; >+ } else if (smb_maxcnt > (sbuf.st_size - startpos)) { >+ smb_maxcnt = (sbuf.st_size - startpos); >+ } > >- if (smb_maxcnt == 0) { >- goto normal_read; >+ if (smb_maxcnt == 0) { >+ goto normal_read; >+ } >+ } else { >+ /* Pipe or device read. */ >+ goto normal_nosendfile_read; > } > > #if defined(WITH_SENDFILE) >@@ -3311,25 +3317,27 @@ normal_read: > } > TALLOC_FREE(req->outbuf); > return; >- } else { >- reply_outbuf(req, 12, smb_maxcnt); >- >- nread = read_file(fsp, smb_buf(req->outbuf), startpos, >- smb_maxcnt); >- if (nread < 0) { >- reply_unixerror(req, ERRDOS, ERRnoaccess); >- return; >- } >- >- setup_readX_header((char *)req->outbuf, nread); >+ } > >- DEBUG( 3, ( "send_file_readX fnum=%d max=%d nread=%d\n", >- fsp->fnum, (int)smb_maxcnt, (int)nread ) ); >+normal_nosendfile_read: > >- chain_reply(req); >+ reply_outbuf(req, 12, smb_maxcnt); > >+ nread = read_file(fsp, smb_buf(req->outbuf), startpos, >+ smb_maxcnt); >+ if (nread < 0) { >+ reply_unixerror(req, ERRDOS, ERRnoaccess); > return; > } >+ >+ setup_readX_header((char *)req->outbuf, nread); >+ >+ DEBUG( 3, ( "send_file_readX fnum=%d max=%d nread=%d\n", >+ fsp->fnum, (int)smb_maxcnt, (int)nread ) ); >+ >+ chain_reply(req); >+ >+ return; > } > > /****************************************************************************
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6302
: 4097 |
4098
|
4101