MAC_GET_PROC(3C) MAC_GET_PROC(3C)
mac_get_proc, mac_set_proc - get or set the MAC label of this process
#include <sys/mac.h>
mac_t mac_get_proc(void);
int mac_set_proc(mac_t macp);
mac_get_proc returns a mac_t, a pointer to an allocated struct mac_label
which is the MAC label for this process.
mac_set_proc sets the MAC label of the process. The MAC label is first
checked for validity by mac_valid(3c). The process must have
CAP_MAC_RELABEL_SUBJ capability in its effective set to change its MAC
label.
mac_get_proc a mac_t if successful, NULL otherwise. The storage should
be freed with a call to mac_free with the returned pointer as an argument
when it is no longer needed.
mac_set_proc returns 0 if successful, -1 otherwise.
mac_get_proc:
ENOMEM allocation of the mac_t failed.
ENOSYS MAC support is not available (not installed).
mac_set_proc:
EINVAL macp points to an invalid MAC label.
ENOSYS MAC support is not available (not installed).
EPERM The process does not have appropriate privilege to
perform the operation to set the MAC label.
PPPPaaaaggggeeee 1111 [ Back ]
|