Remove another use of global_loadparm.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 2 Nov 2008 15:07:28 +0000 (16:07 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 2 Nov 2008 15:07:28 +0000 (16:07 +0100)
Eventually, we should move some of these parameters into a separate
struct (perhaps into smb_transport_options?), to avoid the long lists of
parameters.

31 files changed:
librpc/ndr/ndr.c
source3/include/includes.h
source3/librpc/ndr/util.c
source4/auth/ntlm/auth_server.c
source4/client/cifsdd.h
source4/client/cifsddio.c
source4/client/client.c
source4/libcli/cliconnect.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/ntvfs/cifs/vfs_cifs.c
source4/torture/basic/base.c
source4/torture/basic/misc.c
source4/torture/gentest.c
source4/torture/locktest.c
source4/torture/locktest2.c
source4/torture/masktest.c
source4/torture/raw/composite.c
source4/torture/raw/lockbench.c
source4/torture/raw/openbench.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 2f1daeaeb5ac2982aec61787d99d7ecad0b9c0a2..12f95a9ceb63df03f084bb704e34924658a13117 100644 (file)
@@ -933,7 +933,7 @@ _PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t pu
        /* avoid recursion */
        if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
 
-       ndr = ndr_push_init_ctx(NULL, lp_iconv_convenience(global_loadparm));
+       ndr = ndr_push_init_ctx(NULL, global_iconv_convenience);
        if (!ndr) return 0;
        ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
        status = push(ndr, NDR_SCALARS|NDR_BUFFERS, discard_const(p));
@@ -958,7 +958,7 @@ _PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_pus
        /* avoid recursion */
        if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
 
-       ndr = ndr_push_init_ctx(NULL, lp_iconv_convenience(global_loadparm));
+       ndr = ndr_push_init_ctx(NULL, global_iconv_convenience);
        if (!ndr) return 0;
        ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
 
index 73600e379b47df2bfe67a979fb67c09eb611886d..ece819938f21b4e45fb9d2155941b8ec5bb37a5e 100644 (file)
@@ -567,6 +567,7 @@ typedef char fstring[FSTRING_LEN];
 #endif
 
 /* Samba 3 doesn't use iconv_convenience: */
+extern void *global_iconv_convenience;
 extern void *global_loadparm;
 extern void *cmdline_lp_ctx;
 struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
index 457615ce22320fe2aabb4fdd4fef9f056425e8c0..c1134db8e3f72da9d5f96d96216cd5e10e414867 100644 (file)
@@ -166,6 +166,7 @@ _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name
        ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss));
 }
 
+void *global_iconv_convenience;
 void *global_loadparm;
 void *cmdline_lp_ctx;
 struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx)
index 2af0cc8a00baa96619706902482eba5ef98ebccd..fd0ef0fe4ad9876c75491261edfadad977466088 100644 (file)
@@ -67,6 +67,7 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX
        }
        io.in.dest_ports = lp_smb_ports(ctx->auth_ctx->lp_ctx); 
        io.in.socket_options = lp_socket_options(ctx->auth_ctx->lp_ctx);
+       io.in.gensec_settings = lp_gensec_settings(mem_ctx, ctx->auth_ctx->lp_ctx);
 
        io.in.called_name = strupper_talloc(mem_ctx, io.in.dest_host);
 
index cfc37cad54c80c811eddd377af26994609d68cde..28fe6778f4844a66c6fce616ce3829b6795923bc 100644 (file)
@@ -100,7 +100,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
                                const char *socket_options,
                                struct smbcli_options *smb_options,
                                struct smbcli_session_options *smb_session_options,
-                               struct smb_iconv_convenience *iconv_convenience);
+                               struct smb_iconv_convenience *iconv_convenience,
+                               struct gensec_settings *gensec_settings);
 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 49c32a37dc0fa4dee6bb3b08cd3b439781d9c8b8..06631ee3acc4d4b24f626211a48723299302e67e 100644 (file)
