From b24fcfc1aadf56130f9f2f2371282c0c399611c2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 31 Oct 2004 03:26:30 +0000 Subject: r3400: - allow callers to control the flags2 field in raw packets - added testing of the FLAGS2_READ_PERMIT_EXECUTE bit in the ntdeny tests (This used to be commit adf4a682705871186f3b77ea6d417942445fc5d3) --- source4/torture/basic/denytest.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source4/torture/basic/denytest.c') diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 8dc6118b7d..5dfd610bff 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -1689,7 +1689,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, - enum deny_result *res) + uint16_t flags2, enum deny_result *res) { #define CHECK_MASK(am, sa, right, share) do { \ if (((am) & (right)) && !((sa) & (share))) { \ @@ -1703,6 +1703,9 @@ static NTSTATUS predict_share_conflict(uint32_t sa1, uint32_t am1, uint32_t sa2, } if (am2 & SA_RIGHT_FILE_READ_DATA) { *res += A_R; + } else if ((am2 & SA_RIGHT_FILE_EXECUTE) && + (flags2 & FLAGS2_READ_PERMIT_EXECUTE)) { + *res += A_R; } /* if either open involves no read.write or delete access then @@ -1820,6 +1823,12 @@ static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *c status1 = smb_raw_open(cli1->tree, mem_ctx, &io1); status2 = smb_raw_open(cli2->tree, mem_ctx, &io2); + + if (random() % 2 == 0) { + cli2->tree->session->flags2 |= FLAGS2_READ_PERMIT_EXECUTE; + } else { + cli2->tree->session->flags2 &= ~FLAGS2_READ_PERMIT_EXECUTE; + } if (!NT_STATUS_IS_OK(status1)) { res = A_X; @@ -1847,7 +1856,9 @@ static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *c status2_p = predict_share_conflict(io1.ntcreatex.in.share_access, io1.ntcreatex.in.access_mask, io2.ntcreatex.in.share_access, - io2.ntcreatex.in.access_mask, &res2); + io2.ntcreatex.in.access_mask, + cli2->tree->session->flags2, + &res2); GetTimeOfDay(&tv); tdif = usec_time_diff(&tv, &tv_start); -- cgit