Since the usual convention is for the module name to be same as the base filename of the module, provide a warning message if they are different. Also warn if the output filename is different than the module name. Signed-off-by: James Carter <jwcart2@xxxxxxxxxxxxx> --- checkpolicy/checkmodule.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/checkpolicy/checkmodule.c b/checkpolicy/checkmodule.c index 5957d29..5d1e219 100644 --- a/checkpolicy/checkmodule.c +++ b/checkpolicy/checkmodule.c @@ -258,6 +258,19 @@ int main(int argc, char **argv) } } + if (policy_type != POLICY_BASE) { + sepol_policydb_t *module = (sepol_policydb_t *)&modpolicydb; + if (sepol_module_check_name_matches_filename(module, file)) { + fprintf(stderr, "Module name %s does not match input file %s\n", + sepol_module_get_name(module), file); + } + if (outfile) { + if (sepol_module_check_name_matches_filename(module, outfile)) { + fprintf(stderr, "Module name %s does not match output file %s\n", sepol_module_get_name(module), outfile); + } + } + } + if (modpolicydb.policy_type == POLICY_BASE && !cil) { /* Verify that we can successfully expand the base module. */ policydb_t kernpolicydb; -- 2.5.5 _______________________________________________ Selinux mailing list Selinux@xxxxxxxxxxxxx To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx. To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.