1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-05 12:22:11 +03:00

r26329: Fix more loadparm_context references. Only about a 100 left now.

(This used to be commit ddf233346d)
This commit is contained in:
Jelmer Vernooij
2007-12-07 03:01:41 +01:00
committed by Stefan Metzmacher
parent 6c77f353d3
commit bca631be1f
8 changed files with 22 additions and 16 deletions

View File

@ -129,7 +129,7 @@ static int load_proxy_info(struct ldb_module *module)
ldb_oom(module->ldb); ldb_oom(module->ldb);
goto failed; 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_username(creds, username, CRED_SPECIFIED);
cli_credentials_set_password(creds, password, CRED_SPECIFIED); cli_credentials_set_password(creds, password, CRED_SPECIFIED);

View File

@ -24,12 +24,13 @@
#include "lib/registry/tools/common.h" #include "lib/registry/tools/common.h"
struct registry_context *reg_common_open_remote(const char *remote, struct registry_context *reg_common_open_remote(const char *remote,
struct loadparm_context *lp_ctx,
struct cli_credentials *creds) struct cli_credentials *creds)
{ {
struct registry_context *h; struct registry_context *h;
WERROR error; 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)) { if (!W_ERROR_IS_OK(error)) {
fprintf(stderr, "Unable to open remote registry at %s:%s \n", fprintf(stderr, "Unable to open remote registry at %s:%s \n",

View File

@ -49,7 +49,7 @@ int main(int argc, char **argv)
} }
if (remote) { if (remote) {
h = reg_common_open_remote (remote, cmdline_credentials); h = reg_common_open_remote (remote, global_loadparm, cmdline_credentials);
} else { } else {
h = reg_common_open_local (cmdline_credentials, global_loadparm); h = reg_common_open_local (cmdline_credentials, global_loadparm);
} }

View File

@ -497,7 +497,7 @@ int main(int argc, char **argv)
ctx = talloc_zero(NULL, struct regshell_context); ctx = talloc_zero(NULL, struct regshell_context);
if (remote != NULL) { if (remote != NULL) {
ctx->registry = reg_common_open_remote(remote, ctx->registry = reg_common_open_remote(remote, global_loadparm,
cmdline_credentials); cmdline_credentials);
} else if (file != NULL) { } else if (file != NULL) {
ctx->current = reg_common_open_file(file, cmdline_credentials); ctx->current = reg_common_open_file(file, cmdline_credentials);

View File

@ -129,7 +129,7 @@ int main(int argc, char **argv)
} }
if (remote != NULL) { 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) { } else if (file != NULL) {
start_key = reg_common_open_file(file, cmdline_credentials); start_key = reg_common_open_file(file, cmdline_credentials);
} else { } else {

View 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 composite_context *dcerpc_schannel_key_send(TALLOC_CTX *mem_ctx,
struct dcerpc_pipe *p, struct dcerpc_pipe *p,
struct cli_credentials *credentials) struct cli_credentials *credentials,
struct loadparm_context *lp_ctx)
{ {
struct composite_context *c; struct composite_context *c;
struct schannel_key_state *s; 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 */ /* request the netlogon endpoint mapping */
epm_map_req = dcerpc_epm_map_binding_send(c, s->binding, epm_map_req = dcerpc_epm_map_binding_send(c, s->binding,
&ndr_table_netlogon, &ndr_table_netlogon,
s->pipe->conn->event_ctx); s->pipe->conn->event_ctx,
lp_ctx);
if (composite_nomem(epm_map_req, c)) return c; if (composite_nomem(epm_map_req, c)) return c;
composite_continue(c, epm_map_req, continue_epm_map_binding, 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; s->lp_ctx = lp_ctx;
/* start getting schannel key first */ /* 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; if (composite_nomem(schan_key_req, c)) return c;
composite_continue(c, schan_key_req, continue_schannel_key, c); composite_continue(c, schan_key_req, continue_schannel_key, c);

View 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]) char *share[NSERVERS])
{ {
int server, conn, f; int server, conn, f;
@ -184,7 +185,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], int fnum
} }
talloc_free(cli[server][conn]); 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); server, conn);
if (!cli[server][conn]) { if (!cli[server][conn]) {
DEBUG(0,("Failed to connect to %s\n", share[server])); 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 we then do random locking ops in tamdem on the 4 fnums from each
server and ensure that the results match 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]; struct smbcli_state *cli[NSERVERS][NCONNECTIONS];
int fnum[NSERVERS][NCONNECTIONS][NFILES]; int fnum[NSERVERS][NCONNECTIONS][NFILES];
@ -438,7 +439,7 @@ static void test_locks(char *share[NSERVERS])
#endif #endif
} }
reconnect(cli, fnum, share); reconnect(lp_ctx, cli, fnum, share);
open_files(cli, fnum); open_files(cli, fnum);
n = retest(cli, fnum, numops); n = retest(cli, fnum, numops);
@ -451,7 +452,7 @@ static void test_locks(char *share[NSERVERS])
n1 = n; n1 = n;
close_files(cli, fnum); close_files(cli, fnum);
reconnect(cli, fnum, share); reconnect(lp_ctx, cli, fnum, share);
open_files(cli, fnum); open_files(cli, fnum);
for (i=0;i<n-skip;i+=skip) { for (i=0;i<n-skip;i+=skip) {
@ -489,7 +490,7 @@ static void test_locks(char *share[NSERVERS])
} }
close_files(cli, fnum); close_files(cli, fnum);
reconnect(cli, fnum, share); reconnect(lp_ctx, cli, fnum, share);
open_files(cli, fnum); open_files(cli, fnum);
showall = true; showall = true;
n1 = retest(cli, fnum, n); n1 = retest(cli, fnum, n);
@ -649,7 +650,7 @@ static void usage(void)
seed, lock_base, lock_range, min_length)); seed, lock_base, lock_range, min_length));
srandom(seed); srandom(seed);
test_locks(share); test_locks(lp_ctx, share);
return(0); return(0);
} }

View File

@ -35,6 +35,7 @@ struct wins_state {
int pass_count; int pass_count;
int fail_count; int fail_count;
const char *wins_server; const char *wins_server;
uint16_t wins_port;
const char *my_ip; const char *my_ip;
uint32_t ttl; 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.name = generate_name(tmp_ctx, idx);
io.in.dest_addr = state->wins_server; 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.broadcast = false;
io.in.wins_lookup = true; io.in.wins_lookup = true;
io.in.timeout = 2; io.in.timeout = 2;
@ -241,6 +242,7 @@ static bool bench_wins(struct torture_context *tctx)
state->num_names = torture_entries; state->num_names = torture_entries;
state->registered = talloc_zero_array(state, bool, state->num_names); state->registered = talloc_zero_array(state, bool, state->num_names);
state->wins_server = address; 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->my_ip = talloc_strdup(tctx, iface_best_ip(tctx->lp_ctx, address));
state->ttl = timelimit; state->ttl = timelimit;