Skip to content

Add file_contexts lookup. - #173

Merged
pebenito merged 3 commits into
SELinuxProject:mainfrom
pebenito:filecontexts
Jul 8, 2026
Merged

Add file_contexts lookup.#173
pebenito merged 3 commits into
SELinuxProject:mainfrom
pebenito:filecontexts

Conversation

@pebenito

@pebenito pebenito commented Jul 8, 2026

Copy link
Copy Markdown
Member

This leverages libselinux's existing functionality.

Additional improvements:

  • Add Context lookup by string
  • Add file_contexts lookup support to MCP server
  • Add Range comparison methods

Cleanups:

  • Convert C preprocessor constants from Cython int to enum so Cython knows they aren't writable values.

pebenito added 3 commits July 8, 2026 13:09
This tells Cython that they are not writable values. Avoids issues like this:

178762 | AF_INET6 = __Pyx_PyLong_As_int(o); if (unlikely((AF_INET6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L2_error)
| ^
setools/policyrep.c:178765:22: error: lvalue required as left operand of assignment

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
@pebenito
pebenito merged commit a46abb3 into SELinuxProject:main Jul 8, 2026
12 checks passed
@pebenito
pebenito deleted the filecontexts branch July 8, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant