selinux_file_context_cmp
Compare two SELinux security contexts excluding the 'user' component
- Provided by: libselinux1-dev (Version: 3.3-1build2)
- Source: libselinux
- Report a bug
Compare two SELinux security contexts excluding the 'user' component
#include <selinux/selinux.h>
int selinux_file_context_cmp(const char *a,
selinux_file_context_cmp() compares two context strings excluding the user component with strcmp(3) as shown in the EXAMPLE section.
This is useful as for most object contexts, the user component is not relevant.
The return values follow the strcmp(3) function, where:
None.
The contexts being compared do not specifically need to be file contexts.
If context a is:
and context b is:
then the actual strings compared are:
Therefore they will match and selinux_file_context_cmp() will return zero.