@@ -228,7 +228,8 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct
                                              const char *socket_options,
                                              struct smbcli_options *options,
                                              struct smbcli_session_options *session_options,
-                                             struct smb_iconv_convenience *iconv_convenience)
+                                             struct smb_iconv_convenience *iconv_convenience,
+                                             struct gensec_settings *gensec_settings)
 {
        NTSTATUS                ret;
        struct smbcli_state *   cli = NULL;
@@ -242,7 +243,8 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct
                                     cmdline_credentials, resolve_ctx,
                                     ev, options,
                                     session_options,
-                                    iconv_convenience);
+                                    iconv_convenience,
+                                    gensec_settings);
 
        if (!NT_STATUS_IS_OK(ret)) {
                fprintf(stderr, "%s: connecting to //%s/%s: %s\n",
@@ -311,7 +313,8 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx
                                        const char *socket_options,
                                        struct smbcli_options *smb_options,
                                        struct smbcli_session_options *smb_session_options,
-                                       struct smb_iconv_convenience *iconv_convenience)
+                                       struct smb_iconv_convenience *iconv_convenience,
+                                       struct gensec_settings *gensec_settings)
 {
        struct cifs_handle * smbh;
 
@@ -334,7 +337,8 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx
        if ((smbh->cli = init_smb_session(resolve_ctx, ev, host, ports, share,
                                          socket_options,
                                          smb_options, smb_session_options,
-                                         iconv_convenience)) == NULL) {
+                                         iconv_convenience,
+                                         gensec_settings)) == NULL) {
                return(NULL);
        }
 
@@ -358,7 +362,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
                                const char *socket_options,
                                struct smbcli_options *smb_options,
                                struct smbcli_session_options *smb_session_options,
-                               struct smb_iconv_convenience *iconv_convenience)
+                               struct smb_iconv_convenience *iconv_convenience,
+                               struct gensec_settings *gensec_settings)
 {
        if (file_exist(path)) {
                return(open_fd_handle(path, io_size, options));
@@ -378,7 +383,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
                                                io_size, options, 
                                                socket_options, smb_options,
                                                smb_session_options,
-                                               iconv_convenience));
+                                               iconv_convenience,
+                                               gensec_settings));
                }
 
                return(open_fd_handle(path, io_size, options));
index 5066df1f544b92b1cca466bb31a129bfe335389d..a600b5fb0c6578462e8a650f4df3847a8e18555e 100644 (file)
@@ -3049,7 +3049,8 @@ static bool do_connect(struct smbclient_context *ctx,
                       struct cli_credentials *cred, 
                       struct smbcli_options *options,
                       struct smbcli_session_options *session_options,
-                          struct smb_iconv_convenience *iconv_convenience)
+                          struct smb_iconv_convenience *iconv_convenience,
+                          struct gensec_settings *gensec_settings)
 {
        NTSTATUS status;
        char *server, *share;
@@ -3071,7 +3072,8 @@ static bool do_connect(struct smbclient_context *ctx,
                                        socket_options,
                                        cred, resolve_ctx, 
                                        ev_ctx, options, session_options,
-                                       iconv_convenience);
+                                       iconv_convenience,
+                                       gensec_settings);
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("Connection to \\\\%s\\%s failed - %s\n", 
                         server, share, nt_errstr(status));
@@ -3284,7 +3286,8 @@ static int do_message_op(const char *netbios_name, const char *desthost,
                        desthost, lp_smb_ports(cmdline_lp_ctx), service,
                        lp_socket_options(cmdline_lp_ctx),
                        cmdline_credentials, &smb_options, &smb_session_options,
-                       lp_iconv_convenience(cmdline_lp_ctx)))
+                       lp_iconv_convenience(cmdline_lp_ctx),
+                       lp_gensec_settings(ctx, cmdline_lp_ctx)))
                return 1;
 
        if (base_directory) 
index 402387f5b5fbd6ac4b6a553b7956e69145a8de58..dda05c8d739460423f389736801aee2616173b7a 100644 (file)
@@ -154,7 +154,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx,
                                struct event_context *ev,
                                struct smbcli_options *options,
                                struct smbcli_session_options *session_options,
