mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
s4-torture: Make sure lsa_OpenPolicy2 fails over TCP/IP.
This commit is contained in:
parent
8bc4d7a3e6
commit
1c46bffb11
@ -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");
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user