Skip to content

Commit

Permalink
libsepol/cil: raise default attrs_expand_size to 2
Browse files Browse the repository at this point in the history
The value attrs_expand_size == 1 removes all empty attributes, but it
also makes sense to expand all attributes that have only one type. This
removes some redundant rules (there is sometimes the same rule for the
type and the attribute) and reduces the number of attributes that the
kernel has to go through when looking up rules.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Acked-by: James Carter <jwcart2@gmail.com>
  • Loading branch information
WOnder93 authored and jwcart2 committed Mar 11, 2020
1 parent 42b13ba commit 692716f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libsepol/cil/src/cil.c
Expand Up @@ -452,7 +452,8 @@ void cil_db_init(struct cil_db **db)
(*db)->disable_dontaudit = CIL_FALSE;
(*db)->disable_neverallow = CIL_FALSE;
(*db)->attrs_expand_generated = CIL_FALSE;
(*db)->attrs_expand_size = 1;
/* 2 == remove attributes that contain none or just 1 type */
(*db)->attrs_expand_size = 2;
(*db)->preserve_tunables = CIL_FALSE;
(*db)->handle_unknown = -1;
(*db)->mls = -1;
Expand Down

0 comments on commit 692716f

Please sign in to comment.