Skip to content

Commit

Permalink
libsepol: resolve missing prototypes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cgzones authored and jwcart2 committed Jun 24, 2021
1 parent 2cb6bac commit 9ec061b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion libsepol/src/assertion.c
Expand Up @@ -291,7 +291,7 @@ static int report_assertion_avtab_matches(avtab_key_t *k, avtab_datum_t *d, void
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;
Expand Down
1 change: 1 addition & 0 deletions 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
6 changes: 3 additions & 3 deletions libsepol/src/expand.c
Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions libsepol/src/policydb.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -2839,7 +2839,7 @@ static int filename_trans_read_one(policydb_t *p, struct policy_file *fp)
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;
Expand Down
2 changes: 1 addition & 1 deletion libsepol/src/services.c
Expand Up @@ -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)
Expand Down

0 comments on commit 9ec061b

Please sign in to comment.