libsepol: Print line markers also for allow rules
PATCH 1/1 libsepol: Print line markers also for allow rules
Currently, only line markers for neverallow rules are printed. This makes people difficult to debug a neverallow failure with cil files generated by checkpolicy.
This change additionally prints line markers for allow and allowxperm statements to make debugging easier.
Signed-off-by Inseob Kim <[email protected]>
--- libsepol/src/module_to_cil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
libsepol/src/module_to_cil.c +2 -2
@@ -1196,7 +1196,7 @@ static int avrule_list_to_cil(int indent, struct policydb *pdb, struct avrule *astruct type_set *ts;for (avrule = avrule_list; avrule !=NULL ; avrule = avrule->next) { -if ((avrule->specified & (AVRULE_NEVERALLOW |AVRULE_XPERMS_NEVERALLOW )) && +if ((avrule->specified & (AVRULE_ALLOWED |AVRULE_XPERMS_ALLOWED |AVRULE_NEVERALLOW |AVRULE_XPERMS_NEVERALLOW )) && avrule->source_filename) {cil_println (0 ,";;* lmx %lu %s\n" ,avrule->source_line, avrule->source_filename); }
@@ -1264,7 +1264,7 @@ static int avrule_list_to_cil(int indent, struct policydb *pdb, struct avrule *anames_destroy (&snames, &num_snames);names_destroy (&tnames, &num_tnames); -if ((avrule->specified & (AVRULE_NEVERALLOW |AVRULE_XPERMS_NEVERALLOW )) && +if ((avrule->specified & (AVRULE_ALLOWED |AVRULE_XPERMS_ALLOWED |AVRULE_NEVERALLOW |AVRULE_XPERMS_NEVERALLOW )) && avrule->source_filename) {cil_println (0 ,";;* lme\n" ); }
Signature · 1 line
2.49.0.rc1.451.g8f38331e32-goog