seteuid(2) System Calls Manual seteuid(2) seteuid, setegid - LIBRARY Standard C library (libc, -lc) #include int seteuid(uid_t euid); int setegid(gid_t egid); glibc (. feature_test_macros(7)): seteuid(), setegid(): _POSIX_C_SOURCE >= 200112L || /* glibc <= 2.19: */ _BSD_SOURCE seteuid() . , . setegid() <<>> , <<>>. On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error. : , seteuid() UID 0; -- seteuid(). EINVAL . EPERM seteuid(): ( CAP_SETUID ) euid , . setegid(): ( CAP_SETGID ) egid , . () () Linux 1.1.37 (1.1.38). _POSIX_SAVED_IDS. glibc 2.0 seteuid(euid) setreuid(-1, euid), . glibc 2.1 setresuid(-1, euid, -1) . setegid(), , setregid(-1, egid) setresgid(-1, egid, -1) glibc 2.2 2.3 ( ). POSIX.1, seteuid() (setegid()) euid (egid) (), . C On Linux, seteuid() and setegid() are implemented as library functions that call, respectively, setresuid(2) and setresgid(2). POSIX.1-2008. POSIX.1-2001, 4.3BSD. . geteuid(2), setresuid(2), setreuid(2), setuid(2), capabilities(7), credentials(7), user_namespaces(7) Alexander Golubev , Azamat Hackimov , Hotellook, Nikita , Spiros Georgaras , Vladislav , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 11 2024 . seteuid(2)