sefcontext_compile(8)

sefcontext_compile8

Compile file context regular expression files

Usage

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

Overview

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

-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

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

Examples

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

Results in the following file being generated:

/etc/selinux/default/contexts/files/file_contexts.bin

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

Results in the following file being generated in the cwd:

new_fc.bin

Releases

6 releases since Debian 8 (Jessie); the text changed 2 times.

  1. 8
  2. 9–12
  3. 13

-o since Debian 9 (Stretch); -p since Debian 9 (Stretch).

Author

Dan Walsh, <[email protected]>

From selinux-utils 3.8.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.