1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-03 12:58:35 +03:00

s3:smb2_server: defer channel/session validation to the session setup code.

For session bind, and the channel is only to be bound to the given
session just now, so it is not valid. The early request validation
code can hence not check it, and hence validation is defered to the
actual session setup code, which can look at the session binding flags.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Jul 29 21:31:09 CEST 2015 on sn-devel-104
This commit is contained in:
Michael Adam 2015-07-27 09:01:55 +02:00
parent 8ab4b05d33
commit 8c41cbbf9e

View File

@ -1833,10 +1833,26 @@ static NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req)
req->last_session_id = 0;
/* lookup an existing session */
status = smb2srv_session_lookup_conn(req->xconn,
in_session_id, now,
&session);
/* look an existing session up */
switch (in_opcode) {
case SMB2_OP_SESSSETUP:
/*
* For a session bind request, we don't have the
* channel set up at this point yet, so we defer
* the verification that the connection belongs
* to the session to the session setup code, which
* can look at the session binding flags.
*/
status = smb2srv_session_lookup_client(req->xconn->client,
in_session_id, now,
&session);
break;
default:
status = smb2srv_session_lookup_conn(req->xconn,
in_session_id, now,
&session);
break;
}
if (session) {
req->session = session;
req->last_session_id = in_session_id;