MXS-1346: Make permission rules a class
The default rule is of the type that always matches any query and the Rule base class should reflect this.
This commit is contained in:
@ -292,7 +292,9 @@ struct Rule
|
|||||||
|
|
||||||
virtual bool matches_query(GWBUF* buffer, char** msg)
|
virtual bool matches_query(GWBUF* buffer, char** msg)
|
||||||
{
|
{
|
||||||
return false;
|
*msg = create_error("Permission denied at this time.");
|
||||||
|
MXS_NOTICE("rule '%s': query denied at this time.", rule->name.c_str());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool need_full_parsing(GWBUF* buffer) const
|
virtual bool need_full_parsing(GWBUF* buffer) const
|
||||||
@ -2155,9 +2157,7 @@ bool rule_matches(FW_INSTANCE* my_instance,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RT_PERMISSION:
|
case RT_PERMISSION:
|
||||||
matches = true;
|
/** Handled in Rule::matches_query */
|
||||||
msg = create_error("Permission denied at this time.");
|
|
||||||
MXS_NOTICE("rule '%s': query denied at this time.", rule->name.c_str());
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RT_COLUMN:
|
case RT_COLUMN:
|
||||||
|
Reference in New Issue
Block a user