lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5512E933.60301@redhat.com>
Date:	Wed, 25 Mar 2015 17:58:27 +0100
From:	Ivan Vecera <ivecera@...hat.com>
To:	netdev@...r.kernel.org
CC:	Ben Hutchings <ben@...adent.org.uk>, bhutchings@...arflare.com
Subject: Re: [PATCH] ethtool: return non-zero from do_sset() when any of ETHTOOL_{G,S}*
 fails

On 02/06/2015 04:24 PM, Ivan Vecera wrote:
> Function do_sset returns unconditionally zero error code without regard
> to return value of ETHTOOL_{G,S}* ioctls.
>
> Cc: Ben Hutchings <ben@...adent.org.uk>
> Signed-off-by: Ivan Vecera <ivecera@...hat.com>
> ---
>   ethtool.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/ethtool.c b/ethtool.c
> index bf583f3..c004d41 100644
> --- a/ethtool.c
> +++ b/ethtool.c
> @@ -2357,7 +2357,7 @@ static int do_sset(struct cmd_context *ctx)
>   	int argc = ctx->argc;
>   	char **argp = ctx->argp;
>   	int i;
> -	int err;
> +	int err, result = 0;
>
>   	for (i = 0; i < ARRAY_SIZE(flags_msglvl); i++)
>   		flag_to_cmdline_info(flags_msglvl[i].name,
> @@ -2617,6 +2617,7 @@ static int do_sset(struct cmd_context *ctx)
>   				fprintf(stderr, "  not setting transceiver\n");
>   			if (mdix_wanted != -1)
>   				fprintf(stderr, "  not setting mdix\n");
> +			result = err;
>   		}
>   	}
>
> @@ -2650,6 +2651,7 @@ static int do_sset(struct cmd_context *ctx)
>   				fprintf(stderr, "  not setting wol\n");
>   			if (sopass_change)
>   				fprintf(stderr, "  not setting sopass\n");
> +			result = err;
>   		}
>   	}
>
> @@ -2668,9 +2670,10 @@ static int do_sset(struct cmd_context *ctx)
>   			if (err < 0)
>   				perror("Cannot set new msglvl");
>   		}
> +		result = err;
>   	}
>
> -	return 0;
> +	return result;
>   }
>
>   static int do_gregs(struct cmd_context *ctx)
>
Ben, any comment on this?

Ivan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