From 2552b6632372b35cbd7b788c4e00091dfe520a41 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 20 Sep 2012 05:10:28 +0200 Subject: 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 --- source3/smbd/smb2_server.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3') diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 803be5e288..ede3997909 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, -- cgit