[PATCH] mcstrans: fix inverted alias skip check in compute_trans_from_raw()
Stephen Smalley <[email protected]>
| Newsgroups | org.kernel.vger.selinux |
|---|---|
| Message-ID | <[email protected]> |
ebitmap_cmp() returns 1 when the bitmaps are equal. The skip-if-alias-of-last-bc test incorrectly was comparing to 0 as if it followed strcmp() semantics. Fix the comparison. Signed-off-by: Stephen Smalley <[email protected]> --- mcstrans/src/mcstrans.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mcstrans/src/mcstrans.c b/mcstrans/src/mcstrans.c index e79aa3d5..8ed1aa95 100644 --- a/mcstrans/src/mcstrans.c +++ b/mcstrans/src/mcstrans.c @@ -1623,8 +1623,7 @@ static char *compute_trans_from_raw(const char *level, domain_t *domain) if (l->sens == bc->level->sens) { /* skip if alias of last bc */ if (last && last->level->sens == bc->level->sens && - ebitmap_cmp(&last->level->cat, &bc->level->cat) == - 0) + ebitmap_cmp(&last->level->cat, &bc->level->cat)) continue; /* compute bits not consumed by base classification */ -- 2.55.0