security_g...lean_names(3)
π security_g...lean_names(3) π
ok so bestie, we're in section 3 of the SELinux API Documentation and this page is literally the whole booleans situation. it's giving "runtime policy glow-up without reloading anything" and honestly? iconic. π
β¨ NAME β¨
security_set_boolean, security_commit_booleans, security_get_boolean_names, security_get_boolean_active, security_get_boolean_pending β the routines for manipulating SELinux boolean values π¦
like, all five of them, together, in one little group chat. no cap.
πΈ SYNOPSIS πΈ
#include <selinux/selinux.h>
int security_get_boolean_names(char ***names, int *len);
int security_get_boolean_pending(const char *name);
int security_get_boolean_active(const char *name);
int security_set_boolean(const char *name, int value);
int security_set_boolean_list(size_t boolcnt, SELboolean *boollist, int
permanent);
int security_commit_booleans(void);
yes bestie, security_set_boolean_list is here too, even though it wasn't in the NAME list. she's the β¨surprise guestβ¨ of this function family.
π DESCRIPTION π
okay so, the SELinux policy can have conditional rules in it β rules that get enabled or disabled depending on what the current values of a set of policy booleans are. and the way that these policy booleans work is they let you modify the security policy at runtime without having to load a whole new policy. no reload, no reboot, no drama. π§
the SELinux API gives you a transaction based update, which is so slay of it. so the move is: you set several boolean values, and then you commit them all at once. group project, but everyone actually shows up. π
security_get_boolean_names()β hands you a list of boolean names that are currently supported by the loaded policy. the whole roster. πsecurity_get_boolean_pending()β returns the pending value for the boolean, or-1on failure. πsecurity_get_boolean_active()β returns the active value for the boolean, or-1on failure. π«Άsecurity_set_boolean()β sets the pending value for the boolean. π₯security_set_boolean_list()β saves a list of booleans in a single transaction. but heads up: thatint permanentflag is deprecated and you should set it tozero. not optional, not a vibe, just do it. πsecurity_commit_booleans()β commits all the pending values for the booleans. the final "post it" button. β
ngl, the transaction thing is the whole point: pending values just chill there until you commit. it's giving staged changes, and committing is the push. π
β RETURN VALUE β
where it's not otherwise stated, the functions described on this manual page return zero on success or -1 on error. so 0 = slay, -1 = not slay. simple as that. π
π AUTHOR π
this manual page was written by Dan Walsh <dwalsh@redhat.com>. king behavior fr fr. π
π¦ SEE ALSO π¦
go read those too bestie, they're the extended universe. β¨
and that's the whole page!! π written by dwalsh@redhat.com, dated 15 November 2004, from the SELinux API Documentation β security_g...lean_names(3), out. periodt. π
πΈπ«Ά
π¦ 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 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 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