summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/torture/rpc/alter_context.c2
-rw-r--r--source4/torture/rpc/lsa.c22
2 files changed, 16 insertions, 8 deletions
diff --git a/source4/torture/rpc/alter_context.c b/source4/torture/rpc/alter_context.c
index cbfe034d06..4160ddd8b3 100644
--- a/source4/torture/rpc/alter_context.c
+++ b/source4/torture/rpc/alter_context.c
@@ -90,7 +90,7 @@ bool torture_rpc_alter_context(struct torture_context *torture)
if (NT_STATUS_EQUAL(status, NT_STATUS_RPC_PROTOCOL_ERROR)) {
ret &= test_lsa_OpenPolicy2_ex(p->binding_handle, torture, &handle,
- NT_STATUS_PIPE_DISCONNECTED);
+ NT_STATUS_PIPE_DISCONNECTED, false);
return ret;
}
torture_assert_ntstatus_ok(torture, status, "dcerpc_alter_context failed");
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index d2f1bcef23..7599fa9a94 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -91,7 +91,8 @@ static bool test_OpenPolicy(struct dcerpc_binding_handle *b,
bool test_lsa_OpenPolicy2_ex(struct dcerpc_binding_handle *b,
struct torture_context *tctx,
struct policy_handle **handle,
- NTSTATUS expected_status)
+ NTSTATUS expected_status,
+ bool test_fail)
{
struct lsa_ObjectAttribute attr;
struct lsa_QosInfo qos;
@@ -131,11 +132,13 @@ bool test_lsa_OpenPolicy2_ex(struct dcerpc_binding_handle *b,
if (!NT_STATUS_IS_OK(r.out.result)) {
if (NT_STATUS_EQUAL(r.out.result, NT_STATUS_ACCESS_DENIED) ||
NT_STATUS_EQUAL(r.out.result, NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED)) {
- torture_comment(tctx, "not considering %s to be an error\n",
- nt_errstr(r.out.result));
- talloc_free(*handle);
- *handle = NULL;
- return true;
+ if (test_fail) {
+ torture_comment(tctx, "not considering %s to be an error\n",
+ nt_errstr(r.out.result));
+ talloc_free(*handle);
+ *handle = NULL;
+ return true;
+ }
}
torture_comment(tctx, "OpenPolicy2 failed - %s\n",
nt_errstr(r.out.result));
@@ -150,7 +153,7 @@ bool test_lsa_OpenPolicy2(struct dcerpc_binding_handle *b,
struct torture_context *tctx,
struct policy_handle **handle)
{
- return test_lsa_OpenPolicy2_ex(b, tctx, handle, NT_STATUS_OK);
+ return test_lsa_OpenPolicy2_ex(b, tctx, handle, NT_STATUS_OK, false);
}
static bool test_LookupNames(struct dcerpc_binding_handle *b,
@@ -3083,6 +3086,11 @@ bool torture_rpc_lsa(struct torture_context *tctx)
ret = false;
}
+ if (!test_lsa_OpenPolicy2_ex(b, tctx, &handle,
+ NT_STATUS_OK, true)) {
+ ret = false;
+ }
+
if (!test_many_LookupSids(p, tctx, handle)) {
ret = false;
}