summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-12-07 04:02:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:56 -0500
commit6300221b6c9b3127251c5909451de0bc62b4a01d (patch)
tree03431a1e5b5fb874a35696db9c61dcaaada62a33
parentac98f84de7017007eeac571efdb64f7cded2a4db (diff)
downloadsamba-6300221b6c9b3127251c5909451de0bc62b4a01d.tar.gz
samba-6300221b6c9b3127251c5909451de0bc62b4a01d.tar.bz2
samba-6300221b6c9b3127251c5909451de0bc62b4a01d.zip
r20059: james was asking about CAP_LARGE_READX and reads close to the 64k
boundary. This test shows that both for Samba4 and w2k3, reads larger than or equal to 64k don't work (return zero bytes). Not that I claim this is very useful behaviour :-) (This used to be commit a10fa12ff5657a96e41b309558786780f294a75f)
-rw-r--r--source4/torture/raw/read.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index da9580a472..483f1c6677 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -513,6 +513,26 @@ static BOOL test_readx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_VALUE(io.readx.out.nread, io.readx.in.maxcnt);
CHECK_BUFFER(buf, seed, io.readx.out.nread);
+ if (cli->transport->negotiate.capabilities & CAP_LARGE_READX) {
+ printf("Trying large readx\n");
+ io.readx.in.offset = 0;
+ io.readx.in.mincnt = 0;
+ io.readx.in.maxcnt = 0x10000 - 1;
+ status = smb_raw_read(cli->tree, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ CHECK_VALUE(io.readx.out.nread, 0xFFFF);
+
+ io.readx.in.maxcnt = 0x10000;
+ status = smb_raw_read(cli->tree, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ CHECK_VALUE(io.readx.out.nread, 0);
+
+ io.readx.in.maxcnt = 0x10001;
+ status = smb_raw_read(cli->tree, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ CHECK_VALUE(io.readx.out.nread, 0);
+ }
+
printf("Trying locked region\n");
cli->session->pid++;
if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) {