#define TEST_GROUPNAME "libnetgrouptest"
-static bool test_lsa_close(struct torture_context *tctx,
- struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
- struct policy_handle *domain_handle)
-{
- struct lsa_Close r;
-
- r.in.handle = domain_handle;
- r.out.handle = domain_handle;
-
- torture_assert_ntstatus_ok(tctx,
- dcerpc_lsa_Close_r(b, mem_ctx, &r),
- "Close lsa domain failed");
- torture_assert_ntstatus_ok(tctx, r.out.result,
- "Close lsa domain failed");
-
- return true;
-}
-
-
bool torture_groupinfo_api(struct torture_context *torture)
{
const char *name = TEST_GROUPNAME;
ret = false;
}
- if (!test_lsa_close(torture, ctx->lsa.pipe->binding_handle, mem_ctx, &ctx->lsa.handle)) {
+ if (!test_lsa_close_handle(torture,
+ ctx->lsa.pipe->binding_handle, mem_ctx, &ctx->lsa.handle)) {
torture_comment(torture, "lsa domain close failed\n");
ret = false;
}
-static bool test_lsa_close(struct torture_context *tctx,
- struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
- struct policy_handle *domain_handle)
-{
- struct lsa_Close r;
-
- r.in.handle = domain_handle;
- r.out.handle = domain_handle;
-
- torture_assert_ntstatus_ok(tctx,
- dcerpc_lsa_Close_r(b, mem_ctx, &r),
- "Close lsa domain failed");
- torture_assert_ntstatus_ok(tctx, r.out.result,
- "Close lsa domain failed");
-
- return true;
-}
-
-
bool torture_createuser(struct torture_context *torture)
{
NTSTATUS status;
goto done;
}
- if (!test_lsa_close(torture, ctx->lsa.pipe->binding_handle, mem_ctx, &ctx->lsa.handle)) {
+ if (!test_lsa_close_handle(torture,
+ ctx->lsa.pipe->binding_handle, mem_ctx, &ctx->lsa.handle)) {
torture_comment(torture, "lsa domain close failed\n");
ret = false;
}
return true;
}
+/**
+ * Closes LSA handle obtained from Connect, Open Group, etc
+ */
+bool test_lsa_close_handle(struct torture_context *tctx,
+ struct dcerpc_binding_handle *b,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *lsa_handle)
+{
+ struct lsa_Close r;
+
+ r.in.handle = lsa_handle;
+ r.out.handle = lsa_handle;
+
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_lsa_Close_r(b, mem_ctx, &r),
+ "Close LSA handle RPC call failed");
+ torture_assert_ntstatus_ok(tctx, r.out.result,
+ "Close LSA handle failed");
+
+ return true;
+}
+
/**
* Create and initialize libnet_context Context.
* Use this function in cases where we need to have SAMR and LSA pipes