mac_from_text(3C)

mac_from_text, mac_to_text, mac_to_text_long - convert a POSIX MAC string from/to mac_t

As shipped in IRIX 6.5.15. Unchanged since IRIX 6.5.

NAME
     mac_from_text, mac_to_text, mac_to_text_long - convert a POSIX MAC string
     from/to mac_t

SYNOPSIS
     #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);

DESCRIPTION
     These routines convert MAC labels from/to a mac_t, the structure
     representing an object's MAC attributes in the POSIX P1003.1e
     specifications.

RETURN VALUES
     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.

ERRORS
     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
SEE ALSO
     mac_equal(3C)