Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

security_load_policy(3) [centos man page]

security_load_policy(3) 				     SELinux API documentation					   security_load_policy(3)

security_load_policy - load a new SELinux policy SYNOPSIS
#include <selinux/selinux.h> int security_load_policy(void *data, size_t len); int selinux_mkload_policy(int preservebools); int selinux_init_load_policy(int *enforce); DESCRIPTION
security_load_policy() loads a new policy, returns 0 for success and -1 for error. selinux_mkload_policy() makes a policy image and loads it. This function provides a higher level interface for loading policy than security_load_policy(), internally determining the right policy version, locating and opening the policy file, mapping it into memory, manipulating it as needed for current boolean settings and/or local definitions, and then calling security_load_policy to load it. pre- servebools is a boolean flag indicating whether current policy boolean values should be preserved into the new policy (if 1) or reset to the saved policy settings (if 0). The former case is the default for policy reloads, while the latter case is an option for policy reloads but is primarily used for the initial policy load. selinux_init_load_policy() performs the initial policy load. This function determines the desired enforcing mode, sets the enforce argument accordingly for the caller to use, sets the SELinux kernel enforcing status to match it, and loads the policy. It also internally handles the initial selinuxfs mount required to perform these actions. It should also be noted that after the initial policy load, the SELinux kernel code cannot anymore be disabled and the selinuxfs cannot be unmounted using a call to security_disable(3). Therefore, after the initial policy load, the only operational changes are those permitted by security_setenforce(3) (i.e. eventually setting the framework in permissive mode rather than in enforcing one). RETURN VALUE
Returns zero on success or -1 on error. AUTHOR
This manual page has been written by Guido Trentalancia <> SEE ALSO
selinux(8), security_disable(3), setenforce(8) 3 November 2009 security_load_policy(3)

Check Out this Related Man Page

security_get_boolean_names(3)				     SELinux API Documentation				     security_get_boolean_names(3)

security_load_booleans, security_set_boolean, security_commit_booleans, security_get_boolean_names, security_get_boolean_active, secu- rity_get_boolean_pending - routines for manipulating SELinux boolean values SYNOPSIS
#include <selinux/selinux.h> int security_load_booleans(char *path); 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_load_booleans loads policy boolean settings. Path may be NULL, in which case the booleans are loaded from the active policy boolean configuration file. 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. 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 <>. SEE ALSO
selinux(8), getsebool(8), booleans(8), togglesebool(8) 15 November 2004 security_get_boolean_names(3)
Man Page