table of contents
other versions
- wheezy 3.44-1
- jessie 3.74-1
- jessie-backports 4.10-2~bpo8+1
- testing 4.10-2
- unstable 4.10-2
other sections
SETREUID(2) | Linux Programmer's Manual | SETREUID(2) |
NAME¶
setreuid, setregid - set real and/or effective user or group IDSYNOPSIS¶
#include <sys/types.h>Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
_BSD_SOURCE ||
_XOPEN_SOURCE >= 500 ||
_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
DESCRIPTION¶
setreuid() sets real and effective user IDs of the calling process.RETURN VALUE¶
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.ERRORS¶
- EPERM
- The calling process is not privileged (Linux: does not have the CAP_SETUID capability in the case of setreuid(), or the CAP_SETGID capability in the case of setregid()) and a change 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 set-user-ID (saved set-group-ID) was specified.
CONFORMING TO¶
POSIX.1-2001, 4.3BSD (the setreuid() and setregid() function calls first appeared in 4.2BSD).NOTES¶
Setting the effective user (group) ID to the saved set-user-ID (saved set-group-ID) is possible since Linux 1.1.37 (1.1.38).SEE ALSO¶
getgid(2), getuid(2), seteuid(2), setgid(2), setresuid(2), setuid(2), capabilities(7)COLOPHON¶
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.2010-11-22 | Linux |