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 <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2021-01-31 21:54:21 +01:00
parent 72a88d753d
commit 1f1fa9d47e
No known key found for this signature in database
GPG Key ID: C191415F340DAAA0

View File

@ -27,6 +27,7 @@
* Implementation of the multi-level security (MLS) policy.
*/
#include <sepol/context.h>
#include <sepol/policydb/policydb.h>
#include <sepol/policydb/services.h>
#include <sepol/policydb/context.h>
@ -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;