From bca631be1f4cefeec3d64cd552ec6d9ee9cc1971 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Dec 2007 03:01:41 +0100 Subject: [PATCH] r26329: Fix more loadparm_context references. Only about a 100 left now. (This used to be commit ddf233346d848e91bc6a6a572f0f6120540503b7) --- source4/dsdb/samdb/ldb_modules/proxy.c | 2 +- source4/lib/registry/tools/common.c | 3 ++- source4/lib/registry/tools/regpatch.c | 2 +- source4/lib/registry/tools/regshell.c | 2 +- source4/lib/registry/tools/regtree.c | 2 +- source4/librpc/rpc/dcerpc_schannel.c | 8 +++++--- source4/torture/locktest.c | 15 ++++++++------- source4/torture/nbt/winsbench.c | 4 +++- 8 files changed, 22 insertions(+), 16 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/proxy.c b/source4/dsdb/samdb/ldb_modules/proxy.c index 5f22982b8d2..37ee7f9fce8 100644 --- a/source4/dsdb/samdb/ldb_modules/proxy.c +++ b/source4/dsdb/samdb/ldb_modules/proxy.c @@ -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); diff --git a/source4/lib/registry/tools/common.c b/source4/lib/registry/tools/common.c index 6d766fd25c4..c9293cd3102 100644 --- a/source4/lib/registry/tools/common.c +++ b/source4/lib/registry/tools/common.c @@ -24,12 +24,13 @@ #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", diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index 2f2cf789a93..441138832e4 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -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); } diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 9b582c3c024..7169d7c9f8b 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -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); diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index f95fc1968df..6c21f2cbad4 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -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 { diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c index fadf0add8cf..68e211afae7 100644 --- a/source4/librpc/rpc/dcerpc_schannel.c +++ b/source4/librpc/rpc/dcerpc_schannel.c @@ -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); diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index 2aa074c6c35..08050fc40a0 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -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;iwins_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; -- 2.34.1