// A Bison parser, made by GNU Bison 3.5.3.
// Skeleton implementation for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
// under terms of your choice, so long as that work isn't itself a
// parser generator using the skeleton or a modified version thereof
// as a parser skeleton. Alternatively, if you modify or redistribute
// the parser skeleton itself, you may (at your option) remove this
// special exception, which will cause the skeleton and the resulting
// Bison output files to be licensed under the GNU General Public
// License without this special exception.
// This special exception was added by the Free Software Foundation in
// version 2.2 of Bison.
// Undocumented macros, especially those whose name start with YY_,
// are private implementation details. Do not rely on them.
#include "seclang-parser.hh"
// Unqualified %code blocks.
#line 324 "seclang-parser.yy"
#include "src/parser/driver.h"
#line 49 "seclang-parser.cc"
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include // FIXME: INFRINGES ON USER NAME SPACE.
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif
# endif
# ifndef YY_
# define YY_(msgid) msgid
# endif
#endif
// Whether we are compiled with exception support.
#ifndef YY_EXCEPTIONS
# if defined __GNUC__ && !defined __EXCEPTIONS
# define YY_EXCEPTIONS 0
# else
# define YY_EXCEPTIONS 1
# endif
#endif
#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
# ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
(Current).end = YYRHSLOC (Rhs, N).end; \
} \
else \
{ \
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
} \
while (false)
# endif
// Enable debugging if requested.
#if YYDEBUG
// A pseudo ostream that takes yydebug_ into account.
# define YYCDEBUG if (yydebug_) (*yycdebug_)
# define YY_SYMBOL_PRINT(Title, Symbol) \
do { \
if (yydebug_) \
{ \
*yycdebug_ << Title << ' '; \
yy_print_ (*yycdebug_, Symbol); \
*yycdebug_ << '\n'; \
} \
} while (false)
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug_) \
yy_reduce_print_ (Rule); \
} while (false)
# define YY_STACK_PRINT() \
do { \
if (yydebug_) \
yystack_print_ (); \
} while (false)
#else // !YYDEBUG
# define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol)
# define YY_REDUCE_PRINT(Rule) static_cast (0)
# define YY_STACK_PRINT() static_cast (0)
#endif // !YYDEBUG
#define yyerrok (yyerrstatus_ = 0)
#define yyclearin (yyla.clear ())
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrorlab
#define YYRECOVERING() (!!yyerrstatus_)
namespace yy {
#line 140 "seclang-parser.cc"
/* Return YYSTR after stripping away unnecessary quotes and
backslashes, so that it's suitable for yyerror. The heuristic is
that double-quoting is unnecessary unless the string contains an
apostrophe, a comma, or backslash (other than backslash-backslash).
YYSTR is taken from yytname. */
std::string
seclang_parser::yytnamerr_ (const char *yystr)
{
if (*yystr == '"')
{
std::string yyr;
char const *yyp = yystr;
for (;;)
switch (*++yyp)
{
case '\'':
case ',':
goto do_not_strip_quotes;
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
else
goto append;
append:
default:
yyr += *yyp;
break;
case '"':
return yyr;
}
do_not_strip_quotes: ;
}
return yystr;
}
/// Build a parser object.
seclang_parser::seclang_parser (modsecurity::Parser::Driver& driver_yyarg)
#if YYDEBUG
: yydebug_ (false),
yycdebug_ (&std::cerr),
#else
:
#endif
driver (driver_yyarg)
{}
seclang_parser::~seclang_parser ()
{}
seclang_parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
{}
/*---------------.
| Symbol types. |
`---------------*/
// by_state.
seclang_parser::by_state::by_state () YY_NOEXCEPT
: state (empty_state)
{}
seclang_parser::by_state::by_state (const by_state& that) YY_NOEXCEPT
: state (that.state)
{}
void
seclang_parser::by_state::clear () YY_NOEXCEPT
{
state = empty_state;
}
void
seclang_parser::by_state::move (by_state& that)
{
state = that.state;
that.clear ();
}
seclang_parser::by_state::by_state (state_type s) YY_NOEXCEPT
: state (s)
{}
seclang_parser::symbol_number_type
seclang_parser::by_state::type_get () const YY_NOEXCEPT
{
if (state == empty_state)
return empty_symbol;
else
return yystos_[+state];
}
seclang_parser::stack_symbol_type::stack_symbol_type ()
{}
seclang_parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
: super_type (YY_MOVE (that.state), YY_MOVE (that.location))
{
switch (that.type_get ())
{
case 145: // "Accuracy"
case 146: // "Allow"
case 147: // "Append"
case 148: // "AuditLog"
case 149: // "Block"
case 150: // "Capture"
case 151: // "Chain"
case 152: // "ACTION_CTL_AUDIT_ENGINE"
case 153: // "ACTION_CTL_AUDIT_LOG_PARTS"
case 154: // "ACTION_CTL_BDY_JSON"
case 155: // "ACTION_CTL_BDY_XML"
case 156: // "ACTION_CTL_BDY_URLENCODED"
case 157: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
case 158: // "ACTION_CTL_REQUEST_BODY_ACCESS"
case 159: // "ACTION_CTL_RULE_REMOVE_BY_ID"
case 160: // "ACTION_CTL_RULE_REMOVE_BY_TAG"
case 161: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
case 162: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
case 163: // "Deny"
case 164: // "DeprecateVar"
case 165: // "Drop"
case 166: // "Exec"
case 167: // "ExpireVar"
case 168: // "Id"
case 169: // "InitCol"
case 170: // "Log"
case 171: // "LogData"
case 172: // "Maturity"
case 173: // "Msg"
case 174: // "MultiMatch"
case 175: // "NoAuditLog"
case 176: // "NoLog"
case 177: // "Pass"
case 178: // "Pause"
case 179: // "Phase"
case 180: // "Prepend"
case 181: // "Proxy"
case 182: // "Redirect"
case 183: // "Rev"
case 184: // "SanitiseArg"
case 185: // "SanitiseMatched"
case 186: // "SanitiseMatchedBytes"
case 187: // "SanitiseRequestHeader"
case 188: // "SanitiseResponseHeader"
case 189: // "SetEnv"
case 190: // "SetRsc"
case 191: // "SetSid"
case 192: // "SetUID"
case 193: // "Severity"
case 194: // "Skip"
case 195: // "SkipAfter"
case 196: // "Status"
case 197: // "Tag"
case 198: // "ACTION_TRANSFORMATION_BASE_64_ENCODE"
case 199: // "ACTION_TRANSFORMATION_BASE_64_DECODE"
case 200: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT"
case 201: // "ACTION_TRANSFORMATION_CMD_LINE"
case 202: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE"
case 203: // "ACTION_TRANSFORMATION_CSS_DECODE"
case 204: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE"
case 205: // "ACTION_TRANSFORMATION_HEX_ENCODE"
case 206: // "ACTION_TRANSFORMATION_HEX_DECODE"
case 207: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE"
case 208: // "ACTION_TRANSFORMATION_JS_DECODE"
case 209: // "ACTION_TRANSFORMATION_LENGTH"
case 210: // "ACTION_TRANSFORMATION_LOWERCASE"
case 211: // "ACTION_TRANSFORMATION_MD5"
case 212: // "ACTION_TRANSFORMATION_NONE"
case 213: // "ACTION_TRANSFORMATION_NORMALISE_PATH"
case 214: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN"
case 215: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT"
case 216: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT"
case 217: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT"
case 218: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS"
case 219: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR"
case 220: // "ACTION_TRANSFORMATION_REMOVE_NULLS"
case 221: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE"
case 222: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS"
case 223: // "ACTION_TRANSFORMATION_REPLACE_NULLS"
case 224: // "ACTION_TRANSFORMATION_SHA1"
case 225: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE"
case 226: // "ACTION_TRANSFORMATION_TRIM"
case 227: // "ACTION_TRANSFORMATION_TRIM_LEFT"
case 228: // "ACTION_TRANSFORMATION_TRIM_RIGHT"
case 229: // "ACTION_TRANSFORMATION_UPPERCASE"
case 230: // "ACTION_TRANSFORMATION_URL_ENCODE"
case 231: // "ACTION_TRANSFORMATION_URL_DECODE"
case 232: // "ACTION_TRANSFORMATION_URL_DECODE_UNI"
case 233: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE"
case 234: // "Ver"
case 235: // "xmlns"
case 236: // "CONFIG_COMPONENT_SIG"
case 237: // "CONFIG_CONN_ENGINE"
case 238: // "CONFIG_SEC_ARGUMENT_SEPARATOR"
case 239: // "CONFIG_SEC_WEB_APP_ID"
case 240: // "CONFIG_SEC_SERVER_SIG"
case 241: // "CONFIG_DIR_AUDIT_DIR"
case 242: // "CONFIG_DIR_AUDIT_DIR_MOD"
case 243: // "CONFIG_DIR_AUDIT_ENG"
case 244: // "CONFIG_DIR_AUDIT_FLE_MOD"
case 245: // "CONFIG_DIR_AUDIT_LOG"
case 246: // "CONFIG_DIR_AUDIT_LOG2"
case 247: // "CONFIG_DIR_AUDIT_LOG_P"
case 248: // "CONFIG_DIR_AUDIT_STS"
case 249: // "CONFIG_DIR_AUDIT_TPE"
case 250: // "CONFIG_DIR_DEBUG_LOG"
case 251: // "CONFIG_DIR_DEBUG_LVL"
case 252: // "CONFIG_SEC_CACHE_TRANSFORMATIONS"
case 253: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS"
case 254: // "CONFIG_SEC_HASH_ENGINE"
case 255: // "CONFIG_SEC_HASH_KEY"
case 256: // "CONFIG_SEC_HASH_PARAM"
case 257: // "CONFIG_SEC_HASH_METHOD_RX"
case 258: // "CONFIG_SEC_HASH_METHOD_PM"
case 259: // "CONFIG_SEC_CHROOT_DIR"
case 260: // "CONFIG_DIR_GEO_DB"
case 261: // "CONFIG_DIR_GSB_DB"
case 262: // "CONFIG_SEC_GUARDIAN_LOG"
case 263: // "CONFIG_DIR_PCRE_MATCH_LIMIT"
case 264: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION"
case 265: // "CONFIG_SEC_CONN_R_STATE_LIMIT"
case 266: // "CONFIG_SEC_CONN_W_STATE_LIMIT"
case 267: // "CONFIG_SEC_SENSOR_ID"
case 268: // "CONFIG_DIR_ARGS_LIMIT"
case 269: // "CONFIG_DIR_REQ_BODY"
case 270: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT"
case 271: // "CONFIG_DIR_REQ_BODY_LIMIT"
case 272: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION"
case 273: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT"
case 274: // "CONFIG_DIR_RES_BODY"
case 275: // "CONFIG_DIR_RES_BODY_LIMIT"
case 276: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION"
case 277: // "CONFIG_SEC_RULE_INHERITANCE"
case 278: // "CONFIG_SEC_RULE_PERF_TIME"
case 279: // "CONFIG_DIR_RULE_ENG"
case 280: // "CONFIG_DIR_SEC_ACTION"
case 281: // "CONFIG_DIR_SEC_DEFAULT_ACTION"
case 282: // "CONFIG_DIR_SEC_MARKER"
case 283: // "CONFIG_DIR_UNICODE_MAP_FILE"
case 284: // "CONFIG_DIR_UNICODE_CODE_PAGE"
case 285: // "CONFIG_SEC_COLLECTION_TIMEOUT"
case 286: // "CONFIG_SEC_HTTP_BLKEY"
case 287: // "CONFIG_SEC_INTERCEPT_ON_ERROR"
case 288: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION"
case 289: // "CONFIG_SEC_RULE_REMOVE_BY_ID"
case 290: // "CONFIG_SEC_RULE_REMOVE_BY_MSG"
case 291: // "CONFIG_SEC_RULE_REMOVE_BY_TAG"
case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG"
case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG"
case 294: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID"
case 295: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID"
case 296: // "CONFIG_UPDLOAD_KEEP_FILES"
case 297: // "CONFIG_UPDLOAD_SAVE_TMP_FILES"
case 298: // "CONFIG_UPLOAD_DIR"
case 299: // "CONFIG_UPLOAD_FILE_LIMIT"
case 300: // "CONFIG_UPLOAD_FILE_MODE"
case 301: // "CONFIG_VALUE_ABORT"
case 302: // "CONFIG_VALUE_DETC"
case 303: // "CONFIG_VALUE_HTTPS"
case 304: // "CONFIG_VALUE_OFF"
case 305: // "CONFIG_VALUE_ON"
case 306: // "CONFIG_VALUE_PARALLEL"
case 307: // "CONFIG_VALUE_PROCESS_PARTIAL"
case 308: // "CONFIG_VALUE_REJECT"
case 309: // "CONFIG_VALUE_RELEVANT_ONLY"
case 310: // "CONFIG_VALUE_SERIAL"
case 311: // "CONFIG_VALUE_WARN"
case 312: // "CONFIG_XML_EXTERNAL_ENTITY"
case 313: // "CONGIG_DIR_RESPONSE_BODY_MP"
case 314: // "CONGIG_DIR_SEC_ARG_SEP"
case 315: // "CONGIG_DIR_SEC_COOKIE_FORMAT"
case 316: // "CONFIG_SEC_COOKIEV0_SEPARATOR"
case 317: // "CONGIG_DIR_SEC_DATA_DIR"
case 318: // "CONGIG_DIR_SEC_STATUS_ENGINE"
case 319: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION"
case 320: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION"
case 321: // "CONGIG_DIR_SEC_TMP_DIR"
case 322: // "DIRECTIVE"
case 323: // "DIRECTIVE_SECRULESCRIPT"
case 324: // "FREE_TEXT_QUOTE_MACRO_EXPANSION"
case 325: // "QUOTATION_MARK"
case 326: // "RUN_TIME_VAR_BLD"
case 327: // "RUN_TIME_VAR_DUR"
case 328: // "RUN_TIME_VAR_HSV"
case 329: // "RUN_TIME_VAR_REMOTE_USER"
case 330: // "RUN_TIME_VAR_TIME"
case 331: // "RUN_TIME_VAR_TIME_DAY"
case 332: // "RUN_TIME_VAR_TIME_EPOCH"
case 333: // "RUN_TIME_VAR_TIME_HOUR"
case 334: // "RUN_TIME_VAR_TIME_MIN"
case 335: // "RUN_TIME_VAR_TIME_MON"
case 336: // "RUN_TIME_VAR_TIME_SEC"
case 337: // "RUN_TIME_VAR_TIME_WDAY"
case 338: // "RUN_TIME_VAR_TIME_YEAR"
case 339: // "VARIABLE"
case 340: // "Dictionary element"
case 341: // "Dictionary element, selected by regexp"
value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value));
break;
case 348: // op
case 349: // op_before_init
value.YY_MOVE_OR_COPY< std::unique_ptr > (YY_MOVE (that.value));
break;
case 357: // run_time_string
value.YY_MOVE_OR_COPY< std::unique_ptr > (YY_MOVE (that.value));
break;
case 354: // var
value.YY_MOVE_OR_COPY< std::unique_ptr > (YY_MOVE (that.value));
break;
case 355: // act
case 356: // setvar_action
value.YY_MOVE_OR_COPY< std::unique_ptr > (YY_MOVE (that.value));
break;
case 351: // variables
case 352: // variables_pre_process
case 353: // variables_may_be_quoted
value.YY_MOVE_OR_COPY< std::unique_ptr > > > (YY_MOVE (that.value));
break;
case 346: // actions
case 347: // actions_may_quoted
value.YY_MOVE_OR_COPY< std::unique_ptr > > > (YY_MOVE (that.value));
break;
default:
break;
}
#if 201103L <= YY_CPLUSPLUS
// that is emptied.
that.state = empty_state;
#endif
}
seclang_parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
: super_type (s, YY_MOVE (that.location))
{
switch (that.type_get ())
{
case 145: // "Accuracy"
case 146: // "Allow"
case 147: // "Append"
case 148: // "AuditLog"
case 149: // "Block"
case 150: // "Capture"
case 151: // "Chain"
case 152: // "ACTION_CTL_AUDIT_ENGINE"
case 153: // "ACTION_CTL_AUDIT_LOG_PARTS"
case 154: // "ACTION_CTL_BDY_JSON"
case 155: // "ACTION_CTL_BDY_XML"
case 156: // "ACTION_CTL_BDY_URLENCODED"
case 157: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
case 158: // "ACTION_CTL_REQUEST_BODY_ACCESS"
case 159: // "ACTION_CTL_RULE_REMOVE_BY_ID"
case 160: // "ACTION_CTL_RULE_REMOVE_BY_TAG"
case 161: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
case 162: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
case 163: // "Deny"
case 164: // "DeprecateVar"
case 165: // "Drop"
case 166: // "Exec"
case 167: // "ExpireVar"
case 168: // "Id"
case 169: // "InitCol"
case 170: // "Log"
case 171: // "LogData"
case 172: // "Maturity"
case 173: // "Msg"
case 174: // "MultiMatch"
case 175: // "NoAuditLog"
case 176: // "NoLog"
case 177: // "Pass"
case 178: // "Pause"
case 179: // "Phase"
case 180: // "Prepend"
case 181: // "Proxy"
case 182: // "Redirect"
case 183: // "Rev"
case 184: // "SanitiseArg"
case 185: // "SanitiseMatched"
case 186: // "SanitiseMatchedBytes"
case 187: // "SanitiseRequestHeader"
case 188: // "SanitiseResponseHeader"
case 189: // "SetEnv"
case 190: // "SetRsc"
case 191: // "SetSid"
case 192: // "SetUID"
case 193: // "Severity"
case 194: // "Skip"
case 195: // "SkipAfter"
case 196: // "Status"
case 197: // "Tag"
case 198: // "ACTION_TRANSFORMATION_BASE_64_ENCODE"
case 199: // "ACTION_TRANSFORMATION_BASE_64_DECODE"
case 200: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT"
case 201: // "ACTION_TRANSFORMATION_CMD_LINE"
case 202: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE"
case 203: // "ACTION_TRANSFORMATION_CSS_DECODE"
case 204: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE"
case 205: // "ACTION_TRANSFORMATION_HEX_ENCODE"
case 206: // "ACTION_TRANSFORMATION_HEX_DECODE"
case 207: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE"
case 208: // "ACTION_TRANSFORMATION_JS_DECODE"
case 209: // "ACTION_TRANSFORMATION_LENGTH"
case 210: // "ACTION_TRANSFORMATION_LOWERCASE"
case 211: // "ACTION_TRANSFORMATION_MD5"
case 212: // "ACTION_TRANSFORMATION_NONE"
case 213: // "ACTION_TRANSFORMATION_NORMALISE_PATH"
case 214: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN"
case 215: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT"
case 216: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT"
case 217: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT"
case 218: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS"
case 219: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR"
case 220: // "ACTION_TRANSFORMATION_REMOVE_NULLS"
case 221: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE"
case 222: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS"
case 223: // "ACTION_TRANSFORMATION_REPLACE_NULLS"
case 224: // "ACTION_TRANSFORMATION_SHA1"
case 225: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE"
case 226: // "ACTION_TRANSFORMATION_TRIM"
case 227: // "ACTION_TRANSFORMATION_TRIM_LEFT"
case 228: // "ACTION_TRANSFORMATION_TRIM_RIGHT"
case 229: // "ACTION_TRANSFORMATION_UPPERCASE"
case 230: // "ACTION_TRANSFORMATION_URL_ENCODE"
case 231: // "ACTION_TRANSFORMATION_URL_DECODE"
case 232: // "ACTION_TRANSFORMATION_URL_DECODE_UNI"
case 233: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE"
case 234: // "Ver"
case 235: // "xmlns"
case 236: // "CONFIG_COMPONENT_SIG"
case 237: // "CONFIG_CONN_ENGINE"
case 238: // "CONFIG_SEC_ARGUMENT_SEPARATOR"
case 239: // "CONFIG_SEC_WEB_APP_ID"
case 240: // "CONFIG_SEC_SERVER_SIG"
case 241: // "CONFIG_DIR_AUDIT_DIR"
case 242: // "CONFIG_DIR_AUDIT_DIR_MOD"
case 243: // "CONFIG_DIR_AUDIT_ENG"
case 244: // "CONFIG_DIR_AUDIT_FLE_MOD"
case 245: // "CONFIG_DIR_AUDIT_LOG"
case 246: // "CONFIG_DIR_AUDIT_LOG2"
case 247: // "CONFIG_DIR_AUDIT_LOG_P"
case 248: // "CONFIG_DIR_AUDIT_STS"
case 249: // "CONFIG_DIR_AUDIT_TPE"
case 250: // "CONFIG_DIR_DEBUG_LOG"
case 251: // "CONFIG_DIR_DEBUG_LVL"
case 252: // "CONFIG_SEC_CACHE_TRANSFORMATIONS"
case 253: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS"
case 254: // "CONFIG_SEC_HASH_ENGINE"
case 255: // "CONFIG_SEC_HASH_KEY"
case 256: // "CONFIG_SEC_HASH_PARAM"
case 257: // "CONFIG_SEC_HASH_METHOD_RX"
case 258: // "CONFIG_SEC_HASH_METHOD_PM"
case 259: // "CONFIG_SEC_CHROOT_DIR"
case 260: // "CONFIG_DIR_GEO_DB"
case 261: // "CONFIG_DIR_GSB_DB"
case 262: // "CONFIG_SEC_GUARDIAN_LOG"
case 263: // "CONFIG_DIR_PCRE_MATCH_LIMIT"
case 264: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION"
case 265: // "CONFIG_SEC_CONN_R_STATE_LIMIT"
case 266: // "CONFIG_SEC_CONN_W_STATE_LIMIT"
case 267: // "CONFIG_SEC_SENSOR_ID"
case 268: // "CONFIG_DIR_ARGS_LIMIT"
case 269: // "CONFIG_DIR_REQ_BODY"
case 270: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT"
case 271: // "CONFIG_DIR_REQ_BODY_LIMIT"
case 272: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION"
case 273: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT"
case 274: // "CONFIG_DIR_RES_BODY"
case 275: // "CONFIG_DIR_RES_BODY_LIMIT"
case 276: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION"
case 277: // "CONFIG_SEC_RULE_INHERITANCE"
case 278: // "CONFIG_SEC_RULE_PERF_TIME"
case 279: // "CONFIG_DIR_RULE_ENG"
case 280: // "CONFIG_DIR_SEC_ACTION"
case 281: // "CONFIG_DIR_SEC_DEFAULT_ACTION"
case 282: // "CONFIG_DIR_SEC_MARKER"
case 283: // "CONFIG_DIR_UNICODE_MAP_FILE"
case 284: // "CONFIG_DIR_UNICODE_CODE_PAGE"
case 285: // "CONFIG_SEC_COLLECTION_TIMEOUT"
case 286: // "CONFIG_SEC_HTTP_BLKEY"
case 287: // "CONFIG_SEC_INTERCEPT_ON_ERROR"
case 288: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION"
case 289: // "CONFIG_SEC_RULE_REMOVE_BY_ID"
case 290: // "CONFIG_SEC_RULE_REMOVE_BY_MSG"
case 291: // "CONFIG_SEC_RULE_REMOVE_BY_TAG"
case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG"
case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG"
case 294: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID"
case 295: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID"
case 296: // "CONFIG_UPDLOAD_KEEP_FILES"
case 297: // "CONFIG_UPDLOAD_SAVE_TMP_FILES"
case 298: // "CONFIG_UPLOAD_DIR"
case 299: // "CONFIG_UPLOAD_FILE_LIMIT"
case 300: // "CONFIG_UPLOAD_FILE_MODE"
case 301: // "CONFIG_VALUE_ABORT"
case 302: // "CONFIG_VALUE_DETC"
case 303: // "CONFIG_VALUE_HTTPS"
case 304: // "CONFIG_VALUE_OFF"
case 305: // "CONFIG_VALUE_ON"
case 306: // "CONFIG_VALUE_PARALLEL"
case 307: // "CONFIG_VALUE_PROCESS_PARTIAL"
case 308: // "CONFIG_VALUE_REJECT"
case 309: // "CONFIG_VALUE_RELEVANT_ONLY"
case 310: // "CONFIG_VALUE_SERIAL"
case 311: // "CONFIG_VALUE_WARN"
case 312: // "CONFIG_XML_EXTERNAL_ENTITY"
case 313: // "CONGIG_DIR_RESPONSE_BODY_MP"
case 314: // "CONGIG_DIR_SEC_ARG_SEP"
case 315: // "CONGIG_DIR_SEC_COOKIE_FORMAT"
case 316: // "CONFIG_SEC_COOKIEV0_SEPARATOR"
case 317: // "CONGIG_DIR_SEC_DATA_DIR"
case 318: // "CONGIG_DIR_SEC_STATUS_ENGINE"
case 319: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION"
case 320: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION"
case 321: // "CONGIG_DIR_SEC_TMP_DIR"
case 322: // "DIRECTIVE"
case 323: // "DIRECTIVE_SECRULESCRIPT"
case 324: // "FREE_TEXT_QUOTE_MACRO_EXPANSION"
case 325: // "QUOTATION_MARK"
case 326: // "RUN_TIME_VAR_BLD"
case 327: // "RUN_TIME_VAR_DUR"
case 328: // "RUN_TIME_VAR_HSV"
case 329: // "RUN_TIME_VAR_REMOTE_USER"
case 330: // "RUN_TIME_VAR_TIME"
case 331: // "RUN_TIME_VAR_TIME_DAY"
case 332: // "RUN_TIME_VAR_TIME_EPOCH"
case 333: // "RUN_TIME_VAR_TIME_HOUR"
case 334: // "RUN_TIME_VAR_TIME_MIN"
case 335: // "RUN_TIME_VAR_TIME_MON"
case 336: // "RUN_TIME_VAR_TIME_SEC"
case 337: // "RUN_TIME_VAR_TIME_WDAY"
case 338: // "RUN_TIME_VAR_TIME_YEAR"
case 339: // "VARIABLE"
case 340: // "Dictionary element"
case 341: // "Dictionary element, selected by regexp"
value.move< std::string > (YY_MOVE (that.value));
break;
case 348: // op
case 349: // op_before_init
value.move< std::unique_ptr > (YY_MOVE (that.value));
break;
case 357: // run_time_string
value.move< std::unique_ptr > (YY_MOVE (that.value));
break;
case 354: // var
value.move< std::unique_ptr > (YY_MOVE (that.value));
break;
case 355: // act
case 356: // setvar_action
value.move< std::unique_ptr > (YY_MOVE (that.value));
break;
case 351: // variables
case 352: // variables_pre_process
case 353: // variables_may_be_quoted
value.move< std::unique_ptr > > > (YY_MOVE (that.value));
break;
case 346: // actions
case 347: // actions_may_quoted
value.move< std::unique_ptr > > > (YY_MOVE (that.value));
break;
default:
break;
}
// that is emptied.
that.type = empty_symbol;
}
#if YY_CPLUSPLUS < 201103L
seclang_parser::stack_symbol_type&
seclang_parser::stack_symbol_type::operator= (const stack_symbol_type& that)
{
state = that.state;
switch (that.type_get ())
{
case 145: // "Accuracy"
case 146: // "Allow"
case 147: // "Append"
case 148: // "AuditLog"
case 149: // "Block"
case 150: // "Capture"
case 151: // "Chain"
case 152: // "ACTION_CTL_AUDIT_ENGINE"
case 153: // "ACTION_CTL_AUDIT_LOG_PARTS"
case 154: // "ACTION_CTL_BDY_JSON"
case 155: // "ACTION_CTL_BDY_XML"
case 156: // "ACTION_CTL_BDY_URLENCODED"
case 157: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
case 158: // "ACTION_CTL_REQUEST_BODY_ACCESS"
case 159: // "ACTION_CTL_RULE_REMOVE_BY_ID"
case 160: // "ACTION_CTL_RULE_REMOVE_BY_TAG"
case 161: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
case 162: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
case 163: // "Deny"
case 164: // "DeprecateVar"
case 165: // "Drop"
case 166: // "Exec"
case 167: // "ExpireVar"
case 168: // "Id"
case 169: // "InitCol"
case 170: // "Log"
case 171: // "LogData"
case 172: // "Maturity"
case 173: // "Msg"
case 174: // "MultiMatch"
case 175: // "NoAuditLog"
case 176: // "NoLog"
case 177: // "Pass"
case 178: // "Pause"
case 179: // "Phase"
case 180: // "Prepend"
case 181: // "Proxy"
case 182: // "Redirect"
case 183: // "Rev"
case 184: // "SanitiseArg"
case 185: // "SanitiseMatched"
case 186: // "SanitiseMatchedBytes"
case 187: // "SanitiseRequestHeader"
case 188: // "SanitiseResponseHeader"
case 189: // "SetEnv"
case 190: // "SetRsc"
case 191: // "SetSid"
case 192: // "SetUID"
case 193: // "Severity"
case 194: // "Skip"
case 195: // "SkipAfter"
case 196: // "Status"
case 197: // "Tag"
case 198: // "ACTION_TRANSFORMATION_BASE_64_ENCODE"
case 199: // "ACTION_TRANSFORMATION_BASE_64_DECODE"
case 200: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT"
case 201: // "ACTION_TRANSFORMATION_CMD_LINE"
case 202: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE"
case 203: // "ACTION_TRANSFORMATION_CSS_DECODE"
case 204: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE"
case 205: // "ACTION_TRANSFORMATION_HEX_ENCODE"
case 206: // "ACTION_TRANSFORMATION_HEX_DECODE"
case 207: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE"
case 208: // "ACTION_TRANSFORMATION_JS_DECODE"
case 209: // "ACTION_TRANSFORMATION_LENGTH"
case 210: // "ACTION_TRANSFORMATION_LOWERCASE"
case 211: // "ACTION_TRANSFORMATION_MD5"
case 212: // "ACTION_TRANSFORMATION_NONE"
case 213: // "ACTION_TRANSFORMATION_NORMALISE_PATH"
case 214: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN"
case 215: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT"
case 216: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT"
case 217: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT"
case 218: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS"
case 219: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR"
case 220: // "ACTION_TRANSFORMATION_REMOVE_NULLS"
case 221: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE"
case 222: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS"
case 223: // "ACTION_TRANSFORMATION_REPLACE_NULLS"
case 224: // "ACTION_TRANSFORMATION_SHA1"
case 225: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE"
case 226: // "ACTION_TRANSFORMATION_TRIM"
case 227: // "ACTION_TRANSFORMATION_TRIM_LEFT"
case 228: // "ACTION_TRANSFORMATION_TRIM_RIGHT"
case 229: // "ACTION_TRANSFORMATION_UPPERCASE"
case 230: // "ACTION_TRANSFORMATION_URL_ENCODE"
case 231: // "ACTION_TRANSFORMATION_URL_DECODE"
case 232: // "ACTION_TRANSFORMATION_URL_DECODE_UNI"
case 233: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE"
case 234: // "Ver"
case 235: // "xmlns"
case 236: // "CONFIG_COMPONENT_SIG"
case 237: // "CONFIG_CONN_ENGINE"
case 238: // "CONFIG_SEC_ARGUMENT_SEPARATOR"
case 239: // "CONFIG_SEC_WEB_APP_ID"
case 240: // "CONFIG_SEC_SERVER_SIG"
case 241: // "CONFIG_DIR_AUDIT_DIR"
case 242: // "CONFIG_DIR_AUDIT_DIR_MOD"
case 243: // "CONFIG_DIR_AUDIT_ENG"
case 244: // "CONFIG_DIR_AUDIT_FLE_MOD"
case 245: // "CONFIG_DIR_AUDIT_LOG"
case 246: // "CONFIG_DIR_AUDIT_LOG2"
case 247: // "CONFIG_DIR_AUDIT_LOG_P"
case 248: // "CONFIG_DIR_AUDIT_STS"
case 249: // "CONFIG_DIR_AUDIT_TPE"
case 250: // "CONFIG_DIR_DEBUG_LOG"
case 251: // "CONFIG_DIR_DEBUG_LVL"
case 252: // "CONFIG_SEC_CACHE_TRANSFORMATIONS"
case 253: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS"
case 254: // "CONFIG_SEC_HASH_ENGINE"
case 255: // "CONFIG_SEC_HASH_KEY"
case 256: // "CONFIG_SEC_HASH_PARAM"
case 257: // "CONFIG_SEC_HASH_METHOD_RX"
case 258: // "CONFIG_SEC_HASH_METHOD_PM"
case 259: // "CONFIG_SEC_CHROOT_DIR"
case 260: // "CONFIG_DIR_GEO_DB"
case 261: // "CONFIG_DIR_GSB_DB"
case 262: // "CONFIG_SEC_GUARDIAN_LOG"
case 263: // "CONFIG_DIR_PCRE_MATCH_LIMIT"
case 264: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION"
case 265: // "CONFIG_SEC_CONN_R_STATE_LIMIT"
case 266: // "CONFIG_SEC_CONN_W_STATE_LIMIT"
case 267: // "CONFIG_SEC_SENSOR_ID"
case 268: // "CONFIG_DIR_ARGS_LIMIT"
case 269: // "CONFIG_DIR_REQ_BODY"
case 270: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT"
case 271: // "CONFIG_DIR_REQ_BODY_LIMIT"
case 272: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION"
case 273: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT"
case 274: // "CONFIG_DIR_RES_BODY"
case 275: // "CONFIG_DIR_RES_BODY_LIMIT"
case 276: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION"
case 277: // "CONFIG_SEC_RULE_INHERITANCE"
case 278: // "CONFIG_SEC_RULE_PERF_TIME"
case 279: // "CONFIG_DIR_RULE_ENG"
case 280: // "CONFIG_DIR_SEC_ACTION"
case 281: // "CONFIG_DIR_SEC_DEFAULT_ACTION"
case 282: // "CONFIG_DIR_SEC_MARKER"
case 283: // "CONFIG_DIR_UNICODE_MAP_FILE"
case 284: // "CONFIG_DIR_UNICODE_CODE_PAGE"
case 285: // "CONFIG_SEC_COLLECTION_TIMEOUT"
case 286: // "CONFIG_SEC_HTTP_BLKEY"
case 287: // "CONFIG_SEC_INTERCEPT_ON_ERROR"
case 288: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION"
case 289: // "CONFIG_SEC_RULE_REMOVE_BY_ID"
case 290: // "CONFIG_SEC_RULE_REMOVE_BY_MSG"
case 291: // "CONFIG_SEC_RULE_REMOVE_BY_TAG"
case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG"
case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG"
case 294: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID"
case 295: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID"
case 296: // "CONFIG_UPDLOAD_KEEP_FILES"
case 297: // "CONFIG_UPDLOAD_SAVE_TMP_FILES"
case 298: // "CONFIG_UPLOAD_DIR"
case 299: // "CONFIG_UPLOAD_FILE_LIMIT"
case 300: // "CONFIG_UPLOAD_FILE_MODE"
case 301: // "CONFIG_VALUE_ABORT"
case 302: // "CONFIG_VALUE_DETC"
case 303: // "CONFIG_VALUE_HTTPS"
case 304: // "CONFIG_VALUE_OFF"
case 305: // "CONFIG_VALUE_ON"
case 306: // "CONFIG_VALUE_PARALLEL"
case 307: // "CONFIG_VALUE_PROCESS_PARTIAL"
case 308: // "CONFIG_VALUE_REJECT"
case 309: // "CONFIG_VALUE_RELEVANT_ONLY"
case 310: // "CONFIG_VALUE_SERIAL"
case 311: // "CONFIG_VALUE_WARN"
case 312: // "CONFIG_XML_EXTERNAL_ENTITY"
case 313: // "CONGIG_DIR_RESPONSE_BODY_MP"
case 314: // "CONGIG_DIR_SEC_ARG_SEP"
case 315: // "CONGIG_DIR_SEC_COOKIE_FORMAT"
case 316: // "CONFIG_SEC_COOKIEV0_SEPARATOR"
case 317: // "CONGIG_DIR_SEC_DATA_DIR"
case 318: // "CONGIG_DIR_SEC_STATUS_ENGINE"
case 319: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION"
case 320: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION"
case 321: // "CONGIG_DIR_SEC_TMP_DIR"
case 322: // "DIRECTIVE"
case 323: // "DIRECTIVE_SECRULESCRIPT"
case 324: // "FREE_TEXT_QUOTE_MACRO_EXPANSION"
case 325: // "QUOTATION_MARK"
case 326: // "RUN_TIME_VAR_BLD"
case 327: // "RUN_TIME_VAR_DUR"
case 328: // "RUN_TIME_VAR_HSV"
case 329: // "RUN_TIME_VAR_REMOTE_USER"
case 330: // "RUN_TIME_VAR_TIME"
case 331: // "RUN_TIME_VAR_TIME_DAY"
case 332: // "RUN_TIME_VAR_TIME_EPOCH"
case 333: // "RUN_TIME_VAR_TIME_HOUR"
case 334: // "RUN_TIME_VAR_TIME_MIN"
case 335: // "RUN_TIME_VAR_TIME_MON"
case 336: // "RUN_TIME_VAR_TIME_SEC"
case 337: // "RUN_TIME_VAR_TIME_WDAY"
case 338: // "RUN_TIME_VAR_TIME_YEAR"
case 339: // "VARIABLE"
case 340: // "Dictionary element"
case 341: // "Dictionary element, selected by regexp"
value.copy< std::string > (that.value);
break;
case 348: // op
case 349: // op_before_init
value.copy< std::unique_ptr > (that.value);
break;
case 357: // run_time_string
value.copy< std::unique_ptr > (that.value);
break;
case 354: // var
value.copy< std::unique_ptr > (that.value);
break;
case 355: // act
case 356: // setvar_action
value.copy< std::unique_ptr > (that.value);
break;
case 351: // variables
case 352: // variables_pre_process
case 353: // variables_may_be_quoted
value.copy< std::unique_ptr > > > (that.value);
break;
case 346: // actions
case 347: // actions_may_quoted
value.copy< std::unique_ptr > > > (that.value);
break;
default:
break;
}
location = that.location;
return *this;
}
seclang_parser::stack_symbol_type&
seclang_parser::stack_symbol_type::operator= (stack_symbol_type& that)
{
state = that.state;
switch (that.type_get ())
{
case 145: // "Accuracy"
case 146: // "Allow"
case 147: // "Append"
case 148: // "AuditLog"
case 149: // "Block"
case 150: // "Capture"
case 151: // "Chain"
case 152: // "ACTION_CTL_AUDIT_ENGINE"
case 153: // "ACTION_CTL_AUDIT_LOG_PARTS"
case 154: // "ACTION_CTL_BDY_JSON"
case 155: // "ACTION_CTL_BDY_XML"
case 156: // "ACTION_CTL_BDY_URLENCODED"
case 157: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
case 158: // "ACTION_CTL_REQUEST_BODY_ACCESS"
case 159: // "ACTION_CTL_RULE_REMOVE_BY_ID"
case 160: // "ACTION_CTL_RULE_REMOVE_BY_TAG"
case 161: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
case 162: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
case 163: // "Deny"
case 164: // "DeprecateVar"
case 165: // "Drop"
case 166: // "Exec"
case 167: // "ExpireVar"
case 168: // "Id"
case 169: // "InitCol"
case 170: // "Log"
case 171: // "LogData"
case 172: // "Maturity"
case 173: // "Msg"
case 174: // "MultiMatch"
case 175: // "NoAuditLog"
case 176: // "NoLog"
case 177: // "Pass"
case 178: // "Pause"
case 179: // "Phase"
case 180: // "Prepend"
case 181: // "Proxy"
case 182: // "Redirect"
case 183: // "Rev"
case 184: // "SanitiseArg"
case 185: // "SanitiseMatched"
case 186: // "SanitiseMatchedBytes"
case 187: // "SanitiseRequestHeader"
case 188: // "SanitiseResponseHeader"
case 189: // "SetEnv"
case 190: // "SetRsc"
case 191: // "SetSid"
case 192: // "SetUID"
case 193: // "Severity"
case 194: // "Skip"
case 195: // "SkipAfter"
case 196: // "Status"
case 197: // "Tag"
case 198: // "ACTION_TRANSFORMATION_BASE_64_ENCODE"
case 199: // "ACTION_TRANSFORMATION_BASE_64_DECODE"
case 200: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT"
case 201: // "ACTION_TRANSFORMATION_CMD_LINE"
case 202: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE"
case 203: // "ACTION_TRANSFORMATION_CSS_DECODE"
case 204: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE"
case 205: // "ACTION_TRANSFORMATION_HEX_ENCODE"
case 206: // "ACTION_TRANSFORMATION_HEX_DECODE"
case 207: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE"
case 208: // "ACTION_TRANSFORMATION_JS_DECODE"
case 209: // "ACTION_TRANSFORMATION_LENGTH"
case 210: // "ACTION_TRANSFORMATION_LOWERCASE"
case 211: // "ACTION_TRANSFORMATION_MD5"
case 212: // "ACTION_TRANSFORMATION_NONE"
case 213: // "ACTION_TRANSFORMATION_NORMALISE_PATH"
case 214: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN"
case 215: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT"
case 216: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT"
case 217: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT"
case 218: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS"
case 219: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR"
case 220: // "ACTION_TRANSFORMATION_REMOVE_NULLS"
case 221: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE"
case 222: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS"
case 223: // "ACTION_TRANSFORMATION_REPLACE_NULLS"
case 224: // "ACTION_TRANSFORMATION_SHA1"
case 225: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE"
case 226: // "ACTION_TRANSFORMATION_TRIM"
case 227: // "ACTION_TRANSFORMATION_TRIM_LEFT"
case 228: // "ACTION_TRANSFORMATION_TRIM_RIGHT"
case 229: // "ACTION_TRANSFORMATION_UPPERCASE"
case 230: // "ACTION_TRANSFORMATION_URL_ENCODE"
case 231: // "ACTION_TRANSFORMATION_URL_DECODE"
case 232: // "ACTION_TRANSFORMATION_URL_DECODE_UNI"
case 233: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE"
case 234: // "Ver"
case 235: // "xmlns"
case 236: // "CONFIG_COMPONENT_SIG"
case 237: // "CONFIG_CONN_ENGINE"
case 238: // "CONFIG_SEC_ARGUMENT_SEPARATOR"
case 239: // "CONFIG_SEC_WEB_APP_ID"
case 240: // "CONFIG_SEC_SERVER_SIG"
case 241: // "CONFIG_DIR_AUDIT_DIR"
case 242: // "CONFIG_DIR_AUDIT_DIR_MOD"
case 243: // "CONFIG_DIR_AUDIT_ENG"
case 244: // "CONFIG_DIR_AUDIT_FLE_MOD"
case 245: // "CONFIG_DIR_AUDIT_LOG"
case 246: // "CONFIG_DIR_AUDIT_LOG2"
case 247: // "CONFIG_DIR_AUDIT_LOG_P"
case 248: // "CONFIG_DIR_AUDIT_STS"
case 249: // "CONFIG_DIR_AUDIT_TPE"
case 250: // "CONFIG_DIR_DEBUG_LOG"
case 251: // "CONFIG_DIR_DEBUG_LVL"
case 252: // "CONFIG_SEC_CACHE_TRANSFORMATIONS"
case 253: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS"
case 254: // "CONFIG_SEC_HASH_ENGINE"
case 255: // "CONFIG_SEC_HASH_KEY"
case 256: // "CONFIG_SEC_HASH_PARAM"
case 257: // "CONFIG_SEC_HASH_METHOD_RX"
case 258: // "CONFIG_SEC_HASH_METHOD_PM"
case 259: // "CONFIG_SEC_CHROOT_DIR"
case 260: // "CONFIG_DIR_GEO_DB"
case 261: // "CONFIG_DIR_GSB_DB"
case 262: // "CONFIG_SEC_GUARDIAN_LOG"
case 263: // "CONFIG_DIR_PCRE_MATCH_LIMIT"
case 264: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION"
case 265: // "CONFIG_SEC_CONN_R_STATE_LIMIT"
case 266: // "CONFIG_SEC_CONN_W_STATE_LIMIT"
case 267: // "CONFIG_SEC_SENSOR_ID"
case 268: // "CONFIG_DIR_ARGS_LIMIT"
case 269: // "CONFIG_DIR_REQ_BODY"
case 270: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT"
case 271: // "CONFIG_DIR_REQ_BODY_LIMIT"
case 272: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION"
case 273: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT"
case 274: // "CONFIG_DIR_RES_BODY"
case 275: // "CONFIG_DIR_RES_BODY_LIMIT"
case 276: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION"
case 277: // "CONFIG_SEC_RULE_INHERITANCE"
case 278: // "CONFIG_SEC_RULE_PERF_TIME"
case 279: // "CONFIG_DIR_RULE_ENG"
case 280: // "CONFIG_DIR_SEC_ACTION"
case 281: // "CONFIG_DIR_SEC_DEFAULT_ACTION"
case 282: // "CONFIG_DIR_SEC_MARKER"
case 283: // "CONFIG_DIR_UNICODE_MAP_FILE"
case 284: // "CONFIG_DIR_UNICODE_CODE_PAGE"
case 285: // "CONFIG_SEC_COLLECTION_TIMEOUT"
case 286: // "CONFIG_SEC_HTTP_BLKEY"
case 287: // "CONFIG_SEC_INTERCEPT_ON_ERROR"
case 288: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION"
case 289: // "CONFIG_SEC_RULE_REMOVE_BY_ID"
case 290: // "CONFIG_SEC_RULE_REMOVE_BY_MSG"
case 291: // "CONFIG_SEC_RULE_REMOVE_BY_TAG"
case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG"
case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG"
case 294: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID"
case 295: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID"
case 296: // "CONFIG_UPDLOAD_KEEP_FILES"
case 297: // "CONFIG_UPDLOAD_SAVE_TMP_FILES"
case 298: // "CONFIG_UPLOAD_DIR"
case 299: // "CONFIG_UPLOAD_FILE_LIMIT"
case 300: // "CONFIG_UPLOAD_FILE_MODE"
case 301: // "CONFIG_VALUE_ABORT"
case 302: // "CONFIG_VALUE_DETC"
case 303: // "CONFIG_VALUE_HTTPS"
case 304: // "CONFIG_VALUE_OFF"
case 305: // "CONFIG_VALUE_ON"
case 306: // "CONFIG_VALUE_PARALLEL"
case 307: // "CONFIG_VALUE_PROCESS_PARTIAL"
case 308: // "CONFIG_VALUE_REJECT"
case 309: // "CONFIG_VALUE_RELEVANT_ONLY"
case 310: // "CONFIG_VALUE_SERIAL"
case 311: // "CONFIG_VALUE_WARN"
case 312: // "CONFIG_XML_EXTERNAL_ENTITY"
case 313: // "CONGIG_DIR_RESPONSE_BODY_MP"
case 314: // "CONGIG_DIR_SEC_ARG_SEP"
case 315: // "CONGIG_DIR_SEC_COOKIE_FORMAT"
case 316: // "CONFIG_SEC_COOKIEV0_SEPARATOR"
case 317: // "CONGIG_DIR_SEC_DATA_DIR"
case 318: // "CONGIG_DIR_SEC_STATUS_ENGINE"
case 319: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION"
case 320: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION"
case 321: // "CONGIG_DIR_SEC_TMP_DIR"
case 322: // "DIRECTIVE"
case 323: // "DIRECTIVE_SECRULESCRIPT"
case 324: // "FREE_TEXT_QUOTE_MACRO_EXPANSION"
case 325: // "QUOTATION_MARK"
case 326: // "RUN_TIME_VAR_BLD"
case 327: // "RUN_TIME_VAR_DUR"
case 328: // "RUN_TIME_VAR_HSV"
case 329: // "RUN_TIME_VAR_REMOTE_USER"
case 330: // "RUN_TIME_VAR_TIME"
case 331: // "RUN_TIME_VAR_TIME_DAY"
case 332: // "RUN_TIME_VAR_TIME_EPOCH"
case 333: // "RUN_TIME_VAR_TIME_HOUR"
case 334: // "RUN_TIME_VAR_TIME_MIN"
case 335: // "RUN_TIME_VAR_TIME_MON"
case 336: // "RUN_TIME_VAR_TIME_SEC"
case 337: // "RUN_TIME_VAR_TIME_WDAY"
case 338: // "RUN_TIME_VAR_TIME_YEAR"
case 339: // "VARIABLE"
case 340: // "Dictionary element"
case 341: // "Dictionary element, selected by regexp"
value.move< std::string > (that.value);
break;
case 348: // op
case 349: // op_before_init
value.move< std::unique_ptr > (that.value);
break;
case 357: // run_time_string
value.move< std::unique_ptr > (that.value);
break;
case 354: // var
value.move< std::unique_ptr > (that.value);
break;
case 355: // act
case 356: // setvar_action
value.move< std::unique_ptr > (that.value);
break;
case 351: // variables
case 352: // variables_pre_process
case 353: // variables_may_be_quoted
value.move< std::unique_ptr > > > (that.value);
break;
case 346: // actions
case 347: // actions_may_quoted
value.move< std::unique_ptr > > > (that.value);
break;
default:
break;
}
location = that.location;
// that is emptied.
that.state = empty_state;
return *this;
}
#endif
template
void
seclang_parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const
{
if (yymsg)
YY_SYMBOL_PRINT (yymsg, yysym);
}
#if YYDEBUG
template
void
seclang_parser::yy_print_ (std::ostream& yyo,
const basic_symbol& yysym) const
{
std::ostream& yyoutput = yyo;
YYUSE (yyoutput);
symbol_number_type yytype = yysym.type_get ();
#if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ * 100 + __GNUC_MINOR__ <= 408
// Avoid a (spurious) G++ 4.8 warning about "array subscript is
// below array bounds".
if (yysym.empty ())
std::abort ();
#endif
yyo << (yytype < yyntokens_ ? "token" : "nterm")
<< ' ' << yytname_[yytype] << " ("
<< yysym.location << ": ";
YYUSE (yytype);
yyo << ')';
}
#endif
void
seclang_parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
{
if (m)
YY_SYMBOL_PRINT (m, sym);
yystack_.push (YY_MOVE (sym));
}
void
seclang_parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
{
#if 201103L <= YY_CPLUSPLUS
yypush_ (m, stack_symbol_type (s, std::move (sym)));
#else
stack_symbol_type ss (s, sym);
yypush_ (m, ss);
#endif
}
void
seclang_parser::yypop_ (int n)
{
yystack_.pop (n);
}
#if YYDEBUG
std::ostream&
seclang_parser::debug_stream () const
{
return *yycdebug_;
}
void
seclang_parser::set_debug_stream (std::ostream& o)
{
yycdebug_ = &o;
}
seclang_parser::debug_level_type
seclang_parser::debug_level () const
{
return yydebug_;
}
void
seclang_parser::set_debug_level (debug_level_type l)
{
yydebug_ = l;
}
#endif // YYDEBUG
seclang_parser::state_type
seclang_parser::yy_lr_goto_state_ (state_type yystate, int yysym)
{
int yyr = yypgoto_[yysym - yyntokens_] + yystate;
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
return yytable_[yyr];
else
return yydefgoto_[yysym - yyntokens_];
}
bool
seclang_parser::yy_pact_value_is_default_ (int yyvalue)
{
return yyvalue == yypact_ninf_;
}
bool
seclang_parser::yy_table_value_is_error_ (int yyvalue)
{
return yyvalue == yytable_ninf_;
}
int
seclang_parser::operator() ()
{
return parse ();
}
int
seclang_parser::parse ()
{
int yyn;
/// Length of the RHS of the rule being reduced.
int yylen = 0;
// Error handling.
int yynerrs_ = 0;
int yyerrstatus_ = 0;
/// The lookahead symbol.
symbol_type yyla;
/// The locations where the error started and ended.
stack_symbol_type yyerror_range[3];
/// The return value of parse ().
int yyresult;
#if YY_EXCEPTIONS
try
#endif // YY_EXCEPTIONS
{
YYCDEBUG << "Starting parse\n";
// User initialization code.
#line 317 "seclang-parser.yy"
{
// Initialize the initial location.
yyla.location.begin.filename = yyla.location.end.filename = new std::string(driver.file);
}
#line 1366 "seclang-parser.cc"
/* Initialize the stack. The initial state will be set in
yynewstate, since the latter expects the semantical and the
location values to have been already stored, initialize these
stacks with a primary value. */
yystack_.clear ();
yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
/*-----------------------------------------------.
| yynewstate -- push a new symbol on the stack. |
`-----------------------------------------------*/
yynewstate:
YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n';
// Accept?
if (yystack_[0].state == yyfinal_)
YYACCEPT;
goto yybackup;
/*-----------.
| yybackup. |
`-----------*/
yybackup:
// Try to take a decision without lookahead.
yyn = yypact_[+yystack_[0].state];
if (yy_pact_value_is_default_ (yyn))
goto yydefault;
// Read a lookahead token.
if (yyla.empty ())
{
YYCDEBUG << "Reading a token: ";
#if YY_EXCEPTIONS
try
#endif // YY_EXCEPTIONS
{
symbol_type yylookahead (yylex (driver));
yyla.move (yylookahead);
}
#if YY_EXCEPTIONS
catch (const syntax_error& yyexc)
{
YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
error (yyexc);
goto yyerrlab1;
}
#endif // YY_EXCEPTIONS
}
YY_SYMBOL_PRINT ("Next token is", yyla);
/* If the proper action on seeing token YYLA.TYPE is to reduce or
to detect an error, take that action. */
yyn += yyla.type_get ();
if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ())
{
goto yydefault;
}
// Reduce or error.
yyn = yytable_[yyn];
if (yyn <= 0)
{
if (yy_table_value_is_error_ (yyn))
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
// Count tokens shifted since error; after three, turn off error status.
if (yyerrstatus_)
--yyerrstatus_;
// Shift the lookahead token.
yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla));
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
yydefault:
yyn = yydefact_[+yystack_[0].state];
if (yyn == 0)
goto yyerrlab;
goto yyreduce;
/*-----------------------------.
| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
yylen = yyr2_[yyn];
{
stack_symbol_type yylhs;
yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
/* Variants are always initialized to an empty instance of the
correct type. The default '$$ = $1' action is NOT applied
when using variants. */
switch (yyr1_[yyn])
{
case 145: // "Accuracy"
case 146: // "Allow"
case 147: // "Append"
case 148: // "AuditLog"
case 149: // "Block"
case 150: // "Capture"
case 151: // "Chain"
case 152: // "ACTION_CTL_AUDIT_ENGINE"
case 153: // "ACTION_CTL_AUDIT_LOG_PARTS"
case 154: // "ACTION_CTL_BDY_JSON"
case 155: // "ACTION_CTL_BDY_XML"
case 156: // "ACTION_CTL_BDY_URLENCODED"
case 157: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
case 158: // "ACTION_CTL_REQUEST_BODY_ACCESS"
case 159: // "ACTION_CTL_RULE_REMOVE_BY_ID"
case 160: // "ACTION_CTL_RULE_REMOVE_BY_TAG"
case 161: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
case 162: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
case 163: // "Deny"
case 164: // "DeprecateVar"
case 165: // "Drop"
case 166: // "Exec"
case 167: // "ExpireVar"
case 168: // "Id"
case 169: // "InitCol"
case 170: // "Log"
case 171: // "LogData"
case 172: // "Maturity"
case 173: // "Msg"
case 174: // "MultiMatch"
case 175: // "NoAuditLog"
case 176: // "NoLog"
case 177: // "Pass"
case 178: // "Pause"
case 179: // "Phase"
case 180: // "Prepend"
case 181: // "Proxy"
case 182: // "Redirect"
case 183: // "Rev"
case 184: // "SanitiseArg"
case 185: // "SanitiseMatched"
case 186: // "SanitiseMatchedBytes"
case 187: // "SanitiseRequestHeader"
case 188: // "SanitiseResponseHeader"
case 189: // "SetEnv"
case 190: // "SetRsc"
case 191: // "SetSid"
case 192: // "SetUID"
case 193: // "Severity"
case 194: // "Skip"
case 195: // "SkipAfter"
case 196: // "Status"
case 197: // "Tag"
case 198: // "ACTION_TRANSFORMATION_BASE_64_ENCODE"
case 199: // "ACTION_TRANSFORMATION_BASE_64_DECODE"
case 200: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT"
case 201: // "ACTION_TRANSFORMATION_CMD_LINE"
case 202: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE"
case 203: // "ACTION_TRANSFORMATION_CSS_DECODE"
case 204: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE"
case 205: // "ACTION_TRANSFORMATION_HEX_ENCODE"
case 206: // "ACTION_TRANSFORMATION_HEX_DECODE"
case 207: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE"
case 208: // "ACTION_TRANSFORMATION_JS_DECODE"
case 209: // "ACTION_TRANSFORMATION_LENGTH"
case 210: // "ACTION_TRANSFORMATION_LOWERCASE"
case 211: // "ACTION_TRANSFORMATION_MD5"
case 212: // "ACTION_TRANSFORMATION_NONE"
case 213: // "ACTION_TRANSFORMATION_NORMALISE_PATH"
case 214: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN"
case 215: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT"
case 216: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT"
case 217: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT"
case 218: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS"
case 219: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR"
case 220: // "ACTION_TRANSFORMATION_REMOVE_NULLS"
case 221: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE"
case 222: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS"
case 223: // "ACTION_TRANSFORMATION_REPLACE_NULLS"
case 224: // "ACTION_TRANSFORMATION_SHA1"
case 225: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE"
case 226: // "ACTION_TRANSFORMATION_TRIM"
case 227: // "ACTION_TRANSFORMATION_TRIM_LEFT"
case 228: // "ACTION_TRANSFORMATION_TRIM_RIGHT"
case 229: // "ACTION_TRANSFORMATION_UPPERCASE"
case 230: // "ACTION_TRANSFORMATION_URL_ENCODE"
case 231: // "ACTION_TRANSFORMATION_URL_DECODE"
case 232: // "ACTION_TRANSFORMATION_URL_DECODE_UNI"
case 233: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE"
case 234: // "Ver"
case 235: // "xmlns"
case 236: // "CONFIG_COMPONENT_SIG"
case 237: // "CONFIG_CONN_ENGINE"
case 238: // "CONFIG_SEC_ARGUMENT_SEPARATOR"
case 239: // "CONFIG_SEC_WEB_APP_ID"
case 240: // "CONFIG_SEC_SERVER_SIG"
case 241: // "CONFIG_DIR_AUDIT_DIR"
case 242: // "CONFIG_DIR_AUDIT_DIR_MOD"
case 243: // "CONFIG_DIR_AUDIT_ENG"
case 244: // "CONFIG_DIR_AUDIT_FLE_MOD"
case 245: // "CONFIG_DIR_AUDIT_LOG"
case 246: // "CONFIG_DIR_AUDIT_LOG2"
case 247: // "CONFIG_DIR_AUDIT_LOG_P"
case 248: // "CONFIG_DIR_AUDIT_STS"
case 249: // "CONFIG_DIR_AUDIT_TPE"
case 250: // "CONFIG_DIR_DEBUG_LOG"
case 251: // "CONFIG_DIR_DEBUG_LVL"
case 252: // "CONFIG_SEC_CACHE_TRANSFORMATIONS"
case 253: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS"
case 254: // "CONFIG_SEC_HASH_ENGINE"
case 255: // "CONFIG_SEC_HASH_KEY"
case 256: // "CONFIG_SEC_HASH_PARAM"
case 257: // "CONFIG_SEC_HASH_METHOD_RX"
case 258: // "CONFIG_SEC_HASH_METHOD_PM"
case 259: // "CONFIG_SEC_CHROOT_DIR"
case 260: // "CONFIG_DIR_GEO_DB"
case 261: // "CONFIG_DIR_GSB_DB"
case 262: // "CONFIG_SEC_GUARDIAN_LOG"
case 263: // "CONFIG_DIR_PCRE_MATCH_LIMIT"
case 264: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION"
case 265: // "CONFIG_SEC_CONN_R_STATE_LIMIT"
case 266: // "CONFIG_SEC_CONN_W_STATE_LIMIT"
case 267: // "CONFIG_SEC_SENSOR_ID"
case 268: // "CONFIG_DIR_ARGS_LIMIT"
case 269: // "CONFIG_DIR_REQ_BODY"
case 270: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT"
case 271: // "CONFIG_DIR_REQ_BODY_LIMIT"
case 272: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION"
case 273: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT"
case 274: // "CONFIG_DIR_RES_BODY"
case 275: // "CONFIG_DIR_RES_BODY_LIMIT"
case 276: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION"
case 277: // "CONFIG_SEC_RULE_INHERITANCE"
case 278: // "CONFIG_SEC_RULE_PERF_TIME"
case 279: // "CONFIG_DIR_RULE_ENG"
case 280: // "CONFIG_DIR_SEC_ACTION"
case 281: // "CONFIG_DIR_SEC_DEFAULT_ACTION"
case 282: // "CONFIG_DIR_SEC_MARKER"
case 283: // "CONFIG_DIR_UNICODE_MAP_FILE"
case 284: // "CONFIG_DIR_UNICODE_CODE_PAGE"
case 285: // "CONFIG_SEC_COLLECTION_TIMEOUT"
case 286: // "CONFIG_SEC_HTTP_BLKEY"
case 287: // "CONFIG_SEC_INTERCEPT_ON_ERROR"
case 288: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION"
case 289: // "CONFIG_SEC_RULE_REMOVE_BY_ID"
case 290: // "CONFIG_SEC_RULE_REMOVE_BY_MSG"
case 291: // "CONFIG_SEC_RULE_REMOVE_BY_TAG"
case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG"
case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG"
case 294: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID"
case 295: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID"
case 296: // "CONFIG_UPDLOAD_KEEP_FILES"
case 297: // "CONFIG_UPDLOAD_SAVE_TMP_FILES"
case 298: // "CONFIG_UPLOAD_DIR"
case 299: // "CONFIG_UPLOAD_FILE_LIMIT"
case 300: // "CONFIG_UPLOAD_FILE_MODE"
case 301: // "CONFIG_VALUE_ABORT"
case 302: // "CONFIG_VALUE_DETC"
case 303: // "CONFIG_VALUE_HTTPS"
case 304: // "CONFIG_VALUE_OFF"
case 305: // "CONFIG_VALUE_ON"
case 306: // "CONFIG_VALUE_PARALLEL"
case 307: // "CONFIG_VALUE_PROCESS_PARTIAL"
case 308: // "CONFIG_VALUE_REJECT"
case 309: // "CONFIG_VALUE_RELEVANT_ONLY"
case 310: // "CONFIG_VALUE_SERIAL"
case 311: // "CONFIG_VALUE_WARN"
case 312: // "CONFIG_XML_EXTERNAL_ENTITY"
case 313: // "CONGIG_DIR_RESPONSE_BODY_MP"
case 314: // "CONGIG_DIR_SEC_ARG_SEP"
case 315: // "CONGIG_DIR_SEC_COOKIE_FORMAT"
case 316: // "CONFIG_SEC_COOKIEV0_SEPARATOR"
case 317: // "CONGIG_DIR_SEC_DATA_DIR"
case 318: // "CONGIG_DIR_SEC_STATUS_ENGINE"
case 319: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION"
case 320: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION"
case 321: // "CONGIG_DIR_SEC_TMP_DIR"
case 322: // "DIRECTIVE"
case 323: // "DIRECTIVE_SECRULESCRIPT"
case 324: // "FREE_TEXT_QUOTE_MACRO_EXPANSION"
case 325: // "QUOTATION_MARK"
case 326: // "RUN_TIME_VAR_BLD"
case 327: // "RUN_TIME_VAR_DUR"
case 328: // "RUN_TIME_VAR_HSV"
case 329: // "RUN_TIME_VAR_REMOTE_USER"
case 330: // "RUN_TIME_VAR_TIME"
case 331: // "RUN_TIME_VAR_TIME_DAY"
case 332: // "RUN_TIME_VAR_TIME_EPOCH"
case 333: // "RUN_TIME_VAR_TIME_HOUR"
case 334: // "RUN_TIME_VAR_TIME_MIN"
case 335: // "RUN_TIME_VAR_TIME_MON"
case 336: // "RUN_TIME_VAR_TIME_SEC"
case 337: // "RUN_TIME_VAR_TIME_WDAY"
case 338: // "RUN_TIME_VAR_TIME_YEAR"
case 339: // "VARIABLE"
case 340: // "Dictionary element"
case 341: // "Dictionary element, selected by regexp"
yylhs.value.emplace< std::string > ();
break;
case 348: // op
case 349: // op_before_init
yylhs.value.emplace< std::unique_ptr > ();
break;
case 357: // run_time_string
yylhs.value.emplace< std::unique_ptr > ();
break;
case 354: // var
yylhs.value.emplace< std::unique_ptr > ();
break;
case 355: // act
case 356: // setvar_action
yylhs.value.emplace< std::unique_ptr > ();
break;
case 351: // variables
case 352: // variables_pre_process
case 353: // variables_may_be_quoted
yylhs.value.emplace< std::unique_ptr > > > ();
break;
case 346: // actions
case 347: // actions_may_quoted
yylhs.value.emplace< std::unique_ptr > > > ();
break;
default:
break;
}
// Default location.
{
stack_type::slice range (yystack_, yylen);
YYLLOC_DEFAULT (yylhs.location, range, yylen);
yyerror_range[1].location = yylhs.location;
}
// Perform the reduction.
YY_REDUCE_PRINT (yyn);
#if YY_EXCEPTIONS
try
#endif // YY_EXCEPTIONS
{
switch (yyn)
{
case 2:
#line 709 "seclang-parser.yy"
{
return 0;
}
#line 1724 "seclang-parser.cc"
break;
case 6:
#line 722 "seclang-parser.yy"
{
driver.m_auditLog->setStorageDirMode(strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8));
}
#line 1732 "seclang-parser.cc"
break;
case 7:
#line 728 "seclang-parser.yy"
{
driver.m_auditLog->setStorageDir(yystack_[0].value.as < std::string > ());
}
#line 1740 "seclang-parser.cc"
break;
case 8:
#line 734 "seclang-parser.yy"
{
driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::RelevantOnlyAuditLogStatus);
}
#line 1748 "seclang-parser.cc"
break;
case 9:
#line 738 "seclang-parser.yy"
{
driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::OffAuditLogStatus);
}
#line 1756 "seclang-parser.cc"
break;
case 10:
#line 742 "seclang-parser.yy"
{
driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::OnAuditLogStatus);
}
#line 1764 "seclang-parser.cc"
break;
case 11:
#line 748 "seclang-parser.yy"
{
driver.m_auditLog->setFileMode(strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8));
}
#line 1772 "seclang-parser.cc"
break;
case 12:
#line 754 "seclang-parser.yy"
{
driver.m_auditLog->setFilePath2(yystack_[0].value.as < std::string > ());
}
#line 1780 "seclang-parser.cc"
break;
case 13:
#line 760 "seclang-parser.yy"
{
driver.m_auditLog->setParts(yystack_[0].value.as < std::string > ());
}
#line 1788 "seclang-parser.cc"
break;
case 14:
#line 766 "seclang-parser.yy"
{
driver.m_auditLog->setFilePath1(yystack_[0].value.as < std::string > ());
}
#line 1796 "seclang-parser.cc"
break;
case 15:
#line 771 "seclang-parser.yy"
{
driver.m_auditLog->setFormat(modsecurity::audit_log::AuditLog::JSONAuditLogFormat);
}
#line 1804 "seclang-parser.cc"
break;
case 16:
#line 776 "seclang-parser.yy"
{
driver.m_auditLog->setFormat(modsecurity::audit_log::AuditLog::NativeAuditLogFormat);
}
#line 1812 "seclang-parser.cc"
break;
case 17:
#line 782 "seclang-parser.yy"
{
std::string relevant_status(yystack_[0].value.as < std::string > ());
driver.m_auditLog->setRelevantStatus(relevant_status);
}
#line 1821 "seclang-parser.cc"
break;
case 18:
#line 789 "seclang-parser.yy"
{
driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::SerialAuditLogType);
}
#line 1829 "seclang-parser.cc"
break;
case 19:
#line 793 "seclang-parser.yy"
{
driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::ParallelAuditLogType);
}
#line 1837 "seclang-parser.cc"
break;
case 20:
#line 797 "seclang-parser.yy"
{
driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::HttpsAuditLogType);
}
#line 1845 "seclang-parser.cc"
break;
case 21:
#line 803 "seclang-parser.yy"
{
driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::TrueConfigBoolean;
}
#line 1853 "seclang-parser.cc"
break;
case 22:
#line 807 "seclang-parser.yy"
{
driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::FalseConfigBoolean;
}
#line 1861 "seclang-parser.cc"
break;
case 23:
#line 811 "seclang-parser.yy"
{
driver.error(yystack_[2].location, "SecUploadKeepFiles RelevantOnly is not currently supported. Accepted values are On or Off");
YYERROR;
}
#line 1870 "seclang-parser.cc"
break;
case 24:
#line 816 "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);
}
#line 1879 "seclang-parser.cc"
break;
case 25:
#line 821 "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);
}
#line 1888 "seclang-parser.cc"
break;
case 26:
#line 826 "seclang-parser.yy"
{
driver.m_uploadDirectory.m_set = true;
driver.m_uploadDirectory.m_value = yystack_[0].value.as < std::string > ();
}
#line 1897 "seclang-parser.cc"
break;
case 27:
#line 831 "seclang-parser.yy"
{
driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::TrueConfigBoolean;
}
#line 1905 "seclang-parser.cc"
break;
case 28:
#line 835 "seclang-parser.yy"
{
driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::FalseConfigBoolean;
}
#line 1913 "seclang-parser.cc"
break;
case 29:
#line 842 "seclang-parser.yy"
{
yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[1].value.as < std::unique_ptr > > > ());
}
#line 1921 "seclang-parser.cc"
break;
case 30:
#line 846 "seclang-parser.yy"
{
yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[0].value.as < std::unique_ptr > > > ());
}
#line 1929 "seclang-parser.cc"
break;
case 31:
#line 853 "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 > ()));
yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[2].value.as < std::unique_ptr > > > ());
}
#line 1939 "seclang-parser.cc"
break;
case 32:
#line 859 "seclang-parser.yy"
{
std::unique_ptr>> b(new std::vector>());
ACTION_INIT(yystack_[0].value.as < std::unique_ptr > (), yystack_[1].location)
b->push_back(std::move(yystack_[0].value.as < std::unique_ptr > ()));
yylhs.value.as < std::unique_ptr > > > () = std::move(b);
}
#line 1950 "seclang-parser.cc"
break;
case 33:
#line 869 "seclang-parser.yy"
{
yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ());
std::string error;
if (yylhs.value.as < std::unique_ptr > ()->init(*yystack_[0].location.end.filename, &error) == false) {
driver.error(yystack_[1].location, error);
YYERROR;
}
}
#line 1963 "seclang-parser.cc"
break;
case 34:
#line 878 "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;
std::string error;
if (yylhs.value.as < std::unique_ptr > ()->init(*yystack_[1].location.end.filename, &error) == false) {
driver.error(yystack_[2].location, error);
YYERROR;
}
}
#line 1977 "seclang-parser.cc"
break;
case 35:
#line 888 "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;
if (yylhs.value.as < std::unique_ptr > ()->init(*yystack_[0].location.end.filename, &error) == false) {
driver.error(yystack_[1].location, error);
YYERROR;
}
}
#line 1990 "seclang-parser.cc"
break;
case 36:
#line 897 "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;
std::string error;
if (yylhs.value.as < std::unique_ptr > ()->init(*yystack_[1].location.end.filename, &error) == false) {
driver.error(yystack_[2].location, error);
YYERROR;
}
}
#line 2004 "seclang-parser.cc"
break;
case 37:
#line 910 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::UnconditionalMatch());
}
#line 2012 "seclang-parser.cc"
break;
case 38:
#line 914 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::DetectSQLi());
}
#line 2020 "seclang-parser.cc"
break;
case 39:
#line 918 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::DetectXSS());
}
#line 2028 "seclang-parser.cc"
break;
case 40:
#line 922 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateUrlEncoding());
}
#line 2036 "seclang-parser.cc"
break;
case 41:
#line 926 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateUtf8Encoding());
}
#line 2044 "seclang-parser.cc"
break;
case 42:
#line 930 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::InspectFile(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2052 "seclang-parser.cc"
break;
case 43:
#line 934 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::FuzzyHash(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2060 "seclang-parser.cc"
break;
case 44:
#line 938 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateByteRange(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2068 "seclang-parser.cc"
break;
case 45:
#line 942 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateDTD(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2076 "seclang-parser.cc"
break;
case 46:
#line 946 "seclang-parser.yy"
{
/* $$ = new operators::ValidateHash($1); */
OPERATOR_NOT_SUPPORTED("ValidateHash", yystack_[2].location);
}
#line 2085 "seclang-parser.cc"
break;
case 47:
#line 951 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateSchema(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2093 "seclang-parser.cc"
break;
case 48:
#line 955 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifyCC(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2101 "seclang-parser.cc"
break;
case 49:
#line 959 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifyCPF(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2109 "seclang-parser.cc"
break;
case 50:
#line 963 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifySSN(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2117 "seclang-parser.cc"
break;
case 51:
#line 967 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifySVNR(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2125 "seclang-parser.cc"
break;
case 52:
#line 971 "seclang-parser.yy"
{
/* $$ = new operators::GsbLookup($1); */
OPERATOR_NOT_SUPPORTED("GsbLookup", yystack_[2].location);
}
#line 2134 "seclang-parser.cc"
break;
case 53:
#line 976 "seclang-parser.yy"
{
/* $$ = new operators::Rsub($1); */
OPERATOR_NOT_SUPPORTED("Rsub", yystack_[2].location);
}
#line 2143 "seclang-parser.cc"
break;
case 54:
#line 981 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Within(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2151 "seclang-parser.cc"
break;
case 55:
#line 985 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ContainsWord(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2159 "seclang-parser.cc"
break;
case 56:
#line 989 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Contains(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2167 "seclang-parser.cc"
break;
case 57:
#line 993 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::EndsWith(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2175 "seclang-parser.cc"
break;
case 58:
#line 997 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Eq(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2183 "seclang-parser.cc"
break;
case 59:
#line 1001 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Ge(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2191 "seclang-parser.cc"
break;
case 60:
#line 1005 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Gt(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2199 "seclang-parser.cc"
break;
case 61:
#line 1009 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::IpMatchF(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2207 "seclang-parser.cc"
break;
case 62:
#line 1013 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::IpMatch(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2215 "seclang-parser.cc"
break;
case 63:
#line 1017 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Le(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2223 "seclang-parser.cc"
break;
case 64:
#line 1021 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Lt(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2231 "seclang-parser.cc"
break;
case 65:
#line 1025 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::PmFromFile(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2239 "seclang-parser.cc"
break;
case 66:
#line 1029 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Pm(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2247 "seclang-parser.cc"
break;
case 67:
#line 1033 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rbl(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2255 "seclang-parser.cc"
break;
case 68:
#line 1037 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2263 "seclang-parser.cc"
break;
case 69:
#line 1041 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::StrEq(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2271 "seclang-parser.cc"
break;
case 70:
#line 1045 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::StrMatch(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2279 "seclang-parser.cc"
break;
case 71:
#line 1049 "seclang-parser.yy"
{
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::BeginsWith(std::move(yystack_[0].value.as < std::unique_ptr > ())));
}
#line 2287 "seclang-parser.cc"
break;
case 72:
#line 1053 "seclang-parser.yy"
{
#if defined(WITH_GEOIP) or defined(WITH_MAXMIND)
OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::GeoLookup());
#else
std::stringstream ss;
ss << "This version of ModSecurity was not compiled with GeoIP or MaxMind support.";
driver.error(yystack_[1].location, ss.str());
YYERROR;
#endif // WITH_GEOIP
}
#line 2302 "seclang-parser.cc"
break;
case 74:
#line 1068 "seclang-parser.yy"
{
std::vector *a = new std::vector();
std::vector *t = new std::vector();
for (auto &i : *yystack_[0].value.as < std::unique_ptr > > > ().get()) {
if (dynamic_cast(i.get())) {
t->push_back(dynamic_cast(i.release()));
} else {
a->push_back(i.release());
}
}
variables::Variables *v = new variables::Variables();
for (auto &i : *yystack_[2].value.as < std::unique_ptr > > > ().get()) {
v->push_back(i.release());
}
Operator *op = yystack_[1].value.as < std::unique_ptr > ().release();
std::unique_ptr rule(new Rule(
/* op */ op,
/* variables */ v,
/* actions */ a,
/* transformations */ t,
/* file name */ std::unique_ptr(new std::string(*yystack_[3].location.end.filename)),
/* line number */ yystack_[3].location.end.line
));
if (driver.addSecRule(std::move(rule)) == false) {
YYERROR;
}
}
#line 2336 "seclang-parser.cc"
break;
case 75:
#line 1098 "seclang-parser.yy"
{
variables::Variables *v = new variables::Variables();
for (auto &i : *yystack_[1].value.as < std::unique_ptr > > > ().get()) {
v->push_back(i.release());
}
std::unique_ptr rule(new Rule(
/* op */ yystack_[0].value.as < std::unique_ptr > ().release(),
/* variables */ v,
/* actions */ NULL,
/* transformations */ NULL,
/* file name */ std::unique_ptr(new std::string(*yystack_[2].location.end.filename)),
/* line number */ yystack_[2].location.end.line
));
if (driver.addSecRule(std::move(rule)) == false) {
YYERROR;
}
}
#line 2359 "seclang-parser.cc"
break;
case 76:
#line 1117 "seclang-parser.yy"
{
std::vector *a = new std::vector();
std::vector *t = new std::vector();
for (auto &i : *yystack_[0].value.as < std::unique_ptr > > > ().get()) {
if (dynamic_cast(i.get())) {
t->push_back(dynamic_cast(i.release()));
} else {
a->push_back(i.release());
}
}
std::unique_ptr rule(new Rule(
/* op */ NULL,
/* variables */ NULL,
/* actions */ a,
/* transformations */ t,
/* file name */ std::unique_ptr(new std::string(*yystack_[1].location.end.filename)),
/* line number */ yystack_[1].location.end.line
));
driver.addSecAction(std::move(rule));
}
#line 2384 "seclang-parser.cc"
break;
case 77:
#line 1138 "seclang-parser.yy"
{
std::string err;
std::vector *a = new std::vector();
std::vector *t = new std::vector();
for (auto &i : *yystack_[0].value.as < std::unique_ptr > > > ().get()) {
if (dynamic_cast(i.get())) {
t->push_back(dynamic_cast(i.release()));
} else {
a->push_back(i.release());
}
}
std::unique_ptr r(new RuleScript(
/* path to script */ yystack_[1].value.as < std::string > (),
/* actions */ a,
/* transformations */ t,
/* file name */ std::unique_ptr(new std::string(*yystack_[1].location.end.filename)),
/* line number */ yystack_[1].location.end.line
));
if (r->init(&err) == false) {
driver.error(yystack_[2].location, "Failed to load script: " + err);
YYERROR;
}
if (driver.addSecRuleScript(std::move(r)) == false) {
YYERROR;
}
}
#line 2416 "seclang-parser.cc"
break;
case 78:
#line 1166 "seclang-parser.yy"
{
bool hasDisruptive = false;
std::vector *actions = new std::vector();
for (auto &i : *yystack_[0].value.as < std::unique_ptr > > > ().get()) {
actions->push_back(i.release());
}
std::vector checkedActions;
int definedPhase = -1;
int secRuleDefinedPhase = -1;
for (actions::Action *a : *actions) {
actions::Phase *phase = dynamic_cast(a);
if (a->isDisruptive() == true && dynamic_cast(a) == NULL) {
hasDisruptive = true;
}
if (phase != NULL) {
definedPhase = phase->m_phase;
secRuleDefinedPhase = phase->m_secRulesPhase;
delete phase;
} else if (a->action_kind == actions::Action::RunTimeOnlyIfMatchKind ||
a->action_kind == 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");
YYERROR;
}
checkedActions.push_back(a);
} else {
driver.error(yystack_[2].location, "The action '" + *a->m_name.get() + "' is not suitable to be part of the SecDefaultActions");
YYERROR;
}
}
if (definedPhase == -1) {
definedPhase = modsecurity::Phases::RequestHeadersPhase;
}
if (hasDisruptive == false) {
driver.error(yystack_[2].location, "SecDefaultAction must specify a disruptive action.");
YYERROR;
}
if (!driver.m_defaultActions[definedPhase].empty()) {
std::stringstream ss;
ss << "SecDefaultActions can only be placed once per phase and configuration context. Phase ";
ss << secRuleDefinedPhase;
ss << " was informed already.";
driver.error(yystack_[2].location, ss.str());
YYERROR;
}
for (actions::Action *a : checkedActions) {
driver.m_defaultActions[definedPhase].push_back(
std::unique_ptr(a));
}
delete actions;
}
#line 2477 "seclang-parser.cc"
break;
case 79:
#line 1223 "seclang-parser.yy"
{
driver.addSecMarker(modsecurity::utils::string::removeBracketsIfNeeded(yystack_[0].value.as < std::string > ()));
}
#line 2485 "seclang-parser.cc"
break;
case 80:
#line 1227 "seclang-parser.yy"
{
driver.m_secRuleEngine = modsecurity::RulesSet::DisabledRuleEngine;
}
#line 2493 "seclang-parser.cc"
break;
case 81:
#line 1231 "seclang-parser.yy"
{
driver.m_secRuleEngine = modsecurity::RulesSet::EnabledRuleEngine;
}
#line 2501 "seclang-parser.cc"
break;
case 82:
#line 1235 "seclang-parser.yy"
{
driver.m_secRuleEngine = modsecurity::RulesSet::DetectionOnlyRuleEngine;
}
#line 2509 "seclang-parser.cc"
break;
case 83:
#line 1239 "seclang-parser.yy"
{
driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean;
}
#line 2517 "seclang-parser.cc"
break;
case 84:
#line 1243 "seclang-parser.yy"
{
driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean;
}
#line 2525 "seclang-parser.cc"
break;
case 85:
#line 1247 "seclang-parser.yy"
{
driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean;
}
#line 2533 "seclang-parser.cc"
break;
case 86:
#line 1251 "seclang-parser.yy"
{
driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean;
}
#line 2541 "seclang-parser.cc"
break;
case 87:
#line 1255 "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.");
YYERROR;
}
driver.m_secArgumentSeparator.m_value = yystack_[0].value.as < std::string > ();
driver.m_secArgumentSeparator.m_set = true;
}
#line 2554 "seclang-parser.cc"
break;
case 88:
#line 1264 "seclang-parser.yy"
{
driver.m_components.push_back(yystack_[0].value.as < std::string > ());
}
#line 2562 "seclang-parser.cc"
break;
case 89:
#line 1268 "seclang-parser.yy"
{
driver.error(yystack_[2].location, "SecConnEngine is not yet supported.");
YYERROR;
}
#line 2571 "seclang-parser.cc"
break;
case 90:
#line 1273 "seclang-parser.yy"
{
}
#line 2578 "seclang-parser.cc"
break;
case 91:
#line 1276 "seclang-parser.yy"
{
driver.m_secWebAppId.m_value = yystack_[0].value.as < std::string > ();
driver.m_secWebAppId.m_set = true;
}
#line 2587 "seclang-parser.cc"
break;
case 92:
#line 1281 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecServerSignature is not supported.");
YYERROR;
}
#line 2596 "seclang-parser.cc"
break;
case 93:
#line 1286 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecCacheTransformations is not supported.");
YYERROR;
}
#line 2605 "seclang-parser.cc"
break;
case 94:
#line 1291 "seclang-parser.yy"
{
driver.error(yystack_[2].location, "SecDisableBackendCompression is not supported.");
YYERROR;
}
#line 2614 "seclang-parser.cc"
break;
case 95:
#line 1296 "seclang-parser.yy"
{
}
#line 2621 "seclang-parser.cc"
break;
case 96:
#line 1299 "seclang-parser.yy"
{
driver.error(yystack_[2].location, "SecContentInjection is not yet supported.");
YYERROR;
}
#line 2630 "seclang-parser.cc"
break;
case 97:
#line 1304 "seclang-parser.yy"
{
}
#line 2637 "seclang-parser.cc"
break;
case 98:
#line 1307 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecChrootDir is not supported.");
YYERROR;
}
#line 2646 "seclang-parser.cc"
break;
case 99:
#line 1312 "seclang-parser.yy"
{
driver.error(yystack_[2].location, "SecHashEngine is not yet supported.");
YYERROR;
}
#line 2655 "seclang-parser.cc"
break;
case 100:
#line 1317 "seclang-parser.yy"
{
}
#line 2662 "seclang-parser.cc"
break;
case 101:
#line 1320 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecHashKey is not yet supported.");
YYERROR;
}
#line 2671 "seclang-parser.cc"
break;
case 102:
#line 1325 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecHashParam is not yet supported.");
YYERROR;
}
#line 2680 "seclang-parser.cc"
break;
case 103:
#line 1330 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecHashMethodRx is not yet supported.");
YYERROR;
}
#line 2689 "seclang-parser.cc"
break;
case 104:
#line 1335 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecHashMethodPm is not yet supported.");
YYERROR;
}
#line 2698 "seclang-parser.cc"
break;
case 105:
#line 1340 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecGsbLookupDb is not supported.");
YYERROR;
}
#line 2707 "seclang-parser.cc"
break;
case 106:
#line 1345 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecGuardianLog is not supported.");
YYERROR;
}
#line 2716 "seclang-parser.cc"
break;
case 107:
#line 1350 "seclang-parser.yy"
{
driver.error(yystack_[2].location, "SecInterceptOnError is not yet supported.");
YYERROR;
}
#line 2725 "seclang-parser.cc"
break;
case 108:
#line 1355 "seclang-parser.yy"
{
}
#line 2732 "seclang-parser.cc"
break;
case 109:
#line 1358 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecConnReadStateLimit is not yet supported.");
YYERROR;
}
#line 2741 "seclang-parser.cc"
break;
case 110:
#line 1363 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecConnWriteStateLimit is not yet supported.");
YYERROR;
}
#line 2750 "seclang-parser.cc"
break;
case 111:
#line 1368 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecSensorId is not yet supported.");
YYERROR;
}
#line 2759 "seclang-parser.cc"
break;
case 112:
#line 1373 "seclang-parser.yy"
{
driver.error(yystack_[2].location, "SecRuleInheritance is not yet supported.");
YYERROR;
}
#line 2768 "seclang-parser.cc"
break;
case 113:
#line 1378 "seclang-parser.yy"
{
}
#line 2775 "seclang-parser.cc"
break;
case 114:
#line 1381 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecRulePerfTime is not yet supported.");
YYERROR;
}
#line 2784 "seclang-parser.cc"
break;
case 115:
#line 1386 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecStreamInBodyInspection is not supported.");
YYERROR;
}
#line 2793 "seclang-parser.cc"
break;
case 116:
#line 1391 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecStreamOutBodyInspection is not supported.");
YYERROR;
}
#line 2802 "seclang-parser.cc"
break;
case 117:
#line 1396 "seclang-parser.yy"
{
std::string error;
if (driver.m_exceptions.load(yystack_[0].value.as < std::string > (), &error) == false) {
std::stringstream ss;
ss << "SecRuleRemoveById: failed to load:";
ss << yystack_[0].value.as < std::string > ();
ss << ". ";
ss << error;
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
}
#line 2819 "seclang-parser.cc"
break;
case 118:
#line 1409 "seclang-parser.yy"
{
std::string error;
if (driver.m_exceptions.loadRemoveRuleByTag(yystack_[0].value.as < std::string > (), &error) == false) {
std::stringstream ss;
ss << "SecRuleRemoveByTag: failed to load:";
ss << yystack_[0].value.as < std::string > ();
ss << ". ";
ss << error;
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
}
#line 2836 "seclang-parser.cc"
break;
case 119:
#line 1422 "seclang-parser.yy"
{
std::string error;
if (driver.m_exceptions.loadRemoveRuleByMsg(yystack_[0].value.as < std::string > (), &error) == false) {
std::stringstream ss;
ss << "SecRuleRemoveByMsg: failed to load:";
ss << yystack_[0].value.as < std::string > ();
ss << ". ";
ss << error;
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
}
#line 2853 "seclang-parser.cc"
break;
case 120:
#line 1435 "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) {
std::stringstream ss;
ss << "SecRuleUpdateTargetByTag: failed to load:";
ss << yystack_[1].value.as < std::string > ();
ss << ". ";
ss << error;
driver.error(yystack_[2].location, ss.str());
YYERROR;
}
}
#line 2870 "seclang-parser.cc"
break;
case 121:
#line 1448 "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) {
std::stringstream ss;
ss << "SecRuleUpdateTargetByMsg: failed to load:";
ss << yystack_[1].value.as < std::string > ();
ss << ". ";
ss << error;
driver.error(yystack_[2].location, ss.str());
YYERROR;
}
}
#line 2887 "seclang-parser.cc"
break;
case 122:
#line 1461 "seclang-parser.yy"
{
std::string error;
double ruleId;
try {
ruleId = std::stod(yystack_[1].value.as < std::string > ());
} catch (...) {
std::stringstream ss;
ss << "SecRuleUpdateTargetById: failed to load:";
ss << "The input \"" + yystack_[1].value.as < std::string > () + "\" does not ";
ss << "seems to be a valid rule id.";
ss << ". ";
driver.error(yystack_[2].location, ss.str());
YYERROR;
}
if (driver.m_exceptions.loadUpdateTargetById(ruleId, std::move(yystack_[0].value.as < std::unique_ptr > > > ()), &error) == false) {
std::stringstream ss;
ss << "SecRuleUpdateTargetById: failed to load:";
ss << yystack_[1].value.as < std::string > ();
ss << ". ";
ss << error;
driver.error(yystack_[2].location, ss.str());
YYERROR;
}
}
#line 2917 "seclang-parser.cc"
break;
case 123:
#line 1487 "seclang-parser.yy"
{
std::string error;
double ruleId;
try {
ruleId = std::stod(yystack_[1].value.as < std::string > ());
} catch (...) {
std::stringstream ss;
ss << "SecRuleUpdateActionById: failed to load:";
ss << "The input \"" + yystack_[1].value.as < std::string > () + "\" does not ";
ss << "seems to be a valid rule id.";
ss << ". ";
driver.error(yystack_[2].location, ss.str());
YYERROR;
}
if (driver.m_exceptions.loadUpdateActionById(ruleId, std::move(yystack_[0].value.as < std::unique_ptr > > > ()), &error) == false) {
std::stringstream ss;
ss << "SecRuleUpdateActionById: failed to load:";
ss << yystack_[1].value.as < std::string > ();
ss << ". ";
ss << error;
driver.error(yystack_[2].location, ss.str());
YYERROR;
}
}
#line 2948 "seclang-parser.cc"
break;
case 124:
#line 1515 "seclang-parser.yy"
{
if (driver.m_debugLog != NULL) {
driver.m_debugLog->setDebugLogLevel(atoi(yystack_[0].value.as < std::string > ().c_str()));
} else {
std::stringstream ss;
ss << "Internal error, there is no DebugLog ";
ss << "object associated with the driver class";
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
}
#line 2964 "seclang-parser.cc"
break;
case 125:
#line 1527 "seclang-parser.yy"
{
if (driver.m_debugLog != NULL) {
std::string error;
driver.m_debugLog->setDebugLogFile(yystack_[0].value.as < std::string > (), &error);
if (error.size() > 0) {
std::stringstream ss;
ss << "Failed to start DebugLog: " << error;
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
} else {
std::stringstream ss;
ss << "Internal error, there is no DebugLog ";
ss << "object associated with the driver class";
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
}
#line 2987 "seclang-parser.cc"
break;
case 126:
#line 1547 "seclang-parser.yy"
{
#if defined(WITH_GEOIP) or defined(WITH_MAXMIND)
std::string err;
std::string file = modsecurity::utils::find_resource(yystack_[0].value.as < std::string > (),
*yystack_[0].location.end.filename, &err);
if (file.empty()) {
std::stringstream ss;
ss << "Failed to load locate the GeoDB file from: " << yystack_[0].value.as < std::string > () << " ";
ss << err;
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
if (Utils::GeoLookup::getInstance().setDataBase(file, &err) == false) {
std::stringstream ss;
ss << "Failed to load the GeoDB from: ";
ss << file << ". " << err;
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
#else
std::stringstream ss;
ss << "This version of ModSecurity was not compiled with GeoIP or MaxMind support.";
driver.error(yystack_[1].location, ss.str());
YYERROR;
#endif // WITH_GEOIP
}
#line 3018 "seclang-parser.cc"
break;
case 127:
#line 1574 "seclang-parser.yy"
{
driver.m_argumentsLimit.m_set = true;
driver.m_argumentsLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str());
}
#line 3027 "seclang-parser.cc"
break;
case 128:
#line 1580 "seclang-parser.yy"
{
driver.m_requestBodyLimit.m_set = true;
driver.m_requestBodyLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str());
}
#line 3036 "seclang-parser.cc"
break;
case 129:
#line 1585 "seclang-parser.yy"
{
driver.m_requestBodyNoFilesLimit.m_set = true;
driver.m_requestBodyNoFilesLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str());
}
#line 3045 "seclang-parser.cc"
break;
case 130:
#line 1590 "seclang-parser.yy"
{
std::stringstream ss;
ss << "As of ModSecurity version 3.0, SecRequestBodyInMemoryLimit is no longer ";
ss << "supported. Instead, you can use your web server configurations to control ";
ss << "those values. ModSecurity will follow the web server decision.";
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
#line 3058 "seclang-parser.cc"
break;
case 131:
#line 1599 "seclang-parser.yy"
{
driver.m_responseBodyLimit.m_set = true;
driver.m_responseBodyLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str());
}
#line 3067 "seclang-parser.cc"
break;
case 132:
#line 1604 "seclang-parser.yy"
{
driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction;
}
#line 3075 "seclang-parser.cc"
break;
case 133:
#line 1608 "seclang-parser.yy"
{
driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction;
}
#line 3083 "seclang-parser.cc"
break;
case 134:
#line 1612 "seclang-parser.yy"
{
driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction;
}
#line 3091 "seclang-parser.cc"
break;
case 135:
#line 1616 "seclang-parser.yy"
{
driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction;
}
#line 3099 "seclang-parser.cc"
break;
case 136:
#line 1620 "seclang-parser.yy"
{
driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction;
}
#line 3107 "seclang-parser.cc"
break;
case 137:
#line 1624 "seclang-parser.yy"
{
driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction;
}
#line 3115 "seclang-parser.cc"
break;
case 140:
#line 1638 "seclang-parser.yy"
{
std::istringstream buf(yystack_[0].value.as < std::string > ());
std::istream_iterator beg(buf), end;
std::set tokens(beg, end);
driver.m_responseBodyTypeToBeInspected.m_set = true;
for (std::set::iterator it=tokens.begin();
it!=tokens.end(); ++it)
{
driver.m_responseBodyTypeToBeInspected.m_value.insert(*it);
}
}
#line 3131 "seclang-parser.cc"
break;
case 141:
#line 1650 "seclang-parser.yy"
{
driver.m_responseBodyTypeToBeInspected.m_set = true;
driver.m_responseBodyTypeToBeInspected.m_clear = true;
driver.m_responseBodyTypeToBeInspected.m_value.clear();
}
#line 3141 "seclang-parser.cc"
break;
case 142:
#line 1656 "seclang-parser.yy"
{
driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::FalseConfigBoolean;
}
#line 3149 "seclang-parser.cc"
break;
case 143:
#line 1660 "seclang-parser.yy"
{
driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::TrueConfigBoolean;
}
#line 3157 "seclang-parser.cc"
break;
case 144:
#line 1664 "seclang-parser.yy"
{
/* Parser error disabled to avoid breaking default installations with modsecurity.conf-recommended
std::stringstream ss;
ss << "As of ModSecurity version 3.0, SecTmpDir is no longer supported.";
ss << " Instead, you can use your web server configurations to control when";
ss << "and where to swap. ModSecurity will follow the web server decision.";
driver.error(@0, ss.str());
YYERROR;
*/
}
#line 3172 "seclang-parser.cc"
break;
case 147:
#line 1685 "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.");
YYERROR;
}
}
#line 3183 "seclang-parser.cc"
break;
case 148:
#line 1692 "seclang-parser.yy"
{
driver.error(yystack_[1].location, "SecCookieV0Separator is not yet supported.");
YYERROR;
}
#line 3192 "seclang-parser.cc"
break;
case 150:
#line 1702 "seclang-parser.yy"
{
std::string error;
std::vector param;
double num = 0;
std::string f;
std::string file;
std::string err;
param = utils::string::ssplit(yystack_[0].value.as < std::string > (), ' ');
if (param.size() <= 1) {
std::stringstream ss;
ss << "Failed to process unicode map, missing ";
ss << "parameter: " << yystack_[0].value.as < std::string > () << " ";
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
try {
num = std::stod(param.back());
} catch (...) {
std::stringstream ss;
ss << "Failed to process unicode map, last parameter is ";
ss << "expected to be a number: " << param.back() << " ";
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
param.pop_back();
while (param.size() > 0) {
if (f.empty()) {
f = param.back();
} else {
f = param.back() + " " + f;
}
param.pop_back();
}
file = modsecurity::utils::find_resource(f, *yystack_[0].location.end.filename, &err);
if (file.empty()) {
std::stringstream ss;
ss << "Failed to locate the unicode map file from: " << f << " ";
ss << err;
driver.error(yystack_[1].location, ss.str());
YYERROR;
}
ConfigUnicodeMap::loadConfig(file, num, &driver, &error);
if (!error.empty()) {
driver.error(yystack_[1].location, error);
YYERROR;
}
}
#line 3250 "seclang-parser.cc"
break;
case 151:
#line 1756 "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.");
YYERROR;
*/
}
#line 3261 "seclang-parser.cc"
break;
case 152:
#line 1763 "seclang-parser.yy"
{
driver.m_httpblKey.m_set = true;
driver.m_httpblKey.m_value = yystack_[0].value.as < std::string > ();
}
#line 3270 "seclang-parser.cc"
break;
case 153:
#line 1771 "seclang-parser.yy"
{
std::unique_ptr > > originalList = std::move(yystack_[0].value.as < std::unique_ptr > > > ());
std::unique_ptr>> newList(new std::vector>());
std::unique_ptr>> newNewList(new std::vector>());
std::unique_ptr>> exclusionVars(new std::vector>());
while (!originalList->empty()) {
std::unique_ptr var = std::move(originalList->back());
originalList->pop_back();
if (dynamic_cast(var.get())) {
exclusionVars->push_back(std::move(var));
} else {
newList->push_back(std::move(var));
}
}
while (!newList->empty()) {
bool doNotAdd = false;
std::unique_ptr var = std::move(newList->back());
newList->pop_back();
for (auto &i : *exclusionVars) {
if (*var == *i) {
doNotAdd = true;
}
if (i->belongsToCollection(var.get())) {
var->addsKeyExclusion(i.get());
}
}
if (!doNotAdd) {
newNewList->push_back(std::move(var));
}
}
yylhs.value.as < std::unique_ptr > > > () = std::move(newNewList);
}
#line 3308 "seclang-parser.cc"
break;
case 154:
#line 1808 "seclang-parser.yy"
{
yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[0].value.as < std::unique_ptr > > > ());
}
#line 3316 "seclang-parser.cc"
break;
case 155:
#line 1812 "seclang-parser.yy"
{
yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[1].value.as < std::unique_ptr > > > ());
}
#line 3324 "seclang-parser.cc"
break;
case 156:
#line 1819 "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 > > > ());
}
#line 3333 "seclang-parser.cc"
break;
case 157:
#line 1824 "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));
yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[3].value.as < std::unique_ptr > > > ());
}
#line 3343 "seclang-parser.cc"
break;
case 158:
#line 1830 "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));
yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[3].value.as < std::unique_ptr > > > ());
}
#line 3353 "seclang-parser.cc"
break;
case 159:
#line 1836 "seclang-parser.yy"
{
std::unique_ptr>> b(new std::vector>());
b->push_back(std::move(yystack_[0].value.as < std::unique_ptr > ()));
yylhs.value.as < std::unique_ptr > > > () = std::move(b);
}
#line 3363 "seclang-parser.cc"
break;
case 160:
#line 1842 "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 > ())));
b->push_back(std::move(c));
yylhs.value.as < std::unique_ptr > > > () = std::move(b);
}
#line 3374 "seclang-parser.cc"
break;
case 161:
#line 1849 "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 > ())));
b->push_back(std::move(c));
yylhs.value.as < std::unique_ptr > > > () = std::move(b);
}
#line 3385 "seclang-parser.cc"
break;
case 162:
#line 1859 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3393 "seclang-parser.cc"
break;
case 163:
#line 1863 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3401 "seclang-parser.cc"
break;
case 164:
#line 1867 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_NoDictElement());
}
#line 3409 "seclang-parser.cc"
break;
case 165:
#line 1871 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3417 "seclang-parser.cc"
break;
case 166:
#line 1875 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3425 "seclang-parser.cc"
break;
case 167:
#line 1879 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_NoDictElement());
}
#line 3433 "seclang-parser.cc"
break;
case 168:
#line 1883 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3441 "seclang-parser.cc"
break;
case 169:
#line 1887 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3449 "seclang-parser.cc"
break;
case 170:
#line 1891 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_NoDictElement());
}
#line 3457 "seclang-parser.cc"
break;
case 171:
#line 1895 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3465 "seclang-parser.cc"
break;
case 172:
#line 1899 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3473 "seclang-parser.cc"
break;
case 173:
#line 1903 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_NoDictElement());
}
#line 3481 "seclang-parser.cc"
break;
case 174:
#line 1907 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3489 "seclang-parser.cc"
break;
case 175:
#line 1911 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3497 "seclang-parser.cc"
break;
case 176:
#line 1915 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_NoDictElement());
}
#line 3505 "seclang-parser.cc"
break;
case 177:
#line 1919 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3513 "seclang-parser.cc"
break;
case 178:
#line 1923 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3521 "seclang-parser.cc"
break;
case 179:
#line 1927 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_NoDictElement());
}
#line 3529 "seclang-parser.cc"
break;
case 180:
#line 1931 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3537 "seclang-parser.cc"
break;
case 181:
#line 1935 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3545 "seclang-parser.cc"
break;
case 182:
#line 1939 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_NoDictElement());
}
#line 3553 "seclang-parser.cc"
break;
case 183:
#line 1943 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3561 "seclang-parser.cc"
break;
case 184:
#line 1947 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3569 "seclang-parser.cc"
break;
case 185:
#line 1951 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_NoDictElement());
}
#line 3577 "seclang-parser.cc"
break;
case 186:
#line 1955 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3585 "seclang-parser.cc"
break;
case 187:
#line 1959 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3593 "seclang-parser.cc"
break;
case 188:
#line 1963 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_NoDictElement());
}
#line 3601 "seclang-parser.cc"
break;
case 189:
#line 1967 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3609 "seclang-parser.cc"
break;
case 190:
#line 1971 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3617 "seclang-parser.cc"
break;
case 191:
#line 1975 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_NoDictElement());
}
#line 3625 "seclang-parser.cc"
break;
case 192:
#line 1979 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3633 "seclang-parser.cc"
break;
case 193:
#line 1983 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3641 "seclang-parser.cc"
break;
case 194:
#line 1987 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_NoDictElement());
}
#line 3649 "seclang-parser.cc"
break;
case 195:
#line 1991 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3657 "seclang-parser.cc"
break;
case 196:
#line 1995 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3665 "seclang-parser.cc"
break;
case 197:
#line 1999 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_NoDictElement());
}
#line 3673 "seclang-parser.cc"
break;
case 198:
#line 2003 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_DictElement(yystack_[0].value.as < std::string > ()));
}
#line 3681 "seclang-parser.cc"
break;
case 199:
#line 2007 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_DictElementRegexp(yystack_[0].value.as < std::string > ()));
}
#line 3689 "seclang-parser.cc"
break;
case 200:
#line 2011 "seclang-parser.yy"
{
VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr