mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-01 12:07:46 +03:00
Refactoring: renames Rule to RuleWithOperator
This commit is contained in:
@@ -28,7 +28,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void Duration::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
double e = utils::cpu_seconds() - transaction->m_creationTimeStamp;
|
||||
|
||||
|
@@ -35,7 +35,7 @@ class Duration : public Variable {
|
||||
m_retName("DURATION") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -33,7 +33,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void Env::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
for (char **current = environ; *current; current++) {
|
||||
std::string env = std::string(*current);
|
||||
|
@@ -34,7 +34,7 @@ class Env : public Variable {
|
||||
: Variable(_name) { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
};
|
||||
|
||||
|
@@ -39,7 +39,7 @@ class Global_DictElement : public Variable {
|
||||
m_dictElement("GLOBAL:" + dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_global_collection->resolveMultiMatches(
|
||||
m_name, t->m_collections.m_global_collection_key,
|
||||
@@ -56,7 +56,7 @@ class Global_NoDictElement : public Variable {
|
||||
: Variable("GLOBAL") { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_global_collection->resolveMultiMatches("",
|
||||
t->m_collections.m_global_collection_key,
|
||||
@@ -72,7 +72,7 @@ class Global_DictElementRegexp : public VariableRegex {
|
||||
m_dictElement(dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_global_collection->resolveRegularExpression(
|
||||
m_dictElement,
|
||||
@@ -91,7 +91,7 @@ class Global_DynamicElement : public Variable {
|
||||
m_string(std::move(dictElement)) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_global_collection->resolveMultiMatches(
|
||||
|
@@ -27,7 +27,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void HighestSeverity::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableHighestSeverityAction.assign(
|
||||
std::to_string(transaction->m_highestSeverityAction));
|
||||
|
@@ -35,7 +35,7 @@ class HighestSeverity : public Variable {
|
||||
{ }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
};
|
||||
|
||||
|
@@ -39,7 +39,7 @@ class Ip_DictElement : public Variable {
|
||||
m_dictElement("IP:" + dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_ip_collection->resolveMultiMatches(
|
||||
m_name, t->m_collections.m_ip_collection_key,
|
||||
@@ -56,7 +56,7 @@ class Ip_NoDictElement : public Variable {
|
||||
: Variable("IP") { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_ip_collection->resolveMultiMatches("",
|
||||
t->m_collections.m_ip_collection_key,
|
||||
@@ -72,7 +72,7 @@ class Ip_DictElementRegexp : public VariableRegex {
|
||||
m_dictElement(dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_ip_collection->resolveRegularExpression(
|
||||
m_dictElement, t->m_collections.m_ip_collection_key,
|
||||
@@ -90,7 +90,7 @@ class Ip_DynamicElement : public Variable {
|
||||
m_string(std::move(dictElement)) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_ip_collection->resolveMultiMatches(
|
||||
|
@@ -25,7 +25,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void ModsecBuild::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
|
||||
l->push_back(new VariableValue(&m_retName, &m_build));
|
||||
|
@@ -44,7 +44,7 @@ class ModsecBuild : public Variable {
|
||||
}
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
|
||||
std::string m_build;
|
||||
|
@@ -37,7 +37,7 @@ namespace variables {
|
||||
|
||||
|
||||
void RemoteUser::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
size_t pos;
|
||||
std::string base64;
|
||||
|
@@ -37,7 +37,7 @@ class RemoteUser : public Variable {
|
||||
m_retName("REMOTE_USER") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -39,7 +39,7 @@ class Resource_DictElement : public Variable {
|
||||
m_dictElement("RESOURCE:" + dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_resource_collection->resolveMultiMatches(
|
||||
m_name, t->m_collections.m_resource_collection_key,
|
||||
@@ -56,7 +56,7 @@ class Resource_NoDictElement : public Variable {
|
||||
: Variable("RESOURCE") { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_resource_collection->resolveMultiMatches(m_name,
|
||||
t->m_collections.m_resource_collection_key,
|
||||
@@ -72,7 +72,7 @@ class Resource_DictElementRegexp : public VariableRegex {
|
||||
m_dictElement(dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_resource_collection->resolveRegularExpression(
|
||||
m_dictElement, t->m_collections.m_resource_collection_key,
|
||||
@@ -90,7 +90,7 @@ class Resource_DynamicElement : public Variable {
|
||||
m_string(std::move(dictElement)) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_resource_collection->resolveMultiMatches(
|
||||
|
@@ -38,9 +38,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
: VariableDictElement(std::string("RULE"), dictElement) { }
|
||||
|
||||
static void id(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
Rule *r = rule;
|
||||
RuleWithOperator *r = rule;
|
||||
|
||||
while (r && r->m_ruleId == 0) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -63,9 +63,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
|
||||
|
||||
static void rev(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
Rule *r = rule;
|
||||
RuleWithOperator *r = rule;
|
||||
|
||||
while (r && r->m_rev.empty()) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -89,9 +89,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
|
||||
|
||||
static void severity(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
Rule *r = rule;
|
||||
RuleWithOperator *r = rule;
|
||||
|
||||
while (r && !r->hasSeverity()) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -113,9 +113,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
|
||||
|
||||
static void logData(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
Rule *r = rule;
|
||||
RuleWithOperator *r = rule;
|
||||
|
||||
while (r && !r->hasLogData()) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -136,9 +136,9 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
}
|
||||
|
||||
static void msg(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
Rule *r = rule;
|
||||
RuleWithOperator *r = rule;
|
||||
|
||||
while (r && !r->hasMsg()) {
|
||||
r = r->m_chainedRuleParent;
|
||||
@@ -159,7 +159,7 @@ class Rule_DictElement : public VariableDictElement { \
|
||||
}
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
if (m_dictElement == "id") {
|
||||
id(t, rule, l);
|
||||
@@ -198,7 +198,7 @@ class Rule_DictElementRegexp : public VariableRegex {
|
||||
: VariableRegex("RULE", regex) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
if (Utils::regex_search("id", m_r) > 0) {
|
||||
Rule_DictElement::id(t, rule, l);
|
||||
@@ -230,7 +230,7 @@ class Rule_NoDictElement : public Variable {
|
||||
: Variable("RULE") { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
Rule_DictElement::id(t, rule, l);
|
||||
Rule_DictElement::rev(t, rule, l);
|
||||
|
@@ -39,7 +39,7 @@ class Session_DictElement : public Variable {
|
||||
m_dictElement("SESSION:" + dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_session_collection->resolveMultiMatches(
|
||||
m_name, t->m_collections.m_session_collection_key,
|
||||
@@ -56,7 +56,7 @@ class Session_NoDictElement : public Variable {
|
||||
: Variable("SESSION") { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_session_collection->resolveMultiMatches("",
|
||||
t->m_collections.m_session_collection_key,
|
||||
@@ -72,7 +72,7 @@ class Session_DictElementRegexp : public VariableRegex {
|
||||
m_dictElement(dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_session_collection->resolveRegularExpression(
|
||||
m_dictElement, t->m_collections.m_session_collection_key,
|
||||
@@ -90,7 +90,7 @@ class Session_DynamicElement : public Variable {
|
||||
m_string(std::move(dictElement)) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_session_collection->resolveMultiMatches(
|
||||
|
@@ -34,7 +34,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void Time::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
|
||||
char tstr[200];
|
||||
|
@@ -36,7 +36,7 @@ class Time : public Variable {
|
||||
m_retName("TIME") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -34,7 +34,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void TimeDay::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
char tstr[200];
|
||||
struct tm timeinfo;
|
||||
|
@@ -35,7 +35,7 @@ class TimeDay : public Variable {
|
||||
m_retName("TIME_DAY") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -34,7 +34,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void TimeEpoch::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableTimeEpoch.assign(
|
||||
std::to_string(std::time(nullptr)));
|
||||
|
@@ -35,7 +35,7 @@ class TimeEpoch : public Variable {
|
||||
m_retName("TIME_EPOCH") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -34,7 +34,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void TimeHour::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
char tstr[200];
|
||||
struct tm timeinfo;
|
||||
|
@@ -35,7 +35,7 @@ class TimeHour : public Variable {
|
||||
m_retName("TIME_HOUR") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -34,7 +34,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void TimeMin::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
char tstr[200];
|
||||
struct tm timeinfo;
|
||||
|
@@ -35,7 +35,7 @@ class TimeMin : public Variable {
|
||||
m_retName("TIME_MIN") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -34,7 +34,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void TimeMon::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
char tstr[200];
|
||||
struct tm timeinfo;
|
||||
|
@@ -35,7 +35,7 @@ class TimeMon : public Variable {
|
||||
m_retName("TIME_MON") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -34,7 +34,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void TimeSec::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
char tstr[200];
|
||||
struct tm timeinfo;
|
||||
|
@@ -35,7 +35,7 @@ class TimeSec : public Variable {
|
||||
m_retName("TIME_SEC") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -34,7 +34,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void TimeWDay::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
char tstr[200];
|
||||
struct tm timeinfo;
|
||||
|
@@ -35,7 +35,7 @@ class TimeWDay : public Variable {
|
||||
m_retName("TIME_WDAY") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -34,7 +34,7 @@ namespace modsecurity {
|
||||
namespace variables {
|
||||
|
||||
void TimeYear::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
char tstr[200];
|
||||
struct tm timeinfo;
|
||||
|
@@ -35,7 +35,7 @@ class TimeYear : public Variable {
|
||||
m_retName("TIME_YEAR") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
@@ -39,7 +39,7 @@ class Tx_DictElement : public Variable {
|
||||
m_dictElement("TX:" + dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_tx_collection->resolveMultiMatches(
|
||||
m_name, l, m_keyExclusion);
|
||||
@@ -55,7 +55,7 @@ class Tx_NoDictElement : public Variable {
|
||||
: Variable("TX") { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_tx_collection->resolveMultiMatches("", l,
|
||||
m_keyExclusion);
|
||||
@@ -70,7 +70,7 @@ class Tx_DictElementRegexp : public VariableRegex {
|
||||
m_dictElement(dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_tx_collection->resolveRegularExpression(
|
||||
m_dictElement, l, m_keyExclusion);
|
||||
@@ -87,7 +87,7 @@ class Tx_DynamicElement : public Variable {
|
||||
m_string(std::move(dictElement)) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_tx_collection->resolveMultiMatches(string, l,
|
||||
|
@@ -39,7 +39,7 @@ class User_DictElement : public Variable {
|
||||
m_dictElement("USER:" + dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_user_collection->resolveMultiMatches(
|
||||
m_name, t->m_collections.m_user_collection_key,
|
||||
@@ -56,7 +56,7 @@ class User_NoDictElement : public Variable {
|
||||
: Variable("USER") { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_user_collection->resolveMultiMatches(m_name,
|
||||
t->m_collections.m_user_collection_key,
|
||||
@@ -72,7 +72,7 @@ class User_DictElementRegexp : public VariableRegex {
|
||||
m_dictElement(dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_user_collection->resolveRegularExpression(
|
||||
m_dictElement, t->m_collections.m_user_collection_key,
|
||||
@@ -90,7 +90,7 @@ class User_DynamicElement : public Variable {
|
||||
m_string(std::move(dictElement)) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_user_collection->resolveMultiMatches(
|
||||
|
@@ -49,7 +49,7 @@ class n ## _DictElementRegexp : public VariableRegex { \
|
||||
: VariableRegex(#N, regex) { } \
|
||||
\
|
||||
void evaluate(Transaction *transaction, \
|
||||
Rule *rule, \
|
||||
RuleWithOperator *rule, \
|
||||
std::vector<const VariableValue *> *l) override { \
|
||||
transaction-> e .resolveRegularExpression(&m_r, l, \
|
||||
m_keyExclusion); \
|
||||
@@ -64,7 +64,7 @@ class n ## _DictElement : public VariableDictElement { \
|
||||
: VariableDictElement(#N, dictElement) { } \
|
||||
\
|
||||
void evaluate(Transaction *transaction, \
|
||||
Rule *rule, \
|
||||
RuleWithOperator *rule, \
|
||||
std::vector<const VariableValue *> *l) override { \
|
||||
transaction-> e .resolve(m_dictElement, l); \
|
||||
} \
|
||||
@@ -78,7 +78,7 @@ class n ## _NoDictElement : public Variable { \
|
||||
: Variable(#N) { } \
|
||||
\
|
||||
void evaluate(Transaction *transaction, \
|
||||
Rule *rule, \
|
||||
RuleWithOperator *rule, \
|
||||
std::vector<const VariableValue *> *l) override { \
|
||||
transaction-> e .resolve(l, m_keyExclusion); \
|
||||
} \
|
||||
@@ -92,7 +92,7 @@ class n : public Variable { \
|
||||
: Variable(#N) { } \
|
||||
\
|
||||
void evaluate(Transaction *transaction, \
|
||||
Rule *rule, \
|
||||
RuleWithOperator *rule, \
|
||||
std::vector<const VariableValue *> *l) override { \
|
||||
transaction-> e .evaluate(l); \
|
||||
} \
|
||||
@@ -550,7 +550,7 @@ class Variable : public VariableMonkeyResolution {
|
||||
|
||||
|
||||
virtual void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) = 0;
|
||||
|
||||
|
||||
@@ -630,7 +630,7 @@ class VariableModificatorExclusion : public Variable {
|
||||
m_base(std::move(var)) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
m_base->evaluate(t, rule, l);
|
||||
}
|
||||
@@ -648,7 +648,7 @@ class VariableModificatorCount : public Variable {
|
||||
}
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::vector<const VariableValue *> reslIn;
|
||||
VariableValue *val = NULL;
|
||||
|
@@ -36,7 +36,7 @@ class WebAppId : public Variable {
|
||||
: Variable("WEBAPPID") { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
const std::string name("WEBAPPID");
|
||||
const std::string rname = transaction->m_rules->m_secWebAppId.m_value;
|
||||
|
@@ -48,12 +48,12 @@ namespace variables {
|
||||
|
||||
#ifndef WITH_LIBXML2
|
||||
void XML::evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) { }
|
||||
#else
|
||||
|
||||
void XML::evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) {
|
||||
xmlXPathContextPtr xpathCtx;
|
||||
xmlXPathObjectPtr xpathObj;
|
||||
|
@@ -42,8 +42,8 @@ class XML_NoDictElement : public Variable {
|
||||
m_var(&m_name, &m_plain) {
|
||||
}
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
void evaluate(Transaction *transaction,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
l->push_back(new VariableValue(&m_var));
|
||||
}
|
||||
@@ -59,7 +59,7 @@ class XML : public Variable {
|
||||
: Variable(_name) { }
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
RuleWithOperator *rule,
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user