diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-03-11 12:58:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:57:03 -0500 |
commit | 7f0c7702f6b9db216fcd6c29165b2a11ea1f24a9 (patch) | |
tree | 60fcb41a190e912c8357b16a1563b8f3586a45c3 /source4/torture/basic | |
parent | d41b55618fcbdfe55843b1a2a8bf9c2c7196751b (diff) | |
download | samba-7f0c7702f6b9db216fcd6c29165b2a11ea1f24a9.tar.gz samba-7f0c7702f6b9db216fcd6c29165b2a11ea1f24a9.tar.bz2 samba-7f0c7702f6b9db216fcd6c29165b2a11ea1f24a9.zip |
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)
Diffstat (limited to 'source4/torture/basic')
-rw-r--r-- | source4/torture/basic/denytest.c | 30 |
1 files changed, 22 insertions, 8 deletions
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<<nbits2)-1); int b_sa2 = random() & ((1<<nbits1)-1); int b_am2 = random() & ((1<<nbits2)-1); + BOOL read_for_execute; progress_bar(i, torture_numops); @@ -1835,9 +1835,9 @@ static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *c status2 = smb_raw_open(cli2->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); |