aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSachin Prabhu2013-04-09 12:17:41 -0500
committerGreg Kroah-Hartman2013-04-16 23:48:28 -0500
commit30b1addb438fe0480d6e4c78bb8f66040840f8ac (patch)
tree1c8b91c5165fe21846e2907e70164ea34873758c /fs
parent978ddcd80a05229e14d8f078ee99bbf2d0f71867 (diff)
downloadkernel-omap-30b1addb438fe0480d6e4c78bb8f66040840f8ac.tar.gz
kernel-omap-30b1addb438fe0480d6e4c78bb8f66040840f8ac.tar.xz
kernel-omap-30b1addb438fe0480d6e4c78bb8f66040840f8ac.zip
cifs: Allow passwords which begin with a delimitor
commit c369c9a4a7c82d33329d869cbaf93304cc7a0c40 upstream. 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: Sachin Prabhu <sprabhu@redhat.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/connect.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 12b3da39733b..f7199b9ab370 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1546,14 +1546,24 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1546 } 1546 }
1547 break; 1547 break;
1548 case Opt_blank_pass: 1548 case Opt_blank_pass:
1549 vol->password = NULL;
1550 break;
1551 case Opt_pass:
1552 /* passwords have to be handled differently 1549 /* passwords have to be handled differently
1553 * to allow the character used for deliminator 1550 * to allow the character used for deliminator
1554 * to be passed within them 1551 * to be passed within them
1555 */ 1552 */
1556 1553
1554 /*
1555 * Check if this is a case where the password
1556 * starts with a delimiter
1557 */
1558 tmp_end = strchr(data, '=');
1559 tmp_end++;
1560 if (!(tmp_end < end && tmp_end[1] == delim)) {
1561 /* No it is not. Set the password to NULL */
1562 vol->password = NULL;
1563 break;
1564 }
1565 /* Yes it is. Drop down to Opt_pass below.*/
1566 case Opt_pass:
1557 /* Obtain the value string */ 1567 /* Obtain the value string */
1558 value = strchr(data, '='); 1568 value = strchr(data, '=');
1559 value++; 1569 value++;