---
name: "security_load_booleans"
section: "3"
platform: "linux"
package: "libselinux1-dev"
version: "3.8.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/security_load_booleans"
---

# security\_load\_booleans(3)

routines for manipulating SELinux boolean values

## 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

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

## 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

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

## AUTHOR

This manual page was written by Dan Walsh \<dwalsh@redhat.com\>.

## SEE ALSO

[**selinux**(8)](/selinux/8.md), [**getsebool**(8)](/getsebool/8.md), [**booleans**(8)](/booleans/8.md), [**togglesebool**(8)](/togglesebool/8.md)
