[apparmor] [patch] parser: exit with error on invalid arguments

John Johansen john.johansen at canonical.com
Fri Feb 21 00:47:12 UTC 2014


On 02/20/2014 04:30 PM, Steve Beattie wrote:
> The parser currently indicates that it exited successfully if invalid
> arguments are passed to it, which makes it difficult to detect when
> other tools are calling it incorrectly. This patch causes it to return
> '1' indicating a failure.
> 
> Signed-off-by: Steve Beattie <steve at nxnw.org>
Acked-by: John Johansen <john.johansen at canonical.com>

> ---
>  parser/parser_main.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: b/parser/parser_main.c
> ===================================================================
> --- a/parser/parser_main.c
> +++ b/parser/parser_main.c
> @@ -572,7 +572,7 @@ static int process_arg(int c, char *opta
>  		break;
>  	default:
>  		display_usage(progname);
> -		exit(0);
> +		exit(1);
>  		break;
>  	}
>  
> 
> 
> 




More information about the AppArmor mailing list