setreuid(2) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

setreuid(2)

setreuid(2)                      System Calls                      setreuid(2)



NAME
       setreuid - set real and effective user IDs

SYNOPSIS
       #include <unistd.h>

       int setreuid(uid_t ruid, uid_t euid);

DESCRIPTION
       The  setreuid() function is used to set the real and effective user IDs
       of the calling process. If ruid is −1, the real user ID is not changed;
       if  euid  is  −1,  the  effective  user ID is not changed. The real and
       effective user IDs may be set to different values in the same call.


       If the {PRIV_PROC_SETID} privilege is asserted in the effective set  of
       the  calling process, the real user ID and the effective user ID can be
       set to any legal value.


       If the {PRIV_PROC_SETID} privilege is not asserted in the effective set
       of  the  calling  process,  either  the  real user ID can be set to the
       effective user ID, or the effective user ID can either be  set  to  the
       saved set-user ID from execve() (see exec(2)) or the real user ID.


       In  either case, if the real user ID is being changed (that is, if ruid
       is not −1), or the effective user ID is being changed to  a  value  not
       equal  to  the  real user ID, the saved set-user ID is set equal to the
       new effective user ID.


       All privileges are required to change to uid 0.

RETURN VALUES
       Upon successful completion, 0 is returned. Otherwise, −1  is  returned,
       errno is set to indicate the error, and neither of the user IDs will be
       changed.

ERRORS
       The setreuid() function will fail if:

       EINVAL    The value of ruid or euid is less  than  0  or  greater  than
                 UID_MAX (defined in <limits.h>).


       EPERM     The {PRIV_PROC_SETID} privilege is not asserted in the effec‐
                 tive set of the calling processes and a change was  specified
                 other  than  changing  the real user ID to the effective user
                 ID, or changing the effective user ID to the real user ID  or
                 the  saved  set-user  ID.  See  privileges(7)  for additional
                 restrictions which apply when changing to UID 0.


USAGE
       If a set-user-ID process sets its effective user ID to  its  real  user
       ID,  it  can still set its effective user ID back to the saved set-user
       ID.

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


       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE  VALUE  _  Interface  StabilityCommitted  _  StandardSee  stan‐
       dards(7).


SEE ALSO
       setregid(2),  exec(2),  getuid(2),  setuid(2),  attributes(7),   privi‐
       leges(7), standards(7)



Oracle Solaris 11.4               14 May 2018                      setreuid(2)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3