summaryrefslogtreecommitdiff
path: root/source4/torture/smb2/read.c
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2011-09-21 21:50:29 +0200
committerDavid Disseldorp <ddiss@samba.org>2011-09-29 13:14:21 +0200
commitbd5e9758f8350b5137dccf0d5ebf24aefb970997 (patch)
tree458a2c859fc211961da4ef099a2a834e94435305 /source4/torture/smb2/read.c
parent27195b3ac5970037445e8d05efb77b39cbfdd9ba (diff)
downloadsamba-bd5e9758f8350b5137dccf0d5ebf24aefb970997.tar.gz
samba-bd5e9758f8350b5137dccf0d5ebf24aefb970997.tar.bz2
samba-bd5e9758f8350b5137dccf0d5ebf24aefb970997.zip
s4-torture: remove unchecked read from smb2 create
Add a corresponding test case to smb2.read. Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/torture/smb2/read.c')
-rw-r--r--source4/torture/smb2/read.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/torture/smb2/read.c b/source4/torture/smb2/read.c
index f27ce24413..92b3ce0cf7 100644
--- a/source4/torture/smb2/read.c
+++ b/source4/torture/smb2/read.c
@@ -57,9 +57,18 @@ static bool test_read_eof(struct torture_context *torture, struct smb2_tree *tre
ZERO_STRUCT(buf);
+ smb2_util_unlink(tree, FNAME);
+
status = torture_smb2_testfile(tree, FNAME, &h);
CHECK_STATUS(status, NT_STATUS_OK);
+ ZERO_STRUCT(rd);
+ rd.in.file.handle = h;
+ rd.in.length = 5;
+ rd.in.offset = 0;
+ status = smb2_read(tree, tree, &rd);
+ CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
+
status = smb2_util_write(tree, h, buf, 0, ARRAY_SIZE(buf));
CHECK_STATUS(status, NT_STATUS_OK);