r26329: Fix more loadparm_context references. Only about a 100 left now.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 7 Dec 2007 02:01:41 +0000 (03:01 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:48:42 +0000 (05:48 +0100)
(This used to be commit ddf233346d848e91bc6a6a572f0f6120540503b7)

source4/dsdb/samdb/ldb_modules/proxy.c
source4/lib/registry/tools/common.c
source4/lib/registry/tools/regpatch.c
source4/lib/registry/tools/regshell.c
source4/lib/registry/tools/regtree.c
source4/librpc/rpc/dcerpc_schannel.c
source4/torture/locktest.c
source4/torture/nbt/winsbench.c

index 5f22982b8d292ecbdc678d259eeffa74980247a7..37ee7f9fce82cdb4b3ff21138c614f065e6dee22 100644 (file)
@@ -129,7 +129,7 @@ static int load_proxy_info(struct ldb_module *module)
                ldb_oom(module->ldb);
                goto failed;
        }
-       cli_credentials_guess(creds, global_loadparm);
+       cli_credentials_guess(creds, ldb_get_opaque(module->ldb, "loadparm"));
        cli_credentials_set_username(creds, username, CRED_SPECIFIED);
        cli_credentials_set_password(creds, password, CRED_SPECIFIED);
 
index 6d766fd25c41e41210f0b5d6f92f2431ec5ace35..c9293cd3102811f0202521763224401ca4d80b4d 100644 (file)
 #include "lib/registry/tools/common.h"
 
 struct registry_context *reg_common_open_remote(const char *remote,
+                                               struct loadparm_context *lp_ctx,
                                                struct cli_credentials *creds)
 {
        struct registry_context *h;
        WERROR error;
 
-       error = reg_open_remote(&h, NULL, creds, remote, NULL);
+       error = reg_open_remote(&h, NULL, creds, lp_ctx, remote, NULL);
 
        if (!W_ERROR_IS_OK(error)) {
                fprintf(stderr, "Unable to open remote registry at %s:%s \n",
index 2f2cf789a93641e36429f6c6f632477a5dc14bc2..441138832e4934d9110ca30a9bc4adf1b66491a6 100644 (file)
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
        }
 
        if (remote) {
-               h = reg_common_open_remote (remote, cmdline_credentials);
+               h = reg_common_open_remote (remote, global_loadparm, cmdline_credentials);
        } else {
                h = reg_common_open_local (cmdline_credentials, global_loadparm);
        }
index 9b582c3c024f0d4a8b1180b510664420a7d81321..7169d7c9f8bd5f55838d4bdcb1c42daf0132aeab 100644 (file)
@@ -497,7 +497,7 @@ int main(int argc, char **argv)
        ctx = talloc_zero(NULL, struct regshell_context);
 
        if (remote != NULL) {
-               ctx->registry = reg_common_open_remote(remote,
+               ctx->registry = reg_common_open_remote(remote, global_loadparm, 
                                                       cmdline_credentials);
        } else if (file != NULL) {
                ctx->current = reg_common_open_file(file, cmdline_credentials);
index f95fc1968df13d649bc1734b0790e62bc068276d..6c21f2cbad4cda995bcb9045755b8385f0af3b0e 100644 (file)
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
        }
 
        if (remote != NULL) {
-               h = reg_common_open_remote(remote, cmdline_credentials);
+               h = reg_common_open_remote(remote, global_loadparm, cmdline_credentials);
        } else if (file != NULL) {
                start_key = reg_common_open_file(file, cmdline_credentials);
        } else {
index fadf0add8cfeade9e0e4a43b71796647c30252b0..68e211afae735a5d6c149a93c624322b4f074858 100644 (file)
@@ -224,7 +224,8 @@ static void continue_srv_auth2(struct rpc_request *req)
 */
 struct composite_context *dcerpc_schannel_key_send(TALLOC_CTX *mem_ctx,
                                                   struct dcerpc_pipe *p,
-                                                  struct cli_credentials *credentials)
+                                                  struct cli_credentials *credentials,
+                                                  struct loadparm_context *lp_ctx)
 {
        struct composite_context *c;
        struct schannel_key_state *s;
@@ -262,7 +263,8 @@ struct composite_context *dcerpc_schannel_key_send(TALLOC_CTX *mem_ctx,
        /* request the netlogon endpoint mapping */
        epm_map_req = dcerpc_epm_map_binding_send(c, s->binding,
                                                  &ndr_table_netlogon,
-                                                 s->pipe->conn->event_ctx);
+                                                 s->pipe->conn->event_ctx,
+                                                 lp_ctx);
        if (composite_nomem(epm_map_req, c)) return c;
 
        composite_continue(c, epm_map_req, continue_epm_map_binding, c);
@@ -371,7 +373,7 @@ struct composite_context *dcerpc_bind_auth_schannel_send(TALLOC_CTX *tmp_ctx,
        s->lp_ctx      = lp_ctx;
 
        /* start getting schannel key first */
-       schan_key_req = dcerpc_schannel_key_send(c, p, credentials);
+       schan_key_req = dcerpc_schannel_key_send(c, p, credentials, lp_ctx);
        if (composite_nomem(schan_key_req, c)) return c;
 
        composite_continue(c, schan_key_req, continue_schannel_key, c);
index 2aa074c6c35d276129cd2d914a75baa79b698302..08050fc40a069bab9666ae83f852e7fa1d83ce73 100644 (file)
@@ -168,7 +168,8 @@ static struct smbcli_state *connect_one(struct loadparm_context *lp_ctx,
 }
 
 
-static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], int fnum[NSERVERS][NCONNECTIONS][NFILES],
+static void reconnect(struct loadparm_context *lp_ctx,
+                     struct smbcli_state *cli[NSERVERS][NCONNECTIONS], int fnum[NSERVERS][NCONNECTIONS][NFILES],
                      char *share[NSERVERS])
 {
        int server, conn, f;
@@ -184,7 +185,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], int fnum
                        }
                        talloc_free(cli[server][conn]);
                }
-               cli[server][conn] = connect_one(global_loadparm, share[server], 
+               cli[server][conn] = connect_one(lp_ctx, share[server], 
                                                server, conn);
                if (!cli[server][conn]) {
                        DEBUG(0,("Failed to connect to %s\n", share[server]));
@@ -387,7 +388,7 @@ static int retest(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
    we then do random locking ops in tamdem on the 4 fnums from each
    server and ensure that the results match
  */
-static void test_locks(char *share[NSERVERS])
+static void test_locks(struct loadparm_context *lp_ctx, char *share[NSERVERS])
 {
        struct smbcli_state *cli[NSERVERS][NCONNECTIONS];
        int fnum[NSERVERS][NCONNECTIONS][NFILES];
@@ -438,7 +439,7 @@ static void test_locks(char *share[NSERVERS])
 #endif
        }
 
-       reconnect(cli, fnum, share);
+       reconnect(lp_ctx, cli, fnum, share);
        open_files(cli, fnum);
        n = retest(cli, fnum, numops);
 
@@ -451,7 +452,7 @@ static void test_locks(char *share[NSERVERS])
                n1 = n;
 
                close_files(cli, fnum);
-               reconnect(cli, fnum, share);
+               reconnect(lp_ctx, cli, fnum, share);
                open_files(cli, fnum);
 
                for (i=0;i<n-skip;i+=skip) {
@@ -489,7 +490,7 @@ static void test_locks(char *share[NSERVERS])
        }
 
        close_files(cli, fnum);
-       reconnect(cli, fnum, share);
+       reconnect(lp_ctx, cli, fnum, share);
        open_files(cli, fnum);
        showall = true;
        n1 = retest(cli, fnum, n);
@@ -649,7 +650,7 @@ static void usage(void)
                 seed, lock_base, lock_range, min_length));
        srandom(seed);
 
-       test_locks(share);
+       test_locks(lp_ctx, share);
 
        return(0);
 }
index 1c79b5eb75899f081e8c60a7e7983df830641a73..82223d9dd7ac5f4c556e708272a687037287ea89 100644 (file)
@@ -35,6 +35,7 @@ struct wins_state {
        int pass_count;
        int fail_count;
        const char *wins_server;
+       uint16_t wins_port;
        const char *my_ip;
        uint32_t ttl;
 };
@@ -185,7 +186,7 @@ static void generate_query(struct nbt_name_socket *nbtsock, struct wins_state *s
 
        io.in.name            = generate_name(tmp_ctx, idx);
        io.in.dest_addr       = state->wins_server;
-       io.in.dest_port       = lp_nbt_port(global_loadparm);
+       io.in.dest_port       = state->wins_port;
        io.in.broadcast       = false;
        io.in.wins_lookup     = true;
        io.in.timeout         = 2;
@@ -241,6 +242,7 @@ static bool bench_wins(struct torture_context *tctx)
        state->num_names = torture_entries;
        state->registered = talloc_zero_array(state, bool, state->num_names);
        state->wins_server = address;
+       state->wins_port = lp_nbt_port(tctx->lp_ctx);
        state->my_ip = talloc_strdup(tctx, iface_best_ip(tctx->lp_ctx, address));
        state->ttl = timelimit;