selinux_c...ty_context(3)
β¨ selinux_c...ty_context β¨
okay bestie, so this is a page from the SELinux API documentation β yes, that SELinux, the security thing your sysadmin keeps yelling about π . It's a section 3 manpage (that's library calls, iykyk), and it's literally one function doing one little vibe check. short page, big energy. let's get into it π«Ά
πΈ NAME πΈ
selinux_check_securetty_context β checks whether a SELinux tty security context is defined as a securetty context π
like. is this tty allowed to be a secure tty or not. that's the whole question. no cap.
π SYNOPSIS π
#include <selinux/selinux.h>
int selinux_check_securetty_context(const char *tty_context);
so you gotta pull in <selinux/selinux.h> first (don't forget, it's giving "I forgot the include" energy otherwise π), and then you call it with a const char * called tty_context, and it hands you back an int.
π DESCRIPTION π
selinux_check_securetty_context() returns 0 if tty_context is a securetty context. that's the slay. that's the yes. β¨
if it's not a securetty context, it returns < 0 β so anything negative, doesn't matter which, it's a no from the function. π
and that's genuinely the whole description. short and iconic. periodt.
not me double-checking there's no third case... bestie there is no third case.0or< 0. that's it. π
π¦ SEE ALSO π¦
selinux(8)β go read the big picture one, it's the main character of this whole saga π
and that's the whole page!! π this little cutie was written by dwalsh@redhat.com and dated 1 January 2007 β so yeah, it's been serving securetty realness since before most of us could read. respect the elders fr fr ππ
π¦ where this page comes from
- alpine 3.24: libselinux-doc 3.10-r1 Β· Public-Domain
- centos-stream 10: libselinux-devel 3.11-3.el10 Β· LicenseRef-Fedora-Public-Domain
- debian trixie: libselinux1-dev 3.8.1-1 Β· LicenseRef-public-domain
- fedora 43: libselinux-devel 3.9-5.fc43 Β· LicenseRef-Fedora-Public-Domain
- fedora 43: libselinux-devel 3.9-5.fc43 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.10-1.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.10-1.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.11-2.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.11-2.fc44 Β· LicenseRef-Fedora-Public-Domain
- nixos 26.05: libselinux 3.10
- nixpkgs unstable: libselinux 3.11
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- ubuntu questing: libselinux1-dev 3.8.1-1build1
- ubuntu resolute: libselinux-dev 3.9-4build1 Β· LicenseRef-public-domain
- ubuntu stonking: libselinux-dev 3.11-2.1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms