From e79a14c77b935f6adba5c62320fc71276d050f71 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Thu, 1 Aug 2024 22:32:41 +0300 Subject: [PATCH] policygen: respect CIL option when generating comments Make explanatory comments follow the common style of comments (Classic language / CIL) Signed-off-by: Dmitry Sharshakov Acked-by: James Carter --- python/sepolgen/src/sepolgen/policygen.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/sepolgen/src/sepolgen/policygen.py b/python/sepolgen/src/sepolgen/policygen.py index 5d59dad7b..7715bed50 100644 --- a/python/sepolgen/src/sepolgen/policygen.py +++ b/python/sepolgen/src/sepolgen/policygen.py @@ -179,7 +179,9 @@ def __add_av_rule(self, av): rule.rule_type = rule.DONTAUDIT rule.comment = "" if self.explain: - rule.comment = str(refpolicy.Comment(explain_access(av, verbosity=self.explain))) + comment = refpolicy.Comment(explain_access(av, verbosity=self.explain)) + comment.set_gen_cil(self.gen_cil) + rule.comment = str(comment) if av.type == audit2why.ALLOW: rule.comment += "\n%s!!!! This avc is allowed in the current policy" % self.comment_start