summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_read.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-05-05 09:47:49 -0700
committerJeremy Allison <jra@samba.org>2010-05-05 09:47:49 -0700
commit19758b354d835546fd9ba9cb8b9299dcea91b723 (patch)
tree42ae460e444bb612edb54d6f82f03b0d52e8051a /source3/smbd/smb2_read.c
parent4a97912baffd4c224677dd15da11c85c92901e4a (diff)
downloadsamba-19758b354d835546fd9ba9cb8b9299dcea91b723.tar.gz
samba-19758b354d835546fd9ba9cb8b9299dcea91b723.tar.bz2
samba-19758b354d835546fd9ba9cb8b9299dcea91b723.zip
Get in_minimum and EOF errors right.
Jeremy.
Diffstat (limited to 'source3/smbd/smb2_read.c')
-rw-r--r--source3/smbd/smb2_read.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c
index a858758aee..a428c26ea2 100644
--- a/source3/smbd/smb2_read.c
+++ b/source3/smbd/smb2_read.c
@@ -289,13 +289,23 @@ static struct tevent_req *smbd_smb2_read_send(TALLOC_CTX *mem_ctx,
tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
return tevent_req_post(req, ev);
}
- if (nread == 0 && (in_length != 0 || in_minimum != 0)) {
+ if (nread == 0 && in_length != 0) {
DEBUG(5,("smbd_smb2_read: read_file[%s] end of file\n",
fsp_str_dbg(fsp)));
tevent_req_nterror(req, NT_STATUS_END_OF_FILE);
return tevent_req_post(req, ev);
}
+ if (nread < in_minimum) {
+ DEBUG(5,("smbd_smb2_read: read_file[%s] read less %d than "
+ "minimum requested %u. Returning end of file\n",
+ fsp_str_dbg(fsp),
+ (int)nread,
+ (unsigned int)in_minimum));
+ tevent_req_nterror(req, NT_STATUS_END_OF_FILE);
+ return tevent_req_post(req, ev);
+ }
+
state->out_data.length = nread;
state->out_remaining = 0;
tevent_req_done(req);