Removes the depricated MacroExpansion class

This commit is contained in:
Felipe Zimmerle 2018-01-27 21:41:20 -03:00
parent f17af95728
commit 43bba3f942
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
38 changed files with 1919 additions and 2376 deletions

View File

@ -271,7 +271,6 @@ libmodsecurity_la_SOURCES = \
rules.cc \
debug_log/debug_log.cc \
debug_log/debug_log_writer.cc \
macro_expansion.cc \
run_time_string.cc \
rule.cc \
rule_message.cc \

View File

@ -21,7 +21,6 @@
#include "modsecurity/actions/action.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
namespace modsecurity {

View File

@ -21,7 +21,6 @@
#include <memory>
#include "modsecurity/transaction.h"
#include "src/macro_expansion.h"
#include "src/utils/string.h"
namespace modsecurity {

View File

@ -21,7 +21,6 @@
#include "modsecurity/actions/action.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
#include "src/utils/system.h"
#include "src/engine/lua.h"

View File

@ -21,7 +21,6 @@
#include "modsecurity/actions/action.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
namespace modsecurity {

View File

@ -21,7 +21,6 @@
#include "modsecurity/actions/action.h"
#include "modsecurity/transaction.h"
#include "src/macro_expansion.h"
#include "modsecurity/rule.h"
#include "modsecurity/rule_message.h"

View File

@ -21,7 +21,6 @@
#include "modsecurity/actions/action.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
namespace modsecurity {

View File

@ -21,7 +21,6 @@
#include "modsecurity/actions/action.h"
#include "modsecurity/transaction.h"
#include "src/macro_expansion.h"
#include "modsecurity/rule.h"
#include "modsecurity/rule_message.h"

View File

@ -21,7 +21,6 @@
#include "modsecurity/actions/action.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
namespace modsecurity {

View File

@ -20,7 +20,6 @@
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
namespace modsecurity {

View File

@ -20,7 +20,6 @@
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
namespace modsecurity {

View File

@ -20,7 +20,6 @@
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
namespace modsecurity {

View File

@ -22,7 +22,6 @@
#include "modsecurity/transaction.h"
#include "modsecurity/rules.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
#include "src/utils/string.h"
#include "src/variables/global.h"
#include "src/variables/ip.h"
@ -80,7 +79,6 @@ bool SetVar::evaluate(Rule *rule, Transaction *t) {
} else if (m_operation == setToOneOperation) {
targetValue = std::string("1");
} else if (m_operation == unsetOperation) {
//m_variable
t->m_collections.del(m_variable->m_collectionName + ":" +
m_variableNameExpanded);
goto end;

View File

@ -21,7 +21,6 @@
#include "modsecurity/actions/action.h"
#include "modsecurity/transaction.h"
#include "src/macro_expansion.h"
#include "modsecurity/rule.h"
#include "modsecurity/rule_message.h"

View File

@ -21,7 +21,7 @@
#include "modsecurity/actions/action.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace actions {

View File

@ -28,7 +28,6 @@
#include "modsecurity/modsecurity.h"
#include "src/utils/string.h"
#include "src/macro_expansion.h"
#include "modsecurity/transaction.h"
#include "modsecurity/collection/variable.h"
#include "src/variables/variable.h"

View File

@ -1,343 +0,0 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <memory>
#include "src/macro_expansion.h"
#include "modsecurity/transaction.h"
#include "modsecurity/collection/variable.h"
#include "src/variables/rule.h"
#include "src/variables/tx.h"
#include "src/variables/highest_severity.h"
#include "src/utils/string.h"
namespace modsecurity {
MacroExpansion::MacroExpansion() { }
std::string MacroExpansion::expandKeepOriginal(const std::string& input,
Transaction *transaction) {
std::string a = MacroExpansion::expand(input, transaction);
if (a != input) {
return "\"" + a + "\" (Was: " + input + ")";
}
return input;
}
std::string MacroExpansion::expand(const std::string& input,
Transaction *transaction) {
return expand(input, NULL, transaction);
}
bool MacroExpansion::containsMacro(std::string& input) {
size_t pos = input.find("%{");
size_t end = input.find("}");
if (pos == std::string::npos || end == std::string::npos) {
return false;
}
return true;
}
std::string MacroExpansion::expand(const std::string& input,
modsecurity::Rule *rule, Transaction *transaction) {
std::string res;
size_t pos = input.find("%{");
if (pos != std::string::npos) {
res = input;
} else {
return input;
}
while (pos != std::string::npos) {
size_t start = pos;
size_t end = res.find("}");
size_t new_pos = start;
if (end == std::string::npos) {
return res;
}
std::string variable(res, start + 2, end - (start + 2));
std::unique_ptr<std::string> variableValue = nullptr;
size_t collection = variable.find(".");
if (collection == std::string::npos) {
collection = variable.find(":");
}
if (collection == std::string::npos) {
if (compareStrNoCase(variable, "RESPONSE_CONTENT_TYPE")) {
variableValue = transaction->m_variableResponseContentType.resolveFirst();
}
else if (compareStrNoCase(variable, "ARGS_COMBINED_SIZE")) {
variableValue = transaction->m_variableARGScombinedSize.resolveFirst();
}
else if (compareStrNoCase(variable, "AUTH_TYPE")) {
variableValue = transaction->m_variableAuthType.resolveFirst();
}
else if (compareStrNoCase(variable, "FILES_COMBINED_SIZE")) {
variableValue = transaction->m_variableFilesCombinedSize.resolveFirst();
}
else if (compareStrNoCase(variable, "FULL_REQUEST")) {
variableValue = transaction->m_variableFullRequest.resolveFirst();
}
else if (compareStrNoCase(variable, "FULL_REQUEST_LENGTH")) {
variableValue = transaction->m_variableFullRequestLength.resolveFirst();
}
else if (compareStrNoCase(variable, "INBOUND_DATA_ERROR")) {
variableValue = transaction->m_variableInboundDataError.resolveFirst();
}
else if (compareStrNoCase(variable, "MATCHED_VAR")) {
variableValue = transaction->m_variableMatchedVar.resolveFirst();
}
else if (compareStrNoCase(variable, "MATCHED_VAR_NAME")) {
variableValue = transaction->m_variableMatchedVarName.resolveFirst();
}
else if (compareStrNoCase(variable, "MULTIPART_CRLF_LF_LINES")) {
variableValue = transaction->m_variableMultipartCrlfLFLines.resolveFirst();
}
else if (compareStrNoCase(variable, "MULTIPART_DATA_AFTER")) {
variableValue = transaction->m_variableMultipartDataAfter.resolveFirst();
}
else if (compareStrNoCase(variable, "MULTIPART_FILE_LIMIT_EXCEEDED")) {
variableValue = transaction->m_variableMultipartFileLimitExceeded.resolveFirst();
}
else if (compareStrNoCase(variable, "MULTIPART_STRICT_ERROR")) {
variableValue = transaction->m_variableMultipartStrictError.resolveFirst();
}
else if (compareStrNoCase(variable, "MULTIPART_HEADER_FOLDING")) {
variableValue = transaction->m_variableMultipartHeaderFolding.resolveFirst();
}
else if (compareStrNoCase(variable, "MULTIPART_INVALID_QUOTING")) {
variableValue = transaction->m_variableMultipartInvalidQuoting.resolveFirst();
}
else if (compareStrNoCase(variable, "MULTIPART_INVALID_HEADER_FOLDING")) {
variableValue = transaction->m_variableMultipartInvalidHeaderFolding.resolveFirst();
}
else if (compareStrNoCase(variable, "MULTIPART_UNMATCHED_BOUNDARY")) {
variableValue = transaction->m_variableMultipartUnmatchedBoundary.resolveFirst();
}
else if (compareStrNoCase(variable, "OUTBOUND_DATA_ERROR")) {
variableValue = transaction->m_variableOutboundDataError.resolveFirst();
}
else if (compareStrNoCase(variable, "PATH_INFO")) {
variableValue = transaction->m_variablePathInfo.resolveFirst();
}
else if (compareStrNoCase(variable, "QUERY_STRING")) {
variableValue = transaction->m_variableQueryString.resolveFirst();
}
else if (compareStrNoCase(variable, "REMOTE_ADDR")) {
variableValue = transaction->m_variableRemoteAddr.resolveFirst();
}
else if (compareStrNoCase(variable, "REMOTE_HOST")) {
variableValue = transaction->m_variableRemoteHost.resolveFirst();
}
else if (compareStrNoCase(variable, "REMOTE_PORT")) {
variableValue = transaction->m_variableRemotePort.resolveFirst();
}
else if (compareStrNoCase(variable, "REQBODY_ERROR")) {
variableValue = transaction->m_variableReqbodyError.resolveFirst();
}
else if (compareStrNoCase(variable, "REQBODY_ERROR_MSG")) {
variableValue = transaction->m_variableReqbodyErrorMsg.resolveFirst();
}
else if (compareStrNoCase(variable, "REQBODY_PROCESSOR_ERROR_MSG")) {
variableValue = transaction->m_variableReqbodyProcessorErrorMsg.resolveFirst();
}
else if (compareStrNoCase(variable, "REQBODY_PROCESSOR_ERROR")) {
variableValue = transaction->m_variableReqbodyProcessorError.resolveFirst();
}
else if (compareStrNoCase(variable, "REQBODY_PROCESSOR")) {
variableValue = transaction->m_variableReqbodyProcessor.resolveFirst();
}
else if (compareStrNoCase(variable, "REQUEST_BASENAME")) {
variableValue = transaction->m_variableRequestBasename.resolveFirst();
}
else if (compareStrNoCase(variable, "REQUEST_BODY")) {
variableValue = transaction->m_variableRequestBody.resolveFirst();
}
else if (compareStrNoCase(variable, "REQUEST_BODY_LENGTH")) {
variableValue = transaction->m_variableRequestBodyLength.resolveFirst();
}
else if (compareStrNoCase(variable, "REQUEST_FILENAME")) {
variableValue = transaction->m_variableRequestFilename.resolveFirst();
}
else if (compareStrNoCase(variable, "REQUEST_LINE")) {
variableValue = transaction->m_variableRequestLine.resolveFirst();
}
else if (compareStrNoCase(variable, "REQUEST_METHOD")) {
variableValue = transaction->m_variableRequestMethod.resolveFirst();
}
else if (compareStrNoCase(variable, "REQUEST_PROTOCOL")) {
variableValue = transaction->m_variableRequestProtocol.resolveFirst();
}
else if (compareStrNoCase(variable, "REQUEST_URI")) {
variableValue = transaction->m_variableRequestURI.resolveFirst();
}
else if (compareStrNoCase(variable, "REQUEST_URI_RAW")) {
variableValue = transaction->m_variableRequestURIRaw.resolveFirst();
}
else if (compareStrNoCase(variable, "RESOURCE")) {
variableValue = transaction->m_variableResource.resolveFirst();
}
else if (compareStrNoCase(variable, "RESPONSE_BODY")) {
variableValue = transaction->m_variableResponseBody.resolveFirst();
}
else if (compareStrNoCase(variable, "RESPONSE_CONTENT_LENGTH")) {
variableValue = transaction->m_variableResponseContentLength.resolveFirst();
}
else if (compareStrNoCase(variable, "RESPONSE_PROTOCOL")) {
variableValue = transaction->m_variableResponseProtocol.resolveFirst();
}
else if (compareStrNoCase(variable, "RESPONSE_STATUS")) {
variableValue = transaction->m_variableResponseStatus.resolveFirst();
}
else if (compareStrNoCase(variable, "SERVER_ADDR")) {
variableValue = transaction->m_variableServerAddr.resolveFirst();
}
else if (compareStrNoCase(variable, "SERVER_NAME")) {
variableValue = transaction->m_variableServerName.resolveFirst();
}
else if (compareStrNoCase(variable, "SERVER_PORT")) {
variableValue = transaction->m_variableServerPort.resolveFirst();
}
else if (compareStrNoCase(variable, "SESSIONID")) {
variableValue = transaction->m_variableSessionID.resolveFirst();
}
else if (compareStrNoCase(variable, "UNIQUE_ID")) {
variableValue = transaction->m_variableUniqueID.resolveFirst();
}
else if (compareStrNoCase(variable, "URLENCODED_ERROR")) {
variableValue = transaction->m_variableUrlEncodedError.resolveFirst();
}
else if (compareStrNoCase(variable, "USERID")) {
variableValue = transaction->m_variableUserID.resolveFirst();
} else {
variableValue = transaction->m_collections.resolveFirst(
variable);
}
} else {
std::string col = std::string(variable, 0, collection);
std::string var = std::string(variable, collection + 1,
variable.length() - (collection + 1));
if (compareStrNoCase(col, "ARGS")) {
variableValue = transaction->m_variableArgs.resolveFirst(var);
}
else if (compareStrNoCase(variable, "ARGS_NAMES")) {
variableValue = transaction->m_variableArgsNames.resolveFirst(var);
}
else if (compareStrNoCase(variable, "ARGS_GET_NAMES")) {
variableValue = transaction->m_variableArgsGetNames.resolveFirst(var);
}
else if (compareStrNoCase(variable, "ARGS_POST_NAMES")) {
variableValue = transaction->m_variableArgsPostNames.resolveFirst(var);
}
else if (compareStrNoCase(col, "RULE")) {
variableValue = transaction->m_variableRule.resolveFirst(var);
}
else if (compareStrNoCase(col, "ARGS_GET")) {
variableValue = transaction->m_variableArgsGet.resolveFirst(var);
}
else if (compareStrNoCase(col, "ARGS_POST")) {
variableValue = transaction->m_variableArgsPost.resolveFirst(var);
}
else if (compareStrNoCase(col, "FILES_SIZES")) {
variableValue = transaction->m_variableFilesSizes.resolveFirst(var);
}
else if (compareStrNoCase(col, "FILES_NAMES")) {
variableValue = transaction->m_variableFilesNames.resolveFirst(var);
}
else if (compareStrNoCase(col, "FILES_TMP_CONTENT")) {
variableValue = transaction->m_variableFilesTmpContent.resolveFirst(var);
}
else if (compareStrNoCase(col, "MULTIPART_FILENAME")) {
variableValue = transaction->m_variableMultipartFileName.resolveFirst(var);
}
else if (compareStrNoCase(col, "MULTIPART_NAME")) {
variableValue = transaction->m_variableMultipartName.resolveFirst(var);
}
else if (compareStrNoCase(col, "MATCHED_VARS_NAMES")) {
variableValue = transaction->m_variableMatchedVarsNames.resolveFirst(var);
}
else if (compareStrNoCase(col, "MATCHED_VARS")) {
variableValue = transaction->m_variableMatchedVars.resolveFirst(var);
}
else if (compareStrNoCase(col, "FILES")) {
variableValue = transaction->m_variableFiles.resolveFirst(var);
}
else if (compareStrNoCase(col, "REQUEST_COOKIES")) {
variableValue = transaction->m_variableRequestCookies.resolveFirst(var);
}
else if (compareStrNoCase(col, "REQUEST_HEADERS")) {
variableValue = transaction->m_variableRequestHeaders.resolveFirst(var);
}
else if (compareStrNoCase(variable, "REQUEST_HEADERS_NAMES")) {
variableValue = transaction->m_variableRequestHeadersNames.resolveFirst(var);
}
else if (compareStrNoCase(col, "RESPONSE_HEADERS")) {
variableValue = transaction->m_variableResponseHeaders.resolveFirst(var);
}
else if (compareStrNoCase(variable, "RESPONSE_HEADERS_NAMES")) {
variableValue = transaction->m_variableResponseHeadersNames.resolveFirst(var);
}
else if (compareStrNoCase(col, "GEO")) {
variableValue = transaction->m_variableGeo.resolveFirst(var);
}
else if (compareStrNoCase(col, "REQUEST_COOKIES_NAMES")) {
variableValue = transaction->m_variableRequestCookiesNames.resolveFirst(var);
}
else if (compareStrNoCase(col, "FILES_TMPNAMES")) {
variableValue = transaction->m_variableFilesTmpNames.resolveFirst(var);
} else {
variableValue = transaction->m_collections.resolveFirst(col,
var);
}
}
#ifndef NO_LOGS
if (variableValue) {
transaction->debug(6, "Resolving: " + variable + " to: " +
*variableValue);
} else {
transaction->debug(6, "Resolving: " + variable + " to: NULL");
}
#endif
res.erase(start, end - start + 1);
if (res[start] == '%') {
res.erase(start, 1);
}
if (variableValue != NULL) {
res.insert(start, *variableValue);
new_pos = new_pos + (*variableValue).length();
}
if (new_pos + 3 >= res.length()) {
break;
}
pos = res.find("%{", new_pos);
}
return res;
}
} // namespace modsecurity

View File

@ -1,59 +0,0 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#include "modsecurity/modsecurity.h"
#include "modsecurity/transaction.h"
#ifndef SRC_MACRO_EXPANSION_H_
#define SRC_MACRO_EXPANSION_H_
namespace modsecurity {
class MacroExpansion {
public:
MacroExpansion();
static std::string expand(const std::string& input,
Transaction *transaction);
static std::string expand(const std::string& input,
modsecurity::Rule *r, Transaction *transaction);
static std::string expandKeepOriginal(const std::string& input,
Transaction *transaction);
static inline bool compareStrNoCase(const std::string &a,
const std::string &b) {
return a.size() == b.size()
&& std::equal(a.begin(), a.end(), b.begin(),
[](char aa, char bb) {
return toupper(aa) == bb;
});
}
static bool containsMacro(std::string& input);
};
} // namespace modsecurity
#endif // SRC_MACRO_EXPANSION_H_

View File

@ -18,7 +18,7 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -17,7 +17,6 @@
#include <string>
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -18,7 +18,6 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
#include "modsecurity/rule_message.h"
namespace modsecurity {

View File

@ -19,7 +19,7 @@
#include "src/operators/operator.h"
#include "others/libinjection/src/libinjection.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -18,7 +18,6 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -18,7 +18,7 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -18,7 +18,6 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
#include "src/utils/system.h"
namespace modsecurity {

View File

@ -18,7 +18,7 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -18,7 +18,7 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -18,7 +18,7 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -18,7 +18,6 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -20,7 +20,6 @@
#include <memory>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
#include "modsecurity/rule.h"
#include "modsecurity/rule_message.h"

View File

@ -16,7 +16,6 @@
#include "src/operators/str_eq.h"
#include <string>
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -18,7 +18,7 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

View File

@ -18,7 +18,7 @@
#include <string>
#include "src/operators/operator.h"
#include "src/macro_expansion.h"
namespace modsecurity {
namespace operators {

File diff suppressed because it is too large Load Diff

View File

@ -786,7 +786,6 @@ namespace yy {
// "RUN_TIME_VAR_TIME_SEC"
// "RUN_TIME_VAR_TIME_WDAY"
// "RUN_TIME_VAR_TIME_YEAR"
// "SETVAR_CONTENT_PART"
// "VARIABLE"
// "Dictionary element"
// "Dictionary element, selected by regexp"
@ -1139,10 +1138,9 @@ namespace yy {
TOK_RUN_TIME_VAR_TIME_SEC = 558,
TOK_RUN_TIME_VAR_TIME_WDAY = 559,
TOK_RUN_TIME_VAR_TIME_YEAR = 560,
TOK_SETVAR_CONTENT_PART = 561,
TOK_VARIABLE = 562,
TOK_DICT_ELEMENT = 563,
TOK_DICT_ELEMENT_REGEXP = 564
TOK_VARIABLE = 561,
TOK_DICT_ELEMENT = 562,
TOK_DICT_ELEMENT_REGEXP = 563
};
};
@ -2477,10 +2475,6 @@ namespace yy {
symbol_type
make_RUN_TIME_VAR_TIME_YEAR (const std::string& v, const location_type& l);
static inline
symbol_type
make_SETVAR_CONTENT_PART (const std::string& v, const location_type& l);
static inline
symbol_type
make_VARIABLE (const std::string& v, const location_type& l);
@ -2698,12 +2692,12 @@ namespace yy {
enum
{
yyeof_ = 0,
yylast_ = 3071, ///< Last index in yytable_.
yylast_ = 3069, ///< Last index in yytable_.
yynnts_ = 15, ///< Number of nonterminal symbols.
yyfinal_ = 294, ///< Termination state number.
yyterror_ = 1,
yyerrcode_ = 256,
yyntokens_ = 310 ///< Number of tokens.
yyntokens_ = 309 ///< Number of tokens.
};
@ -2776,9 +2770,9 @@ namespace yy {
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
305, 306, 307, 308, 309
305, 306, 307, 308
};
const unsigned int user_token_number_max_ = 564;
const unsigned int user_token_number_max_ = 563;
const token_number_type undef_token_ = 2;
if (static_cast<int>(t) <= yyeof_)
@ -2975,38 +2969,37 @@ namespace yy {
case 303: // "RUN_TIME_VAR_TIME_SEC"
case 304: // "RUN_TIME_VAR_TIME_WDAY"
case 305: // "RUN_TIME_VAR_TIME_YEAR"
case 306: // "SETVAR_CONTENT_PART"
case 307: // "VARIABLE"
case 308: // "Dictionary element"
case 309: // "Dictionary element, selected by regexp"
case 306: // "VARIABLE"
case 307: // "Dictionary element"
case 308: // "Dictionary element, selected by regexp"
value.copy< std::string > (other.value);
break;
case 316: // op
case 317: // op_before_init
case 315: // op
case 316: // op_before_init
value.copy< std::unique_ptr<Operator> > (other.value);
break;
case 324: // run_time_string
case 323: // run_time_string
value.copy< std::unique_ptr<RunTimeString> > (other.value);
break;
case 321: // var
case 320: // var
value.copy< std::unique_ptr<Variable> > (other.value);
break;
case 322: // act
case 323: // setvar_action
case 321: // act
case 322: // setvar_action
value.copy< std::unique_ptr<actions::Action> > (other.value);
break;
case 319: // variables
case 320: // variables_may_be_quoted
case 318: // variables
case 319: // variables_may_be_quoted
value.copy< std::unique_ptr<std::vector<std::unique_ptr<Variable> > > > (other.value);
break;
case 314: // actions
case 315: // actions_may_quoted
case 313: // actions
case 314: // actions_may_quoted
value.copy< std::unique_ptr<std::vector<std::unique_ptr<actions::Action> > > > (other.value);
break;
@ -3191,38 +3184,37 @@ namespace yy {
case 303: // "RUN_TIME_VAR_TIME_SEC"
case 304: // "RUN_TIME_VAR_TIME_WDAY"
case 305: // "RUN_TIME_VAR_TIME_YEAR"
case 306: // "SETVAR_CONTENT_PART"
case 307: // "VARIABLE"
case 308: // "Dictionary element"
case 309: // "Dictionary element, selected by regexp"
case 306: // "VARIABLE"
case 307: // "Dictionary element"
case 308: // "Dictionary element, selected by regexp"
value.copy< std::string > (v);
break;
case 316: // op
case 317: // op_before_init
case 315: // op
case 316: // op_before_init
value.copy< std::unique_ptr<Operator> > (v);
break;
case 324: // run_time_string
case 323: // run_time_string
value.copy< std::unique_ptr<RunTimeString> > (v);
break;
case 321: // var
case 320: // var
value.copy< std::unique_ptr<Variable> > (v);
break;
case 322: // act
case 323: // setvar_action
case 321: // act
case 322: // setvar_action
value.copy< std::unique_ptr<actions::Action> > (v);
break;
case 319: // variables
case 320: // variables_may_be_quoted
case 318: // variables
case 319: // variables_may_be_quoted
value.copy< std::unique_ptr<std::vector<std::unique_ptr<Variable> > > > (v);
break;
case 314: // actions
case 315: // actions_may_quoted
case 313: // actions
case 314: // actions_may_quoted
value.copy< std::unique_ptr<std::vector<std::unique_ptr<actions::Action> > > > (v);
break;
@ -3480,38 +3472,37 @@ namespace yy {
case 303: // "RUN_TIME_VAR_TIME_SEC"
case 304: // "RUN_TIME_VAR_TIME_WDAY"
case 305: // "RUN_TIME_VAR_TIME_YEAR"
case 306: // "SETVAR_CONTENT_PART"
case 307: // "VARIABLE"
case 308: // "Dictionary element"
case 309: // "Dictionary element, selected by regexp"
case 306: // "VARIABLE"
case 307: // "Dictionary element"
case 308: // "Dictionary element, selected by regexp"
value.template destroy< std::string > ();
break;
case 316: // op
case 317: // op_before_init
case 315: // op
case 316: // op_before_init
value.template destroy< std::unique_ptr<Operator> > ();
break;
case 324: // run_time_string
case 323: // run_time_string
value.template destroy< std::unique_ptr<RunTimeString> > ();
break;
case 321: // var
case 320: // var
value.template destroy< std::unique_ptr<Variable> > ();
break;
case 322: // act
case 323: // setvar_action
case 321: // act
case 322: // setvar_action
value.template destroy< std::unique_ptr<actions::Action> > ();
break;
case 319: // variables
case 320: // variables_may_be_quoted
case 318: // variables
case 319: // variables_may_be_quoted
value.template destroy< std::unique_ptr<std::vector<std::unique_ptr<Variable> > > > ();
break;
case 314: // actions
case 315: // actions_may_quoted
case 313: // actions
case 314: // actions_may_quoted
value.template destroy< std::unique_ptr<std::vector<std::unique_ptr<actions::Action> > > > ();
break;
@ -3702,38 +3693,37 @@ namespace yy {
case 303: // "RUN_TIME_VAR_TIME_SEC"
case 304: // "RUN_TIME_VAR_TIME_WDAY"
case 305: // "RUN_TIME_VAR_TIME_YEAR"
case 306: // "SETVAR_CONTENT_PART"
case 307: // "VARIABLE"
case 308: // "Dictionary element"
case 309: // "Dictionary element, selected by regexp"
case 306: // "VARIABLE"
case 307: // "Dictionary element"
case 308: // "Dictionary element, selected by regexp"
value.move< std::string > (s.value);
break;
case 316: // op
case 317: // op_before_init
case 315: // op
case 316: // op_before_init
value.move< std::unique_ptr<Operator> > (s.value);
break;
case 324: // run_time_string
case 323: // run_time_string
value.move< std::unique_ptr<RunTimeString> > (s.value);
break;
case 321: // var
case 320: // var
value.move< std::unique_ptr<Variable> > (s.value);
break;
case 322: // act
case 323: // setvar_action
case 321: // act
case 322: // setvar_action
value.move< std::unique_ptr<actions::Action> > (s.value);
break;
case 319: // variables
case 320: // variables_may_be_quoted
case 318: // variables
case 319: // variables_may_be_quoted
value.move< std::unique_ptr<std::vector<std::unique_ptr<Variable> > > > (s.value);
break;
case 314: // actions
case 315: // actions_may_quoted
case 313: // actions
case 314: // actions_may_quoted
value.move< std::unique_ptr<std::vector<std::unique_ptr<actions::Action> > > > (s.value);
break;
@ -3822,7 +3812,7 @@ namespace yy {
525, 526, 527, 528, 529, 530, 531, 532, 533, 534,
535, 536, 537, 538, 539, 540, 541, 542, 543, 544,
545, 546, 547, 548, 549, 550, 551, 552, 553, 554,
555, 556, 557, 558, 559, 560, 561, 562, 563, 564
555, 556, 557, 558, 559, 560, 561, 562, 563
};
return static_cast<token_type> (yytoken_number_[type]);
}
@ -5651,12 +5641,6 @@ namespace yy {
return symbol_type (token::TOK_RUN_TIME_VAR_TIME_YEAR, v, l);
}
seclang_parser::symbol_type
seclang_parser::make_SETVAR_CONTENT_PART (const std::string& v, const location_type& l)
{
return symbol_type (token::TOK_SETVAR_CONTENT_PART, v, l);
}
seclang_parser::symbol_type
seclang_parser::make_VARIABLE (const std::string& v, const location_type& l)
{
@ -5678,7 +5662,7 @@ namespace yy {
} // yy
#line 5682 "seclang-parser.hh" // lalr1.cc:377
#line 5666 "seclang-parser.hh" // lalr1.cc:377

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,6 @@
#include "src/utils/string.h"
#include "modsecurity/rules.h"
#include "modsecurity/rule_message.h"
#include "src/macro_expansion.h"
#include "src/actions/msg.h"
#include "src/actions/log_data.h"
#include "src/actions/severity.h"

View File

@ -28,7 +28,6 @@
#include "src/utils/string.h"
#include "modsecurity/rules.h"
#include "modsecurity/rule_message.h"
#include "src/macro_expansion.h"
#include "src/actions/msg.h"
#include "src/actions/log_data.h"
#include "src/actions/severity.h"