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 <jzarsky@redhat.com>
This commit is contained in:
Jan Zarsky 2018-06-05 16:34:03 +02:00 committed by Nicolas Iooss
parent 416900cb11
commit a98314d8c1

View File

@ -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