From: Amitay Isaacs Date: Tue, 2 Aug 2011 06:04:52 +0000 (+1000) Subject: s4-libcli: Replace smb_composite_connect() with smb_full_connection() X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=38b8d38b30370bf930a647bceceed7fd407b649b;p=rusty%2Fsamba.git s4-libcli: Replace smb_composite_connect() with smb_full_connection() Python smb connection now uses smb_full_connection method. Signed-off-by: Andrew Bartlett --- diff --git a/source4/libcli/pysmb.c b/source4/libcli/pysmb.c index b5503402815..ccd765634a2 100644 --- a/source4/libcli/pysmb.c +++ b/source4/libcli/pysmb.c @@ -60,43 +60,39 @@ static void dos_format(char *s) /* - * Connect to SMB share using smb_composite_connect + * Connect to SMB share using smb_full_connection */ static NTSTATUS do_smb_connect(TALLOC_CTX *mem_ctx, struct smb_private_data *spdata, const char *hostname, const char *service, struct smbcli_tree **tree) { - struct smb_composite_connect io; + struct smbcli_state *smb_state; NTSTATUS status; - - gensec_init(); + struct smbcli_options options; + struct smbcli_session_options session_options; *tree = NULL; - ZERO_STRUCT(io); - - io.in.dest_host = hostname; - - io.in.dest_ports = lpcfg_smb_ports(spdata->lp_ctx); - io.in.socket_options = lpcfg_socket_options(spdata->lp_ctx); - io.in.gensec_settings = lpcfg_gensec_settings(mem_ctx, spdata->lp_ctx); - - io.in.called_name = lpcfg_netbios_name(spdata->lp_ctx); - io.in.workgroup = lpcfg_workgroup(spdata->lp_ctx); - - lpcfg_smbcli_options(spdata->lp_ctx, &io.in.options); - lpcfg_smbcli_session_options(spdata->lp_ctx, &io.in.session_options); + gensec_init(); - io.in.service = service; - io.in.service_type = NULL; + smb_state = smbcli_state_init(mem_ctx); - io.in.credentials = spdata->creds; - io.in.fallback_to_anonymous = false; + lpcfg_smbcli_options(spdata->lp_ctx, &options); + lpcfg_smbcli_session_options(spdata->lp_ctx, &session_options); - status = smb_composite_connect(&io, mem_ctx, + status = smbcli_full_connection(mem_ctx, &smb_state, hostname, + lpcfg_smb_ports(spdata->lp_ctx), + service, + NULL, + lpcfg_socket_options(spdata->lp_ctx), + spdata->creds, lpcfg_resolve_context(spdata->lp_ctx), - spdata->ev_ctx); + spdata->ev_ctx, + &options, + &session_options, + lpcfg_gensec_settings(mem_ctx, spdata->lp_ctx)); + if (NT_STATUS_IS_OK(status)) { - *tree = io.out.tree; + *tree = smb_state->tree; } return status;