Prevent incompatible option combinations.

checkmodule -m and -b are fundamentally incompatible with each other,
so reject attempts to use them together.

Resolves
https://bugzilla.redhat.com/show_bug.cgi?id=1064603

Also fix the error message for -m with -U to use stderr.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
This commit is contained in:
Stephen Smalley 2014-02-20 14:20:20 -05:00
parent 2001fa0e9d
commit bfb806120a

View File

@ -224,8 +224,12 @@ int main(int argc, char **argv)
}
if (handle_unknown && (policy_type != POLICY_BASE)) {
printf("Handling of unknown classes and permissions is only ");
printf("valid in the base module\n");
fprintf(stderr, "%s: Handling of unknown classes and permissions is only valid in the base module.\n", argv[0]);
exit(1);
}
if (binary && (policy_type != POLICY_BASE)) {
fprintf(stderr, "%s: -b and -m are incompatible with each other.\n", argv[0]);
exit(1);
}