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

Steve Beattie steve at nxnw.org
Fri Feb 21 00:30:49 UTC 2014


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>
---
 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;
 	}
 

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140220/413e91f1/attachment.pgp>


More information about the AppArmor mailing list