parser: Fix commented SecRule parser

No longer treat the next line as comment. Instead changes the
parser state to comment and figure out what to do.
This commit is contained in:
Felipe Zimmerle 2016-06-24 13:51:54 -03:00
parent 7d06c32b0d
commit bad3e13612
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -454,10 +454,8 @@ CONFIG_DIR_UNICODE_MAP_FILE (?i:SecUnicodeMapFile)
}
[ \t]*[\n] { driver.loc.back()->lines(1); driver.loc.back()->step(); }
#[ \t]*SecRule[^\\]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
#[ \t]*SecRule[^\\]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
#[ \t]*SecAction[^\\]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
#[ \t]*SecAction[^\\]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
#[ \t]*SecRule[^\\].*\\[ \t]*[\r\n]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
#[ \t]*SecAction[^\\].*\\[ \t]*[^\\n] { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); }
#.* { driver.loc.back()->step(); /* comment, just ignore. */ }
. { driver.error (*driver.loc.back(), "invalid character", yytext); throw yy::seclang_parser::syntax_error(*driver.loc.back(), ""); }
<<EOF>> {