From 575e981639a76f32da8f7697b671c772185058b4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Jan 2005 03:48:19 +0000 Subject: r4625: added a test that demonstrates that once a context_id is established, it can't be changed (so you have to create a new context_id, not change the interface bound to an existing one) (This used to be commit 5f10a8f8d04d627927d9870c87d6e7d8b98d563c) --- source4/torture/rpc/alter_context.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/source4/torture/rpc/alter_context.c b/source4/torture/rpc/alter_context.c index 2c6f209404..600b51d15b 100644 --- a/source4/torture/rpc/alter_context.c +++ b/source4/torture/rpc/alter_context.c @@ -32,6 +32,8 @@ BOOL torture_rpc_alter_context(void) TALLOC_CTX *mem_ctx; BOOL ret = True; struct policy_handle handle; + struct dcerpc_syntax_id syntax; + struct dcerpc_syntax_id transfer_syntax; mem_ctx = talloc_init("torture_rpc_alter_context"); @@ -69,6 +71,32 @@ BOOL torture_rpc_alter_context(void) ret = False; } + syntax = p->syntax; + transfer_syntax = p->transfer_syntax; + + printf("Testing change of primary context\n"); + status = dcerpc_alter_context(p, mem_ctx, &p2->syntax, &p2->transfer_syntax); + if (!NT_STATUS_IS_OK(status)) { + printf("dcerpc_alter_context failed - %s\n", nt_errstr(status)); + return False; + } + + printf("testing DSSETUP pipe operations - should fault\n"); + if (test_DsRoleGetPrimaryDomainInformation(p, mem_ctx)) { + ret = False; + } + + if (!test_lsa_OpenPolicy2(p, mem_ctx, &handle)) { + ret = False; + } + + if (!test_lsa_Close(p, mem_ctx, &handle)) { + ret = False; + } + + printf("testing DSSETUP pipe operations\n"); + ret &= test_DsRoleGetPrimaryDomainInformation(p2, mem_ctx); + talloc_destroy(mem_ctx); torture_rpc_close(p); -- cgit