summaryrefslogtreecommitdiff
path: root/source4/libcli/pysmb.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-08-02 16:04:52 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-03 14:26:00 +1000
commit38b8d38b30370bf930a647bceceed7fd407b649b (patch)
treee58551ca9815893e84ae5a3d21e96a66e266b5ef /source4/libcli/pysmb.c
parent6cce5fd43e9036d2d57bb3cd9aef905463acdcce (diff)
downloadsamba-38b8d38b30370bf930a647bceceed7fd407b649b.tar.gz
samba-38b8d38b30370bf930a647bceceed7fd407b649b.tar.bz2
samba-38b8d38b30370bf930a647bceceed7fd407b649b.zip
s4-libcli: Replace smb_composite_connect() with smb_full_connection()
Python smb connection now uses smb_full_connection method. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/libcli/pysmb.c')
-rw-r--r--source4/libcli/pysmb.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/source4/libcli/pysmb.c b/source4/libcli/pysmb.c
index b550340281..ccd765634a 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;