SECURELEVEL_GT(9)
π SECURELEVEL_GT π
okay bestie so this is a section 9 manpage from the Kernel Developer's Manual, and we're talking about securelevel_gt, securelevel_ge β the girlies that test the active securelevel. π
β¨ NAME β¨
securelevel_gt, securelevel_ge β test active securelevel π₯
π¦ SYNOPSIS π¦
#include <sys/types.h>
#include <sys/proc.h>
int
securelevel_gt(struct ucred *cr, int level);
int
securelevel_ge(struct ucred *cr, int level);
πΈ DESCRIPTION πΈ
So basically these functions test the active security level against the level you hand them. Iconic behaviour, honestly.
Here's the lil plot twist: if the calling credential cr was imprisoned by the jail(2) system call, and it has a different security level set than the host environment, then the security level with the highest value is the one that gets used. Not the lowest. Not the average. The highest. periodt. π
Now the two functions, one at a time:
securelevel_gt()β evaluates whether or not the active security level is greater than the suppliedlevel. strictly greater, no equals allowed, we're picky πsecurelevel_ge()β evaluates whether or not the active security level is greater than or equal to the suppliedlevel. this one's chill, equality counts π«Ά
π RETURN VALUES π
These functions return EPERM if the condition evaluated to true, and 0 otherwise.
no cap, that's a little unhinged of them β returning an error code for "yes" β but that's just the vibe here. π
π SEE ALSO π
and that's the whole page bestie, go forth and vibe check those securelevels π
this was Debian's June 2, 2007 edition of SECURELEVEL_GT(9) from the Kernel Developer's Manual β mwah, iconic, no notes πβ¨
π¦ 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) 2000 Christian S.J. Peron <maneo@bsdpro.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms