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
enforceto 1 if SELinux should be run in enforcing mode π - sets the value of
enforceto 0 if SELinux should be run in permissive mode π - sets the value of
enforceto -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
- alpine 3.24: libselinux-doc 3.10-r1 Β· Public-Domain
- centos-stream 10: libselinux-devel 3.11-3.el10 Β· LicenseRef-Fedora-Public-Domain
- centos-stream 9: libselinux-devel 3.6-5.el9 Β· Public Domain
- centos-stream 9: libselinux-devel 3.6-5.el9 Β· Public Domain
- debian bookworm: libselinux1-dev 3.4-1+b6
- 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 jammy: libselinux1-dev 3.3-1build2
- ubuntu noble: libselinux1-dev 3.5-2ubuntu2 Β· LicenseRef-public-domain
- ubuntu noble: libselinux1-dev 3.5-2ubuntu2.1 Β· LicenseRef-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