cifs: Fix regression during share-level security mounts (Repost)
authorShirish Pargaonkar <shirishpargaonkar@gmail.com>
Wed, 19 Jan 2011 04:33:54 +0000 (22:33 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 23:14:44 +0000 (15:14 -0800)
commit 540b2e377797d8715469d408b887baa9310c5f3e upstream.

NTLM response length was changed to 16 bytes instead of 24 bytes
that are sent in Tree Connection Request during share-level security
share mounts.  Revert it back to 24 bytes.

Reported-and-Tested-by: Grzegorz Ozanski <grzegorz.ozanski@intel.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Acked-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/connect.c

index cc1a860..ac75883 100644 (file)
@@ -2999,7 +2999,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
                bcc_ptr++;              /* skip password */
                /* already aligned so no need to do it below */
        } else {
-               pSMB->PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE);
+               pSMB->PasswordLength = cpu_to_le16(CIFS_AUTH_RESP_SIZE);
                /* BB FIXME add code to fail this if NTLMv2 or Kerberos
                   specified as required (when that support is added to
                   the vfs in the future) as only NTLM or the much
@@ -3017,7 +3017,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
 #endif /* CIFS_WEAK_PW_HASH */
                SMBNTencrypt(tcon->password, ses->server->cryptkey, bcc_ptr);
 
-               bcc_ptr += CIFS_SESS_KEY_SIZE;
+               bcc_ptr += CIFS_AUTH_RESP_SIZE;
                if (ses->capabilities & CAP_UNICODE) {
                        /* must align unicode strings */
                        *bcc_ptr = 0; /* null byte password */