| 1 |
.TH "set_matchpathcon_flags" "3" "21 November 2009" "[email protected]" "SELinux API documentation" |
| 2 |
.SH "NAME" |
| 3 |
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 |
| 4 |
. |
| 5 |
.SH "SYNOPSIS" |
| 6 |
.B #include <selinux/selinux.h> |
| 7 |
.sp |
| 8 |
.BI "void set_matchpathcon_flags(unsigned int " flags ");" |
| 9 |
.sp |
| 10 |
.BI "void set_matchpathcon_invalidcon(int (*" f ")(const char *" path ", unsigned " lineno ", char *" context "));" |
| 11 |
.sp |
| 12 |
.BI "void set_matchpathcon_printf(void (*" f ")(const char *" fmt ", ...));" |
| 13 |
. |
| 14 |
.SH "DESCRIPTION" |
| 15 |
.BR set_matchpathcon_flags () |
| 16 |
sets the flags controlling the operation of |
| 17 |
.BR matchpathcon_init (3) |
| 18 |
and subsequently |
| 19 |
.BR matchpathcon_index (3) |
| 20 |
or |
| 21 |
.BR matchpathcon (3). |
| 22 |
If the |
| 23 |
.B MATCHPATHCON_BASEONLY |
| 24 |
flag is set, then only the base file contexts configuration file |
| 25 |
will be processed, not any dynamically generated entries or local customizations. |
| 26 |
.sp |
| 27 |
|
| 28 |
.BR set_matchpathcon_invalidcon () |
| 29 |
sets the function used by |
| 30 |
.BR matchpathcon_init (3) |
| 31 |
when checking the validity of a context in the file contexts |
| 32 |
configuration. If not set, then this defaults to a test based |
| 33 |
on |
| 34 |
.BR security_check_context (3), |
| 35 |
which checks validity against the active policy on a SELinux system. |
| 36 |
This can be set to instead perform checking based on a binary policy file, |
| 37 |
e.g. using |
| 38 |
.BR sepol_check_context (3), |
| 39 |
as is done by |
| 40 |
.B setfiles \-c. |
| 41 |
The function is also responsible for reporting any such error, and |
| 42 |
may include the |
| 43 |
.I path |
| 44 |
and |
| 45 |
.I lineno |
| 46 |
in such error messages. |
| 47 |
.sp |
| 48 |
|
| 49 |
.BR set_matchpathcon_printf () |
| 50 |
sets the function used by |
| 51 |
.BR matchpathcon_init (3) |
| 52 |
when displaying errors about the file contexts configuration. If not set, |
| 53 |
then this defaults to fprintf(stderr, fmt, ...). This can be set to redirect |
| 54 |
error reporting to a different destination. |
| 55 |
. |
| 56 |
.SH "RETURN VALUE" |
| 57 |
Returns zero on success or \-1 otherwise. |
| 58 |
. |
| 59 |
.SH "SEE ALSO" |
| 60 |
.ad l |
| 61 |
.nh |
| 62 |
.BR selinux "(8), " matchpathcon "(3), " matchpathcon_index "(3), " set_matchpathcon_invalidcon "(3), " set_matchpathcon_printf "(3), " freecon "(3), " setfilecon "(3), " setfscreatecon "(3)" |