NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | COLOPHON

sepol_genbools(3) SE Linux binary policy API documentation sepol_genbools(3)

NAME         top

       sepol_genbools  - Rewrite a binary policy with different boolean set‐
       tings

SYNOPSIS         top

       #include <sepol/sepol.h>
       int sepol_genbools(void *data, size_t len, const char *boolpath);
       int sepol_genbools_array(void *data, size_t len, char **names, int
       *values, int nel);

DESCRIPTION         top

       sepol_genbools rewrites a binary policy stored in the memory region
       described by (data, len) to use the boolean settings specified in the
       file named by boolpath.  The boolean settings are specified by
       name=value lines where value may be 0 or false to disable or 1 or
       true to enable.  The binary policy is rewritten in place in memory.
       sepol_genbools_array does likewise, but obtains the boolean settings
       from the parallel arrays (names, values) with nel elements each.

RETURN VALUE         top

       Returns 0 on success or -1 otherwise, with errno set appropriately.
       An errno of ENOENT indicates that the boolean file did not exist.  An
       errno of EINVAL indicates that one or more booleans listed in the
       boolean file was undefined in the policy or had an invalid value
       specified; in this case, the binary policy is still rewritten but any
       invalid boolean settings are ignored.

COLOPHON         top

       This page is part of the selinux (Security-Enhanced Linux user-space
       libraries and tools) project.  Information about the project can be
       found at ⟨https://github.com/SELinuxProject/selinux/wiki⟩.  If you
       have a bug report for this manual page, see 
       ⟨https://github.com/SELinuxProject/selinux/wiki/Contributing⟩.  This
       page was obtained from the project's upstream Git repository 
       ⟨https://github.com/SELinuxProject/selinux⟩ on 2017-07-05.  If you
       discover any rendering problems in this HTML version of the page, or
       you believe there is a better or more up-to-date source for the page,
       or you have corrections or improvements to the information in this
       COLOPHON (which is not part of the original manual page), send a mail
       to man-pages@man7.org
sds@epoch.ncsc.mil             11 August 2004              sepol_genbools(3)