Unix and Linux Discussions Tagged with user |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
29,339 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
9,077 |
What is on Your Mind? |
|
|
|
3 |
9,198 |
UNIX for Beginners Questions & Answers |
|
|
|
0 |
24,630 |
What is on Your Mind? |
|
|
|
5 |
8,753 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
14,463 |
UNIX for Advanced & Expert Users |
|
|
|
5 |
6,199 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
34,576 |
UNIX for Advanced & Expert Users |
|
|
|
4 |
18,576 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
13,857 |
Forum Support Area for Unregistered Users & Account Problems |
|
|
|
4 |
6,086 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
15,026 |
Shell Programming and Scripting |
|
|
|
5 |
5,477 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
16,416 |
AIX |
|
|
|
2 |
3,982 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
5,474 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
4,956 |
Shell Programming and Scripting |
|
|
|
1 |
22,420 |
UNIX for Advanced & Expert Users |
|
|
|
10 |
118,580 |
Shell Programming and Scripting |
|
|
|
3 |
12,813 |
Linux |
|
|
|
8 |
4,393 |
Shell Programming and Scripting |
|
|
|
3 |
5,958 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
9,049 |
Solaris |
|
|
|
0 |
6,032 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
2,954 |
UNIX for Beginners Questions & Answers |
|
|
|
12 |
10,073 |
UNIX for Beginners Questions & Answers |
|
|
|
0 |
5,198 |
Programming |
|
|
|
9 |
12,564 |
Ubuntu |
|
|
|
10 |
7,671 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
33,300 |
Red Hat |
|
|
|
4 |
3,531 |
Shell Programming and Scripting |
|
|
|
0 |
3,762 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
4,387 |
Shell Programming and Scripting |
|
|
|
3 |
3,381 |
Shell Programming and Scripting |
|
|
|
5 |
3,040 |
Shell Programming and Scripting |
|
|
|
1 |
4,798 |
Solaris |
|
|
|
3 |
7,933 |
UNIX for Advanced & Expert Users |
|
|
|
13 |
3,723 |
Shell Programming and Scripting |
|
|
|
8 |
4,381 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
1,769 |
UNIX for Beginners Questions & Answers |
SETREUID(2) Linux Programmer's Manual SETREUID(2)
NAME
setreuid, setregid - set real and/or effective user or group ID
SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
int setreuid(uid_t ruid, uid_t euid);
int setregid(gid_t rgid, gid_t egid);
DESCRIPTION
setreuid sets real and effective user IDs of the current process. Unprivileged users may only set the real user ID to the real user ID or
the effective user ID, and may only set the effective user ID to the real user ID, the effective user ID or the saved user ID.
Supplying a value of -1 for either the real or effective user ID forces the system to leave that ID unchanged.
If the real user ID is set or the effective user ID is set to a value not equal to the previous real user ID, the saved user ID will be set
to the new effective user ID.
Completely analogously, setregid sets real and effective group ID's of the current process, and all of the above holds with "group" instead
of "user".
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EPERM The current process is not the super-user and changes other than (i) swapping the effective user (group) ID with the real user
(group) ID, or (ii) setting one to the value of the other or (iii) setting the effective user (group) ID to the value of the saved
user (group) ID was specified.
NOTES
Setting the effective user (group) ID to the saved user ID is possible since Linux 1.1.37 (1.1.38).
CONFORMING TO
BSD 4.3 (the setreuid and setregid function calls first appeared in 4.2BSD).
SEE ALSO
getuid(2), getgid(2), setuid(2), setgid(2), seteuid(2), setresuid(2)
Linux 1.1.38 1994-08-02 SETREUID(2)