selinux_c...ty_context(3)

πŸ“¦
version 3.11 Β· 2 versions
, in alpine 3.24, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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. 0 or < 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 πŸ™ˆπŸ’œ