1 | .\" Copyright (c) 1980 Regents of the University of California.
|
---|
2 | .\" All rights reserved. The Berkeley software License Agreement
|
---|
3 | .\" specifies the terms and conditions for redistribution.
|
---|
4 | .\"
|
---|
5 | .\" @(#)setreuid.2 6.1 (Berkeley) 5/9/85
|
---|
6 | .\"
|
---|
7 | .TH SETUID 2 "May 9, 1985"
|
---|
8 | .UC 4
|
---|
9 | .SH NAME
|
---|
10 | setuid, seteuid, setgid, setegid \- set (effective) user or group ID's
|
---|
11 | .SH SYNOPSIS
|
---|
12 | .nf
|
---|
13 | .ft B
|
---|
14 | #include <sys/types.h>
|
---|
15 |
|
---|
16 | int setuid(uid_t \fIuid\fP)
|
---|
17 | int seteuid(uid_t \fIeuid\fP)
|
---|
18 | int setgid(gid_t \fIgid\fP)
|
---|
19 | int setegid(gid_t \fIegid\fP)
|
---|
20 | .ft R
|
---|
21 | .fi
|
---|
22 | .SH DESCRIPTION
|
---|
23 | .B Setuid
|
---|
24 | sets the real and effective user ID's of the
|
---|
25 | current process to
|
---|
26 | .IR uid .
|
---|
27 | Unprivileged users may only change both user ID's
|
---|
28 | to the real user ID; only the super-user may
|
---|
29 | make other changes.
|
---|
30 | .B Setgid
|
---|
31 | does the same for the real and effective group ID's.
|
---|
32 | .PP
|
---|
33 | Minix-vmd
|
---|
34 | allows an unprivileged user to change ID's to the original real or effective
|
---|
35 | ID as they were at the time the process was executed.
|
---|
36 | .B Setgid
|
---|
37 | may also set the group ID's to any of the additional group ID's.
|
---|
38 | If one of the
|
---|
39 | remembered user ID's was 0 then any user or group ID may be chosen.
|
---|
40 | .SH "RETURN VALUE
|
---|
41 | Upon successful completion, a value of 0 is returned. Otherwise,
|
---|
42 | a value of \-1 is returned and \fBerrno\fP is set to indicate the error.
|
---|
43 | .SH "ERRORS
|
---|
44 | .TP 15
|
---|
45 | [EPERM]
|
---|
46 | The current process is not the super-user and a change
|
---|
47 | other than one of the allowed changes was attempted.
|
---|
48 | .SH "SEE ALSO"
|
---|
49 | .BR getuid (2),
|
---|
50 | .BR geteuid (2),
|
---|
51 | .BR getgid (2).
|
---|
52 | .BR getegid (2).
|
---|