Krikri::PluginHelpers::SefcontextCommands
SefcontextCommands - command construction and semanage fcontext
output parsing for community.general.sefcontext (see
plugins/sefcontext.cr). Pure string plumbing mirroring the real
module's seobject-backed logic (semanage_fcontext_exists /
semanage_fcontext_modify / semanage_fcontext_delete), unit-testable
without an SELinux policy store.
Constants
FILE_TYPE_FLAG = {"a" => nil, "b" => "b", "c" => "c", "d" => "d", "f" => "--", "l" => "l", "p" => "p", "s" => "s"}
semanage fcontext's own -f flag per ftype letter. 'a' is the default (no flag), and a regular file is spelled '--'.
FILE_TYPE_STR = {"a" => "all files", "b" => "block device", "c" => "character device", "d" => "directory", "f" => "regular file", "l" => "symbolic link", "p" => "named pipe", "s" => "socket"}
The real module's option_to_file_type_str: seobject's own record
spelling for each ftype letter - the exact string semanage fcontext -l prints in its middle column.
Class methods
add_command(target : String, setype : String, ftype : String, seuser : String, serange : String) : Array(String)
Sourcemodify_command(target : String, setype : String, ftype : String, seuser : String, serange : String) : Array(String)
SourceParses semanage fcontext -C -l's equivalence lines:
"target = substitute".