| 1 |
.TH "sepol_genbools" "3" "11 August 2004" "[email protected]" "SE Linux binary policy API documentation" |
| 2 |
.SH "NAME" |
| 3 |
sepol_genbools \- Rewrite a binary policy with different boolean settings |
| 4 |
.SH "SYNOPSIS" |
| 5 |
.B #include <sepol/sepol.h> |
| 6 |
.sp |
| 7 |
.BI "int sepol_genbools(void *" data ", size_t "len ", const char *" boolpath ); |
| 8 |
.br |
| 9 |
.BI "int sepol_genbools_array(void *" data ", size_t " len ", char **" names ", int *" values ", int " nel ); |
| 10 |
|
| 11 |
.SH "DESCRIPTION" |
| 12 |
.B sepol_genbools |
| 13 |
rewrites a binary policy stored in the memory region described by |
| 14 |
(data, len) to use the boolean settings specified in the file named by |
| 15 |
boolpath. The boolean settings are specified by name=value lines |
| 16 |
where value may be 0 or false to disable or 1 or true to enable. The |
| 17 |
binary policy is rewritten in place in memory. |
| 18 |
|
| 19 |
.B sepol_genbools_array |
| 20 |
does likewise, but obtains the boolean settings from the parallel arrays |
| 21 |
(names, values) with nel elements each. |
| 22 |
|
| 23 |
.SH "RETURN VALUE" |
| 24 |
Returns 0 on success or \-1 otherwise, with errno set appropriately. |
| 25 |
An errno of ENOENT indicates that the boolean file did not exist. |
| 26 |
An errno of EINVAL indicates that one or more booleans listed in the |
| 27 |
boolean file was undefined in the policy or had an invalid value specified; |
| 28 |
in this case, the binary policy is still rewritten but any invalid |
| 29 |
boolean settings are ignored. |
| 30 |
|