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