Skip to contentSkip to conversation

cifs: Allow passwords which begin with a delimitor

PATCH Applied Sachin Prabhu 3 participants 4 messages Apr 9, 2013 – Apr 10, 2013 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: Allow passwords which begin with a delimitor

Fixes a regression in cifs_parse_mount_options where a password which begins with a delimitor is parsed incorrectly as being a blank password.

---
 fs/cifs/connect.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
fs/cifs/connect.c +13 -3
index 12b3da3..f7199b9 100644
@@ -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++;
Signature · 1 line
1.7.11.7

A message that is not in the archive (sent off-list or not yet received): 1365527861-6624-1-git-send-email-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

Acked-by
#2 lore raw
Quoted 31 lines · On Tue, 9 Apr 2013 18:17:41 +0100 Sachin Prabhu…

Fixes a regression in cifs_parse_mount_options where a password which begins with a delimitor is parsed incorrectly as being a blank password.

---
 fs/cifs/connect.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
fs/cifs/connect.c +6 -3
index 12b3da3..f7199b9 100644
@@ -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++;

fs/cifs/connect.c cifs_parse_mount_options(const char *mountdata, const char *devname, · line 1569

Quoted 10 lines
fs/cifs/connect.c +7 -0
+			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?

A message that is not in the archive (sent off-list or not yet received): 20130410070525.640b460f-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org

#4 lore raw
Quoted 38 lines · Jeff Layton
Quoted 35 lines · On Tue, 9 Apr 2013 18:17:41 +0100 Sachin Prabhu…

Fixes a regression in cifs_parse_mount_options where a password which begins with a delimitor is parsed incorrectly as being a blank password.

---
 fs/cifs/connect.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
fs/cifs/connect.c +10 -3
index 12b3da3..f7199b9 100644
@@ -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;
Quoted 9 lines

fs/cifs/connect.c cifs_parse_mount_options(const char *mountdata, const char *devname, · line 1569

Quoted 6 lines
fs/cifs/connect.c +3 -0
+			}
+			/* 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.

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#5 lore raw

Merged into cifs-2.6.git for-next (added cc: stable too). Will try
to get this in soon.

Quoted 59 lines · Sachin Prabhu
Quoted 38 lines · Jeff Layton
Quoted 35 lines · On Tue, 9 Apr 2013 18:17:41 +0100 Sachin Prabhu…

Fixes a regression in cifs_parse_mount_options where a password which begins with a delimitor is parsed incorrectly as being a blank password.

---
 fs/cifs/connect.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
fs/cifs/connect.c +10 -3
index 12b3da3..f7199b9 100644
@@ -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;
Quoted 9 lines

fs/cifs/connect.c cifs_parse_mount_options(const char *mountdata, const char *devname, · line 1569

Quoted 6 lines
fs/cifs/connect.c +3 -0
+                   }
+                   /* 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.

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Thanks,

Steve