]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:libcli/smb2: allow smb2_connect*() to fake session and tcon
authorStefan Metzmacher <metze@samba.org>
Wed, 1 Jul 2020 16:27:40 +0000 (18:27 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 8 Jul 2020 15:54:38 +0000 (15:54 +0000)
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>
source4/libcli/raw/libcliraw.h
source4/libcli/smb2/connect.c

index df0690fa223bbb4d9498fd8a6a177f2c57200ec2..0e99618df255ccc829637f1800993164ab5bd373 100644 (file)
@@ -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 */
index e4cbf8c5c4198fc18b5a6acdb4d8834b1aa1cd1a..98aa148ea2cb6e7a343f56e60eaaeffd7b78b2e3 100644 (file)
@@ -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,