Trusted Solaris Developer's Guide

CMW Labels

The text output form for CMW labels is as follows:

[SENSITIVITY LABEL]

This example initializes a CMW label to ADMIN_LOW [ADMIN_HIGH] and prints out the internal and external views. The process runs at ADMIN_HIGH and does not need privileges to translate the ADMIN_LOW [ADMIN_HIGH] label.

#include <tsol/label.h>

main()
{
	int retval, length = 0;
	char *string1 = (char *)0, *string2 = (char *)0;
	bclabel_t cmwlabel;

	bclhigh(&cmwlabel);
	retval = bcltos(&cmwlabel, &string1, length, VIEW_INTERNAL);
	printf("View Internal = %s\n", string1);

	retval = bcltos(&cmwlabel, &string2, length, VIEW_EXTERNAL);
	printf("View External = %s\n", string2);
}

The printf statements print the following:


View Internal = ADMIN_LOW [ADMIN_HIGH]
View External = UNCLASSIFIED [TS A B SA SB CC]

Note -

Although bclhigh() and the other functions in the bclmanifest() family allow you to manipulate to manipulate the value of the information label of the CMW label, you cannot set this value on an object. The information label for all objects is ADMIN_LOW by default.