From 8b06312f7eeff5ea8625677478792888774bd2be Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 24 Oct 2008 13:13:27 +0200 Subject: Eliminate another instance of global_loadparm. --- source4/torture/basic/base.c | 3 ++- source4/torture/basic/misc.c | 1 + source4/torture/gentest.c | 3 ++- source4/torture/locktest.c | 3 ++- source4/torture/masktest.c | 9 ++++++--- source4/torture/raw/composite.c | 2 ++ source4/torture/raw/lockbench.c | 1 + source4/torture/raw/oplock.c | 3 ++- source4/torture/raw/tconrate.c | 3 ++- source4/torture/rpc/join.c | 6 ++++-- source4/torture/rpc/samba3rpc.c | 18 ++++++++++++------ source4/torture/unix/unix_info2.c | 3 ++- source4/torture/unix/whoami.c | 3 ++- source4/torture/util_smb.c | 3 ++- 14 files changed, 42 insertions(+), 19 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index 2ab3f9ca91..f2b7b9b225 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -56,7 +56,8 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx) lp_smbcli_options(tctx->lp_ctx, &options); if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), tctx->ev, - lp_resolve_context(tctx->lp_ctx), &options)) { + lp_resolve_context(tctx->lp_ctx), &options, + lp_iconv_convenience(tctx->lp_ctx))) { torture_comment(tctx, "Failed to connect with %s\n", host); goto failed; } diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c index 3a09fa74b5..89e7169883 100644 --- a/source4/torture/basic/misc.c +++ b/source4/torture/basic/misc.c @@ -821,6 +821,7 @@ static struct composite_context *torture_connect_async( smb->in.service_type=NULL; smb->in.credentials=cmdline_credentials; smb->in.fallback_to_anonymous=false; + smb->in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx); smb->in.workgroup=workgroup; lp_smbcli_options(tctx->lp_ctx, &smb->in.options); lp_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options); diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index 74ece99422..aefed23f51 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -241,7 +241,8 @@ static bool connect_servers(struct event_context *ev, servers[i].credentials, lp_resolve_context(lp_ctx), ev, &smb_options, - &smb_session_options); + &smb_session_options, + lp_iconv_convenience(lp_ctx)); } if (!NT_STATUS_IS_OK(status)) { printf("Failed to connect to \\\\%s\\%s - %s\n", diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index 710aa8007a..819fbe072b 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -166,7 +166,8 @@ static struct smbcli_state *connect_one(struct event_context *ev, share, NULL, servers[snum], lp_resolve_context(lp_ctx), - ev, &options, &session_options); + ev, &options, &session_options, + lp_iconv_convenience(lp_ctx)); if (!NT_STATUS_IS_OK(status)) { sleep(2); } diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c index 6e9ae89336..14d597666e 100644 --- a/source4/torture/masktest.c +++ b/source4/torture/masktest.c @@ -77,7 +77,8 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx, TALLOC_CTX *mem_ctx, char *share, const char **ports, struct smbcli_options *options, - struct smbcli_session_options *session_options) + struct smbcli_session_options *session_options, + struct smb_iconv_convenience *iconv_convenience) { struct smbcli_state *c; char *server; @@ -96,7 +97,8 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx, ports, share, NULL, cmdline_credentials, resolve_ctx, ev, - options, session_options); + options, session_options, + iconv_convenience); if (!NT_STATUS_IS_OK(status)) { return NULL; @@ -366,7 +368,8 @@ static void usage(poptContext pc) lp_smbcli_session_options(lp_ctx, &session_options); cli = connect_one(lp_resolve_context(lp_ctx), ev, mem_ctx, share, - lp_smb_ports(lp_ctx), &options, &session_options); + lp_smb_ports(lp_ctx), &options, &session_options, + lp_iconv_convenience(lp_ctx)); if (!cli) { DEBUG(0,("Failed to connect to %s\n", share)); exit(1); diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 7f1f5943e1..16de4308bb 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -163,6 +163,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct io2.in.workgroup = lp_workgroup(tctx->lp_ctx); io2.in.filename = fname; io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx); + io2.in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx); lp_smbcli_options(tctx->lp_ctx, &io2.in.options); lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options); @@ -352,6 +353,7 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx) io1.in.credentials = cmdline_credentials; io1.in.workgroup = lp_workgroup(tctx->lp_ctx); io1.in.level = RAW_QFS_OBJECTID_INFORMATION; + io1.in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx); printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops); diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c index 26fad4235e..a6dce8a926 100644 --- a/source4/torture/raw/lockbench.c +++ b/source4/torture/raw/lockbench.c @@ -194,6 +194,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te, io->in.credentials = cmdline_credentials; io->in.fallback_to_anonymous = false; io->in.workgroup = lp_workgroup(state->tctx->lp_ctx); + io->in.iconv_convenience = lp_iconv_convenience(state->tctx->lp_ctx); lp_smbcli_options(state->tctx->lp_ctx, &io->in.options); lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options); diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index 19924e731b..46b41e51a0 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -189,7 +189,8 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx, torture_setting_string(tctx, "share", NULL), NULL, cmdline_credentials, lp_resolve_context(tctx->lp_ctx), - tctx->ev, &options, &session_options); + tctx->ev, &options, &session_options, + lp_iconv_convenience(tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("Failed to open connection - %s\n", nt_errstr(status)); return false; diff --git a/source4/torture/raw/tconrate.c b/source4/torture/raw/tconrate.c index 66ef2ae2dd..9e75301828 100644 --- a/source4/torture/raw/tconrate.c +++ b/source4/torture/raw/tconrate.c @@ -102,7 +102,8 @@ static int fork_tcon_client(struct torture_context *tctx, host, lp_smb_ports(tctx->lp_ctx), share, NULL, cmdline_credentials, lp_resolve_context(tctx->lp_ctx), - tctx->ev, &options, &session_options); + tctx->ev, &options, &session_options, + lp_iconv_convenience(tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c index ee0c05360f..a6bb53a759 100644 --- a/source4/torture/rpc/join.c +++ b/source4/torture/rpc/join.c @@ -41,7 +41,8 @@ bool torture_rpc_join(struct torture_context *torture) "IPC$", NULL, machine_account, lp_resolve_context(torture->lp_ctx), - torture->ev, &options, &session_options); + torture->ev, &options, &session_options, + lp_iconv_convenience(torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n", TORTURE_NETBIOS_NAME)); @@ -67,7 +68,8 @@ bool torture_rpc_join(struct torture_context *torture) "IPC$", NULL, machine_account, lp_resolve_context(torture->lp_ctx), - torture->ev, &options, &session_options); + torture->ev, &options, &session_options, + lp_iconv_convenience(torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n", TORTURE_NETBIOS_NAME)); diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 25ff7d0ea9..85714ace13 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -91,7 +91,8 @@ bool torture_bind_authcontext(struct torture_context *torture) lp_smb_ports(torture->lp_ctx), "IPC$", NULL, cmdline_credentials, lp_resolve_context(torture->lp_ctx), - torture->ev, &options, &session_options); + torture->ev, &options, &session_options, + lp_iconv_convenience(torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { d_printf("smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -307,7 +308,8 @@ bool torture_bind_samba3(struct torture_context *torture) lp_smb_ports(torture->lp_ctx), "IPC$", NULL, cmdline_credentials, lp_resolve_context(torture->lp_ctx), - torture->ev, &options, &session_options); + torture->ev, &options, &session_options, + lp_iconv_convenience(torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { d_printf("smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -1226,7 +1228,8 @@ bool torture_netlogon_samba3(struct torture_context *torture) lp_smb_ports(torture->lp_ctx), "IPC$", NULL, anon_creds, lp_resolve_context(torture->lp_ctx), - torture->ev, &options, &session_options); + torture->ev, &options, &session_options, + lp_iconv_convenience(torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { d_printf("smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -1315,7 +1318,8 @@ static bool test_join3(struct torture_context *tctx, lp_smb_ports(tctx->lp_ctx), "IPC$", NULL, smb_creds, lp_resolve_context(tctx->lp_ctx), - tctx->ev, &options, &session_options); + tctx->ev, &options, &session_options, + lp_iconv_convenience(tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { d_printf("smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -1692,7 +1696,8 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture) lp_smb_ports(torture->lp_ctx), "IPC$", NULL, cmdline_credentials, lp_resolve_context(torture->lp_ctx), - torture->ev, &options, &session_options); + torture->ev, &options, &session_options, + lp_iconv_convenience(torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { d_printf("(%s) smbcli_full_connection failed: %s\n", __location__, nt_errstr(status)); @@ -1719,7 +1724,8 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture) lp_smb_ports(torture->lp_ctx), "IPC$", NULL, anon_creds, lp_resolve_context(torture->lp_ctx), - torture->ev, &options, &session_options); + torture->ev, &options, &session_options, + lp_iconv_convenience(torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { d_printf("(%s) anon smbcli_full_connection failed: %s\n", __location__, nt_errstr(status)); diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 3bddde2a97..53909f645b 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -66,7 +66,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx) share, NULL, cmdline_credentials, lp_resolve_context(tctx->lp_ctx), - tctx->ev, &options, &session_options); + tctx->ev, &options, &session_options, + lp_iconv_convenience(tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index d742e23e82..d7fbe4a23d 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -86,7 +86,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx, lp_smb_ports(tctx->lp_ctx), share, NULL, creds, lp_resolve_context(tctx->lp_ctx), - tctx->ev, &options, &session_options); + tctx->ev, &options, &session_options, + lp_iconv_convenience(tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("failed to connect to //%s/%s: %s\n", diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c index 3d9c5e321d..b84938cf11 100644 --- a/source4/torture/util_smb.c +++ b/source4/torture/util_smb.c @@ -488,7 +488,8 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx, sharename, NULL, cmdline_credentials, lp_resolve_context(tctx->lp_ctx), - ev, &options, &session_options); + ev, &options, &session_options, + lp_iconv_convenience(tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("Failed to open connection - %s\n", nt_errstr(status)); return false; -- cgit