bool ret = true;
NTSTATUS status;
TALLOC_CTX *mem_ctx = NULL, *prep_mem_ctx;
- struct libnet_context *ctx;
+ struct libnet_context *ctx = NULL;
struct dcerpc_pipe *p;
struct policy_handle h;
struct lsa_String domain_name;
prep_mem_ctx = talloc_init("prepare torture group info");
- ctx = libnet_context_init(torture->ev, torture->lp_ctx);
- ctx->cred = cmdline_credentials;
-
status = torture_rpc_connection(torture,
&p,
&ndr_table_samr);
mem_ctx = talloc_init("torture group info");
+ if (!test_libnet_context_init(torture, true, &ctx)) {
+ return false;
+ }
+
ZERO_STRUCT(req);
req.in.domain_name = domain_name.string;
ret = false;
}
- talloc_free(ctx);
-
done:
+ talloc_free(ctx);
talloc_free(mem_ctx);
return ret;
}
{
NTSTATUS status;
TALLOC_CTX *mem_ctx;
- struct libnet_context *ctx;
+ struct libnet_context *ctx = NULL;
struct libnet_CreateUser req;
bool ret = true;
mem_ctx = talloc_init("test_createuser");
- ctx = libnet_context_init(torture->ev, torture->lp_ctx);
- ctx->cred = cmdline_credentials;
+ if (!test_libnet_context_init(torture, true, &ctx)) {
+ return false;
+ }
req.in.user_name = TEST_USERNAME;
req.in.domain_name = lp_workgroup(torture->lp_ctx);
struct policy_handle h;
struct lsa_String domain_name;
const char *name = TEST_USERNAME;
- struct libnet_context *ctx;
+ struct libnet_context *ctx = NULL;
struct libnet_DeleteUser req;
bool ret = true;
prep_mem_ctx = talloc_init("prepare test_deleteuser");
- ctx = libnet_context_init(torture->ev, torture->lp_ctx);
- ctx->cred = cmdline_credentials;
-
req.in.user_name = TEST_USERNAME;
req.in.domain_name = lp_workgroup(torture->lp_ctx);
mem_ctx = talloc_init("test_deleteuser");
+ if (!test_libnet_context_init(torture, true, &ctx)) {
+ return false;
+ }
+
status = libnet_DeleteUser(ctx, mem_ctx, &req);
if (!NT_STATUS_IS_OK(status)) {
torture_comment(torture, "libnet_DeleteUser call failed: %s\n", nt_errstr(status));
struct policy_handle h;
struct lsa_String domain_name;
char *name;
- struct libnet_context *ctx;
+ struct libnet_context *ctx = NULL;
struct libnet_ModifyUser req;
struct libnet_UserInfo user_req;
int fld;
prep_mem_ctx = talloc_init("prepare test_deleteuser");
- ctx = libnet_context_init(torture->ev, torture->lp_ctx);
- ctx->cred = cmdline_credentials;
-
status = torture_rpc_connection(torture,
&p,
&ndr_table_samr);
torture_comment(torture, "Testing change of all fields - each single one in turn\n");
- if (!_libnet_context_init_pipes(torture, ctx)) {
+ if (!test_libnet_context_init(torture, true, &ctx)) {
return false;
}
bool ret = true;
NTSTATUS status;
TALLOC_CTX *mem_ctx = NULL, *prep_mem_ctx;
- struct libnet_context *ctx;
+ struct libnet_context *ctx = NULL;
struct dcerpc_pipe *p;
struct policy_handle h;
struct lsa_String domain_name;
prep_mem_ctx = talloc_init("prepare torture user info");
- ctx = libnet_context_init(torture->ev, torture->lp_ctx);
- ctx->cred = cmdline_credentials;
-
status = torture_rpc_connection(torture,
&p,
&ndr_table_samr);
mem_ctx = talloc_init("torture user info");
+ if (!test_libnet_context_init(torture, true, &ctx)) {
+ return false;
+ }
+
ZERO_STRUCT(req);
req.in.domain_name = domain_name.string;
ret = false;
}
- talloc_free(ctx);
-
done:
+ talloc_free(ctx);
talloc_free(mem_ctx);
return ret;
}