From a98314d8c142a02887c841c31f9ba8688057927b Mon Sep 17 00:00:00 2001 From: Jan Zarsky Date: Tue, 5 Jun 2018 16:34:03 +0200 Subject: [PATCH] python/sepolgen: print all AV rules correctly In refpolicy module, in AVRule.__rule_type_str() method, self.rule_type was not checked for value self.NEVERALLOW so that string "neverallow" was never returned. Fix this by checking all four possible values and returning correct strings. Signed-off-by: Jan Zarsky --- python/sepolgen/src/sepolgen/refpolicy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/sepolgen/src/sepolgen/refpolicy.py b/python/sepolgen/src/sepolgen/refpolicy.py index 352b1878..a262e1c5 100644 --- a/python/sepolgen/src/sepolgen/refpolicy.py +++ b/python/sepolgen/src/sepolgen/refpolicy.py @@ -472,8 +472,10 @@ class AVRule(Leaf): return "allow" elif self.rule_type == self.DONTAUDIT: return "dontaudit" - else: + elif self.rule_type == self.AUDITALLOW: return "auditallow" + elif self.rule_type == self.NEVERALLOW: + return "neverallow" def from_av(self, av): """Add the access from an access vector to this allow