diff options
author | Andreas Schneider <asn@samba.org> | 2012-06-26 10:38:08 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-07-06 10:00:56 +0200 |
commit | 1c46bffb115506a561d85ee2e2710b01a377d0f5 (patch) | |
tree | 26800f8a60560563d4e04aff8a2c6d927afea80c | |
parent | 8bc4d7a3e61f5af4ed1e731b43a8530b80403d3a (diff) | |
download | samba-1c46bffb115506a561d85ee2e2710b01a377d0f5.tar.gz samba-1c46bffb115506a561d85ee2e2710b01a377d0f5.tar.bz2 samba-1c46bffb115506a561d85ee2e2710b01a377d0f5.zip |
s4-torture: Make sure lsa_OpenPolicy2 fails over TCP/IP.
-rw-r--r-- | source4/torture/rpc/alter_context.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/lsa.c | 22 |
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; } |