Query: priv_policy
OS: x11r4
Section: 9f
Links: x11r4 man pages all man pages forum categories
Format:Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
priv_policy(9F) Kernel Functions for Drivers priv_policy(9F)NAMEpriv_policy, priv_policy_only, priv_policy_choice - check, report, and audit privilegesSYNOPSIS#include <sys/cred.h> int priv_policy(const cred_t *cr, int priv, int err, const char *msg); int priv_policy_only(const cred_t *cr, int priv); int priv_policy_choice(const cred_t *cr, int priv);INTERFACE LEVELSolaris DDI specific (Solaris DDI).PARAMETERScr The credential to be checked. priv The integer value of the privilege to test. err The error code to return. msg String that is added to the privilege debugging message if one is generated. NULL if no additional information is needed. Because the function name is included in the output, NULL is usually the best value to pass as a parameter.DESCRIPTIONThese functions aid in privilege checking and privilege debugging. priv_policy(), priv_policy_only(), and priv_policy_choice() all check whether priv is asserted in the effective set of the credential. The special value PRIV_ALL tests for all privileges. priv_policy() 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. priv_policy_only() checks whether a privilege is asserted and has no side effects. priv_policy_choice() behaves like priv_policy_only() but records the successfully used non-basic privileges in the audit trail.RETURN VALUESOn 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.ERRORSEINVAL This might be caused by any of the following: o The flags parameter is invalid. o The specified privilege does not exist. o The priv parameter contains invalid characters. ENOMEM There is no room to allocate another privilege. ENAMETOOLONG An attempt was made to allocate a privilege that was longer than {PRIVNAME_MAX} characters.CONTEXTThis functions can be called from user or interrupt context.ATTRIBUTESSee attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+SEE ALSOacct(3HEAD), attributes(5), privileges(5) Writing Device Drivers SunOS 5.10 9 Dec 2002 priv_policy(9F)