diff mbox

mount.cifs: fix the conflict between rwpidforward and rw mount options

Message ID 1314462077-6196-1-git-send-email-piastry@etersoft.ru (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Shilovsky Aug. 27, 2011, 4:21 p.m. UTC
Both these options are started with "rw" - that's why the first one
isn't switched on even if it is specified. Fix this by adding a length
check for "rw" option check.

Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
---
 mount.cifs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Jeff Layton Aug. 29, 2011, 4:55 p.m. UTC | #1
On Sat, 27 Aug 2011 20:21:17 +0400
Pavel Shilovsky <piastry@etersoft.ru> wrote:

> Both these options are started with "rw" - that's why the first one
> isn't switched on even if it is specified. Fix this by adding a length
> check for "rw" option check.
> 
> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
> ---
>  mount.cifs.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mount.cifs.c b/mount.cifs.c
> index aa4581f..1e3d534 100644
> --- a/mount.cifs.c
> +++ b/mount.cifs.c
> @@ -837,7 +837,7 @@ static int parse_opt_token(const char *token)
>  		return OPT_GUEST;
>  	if (strncmp(token, "ro", 2) == 0)
>  		return OPT_RO;
> -	if (strncmp(token, "rw", 2) == 0)
> +	if (strncmp(token, "rw", 2) == 0 && strlen(token) == 2)
>  		return OPT_RW;
>  	if (strncmp(token, "remount", 7) == 0)
>  		return OPT_REMOUNT;

Committed.
diff mbox

Patch

diff --git a/mount.cifs.c b/mount.cifs.c
index aa4581f..1e3d534 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -837,7 +837,7 @@  static int parse_opt_token(const char *token)
 		return OPT_GUEST;
 	if (strncmp(token, "ro", 2) == 0)
 		return OPT_RO;
-	if (strncmp(token, "rw", 2) == 0)
+	if (strncmp(token, "rw", 2) == 0 && strlen(token) == 2)
 		return OPT_RW;
 	if (strncmp(token, "remount", 7) == 0)
 		return OPT_REMOUNT;