Same fix as bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does...
authorJeremy Allison <jra@samba.org>
Mon, 18 Jun 2012 23:24:12 +0000 (16:24 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sat, 30 Jun 2012 11:44:48 +0000 (13:44 +0200)
for the Trans2 calls. See MS-CIFS 2.2.4.47.2 for details.
(cherry picked from commit d5c01dc502e02cde12abc939afd48519d38c09a9)
(cherry picked from commit 8243fb8dbeed34e1a9a61d44c48d82321eebe7ab)

source3/smbd/trans2.c

index 794c138638b0f8099553c69f1087dd0fae59e249..602280d9c18c2809a1126e73ded06ce982c45928 100644 (file)
@@ -849,12 +849,6 @@ void send_trans2_replies(connection_struct *conn,
                reply_outbuf(req, 10, total_sent_thistime + alignment_offset
                             + data_alignment_offset);
 
-               /*
-                * We might have SMBtrans2s in req which was transferred to
-                * the outbuf, fix that.
-                */
-               SCVAL(req->outbuf, smb_com, SMBtrans2);
-
                /* Set total params and data to be sent */
                SSVAL(req->outbuf,smb_tprcnt,paramsize);
                SSVAL(req->outbuf,smb_tdrcnt,datasize);
@@ -8562,6 +8556,15 @@ void reply_transs2(struct smb_request *req)
 
        show_msg((char *)req->inbuf);
 
+       /* Windows clients expect all replies to
+          a transact secondary (SMBtranss2 0x33)
+          to have a command code of transact
+          (SMBtrans2 0x32). See bug #8989
+          and also [MS-CIFS] section 2.2.4.47.2
+          for details.
+       */
+       req->cmd = SMBtrans2;
+
        if (req->wct < 8) {
                reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
                END_PROFILE(SMBtranss2);