Skip to contentSkip to conversation

libsepol/cil: fix error check in new cil_resolve_name

PATCH Applied Steve Lawrence 2 participants 2 messages Jun 2, 2017 SELinux security module

lore
Share & tools
lore
#0 lore raw

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
index fc44a5e..d1a5ed8 100644
@@ -4125,7 +4125,7 @@ int cil_resolve_name(struct cil_tree_node *ast_node, char *name, enum cil_sym_in
 	struct 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
Applied
#1 lore raw
Quoted 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 from cil_resolve_name().

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
index fc44a5e..d1a5ed8 100644
@@ -4125,7 +4125,7 @@ int cil_resolve_name(struct cil_tree_node *ast_node, char *name, enum cil_sym_in
  	struct 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