Commit a878fb22 authored by Steve French's avatar Steve French

[CIFS] Do not limit the length of share names (was 100 for whole UNC name)

during mount. Especially important for some non-Western languages.
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent fc94cdb9
Version 1.43 Version 1.43
------------ ------------
POSIX locking to servers which support CIFS POSIX Extensions POSIX locking to servers which support CIFS POSIX Extensions
(disabled by default controlled by proc/fs/cifs/Experimental) (disabled by default controlled by proc/fs/cifs/Experimental).
Handle conversion of long share names (especially Asian languages)
to Unicode during mount.
Version 1.42 Version 1.42
------------ ------------
......
...@@ -3282,7 +3282,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, ...@@ -3282,7 +3282,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
bcc_ptr++; /* align */ bcc_ptr++; /* align */
} }
if(ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) if(ses->server->secMode &
(SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
smb_buffer->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; smb_buffer->Flags2 |= SMBFLG2_SECURITY_SIGNATURE;
if (ses->capabilities & CAP_STATUS32) { if (ses->capabilities & CAP_STATUS32) {
...@@ -3294,8 +3295,10 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, ...@@ -3294,8 +3295,10 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
if (ses->capabilities & CAP_UNICODE) { if (ses->capabilities & CAP_UNICODE) {
smb_buffer->Flags2 |= SMBFLG2_UNICODE; smb_buffer->Flags2 |= SMBFLG2_UNICODE;
length = length =
cifs_strtoUCS((__le16 *) bcc_ptr, tree, 100, nls_codepage); cifs_strtoUCS((__le16 *) bcc_ptr, tree,
bcc_ptr += 2 * length; /* convert num of 16 bit words to bytes */ 6 /* max utf8 char length in bytes */ *
(/* server len*/ + 256 /* share len */), nls_codepage);
bcc_ptr += 2 * length; /* convert num 16 bit words to bytes */
bcc_ptr += 2; /* skip trailing null */ bcc_ptr += 2; /* skip trailing null */
} else { /* ASCII */ } else { /* ASCII */
strcpy(bcc_ptr, tree); strcpy(bcc_ptr, tree);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment