From: Jeremy Allison Date: Mon, 18 Jun 2012 23:23:13 +0000 (-0700) Subject: Fix Bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does not send... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e46f24296158ca48ac450b013cce39dd6ea91b42;p=thirdparty%2Fsamba.git Fix Bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does not send correct responses to NT Transact Secondary when no data and no params Found by Richard Sharpe . The correct command code in a reply to NT Transact Secondary (0xa1) is NT Transact (0xa0). (cherry picked from commit 115f5af9a89a20929f02578c08a34ae2736951dd) --- diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 6fbbed9bfe0..2ca14f477d2 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -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);