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]
Date:   Fri, 13 Oct 2017 11:38:21 -0500
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>
Cc:     linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH] objtool: Print top level commands on incorrect usage

On Fri, Oct 13, 2017 at 01:51:12PM +0530, Kamalesh Babulal wrote:
> Maintain the consistency with objtool subcommands, by
> printing cmd_usage() of top level commands, along with
> the error. When incorrect option/command is passed to
> objtool. Also change the exit code to 129, like other
> objtool subcommands.
> 
> After the patch:
> $ ./objtool -j
> Unknown option: -j
> 
>  usage: objtool COMMAND [ARGS]
> 
>  Commands:
>    check   Perform stack metadata validation on an object file
>    orc     Generate in-place ORC unwind tables for an object file
> 
> $ echo $?
> 129
> 
> Cc: Ingo Molnar <mingo@...nel.org>
> Signed-off-by: Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>
> ---
>  tools/objtool/objtool.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/objtool/objtool.c b/tools/objtool/objtool.c
> index 31e0f91..07f3299 100644
> --- a/tools/objtool/objtool.c
> +++ b/tools/objtool/objtool.c
> @@ -70,7 +70,7 @@ static void cmd_usage(void)
>  
>  	printf("\n");
>  
> -	exit(1);
> +	exit(129);

For consistency with the rest of the code, this should be -1 instead of
129 (though the end result is the same).

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