Syntax | #include <unistd.h> int setreuid(uid_t ruid, uid_t euid); | |
Description |
If the effective user ID of the calling process matches the superuser, the real user ID and the effective user ID can be set to any permissible value. If the effective user ID of the calling process does not match that of the superuser, either the real user ID can be set to the effective user ID, or the effective user ID can be set to either the saved “set-user-ID“ from execv or the real user ID. If a process for setting the user ID (UID) sets its effective user ID to its real user ID, it can still reset its effective user ID to the saved “set-user-ID“. Both when the real user ID is changed (i.e. if ruid is not -1) and when the effective user ID is changed to a value that does not match the real user ID, the saved “set-user-ID“ is set to the same as the new effective user ID. | |
Return val. | 0 -1 | if executed successfully if an error occurs. |
Errors |
| |
|
| The value of the ruid or euid argument is invalid or outside the permitted value range. |
|
| The effective user ID of the calling process does not match that of the superuser, and a different modification was specified, i.e. something other than changing the real user ID to the effective user ID or the effective user ID into the real or saved “set-user-ID“. |
See also |
|