summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-09-20 05:10:28 +0200
committerKarolin Seeger <kseeger@samba.org>2012-09-28 09:23:07 +0200
commitb26bf825be046dd0d0424b53f0c09346888a3df7 (patch)
tree37c82334a1166f571046bd33d575bc2094aaa51d
parentf24ee3b4ed0ee54b754a27c855b94114ec378330 (diff)
downloadsamba-b26bf825be046dd0d0424b53f0c09346888a3df7.tar.gz
s3:smb2_server: reset req->last_session_id and req->last_tid after using it
If we can find a valid session or tcon we'll set it after the lookup, but it need to make sure to reset it if we don't find the session. This fixes a problem where a compound unrelated request between related requests doesn't reset the session. If we have 3 requests in a compound chain, request 3 should never use the id's cached from request 1. It should only every inherit handles from request 2. metze (cherry picked from commit 2552b6632372b35cbd7b788c4e00091dfe520a41) Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source3/smbd/smb2_server.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 803be5e2881..ede3997909d 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -1691,6 +1691,8 @@ static NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req)
in_tid = req->last_tid;
}
+ req->last_tid = 0;
+
status = smb2srv_tcon_lookup(req->session,
in_tid, now, &tcon);
if (!NT_STATUS_IS_OK(status)) {
@@ -1740,6 +1742,8 @@ static NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req)
in_session_id = req->last_session_id;
}
+ req->last_session_id = 0;
+
/* lookup an existing session */
status = smb2srv_session_lookup(req->sconn->conn,
in_session_id, now,