Skip to content

Commit

Permalink
libsepol/cil: Sync checks for invalid rules in macros
Browse files Browse the repository at this point in the history
When resolving the AST, tunable and in-statements are not considered
to be invalid in macros. This is inconsistent with the checks when
building the AST.

Add checks to make tunable and in-statments invalid in macros when
resolving the AST.

Signed-off-by: James Carter <jwcart2@gmail.com>
  • Loading branch information
jwcart2 committed Apr 19, 2021
1 parent 340f0eb commit f38b7ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libsepol/cil/src/cil_resolve_ast.c
Expand Up @@ -3796,7 +3796,9 @@ int __cil_resolve_ast_node_helper(struct cil_tree_node *node, uint32_t *finished
}

if (macro != NULL) {
if (node->flavor == CIL_BLOCK ||
if (node->flavor == CIL_TUNABLE ||
node->flavor == CIL_IN ||
node->flavor == CIL_BLOCK ||
node->flavor == CIL_BLOCKINHERIT ||
node->flavor == CIL_BLOCKABSTRACT ||
node->flavor == CIL_MACRO) {
Expand Down

0 comments on commit f38b7ea

Please sign in to comment.