[PATCH] libsepol: Skip aliases when creating the type_attr_map
James Carter <[email protected]>
| Newsgroups | org.kernel.vger.selinux |
|---|---|
| Message-ID | <[email protected]> |
Aliases that have primary == 0 share the same value as their primary, so there is no need to process them when creating the type_attr_map. Skip aliases with primary == 0 when creating the type_attr_map. Signed-off-by: James Carter <[email protected]> --- libsepol/src/expand.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsepol/src/expand.c b/libsepol/src/expand.c index 3d5bae83..18718973 100644 --- a/libsepol/src/expand.c +++ b/libsepol/src/expand.c @@ -2646,6 +2646,10 @@ static int type_attr_map(hashtab_key_t key __attribute__((unused)), type = (type_datum_t *)datum; value = type->s.value; + /* Skip aliases since they have the same value as their primary */ + if (!type->primary) + return 0; + if (type->flavor == TYPE_ATTRIB) { if (!(type->flags & TYPE_FLAGS_EXPAND_ATTR_TRUE)) { if (ebitmap_cpy(&p->attr_type_map[value - 1], -- 2.55.0