blob: 4eae1736ccc6ef98023ff38fdc4b03a9692d1d9d [file] [log] [blame]
Richard Haines50640d32015-08-13 12:09:00 +01001.TH "sefcontext_compile" "8" "12 Aug 2015" "dwalsh@redhat.com" "SELinux Command Line documentation"
Dan Walsh2af25262013-10-09 14:38:47 -04002.SH "NAME"
3sefcontext_compile \- compile file context regular expression files
4.
5.SH "SYNOPSIS"
Richard Haines3cb60782015-06-16 14:49:19 +01006.B sefcontext_compile
7.RB [ \-o
8.IR outputfile ]
Richard Haines50640d32015-08-13 12:09:00 +01009.RB [ \-p
10.IR policyfile ]
Richard Haines3cb60782015-06-16 14:49:19 +010011.I inputfile
Dan Walsh2af25262013-10-09 14:38:47 -040012.
13.SH "DESCRIPTION"
Richard Haines3cb60782015-06-16 14:49:19 +010014.B sefcontext_compile
15is used to compile file context regular expressions into
Petr Lautrbachf86707e2016-04-12 16:07:56 +020016.BR pcre (3)
Richard Haines3cb60782015-06-16 14:49:19 +010017format.
18.sp
19The compiled file is used by libselinux file labeling functions.
20.sp
21By default
22.B sefcontext_compile
Petr Lautrbachf86707e2016-04-12 16:07:56 +020023writes the compiled pcre file with the
Richard Haines3cb60782015-06-16 14:49:19 +010024.B .bin
25suffix appended (e.g. \fIinputfile\fB.bin\fR).
26.SH OPTIONS
27.TP
28.B \-o
29Specify an
30.I outputfile
31that must be a fully qualified file name as the
32.B .bin
33suffix is not automatically added.
Richard Haines50640d32015-08-13 12:09:00 +010034.TP
35.B \-p
36Specify a binary
37.I policyfile
38that will be used to validate the context entries in the
39.I inputfile
40.br
41If an invalid context is found the pcre formatted file will not be written and
42an error will be returned.
43
Richard Haines3cb60782015-06-16 14:49:19 +010044.SH "RETURN VALUE"
45On error -1 is returned. On success 0 is returned.
Dan Walsh2af25262013-10-09 14:38:47 -040046
Richard Haines3cb60782015-06-16 14:49:19 +010047.SH "EXAMPLES"
48.B Example 1:
49.br
Dan Walsh2af25262013-10-09 14:38:47 -040050sefcontext_compile /etc/selinux/targeted/contexts/files/file_contexts
Richard Haines3cb60782015-06-16 14:49:19 +010051.sp
52Results in the following file being generated:
53.RS
54/etc/selinux/targeted/contexts/files/file_contexts.bin
55.RE
56.sp
57.B Example 2:
58.br
59sefcontext_compile -o new_fc.bin /etc/selinux/targeted/contexts/files/file_contexts
60.sp
61Results in the following file being generated in the cwd:
62.RS
63new_fc.bin
64.RE
Dan Walsh2af25262013-10-09 14:38:47 -040065.
66.SH AUTHOR
67Dan Walsh, <dwalsh@redhat.com>
68.
69.SH "SEE ALSO"
70.BR selinux (8),
71.BR semanage (8),