Skip to contentSkip to conversation

checkpolicy: mention class name on invalid permission

PATCH Applied Christian Göttsche 2 participants 3 messages Apr 26, 2022 – May 4, 2022 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpolicy: mention class name on invalid permission

When a permission for a constraint statement cannot be found also mention the related class name.

---
 checkpolicy/policy_define.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checkpolicy/policy_define.c +1 -1
index 16b78346..a4c24115 100644
@@ -3627,7 +3627,7 @@ int define_constraint(constraint_expr_t * expr)
 				}
 				if (!perdatum) {
 					yyerror2("permission %s is not"
-						 " defined", id);
+						 " defined for class %s", id, policydbp->p_class_val_to_name[i]);
 					free(id);
 					ebitmap_destroy(&classmap);
 					return -1;
Signature · 1 line
2.36.0
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Christian Göttsche

When a permission for a constraint statement cannot be found also mention the related class name.

Quoted 19 lines
---
 checkpolicy/policy_define.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checkpolicy/policy_define.c +1 -1
index 16b78346..a4c24115 100644
@@ -3627,7 +3627,7 @@ int define_constraint(constraint_expr_t * expr)
 				}
 				if (!perdatum) {
 					yyerror2("permission %s is not"
-						 " defined", id);
+						 " defined for class %s", id, policydbp->p_class_val_to_name[i]);
 					free(id);
 					ebitmap_destroy(&classmap);
 					return -1;
Signature · 1 line
2.36.0
#2 lore raw
Quoted 9 lines · Petr Lautrbach
Quoted 4 lines · Christian Göttsche

When a permission for a constraint statement cannot be found also mention the related class name.

Merged, thanks!

Quoted 20 lines
Quoted 20 lines
---
 checkpolicy/policy_define.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checkpolicy/policy_define.c +1 -1
index 16b78346..a4c24115 100644
@@ -3627,7 +3627,7 @@ int define_constraint(constraint_expr_t * expr)
 				}
 				if (!perdatum) {
 					yyerror2("permission %s is not"
-						 " defined", id);
+						 " defined for class %s", id, policydbp->p_class_val_to_name[i]);
 					free(id);
 					ebitmap_destroy(&classmap);
 					return -1;
Signature · 1 line
2.36.0