From 8d0017919f3e9d987f4fa274ed6cd9f6a3fc3995 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Fri, 15 Mar 2019 01:56:40 -0300 Subject: [PATCH] Cleanup on Action class --- headers/modsecurity/actions/action.h | 88 +- headers/modsecurity/modsecurity.h | 6 + headers/modsecurity/rule_with_actions.h | 11 +- headers/modsecurity/rules.h | 48 +- headers/modsecurity/transaction.h | 1 - src/Makefile.am | 5 +- src/actions/accuracy.cc | 2 +- src/actions/block.cc | 1 + src/actions/chain.cc | 2 + src/actions/maturity.cc | 2 +- src/actions/phase.cc | 1 + src/actions/rev.cc | 1 + src/actions/rule_id.cc | 2 + src/actions/set_env.cc | 2 + src/actions/set_var.cc | 1 + src/actions/transformations/base64_decode.cc | 4 +- src/actions/transformations/base64_decode.h | 4 +- .../transformations/base64_decode_ext.cc | 4 +- .../transformations/base64_decode_ext.h | 4 +- src/actions/transformations/base64_encode.cc | 4 +- src/actions/transformations/base64_encode.h | 4 +- src/actions/transformations/cmd_line.cc | 4 +- src/actions/transformations/cmd_line.h | 4 +- .../transformations/compress_whitespace.cc | 4 +- .../transformations/compress_whitespace.h | 4 +- src/actions/transformations/css_decode.cc | 18 +- src/actions/transformations/css_decode.h | 4 +- .../transformations/escape_seq_decode.cc | 4 +- .../transformations/escape_seq_decode.h | 4 +- src/actions/transformations/hex_decode.cc | 4 +- src/actions/transformations/hex_decode.h | 4 +- src/actions/transformations/hex_encode.cc | 4 +- src/actions/transformations/hex_encode.h | 4 +- .../transformations/html_entity_decode.cc | 4 +- .../transformations/html_entity_decode.h | 4 +- src/actions/transformations/js_decode.cc | 4 +- src/actions/transformations/js_decode.h | 4 +- src/actions/transformations/length.cc | 4 +- src/actions/transformations/length.h | 4 +- src/actions/transformations/lower_case.cc | 4 +- src/actions/transformations/lower_case.h | 4 +- src/actions/transformations/md5.cc | 4 +- src/actions/transformations/md5.h | 4 +- src/actions/transformations/none.cc | 4 +- src/actions/transformations/none.h | 10 +- src/actions/transformations/normalise_path.cc | 4 +- src/actions/transformations/normalise_path.h | 4 +- .../transformations/normalise_path_win.cc | 4 +- .../transformations/normalise_path_win.h | 4 +- .../transformations/parity_even_7bit.cc | 4 +- .../transformations/parity_even_7bit.h | 4 +- .../transformations/parity_odd_7bit.cc | 4 +- src/actions/transformations/parity_odd_7bit.h | 4 +- .../transformations/parity_zero_7bit.cc | 4 +- .../transformations/parity_zero_7bit.h | 4 +- src/actions/transformations/php_args_names.cc | 4 +- src/actions/transformations/php_args_names.h | 4 +- .../transformations/remove_comments.cc | 4 +- src/actions/transformations/remove_comments.h | 4 +- .../transformations/remove_comments_char.cc | 4 +- .../transformations/remove_comments_char.h | 4 +- src/actions/transformations/remove_nulls.cc | 4 +- src/actions/transformations/remove_nulls.h | 4 +- .../transformations/remove_whitespace.cc | 4 +- .../transformations/remove_whitespace.h | 4 +- .../transformations/replace_comments.cc | 4 +- .../transformations/replace_comments.h | 4 +- src/actions/transformations/replace_nulls.cc | 4 +- src/actions/transformations/replace_nulls.h | 4 +- src/actions/transformations/sha1.cc | 4 +- src/actions/transformations/sha1.h | 4 +- src/actions/transformations/sql_hex_decode.cc | 4 +- src/actions/transformations/sql_hex_decode.h | 4 +- src/actions/transformations/transformation.cc | 1 + src/actions/transformations/transformation.h | 7 +- src/actions/transformations/trim.cc | 10 +- src/actions/transformations/trim.h | 10 +- src/actions/transformations/trim_left.cc | 4 +- src/actions/transformations/trim_left.h | 4 +- src/actions/transformations/trim_right.cc | 4 +- src/actions/transformations/trim_right.h | 4 +- src/actions/transformations/upper_case.cc | 4 +- src/actions/transformations/upper_case.h | 4 +- src/actions/transformations/url_decode.cc | 4 +- src/actions/transformations/url_decode.h | 4 +- src/actions/transformations/url_decode_uni.cc | 4 +- src/actions/transformations/url_decode_uni.h | 4 +- src/actions/transformations/url_encode.cc | 4 +- src/actions/transformations/url_encode.h | 4 +- .../transformations/utf8_to_unicode.cc | 4 +- src/actions/transformations/utf8_to_unicode.h | 4 +- src/actions/ver.cc | 1 + src/engine/lua.cc | 8 +- src/modsecurity.cc | 4 +- src/operators/detect_sqli.cc | 2 + src/operators/detect_xss.cc | 1 + src/operators/pm.cc | 2 + src/operators/rbl.cc | 2 + src/operators/rx.cc | 2 + src/operators/verify_cc.cc | 2 + src/operators/verify_cpf.cc | 2 + src/operators/verify_ssn.cc | 2 + src/operators/verify_svnr.cc | 1 + src/parser/seclang-parser.cc | 962 +++++++++--------- src/parser/seclang-parser.hh | 8 +- src/parser/seclang-parser.yy | 6 +- src/rule_script.h | 2 + src/rule_with_actions.cc | 32 +- src/rules.cc | 14 +- src/rules_exceptions.cc | 6 +- src/run_time_string.cc | 1 + src/variables/rule.h | 2 +- src/variables/xml.cc | 2 + test/cppcheck_suppressions.txt | 2 +- test/unit/unit.cc | 4 +- 115 files changed, 786 insertions(+), 793 deletions(-) diff --git a/headers/modsecurity/actions/action.h b/headers/modsecurity/actions/action.h index f42991df..72a95069 100644 --- a/headers/modsecurity/actions/action.h +++ b/headers/modsecurity/actions/action.h @@ -39,35 +39,27 @@ namespace actions { class Action { public: - explicit Action(const std::string& _action) - : m_isNone(false), - temporaryAction(false), - action_kind(2), + : m_actionKind(2), m_name(nullptr), m_parser_payload("") { set_name_and_payload(_action); } + Action(const std::string& _action, int kind) - : m_isNone(false), - temporaryAction(false), - action_kind(kind), + : m_actionKind(kind), m_name(nullptr), m_parser_payload("") { set_name_and_payload(_action); } Action(const Action &a) - : m_isNone(a.m_isNone), - temporaryAction(a.temporaryAction), - action_kind(a.action_kind), + : m_actionKind(a.m_actionKind), m_name(a.m_name), m_parser_payload(a.m_parser_payload) { } Action &operator=(const Action& a) { - m_isNone = a.m_isNone; - temporaryAction = a.temporaryAction; - action_kind = a.action_kind; + m_actionKind = a.m_actionKind; m_name = a.m_name; m_parser_payload = a.m_parser_payload; return *this; @@ -75,52 +67,24 @@ class Action { virtual ~Action() { } + virtual bool init(std::string *error) { return true; } + virtual std::string execute(const std::string &exp, Transaction *transaction); - virtual bool execute(RuleWithActions *rule, Transaction *transaction); - + virtual bool execute(RuleWithActions *rule, + Transaction *transaction); /** * This method is meant to be used by transformations — a particular * type of action. * */ virtual void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { }; - virtual bool init(std::string *error) { return true; } virtual bool isDisruptive() { return false; } - - void set_name_and_payload(const std::string& data) { - size_t pos = data.find(":"); - std::string t = "t:"; - - if (data.compare(0, t.length(), t) == 0) { - pos = data.find(":", 2); - } - - if (pos == std::string::npos) { - m_name = std::shared_ptr(new std::string(data)); - return; - } - - m_name = std::shared_ptr(new std::string(data, 0, pos)); - m_parser_payload = std::string(data, pos + 1, data.length()); - - if (m_parser_payload.at(0) == '\'' && m_parser_payload.size() > 2) { - m_parser_payload.erase(0, 1); - m_parser_payload.pop_back(); - } - } - - bool m_isNone; - bool temporaryAction; - int action_kind; - std::shared_ptr m_name; - std::string m_parser_payload; - /** * * Define the action kind regarding to the execution time. @@ -152,7 +116,35 @@ class Action { */ RunTimeOnlyIfMatchKind, }; - }; + + int m_actionKind; + std::shared_ptr m_name; + std::string m_parser_payload; + + private: + + void set_name_and_payload(const std::string& data) { + size_t pos = data.find(":"); + std::string t = "t:"; + + if (data.compare(0, t.length(), t) == 0) { + pos = data.find(":", 2); + } + + if (pos == std::string::npos) { + m_name = std::shared_ptr(new std::string(data)); + return; + } + + m_name = std::shared_ptr(new std::string(data, 0, pos)); + m_parser_payload = std::string(data, pos + 1, data.length()); + + if (m_parser_payload.at(0) == '\'' && m_parser_payload.size() > 2) { + m_parser_payload.erase(0, 1); + m_parser_payload.pop_back(); + } + } +}; } // namespace actions diff --git a/headers/modsecurity/modsecurity.h b/headers/modsecurity/modsecurity.h index 7eac444c..51e64f53 100644 --- a/headers/modsecurity/modsecurity.h +++ b/headers/modsecurity/modsecurity.h @@ -89,6 +89,12 @@ typedef struct ModSecurity_t modsecurity; #else namespace modsecurity { + /** + * Further that will be changed to be a stack-based string, + * for the benefit of performance. + */ + using ModSecString = std::string; + /** * * The Phases enumerator consists in mapping the different stages of a diff --git a/headers/modsecurity/rule_with_actions.h b/headers/modsecurity/rule_with_actions.h index d71ffeea..085a65dd 100644 --- a/headers/modsecurity/rule_with_actions.h +++ b/headers/modsecurity/rule_with_actions.h @@ -64,18 +64,17 @@ using MatchActionsPtr = std::vector; using XmlNSs = std::vector >; using XmlNSsPtr = std::vector; -using ModSecStackString = std::basic_string, std::allocator >; class TransformationResult { public: TransformationResult( - ModSecStackString *after, + ModSecString *after, std::string *transformation) : m_after(*after), m_transformation(transformation) { }; explicit TransformationResult( - ModSecStackString *after) + ModSecString *after) : m_after(*after), m_transformation(nullptr) { }; @@ -84,7 +83,7 @@ class TransformationResult { m_transformation(t2.m_transformation) { }; - ModSecStackString *getAfter() { + ModSecString *getAfter() { return &m_after; } @@ -95,7 +94,7 @@ class TransformationResult { private: - ModSecStackString m_after; + ModSecString m_after; std::string *m_transformation; }; @@ -224,7 +223,7 @@ class RuleWithActions : public Rule { static void executeTransformation( Transaction *transaction, - ModSecStackString in, + ModSecString in, TransformationsResults *ret, Transformation *transformation); diff --git a/headers/modsecurity/rules.h b/headers/modsecurity/rules.h index 1ed88ebc..43198b7c 100644 --- a/headers/modsecurity/rules.h +++ b/headers/modsecurity/rules.h @@ -40,52 +40,20 @@ namespace modsecurity { class Rules { public: - void dump() const { - for (int j = 0; j < m_rules.size(); j++) { - std::cout << " Rule ID: " << m_rules.at(j)->getReference(); - std::cout << "--" << m_rules.at(j) << std::endl; - } - } + void dump() const; - int append(Rules *from, const std::vector &ids, std::ostringstream *err) { - size_t j = 0; - for (; j < from->size(); j++) { - RuleWithOperator *rule = dynamic_cast(from->at(j).get()); - if (rule && std::binary_search(ids.begin(), ids.end(), rule->getId())) { - if (err != NULL) { - *err << "Rule id: " << std::to_string(rule->getId()) \ - << " is duplicated" << std::endl; - } - return -1; - } - } - m_rules.insert(m_rules.end(), from->m_rules.begin(), from->m_rules.end()); - return j; - } + int append(Rules *from, const std::vector &ids, std::ostringstream *err); - bool insert(const std::shared_ptr &rule) { - return insert(rule, nullptr, nullptr); - } + bool insert(const std::shared_ptr &rule); - bool insert(std::shared_ptr rule, const std::vector *ids, std::ostringstream *err) { - RuleWithOperator *r = dynamic_cast(rule.get()); - if (r && ids != nullptr && std::binary_search(ids->begin(), ids->end(), r->getId())) { - if (err != nullptr) { - *err << "Rule id: " << std::to_string(r->getId()) \ - << " is duplicated" << std::endl; - } - return false; - } - m_rules.push_back(rule); - return true; - } + bool insert(std::shared_ptr rule, const std::vector *ids, std::ostringstream *err); + + size_t size() const; + std::shared_ptr operator[](int index) const; + std::shared_ptr at(int index) const; void fixDefaultActions(); - size_t size() const { return m_rules.size(); } - std::shared_ptr operator[](int index) const { return m_rules[index]; } - std::shared_ptr at(int index) const { return m_rules[index]; } - std::vector > m_defaultActions; std::vector > m_defaultTransformations; diff --git a/headers/modsecurity/transaction.h b/headers/modsecurity/transaction.h index b82f1863..26e445de 100644 --- a/headers/modsecurity/transaction.h +++ b/headers/modsecurity/transaction.h @@ -49,7 +49,6 @@ typedef struct Rules_t RulesSet; #include "modsecurity/collection/collection.h" #include "modsecurity/variable_origin.h" - #ifndef NO_LOGS #define ms_dbg(b, c) \ do { \ diff --git a/src/Makefile.am b/src/Makefile.am index cbef8372..949ff844 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -42,10 +42,6 @@ pkginclude_HEADERS = \ ../headers/modsecurity/intervention.h \ ../headers/modsecurity/modsecurity.h \ ../headers/modsecurity/rule.h \ - ../headers/modsecurity/rule_marker.h \ - ../headers/modsecurity/rule_unconditional.h \ - ../headers/modsecurity/rule_with_actions.h \ - ../headers/modsecurity/rule_with_operator.h \ ../headers/modsecurity/rules.h \ ../headers/modsecurity/rule_message.h \ ../headers/modsecurity/rules_set.h \ @@ -288,6 +284,7 @@ libmodsecurity_la_SOURCES = \ debug_log/debug_log_writer.cc \ run_time_string.cc \ rule.cc \ + rules.cc \ rule_unconditional.cc \ rule_with_actions.cc \ rule_with_operator.cc \ diff --git a/src/actions/accuracy.cc b/src/actions/accuracy.cc index 7fcd44bc..66cb913d 100644 --- a/src/actions/accuracy.cc +++ b/src/actions/accuracy.cc @@ -21,7 +21,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" - +#include "modsecurity/rule_with_actions.h" namespace modsecurity { namespace actions { diff --git a/src/actions/block.cc b/src/actions/block.cc index 757c1d12..c20cf6ab 100644 --- a/src/actions/block.cc +++ b/src/actions/block.cc @@ -24,6 +24,7 @@ #include "modsecurity/rule.h" #include "modsecurity/intervention.h" #include "src/actions/data/status.h" +#include "modsecurity/rule_with_actions.h" namespace modsecurity { namespace actions { diff --git a/src/actions/chain.cc b/src/actions/chain.cc index bcd27a74..b2ac0990 100644 --- a/src/actions/chain.cc +++ b/src/actions/chain.cc @@ -20,6 +20,8 @@ #include "modsecurity/transaction.h" #include "modsecurity/rule.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace actions { diff --git a/src/actions/maturity.cc b/src/actions/maturity.cc index 33b78855..1d6ae4a0 100644 --- a/src/actions/maturity.cc +++ b/src/actions/maturity.cc @@ -21,7 +21,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" - +#include "modsecurity/rule_with_actions.h" namespace modsecurity { namespace actions { diff --git a/src/actions/phase.cc b/src/actions/phase.cc index 3099592b..4cba84c4 100644 --- a/src/actions/phase.cc +++ b/src/actions/phase.cc @@ -22,6 +22,7 @@ #include "modsecurity/rule.h" #include "modsecurity/modsecurity.h" #include "src/utils/string.h" +#include "modsecurity/rule_with_actions.h" namespace modsecurity { diff --git a/src/actions/rev.cc b/src/actions/rev.cc index 86369ebb..e2ec45e7 100644 --- a/src/actions/rev.cc +++ b/src/actions/rev.cc @@ -21,6 +21,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" +#include "modsecurity/rule_with_actions.h" namespace modsecurity { diff --git a/src/actions/rule_id.cc b/src/actions/rule_id.cc index 7d68fe60..40424933 100644 --- a/src/actions/rule_id.cc +++ b/src/actions/rule_id.cc @@ -20,6 +20,8 @@ #include "modsecurity/transaction.h" #include "modsecurity/rule.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace actions { diff --git a/src/actions/set_env.cc b/src/actions/set_env.cc index e5d080bb..2d92d48c 100644 --- a/src/actions/set_env.cc +++ b/src/actions/set_env.cc @@ -21,6 +21,8 @@ #include "modsecurity/transaction.h" #include "modsecurity/rule.h" #include "src/utils/string.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace actions { diff --git a/src/actions/set_var.cc b/src/actions/set_var.cc index e97297e5..2ae13606 100644 --- a/src/actions/set_var.cc +++ b/src/actions/set_var.cc @@ -30,6 +30,7 @@ #include "src/variables/tx.h" #include "src/variables/user.h" #include "src/variables/variable.h" +#include "modsecurity/rule_with_operator.h" namespace modsecurity { namespace actions { diff --git a/src/actions/transformations/base64_decode.cc b/src/actions/transformations/base64_decode.cc index 08d72f11..40a7a442 100644 --- a/src/actions/transformations/base64_decode.cc +++ b/src/actions/transformations/base64_decode.cc @@ -33,8 +33,8 @@ namespace transformations { void Base64Decode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { std::string value(in.c_str(), in.size()); std::string ret = Utils::Base64::decode(value); out.assign(ret.c_str(), ret.size()); diff --git a/src/actions/transformations/base64_decode.h b/src/actions/transformations/base64_decode.h index 55e172a4..e96c1e15 100644 --- a/src/actions/transformations/base64_decode.h +++ b/src/actions/transformations/base64_decode.h @@ -34,8 +34,8 @@ class Base64Decode : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/base64_decode_ext.cc b/src/actions/transformations/base64_decode_ext.cc index 07a77ad0..f582d7e4 100644 --- a/src/actions/transformations/base64_decode_ext.cc +++ b/src/actions/transformations/base64_decode_ext.cc @@ -33,8 +33,8 @@ namespace transformations { void Base64DecodeExt::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { std::string ret = Utils::Base64::decode_forgiven(in.c_str()); out.assign(ret.c_str(), ret.size()); } diff --git a/src/actions/transformations/base64_decode_ext.h b/src/actions/transformations/base64_decode_ext.h index ed9edf78..3f36fc9f 100644 --- a/src/actions/transformations/base64_decode_ext.h +++ b/src/actions/transformations/base64_decode_ext.h @@ -34,8 +34,8 @@ class Base64DecodeExt : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/base64_encode.cc b/src/actions/transformations/base64_encode.cc index 4bc7871a..3560d6eb 100644 --- a/src/actions/transformations/base64_encode.cc +++ b/src/actions/transformations/base64_encode.cc @@ -33,8 +33,8 @@ namespace transformations { void Base64Encode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { std::string ret = Utils::Base64::encode( std::string(in.c_str(), in.size())); out.assign(ret.c_str(), ret.size()); diff --git a/src/actions/transformations/base64_encode.h b/src/actions/transformations/base64_encode.h index 2c816d6b..1158a5c5 100644 --- a/src/actions/transformations/base64_encode.h +++ b/src/actions/transformations/base64_encode.h @@ -34,8 +34,8 @@ class Base64Encode : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/cmd_line.cc b/src/actions/transformations/cmd_line.cc index acb572ac..4082bed6 100644 --- a/src/actions/transformations/cmd_line.cc +++ b/src/actions/transformations/cmd_line.cc @@ -32,8 +32,8 @@ namespace transformations { void CmdLine::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { int space = 0; for (auto& a : in) { diff --git a/src/actions/transformations/cmd_line.h b/src/actions/transformations/cmd_line.h index a853ad83..3724b515 100644 --- a/src/actions/transformations/cmd_line.h +++ b/src/actions/transformations/cmd_line.h @@ -34,8 +34,8 @@ class CmdLine : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/compress_whitespace.cc b/src/actions/transformations/compress_whitespace.cc index a11c6ea4..7d1af976 100644 --- a/src/actions/transformations/compress_whitespace.cc +++ b/src/actions/transformations/compress_whitespace.cc @@ -32,8 +32,8 @@ namespace transformations { void CompressWhitespace::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { int inWhiteSpace = 0; size_t i = 0; out.reserve(in.size()); diff --git a/src/actions/transformations/compress_whitespace.h b/src/actions/transformations/compress_whitespace.h index 11d7b120..de14f33a 100644 --- a/src/actions/transformations/compress_whitespace.h +++ b/src/actions/transformations/compress_whitespace.h @@ -34,8 +34,8 @@ class CompressWhitespace : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/css_decode.cc b/src/actions/transformations/css_decode.cc index 05485d75..1ca7a824 100644 --- a/src/actions/transformations/css_decode.cc +++ b/src/actions/transformations/css_decode.cc @@ -35,17 +35,19 @@ namespace transformations { void CssDecode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { + size_t s = in.size(); + char *tmp = reinterpret_cast( - malloc(sizeof(char) * in.size() + 1)); - memcpy(tmp, in.c_str(), in.size() + 1); - tmp[in.size()] = '\0'; + malloc(sizeof(char) * s + 1)); + memcpy(tmp, in.c_str(), s + 1); + tmp[s] = '\0'; - CssDecode::css_decode_inplace(reinterpret_cast(tmp), - in.size()); + size_t r = CssDecode::css_decode_inplace(reinterpret_cast(tmp), + s); - out.assign(tmp, 0, in.size()); + out.assign(tmp, r); free(tmp); } diff --git a/src/actions/transformations/css_decode.h b/src/actions/transformations/css_decode.h index 112b3391..1be00f48 100644 --- a/src/actions/transformations/css_decode.h +++ b/src/actions/transformations/css_decode.h @@ -35,8 +35,8 @@ class CssDecode : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static int css_decode_inplace(unsigned char *input, int64_t input_len); }; diff --git a/src/actions/transformations/escape_seq_decode.cc b/src/actions/transformations/escape_seq_decode.cc index b81f5d72..073d314f 100644 --- a/src/actions/transformations/escape_seq_decode.cc +++ b/src/actions/transformations/escape_seq_decode.cc @@ -136,8 +136,8 @@ int EscapeSeqDecode::ansi_c_sequences_decode_inplace(unsigned char *input, void EscapeSeqDecode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *tmp = (unsigned char *) malloc(sizeof(char) * in.size() + 1); memcpy(tmp, in.c_str(), in.size() + 1); diff --git a/src/actions/transformations/escape_seq_decode.h b/src/actions/transformations/escape_seq_decode.h index f8c27fe1..7b690687 100644 --- a/src/actions/transformations/escape_seq_decode.h +++ b/src/actions/transformations/escape_seq_decode.h @@ -34,8 +34,8 @@ class EscapeSeqDecode : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static int ansi_c_sequences_decode_inplace(unsigned char *input, int input_len); }; diff --git a/src/actions/transformations/hex_decode.cc b/src/actions/transformations/hex_decode.cc index 13538a0e..212bcbee 100644 --- a/src/actions/transformations/hex_decode.cc +++ b/src/actions/transformations/hex_decode.cc @@ -33,8 +33,8 @@ namespace transformations { void HexDecode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; int size = 0; diff --git a/src/actions/transformations/hex_decode.h b/src/actions/transformations/hex_decode.h index 3501f138..58645cea 100644 --- a/src/actions/transformations/hex_decode.h +++ b/src/actions/transformations/hex_decode.h @@ -34,8 +34,8 @@ class HexDecode : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static int inplace(unsigned char *data, int len); }; diff --git a/src/actions/transformations/hex_encode.cc b/src/actions/transformations/hex_encode.cc index 751970c5..4a70e896 100644 --- a/src/actions/transformations/hex_encode.cc +++ b/src/actions/transformations/hex_encode.cc @@ -33,8 +33,8 @@ namespace transformations { void HexEncode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { std::stringstream result; for (std::size_t i=0; i < in.length(); i++) { int ii = reinterpret_cast(in[i]); diff --git a/src/actions/transformations/hex_encode.h b/src/actions/transformations/hex_encode.h index 2f8414e5..1e6ae842 100644 --- a/src/actions/transformations/hex_encode.h +++ b/src/actions/transformations/hex_encode.h @@ -34,8 +34,8 @@ class HexEncode : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; diff --git a/src/actions/transformations/html_entity_decode.cc b/src/actions/transformations/html_entity_decode.cc index 080f0c75..c2909e09 100644 --- a/src/actions/transformations/html_entity_decode.cc +++ b/src/actions/transformations/html_entity_decode.cc @@ -34,8 +34,8 @@ namespace transformations { void HtmlEntityDecode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; input = reinterpret_cast diff --git a/src/actions/transformations/html_entity_decode.h b/src/actions/transformations/html_entity_decode.h index b2b39a7d..f315fb91 100644 --- a/src/actions/transformations/html_entity_decode.h +++ b/src/actions/transformations/html_entity_decode.h @@ -37,8 +37,8 @@ class HtmlEntityDecode : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static int inplace(unsigned char *input, uint64_t input_len); }; diff --git a/src/actions/transformations/js_decode.cc b/src/actions/transformations/js_decode.cc index 268e0321..32640cad 100644 --- a/src/actions/transformations/js_decode.cc +++ b/src/actions/transformations/js_decode.cc @@ -35,8 +35,8 @@ namespace transformations { void JsDecode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; input = reinterpret_cast diff --git a/src/actions/transformations/js_decode.h b/src/actions/transformations/js_decode.h index 013e4d92..c029e611 100644 --- a/src/actions/transformations/js_decode.h +++ b/src/actions/transformations/js_decode.h @@ -34,8 +34,8 @@ class JsDecode : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static int inplace(unsigned char *input, uint64_t input_len); }; diff --git a/src/actions/transformations/length.cc b/src/actions/transformations/length.cc index d620de31..57f6ae2f 100644 --- a/src/actions/transformations/length.cc +++ b/src/actions/transformations/length.cc @@ -32,8 +32,8 @@ namespace transformations { void Length::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { out.assign(std::to_string(in.size()).c_str()); } diff --git a/src/actions/transformations/length.h b/src/actions/transformations/length.h index bd643005..39828159 100644 --- a/src/actions/transformations/length.h +++ b/src/actions/transformations/length.h @@ -34,8 +34,8 @@ class Length : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/lower_case.cc b/src/actions/transformations/lower_case.cc index fb974794..137227ef 100644 --- a/src/actions/transformations/lower_case.cc +++ b/src/actions/transformations/lower_case.cc @@ -28,8 +28,8 @@ namespace transformations { void LowerCase::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { std::locale loc; out.resize(in.size()); for (std::string::size_type i=0; i < in.size(); ++i) { diff --git a/src/actions/transformations/lower_case.h b/src/actions/transformations/lower_case.h index 2f885914..79852094 100644 --- a/src/actions/transformations/lower_case.h +++ b/src/actions/transformations/lower_case.h @@ -36,8 +36,8 @@ class LowerCase : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/md5.cc b/src/actions/transformations/md5.cc index 3996645a..a179e174 100644 --- a/src/actions/transformations/md5.cc +++ b/src/actions/transformations/md5.cc @@ -32,8 +32,8 @@ namespace transformations { void Md5::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { std::string ret = Utils::Md5::digest(std::string(in.c_str(), in.size())); out.assign(ret.c_str(), ret.size()); diff --git a/src/actions/transformations/md5.h b/src/actions/transformations/md5.h index c822eecf..5b86b0ca 100644 --- a/src/actions/transformations/md5.h +++ b/src/actions/transformations/md5.h @@ -34,8 +34,8 @@ class Md5 : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/none.cc b/src/actions/transformations/none.cc index f093c550..00b5aadc 100644 --- a/src/actions/transformations/none.cc +++ b/src/actions/transformations/none.cc @@ -32,8 +32,8 @@ namespace transformations { void None::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { } + ModSecString &in, + ModSecString &out) { } } // namespace transformations diff --git a/src/actions/transformations/none.h b/src/actions/transformations/none.h index e69c3b07..130cbb74 100644 --- a/src/actions/transformations/none.h +++ b/src/actions/transformations/none.h @@ -32,11 +32,15 @@ class None : public Transformation { public: explicit None(const std::string &action) : Transformation(action) - { m_isNone = true; } + { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; + + bool isNone() override { + return true; + } }; } // namespace transformations diff --git a/src/actions/transformations/normalise_path.cc b/src/actions/transformations/normalise_path.cc index 16290e34..c7ff95a9 100644 --- a/src/actions/transformations/normalise_path.cc +++ b/src/actions/transformations/normalise_path.cc @@ -34,8 +34,8 @@ namespace transformations { void NormalisePath::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { int changed = 0; char *tmp = reinterpret_cast( diff --git a/src/actions/transformations/normalise_path.h b/src/actions/transformations/normalise_path.h index a5667f13..7fd91fc1 100644 --- a/src/actions/transformations/normalise_path.h +++ b/src/actions/transformations/normalise_path.h @@ -34,8 +34,8 @@ class NormalisePath : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static int normalize_path_inplace(unsigned char *input, int input_len, int win, int *changed); diff --git a/src/actions/transformations/normalise_path_win.cc b/src/actions/transformations/normalise_path_win.cc index 7b0541f7..a3746618 100644 --- a/src/actions/transformations/normalise_path_win.cc +++ b/src/actions/transformations/normalise_path_win.cc @@ -35,8 +35,8 @@ namespace transformations { void NormalisePathWin::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { int changed; char *tmp = reinterpret_cast( diff --git a/src/actions/transformations/normalise_path_win.h b/src/actions/transformations/normalise_path_win.h index 48be406b..3d7c8d75 100644 --- a/src/actions/transformations/normalise_path_win.h +++ b/src/actions/transformations/normalise_path_win.h @@ -34,8 +34,8 @@ class NormalisePathWin : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/parity_even_7bit.cc b/src/actions/transformations/parity_even_7bit.cc index 2e8c874f..29d547da 100644 --- a/src/actions/transformations/parity_even_7bit.cc +++ b/src/actions/transformations/parity_even_7bit.cc @@ -33,8 +33,8 @@ namespace transformations { void ParityEven7bit::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; input = reinterpret_cast diff --git a/src/actions/transformations/parity_even_7bit.h b/src/actions/transformations/parity_even_7bit.h index ac4f7ac6..de250260 100644 --- a/src/actions/transformations/parity_even_7bit.h +++ b/src/actions/transformations/parity_even_7bit.h @@ -34,8 +34,8 @@ class ParityEven7bit : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static bool inplace(unsigned char *input, uint64_t input_len); }; diff --git a/src/actions/transformations/parity_odd_7bit.cc b/src/actions/transformations/parity_odd_7bit.cc index ca6946fe..d2695826 100644 --- a/src/actions/transformations/parity_odd_7bit.cc +++ b/src/actions/transformations/parity_odd_7bit.cc @@ -33,8 +33,8 @@ namespace transformations { void ParityOdd7bit::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; input = reinterpret_cast diff --git a/src/actions/transformations/parity_odd_7bit.h b/src/actions/transformations/parity_odd_7bit.h index a99a488d..823b7fc7 100644 --- a/src/actions/transformations/parity_odd_7bit.h +++ b/src/actions/transformations/parity_odd_7bit.h @@ -34,8 +34,8 @@ class ParityOdd7bit : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static bool inplace(unsigned char *input, uint64_t input_len); }; diff --git a/src/actions/transformations/parity_zero_7bit.cc b/src/actions/transformations/parity_zero_7bit.cc index d54e8e13..25e24f42 100644 --- a/src/actions/transformations/parity_zero_7bit.cc +++ b/src/actions/transformations/parity_zero_7bit.cc @@ -33,8 +33,8 @@ namespace transformations { void ParityZero7bit::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; input = reinterpret_cast diff --git a/src/actions/transformations/parity_zero_7bit.h b/src/actions/transformations/parity_zero_7bit.h index 647c7fa2..3dff4d33 100644 --- a/src/actions/transformations/parity_zero_7bit.h +++ b/src/actions/transformations/parity_zero_7bit.h @@ -34,8 +34,8 @@ class ParityZero7bit : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static bool inplace(unsigned char *input, uint64_t input_len); }; diff --git a/src/actions/transformations/php_args_names.cc b/src/actions/transformations/php_args_names.cc index 41e79126..6f9cdf3c 100644 --- a/src/actions/transformations/php_args_names.cc +++ b/src/actions/transformations/php_args_names.cc @@ -34,8 +34,8 @@ PhpArgsNames::PhpArgsNames(const std::string &a) void PhpArgsNames::execute(Transaction *t, - ModSecStackString &val, - ModSecStackString &out) { + ModSecString &val, + ModSecString &out) { //Took the logic from php src code: //https://github.com/php/php-src/blob/master/main/php_variables.c //Function call PHPAPI void php_register_variable_ex(const char *var_name, zval *val, zval *track_vars_array) diff --git a/src/actions/transformations/php_args_names.h b/src/actions/transformations/php_args_names.h index bf1383ee..a9694a32 100644 --- a/src/actions/transformations/php_args_names.h +++ b/src/actions/transformations/php_args_names.h @@ -35,8 +35,8 @@ class PhpArgsNames : public Transformation { explicit PhpArgsNames(const std::string &action); void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/remove_comments.cc b/src/actions/transformations/remove_comments.cc index 44882e81..86b29320 100644 --- a/src/actions/transformations/remove_comments.cc +++ b/src/actions/transformations/remove_comments.cc @@ -33,8 +33,8 @@ namespace transformations { void RemoveComments::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; input = reinterpret_cast diff --git a/src/actions/transformations/remove_comments.h b/src/actions/transformations/remove_comments.h index 9fb33ea0..804a468f 100644 --- a/src/actions/transformations/remove_comments.h +++ b/src/actions/transformations/remove_comments.h @@ -35,8 +35,8 @@ class RemoveComments : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override;; + ModSecString &in, + ModSecString &out) override;; }; diff --git a/src/actions/transformations/remove_comments_char.cc b/src/actions/transformations/remove_comments_char.cc index e1bbf42a..db9c50b2 100644 --- a/src/actions/transformations/remove_comments_char.cc +++ b/src/actions/transformations/remove_comments_char.cc @@ -32,8 +32,8 @@ namespace transformations { void RemoveCommentsChar::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { int64_t i; out = in; diff --git a/src/actions/transformations/remove_comments_char.h b/src/actions/transformations/remove_comments_char.h index 31919925..53ac44ac 100644 --- a/src/actions/transformations/remove_comments_char.h +++ b/src/actions/transformations/remove_comments_char.h @@ -34,8 +34,8 @@ class RemoveCommentsChar : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/remove_nulls.cc b/src/actions/transformations/remove_nulls.cc index 99f0ff14..5ee5fdf4 100644 --- a/src/actions/transformations/remove_nulls.cc +++ b/src/actions/transformations/remove_nulls.cc @@ -34,8 +34,8 @@ namespace transformations { void RemoveNulls::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { int64_t i; out = in; diff --git a/src/actions/transformations/remove_nulls.h b/src/actions/transformations/remove_nulls.h index 452c93cc..00adf316 100644 --- a/src/actions/transformations/remove_nulls.h +++ b/src/actions/transformations/remove_nulls.h @@ -34,8 +34,8 @@ class RemoveNulls : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/remove_whitespace.cc b/src/actions/transformations/remove_whitespace.cc index 19a30b97..7d758fad 100644 --- a/src/actions/transformations/remove_whitespace.cc +++ b/src/actions/transformations/remove_whitespace.cc @@ -33,8 +33,8 @@ namespace transformations { void RemoveWhitespace::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { out = in; int64_t i = 0; diff --git a/src/actions/transformations/remove_whitespace.h b/src/actions/transformations/remove_whitespace.h index f4a41007..71119be1 100644 --- a/src/actions/transformations/remove_whitespace.h +++ b/src/actions/transformations/remove_whitespace.h @@ -34,8 +34,8 @@ class RemoveWhitespace : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/replace_comments.cc b/src/actions/transformations/replace_comments.cc index a4f19489..25fdac9f 100644 --- a/src/actions/transformations/replace_comments.cc +++ b/src/actions/transformations/replace_comments.cc @@ -33,8 +33,8 @@ namespace transformations { void ReplaceComments::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { uint64_t i, j, incomment; char *input = reinterpret_cast( diff --git a/src/actions/transformations/replace_comments.h b/src/actions/transformations/replace_comments.h index 80899cfe..c09c65a4 100644 --- a/src/actions/transformations/replace_comments.h +++ b/src/actions/transformations/replace_comments.h @@ -34,8 +34,8 @@ class ReplaceComments : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/replace_nulls.cc b/src/actions/transformations/replace_nulls.cc index 5b54e24e..bcd28497 100644 --- a/src/actions/transformations/replace_nulls.cc +++ b/src/actions/transformations/replace_nulls.cc @@ -32,8 +32,8 @@ namespace transformations { void ReplaceNulls::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { int64_t i; out = in; diff --git a/src/actions/transformations/replace_nulls.h b/src/actions/transformations/replace_nulls.h index e9434a5c..544f256d 100644 --- a/src/actions/transformations/replace_nulls.h +++ b/src/actions/transformations/replace_nulls.h @@ -34,8 +34,8 @@ class ReplaceNulls : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/sha1.cc b/src/actions/transformations/sha1.cc index 17bcc0c2..995922b9 100644 --- a/src/actions/transformations/sha1.cc +++ b/src/actions/transformations/sha1.cc @@ -33,8 +33,8 @@ namespace transformations { void Sha1::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { auto a = Utils::Sha1::digest( std::string(in.c_str(), in.size()) diff --git a/src/actions/transformations/sha1.h b/src/actions/transformations/sha1.h index 02377e43..fce9aa75 100644 --- a/src/actions/transformations/sha1.h +++ b/src/actions/transformations/sha1.h @@ -34,8 +34,8 @@ class Sha1 : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/sql_hex_decode.cc b/src/actions/transformations/sql_hex_decode.cc index 1420451a..da7fc301 100644 --- a/src/actions/transformations/sql_hex_decode.cc +++ b/src/actions/transformations/sql_hex_decode.cc @@ -42,8 +42,8 @@ namespace transformations { #endif void SqlHexDecode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; int size = 0; diff --git a/src/actions/transformations/sql_hex_decode.h b/src/actions/transformations/sql_hex_decode.h index cb7617a6..7e0d4dd4 100644 --- a/src/actions/transformations/sql_hex_decode.h +++ b/src/actions/transformations/sql_hex_decode.h @@ -34,8 +34,8 @@ class SqlHexDecode : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static int inplace(unsigned char *data, int len); diff --git a/src/actions/transformations/transformation.cc b/src/actions/transformations/transformation.cc index aaa2f098..115e998d 100644 --- a/src/actions/transformations/transformation.cc +++ b/src/actions/transformations/transformation.cc @@ -116,6 +116,7 @@ Transformation* Transformation::instantiate(std::string a) { return new Transformation(a); } + } // namespace transformations } // namespace actions } // namespace modsecurity diff --git a/src/actions/transformations/transformation.h b/src/actions/transformations/transformation.h index 8f11542d..9bedeb3f 100644 --- a/src/actions/transformations/transformation.h +++ b/src/actions/transformations/transformation.h @@ -32,12 +32,7 @@ class Transformation : public Action { explicit Transformation(const std::string& _action) : Action(_action, RunTimeBeforeMatchAttemptKind) { } - void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override { - // FIXME: this should be remove as soon as #1974 got fixed. - out.assign(in.c_str(), in.length()); - } + virtual bool isNone() { return false; } static Transformation* instantiate(std::string a); }; diff --git a/src/actions/transformations/trim.cc b/src/actions/transformations/trim.cc index dba82910..251d75df 100644 --- a/src/actions/transformations/trim.cc +++ b/src/actions/transformations/trim.cc @@ -31,27 +31,27 @@ namespace actions { namespace transformations { -void Trim::ltrim(ModSecStackString *s) { +void Trim::ltrim(ModSecString *s) { s->erase(s->begin(), std::find_if(s->begin(), s->end(), std::not1(std::ptr_fun(std::isspace)))); } -void Trim::rtrim(ModSecStackString *s) { +void Trim::rtrim(ModSecString *s) { s->erase(std::find_if(s->rbegin(), s->rend(), std::not1(std::ptr_fun(std::isspace))).base(), s->end()); } -void Trim::trim(ModSecStackString *s) { +void Trim::trim(ModSecString *s) { rtrim(s); ltrim(s); } void Trim::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { out = in; trim(&out); }; diff --git a/src/actions/transformations/trim.h b/src/actions/transformations/trim.h index bfb76160..6a390fd6 100644 --- a/src/actions/transformations/trim.h +++ b/src/actions/transformations/trim.h @@ -34,12 +34,12 @@ class Trim : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; - void ltrim(ModSecStackString *s); - void rtrim(ModSecStackString *s); - void trim(ModSecStackString *s); + void ltrim(ModSecString *s); + void rtrim(ModSecString *s); + void trim(ModSecString *s); }; } // namespace transformations diff --git a/src/actions/transformations/trim_left.cc b/src/actions/transformations/trim_left.cc index 3451389b..bdf099e2 100644 --- a/src/actions/transformations/trim_left.cc +++ b/src/actions/transformations/trim_left.cc @@ -33,8 +33,8 @@ namespace transformations { void TrimLeft::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { out = in; ltrim(&out); }; diff --git a/src/actions/transformations/trim_left.h b/src/actions/transformations/trim_left.h index 91912921..02b40685 100644 --- a/src/actions/transformations/trim_left.h +++ b/src/actions/transformations/trim_left.h @@ -35,8 +35,8 @@ class TrimLeft : public Trim { : Trim(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/trim_right.cc b/src/actions/transformations/trim_right.cc index ee968a90..91898e18 100644 --- a/src/actions/transformations/trim_right.cc +++ b/src/actions/transformations/trim_right.cc @@ -32,8 +32,8 @@ namespace transformations { void TrimRight::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { out = in; rtrim(&out); }; diff --git a/src/actions/transformations/trim_right.h b/src/actions/transformations/trim_right.h index 7fa2d570..5300559d 100644 --- a/src/actions/transformations/trim_right.h +++ b/src/actions/transformations/trim_right.h @@ -35,8 +35,8 @@ class TrimRight : public Trim { : Trim(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/upper_case.cc b/src/actions/transformations/upper_case.cc index 99100df0..2e6eaf24 100644 --- a/src/actions/transformations/upper_case.cc +++ b/src/actions/transformations/upper_case.cc @@ -28,8 +28,8 @@ namespace transformations { void UpperCase::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { std::locale loc; out.reserve(in.size()); for (std::string::size_type i=0; i < in.size(); ++i) { diff --git a/src/actions/transformations/upper_case.h b/src/actions/transformations/upper_case.h index cf3de628..37c10444 100644 --- a/src/actions/transformations/upper_case.h +++ b/src/actions/transformations/upper_case.h @@ -36,8 +36,8 @@ class UpperCase : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/url_decode.cc b/src/actions/transformations/url_decode.cc index 75ba798c..e5f32afd 100644 --- a/src/actions/transformations/url_decode.cc +++ b/src/actions/transformations/url_decode.cc @@ -33,8 +33,8 @@ namespace transformations { void UrlDecode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *val(NULL); int invalid_count = 0; int changed; diff --git a/src/actions/transformations/url_decode.h b/src/actions/transformations/url_decode.h index b39707a4..03535f2f 100644 --- a/src/actions/transformations/url_decode.h +++ b/src/actions/transformations/url_decode.h @@ -36,8 +36,8 @@ class UrlDecode : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; }; } // namespace transformations diff --git a/src/actions/transformations/url_decode_uni.cc b/src/actions/transformations/url_decode_uni.cc index 9855ae41..18326d24 100644 --- a/src/actions/transformations/url_decode_uni.cc +++ b/src/actions/transformations/url_decode_uni.cc @@ -39,8 +39,8 @@ namespace transformations { void UrlDecodeUni::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; input = reinterpret_cast diff --git a/src/actions/transformations/url_decode_uni.h b/src/actions/transformations/url_decode_uni.h index 4ffbcc6a..4b739919 100644 --- a/src/actions/transformations/url_decode_uni.h +++ b/src/actions/transformations/url_decode_uni.h @@ -35,8 +35,8 @@ class UrlDecodeUni : public Transformation { : Transformation(action) { } void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static int inplace(unsigned char *input, uint64_t input_len, Transaction *transaction); diff --git a/src/actions/transformations/url_encode.cc b/src/actions/transformations/url_encode.cc index 6bfc3463..aa722883 100644 --- a/src/actions/transformations/url_encode.cc +++ b/src/actions/transformations/url_encode.cc @@ -82,8 +82,8 @@ std::string UrlEncode::url_enc(const char *input, void UrlEncode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { int changed; std::string ret = url_enc(in.c_str(), in.size(), &changed); diff --git a/src/actions/transformations/url_encode.h b/src/actions/transformations/url_encode.h index 85217bd4..d4d23e63 100644 --- a/src/actions/transformations/url_encode.h +++ b/src/actions/transformations/url_encode.h @@ -34,8 +34,8 @@ class UrlEncode : public Transformation { : Transformation(action) { }; void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static std::string url_enc(const char *input, unsigned int input_len, int *changed); diff --git a/src/actions/transformations/utf8_to_unicode.cc b/src/actions/transformations/utf8_to_unicode.cc index d979be38..ab848f4e 100644 --- a/src/actions/transformations/utf8_to_unicode.cc +++ b/src/actions/transformations/utf8_to_unicode.cc @@ -34,8 +34,8 @@ namespace transformations { void Utf8ToUnicode::execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) { + ModSecString &in, + ModSecString &out) { unsigned char *input; int changed = 0; diff --git a/src/actions/transformations/utf8_to_unicode.h b/src/actions/transformations/utf8_to_unicode.h index 5bb9bd15..ffc863bc 100644 --- a/src/actions/transformations/utf8_to_unicode.h +++ b/src/actions/transformations/utf8_to_unicode.h @@ -40,8 +40,8 @@ class Utf8ToUnicode : public Transformation { void execute(Transaction *t, - ModSecStackString &in, - ModSecStackString &out) override; + ModSecString &in, + ModSecString &out) override; static char *inplace(unsigned char *input, uint64_t input_len, int *changed); diff --git a/src/actions/ver.cc b/src/actions/ver.cc index e967b1c9..caf3d08b 100644 --- a/src/actions/ver.cc +++ b/src/actions/ver.cc @@ -21,6 +21,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" +#include "modsecurity/rule_with_actions.h" namespace modsecurity { diff --git a/src/engine/lua.cc b/src/engine/lua.cc index 9a109554..d8b68b5f 100644 --- a/src/engine/lua.cc +++ b/src/engine/lua.cc @@ -439,8 +439,8 @@ std::string Lua::applyTransformations(lua_State *L, Transaction *t, "t:" + std::string(name)); // FIXME: transformation is not yet returning null. if (tfn) { - ModSecStackString in; - ModSecStackString out; + ModSecString in; + ModSecString out; in.assign(newVar.c_str(), newVar.size()); tfn->execute(t, in, out); newVar.assign(out.c_str(), out.size()); @@ -465,8 +465,8 @@ std::string Lua::applyTransformations(lua_State *L, Transaction *t, // FIXME: transformation is not yet returning null. if (tfn) { - ModSecStackString in; - ModSecStackString out; + ModSecString in; + ModSecString out; in.assign(newVar.c_str(), newVar.size()); tfn->execute(t, in, out); newVar.assign(out.c_str(), out.size()); diff --git a/src/modsecurity.cc b/src/modsecurity.cc index 165cb3ba..14bc3b46 100644 --- a/src/modsecurity.cc +++ b/src/modsecurity.cc @@ -305,8 +305,8 @@ int ModSecurity::processContentOffset(const char *content, size_t len, while (!trans.empty()) { modsecurity::actions::transformations::Transformation *t; - ModSecStackString in; - ModSecStackString out; + ModSecString in; + ModSecString out; yajl_gen_map_open(g); yajl_gen_string(g, diff --git a/src/operators/detect_sqli.cc b/src/operators/detect_sqli.cc index 232ef9f4..b79e0a0b 100644 --- a/src/operators/detect_sqli.cc +++ b/src/operators/detect_sqli.cc @@ -20,6 +20,8 @@ #include "src/operators/operator.h" #include "others/libinjection/src/libinjection.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace operators { diff --git a/src/operators/detect_xss.cc b/src/operators/detect_xss.cc index d2543dd3..af5e57ab 100644 --- a/src/operators/detect_xss.cc +++ b/src/operators/detect_xss.cc @@ -19,6 +19,7 @@ #include "src/operators/operator.h" #include "others/libinjection/src/libinjection.h" +#include "modsecurity/rule_with_actions.h" namespace modsecurity { diff --git a/src/operators/pm.cc b/src/operators/pm.cc index 5622df69..b673efac 100644 --- a/src/operators/pm.cc +++ b/src/operators/pm.cc @@ -28,6 +28,8 @@ #include "src/operators/operator.h" #include "src/utils/acmp.h" #include "src/utils/string.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace operators { diff --git a/src/operators/rbl.cc b/src/operators/rbl.cc index 0936fff3..0628dc18 100644 --- a/src/operators/rbl.cc +++ b/src/operators/rbl.cc @@ -25,6 +25,8 @@ #include "modsecurity/rules_set.h" #include "src/operators/operator.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace operators { diff --git a/src/operators/rx.cc b/src/operators/rx.cc index 7ee1ea10..bedf9ac1 100644 --- a/src/operators/rx.cc +++ b/src/operators/rx.cc @@ -22,6 +22,8 @@ #include "src/operators/operator.h" #include "modsecurity/rule.h" #include "modsecurity/rule_message.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace operators { diff --git a/src/operators/verify_cc.cc b/src/operators/verify_cc.cc index a21eb509..2ca93199 100644 --- a/src/operators/verify_cc.cc +++ b/src/operators/verify_cc.cc @@ -21,6 +21,8 @@ #include #include "src/operators/operator.h" +#include "modsecurity/rule_with_actions.h" + #if PCRE_HAVE_JIT #define pcre_study_opt PCRE_STUDY_JIT_COMPILE diff --git a/src/operators/verify_cpf.cc b/src/operators/verify_cpf.cc index f5d5a140..edac33a9 100644 --- a/src/operators/verify_cpf.cc +++ b/src/operators/verify_cpf.cc @@ -19,6 +19,8 @@ #include #include "src/operators/operator.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace operators { diff --git a/src/operators/verify_ssn.cc b/src/operators/verify_ssn.cc index e65520a7..3a5a69d9 100644 --- a/src/operators/verify_ssn.cc +++ b/src/operators/verify_ssn.cc @@ -20,6 +20,8 @@ #include #include "src/operators/operator.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace operators { diff --git a/src/operators/verify_svnr.cc b/src/operators/verify_svnr.cc index f9f4174c..075c5989 100644 --- a/src/operators/verify_svnr.cc +++ b/src/operators/verify_svnr.cc @@ -9,6 +9,7 @@ #include "modsecurity/rule_message.h" #include "modsecurity/rules_set_properties.h" +#include "modsecurity/rule_with_actions.h" namespace modsecurity { namespace operators { diff --git a/src/parser/seclang-parser.cc b/src/parser/seclang-parser.cc index 674ec6fe..5d638872 100644 --- a/src/parser/seclang-parser.cc +++ b/src/parser/seclang-parser.cc @@ -42,7 +42,7 @@ // Unqualified %code blocks. -#line 326 "seclang-parser.yy" +#line 328 "seclang-parser.yy" #include "src/parser/driver.h" @@ -1318,7 +1318,7 @@ namespace yy { // User initialization code. -#line 319 "seclang-parser.yy" +#line 321 "seclang-parser.yy" { // Initialize the initial location. yyla.location.begin.filename = yyla.location.end.filename = new std::string(driver.file); @@ -1690,7 +1690,7 @@ namespace yy { switch (yyn) { case 2: // input: "end of file" -#line 713 "seclang-parser.yy" +#line 715 "seclang-parser.yy" { return 0; } @@ -1698,7 +1698,7 @@ namespace yy { break; case 6: // audit_log: "CONFIG_DIR_AUDIT_DIR_MOD" -#line 726 "seclang-parser.yy" +#line 728 "seclang-parser.yy" { driver.m_auditLog->setStorageDirMode(strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8)); } @@ -1706,7 +1706,7 @@ namespace yy { break; case 7: // audit_log: "CONFIG_DIR_AUDIT_DIR" -#line 732 "seclang-parser.yy" +#line 734 "seclang-parser.yy" { driver.m_auditLog->setStorageDir(yystack_[0].value.as < std::string > ()); } @@ -1714,7 +1714,7 @@ namespace yy { break; case 8: // audit_log: "CONFIG_DIR_AUDIT_ENG" "CONFIG_VALUE_RELEVANT_ONLY" -#line 738 "seclang-parser.yy" +#line 740 "seclang-parser.yy" { driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::RelevantOnlyAuditLogStatus); } @@ -1722,7 +1722,7 @@ namespace yy { break; case 9: // audit_log: "CONFIG_DIR_AUDIT_ENG" "CONFIG_VALUE_OFF" -#line 742 "seclang-parser.yy" +#line 744 "seclang-parser.yy" { driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::OffAuditLogStatus); } @@ -1730,7 +1730,7 @@ namespace yy { break; case 10: // audit_log: "CONFIG_DIR_AUDIT_ENG" "CONFIG_VALUE_ON" -#line 746 "seclang-parser.yy" +#line 748 "seclang-parser.yy" { driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::OnAuditLogStatus); } @@ -1738,7 +1738,7 @@ namespace yy { break; case 11: // audit_log: "CONFIG_DIR_AUDIT_FLE_MOD" -#line 752 "seclang-parser.yy" +#line 754 "seclang-parser.yy" { driver.m_auditLog->setFileMode(strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8)); } @@ -1746,7 +1746,7 @@ namespace yy { break; case 12: // audit_log: "CONFIG_DIR_AUDIT_LOG2" -#line 758 "seclang-parser.yy" +#line 760 "seclang-parser.yy" { driver.m_auditLog->setFilePath2(yystack_[0].value.as < std::string > ()); } @@ -1754,7 +1754,7 @@ namespace yy { break; case 13: // audit_log: "CONFIG_DIR_AUDIT_LOG_P" -#line 764 "seclang-parser.yy" +#line 766 "seclang-parser.yy" { driver.m_auditLog->setParts(yystack_[0].value.as < std::string > ()); } @@ -1762,7 +1762,7 @@ namespace yy { break; case 14: // audit_log: "CONFIG_DIR_AUDIT_LOG" -#line 770 "seclang-parser.yy" +#line 772 "seclang-parser.yy" { driver.m_auditLog->setFilePath1(yystack_[0].value.as < std::string > ()); } @@ -1770,7 +1770,7 @@ namespace yy { break; case 15: // audit_log: CONFIG_DIR_AUDIT_LOG_FMT JSON -#line 775 "seclang-parser.yy" +#line 777 "seclang-parser.yy" { driver.m_auditLog->setFormat(modsecurity::audit_log::AuditLog::JSONAuditLogFormat); } @@ -1778,7 +1778,7 @@ namespace yy { break; case 16: // audit_log: CONFIG_DIR_AUDIT_LOG_FMT NATIVE -#line 780 "seclang-parser.yy" +#line 782 "seclang-parser.yy" { driver.m_auditLog->setFormat(modsecurity::audit_log::AuditLog::NativeAuditLogFormat); } @@ -1786,7 +1786,7 @@ namespace yy { break; case 17: // audit_log: "CONFIG_DIR_AUDIT_STS" -#line 786 "seclang-parser.yy" +#line 788 "seclang-parser.yy" { std::string relevant_status(yystack_[0].value.as < std::string > ()); driver.m_auditLog->setRelevantStatus(relevant_status); @@ -1795,7 +1795,7 @@ namespace yy { break; case 18: // audit_log: "CONFIG_DIR_AUDIT_TPE" "CONFIG_VALUE_SERIAL" -#line 793 "seclang-parser.yy" +#line 795 "seclang-parser.yy" { driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::SerialAuditLogType); } @@ -1803,7 +1803,7 @@ namespace yy { break; case 19: // audit_log: "CONFIG_DIR_AUDIT_TPE" "CONFIG_VALUE_PARALLEL" -#line 797 "seclang-parser.yy" +#line 799 "seclang-parser.yy" { driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::ParallelAuditLogType); } @@ -1811,7 +1811,7 @@ namespace yy { break; case 20: // audit_log: "CONFIG_DIR_AUDIT_TPE" "CONFIG_VALUE_HTTPS" -#line 801 "seclang-parser.yy" +#line 803 "seclang-parser.yy" { driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::HttpsAuditLogType); } @@ -1819,7 +1819,7 @@ namespace yy { break; case 21: // audit_log: "CONFIG_UPDLOAD_KEEP_FILES" "CONFIG_VALUE_ON" -#line 807 "seclang-parser.yy" +#line 809 "seclang-parser.yy" { driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -1827,7 +1827,7 @@ namespace yy { break; case 22: // audit_log: "CONFIG_UPDLOAD_KEEP_FILES" "CONFIG_VALUE_OFF" -#line 811 "seclang-parser.yy" +#line 813 "seclang-parser.yy" { driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -1835,7 +1835,7 @@ namespace yy { break; case 23: // audit_log: "CONFIG_UPDLOAD_KEEP_FILES" "CONFIG_VALUE_RELEVANT_ONLY" -#line 815 "seclang-parser.yy" +#line 817 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecUploadKeepFiles RelevantOnly is not currently supported. Accepted values are On or Off"); YYERROR; @@ -1844,7 +1844,7 @@ namespace yy { break; case 24: // audit_log: "CONFIG_UPLOAD_FILE_LIMIT" -#line 820 "seclang-parser.yy" +#line 822 "seclang-parser.yy" { driver.m_uploadFileLimit.m_set = true; driver.m_uploadFileLimit.m_value = strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 10); @@ -1853,7 +1853,7 @@ namespace yy { break; case 25: // audit_log: "CONFIG_UPLOAD_FILE_MODE" -#line 825 "seclang-parser.yy" +#line 827 "seclang-parser.yy" { driver.m_uploadFileMode.m_set = true; driver.m_uploadFileMode.m_value = strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8); @@ -1862,7 +1862,7 @@ namespace yy { break; case 26: // audit_log: "CONFIG_UPLOAD_DIR" -#line 830 "seclang-parser.yy" +#line 832 "seclang-parser.yy" { driver.m_uploadDirectory.m_set = true; driver.m_uploadDirectory.m_value = yystack_[0].value.as < std::string > (); @@ -1871,7 +1871,7 @@ namespace yy { break; case 27: // audit_log: "CONFIG_UPDLOAD_SAVE_TMP_FILES" "CONFIG_VALUE_ON" -#line 835 "seclang-parser.yy" +#line 837 "seclang-parser.yy" { driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -1879,7 +1879,7 @@ namespace yy { break; case 28: // audit_log: "CONFIG_UPDLOAD_SAVE_TMP_FILES" "CONFIG_VALUE_OFF" -#line 839 "seclang-parser.yy" +#line 841 "seclang-parser.yy" { driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -1887,7 +1887,7 @@ namespace yy { break; case 29: // actions: "QUOTATION_MARK" actions_may_quoted "QUOTATION_MARK" -#line 846 "seclang-parser.yy" +#line 848 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[1].value.as < std::unique_ptr > > > ()); } @@ -1895,7 +1895,7 @@ namespace yy { break; case 30: // actions: actions_may_quoted -#line 850 "seclang-parser.yy" +#line 852 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[0].value.as < std::unique_ptr > > > ()); } @@ -1903,7 +1903,7 @@ namespace yy { break; case 31: // actions_may_quoted: actions_may_quoted "," act -#line 857 "seclang-parser.yy" +#line 859 "seclang-parser.yy" { ACTION_INIT(yystack_[0].value.as < std::unique_ptr > (), yystack_[3].location) yystack_[2].value.as < std::unique_ptr > > > ()->push_back(std::move(yystack_[0].value.as < std::unique_ptr > ())); @@ -1913,7 +1913,7 @@ namespace yy { break; case 32: // actions_may_quoted: act -#line 863 "seclang-parser.yy" +#line 865 "seclang-parser.yy" { std::unique_ptr>> b(new std::vector>()); ACTION_INIT(yystack_[0].value.as < std::unique_ptr > (), yystack_[1].location) @@ -1924,7 +1924,7 @@ namespace yy { break; case 33: // op: op_before_init -#line 873 "seclang-parser.yy" +#line 875 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); std::string error; @@ -1937,7 +1937,7 @@ namespace yy { break; case 34: // op: "NOT" op_before_init -#line 882 "seclang-parser.yy" +#line 884 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); yylhs.value.as < std::unique_ptr > ()->m_negation = true; @@ -1951,7 +1951,7 @@ namespace yy { break; case 35: // op: run_time_string -#line 892 "seclang-parser.yy" +#line 894 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ()))); std::string error; @@ -1964,7 +1964,7 @@ namespace yy { break; case 36: // op: "NOT" run_time_string -#line 901 "seclang-parser.yy" +#line 903 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ()))); yylhs.value.as < std::unique_ptr > ()->m_negation = true; @@ -1978,7 +1978,7 @@ namespace yy { break; case 37: // op_before_init: "OPERATOR_UNCONDITIONAL_MATCH" -#line 914 "seclang-parser.yy" +#line 916 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::UnconditionalMatch()); } @@ -1986,7 +1986,7 @@ namespace yy { break; case 38: // op_before_init: "OPERATOR_DETECT_SQLI" -#line 918 "seclang-parser.yy" +#line 920 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::DetectSQLi()); } @@ -1994,7 +1994,7 @@ namespace yy { break; case 39: // op_before_init: "OPERATOR_DETECT_XSS" -#line 922 "seclang-parser.yy" +#line 924 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::DetectXSS()); } @@ -2002,7 +2002,7 @@ namespace yy { break; case 40: // op_before_init: "OPERATOR_VALIDATE_URL_ENCODING" -#line 926 "seclang-parser.yy" +#line 928 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateUrlEncoding()); } @@ -2010,7 +2010,7 @@ namespace yy { break; case 41: // op_before_init: "OPERATOR_VALIDATE_UTF8_ENCODING" -#line 930 "seclang-parser.yy" +#line 932 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateUtf8Encoding()); } @@ -2018,7 +2018,7 @@ namespace yy { break; case 42: // op_before_init: "OPERATOR_INSPECT_FILE" run_time_string -#line 934 "seclang-parser.yy" +#line 936 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::InspectFile(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2026,7 +2026,7 @@ namespace yy { break; case 43: // op_before_init: "OPERATOR_FUZZY_HASH" run_time_string -#line 938 "seclang-parser.yy" +#line 940 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::FuzzyHash(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2034,7 +2034,7 @@ namespace yy { break; case 44: // op_before_init: "OPERATOR_VALIDATE_BYTE_RANGE" run_time_string -#line 942 "seclang-parser.yy" +#line 944 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateByteRange(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2042,7 +2042,7 @@ namespace yy { break; case 45: // op_before_init: "OPERATOR_VALIDATE_DTD" run_time_string -#line 946 "seclang-parser.yy" +#line 948 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateDTD(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2050,7 +2050,7 @@ namespace yy { break; case 46: // op_before_init: "OPERATOR_VALIDATE_HASH" run_time_string -#line 950 "seclang-parser.yy" +#line 952 "seclang-parser.yy" { /* $$ = new operators::ValidateHash($1); */ OPERATOR_NOT_SUPPORTED("ValidateHash", yystack_[2].location); @@ -2059,7 +2059,7 @@ namespace yy { break; case 47: // op_before_init: "OPERATOR_VALIDATE_SCHEMA" run_time_string -#line 955 "seclang-parser.yy" +#line 957 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateSchema(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2067,7 +2067,7 @@ namespace yy { break; case 48: // op_before_init: "OPERATOR_VERIFY_CC" run_time_string -#line 959 "seclang-parser.yy" +#line 961 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifyCC(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2075,7 +2075,7 @@ namespace yy { break; case 49: // op_before_init: "OPERATOR_VERIFY_CPF" run_time_string -#line 963 "seclang-parser.yy" +#line 965 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifyCPF(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2083,7 +2083,7 @@ namespace yy { break; case 50: // op_before_init: "OPERATOR_VERIFY_SSN" run_time_string -#line 967 "seclang-parser.yy" +#line 969 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifySSN(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2091,7 +2091,7 @@ namespace yy { break; case 51: // op_before_init: "OPERATOR_VERIFY_SVNR" run_time_string -#line 971 "seclang-parser.yy" +#line 973 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifySVNR(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2099,7 +2099,7 @@ namespace yy { break; case 52: // op_before_init: "OPERATOR_GSB_LOOKUP" run_time_string -#line 975 "seclang-parser.yy" +#line 977 "seclang-parser.yy" { /* $$ = new operators::GsbLookup($1); */ OPERATOR_NOT_SUPPORTED("GsbLookup", yystack_[2].location); @@ -2108,7 +2108,7 @@ namespace yy { break; case 53: // op_before_init: "OPERATOR_RSUB" run_time_string -#line 980 "seclang-parser.yy" +#line 982 "seclang-parser.yy" { /* $$ = new operators::Rsub($1); */ OPERATOR_NOT_SUPPORTED("Rsub", yystack_[2].location); @@ -2117,7 +2117,7 @@ namespace yy { break; case 54: // op_before_init: "OPERATOR_WITHIN" run_time_string -#line 985 "seclang-parser.yy" +#line 987 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Within(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2125,7 +2125,7 @@ namespace yy { break; case 55: // op_before_init: "OPERATOR_CONTAINS_WORD" run_time_string -#line 989 "seclang-parser.yy" +#line 991 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ContainsWord(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2133,7 +2133,7 @@ namespace yy { break; case 56: // op_before_init: "OPERATOR_CONTAINS" run_time_string -#line 993 "seclang-parser.yy" +#line 995 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Contains(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2141,7 +2141,7 @@ namespace yy { break; case 57: // op_before_init: "OPERATOR_ENDS_WITH" run_time_string -#line 997 "seclang-parser.yy" +#line 999 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::EndsWith(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2149,7 +2149,7 @@ namespace yy { break; case 58: // op_before_init: "OPERATOR_EQ" run_time_string -#line 1001 "seclang-parser.yy" +#line 1003 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Eq(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2157,7 +2157,7 @@ namespace yy { break; case 59: // op_before_init: "OPERATOR_GE" run_time_string -#line 1005 "seclang-parser.yy" +#line 1007 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Ge(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2165,7 +2165,7 @@ namespace yy { break; case 60: // op_before_init: "OPERATOR_GT" run_time_string -#line 1009 "seclang-parser.yy" +#line 1011 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Gt(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2173,7 +2173,7 @@ namespace yy { break; case 61: // op_before_init: "OPERATOR_IP_MATCH_FROM_FILE" run_time_string -#line 1013 "seclang-parser.yy" +#line 1015 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::IpMatchF(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2181,7 +2181,7 @@ namespace yy { break; case 62: // op_before_init: "OPERATOR_IP_MATCH" run_time_string -#line 1017 "seclang-parser.yy" +#line 1019 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::IpMatch(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2189,7 +2189,7 @@ namespace yy { break; case 63: // op_before_init: "OPERATOR_LE" run_time_string -#line 1021 "seclang-parser.yy" +#line 1023 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Le(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2197,7 +2197,7 @@ namespace yy { break; case 64: // op_before_init: "OPERATOR_LT" run_time_string -#line 1025 "seclang-parser.yy" +#line 1027 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Lt(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2205,7 +2205,7 @@ namespace yy { break; case 65: // op_before_init: "OPERATOR_PM_FROM_FILE" run_time_string -#line 1029 "seclang-parser.yy" +#line 1031 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::PmFromFile(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2213,7 +2213,7 @@ namespace yy { break; case 66: // op_before_init: "OPERATOR_PM" run_time_string -#line 1033 "seclang-parser.yy" +#line 1035 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Pm(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2221,7 +2221,7 @@ namespace yy { break; case 67: // op_before_init: "OPERATOR_RBL" run_time_string -#line 1037 "seclang-parser.yy" +#line 1039 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rbl(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2229,7 +2229,7 @@ namespace yy { break; case 68: // op_before_init: "OPERATOR_RX" run_time_string -#line 1041 "seclang-parser.yy" +#line 1043 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2237,7 +2237,7 @@ namespace yy { break; case 69: // op_before_init: "OPERATOR_RX_GLOBAL" run_time_string -#line 1045 "seclang-parser.yy" +#line 1047 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::RxGlobal(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2245,7 +2245,7 @@ namespace yy { break; case 70: // op_before_init: "OPERATOR_STR_EQ" run_time_string -#line 1049 "seclang-parser.yy" +#line 1051 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::StrEq(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2253,7 +2253,7 @@ namespace yy { break; case 71: // op_before_init: "OPERATOR_STR_MATCH" run_time_string -#line 1053 "seclang-parser.yy" +#line 1055 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::StrMatch(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2261,7 +2261,7 @@ namespace yy { break; case 72: // op_before_init: "OPERATOR_BEGINS_WITH" run_time_string -#line 1057 "seclang-parser.yy" +#line 1059 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::BeginsWith(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2269,7 +2269,7 @@ namespace yy { break; case 73: // op_before_init: "OPERATOR_GEOLOOKUP" -#line 1061 "seclang-parser.yy" +#line 1063 "seclang-parser.yy" { #if defined(WITH_GEOIP) or defined(WITH_MAXMIND) OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::GeoLookup()); @@ -2284,7 +2284,7 @@ namespace yy { break; case 75: // expression: "DIRECTIVE" variables op actions -#line 1076 "seclang-parser.yy" +#line 1078 "seclang-parser.yy" { std::vector *a = new std::vector(); std::vector > *t = new std::vector >(); @@ -2320,7 +2320,7 @@ namespace yy { break; case 76: // expression: "DIRECTIVE" variables op -#line 1108 "seclang-parser.yy" +#line 1110 "seclang-parser.yy" { variables::Variables *v = new variables::Variables(); for (auto &i : *yystack_[1].value.as < std::unique_ptr > > > ().get()) { @@ -2343,7 +2343,7 @@ namespace yy { break; case 77: // expression: "CONFIG_DIR_SEC_ACTION" actions -#line 1127 "seclang-parser.yy" +#line 1129 "seclang-parser.yy" { std::vector *a = new std::vector(); std::vector > *t = new std::vector >(); @@ -2368,7 +2368,7 @@ namespace yy { break; case 78: // expression: "DIRECTIVE_SECRULESCRIPT" actions -#line 1148 "seclang-parser.yy" +#line 1150 "seclang-parser.yy" { std::string err; std::vector *a = new std::vector(); @@ -2402,7 +2402,7 @@ namespace yy { break; case 79: // expression: "CONFIG_DIR_SEC_DEFAULT_ACTION" actions -#line 1178 "seclang-parser.yy" +#line 1180 "seclang-parser.yy" { bool hasDisruptive = false; std::vector *actions = new std::vector(); @@ -2421,8 +2421,8 @@ namespace yy { definedPhase = phase->m_phase; secRuleDefinedPhase = phase->m_secRulesPhase; delete phase; - } else if (a->action_kind == actions::Action::RunTimeOnlyIfMatchKind || - a->action_kind == actions::Action::RunTimeBeforeMatchAttemptKind) { + } else if (a->m_actionKind == actions::Action::RunTimeOnlyIfMatchKind || + a->m_actionKind == actions::Action::RunTimeBeforeMatchAttemptKind) { actions::transformations::None *none = dynamic_cast(a); if (none != NULL) { driver.error(yystack_[2].location, "The transformation none is not suitable to be part of the SecDefaultActions"); @@ -2468,7 +2468,7 @@ namespace yy { break; case 80: // expression: "CONFIG_DIR_SEC_MARKER" -#line 1240 "seclang-parser.yy" +#line 1242 "seclang-parser.yy" { driver.addSecMarker(modsecurity::utils::string::removeBracketsIfNeeded(yystack_[0].value.as < std::string > ()), /* file name */ std::unique_ptr(new std::string(*yystack_[0].location.end.filename)), @@ -2479,7 +2479,7 @@ namespace yy { break; case 81: // expression: "CONFIG_DIR_RULE_ENG" "CONFIG_VALUE_OFF" -#line 1247 "seclang-parser.yy" +#line 1249 "seclang-parser.yy" { driver.m_secRuleEngine = modsecurity::RulesSet::DisabledRuleEngine; } @@ -2487,7 +2487,7 @@ namespace yy { break; case 82: // expression: "CONFIG_DIR_RULE_ENG" "CONFIG_VALUE_ON" -#line 1251 "seclang-parser.yy" +#line 1253 "seclang-parser.yy" { driver.m_secRuleEngine = modsecurity::RulesSet::EnabledRuleEngine; } @@ -2495,7 +2495,7 @@ namespace yy { break; case 83: // expression: "CONFIG_DIR_RULE_ENG" "CONFIG_VALUE_DETC" -#line 1255 "seclang-parser.yy" +#line 1257 "seclang-parser.yy" { driver.m_secRuleEngine = modsecurity::RulesSet::DetectionOnlyRuleEngine; } @@ -2503,7 +2503,7 @@ namespace yy { break; case 84: // expression: "CONFIG_DIR_REQ_BODY" "CONFIG_VALUE_ON" -#line 1259 "seclang-parser.yy" +#line 1261 "seclang-parser.yy" { driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -2511,7 +2511,7 @@ namespace yy { break; case 85: // expression: "CONFIG_DIR_REQ_BODY" "CONFIG_VALUE_OFF" -#line 1263 "seclang-parser.yy" +#line 1265 "seclang-parser.yy" { driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -2519,7 +2519,7 @@ namespace yy { break; case 86: // expression: "CONFIG_DIR_RES_BODY" "CONFIG_VALUE_ON" -#line 1267 "seclang-parser.yy" +#line 1269 "seclang-parser.yy" { driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -2527,7 +2527,7 @@ namespace yy { break; case 87: // expression: "CONFIG_DIR_RES_BODY" "CONFIG_VALUE_OFF" -#line 1271 "seclang-parser.yy" +#line 1273 "seclang-parser.yy" { driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -2535,7 +2535,7 @@ namespace yy { break; case 88: // expression: "CONFIG_SEC_ARGUMENT_SEPARATOR" -#line 1275 "seclang-parser.yy" +#line 1277 "seclang-parser.yy" { if (yystack_[0].value.as < std::string > ().length() != 1) { driver.error(yystack_[1].location, "Argument separator should be set to a single character."); @@ -2548,7 +2548,7 @@ namespace yy { break; case 89: // expression: "CONFIG_COMPONENT_SIG" -#line 1284 "seclang-parser.yy" +#line 1286 "seclang-parser.yy" { driver.m_components.push_back(yystack_[0].value.as < std::string > ()); } @@ -2556,7 +2556,7 @@ namespace yy { break; case 90: // expression: "CONFIG_CONN_ENGINE" "CONFIG_VALUE_ON" -#line 1288 "seclang-parser.yy" +#line 1290 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecConnEngine is not yet supported."); YYERROR; @@ -2565,14 +2565,14 @@ namespace yy { break; case 91: // expression: "CONFIG_CONN_ENGINE" "CONFIG_VALUE_OFF" -#line 1293 "seclang-parser.yy" +#line 1295 "seclang-parser.yy" { } #line 2572 "seclang-parser.cc" break; case 92: // expression: "CONFIG_SEC_WEB_APP_ID" -#line 1296 "seclang-parser.yy" +#line 1298 "seclang-parser.yy" { driver.m_secWebAppId.m_value = yystack_[0].value.as < std::string > (); driver.m_secWebAppId.m_set = true; @@ -2581,7 +2581,7 @@ namespace yy { break; case 93: // expression: "CONFIG_SEC_SERVER_SIG" -#line 1301 "seclang-parser.yy" +#line 1303 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecServerSignature is not supported."); YYERROR; @@ -2590,7 +2590,7 @@ namespace yy { break; case 94: // expression: "CONFIG_SEC_CACHE_TRANSFORMATIONS" -#line 1306 "seclang-parser.yy" +#line 1308 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecCacheTransformations is not supported."); YYERROR; @@ -2599,7 +2599,7 @@ namespace yy { break; case 95: // expression: "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" "CONFIG_VALUE_ON" -#line 1311 "seclang-parser.yy" +#line 1313 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecDisableBackendCompression is not supported."); YYERROR; @@ -2608,14 +2608,14 @@ namespace yy { break; case 96: // expression: "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" "CONFIG_VALUE_OFF" -#line 1316 "seclang-parser.yy" +#line 1318 "seclang-parser.yy" { } #line 2615 "seclang-parser.cc" break; case 97: // expression: "CONFIG_CONTENT_INJECTION" "CONFIG_VALUE_ON" -#line 1319 "seclang-parser.yy" +#line 1321 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecContentInjection is not yet supported."); YYERROR; @@ -2624,14 +2624,14 @@ namespace yy { break; case 98: // expression: "CONFIG_CONTENT_INJECTION" "CONFIG_VALUE_OFF" -#line 1324 "seclang-parser.yy" +#line 1326 "seclang-parser.yy" { } #line 2631 "seclang-parser.cc" break; case 99: // expression: "CONFIG_SEC_CHROOT_DIR" -#line 1327 "seclang-parser.yy" +#line 1329 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecChrootDir is not supported."); YYERROR; @@ -2640,7 +2640,7 @@ namespace yy { break; case 100: // expression: "CONFIG_SEC_HASH_ENGINE" "CONFIG_VALUE_ON" -#line 1332 "seclang-parser.yy" +#line 1334 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecHashEngine is not yet supported."); YYERROR; @@ -2649,14 +2649,14 @@ namespace yy { break; case 101: // expression: "CONFIG_SEC_HASH_ENGINE" "CONFIG_VALUE_OFF" -#line 1337 "seclang-parser.yy" +#line 1339 "seclang-parser.yy" { } #line 2656 "seclang-parser.cc" break; case 102: // expression: "CONFIG_SEC_HASH_KEY" -#line 1340 "seclang-parser.yy" +#line 1342 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecHashKey is not yet supported."); YYERROR; @@ -2665,7 +2665,7 @@ namespace yy { break; case 103: // expression: "CONFIG_SEC_HASH_PARAM" -#line 1345 "seclang-parser.yy" +#line 1347 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecHashParam is not yet supported."); YYERROR; @@ -2674,7 +2674,7 @@ namespace yy { break; case 104: // expression: "CONFIG_SEC_HASH_METHOD_RX" -#line 1350 "seclang-parser.yy" +#line 1352 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecHashMethodRx is not yet supported."); YYERROR; @@ -2683,7 +2683,7 @@ namespace yy { break; case 105: // expression: "CONFIG_SEC_HASH_METHOD_PM" -#line 1355 "seclang-parser.yy" +#line 1357 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecHashMethodPm is not yet supported."); YYERROR; @@ -2692,7 +2692,7 @@ namespace yy { break; case 106: // expression: "CONFIG_DIR_GSB_DB" -#line 1360 "seclang-parser.yy" +#line 1362 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecGsbLookupDb is not supported."); YYERROR; @@ -2701,7 +2701,7 @@ namespace yy { break; case 107: // expression: "CONFIG_SEC_GUARDIAN_LOG" -#line 1365 "seclang-parser.yy" +#line 1367 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecGuardianLog is not supported."); YYERROR; @@ -2710,7 +2710,7 @@ namespace yy { break; case 108: // expression: "CONFIG_SEC_INTERCEPT_ON_ERROR" "CONFIG_VALUE_ON" -#line 1370 "seclang-parser.yy" +#line 1372 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecInterceptOnError is not yet supported."); YYERROR; @@ -2719,14 +2719,14 @@ namespace yy { break; case 109: // expression: "CONFIG_SEC_INTERCEPT_ON_ERROR" "CONFIG_VALUE_OFF" -#line 1375 "seclang-parser.yy" +#line 1377 "seclang-parser.yy" { } #line 2726 "seclang-parser.cc" break; case 110: // expression: "CONFIG_SEC_CONN_R_STATE_LIMIT" -#line 1378 "seclang-parser.yy" +#line 1380 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecConnReadStateLimit is not yet supported."); YYERROR; @@ -2735,7 +2735,7 @@ namespace yy { break; case 111: // expression: "CONFIG_SEC_CONN_W_STATE_LIMIT" -#line 1383 "seclang-parser.yy" +#line 1385 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecConnWriteStateLimit is not yet supported."); YYERROR; @@ -2744,7 +2744,7 @@ namespace yy { break; case 112: // expression: "CONFIG_SEC_SENSOR_ID" -#line 1388 "seclang-parser.yy" +#line 1390 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecSensorId is not yet supported."); YYERROR; @@ -2753,7 +2753,7 @@ namespace yy { break; case 113: // expression: "CONFIG_SEC_RULE_INHERITANCE" "CONFIG_VALUE_ON" -#line 1393 "seclang-parser.yy" +#line 1395 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecRuleInheritance is not yet supported."); YYERROR; @@ -2762,14 +2762,14 @@ namespace yy { break; case 114: // expression: "CONFIG_SEC_RULE_INHERITANCE" "CONFIG_VALUE_OFF" -#line 1398 "seclang-parser.yy" +#line 1400 "seclang-parser.yy" { } #line 2769 "seclang-parser.cc" break; case 115: // expression: "CONFIG_SEC_RULE_PERF_TIME" -#line 1401 "seclang-parser.yy" +#line 1403 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecRulePerfTime is not yet supported."); YYERROR; @@ -2778,7 +2778,7 @@ namespace yy { break; case 116: // expression: "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" -#line 1406 "seclang-parser.yy" +#line 1408 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecStreamInBodyInspection is not supported."); YYERROR; @@ -2787,7 +2787,7 @@ namespace yy { break; case 117: // expression: "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" -#line 1411 "seclang-parser.yy" +#line 1413 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecStreamOutBodyInspection is not supported."); YYERROR; @@ -2796,7 +2796,7 @@ namespace yy { break; case 118: // expression: "CONFIG_SEC_RULE_REMOVE_BY_ID" -#line 1416 "seclang-parser.yy" +#line 1418 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.load(yystack_[0].value.as < std::string > (), &error) == false) { @@ -2813,7 +2813,7 @@ namespace yy { break; case 119: // expression: "CONFIG_SEC_RULE_REMOVE_BY_TAG" -#line 1429 "seclang-parser.yy" +#line 1431 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.loadRemoveRuleByTag(yystack_[0].value.as < std::string > (), &error) == false) { @@ -2830,7 +2830,7 @@ namespace yy { break; case 120: // expression: "CONFIG_SEC_RULE_REMOVE_BY_MSG" -#line 1442 "seclang-parser.yy" +#line 1444 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.loadRemoveRuleByMsg(yystack_[0].value.as < std::string > (), &error) == false) { @@ -2847,7 +2847,7 @@ namespace yy { break; case 121: // expression: "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" variables_pre_process -#line 1455 "seclang-parser.yy" +#line 1457 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.loadUpdateTargetByTag(yystack_[1].value.as < std::string > (), std::move(yystack_[0].value.as < std::unique_ptr > > > ()), &error) == false) { @@ -2864,7 +2864,7 @@ namespace yy { break; case 122: // expression: "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" variables_pre_process -#line 1468 "seclang-parser.yy" +#line 1470 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.loadUpdateTargetByMsg(yystack_[1].value.as < std::string > (), std::move(yystack_[0].value.as < std::unique_ptr > > > ()), &error) == false) { @@ -2881,7 +2881,7 @@ namespace yy { break; case 123: // expression: "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" variables_pre_process -#line 1481 "seclang-parser.yy" +#line 1483 "seclang-parser.yy" { std::string error; double ruleId; @@ -2911,7 +2911,7 @@ namespace yy { break; case 124: // expression: "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" actions -#line 1507 "seclang-parser.yy" +#line 1509 "seclang-parser.yy" { std::string error; double ruleId; @@ -2942,7 +2942,7 @@ namespace yy { break; case 125: // expression: "CONFIG_DIR_DEBUG_LVL" -#line 1535 "seclang-parser.yy" +#line 1537 "seclang-parser.yy" { if (driver.m_debugLog != NULL) { driver.m_debugLog->setDebugLogLevel(atoi(yystack_[0].value.as < std::string > ().c_str())); @@ -2958,7 +2958,7 @@ namespace yy { break; case 126: // expression: "CONFIG_DIR_DEBUG_LOG" -#line 1547 "seclang-parser.yy" +#line 1549 "seclang-parser.yy" { if (driver.m_debugLog != NULL) { std::string error; @@ -2981,7 +2981,7 @@ namespace yy { break; case 127: // expression: "CONFIG_DIR_GEO_DB" -#line 1567 "seclang-parser.yy" +#line 1569 "seclang-parser.yy" { #if defined(WITH_GEOIP) or defined(WITH_MAXMIND) std::string err; @@ -3012,7 +3012,7 @@ namespace yy { break; case 128: // expression: "CONFIG_DIR_ARGS_LIMIT" -#line 1594 "seclang-parser.yy" +#line 1596 "seclang-parser.yy" { driver.m_argumentsLimit.m_set = true; driver.m_argumentsLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); @@ -3021,7 +3021,7 @@ namespace yy { break; case 129: // expression: "CONFIG_DIR_REQ_BODY_LIMIT" -#line 1600 "seclang-parser.yy" +#line 1602 "seclang-parser.yy" { driver.m_requestBodyLimit.m_set = true; driver.m_requestBodyLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); @@ -3030,7 +3030,7 @@ namespace yy { break; case 130: // expression: "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" -#line 1605 "seclang-parser.yy" +#line 1607 "seclang-parser.yy" { driver.m_requestBodyNoFilesLimit.m_set = true; driver.m_requestBodyNoFilesLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); @@ -3039,7 +3039,7 @@ namespace yy { break; case 131: // expression: "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" -#line 1610 "seclang-parser.yy" +#line 1612 "seclang-parser.yy" { std::stringstream ss; ss << "As of ModSecurity version 3.0, SecRequestBodyInMemoryLimit is no longer "; @@ -3052,7 +3052,7 @@ namespace yy { break; case 132: // expression: "CONFIG_DIR_RES_BODY_LIMIT" -#line 1619 "seclang-parser.yy" +#line 1621 "seclang-parser.yy" { driver.m_responseBodyLimit.m_set = true; driver.m_responseBodyLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); @@ -3061,7 +3061,7 @@ namespace yy { break; case 133: // expression: "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" "CONFIG_VALUE_PROCESS_PARTIAL" -#line 1624 "seclang-parser.yy" +#line 1626 "seclang-parser.yy" { driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction; } @@ -3069,7 +3069,7 @@ namespace yy { break; case 134: // expression: "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" "CONFIG_VALUE_REJECT" -#line 1628 "seclang-parser.yy" +#line 1630 "seclang-parser.yy" { driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction; } @@ -3077,7 +3077,7 @@ namespace yy { break; case 135: // expression: "CONFIG_DIR_RES_BODY_LIMIT_ACTION" "CONFIG_VALUE_PROCESS_PARTIAL" -#line 1632 "seclang-parser.yy" +#line 1634 "seclang-parser.yy" { driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction; } @@ -3085,7 +3085,7 @@ namespace yy { break; case 136: // expression: "CONFIG_DIR_RES_BODY_LIMIT_ACTION" "CONFIG_VALUE_REJECT" -#line 1636 "seclang-parser.yy" +#line 1638 "seclang-parser.yy" { driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction; } @@ -3093,7 +3093,7 @@ namespace yy { break; case 137: // expression: "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" "CONFIG_VALUE_ABORT" -#line 1640 "seclang-parser.yy" +#line 1642 "seclang-parser.yy" { driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction; } @@ -3101,7 +3101,7 @@ namespace yy { break; case 138: // expression: "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" "CONFIG_VALUE_WARN" -#line 1644 "seclang-parser.yy" +#line 1646 "seclang-parser.yy" { driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction; } @@ -3109,7 +3109,7 @@ namespace yy { break; case 141: // expression: "CONGIG_DIR_RESPONSE_BODY_MP" -#line 1658 "seclang-parser.yy" +#line 1660 "seclang-parser.yy" { std::istringstream buf(yystack_[0].value.as < std::string > ()); std::istream_iterator beg(buf), end; @@ -3125,7 +3125,7 @@ namespace yy { break; case 142: // expression: "CONGIG_DIR_RESPONSE_BODY_MP_CLEAR" -#line 1670 "seclang-parser.yy" +#line 1672 "seclang-parser.yy" { driver.m_responseBodyTypeToBeInspected.m_set = true; driver.m_responseBodyTypeToBeInspected.m_clear = true; @@ -3135,7 +3135,7 @@ namespace yy { break; case 143: // expression: "CONFIG_XML_EXTERNAL_ENTITY" "CONFIG_VALUE_OFF" -#line 1676 "seclang-parser.yy" +#line 1678 "seclang-parser.yy" { driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -3143,7 +3143,7 @@ namespace yy { break; case 144: // expression: "CONFIG_XML_EXTERNAL_ENTITY" "CONFIG_VALUE_ON" -#line 1680 "seclang-parser.yy" +#line 1682 "seclang-parser.yy" { driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -3151,7 +3151,7 @@ namespace yy { break; case 145: // expression: "CONGIG_DIR_SEC_TMP_DIR" -#line 1684 "seclang-parser.yy" +#line 1686 "seclang-parser.yy" { /* Parser error disabled to avoid breaking default installations with modsecurity.conf-recommended std::stringstream ss; @@ -3166,7 +3166,7 @@ namespace yy { break; case 148: // expression: "CONGIG_DIR_SEC_COOKIE_FORMAT" -#line 1705 "seclang-parser.yy" +#line 1707 "seclang-parser.yy" { if (atoi(yystack_[0].value.as < std::string > ().c_str()) == 1) { driver.error(yystack_[1].location, "SecCookieFormat 1 is not yet supported."); @@ -3177,7 +3177,7 @@ namespace yy { break; case 149: // expression: "CONFIG_SEC_COOKIEV0_SEPARATOR" -#line 1712 "seclang-parser.yy" +#line 1714 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecCookieV0Separator is not yet supported."); YYERROR; @@ -3186,7 +3186,7 @@ namespace yy { break; case 151: // expression: "CONFIG_DIR_UNICODE_MAP_FILE" -#line 1722 "seclang-parser.yy" +#line 1724 "seclang-parser.yy" { std::string error; std::vector param; @@ -3244,7 +3244,7 @@ namespace yy { break; case 152: // expression: "CONFIG_SEC_COLLECTION_TIMEOUT" -#line 1776 "seclang-parser.yy" +#line 1778 "seclang-parser.yy" { /* Parser error disabled to avoid breaking default CRS installations with crs-setup.conf-recommended driver.error(@0, "SecCollectionTimeout is not yet supported."); @@ -3255,7 +3255,7 @@ namespace yy { break; case 153: // expression: "CONFIG_SEC_HTTP_BLKEY" -#line 1783 "seclang-parser.yy" +#line 1785 "seclang-parser.yy" { driver.m_httpblKey.m_set = true; driver.m_httpblKey.m_value = yystack_[0].value.as < std::string > (); @@ -3264,7 +3264,7 @@ namespace yy { break; case 154: // variables: variables_pre_process -#line 1791 "seclang-parser.yy" +#line 1793 "seclang-parser.yy" { std::unique_ptr > > originalList = std::move(yystack_[0].value.as < std::unique_ptr > > > ()); std::unique_ptr>> newList(new std::vector>()); @@ -3302,7 +3302,7 @@ namespace yy { break; case 155: // variables_pre_process: variables_may_be_quoted -#line 1828 "seclang-parser.yy" +#line 1830 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[0].value.as < std::unique_ptr > > > ()); } @@ -3310,7 +3310,7 @@ namespace yy { break; case 156: // variables_pre_process: "QUOTATION_MARK" variables_may_be_quoted "QUOTATION_MARK" -#line 1832 "seclang-parser.yy" +#line 1834 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[1].value.as < std::unique_ptr > > > ()); } @@ -3318,7 +3318,7 @@ namespace yy { break; case 157: // variables_may_be_quoted: variables_may_be_quoted PIPE var -#line 1839 "seclang-parser.yy" +#line 1841 "seclang-parser.yy" { yystack_[2].value.as < std::unique_ptr > > > ()->push_back(std::move(yystack_[0].value.as < std::unique_ptr > ())); yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[2].value.as < std::unique_ptr > > > ()); @@ -3327,7 +3327,7 @@ namespace yy { break; case 158: // variables_may_be_quoted: variables_may_be_quoted PIPE VAR_EXCLUSION var -#line 1844 "seclang-parser.yy" +#line 1846 "seclang-parser.yy" { std::unique_ptr c(new VariableModificatorExclusion(std::move(yystack_[0].value.as < std::unique_ptr > ()))); yystack_[3].value.as < std::unique_ptr > > > ()->push_back(std::move(c)); @@ -3337,7 +3337,7 @@ namespace yy { break; case 159: // variables_may_be_quoted: variables_may_be_quoted PIPE VAR_COUNT var -#line 1850 "seclang-parser.yy" +#line 1852 "seclang-parser.yy" { std::unique_ptr c(new VariableModificatorCount(std::move(yystack_[0].value.as < std::unique_ptr > ()))); yystack_[3].value.as < std::unique_ptr > > > ()->push_back(std::move(c)); @@ -3347,7 +3347,7 @@ namespace yy { break; case 160: // variables_may_be_quoted: var -#line 1856 "seclang-parser.yy" +#line 1858 "seclang-parser.yy" { std::unique_ptr>> b(new std::vector>()); b->push_back(std::move(yystack_[0].value.as < std::unique_ptr > ())); @@ -3357,7 +3357,7 @@ namespace yy { break; case 161: // variables_may_be_quoted: VAR_EXCLUSION var -#line 1862 "seclang-parser.yy" +#line 1864 "seclang-parser.yy" { std::unique_ptr>> b(new std::vector>()); std::unique_ptr c(new VariableModificatorExclusion(std::move(yystack_[0].value.as < std::unique_ptr > ()))); @@ -3368,7 +3368,7 @@ namespace yy { break; case 162: // variables_may_be_quoted: VAR_COUNT var -#line 1869 "seclang-parser.yy" +#line 1871 "seclang-parser.yy" { std::unique_ptr>> b(new std::vector>()); std::unique_ptr c(new VariableModificatorCount(std::move(yystack_[0].value.as < std::unique_ptr > ()))); @@ -3379,7 +3379,7 @@ namespace yy { break; case 163: // var: VARIABLE_ARGS "Dictionary element" -#line 1879 "seclang-parser.yy" +#line 1881 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3387,7 +3387,7 @@ namespace yy { break; case 164: // var: VARIABLE_ARGS "Dictionary element, selected by regexp" -#line 1883 "seclang-parser.yy" +#line 1885 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3395,7 +3395,7 @@ namespace yy { break; case 165: // var: VARIABLE_ARGS -#line 1887 "seclang-parser.yy" +#line 1889 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_NoDictElement()); } @@ -3403,7 +3403,7 @@ namespace yy { break; case 166: // var: VARIABLE_ARGS_POST "Dictionary element" -#line 1891 "seclang-parser.yy" +#line 1893 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3411,7 +3411,7 @@ namespace yy { break; case 167: // var: VARIABLE_ARGS_POST "Dictionary element, selected by regexp" -#line 1895 "seclang-parser.yy" +#line 1897 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3419,7 +3419,7 @@ namespace yy { break; case 168: // var: VARIABLE_ARGS_POST -#line 1899 "seclang-parser.yy" +#line 1901 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_NoDictElement()); } @@ -3427,7 +3427,7 @@ namespace yy { break; case 169: // var: VARIABLE_ARGS_GET "Dictionary element" -#line 1903 "seclang-parser.yy" +#line 1905 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3435,7 +3435,7 @@ namespace yy { break; case 170: // var: VARIABLE_ARGS_GET "Dictionary element, selected by regexp" -#line 1907 "seclang-parser.yy" +#line 1909 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3443,7 +3443,7 @@ namespace yy { break; case 171: // var: VARIABLE_ARGS_GET -#line 1911 "seclang-parser.yy" +#line 1913 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_NoDictElement()); } @@ -3451,7 +3451,7 @@ namespace yy { break; case 172: // var: VARIABLE_FILES_SIZES "Dictionary element" -#line 1915 "seclang-parser.yy" +#line 1917 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3459,7 +3459,7 @@ namespace yy { break; case 173: // var: VARIABLE_FILES_SIZES "Dictionary element, selected by regexp" -#line 1919 "seclang-parser.yy" +#line 1921 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3467,7 +3467,7 @@ namespace yy { break; case 174: // var: VARIABLE_FILES_SIZES -#line 1923 "seclang-parser.yy" +#line 1925 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_NoDictElement()); } @@ -3475,7 +3475,7 @@ namespace yy { break; case 175: // var: VARIABLE_FILES_NAMES "Dictionary element" -#line 1927 "seclang-parser.yy" +#line 1929 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3483,7 +3483,7 @@ namespace yy { break; case 176: // var: VARIABLE_FILES_NAMES "Dictionary element, selected by regexp" -#line 1931 "seclang-parser.yy" +#line 1933 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3491,7 +3491,7 @@ namespace yy { break; case 177: // var: VARIABLE_FILES_NAMES -#line 1935 "seclang-parser.yy" +#line 1937 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_NoDictElement()); } @@ -3499,7 +3499,7 @@ namespace yy { break; case 178: // var: VARIABLE_FILES_TMP_CONTENT "Dictionary element" -#line 1939 "seclang-parser.yy" +#line 1941 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3507,7 +3507,7 @@ namespace yy { break; case 179: // var: VARIABLE_FILES_TMP_CONTENT "Dictionary element, selected by regexp" -#line 1943 "seclang-parser.yy" +#line 1945 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3515,7 +3515,7 @@ namespace yy { break; case 180: // var: VARIABLE_FILES_TMP_CONTENT -#line 1947 "seclang-parser.yy" +#line 1949 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_NoDictElement()); } @@ -3523,7 +3523,7 @@ namespace yy { break; case 181: // var: VARIABLE_MULTIPART_FILENAME "Dictionary element" -#line 1951 "seclang-parser.yy" +#line 1953 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3531,7 +3531,7 @@ namespace yy { break; case 182: // var: VARIABLE_MULTIPART_FILENAME "Dictionary element, selected by regexp" -#line 1955 "seclang-parser.yy" +#line 1957 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3539,7 +3539,7 @@ namespace yy { break; case 183: // var: VARIABLE_MULTIPART_FILENAME -#line 1959 "seclang-parser.yy" +#line 1961 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_NoDictElement()); } @@ -3547,7 +3547,7 @@ namespace yy { break; case 184: // var: VARIABLE_MULTIPART_NAME "Dictionary element" -#line 1963 "seclang-parser.yy" +#line 1965 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3555,7 +3555,7 @@ namespace yy { break; case 185: // var: VARIABLE_MULTIPART_NAME "Dictionary element, selected by regexp" -#line 1967 "seclang-parser.yy" +#line 1969 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3563,7 +3563,7 @@ namespace yy { break; case 186: // var: VARIABLE_MULTIPART_NAME -#line 1971 "seclang-parser.yy" +#line 1973 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_NoDictElement()); } @@ -3571,7 +3571,7 @@ namespace yy { break; case 187: // var: VARIABLE_MATCHED_VARS_NAMES "Dictionary element" -#line 1975 "seclang-parser.yy" +#line 1977 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3579,7 +3579,7 @@ namespace yy { break; case 188: // var: VARIABLE_MATCHED_VARS_NAMES "Dictionary element, selected by regexp" -#line 1979 "seclang-parser.yy" +#line 1981 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3587,7 +3587,7 @@ namespace yy { break; case 189: // var: VARIABLE_MATCHED_VARS_NAMES -#line 1983 "seclang-parser.yy" +#line 1985 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_NoDictElement()); } @@ -3595,7 +3595,7 @@ namespace yy { break; case 190: // var: VARIABLE_MATCHED_VARS "Dictionary element" -#line 1987 "seclang-parser.yy" +#line 1989 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3603,7 +3603,7 @@ namespace yy { break; case 191: // var: VARIABLE_MATCHED_VARS "Dictionary element, selected by regexp" -#line 1991 "seclang-parser.yy" +#line 1993 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3611,7 +3611,7 @@ namespace yy { break; case 192: // var: VARIABLE_MATCHED_VARS -#line 1995 "seclang-parser.yy" +#line 1997 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_NoDictElement()); } @@ -3619,7 +3619,7 @@ namespace yy { break; case 193: // var: VARIABLE_FILES "Dictionary element" -#line 1999 "seclang-parser.yy" +#line 2001 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3627,7 +3627,7 @@ namespace yy { break; case 194: // var: VARIABLE_FILES "Dictionary element, selected by regexp" -#line 2003 "seclang-parser.yy" +#line 2005 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3635,7 +3635,7 @@ namespace yy { break; case 195: // var: VARIABLE_FILES -#line 2007 "seclang-parser.yy" +#line 2009 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_NoDictElement()); } @@ -3643,7 +3643,7 @@ namespace yy { break; case 196: // var: VARIABLE_REQUEST_COOKIES "Dictionary element" -#line 2011 "seclang-parser.yy" +#line 2013 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3651,7 +3651,7 @@ namespace yy { break; case 197: // var: VARIABLE_REQUEST_COOKIES "Dictionary element, selected by regexp" -#line 2015 "seclang-parser.yy" +#line 2017 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3659,7 +3659,7 @@ namespace yy { break; case 198: // var: VARIABLE_REQUEST_COOKIES -#line 2019 "seclang-parser.yy" +#line 2021 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_NoDictElement()); } @@ -3667,7 +3667,7 @@ namespace yy { break; case 199: // var: VARIABLE_REQUEST_HEADERS "Dictionary element" -#line 2023 "seclang-parser.yy" +#line 2025 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3675,7 +3675,7 @@ namespace yy { break; case 200: // var: VARIABLE_REQUEST_HEADERS "Dictionary element, selected by regexp" -#line 2027 "seclang-parser.yy" +#line 2029 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3683,7 +3683,7 @@ namespace yy { break; case 201: // var: VARIABLE_REQUEST_HEADERS -#line 2031 "seclang-parser.yy" +#line 2033 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_NoDictElement()); } @@ -3691,7 +3691,7 @@ namespace yy { break; case 202: // var: VARIABLE_RESPONSE_HEADERS "Dictionary element" -#line 2035 "seclang-parser.yy" +#line 2037 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeaders_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3699,7 +3699,7 @@ namespace yy { break; case 203: // var: VARIABLE_RESPONSE_HEADERS "Dictionary element, selected by regexp" -#line 2039 "seclang-parser.yy" +#line 2041 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeaders_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3707,7 +3707,7 @@ namespace yy { break; case 204: // var: VARIABLE_RESPONSE_HEADERS -#line 2043 "seclang-parser.yy" +#line 2045 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeaders_NoDictElement()); } @@ -3715,7 +3715,7 @@ namespace yy { break; case 205: // var: VARIABLE_GEO "Dictionary element" -#line 2047 "seclang-parser.yy" +#line 2049 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Geo_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3723,7 +3723,7 @@ namespace yy { break; case 206: // var: VARIABLE_GEO "Dictionary element, selected by regexp" -#line 2051 "seclang-parser.yy" +#line 2053 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Geo_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3731,7 +3731,7 @@ namespace yy { break; case 207: // var: VARIABLE_GEO -#line 2055 "seclang-parser.yy" +#line 2057 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Geo_NoDictElement()); } @@ -3739,7 +3739,7 @@ namespace yy { break; case 208: // var: VARIABLE_REQUEST_COOKIES_NAMES "Dictionary element" -#line 2059 "seclang-parser.yy" +#line 2061 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookiesNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3747,7 +3747,7 @@ namespace yy { break; case 209: // var: VARIABLE_REQUEST_COOKIES_NAMES "Dictionary element, selected by regexp" -#line 2063 "seclang-parser.yy" +#line 2065 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookiesNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3755,7 +3755,7 @@ namespace yy { break; case 210: // var: VARIABLE_REQUEST_COOKIES_NAMES -#line 2067 "seclang-parser.yy" +#line 2069 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookiesNames_NoDictElement()); } @@ -3763,7 +3763,7 @@ namespace yy { break; case 211: // var: VARIABLE_RULE "Dictionary element" -#line 2071 "seclang-parser.yy" +#line 2073 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Rule_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3771,7 +3771,7 @@ namespace yy { break; case 212: // var: VARIABLE_RULE "Dictionary element, selected by regexp" -#line 2075 "seclang-parser.yy" +#line 2077 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Rule_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3779,7 +3779,7 @@ namespace yy { break; case 213: // var: VARIABLE_RULE -#line 2079 "seclang-parser.yy" +#line 2081 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Rule_NoDictElement()); } @@ -3787,7 +3787,7 @@ namespace yy { break; case 214: // var: "RUN_TIME_VAR_ENV" "Dictionary element" -#line 2083 "seclang-parser.yy" +#line 2085 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Env("ENV:" + yystack_[0].value.as < std::string > ())); } @@ -3795,7 +3795,7 @@ namespace yy { break; case 215: // var: "RUN_TIME_VAR_ENV" "Dictionary element, selected by regexp" -#line 2087 "seclang-parser.yy" +#line 2089 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Env("ENV:" + yystack_[0].value.as < std::string > ())); } @@ -3803,7 +3803,7 @@ namespace yy { break; case 216: // var: "RUN_TIME_VAR_ENV" -#line 2091 "seclang-parser.yy" +#line 2093 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Env("ENV")); } @@ -3811,7 +3811,7 @@ namespace yy { break; case 217: // var: "RUN_TIME_VAR_XML" "Dictionary element" -#line 2095 "seclang-parser.yy" +#line 2097 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::XML("XML:" + yystack_[0].value.as < std::string > ())); } @@ -3819,7 +3819,7 @@ namespace yy { break; case 218: // var: "RUN_TIME_VAR_XML" "Dictionary element, selected by regexp" -#line 2099 "seclang-parser.yy" +#line 2101 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::XML("XML:" + yystack_[0].value.as < std::string > ())); } @@ -3827,7 +3827,7 @@ namespace yy { break; case 219: // var: "RUN_TIME_VAR_XML" -#line 2103 "seclang-parser.yy" +#line 2105 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::XML_NoDictElement()); } @@ -3835,7 +3835,7 @@ namespace yy { break; case 220: // var: "FILES_TMPNAMES" "Dictionary element" -#line 2107 "seclang-parser.yy" +#line 2109 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3843,7 +3843,7 @@ namespace yy { break; case 221: // var: "FILES_TMPNAMES" "Dictionary element, selected by regexp" -#line 2111 "seclang-parser.yy" +#line 2113 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3851,7 +3851,7 @@ namespace yy { break; case 222: // var: "FILES_TMPNAMES" -#line 2115 "seclang-parser.yy" +#line 2117 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpNames_NoDictElement()); } @@ -3859,7 +3859,7 @@ namespace yy { break; case 223: // var: "RESOURCE" run_time_string -#line 2119 "seclang-parser.yy" +#line 2121 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3867,7 +3867,7 @@ namespace yy { break; case 224: // var: "RESOURCE" "Dictionary element" -#line 2123 "seclang-parser.yy" +#line 2125 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3875,7 +3875,7 @@ namespace yy { break; case 225: // var: "RESOURCE" "Dictionary element, selected by regexp" -#line 2127 "seclang-parser.yy" +#line 2129 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3883,7 +3883,7 @@ namespace yy { break; case 226: // var: "RESOURCE" -#line 2131 "seclang-parser.yy" +#line 2133 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_NoDictElement()); } @@ -3891,7 +3891,7 @@ namespace yy { break; case 227: // var: "VARIABLE_IP" run_time_string -#line 2135 "seclang-parser.yy" +#line 2137 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3899,7 +3899,7 @@ namespace yy { break; case 228: // var: "VARIABLE_IP" "Dictionary element" -#line 2139 "seclang-parser.yy" +#line 2141 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3907,7 +3907,7 @@ namespace yy { break; case 229: // var: "VARIABLE_IP" "Dictionary element, selected by regexp" -#line 2143 "seclang-parser.yy" +#line 2145 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3915,7 +3915,7 @@ namespace yy { break; case 230: // var: "VARIABLE_IP" -#line 2147 "seclang-parser.yy" +#line 2149 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_NoDictElement()); } @@ -3923,7 +3923,7 @@ namespace yy { break; case 231: // var: "VARIABLE_GLOBAL" run_time_string -#line 2151 "seclang-parser.yy" +#line 2153 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3931,7 +3931,7 @@ namespace yy { break; case 232: // var: "VARIABLE_GLOBAL" "Dictionary element" -#line 2155 "seclang-parser.yy" +#line 2157 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3939,7 +3939,7 @@ namespace yy { break; case 233: // var: "VARIABLE_GLOBAL" "Dictionary element, selected by regexp" -#line 2159 "seclang-parser.yy" +#line 2161 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3947,7 +3947,7 @@ namespace yy { break; case 234: // var: "VARIABLE_GLOBAL" -#line 2163 "seclang-parser.yy" +#line 2165 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_NoDictElement()); } @@ -3955,7 +3955,7 @@ namespace yy { break; case 235: // var: "VARIABLE_USER" run_time_string -#line 2167 "seclang-parser.yy" +#line 2169 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3963,7 +3963,7 @@ namespace yy { break; case 236: // var: "VARIABLE_USER" "Dictionary element" -#line 2171 "seclang-parser.yy" +#line 2173 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3971,7 +3971,7 @@ namespace yy { break; case 237: // var: "VARIABLE_USER" "Dictionary element, selected by regexp" -#line 2175 "seclang-parser.yy" +#line 2177 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3979,7 +3979,7 @@ namespace yy { break; case 238: // var: "VARIABLE_USER" -#line 2179 "seclang-parser.yy" +#line 2181 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_NoDictElement()); } @@ -3987,7 +3987,7 @@ namespace yy { break; case 239: // var: "VARIABLE_TX" run_time_string -#line 2183 "seclang-parser.yy" +#line 2185 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3995,7 +3995,7 @@ namespace yy { break; case 240: // var: "VARIABLE_TX" "Dictionary element" -#line 2187 "seclang-parser.yy" +#line 2189 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4003,7 +4003,7 @@ namespace yy { break; case 241: // var: "VARIABLE_TX" "Dictionary element, selected by regexp" -#line 2191 "seclang-parser.yy" +#line 2193 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4011,7 +4011,7 @@ namespace yy { break; case 242: // var: "VARIABLE_TX" -#line 2195 "seclang-parser.yy" +#line 2197 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_NoDictElement()); } @@ -4019,7 +4019,7 @@ namespace yy { break; case 243: // var: "VARIABLE_SESSION" run_time_string -#line 2199 "seclang-parser.yy" +#line 2201 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -4027,7 +4027,7 @@ namespace yy { break; case 244: // var: "VARIABLE_SESSION" "Dictionary element" -#line 2203 "seclang-parser.yy" +#line 2205 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4035,7 +4035,7 @@ namespace yy { break; case 245: // var: "VARIABLE_SESSION" "Dictionary element, selected by regexp" -#line 2207 "seclang-parser.yy" +#line 2209 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4043,7 +4043,7 @@ namespace yy { break; case 246: // var: "VARIABLE_SESSION" -#line 2211 "seclang-parser.yy" +#line 2213 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_NoDictElement()); } @@ -4051,7 +4051,7 @@ namespace yy { break; case 247: // var: "Variable ARGS_NAMES" "Dictionary element" -#line 2215 "seclang-parser.yy" +#line 2217 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4059,7 +4059,7 @@ namespace yy { break; case 248: // var: "Variable ARGS_NAMES" "Dictionary element, selected by regexp" -#line 2219 "seclang-parser.yy" +#line 2221 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4067,7 +4067,7 @@ namespace yy { break; case 249: // var: "Variable ARGS_NAMES" -#line 2223 "seclang-parser.yy" +#line 2225 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsNames_NoDictElement()); } @@ -4075,7 +4075,7 @@ namespace yy { break; case 250: // var: VARIABLE_ARGS_GET_NAMES "Dictionary element" -#line 2227 "seclang-parser.yy" +#line 2229 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGetNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4083,7 +4083,7 @@ namespace yy { break; case 251: // var: VARIABLE_ARGS_GET_NAMES "Dictionary element, selected by regexp" -#line 2231 "seclang-parser.yy" +#line 2233 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGetNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4091,7 +4091,7 @@ namespace yy { break; case 252: // var: VARIABLE_ARGS_GET_NAMES -#line 2235 "seclang-parser.yy" +#line 2237 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGetNames_NoDictElement()); } @@ -4099,7 +4099,7 @@ namespace yy { break; case 253: // var: VARIABLE_ARGS_POST_NAMES "Dictionary element" -#line 2240 "seclang-parser.yy" +#line 2242 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPostNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4107,7 +4107,7 @@ namespace yy { break; case 254: // var: VARIABLE_ARGS_POST_NAMES "Dictionary element, selected by regexp" -#line 2244 "seclang-parser.yy" +#line 2246 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPostNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4115,7 +4115,7 @@ namespace yy { break; case 255: // var: VARIABLE_ARGS_POST_NAMES -#line 2248 "seclang-parser.yy" +#line 2250 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPostNames_NoDictElement()); } @@ -4123,7 +4123,7 @@ namespace yy { break; case 256: // var: VARIABLE_REQUEST_HEADERS_NAMES "Dictionary element" -#line 2253 "seclang-parser.yy" +#line 2255 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeadersNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4131,7 +4131,7 @@ namespace yy { break; case 257: // var: VARIABLE_REQUEST_HEADERS_NAMES "Dictionary element, selected by regexp" -#line 2257 "seclang-parser.yy" +#line 2259 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeadersNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4139,7 +4139,7 @@ namespace yy { break; case 258: // var: VARIABLE_REQUEST_HEADERS_NAMES -#line 2261 "seclang-parser.yy" +#line 2263 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeadersNames_NoDictElement()); } @@ -4147,7 +4147,7 @@ namespace yy { break; case 259: // var: VARIABLE_RESPONSE_CONTENT_TYPE -#line 2266 "seclang-parser.yy" +#line 2268 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseContentType()); } @@ -4155,7 +4155,7 @@ namespace yy { break; case 260: // var: VARIABLE_RESPONSE_HEADERS_NAMES "Dictionary element" -#line 2271 "seclang-parser.yy" +#line 2273 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeadersNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4163,7 +4163,7 @@ namespace yy { break; case 261: // var: VARIABLE_RESPONSE_HEADERS_NAMES "Dictionary element, selected by regexp" -#line 2275 "seclang-parser.yy" +#line 2277 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeadersNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4171,7 +4171,7 @@ namespace yy { break; case 262: // var: VARIABLE_RESPONSE_HEADERS_NAMES -#line 2279 "seclang-parser.yy" +#line 2281 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeadersNames_NoDictElement()); } @@ -4179,7 +4179,7 @@ namespace yy { break; case 263: // var: VARIABLE_ARGS_COMBINED_SIZE -#line 2283 "seclang-parser.yy" +#line 2285 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsCombinedSize()); } @@ -4187,7 +4187,7 @@ namespace yy { break; case 264: // var: "AUTH_TYPE" -#line 2287 "seclang-parser.yy" +#line 2289 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::AuthType()); } @@ -4195,7 +4195,7 @@ namespace yy { break; case 265: // var: "FILES_COMBINED_SIZE" -#line 2291 "seclang-parser.yy" +#line 2293 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesCombinedSize()); } @@ -4203,7 +4203,7 @@ namespace yy { break; case 266: // var: "FULL_REQUEST" -#line 2295 "seclang-parser.yy" +#line 2297 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FullRequest()); } @@ -4211,7 +4211,7 @@ namespace yy { break; case 267: // var: "FULL_REQUEST_LENGTH" -#line 2299 "seclang-parser.yy" +#line 2301 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FullRequestLength()); } @@ -4219,7 +4219,7 @@ namespace yy { break; case 268: // var: "INBOUND_DATA_ERROR" -#line 2303 "seclang-parser.yy" +#line 2305 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::InboundDataError()); } @@ -4227,7 +4227,7 @@ namespace yy { break; case 269: // var: "MATCHED_VAR" -#line 2307 "seclang-parser.yy" +#line 2309 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVar()); } @@ -4235,7 +4235,7 @@ namespace yy { break; case 270: // var: "MATCHED_VAR_NAME" -#line 2311 "seclang-parser.yy" +#line 2313 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarName()); } @@ -4243,7 +4243,7 @@ namespace yy { break; case 271: // var: VARIABLE_MULTIPART_BOUNDARY_QUOTED -#line 2315 "seclang-parser.yy" +#line 2317 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartBoundaryQuoted()); } @@ -4251,7 +4251,7 @@ namespace yy { break; case 272: // var: VARIABLE_MULTIPART_BOUNDARY_WHITESPACE -#line 2319 "seclang-parser.yy" +#line 2321 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartBoundaryWhiteSpace()); } @@ -4259,7 +4259,7 @@ namespace yy { break; case 273: // var: "MULTIPART_CRLF_LF_LINES" -#line 2323 "seclang-parser.yy" +#line 2325 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartCrlfLFLines()); } @@ -4267,7 +4267,7 @@ namespace yy { break; case 274: // var: "MULTIPART_DATA_AFTER" -#line 2327 "seclang-parser.yy" +#line 2329 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartDateAfter()); } @@ -4275,7 +4275,7 @@ namespace yy { break; case 275: // var: VARIABLE_MULTIPART_DATA_BEFORE -#line 2331 "seclang-parser.yy" +#line 2333 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartDateBefore()); } @@ -4283,7 +4283,7 @@ namespace yy { break; case 276: // var: "MULTIPART_FILE_LIMIT_EXCEEDED" -#line 2335 "seclang-parser.yy" +#line 2337 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartFileLimitExceeded()); } @@ -4291,7 +4291,7 @@ namespace yy { break; case 277: // var: "MULTIPART_HEADER_FOLDING" -#line 2339 "seclang-parser.yy" +#line 2341 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartHeaderFolding()); } @@ -4299,7 +4299,7 @@ namespace yy { break; case 278: // var: "MULTIPART_INVALID_HEADER_FOLDING" -#line 2343 "seclang-parser.yy" +#line 2345 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartInvalidHeaderFolding()); } @@ -4307,7 +4307,7 @@ namespace yy { break; case 279: // var: VARIABLE_MULTIPART_INVALID_PART -#line 2347 "seclang-parser.yy" +#line 2349 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartInvalidPart()); } @@ -4315,7 +4315,7 @@ namespace yy { break; case 280: // var: "MULTIPART_INVALID_QUOTING" -#line 2351 "seclang-parser.yy" +#line 2353 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartInvalidQuoting()); } @@ -4323,7 +4323,7 @@ namespace yy { break; case 281: // var: VARIABLE_MULTIPART_LF_LINE -#line 2355 "seclang-parser.yy" +#line 2357 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartLFLine()); } @@ -4331,7 +4331,7 @@ namespace yy { break; case 282: // var: VARIABLE_MULTIPART_MISSING_SEMICOLON -#line 2359 "seclang-parser.yy" +#line 2361 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartMissingSemicolon()); } @@ -4339,7 +4339,7 @@ namespace yy { break; case 283: // var: VARIABLE_MULTIPART_SEMICOLON_MISSING -#line 2363 "seclang-parser.yy" +#line 2365 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartMissingSemicolon()); } @@ -4347,7 +4347,7 @@ namespace yy { break; case 284: // var: "MULTIPART_STRICT_ERROR" -#line 2367 "seclang-parser.yy" +#line 2369 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartStrictError()); } @@ -4355,7 +4355,7 @@ namespace yy { break; case 285: // var: "MULTIPART_UNMATCHED_BOUNDARY" -#line 2371 "seclang-parser.yy" +#line 2373 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartUnmatchedBoundary()); } @@ -4363,7 +4363,7 @@ namespace yy { break; case 286: // var: "OUTBOUND_DATA_ERROR" -#line 2375 "seclang-parser.yy" +#line 2377 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::OutboundDataError()); } @@ -4371,7 +4371,7 @@ namespace yy { break; case 287: // var: "PATH_INFO" -#line 2379 "seclang-parser.yy" +#line 2381 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::PathInfo()); } @@ -4379,7 +4379,7 @@ namespace yy { break; case 288: // var: "QUERY_STRING" -#line 2383 "seclang-parser.yy" +#line 2385 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::QueryString()); } @@ -4387,7 +4387,7 @@ namespace yy { break; case 289: // var: "REMOTE_ADDR" -#line 2387 "seclang-parser.yy" +#line 2389 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RemoteAddr()); } @@ -4395,7 +4395,7 @@ namespace yy { break; case 290: // var: "REMOTE_HOST" -#line 2391 "seclang-parser.yy" +#line 2393 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RemoteHost()); } @@ -4403,7 +4403,7 @@ namespace yy { break; case 291: // var: "REMOTE_PORT" -#line 2395 "seclang-parser.yy" +#line 2397 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RemotePort()); } @@ -4411,7 +4411,7 @@ namespace yy { break; case 292: // var: "REQBODY_ERROR" -#line 2399 "seclang-parser.yy" +#line 2401 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyError()); } @@ -4419,7 +4419,7 @@ namespace yy { break; case 293: // var: "REQBODY_ERROR_MSG" -#line 2403 "seclang-parser.yy" +#line 2405 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyErrorMsg()); } @@ -4427,7 +4427,7 @@ namespace yy { break; case 294: // var: "REQBODY_PROCESSOR" -#line 2407 "seclang-parser.yy" +#line 2409 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyProcessor()); } @@ -4435,7 +4435,7 @@ namespace yy { break; case 295: // var: "REQBODY_PROCESSOR_ERROR" -#line 2411 "seclang-parser.yy" +#line 2413 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyProcessorError()); } @@ -4443,7 +4443,7 @@ namespace yy { break; case 296: // var: "REQBODY_PROCESSOR_ERROR_MSG" -#line 2415 "seclang-parser.yy" +#line 2417 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyProcessorErrorMsg()); } @@ -4451,7 +4451,7 @@ namespace yy { break; case 297: // var: "REQUEST_BASENAME" -#line 2419 "seclang-parser.yy" +#line 2421 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestBasename()); } @@ -4459,7 +4459,7 @@ namespace yy { break; case 298: // var: "REQUEST_BODY" -#line 2423 "seclang-parser.yy" +#line 2425 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestBody()); } @@ -4467,7 +4467,7 @@ namespace yy { break; case 299: // var: "REQUEST_BODY_LENGTH" -#line 2427 "seclang-parser.yy" +#line 2429 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestBodyLength()); } @@ -4475,7 +4475,7 @@ namespace yy { break; case 300: // var: "REQUEST_FILENAME" -#line 2431 "seclang-parser.yy" +#line 2433 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestFilename()); } @@ -4483,7 +4483,7 @@ namespace yy { break; case 301: // var: "REQUEST_LINE" -#line 2435 "seclang-parser.yy" +#line 2437 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestLine()); } @@ -4491,7 +4491,7 @@ namespace yy { break; case 302: // var: "REQUEST_METHOD" -#line 2439 "seclang-parser.yy" +#line 2441 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestMethod()); } @@ -4499,7 +4499,7 @@ namespace yy { break; case 303: // var: "REQUEST_PROTOCOL" -#line 2443 "seclang-parser.yy" +#line 2445 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestProtocol()); } @@ -4507,7 +4507,7 @@ namespace yy { break; case 304: // var: "REQUEST_URI" -#line 2447 "seclang-parser.yy" +#line 2449 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestURI()); } @@ -4515,7 +4515,7 @@ namespace yy { break; case 305: // var: "REQUEST_URI_RAW" -#line 2451 "seclang-parser.yy" +#line 2453 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestURIRaw()); } @@ -4523,7 +4523,7 @@ namespace yy { break; case 306: // var: "RESPONSE_BODY" -#line 2455 "seclang-parser.yy" +#line 2457 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseBody()); } @@ -4531,7 +4531,7 @@ namespace yy { break; case 307: // var: "RESPONSE_CONTENT_LENGTH" -#line 2459 "seclang-parser.yy" +#line 2461 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseContentLength()); } @@ -4539,7 +4539,7 @@ namespace yy { break; case 308: // var: "RESPONSE_PROTOCOL" -#line 2463 "seclang-parser.yy" +#line 2465 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseProtocol()); } @@ -4547,7 +4547,7 @@ namespace yy { break; case 309: // var: "RESPONSE_STATUS" -#line 2467 "seclang-parser.yy" +#line 2469 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseStatus()); } @@ -4555,7 +4555,7 @@ namespace yy { break; case 310: // var: "SERVER_ADDR" -#line 2471 "seclang-parser.yy" +#line 2473 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ServerAddr()); } @@ -4563,7 +4563,7 @@ namespace yy { break; case 311: // var: "SERVER_NAME" -#line 2475 "seclang-parser.yy" +#line 2477 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ServerName()); } @@ -4571,7 +4571,7 @@ namespace yy { break; case 312: // var: "SERVER_PORT" -#line 2479 "seclang-parser.yy" +#line 2481 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ServerPort()); } @@ -4579,7 +4579,7 @@ namespace yy { break; case 313: // var: "SESSIONID" -#line 2483 "seclang-parser.yy" +#line 2485 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::SessionID()); } @@ -4587,7 +4587,7 @@ namespace yy { break; case 314: // var: "UNIQUE_ID" -#line 2487 "seclang-parser.yy" +#line 2489 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::UniqueID()); } @@ -4595,7 +4595,7 @@ namespace yy { break; case 315: // var: "URLENCODED_ERROR" -#line 2491 "seclang-parser.yy" +#line 2493 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::UrlEncodedError()); } @@ -4603,7 +4603,7 @@ namespace yy { break; case 316: // var: "USERID" -#line 2495 "seclang-parser.yy" +#line 2497 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::UserID()); } @@ -4611,7 +4611,7 @@ namespace yy { break; case 317: // var: "VARIABLE_STATUS" -#line 2499 "seclang-parser.yy" +#line 2501 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Status()); } @@ -4619,7 +4619,7 @@ namespace yy { break; case 318: // var: "VARIABLE_STATUS_LINE" -#line 2503 "seclang-parser.yy" +#line 2505 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Status()); } @@ -4627,7 +4627,7 @@ namespace yy { break; case 319: // var: "WEBAPPID" -#line 2507 "seclang-parser.yy" +#line 2509 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::WebAppId()); } @@ -4635,7 +4635,7 @@ namespace yy { break; case 320: // var: "RUN_TIME_VAR_DUR" -#line 2511 "seclang-parser.yy" +#line 2513 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4646,7 +4646,7 @@ namespace yy { break; case 321: // var: "RUN_TIME_VAR_BLD" -#line 2519 "seclang-parser.yy" +#line 2521 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4657,7 +4657,7 @@ namespace yy { break; case 322: // var: "RUN_TIME_VAR_HSV" -#line 2526 "seclang-parser.yy" +#line 2528 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4668,7 +4668,7 @@ namespace yy { break; case 323: // var: "RUN_TIME_VAR_REMOTE_USER" -#line 2533 "seclang-parser.yy" +#line 2535 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4679,7 +4679,7 @@ namespace yy { break; case 324: // var: "RUN_TIME_VAR_TIME" -#line 2540 "seclang-parser.yy" +#line 2542 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4690,7 +4690,7 @@ namespace yy { break; case 325: // var: "RUN_TIME_VAR_TIME_DAY" -#line 2547 "seclang-parser.yy" +#line 2549 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4701,7 +4701,7 @@ namespace yy { break; case 326: // var: "RUN_TIME_VAR_TIME_EPOCH" -#line 2554 "seclang-parser.yy" +#line 2556 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4712,7 +4712,7 @@ namespace yy { break; case 327: // var: "RUN_TIME_VAR_TIME_HOUR" -#line 2561 "seclang-parser.yy" +#line 2563 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4723,7 +4723,7 @@ namespace yy { break; case 328: // var: "RUN_TIME_VAR_TIME_MIN" -#line 2568 "seclang-parser.yy" +#line 2570 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4734,7 +4734,7 @@ namespace yy { break; case 329: // var: "RUN_TIME_VAR_TIME_MON" -#line 2575 "seclang-parser.yy" +#line 2577 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4745,7 +4745,7 @@ namespace yy { break; case 330: // var: "RUN_TIME_VAR_TIME_SEC" -#line 2582 "seclang-parser.yy" +#line 2584 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4756,7 +4756,7 @@ namespace yy { break; case 331: // var: "RUN_TIME_VAR_TIME_WDAY" -#line 2589 "seclang-parser.yy" +#line 2591 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4767,7 +4767,7 @@ namespace yy { break; case 332: // var: "RUN_TIME_VAR_TIME_YEAR" -#line 2596 "seclang-parser.yy" +#line 2598 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4778,7 +4778,7 @@ namespace yy { break; case 333: // act: "Accuracy" -#line 2606 "seclang-parser.yy" +#line 2608 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Accuracy(yystack_[0].value.as < std::string > ())); } @@ -4786,7 +4786,7 @@ namespace yy { break; case 334: // act: "Allow" -#line 2610 "seclang-parser.yy" +#line 2612 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Allow(yystack_[0].value.as < std::string > ())); } @@ -4794,7 +4794,7 @@ namespace yy { break; case 335: // act: "Append" -#line 2614 "seclang-parser.yy" +#line 2616 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("Append", yystack_[1].location); } @@ -4802,7 +4802,7 @@ namespace yy { break; case 336: // act: "AuditLog" -#line 2618 "seclang-parser.yy" +#line 2620 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::AuditLog(yystack_[0].value.as < std::string > ())); } @@ -4810,7 +4810,7 @@ namespace yy { break; case 337: // act: "Block" -#line 2622 "seclang-parser.yy" +#line 2624 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Block(yystack_[0].value.as < std::string > ())); } @@ -4818,7 +4818,7 @@ namespace yy { break; case 338: // act: "Capture" -#line 2626 "seclang-parser.yy" +#line 2628 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Capture(yystack_[0].value.as < std::string > ())); } @@ -4826,7 +4826,7 @@ namespace yy { break; case 339: // act: "Chain" -#line 2630 "seclang-parser.yy" +#line 2632 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Chain(yystack_[0].value.as < std::string > ())); } @@ -4834,7 +4834,7 @@ namespace yy { break; case 340: // act: "ACTION_CTL_AUDIT_ENGINE" "CONFIG_VALUE_ON" -#line 2634 "seclang-parser.yy" +#line 2636 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4843,7 +4843,7 @@ namespace yy { break; case 341: // act: "ACTION_CTL_AUDIT_ENGINE" "CONFIG_VALUE_OFF" -#line 2639 "seclang-parser.yy" +#line 2641 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4852,7 +4852,7 @@ namespace yy { break; case 342: // act: "ACTION_CTL_AUDIT_ENGINE" "CONFIG_VALUE_RELEVANT_ONLY" -#line 2644 "seclang-parser.yy" +#line 2646 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4861,7 +4861,7 @@ namespace yy { break; case 343: // act: "ACTION_CTL_AUDIT_LOG_PARTS" -#line 2649 "seclang-parser.yy" +#line 2651 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::AuditLogParts(yystack_[0].value.as < std::string > ())); } @@ -4869,7 +4869,7 @@ namespace yy { break; case 344: // act: "ACTION_CTL_BDY_JSON" -#line 2653 "seclang-parser.yy" +#line 2655 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyProcessorJSON(yystack_[0].value.as < std::string > ())); } @@ -4877,7 +4877,7 @@ namespace yy { break; case 345: // act: "ACTION_CTL_BDY_XML" -#line 2657 "seclang-parser.yy" +#line 2659 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyProcessorXML(yystack_[0].value.as < std::string > ())); } @@ -4885,7 +4885,7 @@ namespace yy { break; case 346: // act: "ACTION_CTL_BDY_URLENCODED" -#line 2661 "seclang-parser.yy" +#line 2663 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyProcessorURLENCODED(yystack_[0].value.as < std::string > ())); } @@ -4893,7 +4893,7 @@ namespace yy { break; case 347: // act: "ACTION_CTL_FORCE_REQ_BODY_VAR" "CONFIG_VALUE_ON" -#line 2665 "seclang-parser.yy" +#line 2667 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlForceReequestBody", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4902,7 +4902,7 @@ namespace yy { break; case 348: // act: "ACTION_CTL_FORCE_REQ_BODY_VAR" "CONFIG_VALUE_OFF" -#line 2670 "seclang-parser.yy" +#line 2672 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlForceReequestBody", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4911,7 +4911,7 @@ namespace yy { break; case 349: // act: "ACTION_CTL_REQUEST_BODY_ACCESS" "CONFIG_VALUE_ON" -#line 2675 "seclang-parser.yy" +#line 2677 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyAccess(yystack_[1].value.as < std::string > () + "true")); } @@ -4919,7 +4919,7 @@ namespace yy { break; case 350: // act: "ACTION_CTL_REQUEST_BODY_ACCESS" "CONFIG_VALUE_OFF" -#line 2679 "seclang-parser.yy" +#line 2681 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyAccess(yystack_[1].value.as < std::string > () + "false")); } @@ -4927,7 +4927,7 @@ namespace yy { break; case 351: // act: "ACTION_CTL_RULE_ENGINE" "CONFIG_VALUE_ON" -#line 2683 "seclang-parser.yy" +#line 2685 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleEngine("ctl:RuleEngine=on")); } @@ -4935,7 +4935,7 @@ namespace yy { break; case 352: // act: "ACTION_CTL_RULE_ENGINE" "CONFIG_VALUE_OFF" -#line 2687 "seclang-parser.yy" +#line 2689 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleEngine("ctl:RuleEngine=off")); } @@ -4943,7 +4943,7 @@ namespace yy { break; case 353: // act: "ACTION_CTL_RULE_ENGINE" "CONFIG_VALUE_DETC" -#line 2691 "seclang-parser.yy" +#line 2693 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleEngine("ctl:RuleEngine=detectiononly")); } @@ -4951,7 +4951,7 @@ namespace yy { break; case 354: // act: "ACTION_CTL_RULE_REMOVE_BY_ID" -#line 2695 "seclang-parser.yy" +#line 2697 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveById(yystack_[0].value.as < std::string > ())); } @@ -4959,7 +4959,7 @@ namespace yy { break; case 355: // act: "ACTION_CTL_RULE_REMOVE_BY_TAG" -#line 2699 "seclang-parser.yy" +#line 2701 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveByTag(yystack_[0].value.as < std::string > ())); } @@ -4967,7 +4967,7 @@ namespace yy { break; case 356: // act: "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" -#line 2703 "seclang-parser.yy" +#line 2705 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveTargetById(yystack_[0].value.as < std::string > ())); } @@ -4975,7 +4975,7 @@ namespace yy { break; case 357: // act: "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" -#line 2707 "seclang-parser.yy" +#line 2709 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveTargetByTag(yystack_[0].value.as < std::string > ())); } @@ -4983,7 +4983,7 @@ namespace yy { break; case 358: // act: "Deny" -#line 2711 "seclang-parser.yy" +#line 2713 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Deny(yystack_[0].value.as < std::string > ())); } @@ -4991,7 +4991,7 @@ namespace yy { break; case 359: // act: "DeprecateVar" -#line 2715 "seclang-parser.yy" +#line 2717 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("DeprecateVar", yystack_[1].location); } @@ -4999,7 +4999,7 @@ namespace yy { break; case 360: // act: "Drop" -#line 2719 "seclang-parser.yy" +#line 2721 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Drop(yystack_[0].value.as < std::string > ())); } @@ -5007,7 +5007,7 @@ namespace yy { break; case 361: // act: "Exec" -#line 2723 "seclang-parser.yy" +#line 2725 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Exec(yystack_[0].value.as < std::string > ())); } @@ -5015,7 +5015,7 @@ namespace yy { break; case 362: // act: "ExpireVar" -#line 2727 "seclang-parser.yy" +#line 2729 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("ExpireVar", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[0].value.as < std::string > ())); @@ -5024,7 +5024,7 @@ namespace yy { break; case 363: // act: "Id" -#line 2732 "seclang-parser.yy" +#line 2734 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::RuleId(yystack_[0].value.as < std::string > ())); } @@ -5032,7 +5032,7 @@ namespace yy { break; case 364: // act: "InitCol" run_time_string -#line 2736 "seclang-parser.yy" +#line 2738 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::InitCol(yystack_[1].value.as < std::string > (), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5040,7 +5040,7 @@ namespace yy { break; case 365: // act: "LogData" run_time_string -#line 2740 "seclang-parser.yy" +#line 2742 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::LogData(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5048,7 +5048,7 @@ namespace yy { break; case 366: // act: "Log" -#line 2744 "seclang-parser.yy" +#line 2746 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Log(yystack_[0].value.as < std::string > ())); } @@ -5056,7 +5056,7 @@ namespace yy { break; case 367: // act: "Maturity" -#line 2748 "seclang-parser.yy" +#line 2750 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Maturity(yystack_[0].value.as < std::string > ())); } @@ -5064,7 +5064,7 @@ namespace yy { break; case 368: // act: "Msg" run_time_string -#line 2752 "seclang-parser.yy" +#line 2754 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Msg(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5072,7 +5072,7 @@ namespace yy { break; case 369: // act: "MultiMatch" -#line 2756 "seclang-parser.yy" +#line 2758 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::MultiMatch(yystack_[0].value.as < std::string > ())); } @@ -5080,7 +5080,7 @@ namespace yy { break; case 370: // act: "NoAuditLog" -#line 2760 "seclang-parser.yy" +#line 2762 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::NoAuditLog(yystack_[0].value.as < std::string > ())); } @@ -5088,7 +5088,7 @@ namespace yy { break; case 371: // act: "NoLog" -#line 2764 "seclang-parser.yy" +#line 2766 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::NoLog(yystack_[0].value.as < std::string > ())); } @@ -5096,7 +5096,7 @@ namespace yy { break; case 372: // act: "Pass" -#line 2768 "seclang-parser.yy" +#line 2770 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Pass(yystack_[0].value.as < std::string > ())); } @@ -5104,7 +5104,7 @@ namespace yy { break; case 373: // act: "Pause" -#line 2772 "seclang-parser.yy" +#line 2774 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("Pause", yystack_[1].location); } @@ -5112,7 +5112,7 @@ namespace yy { break; case 374: // act: "Phase" -#line 2776 "seclang-parser.yy" +#line 2778 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Phase(yystack_[0].value.as < std::string > ())); } @@ -5120,7 +5120,7 @@ namespace yy { break; case 375: // act: "Prepend" -#line 2780 "seclang-parser.yy" +#line 2782 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("Prepend", yystack_[1].location); } @@ -5128,7 +5128,7 @@ namespace yy { break; case 376: // act: "Proxy" -#line 2784 "seclang-parser.yy" +#line 2786 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("Proxy", yystack_[1].location); } @@ -5136,7 +5136,7 @@ namespace yy { break; case 377: // act: "Redirect" run_time_string -#line 2788 "seclang-parser.yy" +#line 2790 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Redirect(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5144,7 +5144,7 @@ namespace yy { break; case 378: // act: "Rev" -#line 2792 "seclang-parser.yy" +#line 2794 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Rev(yystack_[0].value.as < std::string > ())); } @@ -5152,7 +5152,7 @@ namespace yy { break; case 379: // act: "SanitiseArg" -#line 2796 "seclang-parser.yy" +#line 2798 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("SanitiseArg", yystack_[1].location); } @@ -5160,7 +5160,7 @@ namespace yy { break; case 380: // act: "SanitiseMatched" -#line 2800 "seclang-parser.yy" +#line 2802 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("SanitiseMatched", yystack_[1].location); } @@ -5168,7 +5168,7 @@ namespace yy { break; case 381: // act: "SanitiseMatchedBytes" -#line 2804 "seclang-parser.yy" +#line 2806 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("SanitiseMatchedBytes", yystack_[1].location); } @@ -5176,7 +5176,7 @@ namespace yy { break; case 382: // act: "SanitiseRequestHeader" -#line 2808 "seclang-parser.yy" +#line 2810 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("SanitiseRequestHeader", yystack_[1].location); } @@ -5184,7 +5184,7 @@ namespace yy { break; case 383: // act: "SanitiseResponseHeader" -#line 2812 "seclang-parser.yy" +#line 2814 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("SanitiseResponseHeader", yystack_[1].location); } @@ -5192,7 +5192,7 @@ namespace yy { break; case 384: // act: "SetEnv" run_time_string -#line 2816 "seclang-parser.yy" +#line 2818 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetENV(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5200,7 +5200,7 @@ namespace yy { break; case 385: // act: "SetRsc" run_time_string -#line 2820 "seclang-parser.yy" +#line 2822 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetRSC(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5208,7 +5208,7 @@ namespace yy { break; case 386: // act: "SetSid" run_time_string -#line 2824 "seclang-parser.yy" +#line 2826 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetSID(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5216,7 +5216,7 @@ namespace yy { break; case 387: // act: "SetUID" run_time_string -#line 2828 "seclang-parser.yy" +#line 2830 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetUID(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5224,7 +5224,7 @@ namespace yy { break; case 388: // act: "SetVar" setvar_action -#line 2832 "seclang-parser.yy" +#line 2834 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); } @@ -5232,7 +5232,7 @@ namespace yy { break; case 389: // act: "Severity" -#line 2836 "seclang-parser.yy" +#line 2838 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Severity(yystack_[0].value.as < std::string > ())); } @@ -5240,7 +5240,7 @@ namespace yy { break; case 390: // act: "Skip" -#line 2840 "seclang-parser.yy" +#line 2842 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Skip(yystack_[0].value.as < std::string > ())); } @@ -5248,7 +5248,7 @@ namespace yy { break; case 391: // act: "SkipAfter" -#line 2844 "seclang-parser.yy" +#line 2846 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SkipAfter(yystack_[0].value.as < std::string > ())); } @@ -5256,7 +5256,7 @@ namespace yy { break; case 392: // act: "Status" -#line 2848 "seclang-parser.yy" +#line 2850 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::data::Status(yystack_[0].value.as < std::string > ())); } @@ -5264,7 +5264,7 @@ namespace yy { break; case 393: // act: "Tag" run_time_string -#line 2852 "seclang-parser.yy" +#line 2854 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Tag(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5272,7 +5272,7 @@ namespace yy { break; case 394: // act: "Ver" -#line 2856 "seclang-parser.yy" +#line 2858 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Ver(yystack_[0].value.as < std::string > ())); } @@ -5280,7 +5280,7 @@ namespace yy { break; case 395: // act: "xmlns" -#line 2860 "seclang-parser.yy" +#line 2862 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::XmlNS(yystack_[0].value.as < std::string > ())); } @@ -5288,7 +5288,7 @@ namespace yy { break; case 396: // act: "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" -#line 2864 "seclang-parser.yy" +#line 2866 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ParityZero7bit(yystack_[0].value.as < std::string > ())); } @@ -5296,7 +5296,7 @@ namespace yy { break; case 397: // act: "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" -#line 2868 "seclang-parser.yy" +#line 2870 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ParityOdd7bit(yystack_[0].value.as < std::string > ())); } @@ -5304,7 +5304,7 @@ namespace yy { break; case 398: // act: "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" -#line 2872 "seclang-parser.yy" +#line 2874 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ParityEven7bit(yystack_[0].value.as < std::string > ())); } @@ -5312,7 +5312,7 @@ namespace yy { break; case 399: // act: "ACTION_TRANSFORMATION_SQL_HEX_DECODE" -#line 2876 "seclang-parser.yy" +#line 2878 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::SqlHexDecode(yystack_[0].value.as < std::string > ())); } @@ -5320,7 +5320,7 @@ namespace yy { break; case 400: // act: "ACTION_TRANSFORMATION_BASE_64_ENCODE" -#line 2880 "seclang-parser.yy" +#line 2882 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Base64Encode(yystack_[0].value.as < std::string > ())); } @@ -5328,7 +5328,7 @@ namespace yy { break; case 401: // act: "ACTION_TRANSFORMATION_BASE_64_DECODE" -#line 2884 "seclang-parser.yy" +#line 2886 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Base64Decode(yystack_[0].value.as < std::string > ())); } @@ -5336,7 +5336,7 @@ namespace yy { break; case 402: // act: "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" -#line 2888 "seclang-parser.yy" +#line 2890 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Base64DecodeExt(yystack_[0].value.as < std::string > ())); } @@ -5344,7 +5344,7 @@ namespace yy { break; case 403: // act: "ACTION_TRANSFORMATION_CMD_LINE" -#line 2892 "seclang-parser.yy" +#line 2894 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::CmdLine(yystack_[0].value.as < std::string > ())); } @@ -5352,7 +5352,7 @@ namespace yy { break; case 404: // act: "ACTION_TRANSFORMATION_SHA1" -#line 2896 "seclang-parser.yy" +#line 2898 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Sha1(yystack_[0].value.as < std::string > ())); } @@ -5360,7 +5360,7 @@ namespace yy { break; case 405: // act: "ACTION_TRANSFORMATION_MD5" -#line 2900 "seclang-parser.yy" +#line 2902 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Md5(yystack_[0].value.as < std::string > ())); } @@ -5368,7 +5368,7 @@ namespace yy { break; case 406: // act: "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" -#line 2904 "seclang-parser.yy" +#line 2906 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::EscapeSeqDecode(yystack_[0].value.as < std::string > ())); } @@ -5376,7 +5376,7 @@ namespace yy { break; case 407: // act: "ACTION_TRANSFORMATION_HEX_ENCODE" -#line 2908 "seclang-parser.yy" +#line 2910 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::HexEncode(yystack_[0].value.as < std::string > ())); } @@ -5384,7 +5384,7 @@ namespace yy { break; case 408: // act: "ACTION_TRANSFORMATION_HEX_DECODE" -#line 2912 "seclang-parser.yy" +#line 2914 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::HexDecode(yystack_[0].value.as < std::string > ())); } @@ -5392,7 +5392,7 @@ namespace yy { break; case 409: // act: "ACTION_TRANSFORMATION_LOWERCASE" -#line 2916 "seclang-parser.yy" +#line 2918 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::LowerCase(yystack_[0].value.as < std::string > ())); } @@ -5400,7 +5400,7 @@ namespace yy { break; case 410: // act: "ACTION_TRANSFORMATION_PHP_ARGS_NAMES" -#line 2920 "seclang-parser.yy" +#line 2922 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::PhpArgsNames(yystack_[0].value.as < std::string > ())); } @@ -5408,7 +5408,7 @@ namespace yy { break; case 411: // act: "ACTION_TRANSFORMATION_UPPERCASE" -#line 2924 "seclang-parser.yy" +#line 2926 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UpperCase(yystack_[0].value.as < std::string > ())); } @@ -5416,7 +5416,7 @@ namespace yy { break; case 412: // act: "ACTION_TRANSFORMATION_URL_DECODE_UNI" -#line 2928 "seclang-parser.yy" +#line 2930 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UrlDecodeUni(yystack_[0].value.as < std::string > ())); } @@ -5424,7 +5424,7 @@ namespace yy { break; case 413: // act: "ACTION_TRANSFORMATION_URL_DECODE" -#line 2932 "seclang-parser.yy" +#line 2934 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UrlDecode(yystack_[0].value.as < std::string > ())); } @@ -5432,7 +5432,7 @@ namespace yy { break; case 414: // act: "ACTION_TRANSFORMATION_URL_ENCODE" -#line 2936 "seclang-parser.yy" +#line 2938 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UrlEncode(yystack_[0].value.as < std::string > ())); } @@ -5440,7 +5440,7 @@ namespace yy { break; case 415: // act: "ACTION_TRANSFORMATION_NONE" -#line 2940 "seclang-parser.yy" +#line 2942 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::None(yystack_[0].value.as < std::string > ())); } @@ -5448,7 +5448,7 @@ namespace yy { break; case 416: // act: "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" -#line 2944 "seclang-parser.yy" +#line 2946 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::CompressWhitespace(yystack_[0].value.as < std::string > ())); } @@ -5456,7 +5456,7 @@ namespace yy { break; case 417: // act: "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" -#line 2948 "seclang-parser.yy" +#line 2950 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveWhitespace(yystack_[0].value.as < std::string > ())); } @@ -5464,7 +5464,7 @@ namespace yy { break; case 418: // act: "ACTION_TRANSFORMATION_REPLACE_NULLS" -#line 2952 "seclang-parser.yy" +#line 2954 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ReplaceNulls(yystack_[0].value.as < std::string > ())); } @@ -5472,7 +5472,7 @@ namespace yy { break; case 419: // act: "ACTION_TRANSFORMATION_REMOVE_NULLS" -#line 2956 "seclang-parser.yy" +#line 2958 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveNulls(yystack_[0].value.as < std::string > ())); } @@ -5480,7 +5480,7 @@ namespace yy { break; case 420: // act: "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" -#line 2960 "seclang-parser.yy" +#line 2962 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::HtmlEntityDecode(yystack_[0].value.as < std::string > ())); } @@ -5488,7 +5488,7 @@ namespace yy { break; case 421: // act: "ACTION_TRANSFORMATION_JS_DECODE" -#line 2964 "seclang-parser.yy" +#line 2966 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::JsDecode(yystack_[0].value.as < std::string > ())); } @@ -5496,7 +5496,7 @@ namespace yy { break; case 422: // act: "ACTION_TRANSFORMATION_CSS_DECODE" -#line 2968 "seclang-parser.yy" +#line 2970 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::CssDecode(yystack_[0].value.as < std::string > ())); } @@ -5504,7 +5504,7 @@ namespace yy { break; case 423: // act: "ACTION_TRANSFORMATION_TRIM" -#line 2972 "seclang-parser.yy" +#line 2974 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Trim(yystack_[0].value.as < std::string > ())); } @@ -5512,7 +5512,7 @@ namespace yy { break; case 424: // act: "ACTION_TRANSFORMATION_TRIM_LEFT" -#line 2976 "seclang-parser.yy" +#line 2978 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::TrimLeft(yystack_[0].value.as < std::string > ())); } @@ -5520,7 +5520,7 @@ namespace yy { break; case 425: // act: "ACTION_TRANSFORMATION_TRIM_RIGHT" -#line 2980 "seclang-parser.yy" +#line 2982 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::TrimRight(yystack_[0].value.as < std::string > ())); } @@ -5528,7 +5528,7 @@ namespace yy { break; case 426: // act: "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" -#line 2984 "seclang-parser.yy" +#line 2986 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::NormalisePathWin(yystack_[0].value.as < std::string > ())); } @@ -5536,7 +5536,7 @@ namespace yy { break; case 427: // act: "ACTION_TRANSFORMATION_NORMALISE_PATH" -#line 2988 "seclang-parser.yy" +#line 2990 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::NormalisePath(yystack_[0].value.as < std::string > ())); } @@ -5544,7 +5544,7 @@ namespace yy { break; case 428: // act: "ACTION_TRANSFORMATION_LENGTH" -#line 2992 "seclang-parser.yy" +#line 2994 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Length(yystack_[0].value.as < std::string > ())); } @@ -5552,7 +5552,7 @@ namespace yy { break; case 429: // act: "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" -#line 2996 "seclang-parser.yy" +#line 2998 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Utf8ToUnicode(yystack_[0].value.as < std::string > ())); } @@ -5560,7 +5560,7 @@ namespace yy { break; case 430: // act: "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" -#line 3000 "seclang-parser.yy" +#line 3002 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveCommentsChar(yystack_[0].value.as < std::string > ())); } @@ -5568,7 +5568,7 @@ namespace yy { break; case 431: // act: "ACTION_TRANSFORMATION_REMOVE_COMMENTS" -#line 3004 "seclang-parser.yy" +#line 3006 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveComments(yystack_[0].value.as < std::string > ())); } @@ -5576,7 +5576,7 @@ namespace yy { break; case 432: // act: "ACTION_TRANSFORMATION_REPLACE_COMMENTS" -#line 3008 "seclang-parser.yy" +#line 3010 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ReplaceComments(yystack_[0].value.as < std::string > ())); } @@ -5584,7 +5584,7 @@ namespace yy { break; case 433: // setvar_action: "NOT" var -#line 3015 "seclang-parser.yy" +#line 3017 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::unsetOperation, std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5592,7 +5592,7 @@ namespace yy { break; case 434: // setvar_action: var -#line 3019 "seclang-parser.yy" +#line 3021 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::setToOneOperation, std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5600,7 +5600,7 @@ namespace yy { break; case 435: // setvar_action: var SETVAR_OPERATION_EQUALS run_time_string -#line 3023 "seclang-parser.yy" +#line 3025 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::setOperation, std::move(yystack_[2].value.as < std::unique_ptr > ()), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5608,7 +5608,7 @@ namespace yy { break; case 436: // setvar_action: var SETVAR_OPERATION_EQUALS_PLUS run_time_string -#line 3027 "seclang-parser.yy" +#line 3029 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::sumAndSetOperation, std::move(yystack_[2].value.as < std::unique_ptr > ()), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5616,7 +5616,7 @@ namespace yy { break; case 437: // setvar_action: var SETVAR_OPERATION_EQUALS_MINUS run_time_string -#line 3031 "seclang-parser.yy" +#line 3033 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::substractAndSetOperation, std::move(yystack_[2].value.as < std::unique_ptr > ()), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -5624,7 +5624,7 @@ namespace yy { break; case 438: // run_time_string: run_time_string "FREE_TEXT_QUOTE_MACRO_EXPANSION" -#line 3038 "seclang-parser.yy" +#line 3040 "seclang-parser.yy" { yystack_[1].value.as < std::unique_ptr > ()->appendText(yystack_[0].value.as < std::string > ()); yylhs.value.as < std::unique_ptr > () = std::move(yystack_[1].value.as < std::unique_ptr > ()); @@ -5633,7 +5633,7 @@ namespace yy { break; case 439: // run_time_string: run_time_string var -#line 3043 "seclang-parser.yy" +#line 3045 "seclang-parser.yy" { yystack_[1].value.as < std::unique_ptr > ()->appendVar(std::move(yystack_[0].value.as < std::unique_ptr > ())); yylhs.value.as < std::unique_ptr > () = std::move(yystack_[1].value.as < std::unique_ptr > ()); @@ -5642,7 +5642,7 @@ namespace yy { break; case 440: // run_time_string: "FREE_TEXT_QUOTE_MACRO_EXPANSION" -#line 3048 "seclang-parser.yy" +#line 3050 "seclang-parser.yy" { std::unique_ptr r(new RunTimeString()); r->appendText(yystack_[0].value.as < std::string > ()); @@ -5652,7 +5652,7 @@ namespace yy { break; case 441: // run_time_string: var -#line 3054 "seclang-parser.yy" +#line 3056 "seclang-parser.yy" { std::unique_ptr r(new RunTimeString()); r->appendVar(std::move(yystack_[0].value.as < std::unique_ptr > ())); @@ -7158,51 +7158,51 @@ namespace yy { const short seclang_parser::yyrline_[] = { - 0, 712, 712, 716, 717, 720, 725, 731, 737, 741, - 745, 751, 757, 763, 769, 774, 779, 785, 792, 796, - 800, 806, 810, 814, 819, 824, 829, 834, 838, 845, - 849, 856, 862, 872, 881, 891, 900, 913, 917, 921, - 925, 929, 933, 937, 941, 945, 949, 954, 958, 962, - 966, 970, 974, 979, 984, 988, 992, 996, 1000, 1004, - 1008, 1012, 1016, 1020, 1024, 1028, 1032, 1036, 1040, 1044, - 1048, 1052, 1056, 1060, 1074, 1075, 1107, 1126, 1147, 1177, - 1239, 1246, 1250, 1254, 1258, 1262, 1266, 1270, 1274, 1283, - 1287, 1292, 1295, 1300, 1305, 1310, 1315, 1318, 1323, 1326, - 1331, 1336, 1339, 1344, 1349, 1354, 1359, 1364, 1369, 1374, - 1377, 1382, 1387, 1392, 1397, 1400, 1405, 1410, 1415, 1428, - 1441, 1454, 1467, 1480, 1506, 1534, 1546, 1566, 1593, 1599, - 1604, 1609, 1618, 1623, 1627, 1631, 1635, 1639, 1643, 1647, - 1652, 1657, 1669, 1675, 1679, 1683, 1694, 1703, 1704, 1711, - 1716, 1721, 1775, 1782, 1790, 1827, 1831, 1838, 1843, 1849, - 1855, 1861, 1868, 1878, 1882, 1886, 1890, 1894, 1898, 1902, - 1906, 1910, 1914, 1918, 1922, 1926, 1930, 1934, 1938, 1942, - 1946, 1950, 1954, 1958, 1962, 1966, 1970, 1974, 1978, 1982, - 1986, 1990, 1994, 1998, 2002, 2006, 2010, 2014, 2018, 2022, - 2026, 2030, 2034, 2038, 2042, 2046, 2050, 2054, 2058, 2062, - 2066, 2070, 2074, 2078, 2082, 2086, 2090, 2094, 2098, 2102, - 2106, 2110, 2114, 2118, 2122, 2126, 2130, 2134, 2138, 2142, - 2146, 2150, 2154, 2158, 2162, 2166, 2170, 2174, 2178, 2182, - 2186, 2190, 2194, 2198, 2202, 2206, 2210, 2214, 2218, 2222, - 2226, 2230, 2234, 2239, 2243, 2247, 2252, 2256, 2260, 2265, - 2270, 2274, 2278, 2282, 2286, 2290, 2294, 2298, 2302, 2306, - 2310, 2314, 2318, 2322, 2326, 2330, 2334, 2338, 2342, 2346, - 2350, 2354, 2358, 2362, 2366, 2370, 2374, 2378, 2382, 2386, - 2390, 2394, 2398, 2402, 2406, 2410, 2414, 2418, 2422, 2426, - 2430, 2434, 2438, 2442, 2446, 2450, 2454, 2458, 2462, 2466, - 2470, 2474, 2478, 2482, 2486, 2490, 2494, 2498, 2502, 2506, - 2510, 2518, 2525, 2532, 2539, 2546, 2553, 2560, 2567, 2574, - 2581, 2588, 2595, 2605, 2609, 2613, 2617, 2621, 2625, 2629, - 2633, 2638, 2643, 2648, 2652, 2656, 2660, 2664, 2669, 2674, - 2678, 2682, 2686, 2690, 2694, 2698, 2702, 2706, 2710, 2714, - 2718, 2722, 2726, 2731, 2735, 2739, 2743, 2747, 2751, 2755, - 2759, 2763, 2767, 2771, 2775, 2779, 2783, 2787, 2791, 2795, - 2799, 2803, 2807, 2811, 2815, 2819, 2823, 2827, 2831, 2835, - 2839, 2843, 2847, 2851, 2855, 2859, 2863, 2867, 2871, 2875, - 2879, 2883, 2887, 2891, 2895, 2899, 2903, 2907, 2911, 2915, - 2919, 2923, 2927, 2931, 2935, 2939, 2943, 2947, 2951, 2955, - 2959, 2963, 2967, 2971, 2975, 2979, 2983, 2987, 2991, 2995, - 2999, 3003, 3007, 3014, 3018, 3022, 3026, 3030, 3037, 3042, - 3047, 3053 + 0, 714, 714, 718, 719, 722, 727, 733, 739, 743, + 747, 753, 759, 765, 771, 776, 781, 787, 794, 798, + 802, 808, 812, 816, 821, 826, 831, 836, 840, 847, + 851, 858, 864, 874, 883, 893, 902, 915, 919, 923, + 927, 931, 935, 939, 943, 947, 951, 956, 960, 964, + 968, 972, 976, 981, 986, 990, 994, 998, 1002, 1006, + 1010, 1014, 1018, 1022, 1026, 1030, 1034, 1038, 1042, 1046, + 1050, 1054, 1058, 1062, 1076, 1077, 1109, 1128, 1149, 1179, + 1241, 1248, 1252, 1256, 1260, 1264, 1268, 1272, 1276, 1285, + 1289, 1294, 1297, 1302, 1307, 1312, 1317, 1320, 1325, 1328, + 1333, 1338, 1341, 1346, 1351, 1356, 1361, 1366, 1371, 1376, + 1379, 1384, 1389, 1394, 1399, 1402, 1407, 1412, 1417, 1430, + 1443, 1456, 1469, 1482, 1508, 1536, 1548, 1568, 1595, 1601, + 1606, 1611, 1620, 1625, 1629, 1633, 1637, 1641, 1645, 1649, + 1654, 1659, 1671, 1677, 1681, 1685, 1696, 1705, 1706, 1713, + 1718, 1723, 1777, 1784, 1792, 1829, 1833, 1840, 1845, 1851, + 1857, 1863, 1870, 1880, 1884, 1888, 1892, 1896, 1900, 1904, + 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936, 1940, 1944, + 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, + 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, + 2028, 2032, 2036, 2040, 2044, 2048, 2052, 2056, 2060, 2064, + 2068, 2072, 2076, 2080, 2084, 2088, 2092, 2096, 2100, 2104, + 2108, 2112, 2116, 2120, 2124, 2128, 2132, 2136, 2140, 2144, + 2148, 2152, 2156, 2160, 2164, 2168, 2172, 2176, 2180, 2184, + 2188, 2192, 2196, 2200, 2204, 2208, 2212, 2216, 2220, 2224, + 2228, 2232, 2236, 2241, 2245, 2249, 2254, 2258, 2262, 2267, + 2272, 2276, 2280, 2284, 2288, 2292, 2296, 2300, 2304, 2308, + 2312, 2316, 2320, 2324, 2328, 2332, 2336, 2340, 2344, 2348, + 2352, 2356, 2360, 2364, 2368, 2372, 2376, 2380, 2384, 2388, + 2392, 2396, 2400, 2404, 2408, 2412, 2416, 2420, 2424, 2428, + 2432, 2436, 2440, 2444, 2448, 2452, 2456, 2460, 2464, 2468, + 2472, 2476, 2480, 2484, 2488, 2492, 2496, 2500, 2504, 2508, + 2512, 2520, 2527, 2534, 2541, 2548, 2555, 2562, 2569, 2576, + 2583, 2590, 2597, 2607, 2611, 2615, 2619, 2623, 2627, 2631, + 2635, 2640, 2645, 2650, 2654, 2658, 2662, 2666, 2671, 2676, + 2680, 2684, 2688, 2692, 2696, 2700, 2704, 2708, 2712, 2716, + 2720, 2724, 2728, 2733, 2737, 2741, 2745, 2749, 2753, 2757, + 2761, 2765, 2769, 2773, 2777, 2781, 2785, 2789, 2793, 2797, + 2801, 2805, 2809, 2813, 2817, 2821, 2825, 2829, 2833, 2837, + 2841, 2845, 2849, 2853, 2857, 2861, 2865, 2869, 2873, 2877, + 2881, 2885, 2889, 2893, 2897, 2901, 2905, 2909, 2913, 2917, + 2921, 2925, 2929, 2933, 2937, 2941, 2945, 2949, 2953, 2957, + 2961, 2965, 2969, 2973, 2977, 2981, 2985, 2989, 2993, 2997, + 3001, 3005, 3009, 3016, 3020, 3024, 3028, 3032, 3039, 3044, + 3049, 3055 }; void @@ -7236,7 +7236,7 @@ namespace yy { } // yy #line 7238 "seclang-parser.cc" -#line 3060 "seclang-parser.yy" +#line 3062 "seclang-parser.yy" void yy::seclang_parser::error (const location_type& l, const std::string& m) { diff --git a/src/parser/seclang-parser.hh b/src/parser/seclang-parser.hh index 1db831f2..0d0b5edf 100644 --- a/src/parser/seclang-parser.hh +++ b/src/parser/seclang-parser.hh @@ -57,6 +57,8 @@ class Driver; } #include "modsecurity/rule_unconditional.h" +#include "modsecurity/rule_with_operator.h" +#include "modsecurity/rule_with_actions.h" #include "src/rule_script.h" #include "src/actions/accuracy.h" @@ -351,7 +353,7 @@ using namespace modsecurity::operators; a = std::move(c); -#line 355 "seclang-parser.hh" +#line 357 "seclang-parser.hh" # include # include // std::abort @@ -485,7 +487,7 @@ using namespace modsecurity::operators; #endif namespace yy { -#line 489 "seclang-parser.hh" +#line 491 "seclang-parser.hh" @@ -8626,7 +8628,7 @@ switch (yykind) } } // yy -#line 8630 "seclang-parser.hh" +#line 8632 "seclang-parser.hh" diff --git a/src/parser/seclang-parser.yy b/src/parser/seclang-parser.yy index 99d626be..064cf11d 100644 --- a/src/parser/seclang-parser.yy +++ b/src/parser/seclang-parser.yy @@ -18,6 +18,8 @@ class Driver; } #include "modsecurity/rule_unconditional.h" +#include "modsecurity/rule_with_operator.h" +#include "modsecurity/rule_with_actions.h" #include "src/rule_script.h" #include "src/actions/accuracy.h" @@ -1193,8 +1195,8 @@ expression: definedPhase = phase->m_phase; secRuleDefinedPhase = phase->m_secRulesPhase; delete phase; - } else if (a->action_kind == actions::Action::RunTimeOnlyIfMatchKind || - a->action_kind == actions::Action::RunTimeBeforeMatchAttemptKind) { + } else if (a->m_actionKind == actions::Action::RunTimeOnlyIfMatchKind || + a->m_actionKind == actions::Action::RunTimeBeforeMatchAttemptKind) { actions::transformations::None *none = dynamic_cast(a); if (none != NULL) { driver.error(@0, "The transformation none is not suitable to be part of the SecDefaultActions"); diff --git a/src/rule_script.h b/src/rule_script.h index 2e4c2086..6375d8ee 100644 --- a/src/rule_script.h +++ b/src/rule_script.h @@ -32,6 +32,8 @@ #include "src/actions/log_data.h" #include "src/actions/severity.h" #include "src/variables/variable.h" +#include "modsecurity/rule_with_actions.h" + #ifndef SRC_RULE_SCRIPT_H_ #define SRC_RULE_SCRIPT_H_ diff --git a/src/rule_with_actions.cc b/src/rule_with_actions.cc index f85ae451..27abceb2 100644 --- a/src/rule_with_actions.cc +++ b/src/rule_with_actions.cc @@ -104,12 +104,7 @@ RuleWithActions::RuleWithActions( } void RuleWithActions::addDefaultAction(std::shared_ptr a) { - if (a->action_kind == Action::ConfigurationKind) { - a->execute(this, NULL); - return; - } - - if (a->action_kind == Action::ConfigurationKind) { + if (a->m_actionKind == Action::ConfigurationKind) { if (dynamic_cast(a.get())) { actions::Accuracy *accuracy = dynamic_cast(a.get()); m_defaultAccuracy = accuracy->getAccuracy(); @@ -122,7 +117,7 @@ void RuleWithActions::addDefaultAction(std::shared_ptr a) { return; } - if (a->action_kind == Action::RunTimeOnlyIfMatchKind) { + if (a->m_actionKind == Action::RunTimeOnlyIfMatchKind) { if (dynamic_cast(a.get())) { m_defaultContainsCaptureAction = true; } else if (dynamic_cast(a.get())) { @@ -163,7 +158,7 @@ void RuleWithActions::addDefaultAction(std::shared_ptr a) { } void RuleWithActions::addAction(actions::Action *a) { - if (a->action_kind == Action::ConfigurationKind) { + if (a->m_actionKind == Action::ConfigurationKind) { if (dynamic_cast(a)) { actions::Accuracy *accuracy = dynamic_cast(a); m_accuracy = accuracy->getAccuracy(); @@ -177,7 +172,7 @@ void RuleWithActions::addAction(actions::Action *a) { return; } - if (a->action_kind == Action::RunTimeOnlyIfMatchKind) { + if (a->m_actionKind == Action::RunTimeOnlyIfMatchKind) { if (dynamic_cast(a)) { m_containsCaptureAction = true; delete a; @@ -269,7 +264,7 @@ void RuleWithActions::executeActionsAfterFullMatch(Transaction *trans) { #if 0 for (auto &a : trans->m_rules->m_defaultActions[getPhase()]) { - if (a.get()->action_kind != actions::Action::RunTimeOnlyIfMatchKind) { + if (a.get()->m_actionKind != actions::Action::RunTimeOnlyIfMatchKind) { continue; } if (!a.get()->isDisruptive()) { @@ -364,7 +359,7 @@ void RuleWithActions::executeTransformations( TransformationsResults &results) { int none = 0; - ModSecStackString ssin; + ModSecString ssin; ssin.assign(in.c_str()); TransformationResult a = TransformationResult(&ssin); @@ -375,9 +370,8 @@ void RuleWithActions::executeTransformations( std::shared_ptr value = std::shared_ptr(new std::string(in)); - - for (Action *action : getTransformationPtr()) { - if (action->m_isNone) { + for (Transformation *action : getTransformationPtr()) { + if (action->isNone()) { none++; } } @@ -386,7 +380,7 @@ void RuleWithActions::executeTransformations( if (none == 0) { executeTransformation(trans, &results, t); } - if (t->m_isNone) { + if (t->isNone()) { none--; } } @@ -399,7 +393,7 @@ void RuleWithActions::executeTransformations( continue; } Transformation *t = dynamic_cast(b.second.get()); - if (t->m_isNone) { + if (t->isNone()) { none++; } } @@ -413,7 +407,7 @@ void RuleWithActions::executeTransformations( if (none == 0) { executeTransformation(trans, &results, t); } - if (t->m_isNone) { + if (t->isNone()) { none--; } } @@ -447,11 +441,11 @@ void RuleWithActions::executeTransformation( void RuleWithActions::executeTransformation( Transaction *transaction, - ModSecStackString in, + ModSecString in, TransformationsResults *ret, Transformation *transformation) { - ModSecStackString out; + ModSecString out; transformation->execute(transaction, in, out); ms_dbg_a(transaction, 9, " T (" + std::to_string(ret->size() - 1) + ") " + \ diff --git a/src/rules.cc b/src/rules.cc index 4666deb0..b35664fb 100644 --- a/src/rules.cc +++ b/src/rules.cc @@ -14,7 +14,7 @@ */ #include "modsecurity/rules.h" -#include "src/rule_with_actions.h" +#include "modsecurity/rule_with_actions.h" namespace modsecurity { @@ -37,14 +37,14 @@ int Rules::append(Rules *from, const std::vector &ids, std::ostringstre } -bool Rules::insert(std::shared_ptr rule) { +bool Rules::insert(const std::shared_ptr &rule) { return insert(rule, nullptr, nullptr); } bool Rules::insert(std::shared_ptr rule, const std::vector *ids, std::ostringstream *err) { RuleWithActions*r = dynamic_cast(rule.get()); - if (r && ids != nullptr && err != nullptr + if (r && ids != nullptr && std::binary_search(ids->begin(), ids->end(), r->getId())) { if (err != NULL) { *err << "Rule id: " << std::to_string(r->getId()) \ @@ -57,22 +57,22 @@ bool Rules::insert(std::shared_ptr rule, const std::vector *ids, } -size_t Rules::size() { +size_t Rules::size() const { return m_rules.size(); } -std::shared_ptr Rules::operator[](int index) { +std::shared_ptr Rules::operator[](int index) const { return m_rules[index]; } -std::shared_ptr Rules::at(int index) { +std::shared_ptr Rules::at(int index) const { return m_rules[index]; } -void Rules::dump() { +void Rules::dump() const { for (int j = 0; j < m_rules.size(); j++) { std::cout << " Rule ID: " << m_rules.at(j)->getReference(); std::cout << "--" << m_rules.at(j) << std::endl; diff --git a/src/rules_exceptions.cc b/src/rules_exceptions.cc index 93b23a43..4259ac09 100644 --- a/src/rules_exceptions.cc +++ b/src/rules_exceptions.cc @@ -36,15 +36,15 @@ bool RulesExceptions::loadUpdateActionById(double id, std::string *error) { for (auto &a : *actions) { - if (a->action_kind == actions::Action::ConfigurationKind) { + if (a->m_actionKind == actions::Action::ConfigurationKind) { std::cout << "General failure, action: " << a->m_name; std::cout << " has not expected to be used with UpdateActionByID."; std::cout << std::endl; - } else if (a->action_kind + } else if (a->m_actionKind == actions::Action::RunTimeBeforeMatchAttemptKind) { m_action_pre_update_target_by_id.emplace(std::pair>(id , std::move(a))); - } else if (a->action_kind == actions::Action::RunTimeOnlyIfMatchKind) { + } else if (a->m_actionKind == actions::Action::RunTimeOnlyIfMatchKind) { m_action_pos_update_target_by_id.emplace(std::pair>(id , std::move(a))); } else { diff --git a/src/run_time_string.cc b/src/run_time_string.cc index 604467e8..a470f5e7 100644 --- a/src/run_time_string.cc +++ b/src/run_time_string.cc @@ -25,6 +25,7 @@ #include "src/variables/highest_severity.h" #include "src/utils/string.h" #include "src/variables/variable.h" +#include "modsecurity/rule_with_operator.h" namespace modsecurity { diff --git a/src/variables/rule.h b/src/variables/rule.h index b313b188..76d13a8c 100644 --- a/src/variables/rule.h +++ b/src/variables/rule.h @@ -24,7 +24,7 @@ #include "src/actions/severity.h" #include "src/actions/log_data.h" #include "src/actions/msg.h" - +#include "modsecurity/rule_with_actions.h" namespace modsecurity { diff --git a/src/variables/xml.cc b/src/variables/xml.cc index 853db8f7..8e434c86 100644 --- a/src/variables/xml.cc +++ b/src/variables/xml.cc @@ -42,6 +42,8 @@ #include "src/request_body_processor/xml.h" #include "modsecurity/actions/action.h" #include "src/actions/xmlns.h" +#include "modsecurity/rule_with_actions.h" + namespace modsecurity { namespace variables { diff --git a/test/cppcheck_suppressions.txt b/test/cppcheck_suppressions.txt index 520ad2d9..948fcdd2 100644 --- a/test/cppcheck_suppressions.txt +++ b/test/cppcheck_suppressions.txt @@ -55,7 +55,7 @@ noConstructor:src/variables/variable.h:152 duplicateBranch:src/request_body_processor/multipart.cc:93 danglingTempReference:src/modsecurity.cc:204 knownConditionTrueFalse:src/operators/validate_url_encoding.cc:77 -knownConditionTrueFalse:src/operators/verify_svnr.cc:87 +knownConditionTrueFalse:src/operators/verify_svnr.cc:88 noExplicitConstructor:seclang-parser.hh diff --git a/test/unit/unit.cc b/test/unit/unit.cc index 9973ca27..40b47dfb 100644 --- a/test/unit/unit.cc +++ b/test/unit/unit.cc @@ -90,8 +90,8 @@ void perform_unit_test(ModSecurityTest *test, UnitTest *t, } delete op; } else if (t->type == "tfn") { - modsecurity::ModSecStackString in; - modsecurity::ModSecStackString out; + modsecurity::ModSecString in; + modsecurity::ModSecString out; std::string ret; in.assign(t->input.c_str(), t->input.size()); Transformation *tfn = Transformation::instantiate("t:" + t->name);