Deprecate deny and allow in dbfwfilter rules

The `deny` and `allow` tokens are replaced with `match` which better
describes the action. Use of the old tokens causes a warning to be logged.
This commit is contained in:
Markus Mäkelä
2017-09-05 15:24:54 +03:00
parent 11bf5d2412
commit 68baf582c8
4 changed files with 25 additions and 24 deletions

View File

@ -34,8 +34,8 @@
%lex-param {void* scanner}
/** Terminal symbols */
%token FWTOK_RULE FWTOK_USERS FWTOK_RULES FWTOK_MATCH FWTOK_ANY FWTOK_ALL
%token FWTOK_STRICT_ALL FWTOK_DENY FWTOK_WILDCARD FWTOK_COLUMNS FWTOK_REGEX
%token FWTOK_RULE FWTOK_USERS FWTOK_RULES FWTOK_ANY FWTOK_ALL
%token FWTOK_STRICT_ALL FWTOK_MATCH FWTOK_WILDCARD FWTOK_COLUMNS FWTOK_REGEX
%token FWTOK_LIMIT_QUERIES FWTOK_WHERE_CLAUSE FWTOK_AT_TIMES FWTOK_ON_QUERIES
%token FWTOK_FUNCTION FWTOK_USES_FUNCTION FWTOK_COMMENT FWTOK_PIPE
@ -73,7 +73,7 @@ command
;
rule
: FWTOK_RULE rulename {if (!set_rule_name(scanner, $2)){YYERROR;}} FWTOK_DENY ruleparams
: FWTOK_RULE rulename {if (!set_rule_name(scanner, $2)){YYERROR;}} FWTOK_MATCH ruleparams
;
ruleparams

View File

@ -13,7 +13,7 @@
%{
#include <ruleparser.yy.h>
#include <maxscale/log_manager.h>
%}
%option reentrant noyywrap bison-bridge prefix="dbfw_yy"
@ -37,7 +37,7 @@ CMP [=<>!]+
%%
"\n"+ return '\n';
{COMMENT} return FWTOK_COMMENT;
deny|allow return FWTOK_DENY; /** This should be removed at some point */
deny|allow MXS_WARNING("Use of '%s' is deprecated, use 'match' instead", yytext);return FWTOK_MATCH;
rule return FWTOK_RULE;
function return FWTOK_FUNCTION;
uses_function return FWTOK_USES_FUNCTION;