From 02df146f315dee438d4132b12d134d9a1e110b63 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Thu, 21 May 2020 17:04:40 +0200 Subject: [PATCH] Error out on conflicting aa-exec parameters If multiple -p/--profile or -n/--namespace parameters are given to aa-exec, they are handled on a "last one wins" base. This probably isn't expected behaviour, and erroring out in case of conflicting parameters probably makes more sense. --- binutils/aa_exec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/binutils/aa_exec.c b/binutils/aa_exec.c index de310f2c1..a076bfbfd 100644 --- a/binutils/aa_exec.c +++ b/binutils/aa_exec.c @@ -131,9 +131,13 @@ static char **parse_args(int argc, char **argv) usage(argv[0], false); break; case 'p': + if (opt_profile) + error("Multiple -p/--profile parameters given"); opt_profile = optarg; break; case 'n': + if (opt_namespace) + error("Multiple -n/--namespace parameters given"); opt_namespace = optarg; break; case 'i':