The privilege macros operate on single privileges and privilege sets. They are described on the priv_macros(5) man page. The macros do not directly change the privilege sets associated with files or processes, but manipulate variables of type priv_set_t.
Privilege Macro |
Description |
---|---|
PRIV_ASSERT(priv_set, priv_id) |
Put the privilege (priv_id) into the set (priv_set). |
PRIV_ISASSERT(priv_set, priv_id) |
Return non-zero if the privilege (priv_id) is asserted in (priv_set). |
PRIV_EQUAL(priv_set_a, Priv_set_b) |
Return non-zero if the sets are identical. |
PRIV_EMPTY(priv_set) |
Initialize the set to empty. |
PRIV_FILL(priv_set) |
Fill the set with all privileges. |
PRIV_ISEMPTY(priv_set) |
Return non-zero if the set is empty, and 0 if not empty. |
PRIV_ISFULL(priv_set) |
Return non-zero if the privilege contains all privileges defined for the system, and 0 otherwise. |
PRIV_CLEAR(priv_set, priv_id) |
Remove the privilege (priv_id) from set (priv_set). |
PRIV_INTERSECT(priv_set_a, priv_set_b) |
Store the intersection of set_a and set_b in set_b. |
PRIV_INVERSE(priv_set) |
Stores the inverse of priv_set in priv_set. |
PRIV_UNION(priv_set_a, priv_set_b) |
Store the union of set_a and set_b in set_b. |
PRIV_XOR(priv_set_a, priv_set_b,) |
Store the exclusive or of set_a and set_b in set_b. |
PRIV_ISSUBSET(priv_set_a, priv_set_b) |
Returns non-zero when all privileges asserted in priv_set_a are also asserted in priv_set_b, and 0 otherwise. |
PRIV_TEST(priv_id, errno) |
Test whether priv_id is in the effective set, and sets errno to 1 if True and 0 if False. |