Eliminate another instance of global_loadparm.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 24 Oct 2008 11:13:27 +0000 (13:13 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 24 Oct 2008 11:13:27 +0000 (13:13 +0200)
31 files changed:
source4/auth/ntlm/auth_server.c
source4/client/cifsdd.c
source4/client/cifsdd.h
source4/client/cifsddio.c
source4/client/client.c
source4/lib/messaging/pymessaging.c
source4/libcli/cliconnect.c
source4/libcli/raw/clitransport.c
source4/libcli/raw/clitree.c
source4/libcli/raw/libcliraw.h
source4/libcli/smb_composite/connect.c
source4/libcli/smb_composite/fetchfile.c
source4/libcli/smb_composite/fsinfo.c
source4/libcli/smb_composite/smb_composite.h
source4/librpc/rpc/dcerpc_connect.c
source4/ntvfs/cifs/vfs_cifs.c
source4/scripting/python/modules.h
source4/torture/basic/base.c
source4/torture/basic/misc.c
source4/torture/gentest.c
source4/torture/locktest.c
source4/torture/masktest.c
source4/torture/raw/composite.c
source4/torture/raw/lockbench.c
source4/torture/raw/oplock.c
source4/torture/raw/tconrate.c
source4/torture/rpc/join.c
source4/torture/rpc/samba3rpc.c
source4/torture/unix/unix_info2.c
source4/torture/unix/whoami.c
source4/torture/util_smb.c

index fde9835cf2c5fe1b321618662b1d75ddba0b41f0..0b1e091eeac2196f35ac47b387c6ce54b130d850 100644 (file)
@@ -80,6 +80,8 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX
        io.in.workgroup = ""; /* only used with SPNEGO, disabled above */
 
        io.in.options = smb_options;
+       
+       io.in.iconv_convenience = lp_iconv_convenience(ctx->auth_ctx->lp_ctx);
        lp_smbcli_session_options(ctx->auth_ctx->lp_ctx, &io.in.session_options);
 
        status = smb_composite_connect(&io, mem_ctx, lp_resolve_context(ctx->auth_ctx->lp_ctx),
index 5f07826d06eb7381ffcbc8759053163882731cf6..6d35dc6b8289bd1e20feebfd136fa8c61968d743 100644 (file)
@@ -358,7 +358,8 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
                                      struct event_context *ev,
                                      const char * which, const char **ports,
                                      struct smbcli_options *smb_options,
-                                     struct smbcli_session_options *smb_session_options)
+                                     struct smbcli_session_options *smb_session_options,
+                                     struct smb_iconv_convenience *iconv_convenience)
 {
        int                     options = 0;
        const char *            path = NULL;
@@ -380,13 +381,15 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
                path = check_arg_pathname("if");
                handle = dd_open_path(resolve_ctx, ev, path, ports,
                                      check_arg_numeric("ibs"), options,
-                                     smb_options, smb_session_options);
+                                     smb_options, smb_session_options,
+                                     iconv_convenience);
        } else if (strcmp(which, "of") == 0) {
                options |= DD_WRITE;
                path = check_arg_pathname("of");
                handle = dd_open_path(resolve_ctx, ev, path, ports,
                                      check_arg_numeric("obs"), options,
-                                     smb_options, smb_session_options);
+                                     smb_options, smb_session_options,
+                                     iconv_convenience);
        } else {
                SMB_ASSERT(0);
                return(NULL);
@@ -440,13 +443,14 @@ static int copy_files(struct event_context *ev, struct loadparm_context *lp_ctx)
 
        if (!(ifile = open_file(lp_resolve_context(lp_ctx), ev, "if",
                                lp_smb_ports(lp_ctx), &options,
-                               &session_options))) {
+                               &session_options, lp_iconv_convenience(lp_ctx)))) {
                return(FILESYS_EXIT_CODE);
        }
 
        if (!(ofile = open_file(lp_resolve_context(lp_ctx), ev, "of",
                                lp_smb_ports(lp_ctx), &options,
-                               &session_options))) {
+                               &session_options,
+                               lp_iconv_convenience(lp_ctx)))) {
                return(FILESYS_EXIT_CODE);
        }
 
index 3195e4334f3bc4938fa97ad1bf6e4293465784f8..bb851fa24864c9213c054757890fab37604ac305 100644 (file)
@@ -98,7 +98,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
                                  const char **ports,
                                uint64_t io_size, int options, 
                                struct smbcli_options *smb_options,
