Unix and Linux Discussions Tagged with user |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
2 |
2,109 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
26,343 |
AIX |
|
|
|
3 |
28,278 |
Filesystems, Disks and Memory |
|
|
|
0 |
4,477 |
Shell Programming and Scripting |
|
|
|
1 |
11,251 |
UNIX for Advanced & Expert Users |
|
|
|
9 |
4,892 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
1,057 |
Complex Event Processing RSS News |
|
|
|
1 |
7,167 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
1,351 |
UNIX and Linux RSS News |
|
|
|
0 |
984 |
Software Releases - RSS News |
|
|
|
0 |
800 |
Software Releases - RSS News |
|
|
|
8 |
14,100 |
Cybersecurity |
|
|
|
1 |
4,003 |
AIX |
|
|
|
2 |
2,022 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
2,628 |
Shell Programming and Scripting |
|
|
|
2 |
18,088 |
UNIX and Linux Applications |
|
|
|
4 |
1,875 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
898 |
UNIX and Linux RSS News |
|
|
|
1 |
1,725 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,709 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
857 |
Software Releases - RSS News |
|
|
|
5 |
3,646 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
565 |
Software Releases - RSS News |
|
|
|
2 |
9,053 |
UNIX for Advanced & Expert Users |
|
|
|
4 |
26,924 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
601 |
Software Releases - RSS News |
|
|
|
5 |
13,833 |
Solaris |
|
|
|
0 |
575 |
Software Releases - RSS News |
|
|
|
1 |
1,756 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
753 |
Security Advisories (RSS) |
|
|
|
3 |
4,380 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
7,907 |
Linux |
|
|
|
2 |
3,153 |
Post Here to Contact Site Administrators and Moderators |
|
|
|
0 |
919 |
Software Releases - RSS News |
|
|
|
0 |
858 |
Software Releases - RSS News |
|
|
|
1 |
3,421 |
Forum Support Area for Unregistered Users & Account Problems |
|
|
|
1 |
2,838 |
HP-UX |
|
|
|
5 |
13,133 |
Solaris |
|
|
|
5 |
4,047 |
Solaris |
|
|
|
2 |
16,794 |
Solaris |
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)