提交 c369c9a4 编写于 作者: S Sachin Prabhu 提交者: Steve French

cifs: Allow passwords which begin with a delimitor

Fixes a regression in cifs_parse_mount_options where a password
which begins with a delimitor is parsed incorrectly as being a blank
password.
Signed-off-by: NSachin Prabhu <sprabhu@redhat.com>
Acked-by: NJeff Layton <jlayton@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 66ade474
......@@ -1575,14 +1575,24 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
}
break;
case Opt_blank_pass:
vol->password = NULL;
break;
case Opt_pass:
/* passwords have to be handled differently
* to allow the character used for deliminator
* to be passed within them
*/
/*
* Check if this is a case where the password
* starts with a delimiter
*/
tmp_end = strchr(data, '=');
tmp_end++;
if (!(tmp_end < end && tmp_end[1] == delim)) {
/* No it is not. Set the password to NULL */
vol->password = NULL;
break;
}
/* Yes it is. Drop down to Opt_pass below.*/
case Opt_pass:
/* Obtain the value string */
value = strchr(data, '=');
value++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册