s3:smb2_server: don't reset the tid and session id in the out hdr of compound requests
authorStefan Metzmacher <metze@samba.org>
Mon, 31 Oct 2011 22:15:09 +0000 (15:15 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 9 Nov 2011 18:48:10 +0000 (19:48 +0100)
Windows also leaves tid (0xFFFFFFFF) and session id (0xFFFFFFFFFFFFFFFF)
as the client requested them.

Based on commit 8d07d7148bf47ea14e62d39ed8a8cc4f1366810e from master.

metze

source3/smbd/smb2_sesssetup.c
source3/smbd/smb2_tcon.c

index 53f9d104a6e8f7ecf693d3158a27c21d3305d9cc..14f9654798a292ae5178968d42665fc9331226de 100644 (file)
@@ -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;
 }
 
index 8644e56a1dde62b530c6a6ceee2f18d1e55fb651..8d2aae7410a50bac8f99f756d5b85eccdc72daaf 100644 (file)
@@ -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;
 }