Fix Bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does not send...
authorJeremy Allison <jra@samba.org>
Mon, 18 Jun 2012 23:23:13 +0000 (16:23 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sat, 30 Jun 2012 11:44:45 +0000 (13:44 +0200)
Found by Richard Sharpe <realrichardsharpe@gmail.com>. The correct
command code in a reply to NT Transact Secondary (0xa1) is
NT Transact (0xa0).
(cherry picked from commit 115f5af9a89a20929f02578c08a34ae2736951dd)
(cherry picked from commit e46f24296158ca48ac450b013cce39dd6ea91b42)

source3/smbd/nttrans.c

index 6fbbed9bfe04e923cf321a89713435ece7952324..2ca14f477d208c7bea6851a8ee555627cd18667b 100644 (file)
@@ -133,11 +133,6 @@ void send_nt_replies(connection_struct *conn,
                             total_sent_thistime + alignment_offset
                             + data_alignment_offset);
 
-               /*
-                * We might have had SMBnttranss in req->inbuf, fix that.
-                */
-               SCVAL(req->outbuf, smb_com, SMBnttrans);
-
                /*
                 * Set total params and data to be sent.
                 */
@@ -3068,6 +3063,12 @@ void reply_nttranss(struct smb_request *req)
 
        show_msg((char *)req->inbuf);
 
+       /* Windows clients expect all replies to
+          an NT transact secondary (SMBnttranss 0xA1)
+          to have a command code of NT transact
+          (SMBnttrans 0xA0). See bug #8989 for details. */
+       req->cmd = SMBnttrans;
+
        if (req->wct < 18) {
                reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
                END_PROFILE(SMBnttranss);