libcli/smb_composite: Allow specifying SMB parameters in smb_composite_connect struct...
authorjelmer <jelmer@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Wed, 2 Jan 2008 18:39:15 +0000 (18:39 +0000)
committerjelmer <jelmer@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Wed, 2 Jan 2008 18:39:15 +0000 (18:39 +0000)
git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@26646 0c0555d6-39d7-0310-84fc-f1cc0bd64818

source/libcli/raw/clitree.c
source/libcli/smb_composite/connect.c
source/libcli/smb_composite/fetchfile.c
source/libcli/smb_composite/fsinfo.c
source/libcli/smb_composite/smb_composite.h
source/librpc/rpc/dcerpc_connect.c
source/ntvfs/cifs/vfs_cifs.c
source/scripting/ejs/smbcalls_cli.c
source/torture/basic/misc.c
source/torture/raw/lockbench.c
source/torture/raw/openbench.c

index 6b14893c4e9da34bb999de5caed737d4438c08a7..94fa37383bb1a242ea3265853c505ef406a19668 100644 (file)
@@ -192,6 +192,14 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
        io.in.credentials = credentials;
        io.in.fallback_to_anonymous = false;
        io.in.workgroup = lp_workgroup(global_loadparm);
+       io.in.max_xmit = lp_max_xmit(global_loadparm);
+       io.in.max_mux = lp_maxmux(global_loadparm);
+       io.in.ntstatus_support = lp_nt_status_support(global_loadparm);
+       io.in.max_protocol = lp_cli_maxprotocol(global_loadparm);
+       io.in.unicode = lp_unicode(global_loadparm);
+       io.in.use_spnego = lp_use_spnego(global_loadparm) && lp_nt_status_support(global_loadparm);
+
+
        
        status = smb_composite_connect(&io, parent_ctx, resolve_ctx, ev);
        if (NT_STATUS_IS_OK(status)) {
index b71cfc2c19b05c6dfc193ea074873852cf2f63c2..bdefe39b717b3fbb410be7aeda4203d6876cf08d 100644 (file)
@@ -63,8 +63,7 @@ static NTSTATUS connect_send_negprot(struct composite_context *c,
 {
        struct connect_state *state = talloc_get_type(c->private_data, struct connect_state);
 
-       state->req = smb_raw_negotiate_send(state->transport, lp_unicode(global_loadparm),
-                                           lp_cli_maxprotocol(global_loadparm));
+       state->req = smb_raw_negotiate_send(state->transport, io->in.unicode, io->in.max_protocol);
        NT_STATUS_HAVE_NO_MEMORY(state->req);
 
        state->req->async.fn = request_handler;
@@ -308,9 +307,9 @@ 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, 
-                                                lp_max_xmit(global_loadparm),
-                                                lp_maxmux(global_loadparm),
-                                                lp_use_spnego(global_loadparm) && lp_nt_status_support(global_loadparm));
+                                                io->in.max_xmit,
+                                                io->in.max_mux,
+                                                io->in.use_spnego);
        NT_STATUS_HAVE_NO_MEMORY(state->transport);
 
        if (is_ipaddress(state->sock->hostname) &&
index f3934a212321237a42af6e1035a1c2ea229fbb06..893eb854f5c91ea98db37df654d41e6ff6989c6d 100644 (file)
@@ -147,6 +147,14 @@ struct composite_context *smb_composite_fetchfile_send(struct smb_composite_fetc
        state->connect->in.fallback_to_anonymous = false;
        state->connect->in.workgroup    = io->in.workgroup;
 
+       state->connect->in.max_xmit = lp_max_xmit(global_loadparm);
+       state->connect->in.max_mux = lp_maxmux(global_loadparm);
+       state->connect->in.ntstatus_support = lp_nt_status_support(global_loadparm);
+       state->connect->in.max_protocol = lp_cli_maxprotocol(global_loadparm);
+       state->connect->in.unicode = lp_unicode(global_loadparm);
+       state->connect->in.use_spnego = lp_use_spnego(global_loadparm) && 
+               lp_nt_status_support(global_loadparm);
+
        state->creq = smb_composite_connect_send(state->connect, state, 
                                                 lp_resolve_context(global_loadparm), event_ctx);
        if (state->creq == NULL) goto failed;
index 2d8240572e4500fe6b568462d4775bd3f1e6275c..bf425ad7c8b17c39d91905edda83b361053c6c9e 100644 (file)
@@ -153,6 +153,14 @@ 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.max_xmit = lp_max_xmit(global_loadparm);
+       state->connect->in.max_mux = lp_maxmux(global_loadparm);
+       state->connect->in.ntstatus_support = lp_nt_status_support(global_loadparm);
+       state->connect->in.max_protocol = lp_cli_maxprotocol(global_loadparm);
+       state->connect->in.unicode = lp_unicode(global_loadparm);
+       state->connect->in.use_spnego = lp_use_spnego(global_loadparm) && 
+               lp_nt_status_support(global_loadparm);
+
        c->state = COMPOSITE_STATE_IN_PROGRESS;
        state->stage = FSINFO_CONNECT;
        c->event_ctx = talloc_reference(c,  tree->session->transport->socket->event.ctx);
index 5574495079d861f216b6d11c182db63a3239215d..41ce4b03bd7b2b18f96f18f0fb9dfbe0181446c2 100644 (file)
@@ -91,6 +91,12 @@ struct smb_composite_connect {
                struct cli_credentials *credentials;
                bool fallback_to_anonymous;
                const char *workgroup;
+               bool use_spnego;
+               bool ntstatus_support;
+               bool unicode;
+               int max_xmit;
+               int max_mux;
+               int max_protocol;
        } in;
        struct {
                struct smbcli_tree *tree;
index 4c11a56272bfa69f202bd4b0915c605cc7ddfbc5..26bccbbad7e2d1f548b8bd8d0dfec161d949f468 100644 (file)
@@ -119,6 +119,13 @@ 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.max_xmit = lp_max_xmit(lp_ctx);
+       conn->in.max_mux = lp_maxmux(lp_ctx);
+       conn->in.ntstatus_support = lp_nt_status_support(lp_ctx);
+       conn->in.max_protocol = lp_cli_maxprotocol(lp_ctx);
+       conn->in.unicode = lp_unicode(lp_ctx);
+       conn->in.use_spnego = lp_use_spnego(lp_ctx) && lp_nt_status_support(lp_ctx);
+
        /*
         * provide proper credentials - user supplied, but allow a
         * fallback to anonymous if this is an schannel connection
index adfea6d2a2806a5c089b0dd790fd7a195ef5c57c..0b4cbb8a130ce5c9b5d3f9099b731119618f99e7 100644 (file)
@@ -202,6 +202,12 @@ 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.max_xmit = lp_max_xmit(ntvfs->ctx->lp_ctx);
+       io.in.max_mux = lp_maxmux(ntvfs->ctx->lp_ctx);
+       io.in.ntstatus_support = lp_nt_status_support(ntvfs->ctx->lp_ctx);
+       io.in.max_protocol = lp_cli_maxprotocol(ntvfs->ctx->lp_ctx);
+       io.in.unicode = lp_unicode(ntvfs->ctx->lp_ctx);
+       io.in.use_spnego = lp_use_spnego(ntvfs->ctx->lp_ctx) && lp_nt_status_support(ntvfs->ctx->lp_ctx);
        
        creq = smb_composite_connect_send(&io, private, 
                                          lp_resolve_context(ntvfs->ctx->lp_ctx),
index bb1e445d04c6bf81151892d6d646b918407a2b74..b66318dc3d3e372e18fc57c9b190ce004f57eb6b 100644 (file)
@@ -445,6 +445,12 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv)
        io.in.credentials            = creds;
        io.in.fallback_to_anonymous  = false;
        io.in.workgroup              = lp_workgroup(global_loadparm);
+       io.in.max_xmit = lp_max_xmit(global_loadparm);
+       io.in.max_mux = lp_maxmux(global_loadparm);
+       io.in.ntstatus_support = lp_nt_status_support(global_loadparm);
+       io.in.max_protocol = lp_cli_maxprotocol(global_loadparm);
+       io.in.unicode = lp_unicode(global_loadparm);
+       io.in.use_spnego = lp_use_spnego(global_loadparm) && lp_nt_status_support(global_loadparm);
 
        result = smb_composite_connect(&io, mem_ctx, 
                                       lp_resolve_context(global_loadparm), 
index ccff18bfc491734e4331142bcf6c29f6fcdaac28..f4cb47e7ba958e2e7aa5c268b19a45036576817d 100644 (file)
@@ -821,6 +821,12 @@ static struct composite_context *torture_connect_async(
        smb->in.credentials=cmdline_credentials;
        smb->in.fallback_to_anonymous=false;
        smb->in.workgroup=workgroup;
+       smb->in.max_xmit = lp_max_xmit(tctx->lp_ctx);
+       smb->in.max_mux = lp_maxmux(tctx->lp_ctx);
+       smb->in.ntstatus_support = lp_nt_status_support(tctx->lp_ctx);
+       smb->in.max_protocol = lp_cli_maxprotocol(tctx->lp_ctx);
+       smb->in.unicode = lp_unicode(tctx->lp_ctx);
+       smb->in.use_spnego = lp_use_spnego(tctx->lp_ctx) && lp_nt_status_support(tctx->lp_ctx);
        
        return smb_composite_connect_send(smb,mem_ctx,
                                          lp_resolve_context(tctx->lp_ctx),ev);
index 9131128f81d26b0cd14f404007d14d422ec08bc6..28392880d75e1d29d589e77318c5c6699f077e42 100644 (file)
@@ -193,6 +193,12 @@ 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.max_xmit = lp_max_xmit(state->tctx->lp_ctx);
+       io->in.max_mux = lp_maxmux(state->tctx->lp_ctx);
+       io->in.ntstatus_support = lp_nt_status_support(state->tctx->lp_ctx);
+       io->in.max_protocol = lp_cli_maxprotocol(state->tctx->lp_ctx);
+       io->in.unicode = lp_unicode(state->tctx->lp_ctx);
+       io->in.use_spnego = lp_use_spnego(state->tctx->lp_ctx) && lp_nt_status_support(state->tctx->lp_ctx);
 
        /* kill off the remnants of the old connection */
        talloc_free(state->tree);
index 881f487cb061ae96ea334db8019a7a85ae03d7d9..4b6c76488f77e954cecb94d28fc23b983e9f5e39 100644 (file)
@@ -131,6 +131,12 @@ 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.max_xmit = lp_max_xmit(state->tctx->lp_ctx);
+       io->in.max_mux = lp_maxmux(state->tctx->lp_ctx);
+       io->in.ntstatus_support = lp_nt_status_support(state->tctx->lp_ctx);
+       io->in.max_protocol = lp_cli_maxprotocol(state->tctx->lp_ctx);
+       io->in.unicode = lp_unicode(state->tctx->lp_ctx);
+       io->in.use_spnego = lp_use_spnego(state->tctx->lp_ctx) && lp_nt_status_support(state->tctx->lp_ctx);
 
        /* kill off the remnants of the old connection */
        talloc_free(state->tree);