|
@@ -1599,6 +1599,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
|
|
pr_warn("CIFS: username too long\n");
|
|
pr_warn("CIFS: username too long\n");
|
|
goto cifs_parse_mount_err;
|
|
goto cifs_parse_mount_err;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ kfree(vol->username);
|
|
vol->username = kstrdup(string, GFP_KERNEL);
|
|
vol->username = kstrdup(string, GFP_KERNEL);
|
|
if (!vol->username)
|
|
if (!vol->username)
|
|
goto cifs_parse_mount_err;
|
|
goto cifs_parse_mount_err;
|
|
@@ -1700,6 +1702,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
|
|
goto cifs_parse_mount_err;
|
|
goto cifs_parse_mount_err;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ kfree(vol->domainname);
|
|
vol->domainname = kstrdup(string, GFP_KERNEL);
|
|
vol->domainname = kstrdup(string, GFP_KERNEL);
|
|
if (!vol->domainname) {
|
|
if (!vol->domainname) {
|
|
pr_warn("CIFS: no memory for domainname\n");
|
|
pr_warn("CIFS: no memory for domainname\n");
|
|
@@ -1731,6 +1734,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
|
|
}
|
|
}
|
|
|
|
|
|
if (strncasecmp(string, "default", 7) != 0) {
|
|
if (strncasecmp(string, "default", 7) != 0) {
|
|
|
|
+ kfree(vol->iocharset);
|
|
vol->iocharset = kstrdup(string,
|
|
vol->iocharset = kstrdup(string,
|
|
GFP_KERNEL);
|
|
GFP_KERNEL);
|
|
if (!vol->iocharset) {
|
|
if (!vol->iocharset) {
|
|
@@ -2913,8 +2917,7 @@ ip_rfc1001_connect(struct TCP_Server_Info *server)
|
|
* calling name ends in null (byte 16) from old smb
|
|
* calling name ends in null (byte 16) from old smb
|
|
* convention.
|
|
* convention.
|
|
*/
|
|
*/
|
|
- if (server->workstation_RFC1001_name &&
|
|
|
|
- server->workstation_RFC1001_name[0] != 0)
|
|
|
|
|
|
+ if (server->workstation_RFC1001_name[0] != 0)
|
|
rfc1002mangle(ses_init_buf->trailer.
|
|
rfc1002mangle(ses_init_buf->trailer.
|
|
session_req.calling_name,
|
|
session_req.calling_name,
|
|
server->workstation_RFC1001_name,
|
|
server->workstation_RFC1001_name,
|
|
@@ -3692,6 +3695,12 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
|
|
#endif /* CIFS_WEAK_PW_HASH */
|
|
#endif /* CIFS_WEAK_PW_HASH */
|
|
rc = SMBNTencrypt(tcon->password, ses->server->cryptkey,
|
|
rc = SMBNTencrypt(tcon->password, ses->server->cryptkey,
|
|
bcc_ptr, nls_codepage);
|
|
bcc_ptr, nls_codepage);
|
|
|
|
+ if (rc) {
|
|
|
|
+ cifs_dbg(FYI, "%s Can't generate NTLM rsp. Error: %d\n",
|
|
|
|
+ __func__, rc);
|
|
|
|
+ cifs_buf_release(smb_buffer);
|
|
|
|
+ return rc;
|
|
|
|
+ }
|
|
|
|
|
|
bcc_ptr += CIFS_AUTH_RESP_SIZE;
|
|
bcc_ptr += CIFS_AUTH_RESP_SIZE;
|
|
if (ses->capabilities & CAP_UNICODE) {
|
|
if (ses->capabilities & CAP_UNICODE) {
|