Commit 385ca62d authored by Pavel Shilovsky's avatar Pavel Shilovsky

Update 2.6.32 sources from stable (v2.6.32.45)

parent 6b607ba0
......@@ -33,7 +33,7 @@
#define MAX_SHARE_SIZE 64 /* used to be 20, this should still be enough */
#define MAX_USERNAME_SIZE 32 /* 32 is to allow for 15 char names + null
termination then *2 for unicode versions */
#define MAX_PASSWORD_SIZE 16
#define MAX_PASSWORD_SIZE 512 /* max for windows seems to be 256 wide chars */
#define CIFS_MIN_RCV_POOL 4
......
......@@ -1588,17 +1588,29 @@ out_err:
}
static struct cifsSesInfo *
cifs_find_smb_ses(struct TCP_Server_Info *server, char *username)
cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
{
struct list_head *tmp;
struct cifsSesInfo *ses;
write_lock(&cifs_tcp_ses_lock);
list_for_each(tmp, &server->smb_ses_list) {
ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list);
if (strncmp(ses->userName, username, MAX_USERNAME_SIZE))
continue;
list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
switch (server->secType) {
case Kerberos:
if (vol->linux_uid != ses->linux_uid)
continue;
break;
default:
/* anything else takes username/password */
if (strncmp(ses->userName, vol->username,
MAX_USERNAME_SIZE))
continue;
if (strlen(vol->username) != 0 &&
ses->password != NULL &&
strncmp(ses->password,
vol->password ? vol->password : "",
MAX_PASSWORD_SIZE))
continue;
}
++ses->ses_count;
write_unlock(&cifs_tcp_ses_lock);
return ses;
......@@ -2353,7 +2365,7 @@ try_mount_again:
goto out;
}
pSesInfo = cifs_find_smb_ses(srvTcp, volume_info->username);
pSesInfo = cifs_find_smb_ses(srvTcp, volume_info);
if (pSesInfo) {
cFYI(1, ("Existing smb sess found (status=%d)",
pSesInfo->status));
......
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