is used to initialize a labeling handle to be used for lookup operations. The
.Ibackend
argument specifies which backend is to be opened; the list of current backends appears in
.BBACKENDS
below.
The
.Ioptions
argument should be NULL or a pointer to an array of
.Bselinux_opt
structures of length
.IRnopt:
.RS
.ta4n16n24n
.nf
struct selinux_opt {
int type;
const char *value;
};
.fi
.ta
.RE
The available option types are described in
.BGLOBALOPTIONS
below as well as in the documentation for each individual backend. The return value on success is a non-NULL value for use in subsequent label operations.
The option with a type code of zero is a no-op. Thus an array of options may be initizalized to zero and any untouched elements will not cause an error.
.TP
.BSELABEL_OPT_VALIDATE
A non-null value for this option enables context validation. By default,
.BRsecurity_check_context(3)
is used; a custom validation function can be provided via
.BRselinux_set_callback(3).
Note that an invalid context may not be treated as an error unless it is actually encountered during a lookup operation.