security_check_context(3)

✨ NAME ✨

okay so bestie, welcome to the security_check_context page πŸ’– β€” that's the security_check_context(3) manual, straight outta the SELinux API documentation ✨. This one is literally all about checking the validity of a SELinux context. No cap.


🌸 SYNOPSIS 🌸

first things first, you gotta bring in the header:

#include <selinux/selinux.h>

then these two icons are at your service:

int security_check_context(const char *con);

int security_check_context_raw(const char *con);

πŸ’– DESCRIPTION πŸ’–

so security_check_context() does a little vibe check on your context ✨. It returns 0 if SELinux is running and the context is valid β€” slay, we love a valid context πŸ‘‘. Otherwise? It returns -1 😭. That's it. That's the whole tea.

and then there's security_check_context_raw() β€” she behaves identically to security_check_context(), but she does not perform context translation. So if you need the raw, untranslated truth, she's your girl πŸ’….


πŸ¦‹ SEE ALSO πŸ¦‹

  • selinux(8) β€” go read that too, bestie 🫢

this page was brought to you by russell@coker.com.au, dated 1 January 2004, and it's part of the security_check_context(3) manual. mwah πŸ’‹

πŸ“¦ where this page comes from