security\_get\_boolean\_names(3) SELinux API Documentation security\_get\_boolean\_names(3)

# [NAME](#NAME)

security\_set\_boolean, security\_commit\_booleans, security\_get\_boolean\_names, security\_get\_boolean\_active, security\_get\_boolean\_pending - routines for manipulating SELinux boolean values

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;selinux/selinux.h&gt;**

**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);**

# [DESCRIPTION](#DESCRIPTION)

The SELinux policy can include conditional rules that are enabled or disabled based on the current values of a set of policy booleans. These policy booleans allow runtime modification of the security policy without having to load a new policy.

The SELinux API allows for a transaction based update. So you can set several boolean values and then commit them all at once.

**security\_get\_boolean\_names**() provides a list of boolean names, currently supported by the loaded policy.

**security\_get\_boolean\_pending**() returns the pending value for boolean or -1 on failure.

**security\_get\_boolean\_active**() returns the active value for boolean or -1 on failure.

**security\_set\_boolean**() sets the pending value for boolean

**security\_set\_boolean\_list**() saves a list of booleans in a single transaction. Note that the **int permanent** flag is deprecated and should be set to zero.

**security\_commit\_booleans**() commits all pending values for the booleans.

# [RETURN VALUE](#RETURN_VALUE)

Where not otherwise stated, functions described in this manual page return zero on success or -1 on error.

# [AUTHOR](#AUTHOR)

This manual page was written by Dan Walsh &lt;dwalsh@redhat.com&gt;.

# [SEE ALSO](#SEE_ALSO)

[**selinux**(8)](/man/os/libselinux/selinux.8), [**getsebool**(8)](/man/os/libselinux/getsebool.8), [**booleans**(8)](/man/os/libselinux/booleans.8), [**togglesebool**(8)](/man/os/libselinux/togglesebool.8)

15 November 2004 dwalsh@redhat.com

---

Document: security_get_boolean_names(3) from libselinux 3.11-r2 (Chainguard OS)
Source: https://github.com/SELinuxProject/selinux.git
