Jeff Layton | 29 Jul 13:14 2011
Picon

[PATCH] mount.cifs: check_newline returns EX_USAGE on error, not -1

Reported-by: Jan Lieskovsky <jlieskov@...>
Signed-off-by: Jeff Layton <jlayton@...>
---
 mount.cifs.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/mount.cifs.c b/mount.cifs.c
index 107a5a5..aa4581f 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
 <at>  <at>  -1419,8 +1419,7  <at>  <at>  static int check_newline(const char *progname, const char *name)
 static int check_mtab(const char *progname, const char *devname,
 		      const char *dir)
 {
-	if (check_newline(progname, devname) == -1 ||
-	    check_newline(progname, dir) == -1)
+	if (check_newline(progname, devname) || check_newline(progname, dir))
 		return EX_USAGE;
 	return 0;
 }
--

-- 
1.7.6

Jeff Layton | 29 Jul 15:28 2011
Picon

Re: [PATCH] mount.cifs: check_newline returns EX_USAGE on error, not -1

On Fri, 29 Jul 2011 07:14:30 -0400
Jeff Layton <jlayton@...> wrote:

> Reported-by: Jan Lieskovsky <jlieskov@...>
> Signed-off-by: Jeff Layton <jlayton@...>
> ---
>  mount.cifs.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/mount.cifs.c b/mount.cifs.c
> index 107a5a5..aa4581f 100644
> --- a/mount.cifs.c
> +++ b/mount.cifs.c
>  <at>  <at>  -1419,8 +1419,7  <at>  <at>  static int check_newline(const char *progname, const char *name)
>  static int check_mtab(const char *progname, const char *devname,
>  		      const char *dir)
>  {
> -	if (check_newline(progname, devname) == -1 ||
> -	    check_newline(progname, dir) == -1)
> +	if (check_newline(progname, devname) || check_newline(progname, dir))
>  		return EX_USAGE;
>  	return 0;
>  }

Given that this has (minor) security implications, I've gone ahead and
committed this to the repo.

--

-- 
Jeff Layton <jlayton@...>
(Continue reading)


Gmane