mirror of
https://github.com/samba-team/samba.git
synced 2025-02-09 09:57:48 +03:00
r22145: Fix bug #4494 - reported by Kevin Jamieson <bugzilla@kevinjamieson.com>.
If returning a mapped UNIX error from sendfile, don't call chain_reply. Jeremy.
This commit is contained in:
parent
9de16f25c1
commit
38404c990d
@ -1161,8 +1161,8 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
|
||||
char outbuf_saved[smb_wct];
|
||||
int outsize = smb_len(outbuf) + 4;
|
||||
|
||||
/* maybe its not chained */
|
||||
if (smb_com2 == 0xFF) {
|
||||
/* Maybe its not chained, or it's an error packet. */
|
||||
if (smb_com2 == 0xFF || SVAL(outbuf,smb_rcls) != 0) {
|
||||
SCVAL(outbuf,smb_vwv0,0xFF);
|
||||
return outsize;
|
||||
}
|
||||
|
@ -2706,8 +2706,10 @@ int reply_read_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
|
||||
}
|
||||
|
||||
nread = send_file_readX(conn, inbuf, outbuf, length, bufsize, fsp, startpos, smb_maxcnt);
|
||||
if (nread != -1)
|
||||
/* Only call chain_reply if not an error. */
|
||||
if (nread != -1 && SVAL(outbuf,smb_rcls) == 0) {
|
||||
nread = chain_reply(inbuf,outbuf,length,bufsize);
|
||||
}
|
||||
|
||||
END_PROFILE(SMBreadX);
|
||||
return nread;
|
||||
|
Loading…
x
Reference in New Issue
Block a user