Author: Eamon Walsh (ewalsh@tycho.nsa.gov) 2007
"const char *" object_name ", int " object_type ");" "int selabel_lookup_raw(struct selabel_handle *" hnd , "char **" context ,
"const char *" object_name ", int " object_type ");" .
selabel_lookup(3) describes the function with its return and error codes. This backend is also used to determine the default context for labeling remotely connected X clients. The object_type argument should be set to one of the following values:
SELABEL_X_PROP The object_name argument specifies the name of a window property, such as "WM_NAME".
SELABEL_X_SELN The object_name argument specifies the name of a selection, such as "PRIMARY".
SELABEL_X_EXT The object_name argument specifies the name of a protocol extension, such as "RENDER".
SELABEL_X_EVENT The object_name argument specifies the name of an event type, such as "X11:ButtonPress".
SELABEL_X_CLIENT The object_name argument is ignored, however it should be set to either * (an asterisk or 'wildcard' that will select the default entry) or a specific entry such as "remote" in the X contexts file as shown in the EXAMPLE section. The default context for labeling remote X clients is then returned.
SELABEL_X_POLYPROP Like SELABEL_X_PROP , but checks if the property was marked as being polyinstantiated. See NOTES below.
SELABEL_X_POLYSELN Like SELABEL_X_SELN , but checks if the selection was marked as being polyinstantiated. See NOTES below.
SELABEL_OPT_PATH A non-null value for this option specifies a path to a file that will be opened in lieu of the standard X contexts file (see the FILES section for details).
/etc/selinux/{SELINUXTYPE}/contexts/x_contexts
object_type@Text Name |
SELABEL_X_PROP@property |
SELABEL_X_SELN@selection |
SELABEL_X_EXT@extension |
SELABEL_X_EVENT@event |
SELABEL_X_CLIENT@client |
SELABEL_X_POLYPROP@poly_property |
SELABEL_X_POLYSELN@poly_selection |
object_type object_name context
object_type
This is the string representation of the object type shown in the Object Name String Values section. There can be multiple lines with the same object_type string that will form a block of entries (each with a different object_name entry).
These are the object names of the specific X-server resource such as PRIMARY, CUT_BUFFER0 etc. They are generally defined in the X-server source code (protocol.txt and BuiltInAtoms in the dix directory of the xorg-server source package). The entry can contain '*' for wildcard matching or '?' for substitution. Note that if the '*' is used, then be aware that the order of entries in the file is important. The '*' on its own is used to ensure a default fallback context is assigned and should be the last entry in the object_type block.
The security context that will be applied to the object.
# object_type object_name context selection PRIMARY system_u:object_r:clipboard_xselection_t:s0 selection * system_u:object_r:xselection_t:s0Example 2 - This example shows how a client entry can be configured to ensure an entry is always found:
# object_type object_name context client * system_u:object_r:remote_t:s0.