From: Andrew Tridgell Date: Mon, 26 May 2008 05:00:56 +0000 (+1000) Subject: check use of mincnt past EOF in SMB X-Git-Url: http://git.samba.org/samba.git/?p=kai%2Fsamba.git;a=commitdiff_plain;h=cf4899cf4cb3432384034211eaa57e8059c24afb check use of mincnt past EOF in SMB (This used to be commit 763c9d344fa55da7a24c250d29542837c3ae3971) --- diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c index c8420c279eb..ada9b1f4321 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);