summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/basic/charset.c3
-rw-r--r--source4/torture/basic/scanner.c13
-rw-r--r--source4/torture/basic/utable.c5
-rw-r--r--source4/torture/masktest.c2
-rw-r--r--source4/torture/rap/rap.c3
-rw-r--r--source4/torture/rpc/samba3rpc.c2
-rw-r--r--source4/torture/rpc/samlogon.c4
-rw-r--r--source4/torture/rpc/spoolss_win.c2
-rw-r--r--source4/torture/rpc/wkssvc.c2
-rw-r--r--source4/torture/smbtorture.c6
10 files changed, 22 insertions, 20 deletions
diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c
index 6b993aad8c..7dfbdebe7f 100644
--- a/source4/torture/basic/charset.c
+++ b/source4/torture/basic/charset.c
@@ -24,6 +24,7 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "torture/util.h"
+#include "param/param.h"
#define BASEDIR "\\chartest\\"
@@ -55,7 +56,7 @@ static NTSTATUS unicode_open(struct torture_context *tctx,
}
SSVAL(ucs_name, i*2, 0);
- i = convert_string_talloc(ucs_name, global_smb_iconv_convenience, CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname);
+ i = convert_string_talloc(ucs_name, lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname);
if (i == -1) {
torture_comment(tctx, "Failed to convert UCS2 Name into unix - convert_string_talloc() failure\n");
talloc_free(ucs_name);
diff --git a/source4/torture/basic/scanner.c b/source4/torture/basic/scanner.c
index 884be8490d..caccadb7eb 100644
--- a/source4/torture/basic/scanner.c
+++ b/source4/torture/basic/scanner.c
@@ -24,6 +24,7 @@
#include "libcli/raw/libcliraw.h"
#include "system/filesys.h"
#include "pstring.h"
+#include "param/param.h"
#define VERBOSE 0
#define OP_MIN 0
@@ -207,7 +208,7 @@ static bool scan_trans2(struct smbcli_state *cli, int op, int level,
SSVAL(param, 0, level);
SSVAL(param, 2, 0);
SSVAL(param, 4, 0);
- param_len += push_string(global_smb_iconv_convenience, &param[6], fname, sizeof(pstring)-7, STR_TERMINATE|STR_UNICODE);
+ param_len += push_string(lp_iconv_convenience(global_loadparm), &param[6], fname, sizeof(pstring)-7, STR_TERMINATE|STR_UNICODE);
status = try_trans2_len(cli, "fname", op, level, param, data, param_len, &data_len,
&rparam_len, &rdata_len);
@@ -218,7 +219,7 @@ static bool scan_trans2(struct smbcli_state *cli, int op, int level,
SSVAL(param, 0, level);
SSVAL(param, 2, 0);
SSVAL(param, 4, 0);
- param_len += push_string(global_smb_iconv_convenience, &param[6], "\\newfile.dat", sizeof(pstring)-7, STR_TERMINATE|STR_UNICODE);
+ param_len += push_string(lp_iconv_convenience(global_loadparm), &param[6], "\\newfile.dat", sizeof(pstring)-7, STR_TERMINATE|STR_UNICODE);
status = try_trans2_len(cli, "newfile", op, level, param, data, param_len, &data_len,
&rparam_len, &rdata_len);
@@ -230,7 +231,7 @@ static bool scan_trans2(struct smbcli_state *cli, int op, int level,
smbcli_mkdir(cli->tree, "\\testdir");
param_len = 2;
SSVAL(param, 0, level);
- param_len += push_string(global_smb_iconv_convenience, &param[2], "\\testdir", sizeof(pstring)-3, STR_TERMINATE|STR_UNICODE);
+ param_len += push_string(lp_iconv_convenience(global_loadparm), &param[2], "\\testdir", sizeof(pstring)-3, STR_TERMINATE|STR_UNICODE);
status = try_trans2_len(cli, "dfs", op, level, param, data, param_len, &data_len,
&rparam_len, &rdata_len);
@@ -439,7 +440,7 @@ static bool scan_nttrans(struct smbcli_state *cli, int op, int level,
SSVAL(param, 0, level);
SSVAL(param, 2, 0);
SSVAL(param, 4, 0);
- param_len += push_string(global_smb_iconv_convenience, &param[6], fname, sizeof(pstring), STR_TERMINATE | STR_UNICODE);
+ param_len += push_string(lp_iconv_convenience(global_loadparm), &param[6], fname, sizeof(pstring), STR_TERMINATE | STR_UNICODE);
status = try_nttrans_len(cli, "fname", op, level, param, data, param_len, &data_len,
&rparam_len, &rdata_len);
@@ -450,7 +451,7 @@ static bool scan_nttrans(struct smbcli_state *cli, int op, int level,
SSVAL(param, 0, level);
SSVAL(param, 2, 0);
SSVAL(param, 4, 0);
- param_len += push_string(global_smb_iconv_convenience, &param[6], "\\newfile.dat", sizeof(pstring), STR_TERMINATE | STR_UNICODE);
+ param_len += push_string(lp_iconv_convenience(global_loadparm), &param[6], "\\newfile.dat", sizeof(pstring), STR_TERMINATE | STR_UNICODE);
status = try_nttrans_len(cli, "newfile", op, level, param, data, param_len, &data_len,
&rparam_len, &rdata_len);
@@ -462,7 +463,7 @@ static bool scan_nttrans(struct smbcli_state *cli, int op, int level,
smbcli_mkdir(cli->tree, "\\testdir");
param_len = 2;
SSVAL(param, 0, level);
- param_len += push_string(global_smb_iconv_convenience, &param[2], "\\testdir", sizeof(pstring), STR_TERMINATE | STR_UNICODE);
+ param_len += push_string(lp_iconv_convenience(global_loadparm), &param[2], "\\testdir", sizeof(pstring), STR_TERMINATE | STR_UNICODE);
status = try_nttrans_len(cli, "dfs", op, level, param, data, param_len, &data_len,
&rparam_len, &rdata_len);
diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c
index 244378dbc9..51b7b39309 100644
--- a/source4/torture/basic/utable.c
+++ b/source4/torture/basic/utable.c
@@ -24,6 +24,7 @@
#include "libcli/libcli.h"
#include "torture/util.h"
#include "pstring.h"
+#include "param/param.h"
bool torture_utable(struct torture_context *tctx,
struct smbcli_state *cli)
@@ -49,7 +50,7 @@ bool torture_utable(struct torture_context *tctx,
SSVAL(c2, 0, c);
fstrcpy(fname, "\\utable\\x");
p = fname+strlen(fname);
- len = convert_string(global_smb_iconv_convenience, CH_UTF16, CH_UNIX,
+ len = convert_string(lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX,
c2, 2,
p, sizeof(fname)-strlen(fname));
p[len] = 0;
@@ -108,7 +109,7 @@ static char *form_name(int c)
p = fname+strlen(fname);
SSVAL(c2, 0, c);
- len = convert_string(global_smb_iconv_convenience, CH_UTF16, CH_UNIX,
+ len = convert_string(lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX,
c2, 2,
p, sizeof(fname)-strlen(fname));
p[len] = 0;
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index 4603fd05e4..3eb815fe28 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -310,8 +310,6 @@ static void usage(void)
seed = time(NULL);
- reload_charcnv();
-
while ((opt = getopt(argc, argv, "n:d:U:s:hm:f:aoW:M:vEl:")) != EOF) {
switch (opt) {
case 'n':
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index 7ef2555800..d39a83034d 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -26,6 +26,7 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/libcli.h"
#include "librpc/ndr/libndr.h"
+#include "param/param.h"
#define RAP_GOTO(call) do { \
NTSTATUS _status; \
@@ -182,7 +183,7 @@ static NTSTATUS rap_pull_string(TALLOC_CTX *mem_ctx, struct ndr_pull *ndr,
return NT_STATUS_INVALID_PARAMETER;
*dest = talloc_zero_array(mem_ctx, char, len+1);
- pull_string(global_smb_iconv_convenience, *dest, p, len+1, len, STR_ASCII);
+ pull_string(lp_iconv_convenience(global_loadparm), *dest, p, len+1, len, STR_ASCII);
return NT_STATUS_OK;
}
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 496453e181..a63772e964 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -2314,7 +2314,7 @@ static NTSTATUS get_servername(TALLOC_CTX *mem_ctx, struct smbcli_tree *tree,
memcpy(servername, r.out.info.info0.name, 16);
servername[16] = '\0';
- if (pull_ascii_talloc(mem_ctx, global_smb_iconv_convenience,
+ if (pull_ascii_talloc(mem_ctx, lp_iconv_convenience(global_loadparm),
name, servername) < 0) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index b60cef7d53..7fd5199908 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -1158,7 +1158,7 @@ static bool test_plaintext(struct samlogon_state *samlogon_state, enum ntlm_brea
ZERO_STRUCT(user_session_key);
if ((push_ucs2_talloc(samlogon_state->mem_ctx,
- global_smb_iconv_convenience,
+ lp_iconv_convenience(global_loadparm),
&unicodepw, samlogon_state->password)) == -1) {
DEBUG(0, ("push_ucs2_allocate failed!\n"));
exit(1);
@@ -1169,7 +1169,7 @@ static bool test_plaintext(struct samlogon_state *samlogon_state, enum ntlm_brea
password = strupper_talloc(samlogon_state->mem_ctx, samlogon_state->password);
if ((convert_string_talloc(samlogon_state->mem_ctx,
- global_smb_iconv_convenience,
+ lp_iconv_convenience(global_loadparm),
CH_UNIX, CH_DOS,
password, strlen(password)+1,
(void**)&dospw)) == -1) {
diff --git a/source4/torture/rpc/spoolss_win.c b/source4/torture/rpc/spoolss_win.c
index 8e22750d0c..9192d98c73 100644
--- a/source4/torture/rpc/spoolss_win.c
+++ b/source4/torture/rpc/spoolss_win.c
@@ -355,7 +355,7 @@ static bool test_EnumPrinterKey(struct torture_context *tctx,
torture_assert_werr_ok(tctx, epk.out.result, "EnumPrinterKey failed");
- convert_string_talloc(ctx, global_smb_iconv_convenience, CH_UTF16,
+ convert_string_talloc(ctx, lp_iconv_convenience(global_loadparm), CH_UTF16,
CH_UNIX, epk.out.key_buffer, epk.out.needed,
(void**)&ctx->printer_keys);
diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c
index ddec59a15d..98e811468d 100644
--- a/source4/torture/rpc/wkssvc.c
+++ b/source4/torture/rpc/wkssvc.c
@@ -966,7 +966,7 @@ static bool test_NetrMessageBufferSend(struct torture_context *tctx,
size_t size;
uint8_t *msg;
- size = push_ucs2_talloc(tctx, global_smb_iconv_convenience,
+ size = push_ucs2_talloc(tctx, lp_iconv_convenience(global_loadparm),
(void **)&msg, message);
r.in.server_name = dcerpc_server_name(p);
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index b35e623610..6d97e9ad9d 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -50,7 +50,7 @@ static bool run_matching(struct torture_context *torture,
for (o = torture_root->children; o; o = o->next) {
if (gen_fnmatch(expr, o->name) == 0) {
*matched = true;
- reload_charcnv();
+ reload_charcnv(torture->lp_ctx);
ret &= torture_run_suite(torture, o);
continue;
}
@@ -67,7 +67,7 @@ static bool run_matching(struct torture_context *torture,
if (gen_fnmatch(expr, name) == 0) {
*matched = true;
- reload_charcnv();
+ reload_charcnv(torture->lp_ctx);
torture->active_testname = talloc_strdup(torture, prefix);
ret &= torture_run_suite(torture, c);
free(name);
@@ -83,7 +83,7 @@ static bool run_matching(struct torture_context *torture,
asprintf(&name, "%s-%s", prefix, t->name);
if (gen_fnmatch(expr, name) == 0) {
*matched = true;
- reload_charcnv();
+ reload_charcnv(torture->lp_ctx);
torture->active_testname = talloc_strdup(torture, prefix);
ret &= torture_run_tcase(torture, t);
talloc_free(torture->active_testname);