diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/libnet/utils.c | 22 | ||||
-rw-r--r-- | source4/torture/libnet/utils.h | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/source4/torture/libnet/utils.c b/source4/torture/libnet/utils.c index 564c601455..cbd6d045f4 100644 --- a/source4/torture/libnet/utils.c +++ b/source4/torture/libnet/utils.c @@ -295,6 +295,28 @@ bool test_group_create(struct torture_context *tctx, return true; } +/** + * Closes SAMR handle obtained from Connect, Open User/Domain, etc + */ +bool test_samr_close_handle(struct torture_context *tctx, + struct dcerpc_binding_handle *b, + TALLOC_CTX *mem_ctx, + struct policy_handle *samr_handle) +{ + struct samr_Close r; + + r.in.handle = samr_handle; + r.out.handle = samr_handle; + + torture_assert_ntstatus_ok(tctx, + dcerpc_samr_Close_r(b, mem_ctx, &r), + "Close SAMR handle RPC call failed"); + torture_assert_ntstatus_ok(tctx, r.out.result, + "Close SAMR handle failed"); + + return true; +} + void msg_handler(struct monitor_msg *m) { diff --git a/source4/torture/libnet/utils.h b/source4/torture/libnet/utils.h index 7a16d8f174..04ea3e2feb 100644 --- a/source4/torture/libnet/utils.h +++ b/source4/torture/libnet/utils.h @@ -49,4 +49,8 @@ bool test_group_cleanup(struct torture_context *tctx, struct policy_handle *domain_handle, const char *name); +bool test_samr_close_handle(struct torture_context *tctx, + struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx, + struct policy_handle *samr_handle); + void msg_handler(struct monitor_msg *m); |