NAME
setresuid — set
real user ID, effective user ID, and saved set-user-ID
SYNOPSIS
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
DESCRIPTION
The setresuid () function shall set the
real user ID, effective user ID, and saved set-user-ID of the calling
process to the values specified by
ruid,
euid, and
suid,
respectively.
If an argument is -1, the corresponding ID shall not be changed.
Only a process with appropriate privileges can set the real user ID, effective user ID, and saved set-user-ID to any valid value.
A non-privileged process can set its real user ID, effective user ID, and saved set-user-ID, each to one of the values that it currently holds in its real user ID, effective user ID, or saved set-user-ID.
The real user ID, effective user ID, and saved set-user-ID can be set to different values in the same call.
RETURN VALUE
Upon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error, and none of the IDs shall be changed.
ERRORS
The setresuid () function shall fail
if:
- [EINVAL]
- The value of the ruid , euid , or suid argument is invalid or out-of-range.
- [EPERM]
- The calling process does not have appropriate privileges and an attempt was made to change the real user ID, effective user ID, or saved set-user-ID to a value that is not currently present in one of those IDs or an attempt was made to change the real user ID to a value not permitted by the implementation.
EXAMPLES
None.
APPLICATION USAGE
None.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
exec(3), getegid(3), geteuid(3), getgid(3), getresgid(3), getresuid(3), getuid(3), setegid(3), seteuid(3), setgid(3), setregid(3), setresgid(3), setreuid(3), setuid(3)
XBD <unistd.h>
CHANGE HISTORY
First released in Issue 8.