MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Standard C Library Functions                         privset(3C)



NAME
     privset, privineffect - change privilege  sets  and  check
     whether privileges are set

SYNOPSIS
     #include 

     int privset(privopt op, privptypet  which...);


     booleant privineffect(const char *priv);


DESCRIPTION
     The privset() function is  a  convenient  wrapper  for  the
     setppriv(2)  function. It takes three or more arguments. The
     operation argument, op, can be one of PRIVOF,  PRIVON  or
     PRIVSET.  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 PRIVALSETS, 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 PRIVALSETS as the  value  for
     the  which  argument,  setppriv()  is called for each set in
     turn, aborting on the first failed call.


     The privineffect() function is a  conventient  wrapper  for
     the  getppriv(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, privset() 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  effec-
     tive  set,  privineffect()  returns  BTRUE.  Otherwise, it
     returns BFALSE and sets errno to incicate the error.

ERORS
     The privset() function will fail if:

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






SunOS 5.11          Last change: 25 Sep 2003                    1






Standard C Library Functions                         privset(3C)



     ENOMEM    Insufficient memory was allocated.


     EPERM     The application attempted  to  add  privileges  to
               PRIVLIMIT  or  PRIVPERMITED, or the application
               attempted to add privileges to PRIVINHERITABLE or
               PRIVEFECTIVE that were not in PRIVPERMITED.



     The privineffect() function will fail if:

     EINVAL    The privilege specified by priv is invalid.


     ENOMEM    Insufficient memory was allocated.


ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Evolving                    
    
     MT-Level                     MT-Safe                     
    


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



















SunOS 5.11          Last change: 25 Sep 2003                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™