ISSETUGID(2)
β¨ ISSETUGID(2) β¨
okay bestie, this is the manual page for issetugid from the System Calls Manual (that's section 2, the syscall girlies π
). Buckle up, it's short but it's important.
πΈ NAME πΈ
issetugid β is current process tainted by uid or gid changes π
π LIBRARY π
Standard C Library (libc, -lc)
π¦ SYNOPSIS π¦
#include <unistd.h>
int
issetugid(void);
π DESCRIPTION π
so the issetugid() system call returns 1 if the process environment or memory address space is considered βtaintedβ, and returns 0 otherwise. that's it. that's the whole vibe check. β¨
a process is tainted if it was created as a result of an execve(2) system call which had either of the setuid or setgid bits set (and extra privileges were given as a result), or if it has changed any of its real, effective or saved user or group ID's since it began execution. no cap.
this system call exists so that library routines (eg: libc, libtermcap) can reliably determine if it is safe to use information that was obtained from the user β in particular the results from getenv(3) should be viewed with suspicion if it is used to control operation. π¨ like, do NOT trust that env var bestie, it might be lying to you.
a βtaintedβ status is inherited by child processes as a result of the fork(2) system call (or other library code that calls fork, such as popen(3)). the taint is giving generational trauma fr fr π
it is assumed that a program that clears all privileges as it prepares to execute another will also reset the environment, hence the βtaintedβ status will not be passed on. this is important for programs such as su(1) which begin setuid but need to be able to create an untainted process. main character energy honestly π
π ERRORS π
the issetugid() system call is always successful, and no return value is reserved to indicate an error. it simply cannot flop. πβ¨
π SEE ALSO π
the whole setuid setgid friend group, obsessed π«Ά
π HISTORY π
the issetugid() system call first appeared in OpenBSD 2.0 and was also implemented in FreeBSD 3.0. iconic behavior, truly ahead of its time π
and that's the whole page bestie!! this one came from the Debian crew, dated August 25, 1996 β so like, a vintage queen π stay untainted, love u, bye!! ππ¦πΈ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1980, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms