check use of mincnt past EOF in SMB
authorAndrew Tridgell <tridge@samba.org>
Mon, 26 May 2008 05:00:56 +0000 (15:00 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 26 May 2008 05:00:56 +0000 (15:00 +1000)
(This used to be commit 763c9d344fa55da7a24c250d29542837c3ae3971)

source4/torture/raw/read.c

index c8420c279eb43b5f19ac5150ddae96589d90baab..ada9b1f4321ebd09d88ea4f6e959dca2bded4045 100644 (file)
@@ -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);