matchpathcon\_checkmatches(3) SELinux API documentation matchpathcon\_checkmatches(3)

# [NAME](#NAME)

matchpathcon\_checkmatches, matchpathcon\_filespec\_add, matchpathcon\_filespec\_destroy, matchpathcon\_filespec\_eval - check and report whether any specification index has no matches with any inode. Maintenance and statistics on inode associations

# [SYNOPSIS](#SYNOPSIS)

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

**void matchpathcon\_checkmatches(char \*str);**

**int matchpathcon\_filespec\_add(ino\_t ino, int specind, const char \*file);**

**void matchpathcon\_filespec\_destroy(void);**

**void matchpathcon\_filespec\_eval(void);**

# [DESCRIPTION](#DESCRIPTION)

**matchpathcon\_checkmatches**() checks whether any specification has no matches and reports them. The *str* argument is used as a prefix for any warning messages.

**matchpathcon\_filespec\_add**() maintains an association between an inode *ino* and a specification index *specind*, and checks whether a conflicting specification is already associated with the same inode (e.g. due to multiple hard links). If so, then it uses the latter of the two specifications based on their order in the *file* context configuration. Returns the specification index used or -1 on error.

**matchpathcon\_filespec\_destroy**() destroys any inode associations that have been added, e.g. to restart for a new filesystem.

**matchpathcon\_filespec\_eval**() displays statistics on the hash table usage for the inode associations.

# [RETURN VALUE](#RETURN_VALUE)

Returns zero on success or -1 otherwise.

# [SEE ALSO](#SEE_ALSO)

[**selinux**(8)](/man/os/libselinux/selinux.8), [**matchpathcon**(3)](/man/os/libselinux/matchpathcon.3), [**matchpathcon\_index**(3)](/man/os/libselinux/matchpathcon_index.3), [**freecon**(3)](/man/os/libselinux/freecon.3), [**setfilecon**(3)](/man/os/libselinux/setfilecon.3), [**setfscreatecon**(3)](/man/os/libselinux/setfscreatecon.3)

21 November 2009 stephen.smalley.work@gmail.com

---

Document: matchpathcon_filespec_add(3) from libselinux 3.11-r2 (Chainguard OS)
Source: https://github.com/SELinuxProject/selinux.git
