Message ID | 20220111215446.595516-13-jwcart2@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 88c79c6865de |
Headers | show |
Series | Refactor and fix assertion checking | expand |
diff --git a/libsepol/src/assertion.c b/libsepol/src/assertion.c index 71ee7815..26fa8d96 100644 --- a/libsepol/src/assertion.c +++ b/libsepol/src/assertion.c @@ -65,14 +65,11 @@ static void report_failure(sepol_handle_t *handle, policydb_t *p, const avrule_t static int match_any_class_permissions(class_perm_node_t *cp, uint32_t class, uint32_t data) { for (; cp; cp = cp->next) { - if ((cp->tclass == class) && (cp->data & data)) { - break; - } + if ((cp->tclass == class) && (cp->data & data)) + return 1; } - if (!cp) - return 0; - return 1; + return 0; } static int extended_permissions_and(uint32_t *perms1, uint32_t *perms2) {
Signed-off-by: James Carter <jwcart2@gmail.com> --- libsepol/src/assertion.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)