summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/client/cifsdd.c2
-rw-r--r--source4/lib/charset/charcnv.c2
-rw-r--r--source4/lib/cmdline/popt_common.c24
-rw-r--r--source4/lib/cmdline/popt_credentials.c2
-rw-r--r--source4/param/loadparm.c43
-rw-r--r--source4/scripting/ejs/smbcalls_config.c2
-rw-r--r--source4/scripting/ejs/smbscript.c2
-rw-r--r--source4/torture/basic/base.c6
-rw-r--r--source4/torture/local/irpc.c2
-rw-r--r--source4/torture/local/messaging.c2
-rw-r--r--source4/torture/locktest.c4
-rw-r--r--source4/torture/masktest.c4
-rw-r--r--source4/torture/raw/context.c2
-rw-r--r--source4/torture/raw/samba3misc.c6
-rw-r--r--source4/torture/rpc/mgmt.c2
-rw-r--r--source4/torture/rpc/scanner.c2
-rw-r--r--source4/torture/rpc/session_key.c6
-rw-r--r--source4/torture/rpc/spoolss_notify.c2
-rw-r--r--source4/torture/smbtorture.c50
-rw-r--r--source4/torture/util_smb.c2
-rw-r--r--source4/utils/testparm.c4
21 files changed, 88 insertions, 83 deletions
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c
index 8ecb0a628c..cb42e992ce 100644
--- a/source4/client/cifsdd.c
+++ b/source4/client/cifsdd.c
@@ -395,7 +395,7 @@ static void set_max_xmit(uint64_t iomax)
char buf[64];
snprintf(buf, sizeof(buf), "%llu", (unsigned long long)iomax);
- lp_set_cmdline("max xmit", buf);
+ lp_set_cmdline(global_loadparm, "max xmit", buf);
}
static int copy_files(void)
diff --git a/source4/lib/charset/charcnv.c b/source4/lib/charset/charcnv.c
index ca96277679..d0c4461cc8 100644
--- a/source4/lib/charset/charcnv.c
+++ b/source4/lib/charset/charcnv.c
@@ -119,7 +119,7 @@ static smb_iconv_t get_conv_handle(charset_t from, charset_t to)
strcasecmp(charset_name(CH_DOS), "ASCII") != 0) {
DEBUG(0,("dos charset '%s' unavailable - using ASCII\n",
charset_name(CH_DOS)));
- lp_set_cmdline("dos charset", "ASCII");
+ lp_set_cmdline(global_loadparm, "dos charset", "ASCII");
n1 = charset_name(from);
n2 = charset_name(to);
diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c
index 6f91c3a26a..6e0573e7ef 100644
--- a/source4/lib/cmdline/popt_common.c
+++ b/source4/lib/cmdline/popt_common.c
@@ -78,14 +78,14 @@ static void popt_common_callback(poptContext con,
setup_logging(pname, DEBUG_STDOUT);
if (getenv("SMB_CONF_PATH")) {
- lp_set_cmdline("config file", getenv("SMB_CONF_PATH"));
+ lp_set_cmdline(global_loadparm, "config file", getenv("SMB_CONF_PATH"));
}
return;
}
switch(opt->val) {
case 'd':
- lp_set_cmdline("log level", arg);
+ lp_set_cmdline(global_loadparm, "log level", arg);
break;
case OPT_DEBUG_STDERR:
@@ -98,50 +98,50 @@ static void popt_common_callback(poptContext con,
case 'O':
if (arg) {
- lp_set_cmdline("socket options", arg);
+ lp_set_cmdline(global_loadparm, "socket options", arg);
}
break;
case 's':
if (arg) {
- lp_set_cmdline("config file", arg);
+ lp_set_cmdline(global_loadparm, "config file", arg);
}
break;
case 'l':
if (arg) {
char *new_logfile = talloc_asprintf(NULL, "%s/log.%s", arg, pname);
- lp_set_cmdline("log file", new_logfile);
+ lp_set_cmdline(global_loadparm, "log file", new_logfile);
talloc_free(new_logfile);
}
break;
case 'W':
- lp_set_cmdline("workgroup", arg);
+ lp_set_cmdline(global_loadparm, "workgroup", arg);
break;
case 'r':
- lp_set_cmdline("realm", arg);
+ lp_set_cmdline(global_loadparm, "realm", arg);
break;
case 'n':
- lp_set_cmdline("netbios name", arg);
+ lp_set_cmdline(global_loadparm, "netbios name", arg);
break;
case 'i':
- lp_set_cmdline("netbios scope", arg);
+ lp_set_cmdline(global_loadparm, "netbios scope", arg);
break;
case 'm':
- lp_set_cmdline("client max protocol", arg);
+ lp_set_cmdline(global_loadparm, "client max protocol", arg);
break;
case 'R':
- lp_set_cmdline("name resolve order", arg);
+ lp_set_cmdline(global_loadparm, "name resolve order", arg);
break;
case OPT_OPTION:
- if (!lp_set_option(arg)) {
+ if (!lp_set_option(global_loadparm, arg)) {
fprintf(stderr, "Error setting option '%s'\n", arg);
exit(1);
}
diff --git a/source4/lib/cmdline/popt_credentials.c b/source4/lib/cmdline/popt_credentials.c
index 9abd7f53d2..b913e6a53a 100644
--- a/source4/lib/cmdline/popt_credentials.c
+++ b/source4/lib/cmdline/popt_credentials.c
@@ -95,7 +95,7 @@ static void popt_common_credentials_callback(poptContext con,
break;
case 'S':
- lp_set_cmdline("client signing", arg);
+ lp_set_cmdline(global_loadparm, "client signing", arg);
break;
case 'P':
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 1582eb6075..90abc4abcd 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -1182,7 +1182,7 @@ static bool lp_add_hidden(struct loadparm_context *lp_ctx, const char *name,
string_set(service, &service->szPath, tmpdir());
service->comment = talloc_asprintf(service, "%s Service (%s)",
- fstype, loadparm.Globals.szServerString);
+ fstype, lp_ctx->Globals.szServerString);
string_set(service, &service->fstype, fstype);
service->iMaxConnections = -1;
service->bAvailable = true;
@@ -1861,7 +1861,8 @@ bool lp_do_global_parameter_var(struct loadparm_context *lp_ctx,
parsing code. It sets the parameter then marks the parameter as unable to be modified
by smb.conf processing
*/
-bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue)
+bool lp_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName,
+ const char *pszParmValue)
{
int parmnum = map_parameter(pszParmName);
int i;
@@ -1882,7 +1883,7 @@ bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue)
/* reset the CMDLINE flag in case this has been called before */
parm_table[parmnum].flags &= ~FLAG_CMDLINE;
- if (!lp_do_global_parameter(&loadparm, pszParmName, pszParmValue)) {
+ if (!lp_do_global_parameter(lp_ctx, pszParmName, pszParmValue)) {
return false;
}
@@ -1902,7 +1903,7 @@ bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue)
/*
set a option from the commandline in 'a=b' format. Use to support --option
*/
-bool lp_set_option(const char *option)
+bool lp_set_option(struct loadparm_context *lp_ctx, const char *option)
{
char *p, *s;
bool ret;
@@ -1920,7 +1921,7 @@ bool lp_set_option(const char *option)
*p = 0;
- ret = lp_set_cmdline(s, p+1);
+ ret = lp_set_cmdline(lp_ctx, s, p+1);
free(s);
return ret;
}
@@ -2052,7 +2053,7 @@ static bool do_section(const char *pszSectionName, void *userdata)
/* issued by the post-processing of a previous section. */
DEBUG(2, ("Processing section \"[%s]\"\n", pszSectionName));
- if ((loadparm.currentService = add_a_service(lp_ctx, &sDefault,
+ if ((lp_ctx->currentService = add_a_service(lp_ctx, &sDefault,
pszSectionName))
== NULL) {
DEBUG(0, ("Failed to add a new service\n"));
@@ -2099,7 +2100,7 @@ static bool is_default(int i)
Display the contents of the global structure.
***************************************************************************/
-static void dump_globals(FILE *f, bool show_defaults)
+static void dump_globals(struct loadparm_context *lp_ctx, FILE *f, bool show_defaults)
{
int i;
struct param_opt *data;
@@ -2116,8 +2117,8 @@ static void dump_globals(FILE *f, bool show_defaults)
print_parameter(&parm_table[i], parm_table[i].ptr, f);
fprintf(f, "\n");
}
- if (loadparm.Globals.param_opt != NULL) {
- for (data = loadparm.Globals.param_opt; data;
+ if (lp_ctx->Globals.param_opt != NULL) {
+ for (data = lp_ctx->Globals.param_opt; data;
data = data->next) {
fprintf(f, "\t%s = %s\n", data->key, data->value);
}
@@ -2168,9 +2169,10 @@ static void dump_a_service(struct loadparm_service * pService, FILE * f)
}
}
-bool lp_dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal)
+bool lp_dump_a_parameter(struct loadparm_context *lp_ctx, int snum, char *parm_name, FILE * f,
+ bool isGlobal)
{
- struct loadparm_service * pService = loadparm.ServicePtrs[snum];
+ struct loadparm_service * pService = lp_ctx->ServicePtrs[snum];
struct parm_struct *parm;
void *ptr;
@@ -2196,7 +2198,8 @@ bool lp_dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal)
Return NULL when out of parameters.
***************************************************************************/
-struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters)
+struct parm_struct *lp_next_parameter(struct loadparm_context *lp_ctx, int snum, int *i,
+ int allparameters)
{
if (snum == -1) {
/* do the globals */
@@ -2216,7 +2219,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters)
return &parm_table[(*i)++];
}
} else {
- struct loadparm_service *pService = loadparm.ServicePtrs[snum];
+ struct loadparm_service *pService = lp_ctx->ServicePtrs[snum];
for (; parm_table[*i].label; (*i)++) {
if (parm_table[*i].class == P_SEPARATOR)
@@ -2273,16 +2276,18 @@ bool lp_loaded(void)
Unload unused services.
***************************************************************************/
-void lp_killunused(struct smbsrv_connection *smb, bool (*snumused) (struct smbsrv_connection *, int))
+void lp_killunused(struct loadparm_context *lp_ctx,
+ struct smbsrv_connection *smb,
+ bool (*snumused) (struct smbsrv_connection *, int))
{
int i;
- for (i = 0; i < loadparm.iNumServices; i++) {
- if (loadparm.ServicePtrs[i] == NULL)
+ for (i = 0; i < lp_ctx->iNumServices; i++) {
+ if (lp_ctx->ServicePtrs[i] == NULL)
continue;
if (!snumused || !snumused(smb, i)) {
- talloc_free(loadparm.ServicePtrs[i]);
- loadparm.ServicePtrs[i] = NULL;
+ talloc_free(lp_ctx->ServicePtrs[i]);
+ lp_ctx->ServicePtrs[i] = NULL;
}
}
}
@@ -2532,7 +2537,7 @@ void lp_dump(struct loadparm_context *lp_ctx, FILE *f, bool show_defaults,
if (show_defaults)
defaults_saved = false;
- dump_globals(f, show_defaults);
+ dump_globals(lp_ctx, f, show_defaults);
dump_a_service(&sDefault, f);
diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c
index 8f1339db34..f488b0745f 100644
--- a/source4/scripting/ejs/smbcalls_config.c
+++ b/source4/scripting/ejs/smbcalls_config.c
@@ -200,7 +200,7 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv)
return -1;
}
- mpr_Return(eid, mprCreateBoolVar(lp_set_cmdline(argv[0], argv[1])));
+ mpr_Return(eid, mprCreateBoolVar(lp_set_cmdline(global_loadparm, argv[0], argv[1])));
return 0;
}
diff --git a/source4/scripting/ejs/smbscript.c b/source4/scripting/ejs/smbscript.c
index a21669a07e..9f7e048fc0 100644
--- a/source4/scripting/ejs/smbscript.c
+++ b/source4/scripting/ejs/smbscript.c
@@ -52,7 +52,7 @@ int main(int argc, const char **argv)
fault_setup(argv[0]);
if (getenv("SMB_CONF_PATH")) {
- lp_set_cmdline("config file", getenv("SMB_CONF_PATH"));
+ lp_set_cmdline(global_loadparm, "config file", getenv("SMB_CONF_PATH"));
}
ldb_global_init();
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index b6b1d021dc..7c9339dedc 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -1445,7 +1445,7 @@ static BOOL torture_samba3_errorpaths(struct torture_context *tctx)
nt_status_support = lp_nt_status_support();
- if (!lp_set_cmdline("nt status support", "yes")) {
+ if (!lp_set_cmdline(global_loadparm, "nt status support", "yes")) {
torture_comment(tctx, "Could not set 'nt status support = yes'\n");
goto fail;
}
@@ -1454,7 +1454,7 @@ static BOOL torture_samba3_errorpaths(struct torture_context *tctx)
goto fail;
}
- if (!lp_set_cmdline("nt status support", "no")) {
+ if (!lp_set_cmdline(global_loadparm, "nt status support", "no")) {
torture_comment(tctx, "Could not set 'nt status support = yes'\n");
goto fail;
}
@@ -1463,7 +1463,7 @@ static BOOL torture_samba3_errorpaths(struct torture_context *tctx)
goto fail;
}
- if (!lp_set_cmdline("nt status support",
+ if (!lp_set_cmdline(global_loadparm, "nt status support",
nt_status_support ? "yes":"no")) {
torture_comment(tctx, "Could not reset 'nt status support = yes'");
goto fail;
diff --git a/source4/torture/local/irpc.c b/source4/torture/local/irpc.c
index e113b63804..ad1b22ca6f 100644
--- a/source4/torture/local/irpc.c
+++ b/source4/torture/local/irpc.c
@@ -215,7 +215,7 @@ static BOOL irpc_setup(struct torture_context *tctx, void **_data)
*_data = data = talloc(tctx, struct irpc_test_data);
- lp_set_cmdline("pid directory", "piddir.tmp");
+ lp_set_cmdline(global_loadparm, "pid directory", "piddir.tmp");
data->ev = tctx->ev;
torture_assert(tctx, data->msg_ctx1 =
diff --git a/source4/torture/local/messaging.c b/source4/torture/local/messaging.c
index e70fd7c24d..6834c82fae 100644
--- a/source4/torture/local/messaging.c
+++ b/source4/torture/local/messaging.c
@@ -68,7 +68,7 @@ static bool test_ping_speed(struct torture_context *tctx)
uint32_t msg_ping, msg_exit;
TALLOC_CTX *mem_ctx = tctx;
- lp_set_cmdline("pid directory", "piddir.tmp");
+ lp_set_cmdline(global_loadparm, "pid directory", "piddir.tmp");
ev = tctx->ev;
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index d18a1cb6e9..e99ff715a2 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -614,10 +614,10 @@ static void usage(void)
exact_error_codes = True;
break;
case 'l':
- lp_set_cmdline("torture:unclist", optarg);
+ lp_set_cmdline(global_loadparm, "torture:unclist", optarg);
break;
case 'W':
- lp_set_cmdline("workgroup", optarg);
+ lp_set_cmdline(global_loadparm, "workgroup", optarg);
break;
case 'h':
usage();
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index 53cceb9699..9019bf913b 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -285,7 +285,7 @@ static void usage(void)
setup_logging("masktest", DEBUG_STDOUT);
- lp_set_cmdline("log level", "0");
+ lp_set_cmdline(global_loadparm, "log level", "0");
if (argc < 2 || argv[1][0] == '-') {
usage();
@@ -325,7 +325,7 @@ static void usage(void)
verbose++;
break;
case 'M':
- lp_set_cmdline("max protocol", optarg);
+ lp_set_cmdline(global_loadparm, "max protocol", optarg);
break;
case 'U':
cli_credentials_parse_string(credentials, optarg, CRED_SPECIFIED);
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index dacc9958be..5b2e0f8af8 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -892,7 +892,7 @@ bool torture_raw_context(struct torture_context *torture,
bool ret = true;
if (lp_use_spnego()) {
ret &= torture_raw_context_int(torture, cli);
- lp_set_cmdline("use spnego", "False");
+ lp_set_cmdline(global_loadparm, "use spnego", "False");
}
ret &= torture_raw_context_int(torture, cli);
diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c
index 3f6c552cb4..aad13ecd8f 100644
--- a/source4/torture/raw/samba3misc.c
+++ b/source4/torture/raw/samba3misc.c
@@ -346,7 +346,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
nt_status_support = lp_nt_status_support();
- if (!lp_set_cmdline("nt status support", "yes")) {
+ if (!lp_set_cmdline(global_loadparm, "nt status support", "yes")) {
printf("Could not set 'nt status support = yes'\n");
goto fail;
}
@@ -355,7 +355,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
goto fail;
}
- if (!lp_set_cmdline("nt status support", "no")) {
+ if (!lp_set_cmdline(global_loadparm, "nt status support", "no")) {
printf("Could not set 'nt status support = yes'\n");
goto fail;
}
@@ -364,7 +364,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
goto fail;
}
- if (!lp_set_cmdline("nt status support",
+ if (!lp_set_cmdline(global_loadparm, "nt status support",
nt_status_support ? "yes":"no")) {
printf("Could not reset 'nt status support = yes'");
goto fail;
diff --git a/source4/torture/rpc/mgmt.c b/source4/torture/rpc/mgmt.c
index 40a3438492..f27dcd7b05 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("torture:binding", dcerpc_binding_string(loop_ctx, b));
+ lp_set_cmdline(global_loadparm, "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/scanner.c b/source4/torture/rpc/scanner.c
index c070a47754..976279a817 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("torture:binding", dcerpc_binding_string(torture, b));
+ lp_set_cmdline(global_loadparm, "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/session_key.c b/source4/torture/rpc/session_key.c
index ac65b80071..69dc8da6c1 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("ntlmssp client:keyexchange", settings->keyexchange?"True":"False");
- lp_set_cmdline("ntlmssp_client:ntlm2", settings->ntlm2?"True":"False");
- lp_set_cmdline("ntlmssp_client:lm_key", settings->lm_key?"True":"False");
+ 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");
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 c6fb71c465..e44c2a874b 100644
--- a/source4/torture/rpc/spoolss_notify.c
+++ b/source4/torture/rpc/spoolss_notify.c
@@ -224,7 +224,7 @@ 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("dcerpc endpoint servers", "spoolss");
+ lp_set_cmdline(global_loadparm, "dcerpc endpoint servers", "spoolss");
address = iface_n_ip(0);
torture_comment(tctx, "Listening for callbacks on %s\n", address);
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index 020d49497f..5ef2025d1e 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -131,33 +131,33 @@ static void parse_dns(const char *dns)
/* retrievieng the userdn */
p = strchr_m(dns, '#');
if (!p) {
- lp_set_cmdline("torture:ldap_userdn", "");
- lp_set_cmdline("torture:ldap_basedn", "");
- lp_set_cmdline("torture:ldap_secret", "");
+ lp_set_cmdline(global_loadparm, "torture:ldap_userdn", "");
+ lp_set_cmdline(global_loadparm, "torture:ldap_basedn", "");
+ lp_set_cmdline(global_loadparm, "torture:ldap_secret", "");
return;
}
userdn = strndup(dns, p - dns);
- lp_set_cmdline("torture:ldap_userdn", userdn);
+ lp_set_cmdline(global_loadparm, "torture:ldap_userdn", userdn);
/* retrieve the basedn */
d = p + 1;
p = strchr_m(d, '#');
if (!p) {
- lp_set_cmdline("torture:ldap_basedn", "");
- lp_set_cmdline("torture:ldap_secret", "");
+ lp_set_cmdline(global_loadparm, "torture:ldap_basedn", "");
+ lp_set_cmdline(global_loadparm, "torture:ldap_secret", "");
return;
}
basedn = strndup(d, p - d);
- lp_set_cmdline("torture:ldap_basedn", basedn);
+ lp_set_cmdline(global_loadparm, "torture:ldap_basedn", basedn);
/* retrieve the secret */
p = p + 1;
if (!p) {
- lp_set_cmdline("torture:ldap_secret", "");
+ lp_set_cmdline(global_loadparm, "torture:ldap_secret", "");
return;
}
secret = strdup(p);
- lp_set_cmdline("torture:ldap_secret", secret);
+ lp_set_cmdline(global_loadparm, "torture:ldap_secret", secret);
printf ("%s - %s - %s\n", userdn, basedn, secret);
@@ -448,7 +448,7 @@ void run_shell(struct torture_context *tctx)
fprintf(stderr, "Usage: set <variable> <value>\n");
} else {
char *name = talloc_asprintf(NULL, "torture:%s", argv[1]);
- lp_set_cmdline(name, argv[2]);
+ lp_set_cmdline(global_loadparm, name, argv[2]);
talloc_free(name);
}
} else if (!strcmp(argv[0], "help")) {
@@ -538,36 +538,36 @@ int main(int argc,char *argv[])
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_LOADFILE:
- lp_set_cmdline("torture:loadfile", poptGetOptArg(pc));
+ lp_set_cmdline(global_loadparm, "torture:loadfile", poptGetOptArg(pc));
break;
case OPT_UNCLIST:
- lp_set_cmdline("torture:unclist", poptGetOptArg(pc));
+ lp_set_cmdline(global_loadparm, "torture:unclist", poptGetOptArg(pc));
break;
case OPT_TIMELIMIT:
- lp_set_cmdline("torture:timelimit", poptGetOptArg(pc));
+ lp_set_cmdline(global_loadparm, "torture:timelimit", poptGetOptArg(pc));
break;
case OPT_NUMPROGS:
- lp_set_cmdline("torture:nprocs", poptGetOptArg(pc));
+ lp_set_cmdline(global_loadparm, "torture:nprocs", poptGetOptArg(pc));
break;
case OPT_DNS:
parse_dns(poptGetOptArg(pc));
break;
case OPT_DANGEROUS:
- lp_set_cmdline("torture:dangerous", "Yes");
+ lp_set_cmdline(global_loadparm, "torture:dangerous", "Yes");
break;
case OPT_ASYNC:
- lp_set_cmdline("torture:async", "Yes");
+ lp_set_cmdline(global_loadparm, "torture:async", "Yes");
break;
case OPT_SMB_PORTS:
- lp_set_cmdline("smb ports", poptGetOptArg(pc));
+ lp_set_cmdline(global_loadparm, "smb ports", poptGetOptArg(pc));
break;
}
}
if (strcmp(target, "samba3") == 0) {
- lp_set_cmdline("torture:samba3", "true");
+ lp_set_cmdline(global_loadparm, "torture:samba3", "true");
} else if (strcmp(target, "samba4") == 0) {
- lp_set_cmdline("torture:samba4", "true");
+ lp_set_cmdline(global_loadparm, "torture:samba4", "true");
}
if (max_runtime) {
@@ -632,14 +632,14 @@ int main(int argc,char *argv[])
usage(pc);
return false;
}
- lp_set_cmdline("torture:host", binding_struct->host);
+ lp_set_cmdline(global_loadparm, "torture:host", binding_struct->host);
if (lp_parm_string(NULL, "torture", "share") == NULL)
- lp_set_cmdline("torture:share", "IPC$");
- lp_set_cmdline("torture:binding", argv_new[1]);
+ lp_set_cmdline(global_loadparm, "torture:share", "IPC$");
+ lp_set_cmdline(global_loadparm, "torture:binding", argv_new[1]);
} else {
- lp_set_cmdline("torture:host", host);
- lp_set_cmdline("torture:share", share);
- lp_set_cmdline("torture:binding", host);
+ lp_set_cmdline(global_loadparm, "torture:host", host);
+ lp_set_cmdline(global_loadparm, "torture:share", share);
+ lp_set_cmdline(global_loadparm, "torture:binding", host);
}
if (!strcmp(ui_ops_name, "simple")) {
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index 8b944e33a0..c648273c83 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -643,7 +643,7 @@ double torture_create_procs(struct torture_context *tctx,
srandom(((int)mypid) ^ ((int)time(NULL)));
asprintf(&myname, "CLIENT%d", i);
- lp_set_cmdline("netbios name", myname);
+ lp_set_cmdline(global_loadparm, "netbios name", myname);
free(myname);
diff --git a/source4/utils/testparm.c b/source4/utils/testparm.c
index 160cf1cc0a..d8b6069791 100644
--- a/source4/utils/testparm.c
+++ b/source4/utils/testparm.c
@@ -137,7 +137,7 @@ static int do_global_checks(void)
*/
/* We need this to force the output */
- lp_set_cmdline("log level", "2");
+ lp_set_cmdline(global_loadparm, "log level", "2");
fprintf(stderr,"Load smb config files from %s\n",lp_configfile());
@@ -212,7 +212,7 @@ static int do_global_checks(void)
if (!parameter_name) {
lp_dump_one(stdout, show_defaults, service);
} else {
- ret = !lp_dump_a_parameter(s, parameter_name, stdout, (service == NULL));
+ ret = !lp_dump_a_parameter(global_loadparm, s, parameter_name, stdout, (service == NULL));
}
} else {
lp_dump(global_loadparm, stdout, show_defaults, lp_numservices(global_loadparm));