Message ID | 20200310144133.381567-1-dburgener@linux.microsoft.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | checkpolicy: Treat invalid characters as an error | expand |
On Tue, Mar 10, 2020 at 10:42 AM Daniel Burgener <dburgener@linux.microsoft.com> wrote: > > Previously the behavior was to warn, discard the character and proceed. Now the build will halt upon encountering an expected character. > > Signed-off-by: Daniel Burgener <dburgener@linux.microsoft.com> Acked-by: James Carter <jwcart2@gmail.com> > --- > checkpolicy/policy_scan.l | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/checkpolicy/policy_scan.l b/checkpolicy/policy_scan.l > index e2f676e4..8c100f3d 100644 > --- a/checkpolicy/policy_scan.l > +++ b/checkpolicy/policy_scan.l > @@ -290,7 +290,7 @@ GLBLUB { return(GLBLUB); } > "]" | > "~" | > "*" { return(yytext[0]); } > -. { yywarn("unrecognized character");} > +. { yyerror("unrecognized character");} > %% > int yyerror(const char *msg) > { > -- > 2.24.1 >
On Tue, Mar 10, 2020 at 3:19 PM James Carter <jwcart2@gmail.com> wrote: > > On Tue, Mar 10, 2020 at 10:42 AM Daniel Burgener > <dburgener@linux.microsoft.com> wrote: > > > > Previously the behavior was to warn, discard the character and proceed. Now the build will halt upon encountering an expected character. > > > > Signed-off-by: Daniel Burgener <dburgener@linux.microsoft.com> > > Acked-by: James Carter <jwcart2@gmail.com> > > Thanks, applied. Jim > > --- > > checkpolicy/policy_scan.l | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/checkpolicy/policy_scan.l b/checkpolicy/policy_scan.l > > index e2f676e4..8c100f3d 100644 > > --- a/checkpolicy/policy_scan.l > > +++ b/checkpolicy/policy_scan.l > > @@ -290,7 +290,7 @@ GLBLUB { return(GLBLUB); } > > "]" | > > "~" | > > "*" { return(yytext[0]); } > > -. { yywarn("unrecognized character");} > > +. { yyerror("unrecognized character");} > > %% > > int yyerror(const char *msg) > > { > > -- > > 2.24.1 > >
diff --git a/checkpolicy/policy_scan.l b/checkpolicy/policy_scan.l index e2f676e4..8c100f3d 100644 --- a/checkpolicy/policy_scan.l +++ b/checkpolicy/policy_scan.l @@ -290,7 +290,7 @@ GLBLUB { return(GLBLUB); } "]" | "~" | "*" { return(yytext[0]); } -. { yywarn("unrecognized character");} +. { yyerror("unrecognized character");} %% int yyerror(const char *msg) {
Previously the behavior was to warn, discard the character and proceed. Now the build will halt upon encountering an expected character. Signed-off-by: Daniel Burgener <dburgener@linux.microsoft.com> --- checkpolicy/policy_scan.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)