Pass session options around; saves another use of global_loadparm.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 30 Sep 2008 00:47:19 +0000 (02:47 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 30 Sep 2008 00:47:19 +0000 (02:47 +0200)
12 files changed:
source4/auth/ntlm/auth_server.c
source4/libcli/raw/clitree.c
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/torture/basic/misc.c
source4/torture/raw/composite.c
source4/torture/raw/lockbench.c
source4/torture/raw/openbench.c

index bb8773e75e536677d91aaa8937c153d82e8108ba..539ae6aa80a1e9181cf3974dda437012415cc502 100644 (file)
@@ -80,6 +80,7 @@ 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;
+       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),
                                       ctx->auth_ctx->event_ctx);
index 15cd70833c7c0b13810525ef7dfa4e632cde958a..4b5d2dc39787baa1dd3cad6869adb38189043ca4 100644 (file)
@@ -177,7 +177,8 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
                                     struct cli_credentials *credentials,
                                     struct resolve_context *resolve_ctx,
                                     struct event_context *ev,
-                                    struct smbcli_options *options)
+                                    struct smbcli_options *options,
+                                    struct smbcli_session_options *session_options)
 {
        struct smb_composite_connect io;
        NTSTATUS status;
@@ -200,6 +201,7 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
         * is complete -- abartlet 2008-04-28 */
        io.in.workgroup = lp_workgroup(global_loadparm);
        io.in.options = *options;
+       io.in.session_options = *session_options;
        
        status = smb_composite_connect(&io, parent_ctx, resolve_ctx, ev);
        if (NT_STATUS_IS_OK(status)) {
index 5f651f486519fca6392f6663d1d52e7539bf34b3..a4137290bbcb714c44689d62964cc1d478c06a9d 100644 (file)
@@ -229,15 +229,12 @@ static NTSTATUS connect_negprot(struct composite_context *c,
 {
        struct connect_state *state = talloc_get_type(c->private_data, struct connect_state);
        NTSTATUS status;
-       struct smbcli_session_options options;
-
-       lp_smbcli_session_options(global_loadparm, &options);
 
        status = smb_raw_negotiate_recv(state->req);
        NT_STATUS_NOT_OK_RETURN(status);
 
        /* next step is a session setup */
-       state->session = smbcli_session_init(state->transport, state, true, options);
+       state->session = smbcli_session_init(state->transport, state, true, io->in.session_options);
        NT_STATUS_HAVE_NO_MEMORY(state->session);
        
        /* setup for a tconx (or at least have the structure ready to
index 9cd02a51f457b5f45299b2147418b0e52ac428fd..ff4f0e793026e4c8e8ff1e2cd3c9d4f74ca2c77e 100644 (file)
@@ -147,6 +147,7 @@ struct composite_context *smb_composite_fetchfile_send(struct smb_composite_fetc
        state->connect->in.workgroup    = io->in.workgroup;
 
        state->connect->in.options      = io->in.options;
+       state->connect->in.session_options = io->in.session_options;
 
        state->creq = smb_composite_connect_send(state->connect, state, 
                                                 io->in.resolve_ctx, event_ctx);
index cd6e98547b06e79e7cb207a976f3fd49964c5792..dc5327a29cac4b424c0c58c183e073e2190240de 100644 (file)
@@ -155,6 +155,7 @@ struct composite_context *smb_composite_fsinfo_send(struct smbcli_tree *tree,
        state->connect->in.workgroup    = io->in.workgroup;
 
        state->connect->in.options = tree->session->transport->options;
+       state->connect->in.session_options = tree->session->options;
 
        c->state = COMPOSITE_STATE_IN_PROGRESS;
        state->stage = FSINFO_CONNECT;
index 7f4b9d73e4b48da338817e9558b39018119b6a25..08ca40c833072ce4260e8b619f3f97762186a70b 100644 (file)
@@ -57,6 +57,7 @@ struct smb_composite_fetchfile {
                const char *workgroup;
                const char *filename;
                struct smbcli_options options;
+               struct smbcli_session_options session_options;
                struct resolve_context *resolve_ctx;
        } in;
        struct {
@@ -98,6 +99,7 @@ struct smb_composite_connect {
                bool fallback_to_anonymous;
                const char *workgroup;
                struct smbcli_options options;
+               struct smbcli_session_options session_options;
        } in;
        struct {
                struct smbcli_tree *tree;
index 7bdca2d98631e57f3094b637055a2aa7fc6ce468..b117a98270a1f912e006c8be92284d51395900ed 100644 (file)
@@ -121,6 +121,7 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT
        conn->in.workgroup              = lp_workgroup(lp_ctx);
 
        lp_smbcli_options(lp_ctx, &conn->in.options);
+       lp_smbcli_session_options(lp_ctx, &conn->in.session_options);
 
        /*
         * provide proper credentials - user supplied, but allow a
index 844fa11cc5f584df597b0c791386b07354d08c98..9bc36a176266d61510db9cc668b51ae946681faf 100644 (file)
@@ -206,6 +206,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
        io.in.service = remote_share;
        io.in.service_type = "?????";
        lp_smbcli_options(ntvfs->ctx->lp_ctx, &io.in.options);
+       lp_smbcli_session_options(ntvfs->ctx->lp_ctx, &io.in.session_options);
 
        if (!(ntvfs->ctx->client_caps & NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS)) {
                io.in.options.use_level2_oplocks = false;
index 24e0324bc3e303bbe5fc6554b2565e2de3527d44..c129fd586be03a1435c2123d5e3e26671f6d98e9 100644 (file)
@@ -823,6 +823,7 @@ static struct composite_context *torture_connect_async(
        smb->in.fallback_to_anonymous=false;
        smb->in.workgroup=workgroup;
        lp_smbcli_options(tctx->lp_ctx, &smb->in.options);
+       lp_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options);
        
        return smb_composite_connect_send(smb,mem_ctx,
                                          lp_resolve_context(tctx->lp_ctx),ev);
index a151854e59b705ebb73f0ec99f00630b3c99fe95..7f1f5943e1c95fca65bf91c6c618d5145f74f3ae 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);
        lp_smbcli_options(tctx->lp_ctx, &io2.in.options);
+       lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options);
 
        printf("testing parallel fetchfile with %d ops\n", torture_numops);
 
index 21541d003b18eb9ad4ee13b496199eeb8881e8f7..26fad4235e9e793ae097d6fe1e248e43f047c7f5 100644 (file)
@@ -195,6 +195,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
        io->in.fallback_to_anonymous = false;
        io->in.workgroup    = lp_workgroup(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);
 
        /* kill off the remnants of the old connection */
        talloc_free(state->tree);
index 26b862c33f1d1255387ab0fae2e27049e6dcee75..ec94637445a3b0f73a3488342ff4be7b0c1237ce 100644 (file)
@@ -137,6 +137,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
        io->in.fallback_to_anonymous = false;
        io->in.workgroup    = lp_workgroup(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);
 
        /* kill off the remnants of the old connection */
        talloc_free(state->tree);