Trusted Extensions Library Functions labelbuilder(3TSOL)
NAME
labelbuilder, tsollbuildcreate, tsollbuildget,
tsollbuildset, tsollbuilddestroy - create a Motif-based
user interface for interactively building a valid label or
clearance
SYNOPSIS
cc [flag...] file... -ltsol -lDtTsol [library...]
#include
ModLabelData *tsollbuildcreate(Widget widget,
void (*eventhandler)() okcallback,
lbuildattributes extendedoperation, ..., NUL);
void *tsollbuildget(ModLabelData *data,
lbuildattributes extendedoperation);
void tsollbuildset(ModLabelData *data,
lbuildattributes extendedoperation, ..., NUL);
void tsollbuilddestroy(ModLabelData *data);
DESCRIPTION
The label builder user interface prompts the end user for
information and generates a valid sensitivity label or
clearance from the user input based on specifications in the
labelencodings(4) file on the system where the application
runs. The end user can build the label or clearance by typ-
ing a text value or by interactively choosing options.
Application-specific functionality is implemented in the
callback for the OK pushbutton. This callback is passed to
the tsollbuildcreate() call where it is mapped to the OK
pushbutton widget.
When choosing options, the label builder shows the user only
those classifications (and related compartments and mark-
ings) dominated by the workspace sensitivity label unless
the executable has the PRIVSYSTRANSLABEL privilege in its
effective set.
If the end user does not have the authorization to upgrade
or downgrade labels, or if the user-built label is out of
SunOS 5.11 Last change: 20 Jul 2007 1
Trusted Extensions Library Functions labelbuilder(3TSOL)
the user's accreditation range, the OK and Reset pushbuttons
are grayed. There are no privileges to override these res-
trictions.
tsollbuildcreate() creates the graphical user interface
and returns a pointer variable of type ModLabeldata* that
contains information on the user interface. This information
is a combination of values passed in the
tsollbuildcreate() input parameter list, default values
for information not provided, and information on the widgets
used by the label builder to create the user interface. All
information except the widget information should be accessed
with the tsollbuildget() and tsollbuildset() routines.
The widget information is accessed directly by referencing
the following fields of the ModLabelData structure.
lbuilddialog The label builder dialog box.
ok The OK pushbutton.
cancel The Cancel pushbutton.
reset The Reset pushbutton.
help The Help pushbutton.
The tsollbuildcreate() parameter list takes the following
values:
widget The widget from which the dialog box is
created. Any Motif widget can be passed.
okcallback A callback function that implements the
behavior of the OK pushbutton on the dialog
box.
..., NUL A NUL terminated list of extended operations
and value pairs that define the characteris-
tics and behavior of the label builder dialog
box.
SunOS 5.11 Last change: 20 Jul 2007 2
Trusted Extensions Library Functions labelbuilder(3TSOL)
tsollbuilddestroy() destroys the ModLabelData structure
returned by tsollbuildcreate().
tsollbuildget() and tsollbuildset() access the informa-
tion stored in the ModLabelData structure returned by
tsollbuildcreate().
The following extended operations can be passed to
tsollbuildcreate() to build the user interface, to
tsollbuildget() to retrieve information on the user inter-
face, and to tsollbuildset() to change the user interface
information. All extended operations are valid for
tsollbuildget(), but the *WORK* operations are not valid
for tsollbuildset() or tsollbuildcreate() because these
values are set from input supplied by the end user. These
exceptions are noted in the descriptions.
LBUILDMODE Create a user interface to build a
sensitivity label or a clearance.
Value is LBUILDMODESL by default.
LBUILDMODESL Build a sensitivity
label.
LBUILDMODECLR Build a clearance.
LBUILDVALUESL The starting sensitivity label. This
value is ADMINLOW by default and is
used when the mode is LBUILDMODESL.
LBUILDVALUECLR The starting clearance. This value is
ADMINLOW by default and is used when
the mode is LBUILDMODECLR.
LBUILDUSERFIELD A character string prompt that
displays at the top of the label
builder dialog box. Value is NUL by
default.
LBUILDSHOW Show or hide the label builder dialog
box. Value is FALSE by default.
TRUE Show the label builder dialog
box.
SunOS 5.11 Last change: 20 Jul 2007 3
Trusted Extensions Library Functions labelbuilder(3TSOL)
FALSE Hide the label builder dialog
box.
LBUILDTITLE A character string title that appears
at the top of the label builder dialog
box. Value is NUL by default.
LBUILDWORKSL Not valid for tsollbuildset() or
tsollbuildcreate(). The sensitivity
label the end user is building. Value
is updated to the end user's input
when the end user selects the Update
pushbutton or interactively chooses an
option.
LBUILDWORKCLR Not valid for tsollbuildset() or
tsollbuildcreate(). The clearance
the end user is building. Value is
updated to the end user's input when
the end user selects the Update push-
button or interactively chooses an
option.
LBUILDX The X position in pixels of the top-
left corner of the label builder dia-
log box in relation to the top-left
corner of the screen. By default the
label builder dialog box is positioned
in the middle of the screen.
LBUILDY The Y position in pixels of the top-
left corner of the label builder dia-
log box in relation to the top-left
corner of the screen. By default the
label builder dialog box is positioned
in the middle of the screen.
LBUILDLOWERBOUND The lowest classification (and related
compartments and markings) available
to the user as radio buttons for
interactively building a label or
clearance. This value is the user's
minimum label.
SunOS 5.11 Last change: 20 Jul 2007 4
Trusted Extensions Library Functions labelbuilder(3TSOL)
LBUILDUPERBOUND The highest classification (and
related compartments and markings)
available to the user as radio buttons
for interactively building a label or
clearance. A supplied value should be
within the user's accreditation range.
If no value is specified, the value is
the user's workspace sensitivity
label, or if the executable has the
PRIVSYSTRANSLABEL privilege, the
value is the user's clearance.
LBUILDCHECKAR Check that the user-built label
entered in the Update With field is
within the user's accreditation range.
A value of 1 means check, and a value
of 0 means do not check. If checking
is on and the label is out of range,
an error message is raised to the end
user.
LBUILDVIEW Use the internal or external label
representation. Value is
LBUILDVIEWEXTERNAL by default.
LBUILDVIEWINTERNAL
Use the internal names for the
highest and lowest labels in the
system: ADMINHIGH and ADMINLOW.
LBUILDVIEWEXTERNAL
Promote an ADMINLOW label to the
next highest label, and demote an
ADMINHIGH label to the next
lowest label.
RETURN VALUES
The tsollbuildget() function returns -1 if it is unable to
get the value.
The tsollbuildcreate() function returns a variable of type
ModLabelData that contains the information provided in the
tsollbuildcreate() input parameter list, default values
for information not provided, and information on the widgets
SunOS 5.11 Last change: 20 Jul 2007 5
Trusted Extensions Library Functions labelbuilder(3TSOL)
used by the label builder to create the user interface.
EXAMPLES
Example 1 Create a Label Builder.
(ModLabelData *)lbldata = tsollbuildcreate(widget0, callbackfunction,
LBUILDMODE, LBUILDMODESL,
LBUILDTITLE, "Setting Sensitivity Label",
LBUILDVIEW, LBUILDVIEWINTERNAL,
LBUILDX, 200,
LBUILDY, 200,
LBUILDUSERFIELD, "Pathname:",
LBUILDSHOW, FALSE,
NUL);
Example 2 Query the Mode and Display the Label Builder.
These examples call the tsollbuildget() function to query
the mode being used, and call the tsollbuildset() function
so the label builder dialog box displays.
mode = (int)tsollbuildget(lbldata, LBUILDMODE );
tsollbuildset(lbldata, LBUILDSHOW, TRUE, NUL);
Example 3 Destroy the ModLabelData Variable.
This example destroys the ModLabelData variable returned in
the call to tsollbuildcreate().
tsollbuilddestroy(lbldata);
FILES
/usr/dt/include/Dt/ModLabel.h
Header file for label builder functions
/etc/security/tsol/labelencodings
The label encodings file contains the classification
names, words, constraints, and values for the defined
SunOS 5.11 Last change: 20 Jul 2007 6
Trusted Extensions Library Functions labelbuilder(3TSOL)
labels of this system.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level MT-Safe
SEE ALSO
libtsol(3LIB), labelencodings(4), attributes(5)
Chapter 7, Label Builder APIs, in Solaris Trusted Extensions
Developer's Guide
NOTES
The functionality described on this manual page is available
only if the system is configured with Trusted Extensions.
SunOS 5.11 Last change: 20 Jul 2007 7
|