diff options
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/cliconnect.c | 12 | ||||
-rw-r--r-- | source4/libcli/raw/clitransport.c | 12 | ||||
-rw-r--r-- | source4/libcli/raw/clitree.c | 12 | ||||
-rw-r--r-- | source4/libcli/raw/libcliraw.h | 3 | ||||
-rw-r--r-- | source4/libcli/smb_composite/connect.c | 7 | ||||
-rw-r--r-- | source4/libcli/smb_composite/fetchfile.c | 9 | ||||
-rw-r--r-- | source4/libcli/smb_composite/fsinfo.c | 9 | ||||
-rw-r--r-- | source4/libcli/smb_composite/smb_composite.h | 9 |
8 files changed, 20 insertions, 53 deletions
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c index c1fadaa679..666dfe8446 100644 --- a/source4/libcli/cliconnect.c +++ b/source4/libcli/cliconnect.c @@ -33,8 +33,7 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server, const char **ports, struct resolve_context *resolve_ctx, - int max_xmit, int max_mux, bool use_spnego, - enum smb_signing_state signing) + struct smbcli_options *options) { struct smbcli_socket *sock; @@ -43,8 +42,7 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server, if (sock == NULL) return false; - cli->transport = smbcli_transport_init(sock, cli, true, max_xmit, - max_mux, use_spnego, signing); + cli->transport = smbcli_transport_init(sock, cli, true, options); if (!cli->transport) { return false; } @@ -143,7 +141,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx, const char *devtype, struct cli_credentials *credentials, struct resolve_context *resolve_ctx, - struct event_context *ev) + struct event_context *ev, + struct smbcli_options *options) { struct smbcli_tree *tree; NTSTATUS status; @@ -153,7 +152,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx, status = smbcli_tree_full_connection(parent_ctx, &tree, host, ports, sharename, devtype, - credentials, resolve_ctx, ev); + credentials, resolve_ctx, ev, + options); if (!NT_STATUS_IS_OK(status)) { goto done; } diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index 3ca828d46b..62c32d3058 100644 --- a/source4/libcli/raw/clitransport.c +++ b/source4/libcli/raw/clitransport.c @@ -74,10 +74,7 @@ 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, - int max_xmit, - int max_mux, - bool use_spnego, - enum smb_signing_state signing) + struct smbcli_options *options) { struct smbcli_transport *transport; @@ -90,12 +87,7 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock, transport->socket = talloc_reference(transport, sock); } transport->negotiate.protocol = PROTOCOL_NT1; - transport->options.use_spnego = use_spnego; - transport->options.max_xmit = max_xmit; - transport->options.max_mux = max_mux; - transport->options.request_timeout = SMB_REQUEST_TIMEOUT; - transport->options.signing = signing; - + transport->options = *options; transport->negotiate.max_xmit = transport->options.max_xmit; /* setup the stream -> packet parser */ diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c index 3d8a6760a1..ae63d94acd 100644 --- a/source4/libcli/raw/clitree.c +++ b/source4/libcli/raw/clitree.c @@ -175,7 +175,8 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx, const char *service, const char *service_type, struct cli_credentials *credentials, struct resolve_context *resolve_ctx, - struct event_context *ev) + struct event_context *ev, + struct smbcli_options *options) { struct smb_composite_connect io; NTSTATUS status; @@ -191,14 +192,7 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx, io.in.service_type = service_type; 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); - io.in.signing = lp_client_signing(global_loadparm); + io.in.options = *options; status = smb_composite_connect(&io, parent_ctx, resolve_ctx, ev); if (NT_STATUS_IS_OK(status)) { diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h index dd6904dec2..0032eb4e94 100644 --- a/source4/libcli/raw/libcliraw.h +++ b/source4/libcli/raw/libcliraw.h @@ -94,6 +94,9 @@ struct smbcli_options { uint_t use_oplocks:1; uint_t use_level2_oplocks:1; uint_t use_spnego:1; + uint_t unicode:1; + uint_t ntstatus_support:1; + int max_protocol; uint32_t max_xmit; uint16_t max_mux; int request_timeout; diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c index e45a8a25f9..a44765e980 100644 --- a/source4/libcli/smb_composite/connect.c +++ b/source4/libcli/smb_composite/connect.c @@ -63,7 +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, io->in.unicode, io->in.max_protocol); + state->req = smb_raw_negotiate_send(state->transport, io->in.options.unicode, io->in.options.max_protocol); NT_STATUS_HAVE_NO_MEMORY(state->req); state->req->async.fn = request_handler; @@ -307,10 +307,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.max_xmit, - io->in.max_mux, - io->in.use_spnego, - io->in.signing); + &io->in.options); 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 5fa48b4863..c7d02e323c 100644 --- a/source4/libcli/smb_composite/fetchfile.c +++ b/source4/libcli/smb_composite/fetchfile.c @@ -147,14 +147,7 @@ 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->connect->in.signing = lp_client_signing(global_loadparm); + lp_smbcli_options(global_loadparm, &state->connect->in.options); state->creq = smb_composite_connect_send(state->connect, state, lp_resolve_context(global_loadparm), event_ctx); diff --git a/source4/libcli/smb_composite/fsinfo.c b/source4/libcli/smb_composite/fsinfo.c index b6a5a5f2cc..26b19e8759 100644 --- a/source4/libcli/smb_composite/fsinfo.c +++ b/source4/libcli/smb_composite/fsinfo.c @@ -153,14 +153,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.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->connect->in.signing = lp_client_signing(global_loadparm); + lp_smbcli_options(global_loadparm, &state->connect->in.options); c->state = COMPOSITE_STATE_IN_PROGRESS; state->stage = FSINFO_CONNECT; diff --git a/source4/libcli/smb_composite/smb_composite.h b/source4/libcli/smb_composite/smb_composite.h index dd193fc820..a732617f80 100644 --- a/source4/libcli/smb_composite/smb_composite.h +++ b/source4/libcli/smb_composite/smb_composite.h @@ -28,6 +28,7 @@ */ #include "libcli/raw/signing.h" +#include "libcli/raw/libcliraw.h" /* @@ -93,13 +94,7 @@ 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; - enum smb_signing_state signing; + struct smbcli_options options; } in; struct { struct smbcli_tree *tree; |