From 7cbc768376ed0a839afca64aeea99cd53d0fbc6f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Jan 2005 11:15:08 +0000 Subject: r4777: added a smb_composite_sesssetup() async composite function. This encapsulates all the different session setup methods, including the multi-pass spnego code. I have hooked this into all the places that previously used the RAW_SESSSETUP_GENERIC method, and have removed the old RAW_SESSSETUP_GENERIC code from clisession.c and clitree.c. A nice side effect is that these two modules are now very simple again, back to being "raw" session setup handling, which was what was originally intended. I have also used this to replace the session setup code in the smb_composite_connect() code, and used that to build a very simple replacement for smbcli_tree_full_connection(). As a result, smbclient, smbtorture and all our other SMB connection code now goes via these composite async functions. That should give them a good workout! (This used to be commit 080d0518bc7d6fd4bc3ef783e7d4d2e3275d0799) --- source4/libcli/cliconnect.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'source4/libcli/cliconnect.c') diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c index 4d46d1d23c..0f916d1eb1 100644 --- a/source4/libcli/cliconnect.c +++ b/source4/libcli/cliconnect.c @@ -21,6 +21,7 @@ #include "includes.h" #include "system/filesys.h" #include "libcli/raw/libcliraw.h" +#include "libcli/composite/composite.h" /* wrapper around smbcli_sock_connect() @@ -66,7 +67,7 @@ NTSTATUS smbcli_session_setup(struct smbcli_state *cli, const char *password, const char *domain) { - union smb_sesssetup setup; + struct smb_composite_sesssetup setup; NTSTATUS status; TALLOC_CTX *mem_ctx; @@ -77,27 +78,26 @@ NTSTATUS smbcli_session_setup(struct smbcli_state *cli, mem_ctx = talloc_init("smbcli_session_setup"); if (!mem_ctx) return NT_STATUS_NO_MEMORY; - setup.generic.level = RAW_SESSSETUP_GENERIC; - setup.generic.in.sesskey = cli->transport->negotiate.sesskey; - setup.generic.in.capabilities = cli->transport->negotiate.capabilities; + setup.in.sesskey = cli->transport->negotiate.sesskey; + setup.in.capabilities = cli->transport->negotiate.capabilities; if (!user || !user[0]) { - setup.generic.in.password = NULL; - setup.generic.in.user = ""; - setup.generic.in.domain = ""; - setup.generic.in.capabilities &= ~CAP_EXTENDED_SECURITY; + setup.in.password = NULL; + setup.in.user = ""; + setup.in.domain = ""; + setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; } else { if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_USER_LEVEL) { - setup.generic.in.password = password; + setup.in.password = password; } else { - setup.generic.in.password = NULL; + setup.in.password = NULL; } - setup.generic.in.user = user; - setup.generic.in.domain = domain; + setup.in.user = user; + setup.in.domain = domain; } - status = smb_raw_session_setup(cli->session, mem_ctx, &setup); + status = smb_composite_sesssetup(cli->session, &setup); - cli->session->vuid = setup.generic.out.vuid; + cli->session->vuid = setup.out.vuid; talloc_free(mem_ctx); -- cgit