From: Stefan Metzmacher Date: Mon, 31 Oct 2011 22:15:09 +0000 (-0700) Subject: s3:smb2_server: don't reset the tid and session id in the out hdr of compound requests X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab81a8df620a2d7fcb3852834353a0300dcb9f45;p=thirdparty%2Fsamba.git s3:smb2_server: don't reset the tid and session id in the out hdr of compound requests Windows also leaves tid (0xFFFFFFFF) and session id (0xFFFFFFFFFFFFFFFF) as the client requested them. Based on commit 8d07d7148bf47ea14e62d39ed8a8cc4f1366810e from master. metze --- diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index 53f9d104a6e..14f9654798a 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -818,7 +818,6 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req) uint64_t in_session_id; void *p; struct smbd_smb2_session *session; - bool chained_fixup = false; inhdr = (const uint8_t *)req->in.vector[i+0].iov_base; @@ -839,7 +838,6 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req) */ outhdr = (const uint8_t *)req->out.vector[i-3].iov_base; in_session_id = BVAL(outhdr, SMB2_HDR_SESSION_ID); - chained_fixup = true; } } @@ -860,11 +858,6 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req) req->session = session; - if (chained_fixup) { - /* Fix up our own outhdr. */ - outhdr = (const uint8_t *)req->out.vector[i].iov_base; - SBVAL(outhdr, SMB2_HDR_SESSION_ID, in_session_id); - } return NT_STATUS_OK; } diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c index 8644e56a1dd..8d2aae7410a 100644 --- a/source3/smbd/smb2_tcon.c +++ b/source3/smbd/smb2_tcon.c @@ -286,7 +286,6 @@ NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req) uint32_t in_tid; void *p; struct smbd_smb2_tcon *tcon; - bool chained_fixup = false; inhdr = (const uint8_t *)req->in.vector[i+0].iov_base; @@ -307,7 +306,6 @@ NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req) */ outhdr = (const uint8_t *)req->out.vector[i-3].iov_base; in_tid = IVAL(outhdr, SMB2_HDR_TID); - chained_fixup = true; } } @@ -329,12 +327,6 @@ NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req) req->tcon = tcon; - if (chained_fixup) { - /* Fix up our own outhdr. */ - outhdr = (const uint8_t *)req->out.vector[i].iov_base; - SIVAL(outhdr, SMB2_HDR_TID, in_tid); - } - return NT_STATUS_OK; }