From 1dc30f06afc508c757f094d30f9f674ee8f62c28 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 14 Jun 2012 14:53:18 -0700 Subject: [PATCH 1/2] 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). --- source3/smbd/nttrans.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 429250e..47a3747 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -3255,6 +3255,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); -- 1.7.7.3 From f38b617df396c85e037fc5d0707ffe5cb41742cb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 14 Jun 2012 16:50:23 -0700 Subject: [PATCH 2/2] Same fix as 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 for the Trans2 calls. See MS-CIFS 2.2.4.47.2 for details. --- source3/smbd/trans2.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index c7cf1a2..398029b 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -8839,6 +8839,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); -- 1.7.7.3