MAC_FROM_TEXT(3C) MAC_FROM_TEXT(3C)
mac_from_text, mac_to_text, mac_to_text_long - convert a POSIX MAC string
from/to mac_t
#include <sys/mac.h>
mac_t mac_from_text(const char *argp);
char * mac_to_text(mac_t macp, size_t *len_p);
char * mac_to_text_long(mac_t macp, size_t *len_p);
These routines convert MAC labels from/to a mac_t, the structure
representing an object's MAC attributes in the POSIX P1003.1e
specifications.
mac_from_text returns a mac_t, a pointer to an allocated struct mac_label
or a NULL pointer in the case of a failure. The mac_t should be freed
when no longer needed by calling mac_free(3c).
mac_to_text returns a pointer to a null terminated character string
allocated by the routine which is a short form representation of the MAC
label, or a NULL pointer if an error occurred. This string should be
freed when no longer needed by calling mac_free(3c). If the len_p
argument is not NULL, then the length of the string is returned in
ssize_t pointed to by len_p.
mac_to_text_long is identical to mac_to_text, except that a long form
representation of the MAC label is returned.
mac_from_text:
EINVAL input text is invalid
ENOMEM could not allocate space for new label
mac_to_text:
EINVAL input label is invalid
ENOMEM could not allocate space for the return string
mac_to_text_long:
EINVAL input label is invalid
ENOMEM could not allocate space for the return string
Page 1
MAC_FROM_TEXT(3C) MAC_FROM_TEXT(3C)
mac_equal(3C)
PPPPaaaaggggeeee 2222 [ Back ]
|