summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-05-26 15:00:56 +1000
committerAndrew Tridgell <tridge@samba.org>2008-05-26 15:00:56 +1000
commitcf4899cf4cb3432384034211eaa57e8059c24afb (patch)
tree02122ee09fc288fcae1f8fbbff8f52232e5c812a /source4/torture/raw
parentbf8d9e180e1e908e891e3755bbb70eab550f0638 (diff)
downloadsamba-cf4899cf4cb3432384034211eaa57e8059c24afb.tar.gz
samba-cf4899cf4cb3432384034211eaa57e8059c24afb.tar.bz2
samba-cf4899cf4cb3432384034211eaa57e8059c24afb.zip
check use of mincnt past EOF in SMB
(This used to be commit 763c9d344fa55da7a24c250d29542837c3ae3971)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/read.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index c8420c279e..ada9b1f432 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -460,6 +460,23 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
CHECK_VALUE(io.readx.out.compaction_mode, 0);
}
+ printf("Trying mincnt past EOF\n");
+ memset(buf, 0, maxsize);
+ io.readx.in.offset = 0;
+ io.readx.in.mincnt = 100;
+ io.readx.in.maxcnt = 110;
+ status = smb_raw_read(cli->tree, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ CHECK_VALUE(io.readx.out.remaining, 0xFFFF);
+ CHECK_VALUE(io.readx.out.compaction_mode, 0);
+ CHECK_VALUE(io.readx.out.nread, strlen(test_data));
+ if (memcmp(buf, test_data, strlen(test_data)) != 0) {
+ ret = false;
+ printf("incorrect data at %d!? (%s:%s)\n", __LINE__, test_data, buf);
+ goto done;
+ }
+
+
setup_buffer(buf, seed, maxsize);
smbcli_write(cli->tree, fnum, 0, buf, 0, maxsize);
memset(buf, 0, maxsize);