s3:smbd multichannel: let a cross-node session binding NT_STATUS_REQUEST_NOT_ACCEPTED
authorStefan Metzmacher <metze@samba.org>
Fri, 22 Dec 2023 20:50:57 +0000 (21:50 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 9 Jan 2024 10:21:34 +0000 (10:21 +0000)
This is better than NT_STATUS_USER_SESSION_DELETED, as it means the
client can keep it's session alive. Otherwise a windows client believes
the whole session is gone and all other channels are invalid.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/smb2_sesssetup.c

index e15a83d765a678efdf1a8148121c8e2a4abadb8e..ac71e550264e34482de06c3d8021f265cfd667a6 100644 (file)
@@ -754,8 +754,14 @@ static struct tevent_req *smbd_smb2_session_setup_send(TALLOC_CTX *mem_ctx,
                if (NT_STATUS_EQUAL(status, NT_STATUS_BAD_LOGON_SESSION_STATE)) {
                        /*
                         * This comes from smb2srv_session_lookup_global().
+                        * And it's a cross node/cross smbd session bind,
+                        * which can't work in our architecture.
+                        *
+                        * Returning NT_STATUS_REQUEST_NOT_ACCEPTED is better
+                        * than NT_STATUS_USER_SESSION_DELETED in order to
+                        * avoid a completely new session.
                         */
-                       tevent_req_nterror(req, NT_STATUS_USER_SESSION_DELETED);
+                       tevent_req_nterror(req, NT_STATUS_REQUEST_NOT_ACCEPTED);
                        return tevent_req_post(req, ev);
                }