selabel_open(3) | SELinux API documentation | selabel_open(3) |
selabel_open, selabel_close - userspace SELinux labeling interface
#include <selinux/selinux.h>
#include <selinux/label.h>
struct selabel_handle *selabel_open(int
backend,
const struct selinux_opt *options,
unsigned nopt);
void selabel_close(struct selabel_handle *hnd);
selabel_open() is used to initialize a labeling handle to be used for lookup operations. The backend argument specifies which backend is to be opened; the list of current backends appears in BACKENDS below.
The options argument should be NULL or a pointer to an array of selinux_opt structures of length nopt:
struct selinux_opt { int type; const char *value; };
The available option types are described in GLOBAL OPTIONS 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.
selabel_close() terminates use of a handle, freeing any internal resources associated with it. After this call has been made, the handle must not be used again.
Global options which may be passed to selabel_open() include the following:
A non-NULL handle value is returned on success. On error, NULL is returned and errno is set appropriately.
Eamon Walsh <ewalsh@tycho.nsa.gov>
selabel_lookup(3), selabel_stats(3), selinux_set_callback(3), selinux(8)
18 Jun 2007 |