man-pages/man3/set_matchpathcon_flags.3.html
2021-03-31 01:06:50 +01:00

113 lines
3.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of set_matchpathcon_flags</TITLE>
</HEAD><BODY>
<H1>set_matchpathcon_flags</H1>
Section: SELinux API documentation (3)<BR>Updated: 21 November 2009<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
set_matchpathcon_flags, set_matchpathcon_invalidcon, set_matchpathcon_printf - set flags controlling the operation of matchpathcon or matchpathcon_index and configure the behaviour of validity checking and error displaying
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>#include &lt;<A HREF="file:///usr/include/selinux/selinux.h">selinux/selinux.h</A>&gt;</B>
<P>
<B>void set_matchpathcon_flags(unsigned int </B><I>flags</I><B>);</B>
<P>
<B>void set_matchpathcon_invalidcon(int (*</B><I>f</I><B>)(const char *</B><I>path</I><B>, unsigned </B><I>lineno</I><B>, char *</B><I>context</I><B>));</B>
<P>
<B>void set_matchpathcon_printf(void (*</B><I>f</I><B>)(const char *</B><I>fmt</I><B>, ...));</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>set_matchpathcon_flags</B>()
sets the flags controlling the operation of
<B><A HREF="/cgi-bin/man/man2html?3+matchpathcon_init">matchpathcon_init</A></B>(3)
and subsequently
<B><A HREF="/cgi-bin/man/man2html?3+matchpathcon_index">matchpathcon_index</A></B>(3)
or
<B><A HREF="/cgi-bin/man/man2html?3+matchpathcon">matchpathcon</A></B>(3).
If the
<B>MATCHPATHCON_BASEONLY</B>
flag is set, then only the base file contexts configuration file
will be processed, not any dynamically generated entries or local customizations.
<P>
<P>
<B>set_matchpathcon_invalidcon</B>()
sets the function used by
<B><A HREF="/cgi-bin/man/man2html?3+matchpathcon_init">matchpathcon_init</A></B>(3)
when checking the validity of a context in the file contexts
configuration. If not set, then this defaults to a test based
on
<B><A HREF="/cgi-bin/man/man2html?3+security_check_context">security_check_context</A></B>(3),
which checks validity against the active policy on a SELinux system.
This can be set to instead perform checking based on a binary policy file,
e.g. using
<B><A HREF="/cgi-bin/man/man2html?3+sepol_check_context">sepol_check_context</A></B>(3),
as is done by
<B>setfiles -c.</B>
The function is also responsible for reporting any such error, and
may include the
<I>path</I>
and
<I>lineno</I>
in such error messages.
<P>
<P>
<B>set_matchpathcon_printf</B>()
sets the function used by
<B><A HREF="/cgi-bin/man/man2html?3+matchpathcon_init">matchpathcon_init</A></B>(3)
when displaying errors about the file contexts configuration. If not set,
then this defaults to fprintf(stderr, fmt, ...). This can be set to redirect
error reporting to a different destination.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
Returns zero on success or -1 otherwise.
<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?8+selinux">selinux</A></B>(8), <B><A HREF="/cgi-bin/man/man2html?3+matchpathcon">matchpathcon</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+matchpathcon_index">matchpathcon_index</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+set_matchpathcon_invalidcon">set_matchpathcon_invalidcon</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+set_matchpathcon_printf">set_matchpathcon_printf</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+freecon">freecon</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+setfilecon">setfilecon</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+setfscreatecon">setfscreatecon</A></B>(3)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="4"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="5"><A HREF="#lbAF">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:56 GMT, March 31, 2021
</BODY>
</HTML>