diff options
author | Steve French <sfrench@us.ibm.com> | 2011-02-25 02:11:56 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-04-11 20:42:06 -0400 |
commit | 8727c8a85f3951ef0eef36a665f5dceebb4c495d (patch) | |
tree | f35b215604127ebb05a977a1b8c093b7b441b6af /fs/cifs/cifsencrypt.c | |
parent | bdf1b03e093bdbc571f404e751c7b0e2dca412ea (diff) |
Allow user names longer than 32 bytes
We artificially limited the user name to 32 bytes, but modern servers handle
larger. Set the maximum length to a reasonable 256, and make the user name
string dynamically allocated rather than a fixed size in session structure.
Also clean up old checkpatch warning.
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsencrypt.c')
-rw-r--r-- | fs/cifs/cifsencrypt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index a51585f9852b..e307a286a1e5 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c | |||
@@ -469,15 +469,15 @@ static int calc_ntlmv2_hash(struct cifsSesInfo *ses, char *ntlmv2_hash, | |||
469 | return rc; | 469 | return rc; |
470 | } | 470 | } |
471 | 471 | ||
472 | /* convert ses->userName to unicode and uppercase */ | 472 | /* convert ses->user_name to unicode and uppercase */ |
473 | len = strlen(ses->userName); | 473 | len = strlen(ses->user_name); |
474 | user = kmalloc(2 + (len * 2), GFP_KERNEL); | 474 | user = kmalloc(2 + (len * 2), GFP_KERNEL); |
475 | if (user == NULL) { | 475 | if (user == NULL) { |
476 | cERROR(1, "calc_ntlmv2_hash: user mem alloc failure\n"); | 476 | cERROR(1, "calc_ntlmv2_hash: user mem alloc failure\n"); |
477 | rc = -ENOMEM; | 477 | rc = -ENOMEM; |
478 | goto calc_exit_2; | 478 | goto calc_exit_2; |
479 | } | 479 | } |
480 | len = cifs_strtoUCS((__le16 *)user, ses->userName, len, nls_cp); | 480 | len = cifs_strtoUCS((__le16 *)user, ses->user_name, len, nls_cp); |
481 | UniStrupr(user); | 481 | UniStrupr(user); |
482 | 482 | ||
483 | crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, | 483 | crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, |