mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-11 03:51:26 +00:00
Change PermissionMap rule_weight to not raise exception.
We always want the rule_weight to work, even in the face of unmapped permissions. Other functions, e.g. for handling permission map editing and saving may raise an exception.
This commit is contained in:
parent
8a07be100f
commit
767c32b652
@ -149,10 +149,7 @@ class PermissionMap(object):
|
||||
for perm_name in rule.perms:
|
||||
mapping = self.permmap[class_name][perm_name]
|
||||
|
||||
if mapping[0] == "u":
|
||||
raise UnmappedPermission(
|
||||
"{0}:{1} is not mapped.".format(class_name, perm_name))
|
||||
elif mapping[0] == "r":
|
||||
if mapping[0] == "r":
|
||||
read_weight = max(read_weight, mapping[1])
|
||||
elif mapping[0] == "w":
|
||||
write_weight = max(write_weight, mapping[1])
|
||||
|
Loading…
Reference in New Issue
Block a user