File: matchpathcon.3

package info (click to toggle)
libselinux 1.22-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,916 kB
  • ctags: 1,580
  • sloc: ansic: 7,448; makefile: 82; sh: 78
file content (28 lines) | stat: -rw-r--r-- 1,118 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.TH "matchpathcon" "3" "1 August 2004" "dwalsh@redhat.com" "SE Linux API documentation"
.SH "NAME"
matchpathcon \- get the default security context for the specified file from the policy.

.SH "SYNOPSIS"
.B #include <selinux/selinux.h>
.sp
.BI "int matchpathcon(const char *" path ", mode_t " mode ", security_context_t *" con);
.br 
.BI "void set_matchpathcon_printf(void (*f)(const char *fmt, ...));"

.SH "DESCRIPTION"
.br
.B matchpathcon 
matches the specified pathname and mode against the file contexts configuration and sets the security context "con" to refer to the resulting context. "mode" can be 0 to disable mode matching, but should be provided whenever possible, as it may affect the matching.
.B Note: 
   Caller must free returned security context "con" using freecon.

.B set_matchpathcon_printf

Set the function used by matchpathcon when displaying errors about the file_contexts configuration.  If not set, then this defaults to fprintf(stderr, fmt, ...).
.sp
.br
.SH "RETURN VALUE"
Returns 0 on success or -1 otherwise.

.SH "SEE ALSO"
.BR freecon "(3), " setfilecon "(3), " setfscreatecon "(3)"