HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)
p
priv_str_to_set(3) priv_str_to_set(3)
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 <stdio.h>
#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");
if (index)
printf("Invalid privilege name starting at %s\n", index);
exit(1);
}
printf("The privileges in the given privilege vector are %s\n",
priv_set_to_str( priv_vector, NULL, PRIV_STR_SHORT) );
}
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 3: February 2007 − 2 − Hewlett-Packard Company 145