sepol\_check\_context(3) SE Linux binary policy API documentation sepol\_check\_context(3)

# [NAME](#NAME)

sepol\_check\_context - Check the validity of a security context against a binary policy.

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;sepol/sepol.h&gt;**

**int sepol\_check\_context(const char \*context);**

**int sepol\_set\_policydb\_from\_file(FILE \*fp);**

# [DESCRIPTION](#DESCRIPTION)

**sepol\_check\_context** checks the validity of a security context against a binary policy previously loaded from a file via **sepol\_set\_policydb\_from\_file.** It is used by **setfiles -c** to validate a file contexts configuration against the binary policy upon policy builds. For validating a context against the active policy on a SELinux system, use **security\_check\_context** from libselinux instead.

# [RETURN VALUE](#RETURN_VALUE)

Returns 0 on success or -1 with errno set otherwise.

15 March 2005 stephen.smalley.work@gmail.com

---

Document: sepol_check_context(3) from libsepol 3.11-r3 (Chainguard OS)
Source: https://github.com/SELinuxProject/selinux.git
