From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <20130507035848.947144222@goodmis.org> Date: Mon, 06 May 2013 23:58:00 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sachin Prabhu , Jeff Layton , Steve French Subject: [048/126] cifs: Allow passwords which begin with a delimitor References: <20130507035712.909872333@goodmis.org> Content-Disposition: inline; filename=0048-cifs-Allow-passwords-which-begin-with-a-delimitor.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.3 stable review patch. If anyone has any objections, please let me know. ------------------ From: Sachin Prabhu [ Upstream commit c369c9a4a7c82d33329d869cbaf93304cc7a0c40 ] 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 Acked-by: Jeff Layton Cc: Signed-off-by: Steve French Signed-off-by: Steven Rostedt --- fs/cifs/connect.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index b39bb4a..487db09 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1489,14 +1489,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++; -- 1.7.10.4