From dcc282590b34537fc1ead61c3300172528273b44 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 3 Jan 2008 17:22:12 -0600 Subject: r26654: libcli/smb_composite: Rather than specifying each of the gazillion options for SMB individually, just specify the smbcli_options struct. (This used to be commit 8a97886e24a4b969aa91409c06f423b71a45f6eb) --- source4/client/client.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'source4/client/client.c') diff --git a/source4/client/client.c b/source4/client/client.c index 259966ddaa..d9478a3a8a 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -3021,7 +3021,10 @@ return a connection to a server *******************************************************/ static bool do_connect(struct smbclient_context *ctx, struct resolve_context *resolve_ctx, - const char *specified_server, const char **ports, const char *specified_share, struct cli_credentials *cred) + const char *specified_server, const char **ports, + const char *specified_share, + struct cli_credentials *cred, + struct smbcli_options *options) { NTSTATUS status; char *server, *share; @@ -3040,7 +3043,8 @@ static bool do_connect(struct smbclient_context *ctx, status = smbcli_full_connection(ctx, &ctx->cli, server, ports, share, NULL, cred, resolve_ctx, - cli_credentials_get_event_context(cred)); + cli_credentials_get_event_context(cred), + options); if (!NT_STATUS_IS_OK(status)) { d_printf("Connection to \\\\%s\\%s failed - %s\n", server, share, nt_errstr(status)); @@ -3065,7 +3069,7 @@ static int do_host_query(struct loadparm_context *lp_ctx, const char *query_host /**************************************************************************** handle a message operation ****************************************************************************/ -static int do_message_op(const char *netbios_name, const char *desthost, const char **destports, const char *destip, int name_type, struct resolve_context *resolve_ctx, int max_xmit, int max_mux, bool use_spnego, enum smb_signing_state signing) +static int do_message_op(const char *netbios_name, const char *desthost, const char **destports, const char *destip, int name_type, struct resolve_context *resolve_ctx, struct smbcli_options *options) { struct nbt_name called, calling; const char *server_name; @@ -3077,7 +3081,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c server_name = destip ? destip : desthost; - if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, destports, resolve_ctx, max_xmit, max_mux, use_spnego, signing)) { + if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, destports, resolve_ctx, options)) { d_printf("Connection to %s failed\n", server_name); return 1; } @@ -3120,6 +3124,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c TALLOC_CTX *mem_ctx; struct smbclient_context *ctx; const char *cmdstr = NULL; + struct smbcli_options smb_options; struct poptOption long_options[] = { POPT_AUTOHELP @@ -3212,6 +3217,8 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c poptFreeContext(pc); + lp_smbcli_options(cmdline_lp_ctx, &smb_options); + DEBUG( 3, ( "Client started (version %s).\n", SAMBA_VERSION_STRING ) ); if (query_host && (p=strchr_m(query_host,'#'))) { @@ -3225,10 +3232,10 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c } if (message) { - return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), dest_ip, name_type, lp_resolve_context(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx), lp_nt_status_support(cmdline_lp_ctx) && lp_use_spnego(cmdline_lp_ctx), lp_client_signing(cmdline_lp_ctx)); + return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), dest_ip, name_type, lp_resolve_context(cmdline_lp_ctx), &smb_options); } - if (!do_connect(ctx, lp_resolve_context(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), service, cmdline_credentials)) + if (!do_connect(ctx, lp_resolve_context(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), service, cmdline_credentials, &smb_options)) return 1; if (base_directory) -- cgit