-                               struct smb_iconv_convenience *iconv_convenience)
+                               struct smb_iconv_convenience *iconv_convenience,
+                               struct gensec_settings *gensec_settings)
 {
        struct smbcli_tree *tree;
        NTSTATUS status;
@@ -168,7 +169,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx,
                                             credentials, resolve_ctx, ev,
                                             options,
                                             session_options,
-                                                iconv_convenience);
+                                                iconv_convenience,
+                                                gensec_settings);
        if (!NT_STATUS_IS_OK(status)) {
                goto done;
        }
index 8640a25747638bff7b35b6a070bfe993a0cba80c..984aa702472a5b6cc8cc3a15f8aa7903d61f0c4a 100644 (file)
@@ -179,7 +179,8 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
                                     struct event_context *ev,
                                     struct smbcli_options *options,
                                     struct smbcli_session_options *session_options,
-                                        struct smb_iconv_convenience *iconv_convenience)
+                                        struct smb_iconv_convenience *iconv_convenience,
+                                        struct gensec_settings *gensec_settings)
 {
        struct smb_composite_connect io;
        NTSTATUS status;
@@ -195,6 +196,7 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
        io.in.service = service;
        io.in.service_type = service_type;
        io.in.credentials = credentials;
+       io.in.gensec_settings = gensec_settings;
        io.in.fallback_to_anonymous = false;
 
        /* This workgroup gets sent out by the SPNEGO session setup.
index ccd8681fa042eb83c552b0a22b9f0b0b74f89c44..7757d10099c6a76df034f1f2bf723a66f120e2de 100644 (file)
@@ -32,6 +32,7 @@ struct smbcli_transport;  /* forward declare */
 
 struct resolve_context;
 struct cli_credentials;
+struct gensec_settings;
 
 /* default timeout for all smb requests */
 #define SMB_REQUEST_TIMEOUT 60
index 70df0a19ffeee2a00e1cedd8181e247c43103ece..416863bbe1c845b13d7ad5f04bf4603e59864034 100644 (file)
@@ -257,7 +257,7 @@ static NTSTATUS connect_negprot(struct composite_context *c,
        state->io_setup->in.capabilities = state->transport->negotiate.capabilities;
        state->io_setup->in.credentials  = io->in.credentials;
        state->io_setup->in.workgroup    = io->in.workgroup;
-       state->io_setup->in.gensec_settings = lp_gensec_settings(state->io_setup, global_loadparm);
+       state->io_setup->in.gensec_settings = io->in.gensec_settings;
 
        state->creq = smb_composite_sesssetup_send(state->session, state->io_setup);
        NT_STATUS_HAVE_NO_MEMORY(state->creq);
index 6dc2ae8c8f1af39840be8fcec2b696ad007df26b..a19898efaee9ea4ad45111dfe413dcaf79aebdff 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.gensec_settings = io->in.gensec_settings;
        state->connect->in.iconv_convenience = io->in.iconv_convenience;
 
        state->connect->in.options      = io->in.options;
index 8f5339fa057996ef13888cf755135a106b28b453..7c9c7963f4a953dfb377fc812fea1ec171f1335e 100644 (file)
@@ -154,6 +154,7 @@ struct composite_context *smb_composite_fsinfo_send(struct smbcli_tree *tree,
        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.gensec_settings = io->in.gensec_settings;
 
        state->connect->in.options = tree->session->transport->options;
        state->connect->in.session_options = tree->session->options;
index 431733d600dc69eaffd86952882a5543c180799f..a1e1e99d7e9e5bccb6219b6704b91712d882cfe7 100644 (file)
@@ -61,6 +61,7 @@ struct smb_composite_fetchfile {
                struct smbcli_session_options session_options;
                struct resolve_context *resolve_ctx;
                struct smb_iconv_convenience *iconv_convenience;
+               struct gensec_settings *gensec_settings;
        } in;
        struct {
                uint8_t *data;
@@ -104,6 +105,7 @@ struct smb_composite_connect {
                struct smbcli_options options;
                struct smbcli_session_options session_options;
                struct smb_iconv_convenience *iconv_convenience;
+               struct gensec_settings *gensec_settings;
        } in;
        struct {
                struct smbcli_tree *tree;
@@ -144,6 +146,7 @@ struct smb_composite_fsinfo {
                const char *workgroup;
                enum smb_fsinfo_level level;
                struct smb_iconv_convenience *iconv_convenience;
+               struct gensec_settings *gensec_settings;
        } in;
        
        struct {
index 27d5b9de5a3d8a8c94d26a733a678b756f3b0436..d133bbc4801da987bfe4c196337938fd0ca2a32f 100644 (file)
@@ -207,6 +207,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
        io.in.service = remote_share;
        io.in.service_type = "?????";
        io.in.iconv_convenience = lp_iconv_convenience(ntvfs->ctx->lp_ctx);
+       io.in.gensec_settings = lp_gensec_settings(private, 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 4725188e8f75d41466d414ad7df0b11bb92c2a59..ea7b6c08fd31b88faee03f01e949d901a425da45 100644 (file)
@@ -1450,14 +1450,8 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
        const char *os2_fname = ".+,;=[].";
        const char *dname = "samba3_errordir";
        union smb_open io;
-       TALLOC_CTX *mem_ctx = talloc_init("samba3_errorpaths");
        NTSTATUS status;
 
-       if (mem_ctx == NULL) {
-               torture_comment(tctx, "talloc_init failed\n");
-               return false;
-       }
-
        nt_status_support = lp_nt_status_support(tctx->lp_ctx);
 
        if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", "yes")) {
@@ -1506,14 +1500,14 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = dname;
 
-       status = smb_raw_open(cli_nt->tree, mem_ctx, &io);
+       status = smb_raw_open(cli_nt->tree, tctx, &io);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
                torture_comment(tctx, "(%s) incorrect status %s should be %s\n",
                       __location__, nt_errstr(status),
                       nt_errstr(NT_STATUS_OBJECT_NAME_COLLISION));
                goto fail;
        }
-       status = smb_raw_open(cli_dos->tree, mem_ctx, &io);
+       status = smb_raw_open(cli_dos->tree, tctx, &io);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS, ERRfilexists))) {
                torture_comment(tctx, "(%s) incorrect status %s should be %s\n",
                       __location__, nt_errstr(status),
@@ -1563,7 +1557,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
        }
 
        io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
-       status = smb_raw_open(cli_nt->tree, mem_ctx, &io);
+       status = smb_raw_open(cli_nt->tree, tctx, &io);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
                torture_comment(tctx, "(%s) incorrect status %s should be %s\n",
                       __location__, nt_errstr(status),
@@ -1571,7 +1565,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
                goto fail;
        }
 
-       status = smb_raw_open(cli_dos->tree, mem_ctx, &io);
+       status = smb_raw_open(cli_dos->tree, tctx, &io);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS, ERRfilexists))) {
                torture_comment(tctx, "(%s) incorrect status %s should be %s\n",
                       __location__, nt_errstr(status),
@@ -1644,7 +1638,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
                io.ntcreatex.in.fname = fname;
                io.ntcreatex.in.flags = 0;
 
-               status = smb_raw_open(cli_nt->tree, mem_ctx, &io);
+               status = smb_raw_open(cli_nt->tree, tctx, &io);
                if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_A_DIRECTORY)) {
                        torture_comment(tctx, "ntcreate as dir gave %s, "
                                        "expected NT_STATUS_NOT_A_DIRECTORY\n",
@@ -1656,7 +1650,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
                        smbcli_close(cli_nt->tree, io.ntcreatex.out.file.fnum);
                }
 
-               status = smb_raw_open(cli_dos->tree, mem_ctx, &io);
+               status = smb_raw_open(cli_dos->tree, tctx, &io);
                if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS,
                                                           ERRbaddirectory))) {
                        torture_comment(tctx, "ntcreate as dir gave %s, "
index c19b08e617ad419304fa947104f5f5475aa854f5..f11b90f44884e91b6e3d49f5c50b512281e49aa8 100644 (file)
@@ -823,6 +823,7 @@ static struct composite_context *torture_connect_async(
        smb->in.credentials=cmdline_credentials;
        smb->in.fallback_to_anonymous=false;
        smb->in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx);
+       smb->in.gensec_settings = lp_gensec_settings(mem_ctx, 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 9e2456d2361d93d1a8733edef1d2e8a948527fbc..c9cb715a8b48c028b7b65da74ec94751d5a48840 100644 (file)
@@ -246,7 +246,8 @@ static bool connect_servers(struct event_context *ev,
                                                                     lp_resolve_context(lp_ctx), ev,
                                                                     &smb_options,
                                                                     &smb_session_options,
-                                                                        lp_iconv_convenience(lp_ctx));
+                                                                        lp_iconv_convenience(lp_ctx),
+                                                                        lp_gensec_settings(lp_ctx, lp_ctx));
                        }
                        if (!NT_STATUS_IS_OK(status)) {
                                printf("Failed to connect to \\\\%s\\%s - %s\n",
index 4beef98a8ff07cc79093a95effdb83f90a58595e..18c4156cc345d425e1b6325a20b0e477afd37b58 100644 (file)
@@ -168,7 +168,8 @@ static struct smbcli_state *connect_one(struct event_context *ev,
                                                servers[snum], 
                                                lp_resolve_context(lp_ctx),
                                                ev, &options, &session_options,
-                                               lp_iconv_convenience(lp_ctx));
+                                               lp_iconv_convenience(lp_ctx),
+                                               lp_gensec_settings(mem_ctx, lp_ctx));
                if (!NT_STATUS_IS_OK(status)) {
                        sleep(2);
                }
index e7cbf13c74eb4a4ef1c2c43427ff121bdd24a44d..cb435c7b55109b50d97cbe5bd8c9807b037137da 100644 (file)
@@ -144,6 +144,7 @@ static struct smbcli_state *connect_one(TALLOC_CTX *mem_ctx,
                                                                                char *share, const char **ports,
                                        struct smb_options *options,
                                        struct smb_options *session_options,
+                                       struct gensec_settings *gensec_settings,
                                        struct event_context *ev)
 {
        struct smbcli_state *c;
@@ -173,7 +174,7 @@ static struct smbcli_state *connect_one(TALLOC_CTX *mem_ctx,
        nt_status = smbcli_full_connection(NULL, 
                           &c, myname, server_n, ports, share, NULL,
                           username, lp_workgroup(), password, ev,
-                          options, session_options);
+                          options, session_options, gensec_settings);
        if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(0, ("smbcli_full_connection failed with error %s\n", nt_errstr(nt_status)));
                return NULL;
@@ -192,6 +193,7 @@ static void reconnect(TALLOC_CTX *mem_ctx,
                      const char **ports,
                      struct smbcli_options *options,
                      struct smbcli_session_options *session_options,
+                         struct gensec_settings *gensec_settings,
                      struct event_context *ev,
                      char *share1, char *share2)
 {
@@ -211,7 +213,7 @@ static void reconnect(TALLOC_CTX *mem_ctx,
                        smbcli_ulogoff(cli[server][conn]);
                        talloc_free(cli[server][conn]);
                }
-               cli[server][conn] = connect_one(mem_ctx, share[server], ports, options, session_options, ev);
+               cli[server][conn] = connect_one(mem_ctx, share[server], ports, options, session_options, gensec_settings, ev);
                if (!cli[server][conn]) {
                        DEBUG(0,("Failed to connect to %s\n", share[server]));
                        exit(1);
@@ -362,6 +364,7 @@ static void test_locks(TALLOC_CTX *mem_ctx, char *share1, char *share2,
                        const char **ports,
                        struct smbcli_options *options,
                        struct smbcli_session_options *session_options,
+                       struct gensec_settings *gensec_settings,
                        struct event_context *ev)
 {
        struct smbcli_state *cli[NSERVERS][NCONNECTIONS];
@@ -391,7 +394,7 @@ static void test_locks(TALLOC_CTX *mem_ctx, char *share1, char *share2,
                recorded[n].needed = true;
        }
 
-       reconnect(mem_ctx, cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
+       reconnect(mem_ctx, cli, nfs, fnum, ports, options, session_options, gensec_settings, ev, share1, share2);
        open_files(cli, nfs, fnum);
        n = retest(cli, nfs, fnum, numops);
 
@@ -429,7 +432,7 @@ static void test_locks(TALLOC_CTX *mem_ctx, char *share1, char *share2,
        }
 
        close_files(cli, nfs, fnum);
-       reconnect(mem_ctx, cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
+       reconnect(mem_ctx, cli, nfs, fnum, ports, options, session_options, gensec_settings, ev, share1, share2);
        open_files(cli, nfs, fnum);
        showall = true;
        n1 = retest(cli, nfs, fnum, n);
@@ -567,8 +570,9 @@ static void usage(void)
        locking_init(1);
        lp_smbcli_options(lp_ctx, &options);
        lp_smbcli_session_options(lp_ctx, &session_options);
-       test_locks(mem_ctx, share1, share2, nfspath1, nfspath2, lp_smb_ports(lp_ctx),
-                  &options, &session_options, ev);
+       test_locks(mem_ctx, share1, share2, nfspath1, nfspath2, 
+                          lp_smb_ports(lp_ctx),
+                          &options, &session_options, lp_gensec_settings(lp_ctx), ev);
 
        return(0);
 }
index fb1277a95ab3191e0f77859c5f01a721b2e90be3..9ff790c2b00a20602e59305cd85346fddf4fabc5 100644 (file)
@@ -79,7 +79,8 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
                                        const char *socket_options,
                                        struct smbcli_options *options,
                                        struct smbcli_session_options *session_options,
-                                       struct smb_iconv_convenience *iconv_convenience)
+                                       struct smb_iconv_convenience *iconv_convenience,
+                                       struct gensec_settings *gensec_settings)
 {
        struct smbcli_state *c;
        char *server;
@@ -100,7 +101,8 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
                                        socket_options,
                                        cmdline_credentials, resolve_ctx, ev,
                                        options, session_options,
-                                       iconv_convenience);
+                                       iconv_convenience,
+                                       gensec_settings);
 
        if (!NT_STATUS_IS_OK(status)) {
                return NULL;
@@ -372,7 +374,8 @@ static void usage(poptContext pc)
        cli = connect_one(lp_resolve_context(lp_ctx), ev, mem_ctx, share, 
                          lp_smb_ports(lp_ctx), lp_socket_options(lp_ctx), 
                          &options, &session_options,
-                         lp_iconv_convenience(lp_ctx));
+                         lp_iconv_convenience(lp_ctx),
+                         lp_gensec_settings(mem_ctx, lp_ctx));
        if (!cli) {
                DEBUG(0,("Failed to connect to %s\n", share));
                exit(1);
index 6eb4fe0e67e98abe4cdad17141d0909f1f6ec9eb..79ae41dafb984e807709e9ed43931defa4599263 100644 (file)
@@ -164,6 +164,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct
        io2.in.filename = fname;
        io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx);
        io2.in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx);
+       io2.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
        lp_smbcli_options(tctx->lp_ctx, &io2.in.options);
        lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options);
 
@@ -355,6 +356,7 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx)
        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);
