>From ac9334f68ece14fa3f6ee23a5966702fdadbe182 Mon Sep 17 00:00:00 2001
From: Steve French <[email protected]>
Date: Tue, 13 May 2014 13:37:45 -0700
Subject: [PATCH] [CIFS] Do not send ClientGUID on SMB2.02 dialect

ClientGUID must be zero for SMB2.02 dialect.  See section 2.2.3
of MS-SMB2. For SMB2.1 and later it must be non-zero.

Signed-off-by: Steve French <[email protected]>
CC: Sachin Prabhu <[email protected]>
---
 fs/cifs/smb2pdu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index dc44610..e8b2550 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -375,7 +375,12 @@ SMB2_negotiate(const unsigned int xid, struct
cifs_ses *ses)

  req->Capabilities = cpu_to_le32(ses->server->vals->req_capabilities);

- memcpy(req->ClientGUID, server->client_guid, SMB2_CLIENT_GUID_SIZE);
+ /* ClientGUID must be zero for SMB2.02 dialect */
+ if (ses->server->vals->protocol_id == SMB20_PROT_ID)
+ memset(req->ClientGUID, 0, SMB2_CLIENT_GUID_SIZE);
+ else
+ memcpy(req->ClientGUID, server->client_guid,
+ SMB2_CLIENT_GUID_SIZE);

  iov[0].iov_base = (char *)req;
  /* 4 for rfc1002 length field */
-- 
1.9.1


-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to