Re: [PATCH 2/3] libsepol: uniformize prototypes of sepol_mls_contains and sepol_mls_check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 3, 2021 at 4:00 AM Nicolas Iooss <nicolas.iooss@xxxxxxx> wrote:
>
> 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@xxxxxxx>

Acked-by: James Carter <jwcart2@xxxxxxxxx>

> ---
>  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 1ee90cf8dee1..366a1114ce96 100644
> --- a/libsepol/src/mls.c
> +++ b/libsepol/src/mls.c
> @@ -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;
> --
> 2.30.0
>



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux