libsepol/cil: fix error check in new cil_resolve_name
PATCH 1/1 libsepol/cil: fix error check in new cil_resolve_name
This prevented cil_resolve_name() from returning an actual thing when a name resolved to an alias. This appears to have only affected resolution dealing with sensitivity and category aliases. Type aliases were not affected since places that dealt with types handled type aliases specifically and did not rely on this behavior from cil_resolve_name().
--- libsepol/cil/src/cil_resolve_ast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libsepol/cil/src/cil_resolve_ast.c +1 -1
@@ -4125,7 +4125,7 @@ int cil_resolve_name(struct cil_tree_node *ast_node, char *name, enum cil_sym_instruct cil_tree_node *node =NULL ; rc =cil_resolve_name_keep_aliases (ast_node, name, sym_index, extra_args, datum); -if (rc !=SEPOL_ERR ) { +if (rc !=SEPOL_OK ) { goto exit; }
Signature · 1 line
2.9.4
jwcart2
AppliedQuoted 7 lines · Steve Lawrence
This prevented
cil_resolve_name()from returning an actual thing when a name resolved to an alias. This appears to have only affected resolution dealing with sensitivity and category aliases. Type aliases were not affected since places that dealt with types handled type aliases specifically and did not rely on this behavior fromcil_resolve_name().Signed-off-by Steve Lawrence <[email protected]>
Applied.
Thanks,
Jim
Quoted 18 lines
--- libsepol/cil/src/cil_resolve_ast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)libsepol/cil/src/cil_resolve_ast.c +1
-1@@ -4125,7 +4125,7 @@ int cil_resolve_name(struct cil_tree_node *ast_node, char *name, enum cil_sym_instruct cil_tree_node *node =NULL ; rc =cil_resolve_name_keep_aliases (ast_node, name, sym_index, extra_args, datum); -if (rc !=SEPOL_ERR ) { +if (rc !=SEPOL_OK ) { goto exit; }
Signature · 2 lines
James Carter <[email protected]> National Security Agency