r26249: Remove a couple more uses of global_loadparm.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 3 Dec 2007 14:53:07 +0000 (15:53 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:47:27 +0000 (05:47 +0100)
21 files changed:
source/torture/basic/base.c
source/torture/basic/delete.c
source/torture/basic/disconnect.c
source/torture/basic/misc.c
source/torture/basic/scanner.c
source/torture/nbench/nbench.c
source/torture/nbench/nbio.c
source/torture/rap/rap.c
source/torture/raw/eas.c
source/torture/raw/lockbench.c
source/torture/raw/notify.c
source/torture/raw/open.c
source/torture/raw/openbench.c
source/torture/raw/oplock.c
source/torture/raw/pingpong.c
source/torture/raw/samba3hide.c
source/torture/raw/samba3misc.c
source/torture/rpc/dfs.c
source/torture/rpc/samba3rpc.c
source/torture/util_smb.c
source/utils/ntlm_auth.c

index 9a5616e2741245f411c9940f1bc044b6ef2d7601..3e6c16f0885b94d9bbbc7550a14ee43ba10de0b8 100644 (file)
@@ -370,7 +370,7 @@ static bool run_negprot_nowait(struct torture_context *tctx)
        }
 
        torture_comment(tctx, "Opening secondary connection\n");
-       if (!torture_open_connection(&cli2, 1)) {
+       if (!torture_open_connection(&cli2, tctx, 1)) {
                torture_comment(tctx, "Failed to open secondary connection\n");
                correct = false;
        }
@@ -1450,7 +1450,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
                goto fail;
        }
 
-       if (!torture_open_connection(&cli_nt, 0)) {
+       if (!torture_open_connection(&cli_nt, tctx, 0)) {
                goto fail;
        }
 
@@ -1459,7 +1459,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
                goto fail;
        }
 
-       if (!torture_open_connection(&cli_dos, 1)) {
+       if (!torture_open_connection(&cli_dos, tctx, 1)) {
                goto fail;
        }
 
index 38528cd8456111aabd057f5c7f03a7768b6c43b3..8b84880c06c57ab8f8411cdb45b3ba98ae81b466 100644 (file)
@@ -1373,10 +1373,10 @@ static bool deltest21(struct torture_context *tctx)
        struct smbcli_state *cli2;
        bool correct = true;
 
-       if (!torture_open_connection(&cli1, 0))
+       if (!torture_open_connection(&cli1, tctx, 0))
                return false;
 
-       if (!torture_open_connection(&cli2, 1))
+       if (!torture_open_connection(&cli2, tctx, 1))
                return false;
 
        del_clean_area(cli1, cli2);
@@ -1404,7 +1404,7 @@ static bool deltest21(struct torture_context *tctx)
 
        fnum1 = -1;
 
-       if (!torture_open_connection(&cli1, 0)) {
+       if (!torture_open_connection(&cli1, tctx, 0)) {
                return false;
        }
 
@@ -1440,7 +1440,7 @@ static bool deltest22(struct torture_context *tctx)
        struct smbcli_state *cli1;
        bool correct = true;
 
-       if (!torture_open_connection(&cli1, 0))
+       if (!torture_open_connection(&cli1, tctx, 0))
                return false;
 
        smbcli_deltree(cli1->tree, dname);
index cb77bfe984d74f81e05d5951b35236774d5026d4..09f54ed6a709bc367c041a8a8f8cb10c5d00d878 100644 (file)
@@ -136,7 +136,7 @@ bool torture_disconnect(struct torture_context *torture)
 
        mem_ctx = talloc_init("torture_raw_mux");
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, torture, 0)) {
                return false;
        }
 
