MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


System Calls                                          getppriv(2)



NAME
     getppriv, setppriv - get or set a privilege set

SYNOPSIS
     #include 

     int getppriv(privptypet which, privsett *set);


     int setppriv(privopt op, privptypet which, privsett *set);


DESCRIPTION
     The getppriv() function returns the  process  privilege  set
     specified  by which in the set pointed to by set. The memory
     for set is allocated with  privallocset()  and  freed  with
     privfreeset().   Both   functions  are  documented  on  the
     privaddset(3C) manual page.


     The  setppriv()  function  sets  or  changes   the   process
     privilege  set.  The op argument specifies the operation and
     can be one of PRIVOF, PRIVON or PRIVSET. The which argu-
     ment  specifies the name of the privilege set. The set argu-
     ment specifies the set.


     If op is PRIVOF, the privileges in set  are  removed  from
     the  process  privilege set specified by which. There are no
     restrictions on removing privileges from process  privileges
     sets, but the following apply:

         o    Privileges removed from PRIVPERMITED are silently
              removed from PRIVEFECTIVE.

         o    If privileges are removed from PRIVLIMIT, they are
              not  removed  from  the  other  sets  until  one of
              exec(2) functions has successfully completed.


     If op is PRIVON, the privileges in set  are  added  to  the
     process  privilege  set  specified  by which.  The following
     operations are permitted:

         o    Privileges  in  PRIVPERMITED  can  be  added   to
              PRIVEFECTIVE without restriction.

         o    Privileges  in  PRIVPERMITED  can  be  added   to
              PRIVINHERITABLE without restriction.

         o    All operations that attempt to add privileges  that
              are already present are permitted.



SunOS 5.11          Last change: 10 Sep 2004                    1






System Calls                                          getppriv(2)



     If op is PRIVSET, the privileges in set replace  completely
     the  process  privilege  set specified by which. PRIVSET is
     implemented in terms of PRIVOF and PRIVON. The same  res-
     trictions apply.

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

ERORS
     The getppriv() and setppriv() functions will fail if:

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


     EFAULT    The set argument points to an illegal address.



     The setppriv() function will fail if:

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


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



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


SEE ALSO
     privaddset(3C), attributes(5), privileges(5)











SunOS 5.11          Last change: 10 Sep 2004                    2



OpenSolaris man pages main menu

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