Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in Checkmodule when downwriting to Module version 12 or lower. #273

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
Smaller bugfixes and testing module works as imagined.
Signed-off-by: Matthew Ife <[email protected]>
  • Loading branch information
Matthew Ife committed Nov 30, 2020
commit 5c8d72771b35de798b11edae1a75e8eccdba5757
2 changes: 1 addition & 1 deletion libsepol/src/hashtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ int hashtab_map(hashtab_t h,

for (i = 0; i < h->size; i++) {
cur = h->htable[i];
while (curi != NULL) {
while (cur != NULL) {
next = cur->next;
ret = apply(cur->key, cur->datum, args);
if (ret)
Expand Down
8 changes: 6 additions & 2 deletions libsepol/src/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -2170,7 +2170,7 @@ static void scope_write_destroy(hashtab_key_t key __attribute__ ((unused)),
free(cur);
}

static void type_attr_filter(hashtab_key_t key,
static int type_attr_filter(hashtab_key_t key,
hashtab_datum_t datum, void *args)
{
type_datum_t *typdatum = datum;
Expand All @@ -2186,9 +2186,11 @@ static void type_attr_filter(hashtab_key_t key,
if (scope)
hashtab_remove(scopetbl, key, scope_write_destroy, scope);
}

return 0;
}

static void role_attr_filter(hashtab_key_t key,
static int role_attr_filter(hashtab_key_t key,
hashtab_datum_t datum, void *args)
{
role_datum_t *role = datum;
Expand All @@ -2204,6 +2206,8 @@ static void role_attr_filter(hashtab_key_t key,
if (scope)
hashtab_remove(scopetbl, key, scope_write_destroy, scope);
}

return 0;
}

/*
Expand Down