summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-03 00:28:22 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:20 +0100
commitbbdfbf8d9d486aee51117976b8f825759a4c4a37 (patch)
treec0f97e145aae09c3e7e5387471fb3fb0ab839596 /source4/torture/rpc
parent291ddf433685ee5c25e172885045a4b60d7bb1ee (diff)
downloadsamba-bbdfbf8d9d486aee51117976b8f825759a4c4a37.tar.gz
samba-bbdfbf8d9d486aee51117976b8f825759a4c4a37.tar.bz2
samba-bbdfbf8d9d486aee51117976b8f825759a4c4a37.zip
r26238: Add a loadparm context parameter to torture_context, remove more uses of global_loadparm.
(This used to be commit a33a5530545086b81a3b205aa109dff11c546926)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/bench.c8
-rw-r--r--source4/torture/rpc/countcalls.c2
-rw-r--r--source4/torture/rpc/drsuapi.c36
-rw-r--r--source4/torture/rpc/dssync.c2
-rw-r--r--source4/torture/rpc/frsapi.c2
-rw-r--r--source4/torture/rpc/mgmt.c2
-rw-r--r--source4/torture/rpc/netlogon.c26
-rw-r--r--source4/torture/rpc/samba3rpc.c6
-rw-r--r--source4/torture/rpc/samlogon.c4
-rw-r--r--source4/torture/rpc/samr_accessmask.c10
-rw-r--r--source4/torture/rpc/samsync.c12
-rw-r--r--source4/torture/rpc/scanner.c2
-rw-r--r--source4/torture/rpc/schannel.c8
-rw-r--r--source4/torture/rpc/session_key.c6
-rw-r--r--source4/torture/rpc/spoolss_notify.c4
-rw-r--r--source4/torture/rpc/testjoin.c4
-rw-r--r--source4/torture/rpc/wkssvc.c20
17 files changed, 77 insertions, 77 deletions
diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c
index 2619ac2d25..2ae92332f8 100644
--- a/source4/torture/rpc/bench.c
+++ b/source4/torture/rpc/bench.c
@@ -68,11 +68,11 @@ static bool test_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
/*
benchmark srvsvc netshareenumall queries
*/
-static bool bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+static bool bench_NetShareEnumAll(struct torture_context *tctx, struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
struct timeval tv = timeval_current();
bool ret = true;
- int timelimit = lp_parm_int(global_loadparm, NULL, "torture", "timelimit", 10);
+ int timelimit = torture_setting_int(tctx, "timelimit", 10);
int count=0;
printf("Running for %d seconds\n", timelimit);
@@ -82,7 +82,7 @@ static bool bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
talloc_free(tmp_ctx);
count++;
if (count % 50 == 0) {
- if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) {
+ if (torture_setting_bool(tctx, "progress", true)) {
printf("%.1f queries per second \r",
count / timeval_elapsed(&tv));
}
@@ -112,7 +112,7 @@ bool torture_bench_rpc(struct torture_context *torture)
return false;
}
- if (!bench_NetShareEnumAll(p, mem_ctx)) {
+ if (!bench_NetShareEnumAll(torture, p, mem_ctx)) {
ret = false;
}
diff --git a/source4/torture/rpc/countcalls.c b/source4/torture/rpc/countcalls.c
index f9a31feaaf..ba00b0f467 100644
--- a/source4/torture/rpc/countcalls.c
+++ b/source4/torture/rpc/countcalls.c
@@ -111,7 +111,7 @@ bool torture_rpc_countcalls(struct torture_context *torture)
if (!mem_ctx) {
return false;
}
- iface_name = lp_parm_string(global_loadparm, NULL, "countcalls", "interface");
+ iface_name = lp_parm_string(torture->lp_ctx, NULL, "countcalls", "interface");
if (iface_name != NULL) {
iface = ndr_table_by_name(iface_name);
if (!iface) {
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c
index 3407e49565..ee752c6568 100644
--- a/source4/torture/rpc/drsuapi.c
+++ b/source4/torture/rpc/drsuapi.c
@@ -232,7 +232,7 @@ static bool test_DsWriteAccountSpn(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
-static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, struct torture_context *tctx,
struct DsPrivate *priv)
{
NTSTATUS status;
@@ -307,7 +307,7 @@ static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
};
- if (lp_parm_bool(global_loadparm, NULL, "torture", "samba4", false)) {
+ if (torture_setting_bool(tctx, "samba4", false)) {
printf("skipping DsReplicaGetInfo test against Samba4\n");
return true;
}
@@ -340,11 +340,11 @@ static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
break;
}
- status = dcerpc_drsuapi_DsReplicaGetInfo(p, mem_ctx, &r);
+ status = dcerpc_drsuapi_DsReplicaGetInfo(p, tctx, &r);
if (!NT_STATUS_IS_OK(status)) {
const char *errstr = nt_errstr(status);
if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
- errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
+ errstr = dcerpc_errstr(tctx, p->last_fault_code);
}
if (p->last_fault_code != DCERPC_FAULT_INVALID_TAG) {
printf("dcerpc_drsuapi_DsReplicaGetInfo failed - %s\n", errstr);
@@ -362,7 +362,7 @@ static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
-static bool test_DsReplicaSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+static bool test_DsReplicaSync(struct dcerpc_pipe *p, struct torture_context *tctx,
struct DsPrivate *priv)
{
NTSTATUS status;
@@ -380,12 +380,12 @@ static bool test_DsReplicaSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
};
- if (!lp_parm_bool(global_loadparm, NULL, "torture", "dangerous", false)) {
+ if (!torture_setting_bool(tctx, "dangerous", false)) {
printf("DsReplicaSync disabled - enable dangerous tests to use\n");
return true;
}
- if (lp_parm_bool(global_loadparm, NULL, "torture", "samba4", false)) {
+ if (torture_setting_bool(tctx, "samba4", false)) {
printf("skipping DsReplicaSync test against Samba4\n");
return true;
}
@@ -413,11 +413,11 @@ static bool test_DsReplicaSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
break;
}
- status = dcerpc_drsuapi_DsReplicaSync(p, mem_ctx, &r);
+ status = dcerpc_drsuapi_DsReplicaSync(p, tctx, &r);
if (!NT_STATUS_IS_OK(status)) {
const char *errstr = nt_errstr(status);
if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
- errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
+ errstr = dcerpc_errstr(tctx, p->last_fault_code);
}
printf("dcerpc_drsuapi_DsReplicaSync failed - %s\n", errstr);
ret = false;
@@ -430,7 +430,7 @@ static bool test_DsReplicaSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
-static bool test_DsReplicaUpdateRefs(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+static bool test_DsReplicaUpdateRefs(struct dcerpc_pipe *p, struct torture_context *tctx,
struct DsPrivate *priv)
{
NTSTATUS status;
@@ -448,7 +448,7 @@ static bool test_DsReplicaUpdateRefs(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
};
- if (lp_parm_bool(global_loadparm, NULL, "torture", "samba4", false)) {
+ if (torture_setting_bool(tctx, "samba4", false)) {
printf("skipping DsReplicaUpdateRefs test against Samba4\n");
return true;
}
@@ -470,18 +470,18 @@ static bool test_DsReplicaUpdateRefs(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
nc.dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
r.in.req.req1.naming_context = &nc;
- r.in.req.req1.dest_dsa_dns_name = talloc_asprintf(mem_ctx, "__some_dest_dsa_guid_string._msdn.%s",
+ r.in.req.req1.dest_dsa_dns_name = talloc_asprintf(tctx, "__some_dest_dsa_guid_string._msdn.%s",
priv->domain_dns_name);
r.in.req.req1.dest_dsa_guid = null_guid;
r.in.req.req1.options = 0;
break;
}
- status = dcerpc_drsuapi_DsReplicaUpdateRefs(p, mem_ctx, &r);
+ status = dcerpc_drsuapi_DsReplicaUpdateRefs(p, tctx, &r);
if (!NT_STATUS_IS_OK(status)) {
const char *errstr = nt_errstr(status);
if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
- errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
+ errstr = dcerpc_errstr(tctx, p->last_fault_code);
}
printf("dcerpc_drsuapi_DsReplicaUpdateRefs failed - %s\n", errstr);
ret = false;
@@ -494,7 +494,7 @@ static bool test_DsReplicaUpdateRefs(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
-static bool test_DsGetNCChanges(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+static bool test_DsGetNCChanges(struct dcerpc_pipe *p, struct torture_context *tctx,
struct DsPrivate *priv)
{
NTSTATUS status;
@@ -515,7 +515,7 @@ static bool test_DsGetNCChanges(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
};
- if (lp_parm_bool(global_loadparm, NULL, "torture", "samba4", false)) {
+ if (torture_setting_bool(tctx, "samba4", false)) {
printf("skipping DsGetNCChanges test against Samba4\n");
return true;
}
@@ -589,11 +589,11 @@ static bool test_DsGetNCChanges(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
break;
}
- status = dcerpc_drsuapi_DsGetNCChanges(p, mem_ctx, &r);
+ status = dcerpc_drsuapi_DsGetNCChanges(p, tctx, &r);
if (!NT_STATUS_IS_OK(status)) {
const char *errstr = nt_errstr(status);
if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
- errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
+ errstr = dcerpc_errstr(tctx, p->last_fault_code);
}
printf("dcerpc_drsuapi_DsGetNCChanges failed - %s\n", errstr);
ret = false;
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index 4403a64a36..7c56a52203 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -420,7 +420,7 @@ static void test_analyse_objects(struct DsSyncTest *ctx,
static uint32_t object_id;
const char *save_values_dir;
- if (!lp_parm_bool(global_loadparm, NULL,"dssync","print_pwd_blobs", false)) {
+ if (!lp_parm_bool(global_loadparm, NULL, "dssync", "print_pwd_blobs", false)) {
return;
}
diff --git a/source4/torture/rpc/frsapi.c b/source4/torture/rpc/frsapi.c
index 72aae3c196..a39c91f853 100644
--- a/source4/torture/rpc/frsapi.c
+++ b/source4/torture/rpc/frsapi.c
@@ -194,7 +194,7 @@ static bool test_ForceReplication(struct torture_context *tctx,
r.in.guid1 = NULL;
r.in.guid2 = NULL;
r.in.replica_set = talloc_asprintf(tctx, "%s",
- lp_realm(global_loadparm));
+ lp_realm(tctx->lp_ctx));
r.in.partner_name = dcerpc_server_name(p);
torture_assert_ntstatus_ok(tctx,
diff --git a/source4/torture/rpc/mgmt.c b/source4/torture/rpc/mgmt.c
index 258450ada1..4ae4ac3b34 100644
--- a/source4/torture/rpc/mgmt.c
+++ b/source4/torture/rpc/mgmt.c
@@ -228,7 +228,7 @@ bool torture_rpc_mgmt(struct torture_context *torture)
continue;
}
- lp_set_cmdline(global_loadparm, "torture:binding", dcerpc_binding_string(loop_ctx, b));
+ lp_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(loop_ctx, b));
status = torture_rpc_connection(torture, &p, &ndr_table_mgmt);
if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 745744a25d..a8f408c0f6 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -452,11 +452,11 @@ bool test_netlogon_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
DATA_BLOB names_blob, chal, lm_resp, nt_resp;
int i;
int flags = CLI_CRED_NTLM_AUTH;
- if (lp_client_lanman_auth(global_loadparm)) {
+ if (lp_client_lanman_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(global_loadparm)) {
+ if (lp_client_ntlmv2_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
@@ -740,7 +740,7 @@ static bool test_GetDcName(struct torture_context *tctx,
struct netr_GetDcName r;
r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.domainname = lp_workgroup(global_loadparm);
+ r.in.domainname = lp_workgroup(tctx->lp_ctx);
status = dcerpc_netr_GetDcName(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "GetDcName");
@@ -787,7 +787,7 @@ static bool test_GetAnyDCName(struct torture_context *tctx,
struct netr_GetAnyDCName r;
r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.domainname = lp_workgroup(global_loadparm);
+ r.in.domainname = lp_workgroup(tctx->lp_ctx);
status = dcerpc_netr_GetAnyDCName(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "GetAnyDCName");
@@ -813,7 +813,7 @@ static bool test_LogonControl2(struct torture_context *tctx,
r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.function_code = NETLOGON_CONTROL_REDISCOVER;
- r.in.data.domain = lp_workgroup(global_loadparm);
+ r.in.data.domain = lp_workgroup(tctx->lp_ctx);
for (i=1;i<4;i++) {
r.in.level = i;
@@ -826,7 +826,7 @@ static bool test_LogonControl2(struct torture_context *tctx,
}
r.in.function_code = NETLOGON_CONTROL_TC_QUERY;
- r.in.data.domain = lp_workgroup(global_loadparm);
+ r.in.data.domain = lp_workgroup(tctx->lp_ctx);
for (i=1;i<4;i++) {
r.in.level = i;
@@ -839,7 +839,7 @@ static bool test_LogonControl2(struct torture_context *tctx,
}
r.in.function_code = NETLOGON_CONTROL_TRANSPORT_NOTIFY;
- r.in.data.domain = lp_workgroup(global_loadparm);
+ r.in.data.domain = lp_workgroup(tctx->lp_ctx);
for (i=1;i<4;i++) {
r.in.level = i;
@@ -932,7 +932,7 @@ static bool test_LogonControl2Ex(struct torture_context *tctx,
r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.function_code = NETLOGON_CONTROL_REDISCOVER;
- r.in.data.domain = lp_workgroup(global_loadparm);
+ r.in.data.domain = lp_workgroup(tctx->lp_ctx);
for (i=1;i<4;i++) {
r.in.level = i;
@@ -945,7 +945,7 @@ static bool test_LogonControl2Ex(struct torture_context *tctx,
}
r.in.function_code = NETLOGON_CONTROL_TC_QUERY;
- r.in.data.domain = lp_workgroup(global_loadparm);
+ r.in.data.domain = lp_workgroup(tctx->lp_ctx);
for (i=1;i<4;i++) {
r.in.level = i;
@@ -958,7 +958,7 @@ static bool test_LogonControl2Ex(struct torture_context *tctx,
}
r.in.function_code = NETLOGON_CONTROL_TRANSPORT_NOTIFY;
- r.in.data.domain = lp_workgroup(global_loadparm);
+ r.in.data.domain = lp_workgroup(tctx->lp_ctx);
for (i=1;i<4;i++) {
r.in.level = i;
@@ -1090,7 +1090,7 @@ static bool test_netr_DsRGetDCName(struct torture_context *tctx,
struct netr_DsRGetDCName r;
r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.domain_name = talloc_asprintf(tctx, "%s", lp_realm(global_loadparm));
+ r.in.domain_name = talloc_asprintf(tctx, "%s", lp_realm(tctx->lp_ctx));
r.in.domain_guid = NULL;
r.in.site_guid = NULL;
r.in.flags = DS_RETURN_DNS_NAME;
@@ -1113,7 +1113,7 @@ static bool test_netr_DsRGetDCNameEx(struct torture_context *tctx,
struct netr_DsRGetDCNameEx r;
r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.domain_name = talloc_asprintf(tctx, "%s", lp_realm(global_loadparm));
+ r.in.domain_name = talloc_asprintf(tctx, "%s", lp_realm(tctx->lp_ctx));
r.in.domain_guid = NULL;
r.in.site_name = NULL;
r.in.flags = DS_RETURN_DNS_NAME;
@@ -1138,7 +1138,7 @@ static bool test_netr_DsRGetDCNameEx2(struct torture_context *tctx,
r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.client_account = NULL;
r.in.mask = 0x00000000;
- r.in.domain_name = talloc_asprintf(tctx, "%s", lp_realm(global_loadparm));
+ r.in.domain_name = talloc_asprintf(tctx, "%s", lp_realm(tctx->lp_ctx));
r.in.domain_guid = NULL;
r.in.site_name = NULL;
r.in.flags = DS_RETURN_DNS_NAME;
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 3a315ff08f..941c7b4f74 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -1164,7 +1164,7 @@ bool torture_netlogon_samba3(struct torture_context *torture)
goto done;
}
- cli_credentials_set_conf(wks_creds, global_loadparm);
+ cli_credentials_set_conf(wks_creds, torture->lp_ctx);
cli_credentials_set_secure_channel_type(wks_creds, SEC_CHAN_WKSTA);
cli_credentials_set_username(wks_creds, wks_name, CRED_SPECIFIED);
cli_credentials_set_workstation(wks_creds, wks_name, CRED_SPECIFIED);
@@ -1656,7 +1656,7 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
goto done;
}
- cli_credentials_set_conf(user_creds, global_loadparm);
+ cli_credentials_set_conf(user_creds, torture->lp_ctx);
cli_credentials_set_username(user_creds, "torture_username",
CRED_SPECIFIED);
cli_credentials_set_password(user_creds,
@@ -2557,7 +2557,7 @@ bool torture_samba3_rpc_spoolss(struct torture_context *torture)
ZERO_STRUCT(userlevel1);
userlevel1.client = talloc_asprintf(
- mem_ctx, "\\\\%s", lp_netbios_name(global_loadparm));
+ mem_ctx, "\\\\%s", lp_netbios_name(torture->lp_ctx));
userlevel1.user = cli_credentials_get_username(cmdline_credentials);
userlevel1.build = 2600;
userlevel1.major = 3;
diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index aa0f6de788..de13b84392 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -1512,7 +1512,7 @@ bool torture_rpc_samlogon(struct torture_context *torture)
return false;
}
- userdomain = torture_setting_string(torture, "userdomain", lp_workgroup(global_loadparm));
+ userdomain = torture_setting_string(torture, "userdomain", lp_workgroup(torture->lp_ctx));
user_ctx = torture_create_testuser(torture,
TEST_USER_NAME,
@@ -1735,7 +1735,7 @@ bool torture_rpc_samlogon(struct torture_context *torture)
.username = talloc_asprintf(mem_ctx,
"%s@%s",
TEST_USER_NAME,
- lp_realm(global_loadparm)),
+ lp_realm(torture->lp_ctx)),
.password = user_password,
.network_login = true,
.expected_interactive_error = NT_STATUS_OK,
diff --git a/source4/torture/rpc/samr_accessmask.c b/source4/torture/rpc/samr_accessmask.c
index c444187cfc..e64d6a6bce 100644
--- a/source4/torture/rpc/samr_accessmask.c
+++ b/source4/torture/rpc/samr_accessmask.c
@@ -412,7 +412,7 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
ld.in.connect_handle = &ch;
ld.in.domain_name = &dn;
- dn.string = lp_workgroup(global_loadparm);
+ dn.string = lp_workgroup(tctx->lp_ctx);
status = dcerpc_samr_LookupDomain(p, tctx, &ld);
if (!NT_STATUS_IS_OK(status)) {
@@ -436,7 +436,7 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
ld.in.connect_handle = &ch;
ld.in.domain_name = &dn;
- dn.string = lp_workgroup(global_loadparm);
+ dn.string = lp_workgroup(tctx->lp_ctx);
status = dcerpc_samr_LookupDomain(p, tctx, &ld);
if(!NT_STATUS_EQUAL(NT_STATUS_ACCESS_DENIED, status)) {
@@ -488,7 +488,7 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
ld.in.connect_handle = &ch;
ld.in.domain_name = &dn;
- dn.string = lp_workgroup(global_loadparm);
+ dn.string = lp_workgroup(tctx->lp_ctx);
status = dcerpc_samr_LookupDomain(p, tctx, &ld);
if (!NT_STATUS_IS_OK(status)) {
printf("LookupDomain failed - %s\n", nt_errstr(status));
@@ -569,7 +569,7 @@ static bool test_samr_connect(struct torture_context *tctx,
const struct dom_sid *test_sid;
/* create a test user */
- testuser = torture_create_testuser(tctx, TEST_USER_NAME, lp_workgroup(global_loadparm),
+ testuser = torture_create_testuser(tctx, TEST_USER_NAME, lp_workgroup(tctx->lp_ctx),
ACB_NORMAL, &testuser_passwd);
if (!testuser) {
printf("Failed to create test user\n");
@@ -577,7 +577,7 @@ static bool test_samr_connect(struct torture_context *tctx,
}
test_credentials = cli_credentials_init(tctx);
cli_credentials_set_workstation(test_credentials, "localhost", CRED_SPECIFIED);
- cli_credentials_set_domain(test_credentials, lp_workgroup(global_loadparm),
+ cli_credentials_set_domain(test_credentials, lp_workgroup(tctx->lp_ctx),
CRED_SPECIFIED);
cli_credentials_set_username(test_credentials, TEST_USER_NAME, CRED_SPECIFIED);
cli_credentials_set_password(test_credentials, testuser_passwd, CRED_SPECIFIED);
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index a7cde8af4f..d1d95ce8fd 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -1433,7 +1433,7 @@ bool torture_rpc_samsync(struct torture_context *torture)
test_machine_account = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
join_ctx = torture_create_testuser(torture, test_machine_account,
- lp_workgroup(global_loadparm), ACB_SVRTRUST,
+ lp_workgroup(torture->lp_ctx), ACB_SVRTRUST,
&machine_password);
if (!join_ctx) {
talloc_free(mem_ctx);
@@ -1442,7 +1442,7 @@ bool torture_rpc_samsync(struct torture_context *torture)
}
test_wksta_machine_account = talloc_asprintf(mem_ctx, "%s$", TEST_WKSTA_MACHINE_NAME);
- join_ctx2 = torture_create_testuser(torture, test_wksta_machine_account, lp_workgroup(global_loadparm), ACB_WSTRUST, &wksta_machine_password);
+ join_ctx2 = torture_create_testuser(torture, test_wksta_machine_account, lp_workgroup(torture->lp_ctx), ACB_WSTRUST, &wksta_machine_password);
if (!join_ctx2) {
talloc_free(mem_ctx);
printf("Failed to join as member\n");
@@ -1450,7 +1450,7 @@ bool torture_rpc_samsync(struct torture_context *torture)
}
user_ctx = torture_create_testuser(torture, TEST_USER_NAME,
- lp_workgroup(global_loadparm),
+ lp_workgroup(torture->lp_ctx),
ACB_NORMAL, NULL);
if (!user_ctx) {
talloc_free(mem_ctx);
@@ -1474,7 +1474,7 @@ bool torture_rpc_samsync(struct torture_context *torture)
goto failed;
}
- domain_policy = samsync_open_domain(mem_ctx, samsync_state, lp_workgroup(global_loadparm), NULL);
+ domain_policy = samsync_open_domain(mem_ctx, samsync_state, lp_workgroup(torture->lp_ctx), NULL);
if (!domain_policy) {
printf("samrsync_open_domain failed\n");
ret = false;
@@ -1549,7 +1549,7 @@ bool torture_rpc_samsync(struct torture_context *torture)
credentials = cli_credentials_init(mem_ctx);
cli_credentials_set_workstation(credentials, TEST_MACHINE_NAME, CRED_SPECIFIED);
- cli_credentials_set_domain(credentials, lp_workgroup(global_loadparm), CRED_SPECIFIED);
+ cli_credentials_set_domain(credentials, lp_workgroup(torture->lp_ctx), CRED_SPECIFIED);
cli_credentials_set_username(credentials, test_machine_account, CRED_SPECIFIED);
cli_credentials_set_password(credentials, machine_password, CRED_SPECIFIED);
cli_credentials_set_secure_channel_type(credentials,
@@ -1586,7 +1586,7 @@ bool torture_rpc_samsync(struct torture_context *torture)
credentials_wksta = cli_credentials_init(mem_ctx);
cli_credentials_set_workstation(credentials_wksta, TEST_WKSTA_MACHINE_NAME, CRED_SPECIFIED);
- cli_credentials_set_domain(credentials_wksta, lp_workgroup(global_loadparm), CRED_SPECIFIED);
+ cli_credentials_set_domain(credentials_wksta, lp_workgroup(torture->lp_ctx), CRED_SPECIFIED);
cli_credentials_set_username(credentials_wksta, test_wksta_machine_account, CRED_SPECIFIED);
cli_credentials_set_password(credentials_wksta, wksta_machine_password, CRED_SPECIFIED);
cli_credentials_set_secure_channel_type(credentials_wksta,
diff --git a/source4/torture/rpc/scanner.c b/source4/torture/rpc/scanner.c
index 630e9cf1e4..a47fbdd667 100644
--- a/source4/torture/rpc/scanner.c
+++ b/source4/torture/rpc/scanner.c
@@ -131,7 +131,7 @@ bool torture_rpc_scanner(struct torture_context *torture)
b->endpoint = talloc_strdup(b, l->table->name);
}
- lp_set_cmdline(global_loadparm, "torture:binding", dcerpc_binding_string(torture, b));
+ lp_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(torture, b));
status = torture_rpc_connection(torture, &p, &ndr_table_mgmt);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c
index a1a83c69d7..f7c9806faa 100644
--- a/source4/torture/rpc/schannel.c
+++ b/source4/torture/rpc/schannel.c
@@ -47,11 +47,11 @@ bool test_netlogon_ex_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
DATA_BLOB names_blob, chal, lm_resp, nt_resp;
int i;
int flags = CLI_CRED_NTLM_AUTH;
- if (lp_client_lanman_auth(global_loadparm)) {
+ if (lp_client_lanman_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(global_loadparm)) {
+ if (lp_client_ntlmv2_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
@@ -122,7 +122,7 @@ static bool test_samr_ops(struct torture_context *tctx,
struct policy_handle handle;
struct policy_handle domain_handle;
- name.string = lp_workgroup(global_loadparm);
+ name.string = lp_workgroup(tctx->lp_ctx);
r.in.domain_name = &name;
connect.in.system_name = 0;
@@ -233,7 +233,7 @@ static bool test_schannel(struct torture_context *tctx,
{
struct test_join *join_ctx;
NTSTATUS status;
- const char *binding = lp_parm_string(global_loadparm, NULL, "torture", "binding");
+ const char *binding = torture_setting_string(tctx, "binding", NULL);
struct dcerpc_binding *b;
struct dcerpc_pipe *p = NULL;
struct dcerpc_pipe *p_netlogon = NULL;
diff --git a/source4/torture/rpc/session_key.c b/source4/torture/rpc/session_key.c
index 69dc8da6c1..765458c62a 100644
--- a/source4/torture/rpc/session_key.c
+++ b/source4/torture/rpc/session_key.c
@@ -148,9 +148,9 @@ static bool test_secrets(struct torture_context *torture, const void *_data)
const struct secret_settings *settings =
(const struct secret_settings *)_data;
- lp_set_cmdline(global_loadparm, "ntlmssp client:keyexchange", settings->keyexchange?"True":"False");
- lp_set_cmdline(global_loadparm, "ntlmssp_client:ntlm2", settings->ntlm2?"True":"False");
- lp_set_cmdline(global_loadparm, "ntlmssp_client:lm_key", settings->lm_key?"True":"False");
+ lp_set_cmdline(torture->lp_ctx, "ntlmssp client:keyexchange", settings->keyexchange?"True":"False");
+ lp_set_cmdline(torture->lp_ctx, "ntlmssp_client:ntlm2", settings->ntlm2?"True":"False");
+ lp_set_cmdline(torture->lp_ctx, "ntlmssp_client:lm_key", settings->lm_key?"True":"False");
torture_assert_ntstatus_ok(torture, torture_rpc_binding(torture, &binding),
"Getting bindoptions");
diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c
index 2547f8ce00..c39294e431 100644
--- a/source4/torture/rpc/spoolss_notify.c
+++ b/source4/torture/rpc/spoolss_notify.c
@@ -224,11 +224,11 @@ static bool test_RFFPCNEx(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, dcerpc_register_ep_server(&ep_server),
"unable to register spoolss server");
- lp_set_cmdline(global_loadparm, "dcerpc endpoint servers", "spoolss");
+ lp_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss");
address = iface_n_ip(0);
torture_comment(tctx, "Listening for callbacks on %s\n", address);
- status = smbsrv_add_socket(p->conn->event_ctx, &single_ops, address);
+ status = smbsrv_add_socket(p->conn->event_ctx, tctx->lp_ctx, &single_ops, address);
torture_assert_ntstatus_ok(tctx, status, "starting smb server");
status = dcesrv_init_context(tctx, endpoints, &dce_ctx);
diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c
index 725799f2dd..edffe539d7 100644
--- a/source4/torture/rpc/testjoin.c
+++ b/source4/torture/rpc/testjoin.c
@@ -126,7 +126,7 @@ struct test_join *torture_create_testuser(struct torture_context *torture,
int policy_min_pw_len = 0;
struct test_join *join;
char *random_pw;
- const char *dc_binding = lp_parm_string(global_loadparm, NULL, "torture", "dc_binding");
+ const char *dc_binding = torture_setting_string(torture, "dc_binding", NULL);
join = talloc(NULL, struct test_join);
if (join == NULL) {
@@ -276,7 +276,7 @@ again:
u.info21.description.string = talloc_asprintf(join,
"Samba4 torture account created by host %s: %s",
- lp_netbios_name(global_loadparm),
+ lp_netbios_name(torture->lp_ctx),
timestring(join, time(NULL)));
printf("Resetting ACB flags, force pw change time\n");
diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c
index 9a2f518535..dba2fa16e3 100644
--- a/source4/torture/rpc/wkssvc.c
+++ b/source4/torture/rpc/wkssvc.c
@@ -212,7 +212,7 @@ static bool test_NetrWkstaUserGetInfo(struct torture_context *tctx,
NTSTATUS status;
struct wkssvc_NetrWkstaUserGetInfo r;
union wkssvc_NetrWkstaUserInfo info;
- const char *dom = lp_workgroup(global_loadparm);
+ const char *dom = lp_workgroup(tctx->lp_ctx);
struct cli_credentials *creds = cmdline_credentials;
const char *user = cli_credentials_get_username(creds);
int i;
@@ -483,7 +483,7 @@ static bool test_NetrLogonDomainNameAdd(struct torture_context *tctx,
NTSTATUS status;
struct wkssvc_NetrLogonDomainNameAdd r;
- r.in.domain_name = lp_workgroup(global_loadparm);
+ r.in.domain_name = lp_workgroup(tctx->lp_ctx);
torture_comment(tctx, "testing NetrLogonDomainNameAdd\n");
@@ -501,7 +501,7 @@ static bool test_NetrLogonDomainNameDel(struct torture_context *tctx,
NTSTATUS status;
struct wkssvc_NetrLogonDomainNameDel r;
- r.in.domain_name = lp_workgroup(global_loadparm);
+ r.in.domain_name = lp_workgroup(tctx->lp_ctx);
torture_comment(tctx, "testing NetrLogonDomainNameDel\n");
@@ -595,7 +595,7 @@ static bool test_NetrValidateName(struct torture_context *tctx,
for (i=0; i<ARRAY_SIZE(levels); i++) {
r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.name = lp_workgroup(global_loadparm);
+ r.in.name = lp_workgroup(tctx->lp_ctx);
r.in.Account = NULL;
r.in.Password = NULL;
r.in.name_type = levels[i];
@@ -625,7 +625,7 @@ static bool test_NetrValidateName2(struct torture_context *tctx,
for (i=0; i<ARRAY_SIZE(levels); i++) {
r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.name = lp_workgroup(global_loadparm);
+ r.in.name = lp_workgroup(tctx->lp_ctx);
r.in.Account = NULL;
r.in.EncryptedPassword = NULL;
r.in.name_type = levels[i];
@@ -1047,7 +1047,7 @@ static bool test_NetrGetJoinableOus(struct torture_context *tctx,
const char **ous = NULL;
r.in.server_name = dcerpc_server_name(p);
- r.in.domain_name = lp_workgroup(global_loadparm);
+ r.in.domain_name = lp_workgroup(tctx->lp_ctx);
r.in.Account = NULL;
r.in.unknown = NULL;
r.in.num_ous = r.out.num_ous = &num_ous;
@@ -1073,7 +1073,7 @@ static bool test_NetrGetJoinableOus2(struct torture_context *tctx,
const char **ous = NULL;
r.in.server_name = dcerpc_server_name(p);
- r.in.domain_name = lp_workgroup(global_loadparm);
+ r.in.domain_name = lp_workgroup(tctx->lp_ctx);
r.in.Account = NULL;
r.in.EncryptedPassword = NULL;
r.in.num_ous = r.out.num_ous = &num_ous;
@@ -1100,7 +1100,7 @@ static bool test_NetrUnjoinDomain(struct torture_context *tctx,
const char *admin_account = NULL;
admin_account = talloc_asprintf(tctx, "%s\\%s",
- lp_workgroup(global_loadparm),
+ lp_workgroup(tctx->lp_ctx),
user);
r.in.server_name = dcerpc_server_name(p);
@@ -1128,11 +1128,11 @@ static bool test_NetrJoinDomain(struct torture_context *tctx,
const char *admin_account = NULL;
admin_account = talloc_asprintf(tctx, "%s\\%s",
- lp_workgroup(global_loadparm),
+ lp_workgroup(tctx->lp_ctx),
user);
r.in.server_name = dcerpc_server_name(p);
- r.in.domain_name = lp_realm(global_loadparm);
+ r.in.domain_name = lp_realm(tctx->lp_ctx);
r.in.account_ou = NULL;
r.in.Account = admin_account;
r.in.password = NULL;