selinux_getenforcemode(3)

okay bestie, welcome to selinux_getenforcemode(3) from the SELinux API documentation 🫢 we're gonna check how the system was set up to run SELinux, and honestly it's giving config-file detective energy πŸ”βœ¨

✨ NAME ✨

selinux_getenforcemode β€” get the enforcing state of SELinux πŸ’…

🌸 SYNOPSIS 🌸

#include <selinux/selinux.h>

int selinux_getenforcemode(int *enforce);

πŸ¦‹ DESCRIPTION πŸ¦‹

so selinux_getenforcemode() reads the contents of /etc/selinux/config to figure out how the system was set up to run SELinux. no cap. then it sets the value of enforce based on what it finds:

  • sets the value of enforce to 1 if SELinux should be run in enforcing mode πŸ‘‘
  • sets the value of enforce to 0 if SELinux should be run in permissive mode πŸ™ˆ
  • sets the value of enforce to -1 if SELinux should be disabled πŸ’€

πŸŽ€ RETURN VALUE πŸŽ€

on success, zero is returned. on failure, -1 is returned. periodt πŸ’…

🌈 SEE ALSO 🌈

selinux(8) β€” go read that too, bestie πŸ“–


this page was brought to you by dwalsh@redhat.com, dated 25 May 2004, and it's the selinux_getenforcemode(3) manual page. mwah πŸ’‹

πŸ“¦ where this page comes from