1 From c369c9a4a7c82d33329d869cbaf93304cc7a0c40 Mon Sep 17 00:00:00 2001
2 From: Sachin Prabhu <sprabhu@redhat.com>
3 Date: Tue, 9 Apr 2013 18:17:41 +0100
4 Subject: cifs: Allow passwords which begin with a delimitor
6 From: Sachin Prabhu <sprabhu@redhat.com>
8 commit c369c9a4a7c82d33329d869cbaf93304cc7a0c40 upstream.
10 Fixes a regression in cifs_parse_mount_options where a password
11 which begins with a delimitor is parsed incorrectly as being a blank
14 Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
15 Acked-by: Jeff Layton <jlayton@redhat.com>
16 Signed-off-by: Steve French <sfrench@us.ibm.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 fs/cifs/connect.c | 16 +++++++++++++---
21 1 file changed, 13 insertions(+), 3 deletions(-)
23 --- a/fs/cifs/connect.c
24 +++ b/fs/cifs/connect.c
25 @@ -1546,14 +1546,24 @@ cifs_parse_mount_options(const char *mou
29 - vol->password = NULL;
32 /* passwords have to be handled differently
33 * to allow the character used for deliminator
34 * to be passed within them
38 + * Check if this is a case where the password
39 + * starts with a delimiter
41 + tmp_end = strchr(data, '=');
43 + if (!(tmp_end < end && tmp_end[1] == delim)) {
44 + /* No it is not. Set the password to NULL */
45 + vol->password = NULL;
48 + /* Yes it is. Drop down to Opt_pass below.*/
50 /* Obtain the value string */
51 value = strchr(data, '=');