Query: setreuid
OS: opensolaris
Section: 2
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
setreuid(2) System Calls setreuid(2)NAMEsetreuid - set real and effective user IDsSYNOPSIS#include <unistd.h> int setreuid(uid_t ruid, uid_t euid);DESCRIPTIONThe 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() (seeexec(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 VALUESUpon 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.ERRORSThe 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 effective 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(5) for additional restrictions which apply when changing to UID 0.USAGEIf 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.ATTRIBUTESSee attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+SEE ALSOexec(2), getuid(2), setregid(2), setuid(2), attributes(5), privileges(5), standards(5) SunOS 5.11 22 Mar 2004 setreuid(2)
Related Man Pages |
---|
setregid(2) - opensolaris |
setegid(2) - sunos |
seteuid(2) - opensolaris |
setreuid(2) - netbsd |
setgid(2) - sunos |
Similar Topics in the Unix Linux Community |
---|
userid |
Bayesian IDS |
Change of user name |
Infraction for hudson03051nh: Threadjacking |
Changing the user id or euid of the shell itself |