From 1f1fa9d47edecf3f455572c2ba244b16acc5ec31 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Sun, 31 Jan 2021 21:54:21 +0100 Subject: [PATCH] libsepol: uniformize prototypes of sepol_mls_contains and sepol_mls_check In libsepol/src/mls.c, functions sepol_mls_contains and sepol_mls_check used "sepol_policydb_t * policydb" even though libsepol/include/sepol/context.h used "const sepol_policydb_t * policydb". Add const qualifiers in mls.c in order to match the header file. Detect such mismatching error at compile time by including the header file in mls.c. Signed-off-by: Nicolas Iooss --- libsepol/src/mls.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libsepol/src/mls.c b/libsepol/src/mls.c index 1ee90cf8..366a1114 100644 --- a/libsepol/src/mls.c +++ b/libsepol/src/mls.c @@ -27,6 +27,7 @@ * Implementation of the multi-level security (MLS) policy. */ +#include #include #include #include @@ -664,7 +665,7 @@ int mls_compute_sid(policydb_t * policydb, } int sepol_mls_contains(sepol_handle_t * handle, - sepol_policydb_t * policydb, + const sepol_policydb_t * policydb, const char *mls1, const char *mls2, int *response) { @@ -703,7 +704,7 @@ int sepol_mls_contains(sepol_handle_t * handle, } int sepol_mls_check(sepol_handle_t * handle, - sepol_policydb_t * policydb, const char *mls) + const sepol_policydb_t * policydb, const char *mls) { int ret;