Commit | Line | Data |
---|---|---|
1d70186a KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
80d6e3f5 | 5 | .\" @(#)setuid.2 6.3 (Berkeley) %G% |
1d70186a | 6 | .\" |
2b413789 | 7 | .TH SETUID 3 "" |
1d70186a KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | setuid, seteuid, setruid, setgid, setegid, setrgid \- set user and group ID | |
11 | .SH SYNOPSIS | |
12 | .nf | |
f8eedcbc KM |
13 | .ft B |
14 | #include <sys/types.h> | |
1d70186a | 15 | .PP |
f8eedcbc KM |
16 | .ft B |
17 | .nf | |
18 | setuid(uid) | |
19 | seteuid(euid) | |
20 | setruid(ruid) | |
21 | uid_t uid, euid, ruid; | |
22 | .PP | |
23 | .ft B | |
24 | .nf | |
25 | setgid(gid) | |
26 | setegid(egid) | |
27 | setrgid(rgid) | |
28 | gid_t gid, egid, rgid; | |
1d70186a KM |
29 | .fi |
30 | .SH DESCRIPTION | |
31 | .I Setuid | |
32 | .RI ( setgid ) | |
33 | sets both the real and effective | |
34 | user ID (group ID) of the current process to | |
35 | as specified. | |
36 | .PP | |
37 | .I Seteuid | |
38 | .RI ( setegid ) | |
39 | sets the effective user ID (group ID) of the | |
40 | current process. | |
41 | .PP | |
42 | .I Setruid | |
80d6e3f5 | 43 | .RI ( setrgid ) |
1d70186a KM |
44 | sets the real user ID (group ID) of the |
45 | current process. | |
46 | .PP | |
47 | These calls are only permitted to the super-user | |
48 | or if the argument is the real or effective ID. | |
49 | .SH "SEE ALSO" | |
50 | setreuid(2), setregid(2), getuid(2), getgid(2) | |
51 | .SH DIAGNOSTICS | |
52 | Zero is returned if the user (group) ID is set; | |
53 | \-1 is returned otherwise. |