Re: [PATCH 02/23] libsepol: resolve missing prototypes

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

 



On Tue, Jun 8, 2021 at 12:01 PM Christian Göttsche
<cgzones@xxxxxxxxxxxxxx> wrote:
>
> Declare the functions as static or include the corresponding header
> file.
>
> assertion.c:294:5: error: no previous prototype for function 'report_assertion_failures' [-Werror,-Wmissing-prototypes]
> int report_assertion_failures(sepol_handle_t *handle, policydb_t *p, avrule_t *avrule)
>     ^
>
> context.c:23:5: error: no previous prototype for function 'sepol_check_context' [-Werror,-Wmissing-prototypes]
> int sepol_check_context(const char *context)
>     ^
>
> expand.c:3377:5: error: no previous prototype for function 'expand_cond_av_node' [-Werror,-Wmissing-prototypes]
> int expand_cond_av_node(policydb_t * p,
>     ^
>
> policydb.c:638:6: error: no previous prototype for function 'role_trans_rule_destroy' [-Werror,-Wmissing-prototypes]
> void role_trans_rule_destroy(role_trans_rule_t * x)
>      ^
>
> policydb.c:1169:5: error: no previous prototype for function 'policydb_index_decls' [-Werror,-Wmissing-prototypes]
> int policydb_index_decls(sepol_handle_t * handle, policydb_t * p)
>     ^
>
> policydb.c:1429:6: error: no previous prototype for function 'ocontext_selinux_free' [-Werror,-Wmissing-prototypes]
> void ocontext_selinux_free(ocontext_t **ocontexts)
>      ^
>
> policydb.c:1451:6: error: no previous prototype for function 'ocontext_xen_free' [-Werror,-Wmissing-prototypes]
> void ocontext_xen_free(ocontext_t **ocontexts)
>      ^
>
> policydb.c:1750:5: error: no previous prototype for function 'type_set_or' [-Werror,-Wmissing-prototypes]
> int type_set_or(type_set_t * dst, type_set_t * a, type_set_t * b)
>     ^
>
> policydb.c:2524:5: error: no previous prototype for function 'role_trans_read' [-Werror,-Wmissing-prototypes]
> int role_trans_read(policydb_t *p, struct policy_file *fp)
>     ^
>
> policydb.c:2567:5: error: no previous prototype for function 'role_allow_read' [-Werror,-Wmissing-prototypes]
> int role_allow_read(role_allow_t ** r, struct policy_file *fp)
>     ^
>
> policydb.c:2842:5: error: no previous prototype for function 'filename_trans_read' [-Werror,-Wmissing-prototypes]
> int filename_trans_read(policydb_t *p, struct policy_file *fp)
>     ^
>
> services.c:1027:5: error: no previous prototype for function 'sepol_validate_transition' [-Werror,-Wmissing-prototypes]
> int sepol_validate_transition(sepol_security_id_t oldsid,
>     ^
>
> Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>

Acked-by: James Carter <jwcart2@xxxxxxxxx>

> ---
>  libsepol/src/assertion.c        |  2 +-
>  libsepol/src/context_internal.h |  1 +
>  libsepol/src/expand.c           |  6 +++---
>  libsepol/src/policydb.c         | 16 ++++++++--------
>  libsepol/src/services.c         |  2 +-
>  5 files changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/libsepol/src/assertion.c b/libsepol/src/assertion.c
> index 266f67d7..dd2749a0 100644
> --- a/libsepol/src/assertion.c
> +++ b/libsepol/src/assertion.c
> @@ -291,7 +291,7 @@ exit:
>         return rc;
>  }
>
> -int report_assertion_failures(sepol_handle_t *handle, policydb_t *p, avrule_t *avrule)
> +static int report_assertion_failures(sepol_handle_t *handle, policydb_t *p, avrule_t *avrule)
>  {
>         int rc;
>         struct avtab_match_args args;
> diff --git a/libsepol/src/context_internal.h b/libsepol/src/context_internal.h
> index 3cae28cc..3dc9cd15 100644
> --- a/libsepol/src/context_internal.h
> +++ b/libsepol/src/context_internal.h
> @@ -1,6 +1,7 @@
>  #ifndef _SEPOL_CONTEXT_INTERNAL_H_
>  #define _SEPOL_CONTEXT_INTERNAL_H_
>
> +#include <sepol/context.h>
>  #include <sepol/context_record.h>
>
>  #endif
> diff --git a/libsepol/src/expand.c b/libsepol/src/expand.c
> index a656ffad..84bfcfa3 100644
> --- a/libsepol/src/expand.c
> +++ b/libsepol/src/expand.c
> @@ -3374,9 +3374,9 @@ static int expand_cond_insert(cond_av_list_t ** l,
>         return 0;
>  }
>
> -int expand_cond_av_node(policydb_t * p,
> -                       avtab_ptr_t node,
> -                       cond_av_list_t ** newl, avtab_t * expa)
> +static int expand_cond_av_node(policydb_t * p,
> +                              avtab_ptr_t node,
> +                              cond_av_list_t ** newl, avtab_t * expa)
>  {
>         avtab_key_t *k = &node->key;
>         avtab_datum_t *d = &node->datum;
> diff --git a/libsepol/src/policydb.c b/libsepol/src/policydb.c
> index ffa27971..3f7ddb11 100644
> --- a/libsepol/src/policydb.c
> +++ b/libsepol/src/policydb.c
> @@ -635,7 +635,7 @@ void role_trans_rule_init(role_trans_rule_t * x)
>         ebitmap_init(&x->classes);
>  }
>
> -void role_trans_rule_destroy(role_trans_rule_t * x)
> +static void role_trans_rule_destroy(role_trans_rule_t * x)
>  {
>         if (x != NULL) {
>                 role_set_destroy(&x->roles);
> @@ -1166,7 +1166,7 @@ int policydb_index_bools(policydb_t * p)
>         return 0;
>  }
>
> -int policydb_index_decls(sepol_handle_t * handle, policydb_t * p)
> +static int policydb_index_decls(sepol_handle_t * handle, policydb_t * p)
>  {
>         avrule_block_t *curblock;
>         avrule_decl_t *decl;
> @@ -1426,7 +1426,7 @@ static int range_tr_destroy(hashtab_key_t key, hashtab_datum_t datum,
>         return 0;
>  }
>
> -void ocontext_selinux_free(ocontext_t **ocontexts)
> +static void ocontext_selinux_free(ocontext_t **ocontexts)
>  {
>         ocontext_t *c, *ctmp;
>         int i;
> @@ -1448,7 +1448,7 @@ void ocontext_selinux_free(ocontext_t **ocontexts)
>         }
>  }
>
> -void ocontext_xen_free(ocontext_t **ocontexts)
> +static void ocontext_xen_free(ocontext_t **ocontexts)
>  {
>         ocontext_t *c, *ctmp;
>         int i;
> @@ -1747,7 +1747,7 @@ int symtab_insert(policydb_t * pol, uint32_t sym,
>         return retval;
>  }
>
> -int type_set_or(type_set_t * dst, type_set_t * a, type_set_t * b)
> +static int type_set_or(type_set_t * dst, type_set_t * a, type_set_t * b)
>  {
>         type_set_init(dst);
>
> @@ -2521,7 +2521,7 @@ static int type_read(policydb_t * p, hashtab_t h, struct policy_file *fp)
>         return -1;
>  }
>
> -int role_trans_read(policydb_t *p, struct policy_file *fp)
> +static int role_trans_read(policydb_t *p, struct policy_file *fp)
>  {
>         role_trans_t **t = &p->role_tr;
>         unsigned int i;
> @@ -2564,7 +2564,7 @@ int role_trans_read(policydb_t *p, struct policy_file *fp)
>         return 0;
>  }
>
> -int role_allow_read(role_allow_t ** r, struct policy_file *fp)
> +static int role_allow_read(role_allow_t ** r, struct policy_file *fp)
>  {
>         unsigned int i;
>         uint32_t buf[2], nel;
> @@ -2839,7 +2839,7 @@ err:
>         return -1;
>  }
>
> -int filename_trans_read(policydb_t *p, struct policy_file *fp)
> +static int filename_trans_read(policydb_t *p, struct policy_file *fp)
>  {
>         unsigned int i;
>         uint32_t buf[1], nel;
> diff --git a/libsepol/src/services.c b/libsepol/src/services.c
> index 6596431c..39fbd979 100644
> --- a/libsepol/src/services.c
> +++ b/libsepol/src/services.c
> @@ -1024,7 +1024,7 @@ static int context_struct_compute_av(context_struct_t * scontext,
>         return 0;
>  }
>
> -int sepol_validate_transition(sepol_security_id_t oldsid,
> +static int sepol_validate_transition(sepol_security_id_t oldsid,
>                                      sepol_security_id_t newsid,
>                                      sepol_security_id_t tasksid,
>                                      sepol_security_class_t tclass)
> --
> 2.32.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