table of contents
selinux_raw_context_to_color(3) | Library Functions Manual | selinux_raw_context_to_color(3) |
NAME¶
selinux_raw_context_to_color - Return RGB color string for an SELinux security context.SYNOPSIS¶
#include <selinux/selinux.h>char **color_str);
DESCRIPTION¶
selinux_raw_context_to_color returns a color_str associated to the raw context raw provided that the mcstransd(8) daemon is running, the policy is an MLS type policy (MCS or MLS) and there is a color configuration file secolor.conf(5) (see the FILES section).role, type, range
user, type, range
user, role, range
user, role, type
----- user ---- ---- role ---- ---- type ----
---- range ----
#000000 #ffffff #000000 #ffffff #000000 #ffffff #000000 #ffffff
RETURN VALUE¶
On success, zero is returned.ERRORS¶
ENOENT If the mcstransd(8) daemon is not running.FILES¶
selinux_raw_context_to_color obtains the translated entry from the active policy secolor.conf(5) file as returned by selinux_colors_path(3). The file format is described in secolor.conf(5).NOTES¶
1. The primary use of selinux_raw_context_to_color is to return a color that corresponds to a range, that can then be used to highlight information at different MLS levels.EXAMPLE¶
selinux_raw_context_to_color returns the foreground and background colors of the context string components (user:role:type:range) as RGB triples as follows:user : role : type : range
fg bg : fg bg : fg bg : fg bg
black white : white black : tan orange : black green
SEE ALSO¶
selinux(8), selinux_colors_path(3), mcstransd(8), secolor.conf(5), selinux_raw_to_trans_context(3), selinux_trans_to_raw_context(3), free(3)08 April 2011 | SELinux API documentation |