The is_system_labeled() routine is used to determine whether you are running on a Trusted Extensions system. The following routine description includes the prototype declaration for each routine:
The is_system_labeled() routine returns TRUE (1) if the Trusted Extensions software is installed and active. Otherwise, it returns FALSE (0).
See the is_system_labeled(3C) man page. For an example of this routine's use, see get_peer_label() Label-Aware Function.
You can also use these other interfaces to determine whether the system is labeled:
X client. If you are writing an X client that depends on multilevel functionality, use the XQueryExtension() routine to query the X server for the SUN_TSOL extension.
Shell script. If you are writing a shell script that will determine whether the system is labeled, use the plabel command. See the plabel(1) man page.
The following example shows the smf_is_system_labeled() function used by the /onnv/onnv-gate/usr/src/cmd/svc/shell/smf_include.sh script:
#
# Returns zero (success) if system is labeled (aka Trusted Extensions).
# 1 otherwise.
#
smf_is_system_labeled() {
[ ! -x /bin/plabel ] && return 1
/bin/plabel > /dev/null 2>&1
return $?
}