Skip to content

Commit

Permalink
policygen: respect CIL option when generating comments
Browse files Browse the repository at this point in the history
Make explanatory comments follow the common style of comments (Classic language / CIL)

Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
Acked-by: James Carter <jwcart2@gmail.com>
  • Loading branch information
dsseng authored and jwcart2 committed Aug 14, 2024
1 parent b6910aa commit e79a14c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/sepolgen/src/sepolgen/policygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e79a14c

Please sign in to comment.