diff options
author | Sachin Prabhu <sprabhu@redhat.com> | 2013-04-09 18:17:41 +0100 |
---|---|---|
committer | Xavier Boudet <x-boudet@ti.com> | 2013-04-17 09:06:52 +0200 |
commit | 80765f2d682ff16c5e3b6fc569504b6407561499 (patch) | |
tree | 99553b3027d70d40eb5d783daa27ff693edd1026 /fs/cifs | |
parent | 47a4de8d9a816f3f4629c4f50e8a177f7f89adf8 (diff) |
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/cifs')
-rw-r--r-- | fs/cifs/connect.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index f771e9f98f9f..9cc574cb00d1 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1576,14 +1576,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++; |