NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | RETURN VALUES | EXAMPLES | FILES | SEE ALSO | NOTES
#include <tsol/label.h>int bcltobanner(const bclabel_t *label, struct banner_fields *fields, const int flags);
The calling process must have PRIV_SYS_TRANS_LABEL
in its set of effective privileges to perform label translation on labels that dominate the current process' sensitivity label.
bcltobanner() translates a binary CMW label, label, into various character-coded labels and strings for display on printer banner and trailer pages and at the top and bottom of the document body pages. The members of the fields structure are either string pointers, or the length of memory pre-allocated to a string pointer. The string pointers may contain either a pointer to pre-allocated memory, or the value (char *)0. If the string pointer contains a pointer to pre-allocated memory, then its associated length member indicates the size of that memory. If it contains the value (char *)0, memory is allocated using malloc() to contain the translated character-coded label or string. The translated string is copied into allocated or pre-allocated memory.
The structure banner_fields stores the folloiwng information:
struct banner_fields { char *header; /* top and bottom banner/trailer page */ char *protect_as; /* "protect as" banner page section */ char *ilabel; /* Information Label, also top and bottom of body pages */ char *caveats; /* ``caveats'' banner page section */ char *channels; /* ``handling channels'' section */ /* lengths of pre-allocated string memory */ short header_len; /* header */ short protect_as_len; /* protect_as */ short short ilabel_len; /* Information Label */ short caveats_len; /* caveats */ short channels_len; /* handling channels */ };
Members of the fields structure have the following meaning:
String to print at the top and bottom of banner and trailer pages
String to print in the protect as warning of banner and trailer pages
String to print in the this system has labeled message of banner and trailer pages, and at the top and bottom of the document body pages
String to print in caveats section of the banner and trailer pages
String to print in channels section of the banner and trailer pages
Length of pre-allocated memory for header string
Length of pre-allocated memory for protect_as string
Length of pre-allocated memory for ilabel string
Length of pre-allocated memory for caveats string
Length of pre-allocated memory for channels string
The translation is controlled by the value of the flags parameter. flags may be either LONG_WORDS
, SHORT_WORDS
, or 0 (zero).
LONG_WORDS
Translate using long names of Words defined in label.
SHORT_WORDS
Translate using short names of Words defined in label. If no short name is defined in the label_encodings file for a Word, the long name is used.
A flags value 0 is equivalent to LONG_WORDS
.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Availability | SUNWtsu |
MT-Level | MT-Safe |
bcltobanner() returns:
If label is not a binary CMW label with a defined information label and sensitivity label, or if its information label portion is not dominated
by its sensitivity label portion, or if its sensitivity label portion is not dominated by the process sensitivity label and the process does not have PRIV_SYS_TRANS_LABEL
in its set of effective privileges, or if the label_encodings file is
inaccessible.
If memory cannot be allocated for a string in the fields structure, or if one of the pre-allocated memories is insufficient to hold its string. The value of that pre-allocated string is set to the NULL string (fields-> string[0] = '\00';).
If successful.
The string members of the fields structure are included in a printer banner page in the following manner:
HEADER This output must be protected as: PROTECT_AS unless manually reviewed and downgraded. The system has labeled this data: ILABEL CAVEATS CHANNELS HEADER
The label encodings file contains the classification names, words, constraints, and values for the defined labels of this system.
bilconjoin(3), blcompare(3), blinset(3), blmanifest(3), blminmax(3), blportion(3), bltos(3), bltype(3), blvalid(3), btohex(3), hextob(3), labelinfo(3), labelvers(3), sbltos(3), stobl(3), label_encodings(4)
Trusted Solaris Developer's Guide, and Trusted Solaris administrator's document set
If memory is allocated by this routine, the caller must free memory with free() when the memory is no longer in use. ADMIN_LOW
and ADMIN_HIGH
label portions are mapped differently
than the other routines. If the sensitivity label portion of label is ADMIN_LOW
, the label is mapped into the minimum sensitivity label defined in the label_encodings file, and if the label is ADMIN_HIGH
, the label is mapped into the maximum classification, and all compartments defined in the label_encodings file.
Information labels (ILs) are not supported in Trusted Solaris 7 and later releases. Trusted Solaris software interprets any ILs on communications and files from systems running earlier releases as ADMIN_LOW
.
Objects still have CMW labels, and CMW labels still include the IL component: IL[SL]; however, the IL component is fixed at ADMIN_LOW
.
As a result, Trusted Solaris 7 has the following characteristics:
ILs do not display in window labels; SLs (Sensitivity Labels) display alone within brackets.
ILs do not float.
Setting an IL on an object has no effect.
Getting an object's IL will always return ADMIN_LOW
.
Although certain utilities, library functions, and system calls can manipulate IL strings, the resulting ILs are always ADMIN_LOW
, and cannot be set on any objects.
Printer banners display sensitivity labels, not information labels.
NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | RETURN VALUES | EXAMPLES | FILES | SEE ALSO | NOTES