summaryrefslogtreecommitdiff
path: root/source4/torture/basic
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-05-09 17:20:01 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-05-18 11:45:30 +0200
commitf9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d (patch)
tree9a0a6cb6617d855c28eb891396898096c4214e88 /source4/torture/basic
parente9f5bdf6b5a1aeb7e2e556cf41f7cbc2abed7856 (diff)
downloadsamba-f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d.tar.gz
samba-f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d.tar.bz2
samba-f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d.zip
Finish removal of iconv_convenience in public API's.
Diffstat (limited to 'source4/torture/basic')
-rw-r--r--source4/torture/basic/base.c1
-rw-r--r--source4/torture/basic/scanner.c13
-rw-r--r--source4/torture/basic/utable.c14
3 files changed, 12 insertions, 16 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index 309a394476..b2d523283a 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -55,7 +55,6 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx)
if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), tctx->ev,
lp_resolve_context(tctx->lp_ctx), &options,
- lp_iconv_convenience(tctx->lp_ctx),
lp_socket_options(tctx->lp_ctx))) {
torture_comment(tctx, "Failed to connect with %s\n", host);
goto failed;
diff --git a/source4/torture/basic/scanner.c b/source4/torture/basic/scanner.c
index 37c1f43c39..a4d8674db9 100644
--- a/source4/torture/basic/scanner.c
+++ b/source4/torture/basic/scanner.c
@@ -435,8 +435,7 @@ static NTSTATUS try_nttrans_len(struct smbcli_state *cli,
/****************************************************************************
check for existance of a nttrans call
****************************************************************************/
-static bool scan_nttrans(struct smb_iconv_convenience *iconv_convenience,
- struct smbcli_state *cli, int op, int level,
+static bool scan_nttrans(struct smbcli_state *cli, int op, int level,
int fnum, int dnum, const char *fname)
{
int data_len = 0;
@@ -546,7 +545,6 @@ bool torture_nttrans_scan(struct torture_context *torture,
{
int op, level;
const char *fname = "\\scanner.dat";
- struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(torture->lp_ctx);
int fnum, dnum;
fnum = smbcli_open(cli->tree, fname, O_RDWR | O_CREAT | O_TRUNC,
@@ -556,18 +554,15 @@ bool torture_nttrans_scan(struct torture_context *torture,
for (op=OP_MIN; op<=OP_MAX; op++) {
printf("Scanning op=%d\n", op);
for (level = 0; level <= 50; level++) {
- scan_nttrans(iconv_convenience,
- cli, op, level, fnum, dnum, fname);
+ scan_nttrans(cli, op, level, fnum, dnum, fname);
}
for (level = 0x100; level <= 0x130; level++) {
- scan_nttrans(iconv_convenience,
- cli, op, level, fnum, dnum, fname);
+ scan_nttrans(cli, op, level, fnum, dnum, fname);
}
for (level = 1000; level < 1050; level++) {
- scan_nttrans(iconv_convenience,
- cli, op, level, fnum, dnum, fname);
+ scan_nttrans(cli, op, level, fnum, dnum, fname);
}
}
diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c
index 158418a284..682bc0963e 100644
--- a/source4/torture/basic/utable.c
+++ b/source4/torture/basic/utable.c
@@ -49,9 +49,9 @@ bool torture_utable(struct torture_context *tctx,
SSVAL(c2, 0, c);
strncpy(fname, "\\utable\\x", sizeof(fname)-1);
p = fname+strlen(fname);
- convert_string_convenience(lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX,
+ len = convert_string(CH_UTF16, CH_UNIX,
c2, 2,
- p, sizeof(fname)-strlen(fname), &len, false);
+ p, sizeof(fname)-strlen(fname), false);
p[len] = 0;
strncat(fname,"_a_long_extension",sizeof(fname)-1);
@@ -97,7 +97,7 @@ bool torture_utable(struct torture_context *tctx,
}
-static char *form_name(struct smb_iconv_convenience *iconv_convenience, int c)
+static char *form_name(int c)
{
static char fname[256];
uint8_t c2[4];
@@ -108,9 +108,11 @@ static char *form_name(struct smb_iconv_convenience *iconv_convenience, int c)
p = fname+strlen(fname);
SSVAL(c2, 0, c);
- convert_string_convenience(iconv_convenience, CH_UTF16, CH_UNIX,
+ len = convert_string(CH_UTF16, CH_UNIX,
c2, 2,
- p, sizeof(fname)-strlen(fname), &len, false);
+ p, sizeof(fname)-strlen(fname), false);
+ if (len == -1)
+ return NULL;
p[len] = 0;
return fname;
}
@@ -138,7 +140,7 @@ bool torture_casetable(struct torture_context *tctx,
torture_comment(tctx, "%04x (%c)\n", c, isprint(c)?c:'.');
- fname = form_name(lp_iconv_convenience(tctx->lp_ctx), c);
+ fname = form_name(c);
fnum = smbcli_nt_create_full(cli->tree, fname, 0,
#if 0
SEC_RIGHT_MAXIMUM_ALLOWED,