r25392: Add loadparm context as argument in a couple more places.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 27 Sep 2007 23:31:28 +0000 (23:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:07:24 +0000 (15:07 -0500)
21 files changed:
source/client/cifsdd.c
source/lib/charset/charcnv.c
source/lib/cmdline/popt_common.c
source/lib/cmdline/popt_credentials.c
source/param/loadparm.c
source/scripting/ejs/smbcalls_config.c
source/scripting/ejs/smbscript.c
source/torture/basic/base.c
source/torture/local/irpc.c
source/torture/local/messaging.c
source/torture/locktest.c
source/torture/masktest.c
source/torture/raw/context.c
source/torture/raw/samba3misc.c
source/torture/rpc/mgmt.c
source/torture/rpc/scanner.c
source/torture/rpc/session_key.c
source/torture/rpc/spoolss_notify.c
source/torture/smbtorture.c
source/torture/util_smb.c
source/utils/testparm.c

index 8ecb0a628c86f2363fd4130fed84e9ef2390121f..cb42e992ce0698dba0545dd5bf9c4017b77659b4 100644 (file)
@@ -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)
index ca96277679d99a014b198d3fa3bc69a9a567a8ab..d0c4461cc81c57b38b47d6d9439e2570423fc062 100644 (file)
@@ -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);
index 6f91c3a26a454dbe6d53ed69608dadd9cb26974d..6e0573e7ef154c114a2c068acc994a733fc86293 100644 (file)
@@ -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);
                }
index 9abd7f53d246e9c21a4c2487b9bf22bb33a83bc6..b913e6a53a9a27c0a68914daab494578fb332328 100644 (file)
@@ -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':
index 1582eb6075c12f51dab49a725eda749c96371376..90abc4abcd101693fd887e7e9413398110b35829 100644 (file)
@@ -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);
 
index 8f1339db345446d239de13b37687a7b0b48957fa..f488b0745ff966aabfc6bc9b10cd3e63b59bfa51 100644 (file)
@@ -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;
 }
 
index a21669a07e12acd25a7985c6a8f603e8aca9c7fe..9f7e048fc09250e90eb27cb74a3fd96e99731422 100644 (file)
@@ -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();
index b6b1d021dccc7f72471c59919ed3cce904764c12..7c9339dedc9d86a8bcba5f70b11ee544fe545939 100644 (file)
@@ -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;
index e113b63804a2f290e8c1b0324e74c350021d86ac..ad1b22ca6fb2b4a8ab51700f0d9fdbda502aa0b5 100644 (file)
@@ -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 = 
index e70fd7c24dddb62c536258f9e99d5a4d11b3b285..6834c82fae01eb3e32433017414a96860e086ab4 100644 (file)
@@ -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;
 
index d18a1cb6e91e4acf75a47c070ae71e01f74e0526..e99ff715a2b27f86467e1968f08efcf0f62931b7 100644 (file)
@@ -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();
index 53cceb9699137bd6d6f1ab77dec2e06d0ef7c3e4..9019bf913bc37249e5a85a5f087e77d54df189f9 100644 (file)
@@ -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);
index dacc9958be141bd0832f383fa454763529afefa7..5b2e0f8af8151d08a7a724d876bb9d8580c75970 100644 (file)
@@ -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);
index 3f6c552cb4c1aab72ad46046e2250e7fb7346740..aad13ecd8fd894e6a1c08d3619b60a5eaf3b0f9d 100644 (file)
@@ -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;
index 40a34384927ef0472b37bd9aeead6831f8a84e04..f27dcd7b0585f8efafef579427700934f1478cfc 100644 (file)
@@ -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)) {
index c070a477544078cd6df552b558479148f7d398ab..976279a817827d5c7e8c0ee2badd7063e383c873 100644 (file)
@@ -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)) {
index ac65b80071c05c4433191166febf93c2e4a5b712..69dc8da6c1b61b14e7ed0655ba58f17935972518 100644 (file)
@@ -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");
index c6fb71c4654d9f91b898d5c7b86ea80856d0945f..e44c2a874b3fa6db848b92e465b58d0b768ec7f6 100644 (file)
@@ -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);
index 020d49497f2dcff16566c2cdb7e11614c230e067..5ef2025d1efd24cd23e9a37996c374fa9420fa94 100644 (file)
@@ -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")) {
index 8b944e33a09f8eed640194c35673e9ba35bdfd78..c648273c83da99367d01f046de065c96117ec859 100644 (file)
@@ -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);
 
 
index 160cf1cc0aefbb90f28353a3a1543c50203d793c..d8b6069791161b0e931e42e0492f6f6fc512ce10 100644 (file)
@@ -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));