-                               struct smbcli_session_options *smb_session_options);
+                               struct smbcli_session_options *smb_session_options,
+                               struct smb_iconv_convenience *iconv_convenience);
 bool dd_fill_block(struct dd_iohandle * h, uint8_t * buf,
                uint64_t * buf_size, uint64_t need_size, uint64_t block_size);
 bool dd_flush_block(struct dd_iohandle * h, uint8_t * buf,
index 25194a621a82472db63e02fc7b60964978cee21e..3c9e0c22022915b457f13a291f62c2a10d4a6846 100644 (file)
@@ -226,7 +226,8 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct
                                              const char **ports,
                                              const char * share,
                                              struct smbcli_options *options,
-                                             struct smbcli_session_options *session_options)
+                                             struct smbcli_session_options *session_options,
+                                             struct smb_iconv_convenience *iconv_convenience)
 {
        NTSTATUS                ret;
        struct smbcli_state *   cli = NULL;
@@ -238,7 +239,8 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct
                                     NULL /* devtype */,
                                     cmdline_credentials, resolve_ctx,
                                     ev, options,
-                                    session_options);
+                                    session_options,
+                                    iconv_convenience);
 
        if (!NT_STATUS_IS_OK(ret)) {
                fprintf(stderr, "%s: connecting to //%s/%s: %s\n",
@@ -305,7 +307,8 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx
                                        uint64_t io_size,
                                        int options,
                                        struct smbcli_options *smb_options,
-                                       struct smbcli_session_options *smb_session_options)
+                                       struct smbcli_session_options *smb_session_options,
+                                       struct smb_iconv_convenience *iconv_convenience)
 {
        struct cifs_handle * smbh;
 
@@ -326,7 +329,8 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx
        smbh->h.io_seek = smb_seek_func;
 
        if ((smbh->cli = init_smb_session(resolve_ctx, ev, host, ports, share,
-                                         smb_options, smb_session_options)) == NULL) {
+                                         smb_options, smb_session_options,
+                                         iconv_convenience)) == NULL) {
                return(NULL);
        }
 
@@ -348,7 +352,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
                                uint64_t io_size,
                                int options,
                                struct smbcli_options *smb_options,
-                               struct smbcli_session_options *smb_session_options)
+                               struct smbcli_session_options *smb_session_options,
+                               struct smb_iconv_convenience *iconv_convenience)
 {
        if (file_exist(path)) {
                return(open_fd_handle(path, io_size, options));
@@ -366,7 +371,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
                        return(open_cifs_handle(resolve_ctx, ev, host, ports,
                                                share, remain,
                                                io_size, options, smb_options,
-                                               smb_session_options));
+                                               smb_session_options,
+                                               iconv_convenience));
                }
 
                return(open_fd_handle(path, io_size, options));
index 1865d8db132b311fa045459a09ec982e565c77a8..a61d1b4ca4ce564226a9a3cf76bb6dd659fcb5fb 100644 (file)
@@ -3033,7 +3033,8 @@ static bool do_connect(struct smbclient_context *ctx,
                       const char *specified_share, 
                       struct cli_credentials *cred, 
                       struct smbcli_options *options,
-                      struct smbcli_session_options *session_options)
+                      struct smbcli_session_options *session_options,
+                          struct smb_iconv_convenience *iconv_convenience)
 {
        NTSTATUS status;
        char *server, *share;
@@ -3052,7 +3053,8 @@ static bool do_connect(struct smbclient_context *ctx,
        
        status = smbcli_full_connection(ctx, &ctx->cli, server, ports,
                                        share, NULL, cred, resolve_ctx, 
-                                       ev_ctx, options, session_options);
+                                       ev_ctx, options, session_options,
+                                       iconv_convenience);
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("Connection to \\\\%s\\%s failed - %s\n", 
                         server, share, nt_errstr(status));
@@ -3085,7 +3087,8 @@ static int do_message_op(const char *netbios_name, const char *desthost,
                         int name_type,
                         struct event_context *ev_ctx,
                         struct resolve_context *resolve_ctx,
-                        struct smbcli_options *options)
+                        struct smbcli_options *options,
+                        struct smb_iconv_convenience *iconv_convenience)
 {
        struct nbt_name called, calling;
        const char *server_name;
@@ -3099,7 +3102,8 @@ static int do_message_op(const char *netbios_name, const char *desthost,
 
        if (!(cli = smbcli_state_init(NULL)) ||
            !smbcli_socket_connect(cli, server_name, destports,
-                                  ev_ctx, resolve_ctx, options)) {
+                                  ev_ctx, resolve_ctx, options,
+                                  iconv_convenience)) {
                d_printf("Connection to %s failed\n", server_name);
                return 1;
        }
@@ -3252,13 +3256,14 @@ static int do_message_op(const char *netbios_name, const char *desthost,
                                   lp_smb_ports(cmdline_lp_ctx), dest_ip,
                                   name_type, ev_ctx,
                                   lp_resolve_context(cmdline_lp_ctx),
-                                  &smb_options);
+                                  &smb_options, lp_iconv_convenience(cmdline_lp_ctx));
                return rc;
        }
        
        if (!do_connect(ctx, ev_ctx, lp_resolve_context(cmdline_lp_ctx),
                        desthost, lp_smb_ports(cmdline_lp_ctx), service,
-                       cmdline_credentials, &smb_options, &smb_session_options))
+                       cmdline_credentials, &smb_options, &smb_session_options,
+                       lp_iconv_convenience(cmdline_lp_ctx)))
                return 1;
 
        if (base_directory) 
