From e296914f42d2fea9d34851b3b6af5edc45d165c2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 18 Jun 2012 16:23:13 -0700 Subject: [PATCH] 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) (cherry picked from commit e46f24296158ca48ac450b013cce39dd6ea91b42) --- source3/smbd/nttrans.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 @@ -134,11 +134,6 @@ void send_nt_replies(connection_struct *conn, + 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); -- 2.11.4.GIT