[MXS-1684] Empty space on a line in rule file confuses dbfwfilter which refuses to start Created: 2018-02-25  Updated: 2018-03-05  Resolved: 2018-03-01

Status: Closed
Project: MariaDB MaxScale
Component/s: dbfwfilter
Affects Version/s: 2.2.2
Fix Version/s: 2.1.14, 2.2.3

Type: Bug Priority: Major
Reporter: Anders Karlsson Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux CentOS 7.4



 Description   

I have the following rule file:

rule selectcmd match regex '(?i)SELECT .*'
 
users %@% match any rules selectcmd

On the second line there is a single space. MariaDB MaxScale refuse to start and in the log I get:
2018-02-24 12:06:34 warning: Firewall rules file lacks a trailing newline.
2018-02-24 12:06:34 error : [dbfwfilter] Error on line 3, syntax error: users
If you remove the single space on line two in the rules file, it works as expected:

rule selectcmd match regex '(?i)SELECT .*'
 
users %@% match any rules selectcmd

There is the error message about a missing newline, but this is actually not a correct description of the issue and doesn't help in diagnosing the error.


Generated at Thu Feb 08 04:08:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.