All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Carter <jwcart2@gmail.com>
To: "Christian Göttsche" <cgzones@googlemail.com>
Cc: SElinux list <selinux@vger.kernel.org>
Subject: Re: [PATCH 02/23] libsepol: resolve missing prototypes
Date: Mon, 21 Jun 2021 16:55:37 -0400	[thread overview]
Message-ID: <CAP+JOzQU=r6c23e9-6WivjzSV3uKweo5NVdiU88F-awfL=+d3w@mail.gmail.com> (raw)
In-Reply-To: <20210608155912.32047-3-cgzones@googlemail.com>

On Tue, Jun 8, 2021 at 12:01 PM Christian Göttsche
<cgzones@googlemail.com> 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@googlemail.com>

Acked-by: James Carter <jwcart2@gmail.com>

> ---
>  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
>

  reply	other threads:[~2021-06-21 20:55 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 15:58 [PATCH 00/23] libsepol: miscellaneous cleanup Christian Göttsche
2021-06-08 15:58 ` [PATCH 01/23] libsepol: fix typos Christian Göttsche
2021-06-21 20:54   ` James Carter
2021-06-08 15:58 ` [PATCH 02/23] libsepol: resolve missing prototypes Christian Göttsche
2021-06-21 20:55   ` James Carter [this message]
2021-06-08 15:58 ` [PATCH 03/23] libsepol: remove unused functions Christian Göttsche
2021-06-21 20:54   ` James Carter
2021-06-08 15:58 ` [PATCH 04/23] libsepol: ignore UBSAN false-positives Christian Göttsche
2021-06-09 13:44   ` Ondrej Mosnacek
2021-06-09 14:05   ` James Carter
2021-07-01 18:06   ` [PATCH v2 1/3] " Christian Göttsche
2021-07-12  7:34     ` Nicolas Iooss
2021-07-13 19:59       ` Nicolas Iooss
2021-06-08 15:58 ` [PATCH 05/23] libsepol: avoid implicit conversions Christian Göttsche
2021-06-09 13:47   ` Ondrej Mosnacek
2021-07-01 18:06   ` [PATCH v2 2/3] " Christian Göttsche
2021-07-12  7:36     ` Nicolas Iooss
2021-07-13 20:01       ` Nicolas Iooss
2021-06-08 15:58 ` [PATCH 06/23] libsepol: avoid unsigned integer overflow Christian Göttsche
2021-06-21 20:58   ` James Carter
2021-06-08 15:58 ` [PATCH 07/23] libsepol: follow declaration-after-statement Christian Göttsche
2021-06-21 20:57   ` James Carter
2021-06-08 15:58 ` [PATCH 08/23] libsepol/cil: " Christian Göttsche
2021-06-21 20:56   ` James Carter
2021-06-08 15:58 ` [PATCH 09/23] libsepol: remove dead stores Christian Göttsche
2021-06-08 15:58 ` [PATCH 10/23] libsepol: mark read-only parameters of ebitmap interfaces const Christian Göttsche
2021-06-21 20:55   ` James Carter
2021-06-08 15:59 ` [PATCH 11/23] libsepol: mark read-only parameters of type_set_ " Christian Göttsche
2021-06-21 20:58   ` James Carter
2021-06-08 15:59 ` [PATCH 12/23] libsepol: do not allocate memory of size 0 Christian Göttsche
2021-06-21 20:59   ` James Carter
2021-06-08 15:59 ` [PATCH 13/23] libsepol: assure string NUL-termination Christian Göttsche
2021-06-09 14:38   ` James Carter
2021-07-01 18:07   ` [PATCH v2 3/3] libsepol: assure string NUL-termination of ibdev_name Christian Göttsche
2021-07-12  7:35     ` Nicolas Iooss
2021-07-13 19:59       ` Nicolas Iooss
2021-06-08 15:59 ` [PATCH 14/23] libsepol: remove dead stores Christian Göttsche
2021-06-08 15:59 ` [PATCH 15/23] libsepol/cil: silence cast warning Christian Göttsche
2021-06-21 20:58   ` James Carter
2021-06-08 15:59 ` [PATCH 16/23] libsepol/cil: drop extra semicolon Christian Göttsche
2021-06-21 20:57   ` James Carter
2021-06-08 15:59 ` [PATCH 17/23] libsepol/cil: drop dead store Christian Göttsche
2021-06-21 20:56   ` James Carter
2021-06-08 15:59 ` [PATCH 18/23] libsepol/cil: drop unnecessary casts Christian Göttsche
2021-06-21 20:55   ` James Carter
2021-06-08 15:59 ` [PATCH 19/23] libsepol/cil: avoid using maybe uninitialized variables Christian Göttsche
2021-06-21 21:00   ` James Carter
2021-06-08 15:59 ` [PATCH 20/23] libsepol: drop repeated semicolons Christian Göttsche
2021-06-21 20:54   ` James Carter
2021-06-08 15:59 ` [PATCH 21/23] libsepol: drop unnecessary casts Christian Göttsche
2021-06-21 20:57   ` James Carter
2021-06-08 15:59 ` [PATCH 22/23] libsepol: declare file local variable static Christian Göttsche
2021-06-21 21:00   ` James Carter
2021-06-08 15:59 ` [PATCH 23/23] libsepol: declare read-only arrays const Christian Göttsche
2021-06-21 20:59   ` James Carter
2021-06-24 14:29 ` [PATCH 00/23] libsepol: miscellaneous cleanup James Carter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP+JOzQU=r6c23e9-6WivjzSV3uKweo5NVdiU88F-awfL=+d3w@mail.gmail.com' \
    --to=jwcart2@gmail.com \
    --cc=cgzones@googlemail.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.