libsepol: Add ability to convert binary policy to policy.conf file

It would sometimes be helpful for debugging or verification purposes
to be able to convert a binary policy to a human-readable form.

Create new function, sepol_kernel_policydb_to_conf(), that takes a
policydb created from a binary policy and writes a policy.conf file
to the provided FILE pointer.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
This commit is contained in:
James Carter 2017-03-21 15:59:35 -04:00
parent 70a480bfcd
commit 0a08fd1e69
3 changed files with 3102 additions and 0 deletions

View File

@ -0,0 +1,5 @@
#include <stdlib.h>
#include <sepol/policydb/policydb.h>
int sepol_kernel_policydb_to_conf(FILE *fp, struct policydb *pdb);

File diff suppressed because it is too large Load Diff

View File

@ -50,4 +50,5 @@ LIBSEPOL_1.1 {
sepol_module_package_to_cil;
sepol_module_policydb_to_cil;
sepol_kernel_policydb_to_cil;
sepol_kernel_policydb_to_conf;
} LIBSEPOL_1.0;