@@ -146,12 +146,12 @@ bool torture_disconnect(struct torture_context *torture)
 
        for (i=0;i<torture_numops;i++) {
                ret &= test_disconnect_lock(cli, mem_ctx);
-               if (!torture_open_connection(&cli, 0)) {
+               if (!torture_open_connection(&cli, torture, 0)) {
                        return false;
                }
 
                ret &= test_disconnect_open(cli, mem_ctx);
-               if (!torture_open_connection(&cli, 0)) {
+               if (!torture_open_connection(&cli, torture, 0)) {
                        return false;
                }
 
index 46f74ee1b1050594bef57031c64e4be3abb6a6dc..e9a41e8299995da00ffec7acb8ce938d02610865 100644 (file)
@@ -194,7 +194,7 @@ bool torture_holdcon(struct torture_context *tctx)
        cli = malloc_array_p(struct smbcli_state *, torture_numops);
 
        for (i=0;i<torture_numops;i++) {
-               if (!torture_open_connection(&cli[i], i)) {
+               if (!torture_open_connection(&cli[i], tctx, i)) {
                        return false;
                }
                if (torture_setting_bool(tctx, "progress", true)) {
index dd596c9ee36177deff99a3a17c3e6cbc8a766b99..f97bb404c03f9a528f49f57726de72dba9b647b1 100644 (file)
@@ -515,7 +515,7 @@ bool torture_smb_scan(struct torture_context *torture)
        for (op=0x0;op<=0xFF;op++) {
                if (op == SMBreadbraw) continue;
 
-               if (!torture_open_connection(&cli, 0)) {
+               if (!torture_open_connection(&cli, torture, 0)) {
                        return false;
                }
 
index ddedd102f9fcd42d28508c7dc2f178f627bafcca..e9bd32cce05eb3549d858ad41c862a6011b60ebf 100644 (file)
@@ -39,14 +39,14 @@ static int read_only;
 static unsigned long nb_max_retries;
 
 #define NB_RETRY(op) \
-       for (n=0;n<=nb_max_retries && !op;n++) do_reconnect(&cli, client)
+       for (n=0;n<=nb_max_retries && !op;n++) do_reconnect(&cli, tctx, client)
 
-static void do_reconnect(struct smbcli_state **cli, int client)
+static void do_reconnect(struct smbcli_state **cli, struct torture_context *tctx, int client)
 {
        int n;
        printf("[%d] Reconnecting client %d\n", nbench_line_count, client);
        for (n=0;n<nb_max_retries;n++) {
-               if (nb_reconnect(cli, client)) {
+               if (nb_reconnect(cli, tctx, client)) {
                        printf("[%d] Reconnected client %d\n", nbench_line_count, client);
                        return;
                }
@@ -244,7 +244,7 @@ bool torture_nbench(struct torture_context *torture)
        }
 
        if (torture_nprocs > 1) {
-               if (!torture_open_connection(&cli, 0)) {
+               if (!torture_open_connection(&cli, torture, 0)) {
                        return false;
                }
 
index 5de903ff78903de0ab32e9ec1e900a99c13ce578..2664d3e7f52d04e9590e7e26071a638aaaed8f06 100644 (file)
@@ -157,7 +157,7 @@ static bool nb_reopen_all_files(void)
        return true;
 }
 
-bool nb_reconnect(struct smbcli_state **cli, int client)
+bool nb_reconnect(struct smbcli_state **cli, struct torture_context *tctx, int client)
 {
        children[client].connected = false;
 
@@ -165,7 +165,7 @@ bool nb_reconnect(struct smbcli_state **cli, int client)
                talloc_free(*cli);
        }
 
-       if (!torture_open_connection(cli, client)) {
+       if (!torture_open_connection(cli, tctx, client)) {
                printf("nb_reconnect: failed to connect\n");
                *cli = NULL;
                return false;
index 92895772694bab89458946abec0f9b108e1bfbaf..6c07a2747f8dab88eaee01035f154bb8db2821bb 100644 (file)
@@ -536,7 +536,7 @@ bool torture_rap_basic(struct torture_context *torture)
        bool ret = true;
        TALLOC_CTX *mem_ctx;
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, torture, 0)) {
                return false;
        }
 
@@ -560,7 +560,7 @@ bool torture_rap_scan(struct torture_context *torture)
 
        mem_ctx = talloc_init("torture_rap_scan");
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, torture, 0)) {
                return false;
        }
        
index 53449a1505b675ac5a1fbcd86c11d32b234e8df6..bc4473b17a34da01ff7325c0d9ed2e89f1a05361 100644 (file)
@@ -469,7 +469,7 @@ bool torture_max_eas(struct torture_context *torture)
        struct smbcli_state *cli;
        bool ret = true;
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, torture, 0)) {
                return false;
        }
 
index 633264ce0a8f1a347042dc2d852bb491433c11c2..81016fc563f5abf154bf37590fb646512f3a3daa 100644 (file)
@@ -42,6 +42,7 @@ static int num_connected;
 enum lock_stage {LOCK_INITIAL, LOCK_LOCK, LOCK_UNLOCK};
 
 struct benchlock_state {
+       struct torture_context *tctx;
        struct event_context *ev;
        struct smbcli_tree *tree;
        TALLOC_CTX *mem_ctx;
@@ -178,7 +179,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
 
        state->te = NULL;
 
-       if (!torture_get_conn_index(state->client_num, state->mem_ctx, &host, &share)) {
+       if (!torture_get_conn_index(state->client_num, state->mem_ctx, state->tctx, &host, &share)) {
                DEBUG(0,("Can't find host/share for reconnect?!\n"));
                exit(1);
        }
@@ -324,10 +325,11 @@ bool torture_bench_lock(struct torture_context *torture)
 
        printf("Opening %d connections\n", nprocs);
        for (i=0;i<nprocs;i++) {
+               state[i].tctx = torture;
                state[i].mem_ctx = talloc_new(state);
                state[i].client_num = i;
                state[i].ev = ev;
-               if (!torture_open_connection_ev(&cli, i, ev)) {
+               if (!torture_open_connection_ev(&cli, i, torture, ev)) {
                        return false;
                }
                talloc_steal(mem_ctx, state);
index 8687e8e952d3d230907d4785cece05f41ae36ce2..2967abdbe3cca1acfb2e5414d2d960103a5bfb4c 100644 (file)
@@ -836,7 +836,7 @@ done:
 /*
   basic testing of change notifies followed by a tdis
 */
-static bool test_notify_tdis(TALLOC_CTX *mem_ctx)
+static bool test_notify_tdis(struct torture_context *tctx)
 {
        bool ret = true;
        NTSTATUS status;
@@ -848,7 +848,7 @@ static bool test_notify_tdis(TALLOC_CTX *mem_ctx)
 
        printf("TESTING CHANGE NOTIFY FOLLOWED BY TDIS\n");
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, tctx, 0)) {
                return false;
        }
 
@@ -868,7 +868,7 @@ static bool test_notify_tdis(TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = BASEDIR;
 
-       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       status = smb_raw_open(cli->tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum = io.ntcreatex.out.file.fnum;
 
@@ -886,7 +886,7 @@ static bool test_notify_tdis(TALLOC_CTX *mem_ctx)
        CHECK_STATUS(status, NT_STATUS_OK);
        cli->tree = NULL;
 
-       status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
+       status = smb_raw_changenotify_recv(req, tctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VAL(notify.nttrans.out.num_changes, 0);
 
@@ -898,7 +898,7 @@ done:
 /*
   basic testing of change notifies followed by a exit
 */
-static bool test_notify_exit(TALLOC_CTX *mem_ctx)
+static bool test_notify_exit(struct torture_context *tctx)
 {
        bool ret = true;
        NTSTATUS status;
@@ -910,7 +910,7 @@ static bool test_notify_exit(TALLOC_CTX *mem_ctx)
 
        printf("TESTING CHANGE NOTIFY FOLLOWED BY EXIT\n");
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, tctx, 0)) {
                return false;
        }
 
@@ -930,7 +930,7 @@ static bool test_notify_exit(TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = BASEDIR;
 
-       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       status = smb_raw_open(cli->tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum = io.ntcreatex.out.file.fnum;
 
@@ -947,7 +947,7 @@ static bool test_notify_exit(TALLOC_CTX *mem_ctx)
        status = smb_raw_exit(cli->session);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
+       status = smb_raw_changenotify_recv(req, tctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VAL(notify.nttrans.out.num_changes, 0);
 
@@ -959,7 +959,7 @@ done:
 /*
   basic testing of change notifies followed by a ulogoff
 */
-static bool test_notify_ulogoff(TALLOC_CTX *mem_ctx)
+static bool test_notify_ulogoff(struct torture_context *tctx)
 {
        bool ret = true;
        NTSTATUS status;
@@ -971,7 +971,7 @@ static bool test_notify_ulogoff(TALLOC_CTX *mem_ctx)
 
        printf("TESTING CHANGE NOTIFY FOLLOWED BY ULOGOFF\n");
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, tctx, 0)) {
                return false;
        }
 
@@ -991,7 +991,7 @@ static bool test_notify_ulogoff(TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = BASEDIR;
 
-       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       status = smb_raw_open(cli->tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum = io.ntcreatex.out.file.fnum;
 
@@ -1008,7 +1008,7 @@ static bool test_notify_ulogoff(TALLOC_CTX *mem_ctx)
        status = smb_raw_ulogoff(cli->session);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
+       status = smb_raw_changenotify_recv(req, tctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VAL(notify.nttrans.out.num_changes, 0);
 
@@ -1027,7 +1027,7 @@ static void tcp_dis_handler(struct smbcli_transport *t, void *p)
 /*
   basic testing of change notifies followed by tcp disconnect
 */
-static bool test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
+static bool test_notify_tcp_dis(struct torture_context *tctx)
 {
        bool ret = true;
        NTSTATUS status;
@@ -1039,7 +1039,7 @@ static bool test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
 
        printf("TESTING CHANGE NOTIFY FOLLOWED BY TCP DISCONNECT\n");
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, tctx, 0)) {
                return false;
        }
 
@@ -1059,7 +1059,7 @@ static bool test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = BASEDIR;
 
-       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       status = smb_raw_open(cli->tree, tctx, &io);
        CHECK_STATUS(status, NT_STATUS_OK);
        fnum = io.ntcreatex.out.file.fnum;
 
@@ -1075,7 +1075,7 @@ static bool test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
 
        smbcli_transport_idle_handler(cli->transport, tcp_dis_handler, 250, cli);
 
-       status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
+       status = smb_raw_changenotify_recv(req, tctx, &notify);
        CHECK_STATUS(status, NT_STATUS_LOCAL_DISCONNECT);
 
 done:
index fb81f7d55c27871568676b86927a6de2aca37414..47f32b619b0fbfc977c5906afb7f387536e2b69c 100644 (file)
@@ -1363,7 +1363,7 @@ static bool test_raw_open_multi(struct torture_context *tctx)
                return false;
        }
 
-       if (!torture_open_connection_share(mem_ctx, &cli, host, share, ev)) {
+       if (!torture_open_connection_share(mem_ctx, &cli, tctx, host, share, ev)) {
                return false;
        }
 
@@ -1371,7 +1371,7 @@ static bool test_raw_open_multi(struct torture_context *tctx)
 
        for (i=0; i<num_files; i++) {
                if (!torture_open_connection_share(mem_ctx, &(clients[i]),
-                                                  host, share, ev)) {
+                                                  tctx, host, share, ev)) {
                        DEBUG(0, ("Could not open %d'th connection\n", i));
                        return false;
                }
index a53efb3a8b4ed9e862590b4b0fab96c9cca01cb6..3eec9fbb134af257bc7a75576f55b8cb026e25db 100644 (file)
@@ -42,6 +42,7 @@ static int num_connected;
 static struct timed_event *report_te;
 
 struct benchopen_state {
+       struct torture_context *tctx;
        TALLOC_CTX *mem_ctx;
        struct event_context *ev;
        struct smbcli_state *cli;
@@ -116,7 +117,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
 
        state->te = NULL;
 
-       if (!torture_get_conn_index(state->client_num, state->mem_ctx, &host, &share)) {
+       if (!torture_get_conn_index(state->client_num, state->mem_ctx, state->tctx, &host, &share)) {
                DEBUG(0,("Can't find host/share for reconnect?!\n"));
                exit(1);
        }
@@ -358,10 +359,11 @@ bool torture_bench_open(struct torture_context *torture)
 
        printf("Opening %d connections\n", nprocs);
        for (i=0;i<nprocs;i++) {
+               state[i].tctx = torture;
                state[i].mem_ctx = talloc_new(state);
                state[i].client_num = i;
                state[i].ev = ev;
-               if (!torture_open_connection_ev(&state[i].cli, i, ev)) {
+               if (!torture_open_connection_ev(&state[i].cli, i, torture, ev)) {
                        return false;
                }
                talloc_steal(mem_ctx, state);
index e642c1846c0e0ad5a9362006e81a0ed0608538af..952088e46c8bdbe28134dfad13daf7ad2f496f5d 100644 (file)
@@ -1325,7 +1325,7 @@ bool torture_bench_oplock(struct torture_context *torture)
 
        torture_comment(torture, "Opening %d connections\n", torture_nprocs);
        for (i=0;i<torture_nprocs;i++) {
-               if (!torture_open_connection_ev(&cli[i], i, ev)) {
+               if (!torture_open_connection_ev(&cli[i], i, torture, ev)) {
                        return false;
                }
                talloc_steal(mem_ctx, cli[i]);
index 3174021f7b867621929a7a0d31b950431f99d268..ca56f190a9347cc1a1b1d2ab5e0640cb87f57800 100755 (executable)
@@ -207,7 +207,7 @@ bool torture_ping_pong(struct torture_context *torture)
        do_writes    = torture_setting_bool(torture, "write", false);
        lock_timeout =  torture_setting_int(torture, "lock_timeout", 100000);
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, torture, 0)) {
                DEBUG(0,("Could not open connection\n"));
                return false;
        }
index 8fe3aa4d2d98f704b00c4d39cc82ea81bea8b48a..814b5f57f43bdebf1812e297d22299f2b5c1a775 100644 (file)
@@ -135,7 +135,7 @@ bool torture_samba3_hide(struct torture_context *torture)
        struct smbcli_tree *hideunwrite;
 
        if (!torture_open_connection_share(
-                   torture, &cli, torture_setting_string(torture, "host", NULL),
+                   torture, &cli, torture, torture_setting_string(torture, "host", NULL),
                    torture_setting_string(torture, "share", NULL), NULL)) {
                d_printf("torture_open_connection_share failed\n");
                return false;
@@ -283,7 +283,7 @@ bool torture_samba3_closeerr(struct torture_context *tctx)
        const char *fname = "closeerr.dir\\closerr.txt";
        int fnum;
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, tctx, 0)) {
                goto fail;
        }
 
index a075277efb5c0d98831848a92b2d2199c638456e..749b10cc074336f39aced9259cbf07418d1de431 100644 (file)
@@ -54,7 +54,7 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
        }
 
        if (!torture_open_connection_share(
-                   torture, &cli, torture_setting_string(torture, "host", NULL),
+                   torture, &cli, torture, torture_setting_string(torture, "host", NULL),
                    torture_setting_string(torture, "share", NULL), NULL)) {
                d_printf("torture_open_connection_share failed\n");
                ret = false;
@@ -351,7 +351,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
                goto fail;
        }
 
-       if (!torture_open_connection(&cli_nt, 0)) {
+       if (!torture_open_connection(&cli_nt, torture, 0)) {
                goto fail;
        }
 
@@ -360,7 +360,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
                goto fail;
        }
 
-       if (!torture_open_connection(&cli_dos, 1)) {
+       if (!torture_open_connection(&cli_dos, torture, 1)) {
                goto fail;
        }
 
@@ -626,7 +626,7 @@ bool torture_samba3_caseinsensitive(struct torture_context *torture)
                return false;
        }
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, torture, 0)) {
                goto done;
        }
 
@@ -692,7 +692,7 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
        struct smb_lock_entry lock_entry;
        struct smbcli_request *req;
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, tctx, 0)) {
                ret = false;
                goto done;
        }
@@ -827,7 +827,7 @@ bool torture_samba3_rootdirfid(struct torture_context *tctx)
        const char *fname = "testfile";
        bool ret = false;
 
-       if (!torture_open_connection(&cli, 0)) {
+       if (!torture_open_connection(&cli, tctx, 0)) {
                ret = false;
                goto done;
        }
index 2c68872a55dc894096723b4f62cfd3b72f905103..e169876b2b382b9b5b06e353aec1d7406aa951e3 100644 (file)
@@ -115,13 +115,14 @@ static bool test_NetShareDel(TALLOC_CTX *mem_ctx,
 
 static bool test_CreateDir(TALLOC_CTX *mem_ctx,
                           struct smbcli_state **cli,
+                          struct torture_context *tctx,
                           const char *host,
                           const char *share,
                           const char *dir)
 {
        printf("Creating directory %s\n", dir);
 
-       if (!torture_open_connection_share(mem_ctx, cli, host, share, NULL)) {
+       if (!torture_open_connection_share(mem_ctx, cli, tctx, host, share, NULL)) {
                return false;
        }
 
@@ -480,6 +481,7 @@ static bool test_AddStdRootForced(struct dcerpc_pipe *p,
 
 static void test_cleanup_stdroot(struct dcerpc_pipe *p,
                                 TALLOC_CTX *mem_ctx,
+                                struct torture_context *tctx,
                                 const char *host,
                                 const char *sharename,
                                 const char *dir)
@@ -490,13 +492,14 @@ static void test_cleanup_stdroot(struct dcerpc_pipe *p,
 
        test_RemoveStdRoot(p, mem_ctx, host, sharename);
        test_NetShareDel(mem_ctx, host, sharename);
-       torture_open_connection_share(mem_ctx, &cli, host, "C$", NULL);
+       torture_open_connection_share(mem_ctx, &cli, tctx, host, "C$", NULL);
        test_DeleteDir(cli, dir);
        torture_close_connection(cli);
 }
 
 static bool test_StdRoot(struct dcerpc_pipe *p,
                         TALLOC_CTX *mem_ctx,
+                        struct torture_context *tctx,
                         const char *host)
 {
        const char *sharename = SMBTORTURE_DFS_SHARENAME;
@@ -507,9 +510,9 @@ static bool test_StdRoot(struct dcerpc_pipe *p,
 
        printf("Testing StdRoot\n");
 
-       test_cleanup_stdroot(p, mem_ctx, host, sharename, dir);
+       test_cleanup_stdroot(p, mem_ctx, tctx, host, sharename, dir);
 
-       ret &= test_CreateDir(mem_ctx, &cli, host, "C$", dir);
+       ret &= test_CreateDir(mem_ctx, &cli, tctx, host, "C$", dir);
        ret &= test_NetShareAdd(mem_ctx, host, sharename, path);
        ret &= test_AddStdRoot(p, mem_ctx, host, sharename);
        ret &= test_RemoveStdRoot(p, mem_ctx, host, sharename);
@@ -652,7 +655,7 @@ bool torture_rpc_dfs(struct torture_context *torture)
        ret &= test_ManagerInitialize(p, torture, host);
        ret &= test_Enum(p, torture);
        ret &= test_EnumEx(p, torture, host);
-       ret &= test_StdRoot(p, torture, host);
+       ret &= test_StdRoot(p, torture, torture, host);
        ret &= test_FtRoot(p, torture, host);
        ret &= test_DcAddress(p, torture, host);
 
index 941c7b4f748febec55b46556a3d5eb409bde3ffb..522b821b915b0b77efca33a4562fe565017b2cc7 100644 (file)
@@ -1840,7 +1840,7 @@ bool torture_samba3_rpc_srvsvc(struct torture_context *torture)
        }
 
        if (!(torture_open_connection_share(
-                     mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
+                     mem_ctx, &cli, torture, torture_setting_string(torture, "host", NULL),
                      "IPC$", NULL))) {
                talloc_free(mem_ctx);
                return false;
@@ -1902,7 +1902,7 @@ bool torture_samba3_rpc_randomauth2(struct torture_context *torture)
 
        if (!(torture_open_connection_share(
                      mem_ctx, &cli,
-                     torture_setting_string(torture, "host", NULL),
+                     torture, torture_setting_string(torture, "host", NULL),
                      "IPC$", NULL))) {
                d_printf("IPC$ connection failed\n");
                goto done;
@@ -2193,7 +2193,7 @@ bool torture_samba3_rpc_sharesec(struct torture_context *torture)
        }
 
        if (!(torture_open_connection_share(
-                     mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
+                     mem_ctx, &cli, torture, torture_setting_string(torture, "host", NULL),
                      "IPC$", NULL))) {
                d_printf("IPC$ connection failed\n");
                talloc_free(mem_ctx);
@@ -2241,7 +2241,7 @@ bool torture_samba3_rpc_lsa(struct torture_context *torture)
        }
 
        if (!(torture_open_connection_share(
-                     mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
+                     mem_ctx, &cli, torture, torture_setting_string(torture, "host", NULL),
                      "IPC$", NULL))) {
                d_printf("IPC$ connection failed\n");
                talloc_free(mem_ctx);
@@ -2519,7 +2519,7 @@ bool torture_samba3_rpc_spoolss(struct torture_context *torture)
        }
 
        if (!(torture_open_connection_share(
-                     mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
+                     mem_ctx, &cli, torture, torture_setting_string(torture, "host", NULL),
                      "IPC$", NULL))) {
                d_printf("IPC$ connection failed\n");
                talloc_free(mem_ctx);
@@ -2705,7 +2705,7 @@ bool torture_samba3_rpc_wkssvc(struct torture_context *torture)
        }
 
        if (!(torture_open_connection_share(
-                     mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
+                     mem_ctx, &cli, torture, torture_setting_string(torture, "host", NULL),
                      "IPC$", NULL))) {
                d_printf("IPC$ connection failed\n");
                talloc_free(mem_ctx);
@@ -3255,7 +3255,7 @@ bool torture_samba3_regconfig(struct torture_context *torture)
        bool ret = false;
        const char *comment = "Dummer Kommentar";
 
-       if (!(torture_open_connection(&cli, 0))) {
+       if (!(torture_open_connection(&cli, torture, 0))) {
                return false;
        }
 
index 965b5543b0d8fb203c1b21d4727481a2f79e093d..6e6acf220f29fbb2925e75cced729f247f274a74 100644 (file)
@@ -465,6 +465,7 @@ NTSTATUS torture_check_ea(struct smbcli_state *cli,
 
 _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
                                   struct smbcli_state **c, 
+                                  struct torture_context *tctx,
                                   const char *hostname, 
                                   const char *sharename,
                                   struct event_context *ev)
@@ -479,26 +480,25 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
                return 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);
+       (*c)->transport->options.use_oplocks = torture_setting_bool(tctx, "use_oplocks", false);
+       (*c)->transport->options.use_level2_oplocks = torture_setting_bool(tctx, "use_level2_oplocks", false);
 
        return true;
 }
 
 _PUBLIC_ bool torture_get_conn_index(int conn_index,
                                     TALLOC_CTX *mem_ctx,
+                                    struct torture_context *tctx,
                                     char **host, char **share)
 {
        char **unc_list = NULL;
        int num_unc_names = 0;
        const char *p;
 
-       (*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"));
+       (*host) = talloc_strdup(mem_ctx, torture_setting_string(tctx, "host", NULL));
+       (*share) = talloc_strdup(mem_ctx, torture_setting_string(tctx, "share", NULL));
        
-       p = lp_parm_string(global_loadparm, NULL, "torture", "unclist");
+       p = torture_setting_string(tctx, "unclist", NULL);
        if (!p) {
                return true;
        }
@@ -524,25 +524,26 @@ _PUBLIC_ bool torture_get_conn_index(int conn_index,
 
 _PUBLIC_ bool torture_open_connection_ev(struct smbcli_state **c,
                                         int conn_index,
+                                        struct torture_context *tctx,
                                         struct event_context *ev)
 {
        char *host, *share;
        bool ret;
 
-       if (!torture_get_conn_index(conn_index, ev, &host, &share)) {
+       if (!torture_get_conn_index(conn_index, ev, tctx, &host, &share)) {
                return false;
        }
 
-       ret = torture_open_connection_share(NULL, c, host, share, ev);
+       ret = torture_open_connection_share(NULL, c, tctx, host, share, ev);
        talloc_free(host);
        talloc_free(share);
 
        return ret;
 }
 
-_PUBLIC_ bool torture_open_connection(struct smbcli_state **c, int conn_index)
+_PUBLIC_ bool torture_open_connection(struct smbcli_state **c, struct torture_context *tctx, int conn_index)
 {
-       return torture_open_connection_ev(c, conn_index, 
+       return torture_open_connection_ev(c, conn_index, tctx,
                                          cli_credentials_get_event_context(cmdline_credentials));
 }
 
@@ -648,7 +649,7 @@ double torture_create_procs(struct torture_context *tctx,
 
 
                        while (1) {
-                               if (torture_open_connection(&current_cli, i)) {
+                               if (torture_open_connection(&current_cli, tctx, i)) {
                                        break;
                                }
                                if (tries-- == 0) {
@@ -766,8 +767,8 @@ static bool wrap_simple_2smb_test(struct torture_context *torture_ctx,
 
        struct smbcli_state *cli1, *cli2;
 
-       if (!torture_open_connection(&cli1, 0) || 
-               !torture_open_connection(&cli2, 1))
+       if (!torture_open_connection(&cli1, torture_ctx, 0) || 
+               !torture_open_connection(&cli2, torture_ctx, 1))
                return false;
 
        fn = test->fn;
@@ -817,7 +818,7 @@ static bool wrap_simple_1smb_test(struct torture_context *torture_ctx,
 
        struct smbcli_state *cli1;
 
-       if (!torture_open_connection(&cli1, 0))
+       if (!torture_open_connection(&cli1, torture_ctx, 0))
                return false;
 
        fn = test->fn;
index 72c99c112645380f770540e39cd5469e0c23de68..8b767c8436a43200b3d526bf0e1ed204023e1177 100644 (file)
@@ -126,10 +126,10 @@ static void mux_printf(unsigned int mux_id, const char *format, ...)
    form DOMAIN/user into a domain and a user */
 
 static bool parse_ntlm_auth_domain_user(const char *domuser, fstring domain, 
-                                       fstring user)
+                                       fstring user, char winbind_separator)
 {
 
-       char *p = strchr(domuser, *lp_winbind_separator(global_loadparm));
+       char *p = strchr(domuser, winbind_separator);
 
        if (!p) {
                return false;
@@ -470,7 +470,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
                        if (!ev) {
                                exit(1);
                        }
-                       msg = messaging_client_init(state, lp_messaging_path(state, global_loadparm), ev);
+                       msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx), ev);
                        if (!msg) {
                                exit(1);
                        }
@@ -483,7 +483,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
                }
 
                creds = cli_credentials_init(state->gensec_state);
-               cli_credentials_set_conf(creds, global_loadparm);
+               cli_credentials_set_conf(creds, lp_ctx);
                if (opt_username) {
                        cli_credentials_set_username(creds, opt_username, CRED_SPECIFIED);
                }
@@ -668,7 +668,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
                        reply_code = "AF";
                        reply_arg = talloc_asprintf(state->gensec_state, 
                                                    "%s%s%s", session_info->server_info->domain_name, 
-                                                   lp_winbind_separator(global_loadparm), session_info->server_info->account_name);
+                                                   lp_winbind_separator(lp_ctx), session_info->server_info->account_name);
                        talloc_free(session_info);
                }
        } else if (state->gensec_state->gensec_role == GENSEC_CLIENT) {
@@ -744,7 +744,8 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod
                                fstring fstr_user;
                                fstring fstr_domain;
                                
-                               if (!parse_ntlm_auth_domain_user(full_username, fstr_user, fstr_domain)) {
+                               if (!parse_ntlm_auth_domain_user(full_username, fstr_user, fstr_domain, 
+                                                                *lp_winbind_separator(lp_ctx))) {
                                        /* username might be 'tainted', don't print into our new-line deleimianted stream */
                                        mux_printf(mux_id, "Error: Could not parse into domain and username\n");
                                }