libsepol, policycoreutils: Move functions to convert a module package to CIL

Move code to convert a policy module to CIL from the policy package to
CIL conversion tool, pp, in policycoreutils to libsepol. The only changes
to the code are the additions of the prefix "sepol_" to the functions
sepol_module_package_to_cil() and sepol_ppfile_to_module_package(). This
code is being changed from GPL to LGPL with permission from Tresys.

Convert pp to use the renamed functions in libsepol.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
This commit is contained in:
James Carter 2015-04-01 10:03:04 -04:00
parent 1b7f3248ec
commit 758a7fe501
6 changed files with 3886 additions and 3828 deletions

View File

@ -23,6 +23,7 @@ common_src_files := \
src/link.c \
src/mls.c \
src/module.c \
src/module_to_cil.c \
src/node_record.c \
src/nodes.c \
src/polcaps.c \

View File

@ -0,0 +1,6 @@
#include <stdlib.h>
#include <sepol/module.h>
int sepol_module_package_to_cil(FILE *fp, struct sepol_module_package *mod_pkg);
int sepol_ppfile_to_module_package(FILE *fp, struct sepol_module_package **mod_pkg);

View File

@ -45,5 +45,7 @@ LIBSEPOL_1.1 {
cil_set_target_platform;
cil_set_policy_version;
cil_set_mls;
sepol_ppfile_to_module_package;
sepol_module_package_to_cil;
local: *;
} LIBSEPOL_1.0;

3873
libsepol/src/module_to_cil.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ HLLDIR ?= $(LIBEXECDIR)/selinux/hll
CFLAGS ?= -Werror -Wall -W
override CFLAGS += -I$(INCLUDEDIR)
LDLIBS = $(LIBDIR)/libsepol.a -L$(LIBDIR)
LDLIBS = -lsepol -L$(LIBDIR)
PP_SRCS = $(wildcard *.c)
PP_OBJS = $(patsubst %.c,%.o,$(PP_SRCS))

File diff suppressed because it is too large Load Diff