r25430: Add the loadparm context to all parametric options.
[ab/samba.git/.git] / source4 / torture / util_smb.c
index 8e4f3b56eeafaf77a3a28e0c4f26ded8164b0300..10d48313263df3087ecd2cd9654a2be2e868511a 100644 (file)
@@ -31,6 +31,7 @@
 #include "torture/torture.h"
 #include "util/dlinklist.h"
 #include "auth/credentials/credentials.h"
+#include "param/param.h"
 
 
 /**
@@ -291,7 +292,7 @@ bool wire_bad_flags(struct smb_wire_string *str, int flags, struct smbcli_transp
        if (flags & STR_TERMINATE) len++;
 
        server_unicode = (transport->negotiate.capabilities&CAP_UNICODE)?True:False;
-       if (getenv("CLI_FORCE_ASCII") || !lp_unicode()) {
+       if (getenv("CLI_FORCE_ASCII") || !lp_unicode(global_loadparm)) {
                server_unicode = False;
        }
 
@@ -478,10 +479,10 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
                return False;
        }
 
-       (*c)->transport->options.use_oplocks = lp_parm_bool(-1, "torture", 
-                                                                                                               "use_oplocks", False);
-       (*c)->transport->options.use_level2_oplocks = lp_parm_bool(-1, "torture", 
-                                                                                               "use_level2_oplocks", False);
+       (*c)->transport->options.use_oplocks = lp_parm_bool(global_loadparm, NULL, "torture", 
+                                                                                                               "use_oplocks", false);
+       (*c)->transport->options.use_level2_oplocks = lp_parm_bool(global_loadparm, NULL, "torture", 
+                                                                                               "use_level2_oplocks", false);
 
        return True;
 }
@@ -494,10 +495,10 @@ _PUBLIC_ bool torture_get_conn_index(int conn_index,
        int num_unc_names = 0;
        const char *p;
 
-       (*host) = talloc_strdup(mem_ctx, lp_parm_string(-1, "torture", "host"));
-       (*share) = talloc_strdup(mem_ctx, lp_parm_string(-1, "torture", "share"));
+       (*host) = talloc_strdup(mem_ctx, lp_parm_string(global_loadparm, NULL, "torture", "host"));
+       (*share) = talloc_strdup(mem_ctx, lp_parm_string(global_loadparm, NULL, "torture", "share"));
        
-       p = lp_parm_string(-1, "torture", "unclist");
+       p = lp_parm_string(global_loadparm, NULL, "torture", "unclist");
        if (!p) {
                return True;
        }
@@ -642,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);