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");
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;
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));
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,
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;
}