From 7f0c7702f6b9db216fcd6c29165b2a11ea1f24a9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 11 Mar 2006 12:58:36 +0000 Subject: r14208: removed use of req->flags2 inside the ntvfs layer. This should help metze on his quest to unify the ntvfs strucures for the smb and smb2 servers. The only place we needed flags2 inside ntvfs was for the FLAGS2_READ_PERMIT_EXECUTE bit, which only affects readx, so I added a readx.in.read_for_execute flag instead. (This used to be commit b78abbbce60ab0009da19a72dd769800c44298a2) --- source4/torture/basic/denytest.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'source4/torture/basic/denytest.c') diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 646714a4e9..5715238fca 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -1693,7 +1693,7 @@ static const char *bit_string(TALLOC_CTX *mem_ctx, const struct bit_value *bv, i determine if two opens conflict */ static NTSTATUS predict_share_conflict(uint32_t sa1, uint32_t am1, uint32_t sa2, uint32_t am2, - uint16_t flags2, enum deny_result *res) + BOOL read_for_execute, enum deny_result *res) { #define CHECK_MASK(am, sa, right, share) do { \ if (((am) & (right)) && !((sa) & (share))) { \ @@ -1707,8 +1707,7 @@ static NTSTATUS predict_share_conflict(uint32_t sa1, uint32_t am1, uint32_t sa2, } if (am2 & SEC_FILE_READ_DATA) { *res += A_R; - } else if ((am2 & SEC_FILE_EXECUTE) && - (flags2 & FLAGS2_READ_PERMIT_EXECUTE)) { + } else if ((am2 & SEC_FILE_EXECUTE) && read_for_execute) { *res += A_R; } @@ -1822,6 +1821,7 @@ static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *c int b_am1 = random() & ((1<tree, mem_ctx, &io2); if (random() % 2 == 0) { - cli2->tree->session->flags2 |= FLAGS2_READ_PERMIT_EXECUTE; + read_for_execute = True; } else { - cli2->tree->session->flags2 &= ~FLAGS2_READ_PERMIT_EXECUTE; + read_for_execute = False; } if (!NT_STATUS_IS_OK(status1)) { @@ -1845,9 +1845,23 @@ static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *c } else if (!NT_STATUS_IS_OK(status2)) { res = A_0; } else { + union smb_read r; + NTSTATUS status; + + /* we can't use smbcli_read() as we need to + set read_for_execute */ + r.readx.level = RAW_READ_READX; + r.readx.file.fnum = io2.ntcreatex.file.fnum; + r.readx.in.offset = 0; + r.readx.in.mincnt = sizeof(buf); + r.readx.in.maxcnt = sizeof(buf); + r.readx.in.remaining = 0; + r.readx.in.read_for_execute = read_for_execute; + r.readx.out.data = buf; + res = A_0; - if (smbcli_read(cli2->tree, - io2.ntcreatex.file.fnum, buf, 0, sizeof(buf)) >= 1) { + status = smb_raw_read(cli2->tree, &r); + if (NT_STATUS_IS_OK(status)) { res += A_R; } if (smbcli_write(cli2->tree, @@ -1867,7 +1881,7 @@ static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *c io1.ntcreatex.in.access_mask, io2.ntcreatex.in.share_access, io2.ntcreatex.in.access_mask, - cli2->tree->session->flags2, + read_for_execute, &res2); GetTimeOfDay(&tv); -- cgit