* [PATCH] cifs: Allow passwords which begin with a delimitor
@ 2013-04-09 17:17 Sachin Prabhu
[not found] ` <1365527861-6624-1-git-send-email-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Sachin Prabhu @ 2013-04-09 17:17 UTC (permalink / raw)
To: linux-cifs; +Cc: Steve French, Jeff Layton, Peter Maloney
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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
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 12b3da3..f7199b9 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,
}
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.11.7
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <1365527861-6624-1-git-send-email-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] cifs: Allow passwords which begin with a delimitor [not found] ` <1365527861-6624-1-git-send-email-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2013-04-10 11:05 ` Jeff Layton [not found] ` <20130410070525.640b460f-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Jeff Layton @ 2013-04-10 11:05 UTC (permalink / raw) To: Sachin Prabhu; +Cc: linux-cifs, Steve French, Peter Maloney On Tue, 9 Apr 2013 18:17:41 +0100 Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > --- > 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 12b3da3..f7199b9 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, > } > 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++; Looks reasonable to me. Should this also go to stable? Acked-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20130410070525.640b460f-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>]
* Re: [PATCH] cifs: Allow passwords which begin with a delimitor [not found] ` <20130410070525.640b460f-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org> @ 2013-04-10 11:47 ` Sachin Prabhu 2013-04-10 20:57 ` Steve French 0 siblings, 1 reply; 4+ messages in thread From: Sachin Prabhu @ 2013-04-10 11:47 UTC (permalink / raw) To: Jeff Layton; +Cc: linux-cifs, Steve French, Peter Maloney On Wed, 2013-04-10 at 07:05 -0400, Jeff Layton wrote: > On Tue, 9 Apr 2013 18:17:41 +0100 > Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > > > 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > --- > > 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 12b3da3..f7199b9 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, > > } > > 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++; > > Looks reasonable to me. Should this also go to stable? > Yes. This will also need to be fixed in stable. > Acked-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > -- > To unsubscribe from this list: send the line "unsubscribe linux-cifs" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cifs: Allow passwords which begin with a delimitor 2013-04-10 11:47 ` Sachin Prabhu @ 2013-04-10 20:57 ` Steve French 0 siblings, 0 replies; 4+ messages in thread From: Steve French @ 2013-04-10 20:57 UTC (permalink / raw) To: Sachin Prabhu; +Cc: Jeff Layton, linux-cifs, Peter Maloney Merged into cifs-2.6.git for-next (added cc: stable too). Will try to get this in soon. On Wed, Apr 10, 2013 at 6:47 AM, Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > On Wed, 2013-04-10 at 07:05 -0400, Jeff Layton wrote: >> On Tue, 9 Apr 2013 18:17:41 +0100 >> Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: >> >> > 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> >> > --- >> > 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 12b3da3..f7199b9 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, >> > } >> > 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++; >> >> Looks reasonable to me. Should this also go to stable? >> > > Yes. This will also need to be fixed in stable. > >> Acked-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in >> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > > -- Thanks, Steve ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-10 20:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-09 17:17 [PATCH] cifs: Allow passwords which begin with a delimitor Sachin Prabhu
[not found] ` <1365527861-6624-1-git-send-email-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-10 11:05 ` Jeff Layton
[not found] ` <20130410070525.640b460f-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-04-10 11:47 ` Sachin Prabhu
2013-04-10 20:57 ` Steve French
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.