diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index d3aa999ab785..480cf9c81d50 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1599,6 +1599,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1599 | pr_warn("CIFS: username too long\n"); | 1599 | pr_warn("CIFS: username too long\n"); |
1600 | goto cifs_parse_mount_err; | 1600 | goto cifs_parse_mount_err; |
1601 | } | 1601 | } |
1602 | |||
1603 | kfree(vol->username); | ||
1602 | vol->username = kstrdup(string, GFP_KERNEL); | 1604 | vol->username = kstrdup(string, GFP_KERNEL); |
1603 | if (!vol->username) | 1605 | if (!vol->username) |
1604 | goto cifs_parse_mount_err; | 1606 | goto cifs_parse_mount_err; |
@@ -1700,6 +1702,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1700 | goto cifs_parse_mount_err; | 1702 | goto cifs_parse_mount_err; |
1701 | } | 1703 | } |
1702 | 1704 | ||
1705 | kfree(vol->domainname); | ||
1703 | vol->domainname = kstrdup(string, GFP_KERNEL); | 1706 | vol->domainname = kstrdup(string, GFP_KERNEL); |
1704 | if (!vol->domainname) { | 1707 | if (!vol->domainname) { |
1705 | pr_warn("CIFS: no memory for domainname\n"); | 1708 | pr_warn("CIFS: no memory for domainname\n"); |
@@ -1731,6 +1734,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1731 | } | 1734 | } |
1732 | 1735 | ||
1733 | if (strncasecmp(string, "default", 7) != 0) { | 1736 | if (strncasecmp(string, "default", 7) != 0) { |
1737 | kfree(vol->iocharset); | ||
1734 | vol->iocharset = kstrdup(string, | 1738 | vol->iocharset = kstrdup(string, |
1735 | GFP_KERNEL); | 1739 | GFP_KERNEL); |
1736 | if (!vol->iocharset) { | 1740 | if (!vol->iocharset) { |
@@ -2913,8 +2917,7 @@ ip_rfc1001_connect(struct TCP_Server_Info *server) | |||
2913 | * calling name ends in null (byte 16) from old smb | 2917 | * calling name ends in null (byte 16) from old smb |
2914 | * convention. | 2918 | * convention. |
2915 | */ | 2919 | */ |
2916 | if (server->workstation_RFC1001_name && | 2920 | if (server->workstation_RFC1001_name[0] != 0) |
2917 | server->workstation_RFC1001_name[0] != 0) | ||
2918 | rfc1002mangle(ses_init_buf->trailer. | 2921 | rfc1002mangle(ses_init_buf->trailer. |
2919 | session_req.calling_name, | 2922 | session_req.calling_name, |
2920 | server->workstation_RFC1001_name, | 2923 | server->workstation_RFC1001_name, |
@@ -3692,6 +3695,12 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses, | |||
3692 | #endif /* CIFS_WEAK_PW_HASH */ | 3695 | #endif /* CIFS_WEAK_PW_HASH */ |
3693 | rc = SMBNTencrypt(tcon->password, ses->server->cryptkey, | 3696 | rc = SMBNTencrypt(tcon->password, ses->server->cryptkey, |
3694 | bcc_ptr, nls_codepage); | 3697 | bcc_ptr, nls_codepage); |
3698 | if (rc) { | ||
3699 | cifs_dbg(FYI, "%s Can't generate NTLM rsp. Error: %d\n", | ||
3700 | __func__, rc); | ||
3701 | cifs_buf_release(smb_buffer); | ||
3702 | return rc; | ||
3703 | } | ||
3695 | 3704 | ||
3696 | bcc_ptr += CIFS_AUTH_RESP_SIZE; | 3705 | bcc_ptr += CIFS_AUTH_RESP_SIZE; |
3697 | if (ses->capabilities & CAP_UNICODE) { | 3706 | if (ses->capabilities & CAP_UNICODE) { |