index 621a2fe3494232beda544036ee3a55d8c183fc08..fb23214bca300322e54c309609edaa9423610a5f 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "includes.h"
 #include <Python.h>
+#include "scripting/python/modules.h"
 #include "libcli/util/pyerrors.h"
 #include "librpc/rpc/pyrpc.h"
 #include "lib/messaging/irpc.h"
@@ -347,12 +348,12 @@ PyObject *py_irpc_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs)
                ret->msg_ctx = messaging_init(ret->mem_ctx, 
                                            messaging_path,
                                            server_id,
-                                           lp_iconv_convenience(global_loadparm),
+                                       py_iconv_convenience(ret->mem_ctx),
                                            ev);
        } else {
                ret->msg_ctx = messaging_client_init(ret->mem_ctx, 
                                            messaging_path,
-                                           lp_iconv_convenience(global_loadparm),
+                                       py_iconv_convenience(ret->mem_ctx),
                                            ev);
        }
 
index e42b04cdc57426027a8d45e32d5fcac796f32dd1..1b3d2c98c95110fea0cdf0a055097fb8257af011 100644 (file)
@@ -35,7 +35,8 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server,
                           const char **ports, 
                           struct event_context *ev_ctx,
                           struct resolve_context *resolve_ctx,
-                          struct smbcli_options *options)
+                          struct smbcli_options *options,
+                          struct smb_iconv_convenience *iconv_convenience)
 {
        struct smbcli_socket *sock;
 
@@ -44,7 +45,8 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server,
 
        if (sock == NULL) return false;
        
-       cli->transport = smbcli_transport_init(sock, cli, true, options);
+       cli->transport = smbcli_transport_init(sock, cli, true, options, 
+                                                                                  iconv_convenience);
        if (!cli->transport) {
                return false;
        }
@@ -147,7 +149,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx,
                                struct resolve_context *resolve_ctx,
                                struct event_context *ev,
                                struct smbcli_options *options,
-                               struct smbcli_session_options *session_options)
+                               struct smbcli_session_options *session_options,
+                               struct smb_iconv_convenience *iconv_convenience)
 {
        struct smbcli_tree *tree;
        NTSTATUS status;
@@ -159,7 +162,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx,
                                             sharename, devtype,
                                             credentials, resolve_ctx, ev,
                                             options,
-                                            session_options);
+                                            session_options,
+                                                iconv_convenience);
        if (!NT_STATUS_IS_OK(status)) {
                goto done;
        }
index db43c9e20c911a987702008572ef8585bde8b360..391efe061941990658b96a905cf56aad68f823b9 100644 (file)
@@ -76,7 +76,8 @@ static NTSTATUS smbcli_transport_finish_recv(void *private, DATA_BLOB blob);
 struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
                                               TALLOC_CTX *parent_ctx, 
                                               bool primary, 
