1
0
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:
Jeremy Allison 2007-04-09 21:01:46 +00:00 committed by Gerald (Jerry) Carter
parent 9de16f25c1
commit 38404c990d
2 changed files with 5 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;