PRIV_POLICY(9F) | Kernel Functions for Drivers | PRIV_POLICY(9F) |
priv_policy, priv_policy_only, priv_policy_choice - check, report, and audit privileges
#include <sys/policy.h> int priv_policy(const cred_t *cr, int priv, int err,
boolean_t flag, const char *msg);
boolean_t priv_policy_only(const cred_t *cr, int priv,
boolean_t flag);
boolean_t priv_policy_choice(const cred_t *cr, int priv,
boolean_t flag);
illumos DDI specific (illumos DDI).
cr
priv
flag
err
msg
These functions aid in privilege checking and privilege debugging.
The priv_policy(), priv_policy_only(), and priv_policy_choice() functions all check whether priv is asserted in the effective set of the credential. The special value PRIV_ALL tests for all privileges.
The priv_policy() function updates the ASU accounting flag and records the privilege used on success in the audit trail if the required privilege was not a basic privilege.
The priv_policy_only() function checks whether a privilege is asserted and has no side effects.
The priv_policy_choice() function behaves like priv_policy_only() but records the successfully used non-basic privileges in the audit trail.
On success, priv_policy() return 0. On failure it returns its parameter err.
On success, priv_policy_choice() and priv_policy_only() return 1, on failure both return 0.
EINVAL
ENOMEM
ENAMETOOLONG
This functions can be called from user, interrupt, or kernel context.
See attributes(7) for a description of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Committed |
acct(3HEAD), attributes(7), privileges(7)
Writing Device Drivers
April 3, 2009 | OmniOS |