diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-02 18:39:15 -0600 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-01-02 12:48:04 -0600 |
commit | 969b8579c755441092e27b499ecedbd7d725816d (patch) | |
tree | 2b6ed0049c7afc7624ec81b559aad1d179a6b398 | |
parent | 40acf23a927b7fcabad621cadabb9c7476c8d5e9 (diff) | |
download | samba-969b8579c755441092e27b499ecedbd7d725816d.tar.gz samba-969b8579c755441092e27b499ecedbd7d725816d.tar.bz2 samba-969b8579c755441092e27b499ecedbd7d725816d.zip |
r26646: libcli/smb_composite: Allow specifying SMB parameters in smb_composite_connect structure. AFAIK no global variables will now be used when doing RPC client connections.
(This used to be commit 0ef75e4e3cb0e1bd10e367a00f5e9b725587c40a)
-rw-r--r-- | source4/libcli/raw/clitree.c | 8 | ||||
-rw-r--r-- | source4/libcli/smb_composite/connect.c | 9 | ||||
-rw-r--r-- | source4/libcli/smb_composite/fetchfile.c | 8 | ||||
-rw-r--r-- | source4/libcli/smb_composite/fsinfo.c | 8 | ||||
-rw-r--r-- | source4/libcli/smb_composite/smb_composite.h | 6 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_connect.c | 7 | ||||
-rw-r--r-- | source4/ntvfs/cifs/vfs_cifs.c | 6 | ||||
-rw-r--r-- | source4/scripting/ejs/smbcalls_cli.c | 6 | ||||
-rw-r--r-- | source4/torture/basic/misc.c | 6 | ||||
-rw-r--r-- | source4/torture/raw/lockbench.c | 6 | ||||
-rw-r--r-- | source4/torture/raw/openbench.c | 6 |
11 files changed, 71 insertions, 5 deletions
diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c index 6b14893c4e..94fa37383b 100644 --- a/source4/libcli/raw/clitree.c +++ b/source4/libcli/raw/clitree.c @@ -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)) { diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c index b71cfc2c19..bdefe39b71 100644 --- a/source4/libcli/smb_composite/connect.c +++ b/source4/libcli/smb_composite/connect.c @@ -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) && diff --git a/source4/libcli/smb_composite/fetchfile.c b/source4/libcli/smb_composite/fetchfile.c index f3934a2123..893eb854f5 100644 --- a/source4/libcli/smb_composite/fetchfile.c +++ b/source4/libcli/smb_composite/fetchfile.c @@ -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; diff --git a/source4/libcli/smb_composite/fsinfo.c b/source4/libcli/smb_composite/fsinfo.c index 2d8240572e..bf425ad7c8 100644 --- a/source4/libcli/smb_composite/fsinfo.c +++ b/source4/libcli/smb_composite/fsinfo.c @@ -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); diff --git a/source4/libcli/smb_composite/smb_composite.h b/source4/libcli/smb_composite/smb_composite.h index 5574495079..41ce4b03bd 100644 --- a/source4/libcli/smb_composite/smb_composite.h +++ b/source4/libcli/smb_composite/smb_composite.h @@ -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; diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c index 4c11a56272..26bccbbad7 100644 --- a/source4/librpc/rpc/dcerpc_connect.c +++ b/source4/librpc/rpc/dcerpc_connect.c @@ -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 diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c index adfea6d2a2..0b4cbb8a13 100644 --- a/source4/ntvfs/cifs/vfs_cifs.c +++ b/source4/ntvfs/cifs/vfs_cifs.c @@ -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), diff --git a/source4/scripting/ejs/smbcalls_cli.c b/source4/scripting/ejs/smbcalls_cli.c index bb1e445d04..b66318dc3d 100644 --- a/source4/scripting/ejs/smbcalls_cli.c +++ b/source4/scripting/ejs/smbcalls_cli.c @@ -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), diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c index ccff18bfc4..f4cb47e7ba 100644 --- a/source4/torture/basic/misc.c +++ b/source4/torture/basic/misc.c @@ -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); diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c index 9131128f81..28392880d7 100644 --- a/source4/torture/raw/lockbench.c +++ b/source4/torture/raw/lockbench.c @@ -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); diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c index 881f487cb0..4b6c76488f 100644 --- a/source4/torture/raw/openbench.c +++ b/source4/torture/raw/openbench.c @@ -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); |