Skip to content

Commit

Permalink
Support gaps in type array
Browse files Browse the repository at this point in the history
Support gaps in the type array which are supported by libsepol.

Encountered while experimenting on a policy optimization step that
removes unused type-attributes.

Signed-off-by: Christian Göttsche <[email protected]>
  • Loading branch information
cgzones committed Oct 1, 2024
1 parent 305c8fa commit 205dbb8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions setools/policyrep/selinuxpolicy.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,10 @@ cdef class SELinuxPolicy:
for i in range(self.handle.p.symtab[sepol.SYM_TYPES].nprim):
tmp_type = self.handle.p.type_val_to_struct[i]

# skip gaps
if tmp_type == NULL:
continue

# skip types
if tmp_type.flavor != sepol.TYPE_ATTRIB:
continue
Expand Down

0 comments on commit 205dbb8

Please sign in to comment.