diff mbox

libsepol/cil: fix error check in new cil_resolve_name

Message ID 20170602112107.16109-1-slawrence@tresys.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Steve Lawrence June 2, 2017, 11:21 a.m. UTC
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().

Signed-off-by: Steve Lawrence <slawrence@tresys.com>
---
 libsepol/cil/src/cil_resolve_ast.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Carter June 2, 2017, 4:26 p.m. UTC | #1
On 06/02/2017 07:21 AM, Steve Lawrence wrote:
> 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().
> 
> Signed-off-by: Steve Lawrence <slawrence@tresys.com>

Applied.

Thanks,
Jim

> ---
>   libsepol/cil/src/cil_resolve_ast.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c
> index fc44a5e..d1a5ed8 100644
> --- a/libsepol/cil/src/cil_resolve_ast.c
> +++ b/libsepol/cil/src/cil_resolve_ast.c
> @@ -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;
>   	}
>   
>
diff mbox

Patch

diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c
index fc44a5e..d1a5ed8 100644
--- a/libsepol/cil/src/cil_resolve_ast.c
+++ b/libsepol/cil/src/cil_resolve_ast.c
@@ -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;
 	}