genfscon rules have always supported an optional file type, but when the ability for writing a policy.conf file from a kernel policy was added to libsepol it did not include that support. Support for the optional file type was also left out of CIL genfscon rules. This patch set fixes these problems. Patch 1 adds support for writing the optional file type in genfscon rules when writing a policy.conf file from a kernel policy. Patches 2-4 adds support in CIL for handling an optional file type in genfscon rules, updates the CIL documentation, and adds support when writing out CIL from a kernel policy or module as well. James Carter (4): libsepol: Add support for file types in writing out policy.conf libsepol/cil: Allow optional file type in genfscon rules secilc/docs: Document the optional file type for genfscon rules libsepol: Write out genfscon file type when writing out CIL policy libsepol/cil/src/cil_binary.c | 39 +++++++++++++++++++ libsepol/cil/src/cil_build_ast.c | 43 +++++++++++++++++++-- libsepol/cil/src/cil_internal.h | 1 + libsepol/src/kernel_to_cil.c | 35 ++++++++++++++++- libsepol/src/kernel_to_conf.c | 35 ++++++++++++++++- libsepol/src/module_to_cil.c | 27 ++++++++++++- secilc/docs/cil_file_labeling_statements.md | 10 ++++- 7 files changed, 179 insertions(+), 11 deletions(-) -- 2.31.1