SELinux is a flexible Mandatory Access Control (MAC) for Linux.
This crate exposes neither deprecated nor undocumented SELinux API functions and types.
This crate is Linux-specific. Building it for non-Linux platforms, or for the Linux kernel, results in an empty crate.
This crate depends on some environment variables, and variants of those.
For each environment variable (e.g.,
CC), the following are the accepted
variants of it:
The following environment variables (and their variants) affect how this crate is built:
This crate links to
libselinux dynamically if possible, except when targeting
platforms based on the
musl C library.
This behavior can be changed either by setting the environment variable
1, or by enabling the crate feature
If both are defined, then the value of
SELINUX_STATIC takes precedence.
0 mandates dynamic linking.
By default, this crate finds SELinux headers and library based on the default target C compiler.
This behavior can be changed by:
- Either defining the environment variable
SELINUX_PATHto the path of a directory containing the sub-directories
libwhere the headers and library are installed.
- Or by defining one or both of the environment variables
SELINUX_LIB_DIRto paths to the directories where headers and library are present. If
SELINUX_PATHis also defined, then
This crate provides the following variables to other crates that depend on it:
DEP_SELINUX_INCLUDE: Path of the directory where library C header files reside.
DEP_SELINUX_LIB: Path of the directory where the library binary resides.
This project adheres to Semantic Versioning.
CHANGELOG.md file details notable changes over time.