]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.8.8/cifs-allow-passwords-which-begin-with-a-delimitor.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.8.8 / cifs-allow-passwords-which-begin-with-a-delimitor.patch
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
5
6 From: Sachin Prabhu <sprabhu@redhat.com>
7
8 commit c369c9a4a7c82d33329d869cbaf93304cc7a0c40 upstream.
9
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
12 password.
13
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>
18
19 ---
20 fs/cifs/connect.c | 16 +++++++++++++---
21 1 file changed, 13 insertions(+), 3 deletions(-)
22
23 --- a/fs/cifs/connect.c
24 +++ b/fs/cifs/connect.c
25 @@ -1546,14 +1546,24 @@ cifs_parse_mount_options(const char *mou
26 }
27 break;
28 case Opt_blank_pass:
29 - vol->password = NULL;
30 - break;
31 - case Opt_pass:
32 /* passwords have to be handled differently
33 * to allow the character used for deliminator
34 * to be passed within them
35 */
36
37 + /*
38 + * Check if this is a case where the password
39 + * starts with a delimiter
40 + */
41 + tmp_end = strchr(data, '=');
42 + tmp_end++;
43 + if (!(tmp_end < end && tmp_end[1] == delim)) {
44 + /* No it is not. Set the password to NULL */
45 + vol->password = NULL;
46 + break;
47 + }
48 + /* Yes it is. Drop down to Opt_pass below.*/
49 + case Opt_pass:
50 /* Obtain the value string */
51 value = strchr(data, '=');
52 value++;