summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2020-07-01 18:27:40 +0200
committerStefan Metzmacher <metze@samba.org>2020-07-08 15:54:38 +0000
commit7d06874478edb29a14eedcd8d634f3bf5d8dee50 (patch)
tree426c3ebb96f91e6b41fd927d27546cb6fa0d249a
parentfe6a6ec4d4843f4eecbb88e1664fbbc8e355a0ca (diff)
downloadsamba-7d06874478edb29a14eedcd8d634f3bf5d8dee50.tar.gz
s4:libcli/smb2: allow smb2_connect*() to fake session and tcon
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 <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
-rw-r--r--source4/libcli/raw/libcliraw.h1
-rw-r--r--source4/libcli/smb2/connect.c9
2 files changed, 10 insertions, 0 deletions
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,