+       io1.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
 
        printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops);
 
index 6b59b35b5d8b07e4f0e8b0a4f48dd7333c6dc667..dce21ebe71d522687a8ae33393dbd7375b7b0194 100644 (file)
@@ -188,6 +188,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
 
        io->in.dest_host    = state->dest_host;
        io->in.dest_ports   = state->dest_ports;
+       io->in.gensec_settings = lp_gensec_settings(state->mem_ctx, state->tctx->lp_ctx);
        io->in.socket_options = lp_socket_options(state->tctx->lp_ctx);
        io->in.called_name  = state->called_name;
        io->in.service      = share;
index e2d52f6c029f8a3fa90f7a9f2f56efa88d079fd9..2440649e7f89b982f4e7f27042ecf6a409c1057d 100644 (file)
@@ -137,6 +137,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.gensec_settings = lp_gensec_settings(state->mem_ctx, 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 86dae6bc1fd6f8a7618bb1a4656ee0dd2a6fce1d..4ffb24eb03189edd873ac846e2fb0737804842d1 100644 (file)
@@ -190,7 +190,8 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx,
                                        NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials,
                                        lp_resolve_context(tctx->lp_ctx),
                                        tctx->ev, &options, &session_options,
-                                       lp_iconv_convenience(tctx->lp_ctx));
+                                       lp_iconv_convenience(tctx->lp_ctx),
+                                       lp_gensec_settings(tctx, tctx->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to open connection - %s\n", nt_errstr(status));
                return false;
index 1615b5322a5f9e72cb246ca735421547169f71f6..0109b65481b8fbf944296abcd814145aeb820a1f 100644 (file)
@@ -103,7 +103,8 @@ static int fork_tcon_client(struct torture_context *tctx,
                                NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials,
                                lp_resolve_context(tctx->lp_ctx),
                                tctx->ev, &options, &session_options,
-                               lp_iconv_convenience(tctx->lp_ctx));
+                               lp_iconv_convenience(tctx->lp_ctx),
+                               lp_gensec_settings(tctx, tctx->lp_ctx));
 
                if (!NT_STATUS_IS_OK(status)) {
                        printf("failed to connect to //%s/%s: %s\n",
index 9d6c803ad7163043502bce0c90f099327fbe86b0..b0c122c1b6d54e7e0d789c8af9ec2ee2192dfba1 100644 (file)
@@ -43,7 +43,8 @@ bool torture_rpc_join(struct torture_context *torture)
                                        machine_account,
                                        lp_resolve_context(torture->lp_ctx),
                                        torture->ev, &options, &session_options,
-                                       lp_iconv_convenience(torture->lp_ctx));
+                                       lp_iconv_convenience(torture->lp_ctx),
+                                       lp_gensec_settings(torture, torture->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
                          TORTURE_NETBIOS_NAME));
