Skip to contentSkip to conversation

checkpolicy: Treat invalid characters as an error

PATCH Applied Daniel Burgener 2 participants 3 messages Mar 10, 2020 – Mar 11, 2020 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpolicy: Treat invalid characters as an error

Previously the behavior was to warn, discard the character and proceed. Now the build will halt upon encountering an expected character.

---
 checkpolicy/policy_scan.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checkpolicy/policy_scan.l +1 -1
index e2f676e4..8c100f3d 100644
@@ -290,7 +290,7 @@ GLBLUB				{ return(GLBLUB); }
 "]" |
 "~" |
 "*"				{ return(yytext[0]); } 
-.                               { yywarn("unrecognized character");}
+.                               { yyerror("unrecognized character");}
 %%
 int yyerror(const char *msg)
 {
Signature · 1 line
2.24.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Daniel Burgener

Previously the behavior was to warn, discard the character and proceed. Now the build will halt upon encountering an expected character.

Quoted 20 lines
---
 checkpolicy/policy_scan.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checkpolicy/policy_scan.l +1 -2
index e2f676e4..8c100f3d 100644
@@ -290,7 +290,7 @@ GLBLUB                              { return(GLBLUB); }
 "]" |
 "~" |
 "*"                            { return(yytext[0]); }
-.                               { yywarn("unrecognized character");}
+.                               { yyerror("unrecognized character");}
 %%
 int yyerror(const char *msg)
 {
--

2.24.1

Applied
#2 lore raw
Quoted 11 lines · James Carter
Quoted 4 lines · Daniel Burgener

Previously the behavior was to warn, discard the character and proceed. Now the build will halt upon encountering an expected character.

Thanks, applied.
Jim

Quoted 20 lines
Quoted 20 lines
---
 checkpolicy/policy_scan.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checkpolicy/policy_scan.l +1 -2
index e2f676e4..8c100f3d 100644
@@ -290,7 +290,7 @@ GLBLUB                              { return(GLBLUB); }
 "]" |
 "~" |
 "*"                            { return(yytext[0]); }
-.                               { yywarn("unrecognized character");}
+.                               { yyerror("unrecognized character");}
 %%
 int yyerror(const char *msg)
 {
--

2.24.1