diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-09-20 05:10:28 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-09-22 10:18:57 +0200 |
commit | 2552b6632372b35cbd7b788c4e00091dfe520a41 (patch) | |
tree | d114ee03e19e8bbdd942e1fc2b3c6742078258b6 /source3/smbd | |
parent | bd8d50b451ea7f94efa7777fbe5dc0c2c19f6bf9 (diff) | |
download | samba-2552b6632372b35cbd7b788c4e00091dfe520a41.tar.gz samba-2552b6632372b35cbd7b788c4e00091dfe520a41.tar.bz2 samba-2552b6632372b35cbd7b788c4e00091dfe520a41.zip |
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
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/smb2_server.c | 4 |
1 files changed, 4 insertions, 0 deletions
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, |