]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smb2_server: don't reset the tid and session id in the out hdr of compound requests
authorStefan Metzmacher <metze@samba.org>
Thu, 27 Oct 2011 11:01:22 +0000 (13:01 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 31 Oct 2011 18:39:02 +0000 (19:39 +0100)
Windows also leaves tid (0xFFFFFFFF) and session id (0xFFFFFFFFFFFFFFFF)
as the client requested them.

metze

source3/smbd/smb2_server.c

index 5d8acc420327fbd38e51fe6cbff7fdb6a2aa5d22..5bb3c3bc5860d7aa9fe99c48f3fede7fa2ca107b 100644 (file)
@@ -1144,7 +1144,6 @@ static 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;
 
@@ -1165,7 +1164,6 @@ static 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;
                }
        }
 
@@ -1187,12 +1185,6 @@ static 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(discard_const_p(uint8_t, outhdr), SMB2_HDR_TID, in_tid);
-       }
-
        return NT_STATUS_OK;
 }
 
@@ -1229,7 +1221,6 @@ static 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;
                }
        }
 
@@ -1250,11 +1241,6 @@ static 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(discard_const_p(uint8_t, outhdr), SMB2_HDR_SESSION_ID, in_session_id);
-       }
        return NT_STATUS_OK;
 }