-                                              struct smbcli_options *options)
+                                              struct smbcli_options *options,
+                                                  struct smb_iconv_convenience *iconv_convenience)
 {
        struct smbcli_transport *transport;
 
@@ -91,6 +92,7 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
        transport->negotiate.protocol = PROTOCOL_NT1;
        transport->options = *options;
        transport->negotiate.max_xmit = transport->options.max_xmit;
+       transport->iconv_convenience = iconv_convenience;
 
        /* setup the stream -> packet parser */
        transport->packet = packet_init(transport);
index ccfb28b84dba9b42fcc896388652443e23204d50..08f611941d6badc28ba4dc49e9f80df4da4fbba5 100644 (file)
@@ -178,7 +178,8 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
                                     struct resolve_context *resolve_ctx,
                                     struct event_context *ev,
                                     struct smbcli_options *options,
-                                    struct smbcli_session_options *session_options)
+                                    struct smbcli_session_options *session_options,
+                                        struct smb_iconv_convenience *iconv_convenience)
 {
        struct smb_composite_connect io;
        NTSTATUS status;
@@ -201,6 +202,7 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
        io.in.workgroup = "";
        io.in.options = *options;
        io.in.session_options = *session_options;
+       io.in.iconv_convenience = iconv_convenience;
        
        status = smb_composite_connect(&io, parent_ctx, resolve_ctx, ev);
        if (NT_STATUS_IS_OK(status)) {
index bd9bda0db1b120001b7eceaa32fe35a8d50f11d3..98f18b1ed58cb44efa4c76f4df96959fa661c414 100644 (file)
@@ -162,6 +162,9 @@ struct smbcli_transport {
 
        /* context of the stream -> packet parser */
        struct packet_context *packet;
+
+       /* iconv convenience */
+       struct smb_iconv_convenience *iconv_convenience;
 };
 
 /* this is the context for the user */
index a4137290bbcb714c44689d62964cc1d478c06a9d..8af17565624b3a4b54a13f9819d6fca0ac42c786 100644 (file)
@@ -322,7 +322,7 @@ static NTSTATUS connect_socket(struct composite_context *c,
 
        /* the socket is up - we can initialise the smbcli transport layer */
        state->transport = smbcli_transport_init(state->sock, state, true, 
-                                                &io->in.options);
+                                                &io->in.options, io->in.iconv_convenience);
        NT_STATUS_HAVE_NO_MEMORY(state->transport);
 
        if (is_ipaddress(state->sock->hostname) &&
index ff4f0e793026e4c8e8ff1e2cd3c9d4f74ca2c77e..c46cda25df75ffb07712d53c50edaa8968e5e2f6 100644 (file)
@@ -145,6 +145,7 @@ struct composite_context *smb_composite_fetchfile_send(struct smb_composite_fetc
        state->connect->in.credentials  = io->in.credentials;
        state->connect->in.fallback_to_anonymous = false;
        state->connect->in.workgroup    = io->in.workgroup;
+       state->connect->in.iconv_convenience = io->in.iconv_convenience;
 
        state->connect->in.options      = io->in.options;
        state->connect->in.session_options = io->in.session_options;
index dc5327a29cac4b424c0c58c183e073e2190240de..284fe8415469c65c9742c280bec26316ba07c199 100644 (file)
@@ -153,6 +153,7 @@ struct composite_context *smb_composite_fsinfo_send(struct smbcli_tree *tree,
        state->connect->in.credentials  = io->in.credentials;
        state->connect->in.fallback_to_anonymous = false;
        state->connect->in.workgroup    = io->in.workgroup;
+       state->connect->in.iconv_convenience = io->in.iconv_convenience;
 
        state->connect->in.options = tree->session->transport->options;
        state->connect->in.session_options = tree->session->options;
index 08ca40c833072ce4260e8b619f3f97762186a70b..fd1b95e64f01a5b7ee55793dc1d3d8184ad1e98d 100644 (file)
@@ -59,6 +59,7 @@ struct smb_composite_fetchfile {
                struct smbcli_options options;
                struct smbcli_session_options session_options;
                struct resolve_context *resolve_ctx;
+               struct smb_iconv_convenience *iconv_convenience;
        } in;
        struct {
                uint8_t *data;
@@ -100,6 +101,7 @@ struct smb_composite_connect {
                const char *workgroup;
                struct smbcli_options options;
                struct smbcli_session_options session_options;
+               struct smb_iconv_convenience *iconv_convenience;
        } in;
        struct {
                struct smbcli_tree *tree;
@@ -137,6 +139,7 @@ struct smb_composite_fsinfo {
                struct cli_credentials *credentials;
                const char *workgroup;
                enum smb_fsinfo_level level;
+               struct smb_iconv_convenience *iconv_convenience;
        } in;
        
        struct {
index b117a98270a1f912e006c8be92284d51395900ed..9583fcdc02bc54bd2567a9bd8b9c67ac0cd1fc05 100644 (file)
@@ -120,6 +120,8 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT
        conn->in.service_type           = NULL;
        conn->in.workgroup              = lp_workgroup(lp_ctx);
 
+       conn->in.iconv_convenience = lp_iconv_convenience(lp_ctx);
+
        lp_smbcli_options(lp_ctx, &conn->in.options);
        lp_smbcli_session_options(lp_ctx, &conn->in.session_options);
 
index 322814ef5d7816ae3abf2a3f8ee0b41d3c5d7c2e..14bf79ecf6cbb61ac128843382ccde17834f8c8e 100644 (file)
@@ -205,6 +205,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
        io.in.workgroup = lp_workgroup(ntvfs->ctx->lp_ctx);
        io.in.service = remote_share;
        io.in.service_type = "?????";
+       io.in.iconv_convenience = lp_iconv_convenience(ntvfs->ctx->lp_ctx);
        lp_smbcli_options(ntvfs->ctx->lp_ctx, &io.in.options);
        lp_smbcli_session_options(ntvfs->ctx->lp_ctx, &io.in.session_options);
 
index 238c73455fa609bd573d985a119c66566563acc6..6b242ee25773beb95bff91665688cdfd6124a7dd 100644 (file)
@@ -23,4 +23,6 @@
 void py_load_samba_modules(void);
 void py_update_path(const char *bindir);
 
+#define py_iconv_convenience(mem_ctx) smb_iconv_convenience_init(mem_ctx, "ASCII", PyUnicode_GetDefaultEncoding(), true)
+
 #endif /* __SAMBA_PYTHON_MODULES_H__ */ 
index 2ab3f9ca91640068b68b2ff179084f6ec052249b..f2b7b9b2251322eef2061b2ad373c9d77009d697 100644 (file)
@@ -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;
        }
index 3a09fa74b5540ad9693aed6b5ae7eb773b1c600d..89e716988393ac123785035998183a48be819315 100644 (file)
@@ -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);
index 74ece9942281f43ea57a206a7205440f5e4185e4..aefed23f51a9e60adeba9e02506cc806bcfa27ca 100644 (file)
@@ -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",
index 710aa8007a9adac84488bc1eef6370ea3ba844f0..819fbe072b950f2cc3a86bc606ffd54ce68a365d 100644 (file)
@@ -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);
                }
index 6e9ae893363e049633387a850edc2814d9298a0a..14d597666e37f20b0233abdc32bc0b39d87e86a0 100644 (file)
@@ -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);
index 7f1f5943e1c95fca65bf91c6c618d5145f74f3ae..16de4308bb3a920999f83fab75ca8a99f4c890e7 100644 (file)
@@ -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);
 
index 26fad4235e9e793ae097d6fe1e248e43f047c7f5..a6dce8a9266d0e42a3df985350f729760ba66432 100644 (file)
@@ -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);
 
index 19924e731bb1e4923e0f08a96da7fb386628607d..46b41e51a00ad9c0ed139be5b6afe607f36e5f40 100644 (file)
@@ -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;
index 66ef2ae2dde8e761a7459b7d635a1995dfc3cf42..9e753018289c55e4d4408e18144010cf3e93b67a 100644 (file)
@@ -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",
index ee0c05360fcd47af039a12c65450edc2c04a0044..a6bb53a7599a2fa69c40d7c60a528a85816495fa 100644 (file)
@@ -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));
index 25ff7d0ea9b4052c8ec5360836e2d73f18c69495..85714ace137300c6a559f0387f81edefd551e60c 100644 (file)
@@ -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));
index 3bddde2a97ce5a78565e6f3f559d1c14cb77acdd..53909f645b651617d0579e7e2f15791a497cc3ac 100644 (file)
@@ -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",
index d742e23e829de59e1f1ea09e13edb466b6d8874c..d7fbe4a23d814bb0e245fdf08dbe5de2875640bb 100644 (file)
@@ -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",
index 3d9c5e321d538fd63e8b87d8ce2b8b51a876af37..b84938cf11f3d755dc02a2c8885b1c165aee0ad2 100644 (file)
@@ -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;