priv_set man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]

PRIV_SET(3C)							  PRIV_SET(3C)

NAME
       priv_set, priv_ineffect - change privilege sets and check whether priv‐
       ileges are set

SYNOPSIS
       #include <priv.h>

       int priv_set(priv_op_t op, priv_ptype_t	which...);

       boolean_t priv_ineffect(const char *priv);

DESCRIPTION
       The priv_set() function is a convenient	wrapper	 for  the  setppriv(2)
       function. It takes three or more arguments. The operation argument, op,
       can be one of PRIV_OFF, PRIV_ON or PRIV_SET. The which argument is  the
       name  of	 the  privilege set to change. The third argument is a list of
       zero or more privilege names terminated with a null pointer.  If	 which
       is the special pseudo set PRIV_ALLSETS, the operation should be applied
       to all privilege sets.

       The specified privileges are converted to a binary  privilege  set  and
       setppriv() is called with the same op and which arguments.  When called
       with PRIV_ALLSETS as the value for the which  argument,	setppriv()  is
       called for each set in turn, aborting on the first failed call.

       The  priv_ineffect()  function  is  a conventient wrapper for the getp‐
       priv(2) function. The priv argument specifies the name of the privilege
       for which this function checks its presence in the effective set.

RETURN VALUES
       Upon  successful	 completion,  priv_set()  return  0. Otherwise, -1  is
       returned and errno is set to indicate the error.

       If priv is a valid privilege that is a member  of  the  effective  set,
       priv_ineffect()	returns B_TRUE. Otherwise, it returns B_FALSE and sets
       errno to incicate the error.

ERRORS
       The priv_set() function will fail if:

       EINVAL
		 The value of op or which is out of range.

       ENOMEM
		 Insufficient memory was allocated.

       EPERM
		 The application attempted to add privileges to PRIV_LIMIT  or
		 PRIV_PERMITTED,  or  the  application attempted to add privi‐
		 leges to PRIV_INHERITABLE or PRIV_EFFECTIVE that were not  in
		 PRIV_PERMITTED.

       The priv_ineffect() function will fail if:

       EINVAL
		 The privilege specified by priv is invalid.

       ENOMEM
		 Insufficient memory was allocated.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌────────────────────┬─────────────────┐
       │  ATTRIBUTE TYPE    │ ATTRIBUTE VALUE │
       ├────────────────────┼─────────────────┤
       │Interface Stability │ Evolving	      │
       ├────────────────────┼─────────────────┤
       │MT-Level	    │ MT-Safe	      │
       └────────────────────┴─────────────────┘

SEE ALSO
       setppriv(2), priv_str_to_set(3C), attributes(5), privileges(5)

				 Sep 25, 2003			  PRIV_SET(3C)
[top]

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net