From 7d06874478edb29a14eedcd8d634f3bf5d8dee50 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 1 Jul 2020 18:27:40 +0200 Subject: s4:libcli/smb2: allow smb2_connect*() to fake session and tcon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For multichannel connection we want a way to have just a connection with a negprot finished. For now we just fake a tcon and session in order to avoid changes in the caller. We can clean that up later if needed. Signed-off-by: Stefan Metzmacher Reviewed-by: Günther Deschner --- source4/libcli/raw/libcliraw.h | 1 + source4/libcli/smb2/connect.c | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'source4') diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h index df0690fa223..0e99618df25 100644 --- a/source4/libcli/raw/libcliraw.h +++ b/source4/libcli/raw/libcliraw.h @@ -104,6 +104,7 @@ struct smbcli_options { uint32_t smb2_capabilities; struct GUID client_guid; uint64_t max_credits; + unsigned int only_negprot; }; /* this is the context for the client transport layer */ diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c index e4cbf8c5c41..98aa148ea2c 100644 --- a/source4/libcli/smb2/connect.c +++ b/source4/libcli/smb2/connect.c @@ -218,6 +218,15 @@ static void smb2_connect_session_start(struct tevent_req *req) return; } + if (state->options.only_negprot) { + state->tree = smb2_tree_init(state->session, state, true); + if (tevent_req_nomem(state->tree, req)) { + return; + } + tevent_req_done(req); + return; + } + subreq = smb2_session_setup_spnego_send(state, state->ev, state->session, state->credentials, -- cgit v1.2.1