From 3a899e24d513de7c56363e39efb74b2c88c29854 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Fri, 28 May 2010 04:45:40 +0300 Subject: [PATCH] s4/test: make samr_close handle functio public It is to be used further for closing opened handles when testing using SAMR interface --- source4/torture/libnet/utils.c | 22 ++++++++++++++++++++++ source4/torture/libnet/utils.h | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/source4/torture/libnet/utils.c b/source4/torture/libnet/utils.c index 564c601455e..cbd6d045f4d 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 7a16d8f174c..04ea3e2febb 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); -- 2.34.1