sefcontext_compile(8) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | RETURN VALUE | EXAMPLES | AUTHOR | SEE ALSO | COLOPHON

sefcon...ompile(8) SELinux Command Line documentation sefcon...ompile(8)

NAME         top

       sefcontext_compile - compile file context regular expression
       files

SYNOPSIS         top

       sefcontext_compile [-o outputfile] [-p policyfile] inputfile

DESCRIPTION         top

       sefcontext_compile is used to compile file context regular
       expressions into pcre(3) format.

       The compiled file is used by libselinux file labeling functions.

       By default sefcontext_compile writes the compiled pcre file with
       the .bin suffix appended (e.g. inputfile.bin).

OPTIONS         top

       -o     Specify an outputfile that must be a fully qualified file
              name as the .bin suffix is not automatically added.

       -p     Specify a binary policyfile that will be used to validate
              the context entries in the inputfile
              If an invalid context is found the pcre formatted file
              will not be written and an error will be returned.

RETURN VALUE         top

       On error -1 is returned.  On success 0 is returned.

EXAMPLES         top

       Example 1:
       sefcontext_compile
       /etc/selinux/targeted/contexts/files/file_contexts

       Results in the following file being generated:
              /etc/selinux/targeted/contexts/files/file_contexts.bin

       Example 2:
       sefcontext_compile -o new_fc.bin
       /etc/selinux/targeted/contexts/files/file_contexts

       Results in the following file being generated in the cwd:
              new_fc.bin

AUTHOR         top

       Dan Walsh, <[email protected]>

SEE ALSO         top

       selinux(8), semanage(8),

COLOPHON         top

       This page is part of the selinux (Security-Enhanced Linux user-
       space libraries and tools) project.  Information about the
       project can be found at 
       ⟨https://github.com/SELinuxProject/selinux/wiki⟩.  If you have a
       bug report for this manual page, see
       ⟨https://github.com/SELinuxProject/selinux/wiki/Contributing⟩.
       This page was obtained from the project's upstream Git repository
       ⟨https://github.com/SELinuxProject/selinux⟩ on 2024-06-14.  (At
       that time, the date of the most recent commit that was found in
       the repository was 2023-05-11.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there
       is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to
       [email protected]

[email protected]              12 Aug 2015            sefcon...ompile(8)