HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

p
priv_str_to_set(3) priv_str_to_set(3)
priv_set_to_str()
is responsible for freeing the result using the
free().
NULL pointer
Function failed. Returns a null pointer and sets
errno to indicate the error .
ERRORS
If any of the following conditions occur, the functions fail and set
errno.
[ENOMEM] Cannot allocate enough memory for the given data.
[EINVAL] One or more arguments are invalid.
EXAMPLES
#include <sys/types.h>
#include <sys/privileges.h>
#define priv_list "PRIV_CHOWN,PRIV_CHROOT,PRIV_DACREAD"
main()
{
char *index;
priv_set_t * priv_vector;
if ( (priv_vector = priv_str_to_set( priv_list,
NULL,
&index)) == NULL )
{
perror("priv_str_to_set failed \n");
exit(1);
}
if (index)
printf("invalid privilege name starting at %s \n", index);
perror("The privileges in the given privilege vector are %s",
priv_set_to_str( priv_vector, NULL) );
}
DEPENDENCIES
priv_str_to_set()
and priv_set_to_str() are both part of the libsec library.
SEE ALSO
privset_free(3), privileges(5).
HP-UX 11i Version 2: December 2007 Update 2 Hewlett-Packard Company 169