mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:17:36 +00:00
Add man pages for seteuid() and friends.
Also add an overview page that explains the general concepts.
This commit is contained in:
parent
9b4e6f6a23
commit
1f323076f0
13 changed files with 273 additions and 0 deletions
36
Base/usr/share/man/man2/setuid.md
Normal file
36
Base/usr/share/man/man2/setuid.md
Normal file
|
@ -0,0 +1,36 @@
|
|||
## Name
|
||||
|
||||
setuid, setgid - set user / group ID
|
||||
|
||||
## Synopsis
|
||||
|
||||
```**c++
|
||||
#include <unistd.h>
|
||||
|
||||
int setuid(uid_t);
|
||||
int setgid(gid_t);
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
Sets all of real, effective, and saved user or group ID to the given ID.
|
||||
|
||||
For non-superusers, the given ID has to be equal to the current real or effective ID for the call to succeed.
|
||||
|
||||
## Return value
|
||||
|
||||
If the call was set successful, returns 0.
|
||||
Else, returns -1 and sets `errno` to describe the error.
|
||||
|
||||
## Errors
|
||||
|
||||
* `EPERM`: The new ID is not equal to the real ID or effective ID, and the user is not superuser.
|
||||
|
||||
## See also
|
||||
|
||||
* [`setuid_overview`(7)](../man7/setuid_overview.md)
|
||||
* [`geteuid`(2) / `getegid`(2)](geteuid.md)
|
||||
* [`getuid`(2) / `getgid`(2)](getuid.md)
|
||||
* [`getresuid`(2) / `getresgid`(2)](getresuid.md)
|
||||
* [`seteuid`(2) / `setegid`(2)](seteuid.md)
|
||||
* [`setresuid`(2) / `setresgid`(2)](setresuid.md)
|
Loading…
Add table
Add a link
Reference in a new issue