@@ -71,7 +72,8 @@ bool torture_rpc_join(struct torture_context *torture)
                                        machine_account,
                                        lp_resolve_context(torture->lp_ctx),
                                        torture->ev, &options, &session_options,
-                                       lp_iconv_convenience(torture->lp_ctx));
+                                       lp_iconv_convenience(torture->lp_ctx),
+                                       lp_gensec_settings(torture, 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 73c2044449efd045f033815d8f6c99f697d4cd6d..c2b849127fa6574c75509422d26d3b7a93d09f79 100644 (file)
@@ -94,7 +94,8 @@ bool torture_bind_authcontext(struct torture_context *torture)
                                        cmdline_credentials,
                                        lp_resolve_context(torture->lp_ctx),
                                        torture->ev, &options, &session_options,
-                                       lp_iconv_convenience(torture->lp_ctx));
+                                       lp_iconv_convenience(torture->lp_ctx),
+                                       lp_gensec_settings(torture, torture->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("smbcli_full_connection failed: %s\n",
                         nt_errstr(status));
@@ -316,7 +317,8 @@ bool torture_bind_samba3(struct torture_context *torture)
                                        cmdline_credentials,
                                        lp_resolve_context(torture->lp_ctx),
                                        torture->ev, &options, &session_options,
-                                       lp_iconv_convenience(torture->lp_ctx));
+                                       lp_iconv_convenience(torture->lp_ctx),
+                                       lp_gensec_settings(torture, torture->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("smbcli_full_connection failed: %s\n",
                         nt_errstr(status));
@@ -1254,7 +1256,8 @@ bool torture_netlogon_samba3(struct torture_context *torture)
                                        anon_creds, 
                                        lp_resolve_context(torture->lp_ctx),
                                        torture->ev, &options, &session_options,
-                                       lp_iconv_convenience(torture->lp_ctx));
+                                       lp_iconv_convenience(torture->lp_ctx),
+                                       lp_gensec_settings(torture, torture->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("smbcli_full_connection failed: %s\n",
                         nt_errstr(status));
@@ -1344,7 +1347,8 @@ static bool test_join3(struct torture_context *tctx,
                                        "IPC$", NULL, lp_socket_options(tctx->lp_ctx),
                                        smb_creds, lp_resolve_context(tctx->lp_ctx),
                                        tctx->ev, &options, &session_options,
-                                       lp_iconv_convenience(tctx->lp_ctx));
+                                       lp_iconv_convenience(tctx->lp_ctx),
+                                       lp_gensec_settings(tctx, tctx->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("smbcli_full_connection failed: %s\n",
                         nt_errstr(status));
@@ -1727,7 +1731,8 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
                "IPC$", NULL, lp_socket_options(torture->lp_ctx), cmdline_credentials, 
                lp_resolve_context(torture->lp_ctx),
                torture->ev, &options, &session_options,
-               lp_iconv_convenience(torture->lp_ctx));
+               lp_iconv_convenience(torture->lp_ctx),
+               lp_gensec_settings(torture, torture->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("(%s) smbcli_full_connection failed: %s\n",
                         __location__, nt_errstr(status));
@@ -1755,7 +1760,8 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
                lp_socket_options(torture->lp_ctx), anon_creds, 
                lp_resolve_context(torture->lp_ctx),
                torture->ev, &options, &session_options,
-               lp_iconv_convenience(torture->lp_ctx));
+               lp_iconv_convenience(torture->lp_ctx),
+               lp_gensec_settings(torture, torture->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("(%s) anon smbcli_full_connection failed: %s\n",
                         __location__, nt_errstr(status));
index 2e451e199907d481b87c7577d18ebdd04e23063a..d0a2c3d041ca377bc1d1e3e67807dd0afcae0b7c 100644 (file)
@@ -67,7 +67,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx)
                                        cmdline_credentials, 
                                        lp_resolve_context(tctx->lp_ctx),
                                        tctx->ev, &options, &session_options,
-                                       lp_iconv_convenience(tctx->lp_ctx));
+                                       lp_iconv_convenience(tctx->lp_ctx),
+                                       lp_gensec_settings(tctx, tctx->lp_ctx));
 
        if (!NT_STATUS_IS_OK(status)) {
                printf("failed to connect to //%s/%s: %s\n",
index f3a6acee506888fad8c237ff1e674fb06a416d6d..5e5a5e81cde1e8f38434e83b44f03a54b972a66c 100644 (file)
@@ -87,7 +87,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx,
                                        share, NULL, lp_socket_options(tctx->lp_ctx),
                                        creds, lp_resolve_context(tctx->lp_ctx),
                                        tctx->ev, &options, &session_options,
-                                       lp_iconv_convenience(tctx->lp_ctx));
+                                       lp_iconv_convenience(tctx->lp_ctx),
+                                       lp_gensec_settings(tctx, tctx->lp_ctx));
 
        if (!NT_STATUS_IS_OK(status)) {
                printf("failed to connect to //%s/%s: %s\n",
index 5157369a78e2c536ef2dbe45596af3ff272da0ea..ae051b9735f7900aa397cb603c1b15be68017538 100644 (file)
@@ -490,7 +490,8 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
                                        cmdline_credentials, 
                                        lp_resolve_context(tctx->lp_ctx),
                                        ev, &options, &session_options,
-                                       lp_iconv_convenience(tctx->lp_ctx));
+                                       lp_iconv_convenience(tctx->lp_ctx),
+                                       lp_gensec_settings(tctx, tctx->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to open connection - %s\n", nt_errstr(status));
                return false;