privileges.3 (2010 09)

p
privileges(3) privileges(3)
privset_add() Adds the privilege privid to the privilege set referred to by dstp .
privset_alloc()
Allocates memory for a privilege set of type priv_set_t, but does
not initialize the space. The space allocated by this routine should be
released using the
privset_free()
routine.
privset_copy()
Copies the privilege set referred to by srcp to the privilege set
referred to by dstp .
privset_del() Removes the privilege specified by num from the privilege set referred
to by privp .
privset_empty()
Clears all privileges from privp .
privset_fill()
Assigns all privileges, including those not currently define on the sys-
tem, to the privilege set privp .
privset_free()
Deallocates the space used by the privilege set referred to by privp .
If privp is NULL, no action occurs.
privset_intersect()
Finds the privileges that the privilege sets srcp and dstp have in com-
mon and places the results in the privilege set dstp .
privset_inverse()
Inverts the privilege set pointed to by privp .
privset_isempty()
Checks whether the privilege set privp is the empty set.
privset_isequal()
Checks whether the privilege sets srcp and dstp are equal sets.
privset_isfull() Check whether the privilege set privp is the full set of privileges. A
full set of privileges is a set with all bits set, regardless of whether the
privilege is currently defined on the system.
privset_ismember()
Check whether the privilege privid is a member of the privilege set
privp .
privset_issubset()
Checks whether the privilege set srcp is a subset of the privilege set
dstp .
privset_subtract()
Subtracts the privilege set referred to by srcp from the privilege set
referred to by dstp .
privset_union() Checks the privileges in the privilege sets srcp and dstp and puts any
privilege that is in either set into dstp .
RETURN VALUE
priv_addset(), priv_delset()
, and privset_delset() return the following values:
0 Successful completion.
-1 Function failed. errno is set to indicate the error.
privset_isempty(), privset_isequal()
, privset_isfull(), priv_ismember(),
priv_isobserved(), and privset_issubset()
return the following values:
n
!=0 Non-zero number. Condition is TRUE.
0 Condition is FALSE. errno is set to indicate the error.
privset_alloc() returns the following values:
pointer Successful completions. Returns a non-null pointer to the allocated space.
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] Insufficient memory available to allocate space to hold a privilege set. The applica-
tion can try again later.
[EINVAL] Invalid argument.
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010