diff --git a/src/bw/Dockerfile b/src/bw/Dockerfile index d79d870af..cf406d753 100644 --- a/src/bw/Dockerfile +++ b/src/bw/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.20.2-alpine AS builder +FROM nginx:1.22.1-alpine AS builder # Copy dependencies sources folder COPY src/deps /tmp/bunkerweb/deps @@ -21,7 +21,7 @@ RUN apk add --no-cache --virtual build py3-pip && \ pip install --no-cache-dir --require-hashes --target /usr/share/bunkerweb/deps/python -r /usr/share/bunkerweb/deps/requirements.txt && \ apk del build -FROM nginx:1.20.2-alpine +FROM nginx:1.22.1-alpine # Copy dependencies COPY --from=builder /usr/share/bunkerweb /usr/share/bunkerweb @@ -43,7 +43,7 @@ COPY src/common/utils /usr/share/bunkerweb/utils COPY src/VERSION /usr/share/bunkerweb/VERSION # Install runtime dependencies, pypi packages, move bwcli, create data folders and set permissions -RUN apk add --no-cache bash python3 && \ +RUN apk add --no-cache pcre bash python3 && \ cp /usr/share/bunkerweb/helpers/bwcli /usr/bin/ && \ echo "Docker" > /usr/share/bunkerweb/INTEGRATION && \ mkdir -p /var/tmp/bunkerweb && \ diff --git a/src/common/db/requirements.in b/src/common/db/requirements.in index c34ca6e68..08794418f 100644 --- a/src/common/db/requirements.in +++ b/src/common/db/requirements.in @@ -1,4 +1,4 @@ -sqlalchemy==1.4.43 +sqlalchemy==1.4.44 psycopg2-binary==2.9.5 PyMySQL==1.0.2 -oracledb==1.1.1 +oracledb==1.2.0 diff --git a/src/common/db/requirements.txt b/src/common/db/requirements.txt index 6b6bf01f3..680a12887 100644 --- a/src/common/db/requirements.txt +++ b/src/common/db/requirements.txt @@ -160,30 +160,35 @@ greenlet==2.0.1 \ --hash=sha256:f6327b6907b4cb72f650a5b7b1be23a2aab395017aa6f1adb13069d66360eb3f \ --hash=sha256:fb412b7db83fe56847df9c47b6fe3f13911b06339c2aa02dcc09dce8bbf582cd # via sqlalchemy -oracledb==1.1.1 \ - --hash=sha256:07846a86f481f9105dbf53390e1cb6b422ac929717949fbe9f2251a11a8f4332 \ - --hash=sha256:0f731830519aef5b8c90c051ac631bdb9458a960a95945532dcf91c2cb66edf2 \ - --hash=sha256:0f7ab47b95b5c7dad464fbcdad0731ee2e99defdecaf2d05808bceb7038d2489 \ - --hash=sha256:24296ff54bca75c3b26df7b988a3b49ccd51d6070fc15d4e1cafafb277361f97 \ - --hash=sha256:36d767d2e2a6abbb3f52ea76625f040bdaf32a141a4aa64942952e7e99051e0b \ - --hash=sha256:393245177e3a0fcddbbc4f738fe8bdff92d19f7656f0baf87aaef8c12ee0fe62 \ - --hash=sha256:39bf05208ada7c99ff85cd879f2a9f64c8f8fe73d4ce11d037f2bbedab0c4020 \ - --hash=sha256:6a0ddb1f248912d1b5bbbef191f60d9e9b00700085004de068fa1986e0755295 \ - --hash=sha256:6c643aa1826129af55688dc0a4a78a0525c991e17da26390e9f676067f92ddfe \ - --hash=sha256:6cf4f9031b8c6262d75aac1af3c8246a73697ebcf91fd33eb0c82f6cd2100716 \ - --hash=sha256:73f98552bb283baf385dba06a75d1de77f14d5870334c25ea5054e9d32fb6d1e \ - --hash=sha256:7c5bd39b08c8adbf7a92385cb3a3689976301249364003929f71d4559fbf95c5 \ - --hash=sha256:878cd5e18e0ad5885d1a74fd9a5f2e38eb320b6902ba63ad0a51aebd4bb4d68a \ - --hash=sha256:88319c122f190b02ddf99cd278c1a7942c361b0037f8d9cf83142b4019c09602 \ - --hash=sha256:8e0525c23b9a349a0ca63d6c2ef8e0fc6c526f2fffae8087ca5b43cef9969d6a \ - --hash=sha256:90e01f66a1251da02f2dea4ac42a591e22b1c0b67ba2a6964fd01ef09a014b82 \ - --hash=sha256:9be9d00b3f3118bacdffef8a9173a2ea3188552083d93129b1ab8c7907b3eea4 \ - --hash=sha256:da65ea1b598de23ef9453cf6dfa3c7cc0f1645c9c63058098b1a92ed0d0619fb \ - --hash=sha256:df25a33c00cd294cfee7b1112243a3b0d8d17982d1be301ba7c0b4c82eb8bc88 \ - --hash=sha256:dffcc7fe4292b2382c3e8c0c81b83f409ad8d7ddcfaee090dc2d9e3b4f4ca2c9 \ - --hash=sha256:f1aba62d17b2d2c91c410f384e05fdc94c1b36cb82ebb136842c82a37b7f981e \ - --hash=sha256:f233a4d374379e5ecd86e776f2061308f5c2655ff62c2bdb43d8d7b9969cbc88 \ - --hash=sha256:f35f8368dcd3adc33d1a695434fd994f78bb56a258136a6812b244e4ada24585 +oracledb==1.2.0 \ + --hash=sha256:1086bb446fdfaf3571d61ea0c3000afe2b2326aa27c9b75252a281e5d09c5aa9 \ + --hash=sha256:171b932eba53782500123047b23984c01c5d7d997d567108931e96538cbafd26 \ + --hash=sha256:1d5aff76c2bb2e6ca0ce7377381bb1d5869977deeaea6f8e675762d7ffffb0ad \ + --hash=sha256:2e0636c5b26d30b047f5acd60de20f6226936f9a4d30dec6f3b35edee08b6bbd \ + --hash=sha256:393c12c7f7adbd05e7650ca871e20485680305add0f76ae87247af9055d97153 \ + --hash=sha256:3b9adac2f87113c573582d4b48c1b28adb0e67115aa9f8db721a9c0a172048ee \ + --hash=sha256:43c856aacadb786d234e7508f28fcaf1b8888da052c6b9f1284702ca6509d7d5 \ + --hash=sha256:45a6ab3a7fdc2142fce95930d90bdef7dde1e344ab897b4381b5e381d11ba5e3 \ + --hash=sha256:4dad11f14d2cfa6276ea52f033bdd6ac98cc809c731acee2d23ecbefac76a7b8 \ + --hash=sha256:551ac2acde38a72380f5a3e93128262ece4e27aa5acb13d058e5aa10362031a5 \ + --hash=sha256:59bb3f3f66f4affe347ef138f85548c5cb919309e74a73d09a8f03f35af436b7 \ + --hash=sha256:6f7b7608c674b09527edb3a8fb6d4a688ecdbba6ad51d32930ddbfea7a9b389e \ + --hash=sha256:74f5c2f13dbebcaeac810ae72bfa19c115d7749959833ebaaae4b497695a625f \ + --hash=sha256:7b2fb0aacebde75d667e21cbb53e65ebc5d4110bd6b263c4d8a3798d2e0c889f \ + --hash=sha256:8043124a55b3946bffd9ebb83953141f62f9d14fb30fa4b9cfcb09bdd7e2fae5 \ + --hash=sha256:86fa01c9aa20edb533ec1dfde33fa097631e8fcc044a74ffba5e892313774d5a \ + --hash=sha256:8d12a9cd1d64dffcc442c405d84d23af79cde5d855831b2ae43cc8e1b39b9163 \ + --hash=sha256:989524ea2e54269b9119340d3ad690f0aacafa50f028d9ea9dad96b0b8ac8b4a \ + --hash=sha256:a48772323ce560fd85d5474bd9c9c858f79621eba85b766cb5e16f5a9d4a48dc \ + --hash=sha256:a69ad4a65872e323a64fd7348eafcc9a1ae7725ddb3918ceb78037f98d6becde \ + --hash=sha256:c03ffd713a2ca5551ae44d103e72b3ecf440a5041b99b2bf8462d5e54a8c01c5 \ + --hash=sha256:c4fcb54bc7910193760ea5a210310a88d22e06647f973a3951516c6533b8faa6 \ + --hash=sha256:d8b04167bb490895f924e43387b69dcf12aabef651becc245c38de40822e2c93 \ + --hash=sha256:dbe550e2fbd8ebdd5dcc1426ae5137f0ab3da435109e2a4947372eb8d73190b2 \ + --hash=sha256:dfee7490715a29db9fa11758c3732516dfec731511cea1cfe606c411250c6681 \ + --hash=sha256:e50fa0ef531df0b57cdf5b31bee6bc86fdcc27f5b5635e6ab057a46605db72e0 \ + --hash=sha256:ed037b902ed0b90067a71d2a38abb967692a9d82b100386159e1d693f8228b52 \ + --hash=sha256:f3c9a78b623696448834dc0ab49a18f985acb3cebb6fb96f4cdfbee17f9d2aa9 # via -r requirements.in psycopg2-binary==2.9.5 \ --hash=sha256:00475004e5ed3e3bf5e056d66e5dcdf41a0dc62efcd57997acd9135c40a08a50 \ @@ -266,46 +271,46 @@ pymysql==1.0.2 \ --hash=sha256:41fc3a0c5013d5f039639442321185532e3e2c8924687abe6537de157d403641 \ --hash=sha256:816927a350f38d56072aeca5dfb10221fe1dc653745853d30a216637f5d7ad36 # via -r requirements.in -sqlalchemy==1.4.43 \ - --hash=sha256:0c8a174f23bc021aac97bcb27fbe2ae3d4652d3d23e5768bc2ec3d44e386c7eb \ - --hash=sha256:13ce4f3a068ec4ef7598d2a77f42adc3d90c76981f5a7c198756b25c4f4a22ea \ - --hash=sha256:1d16aca30fad4753aeb4ebde564bbd4a248b9673e4f879b940f4e806a17be87f \ - --hash=sha256:23a4569d3db1ce44370d05c5ad79be4f37915fcc97387aef9da232b95db7b695 \ - --hash=sha256:27479b5a1e110e64c56b18ffbf8cf99e101572a3d1a43943ea02158f1304108e \ - --hash=sha256:2fef01240d32ada9007387afd8e0b2230f99efdc4b57ca6f1d1192fca4fcf6a5 \ - --hash=sha256:35dc0a5e934c41e282e019c889069b01ff4cd356b2ea452c9985e1542734cfb1 \ - --hash=sha256:41df873cdae1d56fde97a1b4f6ffa118f40e4b2d6a6aa8c25c50eea31ecbeb08 \ - --hash=sha256:42bff29eaecbb284f614f4bb265bb0c268625f5b93ce6268f8017811e0afbdde \ - --hash=sha256:491d94879f9ec0dea7e1cb053cd9cc65a28d2467960cf99f7b3c286590406060 \ - --hash=sha256:4a791e7a1e5ac33f70a3598f8f34fdd3b60c68593bbb038baf58bc50e02d7468 \ - --hash=sha256:4abda3e693d24169221ffc7aa0444ccef3dc43dfeab6ad8665d3836751cd6af7 \ - --hash=sha256:529e2cc8af75811114e5ab2eb116fd71b6e252c6bdb32adbfcd5e0c5f6d5ab06 \ - --hash=sha256:59bd0ae166253f7fed8c3f4f6265d2637f25d2f6614d00df34d7ee0d95d29c91 \ - --hash=sha256:5d5937e1bf7921e4d1acdfad72dd98d9e7f9ea5c52aeb12b3b05b534b527692d \ - --hash=sha256:6b462c070769f0ef06ea5fe65206b970bcf2b59cb3fda2bec2f4729e1be89c13 \ - --hash=sha256:736d4e706adb3c95a0a7e660073a5213dfae78ff2df6addf8ff2918c83fbeebe \ - --hash=sha256:7d6293010aa0af8bd3b0c9993259f8979db2422d6abf85a31d70ec69cb2ee4dc \ - --hash=sha256:962c7c80c54a42836c47cb0d8a53016986c8584e8d98e90e2ea723a4ed0ba85b \ - --hash=sha256:a22f46440e61d90100e0f378faac40335fb5bbf278472df0d83dc15b653b9896 \ - --hash=sha256:a7fa3e57a7b0476fbcba72b231150503d53dbcbdd23f4a86be5152912a923b6e \ - --hash=sha256:aa12e27cb465b4b006ffb777624fc6023363e01cfed2d3f89d33fb6da80f6de2 \ - --hash=sha256:b6fd58e25e6cdd2a131d7e97f9713f8f2142360cd40c75af8aa5b83d535f811c \ - --hash=sha256:bd80300d81d92661e2488a4bf4383f0c5dc6e7b05fa46d2823e231af4e30539a \ - --hash=sha256:c1ced2fae7a1177a36cf94d0a5567452d195d3b4d7d932dd61f123fb15ddf87b \ - --hash=sha256:c1f5bfffc3227d05d90c557b10604962f655b4a83c9f3ad507a81ac8d6847679 \ - --hash=sha256:c3dde668edea70dc8d55a74d933d5446e5a97786cdd1c67c8e4971c73bd087ad \ - --hash=sha256:c628697aad7a141da8fc3fd81b4874a711cc84af172e1b1e7bbfadf760446496 \ - --hash=sha256:c6de20de7c19b965c007c9da240268dde1451865099ca10f0f593c347041b845 \ - --hash=sha256:c9a6e878e63286392b262d86d21fe16e6eec12b95ccb0a92c392f2b1e0acca03 \ - --hash=sha256:c9b59863e2b1f1e1ebf9ee517f86cdfa82d7049c8d81ad71ab58d442b137bbe9 \ - --hash=sha256:cde363fb5412ab178f1cc1e596e9cfc396464da8a4fe8e733cc6d6b4e2c23aa9 \ - --hash=sha256:d05d7365c2d1df03a69d90157a3e9b3e7b62088cca8ee6686aed2598659a6e14 \ - --hash=sha256:dc1e005d490c101d27657481a05765851ab795cc8aedeb8d9425595088b20736 \ - --hash=sha256:ed1c950aba723b7a5b702b88f05d883607c587de918d7d8c2014fe7f55cf67e0 \ - --hash=sha256:ee9613b0460dce970414cfc990ca40afe518bc139e697243fcdf890285fb30ac \ - --hash=sha256:eeb55a555eef1a9607c1635bbdddd0b8a2bb9713bcb5bc8da1e8fae8ee46d1d8 \ - --hash=sha256:f5438f6c768b7e928f0463777b545965648ba0d55877afd14a4e96d2a99702e7 \ - --hash=sha256:f6e036714a586f757a3e12ff0798ce9a90aa04a60cff392d8bcacc5ecf79c95e \ - --hash=sha256:fa46d86a17cccd48c6762df1a60aecf5aaa2e0c0973efacf146c637694b62ffd \ - --hash=sha256:fb9a44e7124f72b79023ab04e1c8fcd8f392939ef0d7a75beae8634e15605d30 +sqlalchemy==1.4.44 \ + --hash=sha256:0be9b479c5806cece01f1581726573a8d6515f8404e082c375b922c45cfc2a7b \ + --hash=sha256:17aee7bfcef7bf0dea92f10e5dfdd67418dcf6fe0759f520e168b605855c003e \ + --hash=sha256:21f3df74a0ab39e1255e94613556e33c1dc3b454059fe0b365ec3bbb9ed82e4a \ + --hash=sha256:237067ba0ef45a518b64606e1807f7229969ad568288b110ed5f0ca714a3ed3a \ + --hash=sha256:2dda5f96719ae89b3ec0f1b79698d86eb9aecb1d54e990abb3fdd92c04b46a90 \ + --hash=sha256:393f51a09778e8984d735b59a810731394308b4038acdb1635397c2865dae2b6 \ + --hash=sha256:3ca21b35b714ce36f4b8d1ee8d15f149db8eb43a472cf71600bf18dae32286e7 \ + --hash=sha256:3cbdbed8cdcae0f83640a9c44fa02b45a6c61e149c58d45a63c9581aba62850f \ + --hash=sha256:3eba07f740488c3a125f17c092a81eeae24a6c7ec32ac9dbc52bf7afaf0c4f16 \ + --hash=sha256:3f68eab46649504eb95be36ca529aea16cd199f080726c28cbdbcbf23d20b2a2 \ + --hash=sha256:4c56e6899fa6e767e4be5d106941804a4201c5cb9620a409c0b80448ec70b656 \ + --hash=sha256:53f90a2374f60e703c94118d21533765412da8225ba98659de7dd7998641ab17 \ + --hash=sha256:595b185041a4dc5c685283ea98c2f67bbfa47bb28e4a4f5b27ebf40684e7a9f8 \ + --hash=sha256:65a0ad931944fcb0be12a8e0ac322dbd3ecf17c53f088bc10b6da8f0caac287b \ + --hash=sha256:68e0cd5d32a32c4395168d42f2fefbb03b817ead3a8f3704b8bd5697c0b26c24 \ + --hash=sha256:6a06c2506c41926d2769f7968759995f2505e31c5b5a0821e43ca5a3ddb0e8ae \ + --hash=sha256:6d7e1b28342b45f19e3dea7873a9479e4a57e15095a575afca902e517fb89652 \ + --hash=sha256:6f0ea4d7348feb5e5d0bf317aace92e28398fa9a6e38b7be9ec1f31aad4a8039 \ + --hash=sha256:7313e4acebb9ae88dbde14a8a177467a7625b7449306c03a3f9f309b30e163d0 \ + --hash=sha256:7cf7c7adbf4417e3f46fc5a2dbf8395a5a69698217337086888f79700a12e93a \ + --hash=sha256:80ead36fb1d676cc019586ffdc21c7e906ce4bf243fe4021e4973dae332b6038 \ + --hash=sha256:9470633395e5f24d6741b4c8a6e905bce405a28cf417bba4ccbaadf3dab0111d \ + --hash=sha256:94c0093678001f5d79f2dcbf3104c54d6c89e41ab50d619494c503a4d3f1aef2 \ + --hash=sha256:95f4f8d62589755b507218f2e3189475a4c1f5cc9db2aec772071a7dc6cd5726 \ + --hash=sha256:9c857676d810ca196be73c98eb839125d6fa849bfa3589be06201a6517f9961c \ + --hash=sha256:a22208c1982f1fe2ae82e5e4c3d4a6f2445a7a0d65fb7983a3d7cbbe3983f5a4 \ + --hash=sha256:ad5f966623905ee33694680dda1b735544c99c7638f216045d21546d3d8c6f5b \ + --hash=sha256:ae1ed1ebc407d2f66c6f0ec44ef7d56e3f455859df5494680e2cf89dad8e3ae0 \ + --hash=sha256:afd1ac99179d1864a68c06b31263a08ea25a49df94e272712eb2824ef151e294 \ + --hash=sha256:b6a337a2643a41476fb6262059b8740f4b9a2ec29bf00ffb18c18c080f6e0aed \ + --hash=sha256:b737fbeb2f78926d1f59964feb287bbbd050e7904766f87c8ce5cfb86e6d840c \ + --hash=sha256:c46322354c58d4dc039a2c982d28284330f8919f31206894281f4b595b9d8dbe \ + --hash=sha256:c7e3b9e01fdbe1ce3a165cc7e1ff52b24813ee79c6df6dee0d1e13888a97817e \ + --hash=sha256:c9aa372b295a36771cffc226b6517df3011a7d146ac22d19fa6a75f1cdf9d7e6 \ + --hash=sha256:d3b6d4588994da73567bb00af9d7224a16c8027865a8aab53ae9be83f9b7cbd1 \ + --hash=sha256:d3b9ac11f36ab9a726097fba7c7f6384f0129aedb017f1d4d1d4fce9052a1320 \ + --hash=sha256:d654870a66027af3a26df1372cf7f002e161c6768ebe4c9c6fdc0da331cb5173 \ + --hash=sha256:d8080bc51a775627865e0f1dbfc0040ff4ace685f187f6036837e1727ba2ed10 \ + --hash=sha256:da60b98b0f6f0df9fbf8b72d67d13b73aa8091923a48af79a951d4088530a239 \ + --hash=sha256:f5e8ed9cde48b76318ab989deeddc48f833d2a6a7b7c393c49b704f67dedf01d \ + --hash=sha256:f8e5443295b218b08bef8eb85d31b214d184b3690d99a33b7bd8e5591e2b0aa1 # via -r requirements.in diff --git a/src/common/gen/requirements.txt b/src/common/gen/requirements.txt index cba2de775..bc2845cbf 100644 --- a/src/common/gen/requirements.txt +++ b/src/common/gen/requirements.txt @@ -190,7 +190,7 @@ websocket-client==1.4.2 \ # kubernetes # The following packages are considered to be unsafe in a requirements file: -setuptools==65.5.1 \ - --hash=sha256:d0b9a8433464d5800cbe05094acf5c6d52a91bfac9b52bcfc4d41382be5d5d31 \ - --hash=sha256:e197a19aa8ec9722928f2206f8de752def0e4c9fc6953527360d1c36d94ddb2f +setuptools==65.6.0 \ + --hash=sha256:6211d2f5eddad8757bd0484923ca7c0a6302ebc4ab32ea5e94357176e0ca0840 \ + --hash=sha256:d1eebf881c6114e51df1664bc2c9133d022f78d12d5f4f665b9191f084e2862d # via kubernetes diff --git a/src/deps/clone.sh b/src/deps/clone.sh index dee041b83..606905689 100755 --- a/src/deps/clone.sh +++ b/src/deps/clone.sh @@ -128,103 +128,103 @@ function do_and_check_cmd() { return 0 } -# nginx 1.20.2 -echo "ℹ️ Download nginx" -NGINX_VERSION="1.20.2" -secure_download "https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" "nginx-${NGINX_VERSION}.tar.gz" "8b65e881ea4ac6162cbf32e5e95cf47a6d5418819f8763ca4a781cffa38187dd7886d4bc195d000a7046111a27121ff25800f8645405174995247e6738b4279a" +# nginx 1.22.1 +echo "ℹ️ Downloading nginx" +NGINX_VERSION="1.22.1" +secure_download "https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" "nginx-${NGINX_VERSION}.tar.gz" "1d468dcfa9bbd348b8a5dc514ac1428a789e73a92384c039b73a51ce376785f74bf942872c5594a9fcda6bbf44758bd727ce15ac2395f1aa989c507014647dcc" if [ -f "deps/src/nginx-${NGINX_VERSION}.tar.gz" ] ; then do_and_check_cmd tar -xvzf deps/src/nginx-${NGINX_VERSION}.tar.gz -C deps/src do_and_check_cmd rm -f deps/src/nginx-${NGINX_VERSION}.tar.gz fi # Lua 5.1.5 -echo "ℹ️ Download Lua" +echo "ℹ️ Downloading Lua" LUA_VERSION="5.1.5" secure_download "https://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gz" "lua-${LUA_VERSION}.tar.gz" "0142fefcbd13afcd9b201403592aa60620011cc8e8559d4d2db2f92739d18186860989f48caa45830ff4f99bfc7483287fd3ff3a16d4dec928e2767ce4d542a9" if [ -f "deps/src/lua-${LUA_VERSION}.tar.gz" ] ; then do_and_check_cmd tar -xvzf deps/src/lua-${LUA_VERSION}.tar.gz -C deps/src do_and_check_cmd rm -f deps/src/lua-${LUA_VERSION}.tar.gz - do_and_check_cmd patch deps/src/lua-5.1.5/Makefile deps/misc/lua.patch1 - do_and_check_cmd patch deps/src/lua-5.1.5/src/Makefile deps/misc/lua.patch2 + do_and_check_cmd patch deps/src/lua-${LUA_VERSION}/Makefile deps/misc/lua.patch1 + do_and_check_cmd patch deps/src/lua-${LUA_VERSION}/src/Makefile deps/misc/lua.patch2 fi -# LuaJIT 2.1-20220111 -echo "ℹ️ Download LuaJIT" -git_secure_clone "https://github.com/openresty/luajit2.git" "f1491357fa1dbfa3480ba67513fee19a9c65ca6f" +# LuaJIT v2.1-20220915 +echo "ℹ️ Downloading LuaJIT" +git_secure_clone "https://github.com/openresty/luajit2.git" "8384278b14988390cf030b787537aa916a9709bb" -# lua-nginx-module v0.10.20 -echo "ℹ️ Download lua-nginx-module" -git_secure_clone "https://github.com/openresty/lua-nginx-module.git" "9007d673e28938f5dfa7720438991e22b794d225" +# lua-nginx-module v0.10.22 +echo "ℹ️ Downloading lua-nginx-module" +git_secure_clone "https://github.com/openresty/lua-nginx-module.git" "8d9032298ef542aef058fa02940a6ecd9cf25423" -# lua-resty-core v0.1.22 -echo "ℹ️ Download lua-resty-core" -git_secure_clone "https://github.com/openresty/lua-resty-core.git" "12f26310a35e45c37157420f7e1f395a0e36e457" +# lua-resty-core v0.1.24 +echo "ℹ️ Downloading lua-resty-core" +git_secure_clone "https://github.com/openresty/lua-resty-core.git" "c48e90a8fc9d974d8a6a369e031940cedf473789" -# lua-resty-lrucache v0.11 -echo "ℹ️ Download lua-resty-lrucache" -git_secure_clone "https://github.com/openresty/lua-resty-lrucache.git" "f20bb8ac9489ba87d90d78f929552c2eab153caa" +# lua-resty-lrucache v0.13 +echo "ℹ️ Downloading lua-resty-lrucache" +git_secure_clone "https://github.com/openresty/lua-resty-lrucache.git" "2ab2624c841cbf04785cc6384c5e213933d3b5f2" # lua-resty-dns v0.22 -echo "ℹ️ Download lua-resty-dns" +echo "ℹ️ Downloading lua-resty-dns" git_secure_clone "https://github.com/openresty/lua-resty-dns.git" "869d2fbb009b6ada93a5a10cb93acd1cc12bd53f" # lua-resty-session v3.10 -echo "ℹ️ Download lua-resty-session" +echo "ℹ️ Downloading lua-resty-session" git_secure_clone "https://github.com/bungle/lua-resty-session.git" "e6bf2630c90df7b3db35e859f0aa7e096af3e918" # lua-resty-random v? -echo "ℹ️ Download lua-resty-random" +echo "ℹ️ Downloading lua-resty-random" git_secure_clone "https://github.com/bungle/lua-resty-random.git" "17b604f7f7dd217557ca548fc1a9a0d373386480" # lua-resty-string v0.15 -echo "ℹ️ Download lua-resty-string" +echo "ℹ️ Downloading lua-resty-string" git_secure_clone "https://github.com/openresty/lua-resty-string.git" "b192878f6ed31b0af237935bbc5a8110a3c2256c" -# lua-cjson v2.1.0.8 -echo "ℹ️ Download lua-cjson" -git_secure_clone "https://github.com/openresty/lua-cjson.git" "0df488874f52a881d14b5876babaa780bb6200ee" +# lua-cjson v2.1.0.9 +echo "ℹ️ Downloading lua-cjson" +git_secure_clone "https://github.com/openresty/lua-cjson.git" "891962b11d6d3b1b7275550b5c109e16c73ac94f" -# lua-gd v? -echo "ℹ️ Download lua-gd" +# lua-gd v2.0.33r3+ +echo "ℹ️ Downloading lua-gd" git_secure_clone "https://github.com/ittner/lua-gd.git" "2ce8e478a8591afd71e607506bc8c64b161bbd30" -# lua-resty-http v1.16.1 -echo "ℹ️ Download lua-resty-http" +# lua-resty-http v0.16.1 +echo "ℹ️ Downloading lua-resty-http" git_secure_clone "https://github.com/ledgetech/lua-resty-http.git" "9bf951dfe162dd9710a0e1f4525738d4902e9d20" -# lualogging v1.6.0 -echo "ℹ️ Download lualogging" -git_secure_clone "https://github.com/lunarmodules/lualogging.git" "0bc4415de03ff1a99c92c02a5bed14a45b078079" +# lualogging v1.8.0 +echo "ℹ️ Downloading lualogging" +git_secure_clone "https://github.com/lunarmodules/lualogging.git" "1c6fcf5f68e4d0324c5977f1a27083c06f4d1b8f" -# luasocket v? -echo "ℹ️ Download luasocket" -git_secure_clone "https://github.com/diegonehab/luasocket.git" "5b18e475f38fcf28429b1cc4b17baee3b9793a62" +# luasocket v3.1.0 +echo "ℹ️ Downloading luasocket" +git_secure_clone "https://github.com/diegonehab/luasocket.git" "95b7efa9da506ef968c1347edf3fc56370f0deed" -# luasec v1.0.2 -echo "ℹ️ Download luasec" -git_secure_clone "https://github.com/brunoos/luasec.git" "ef14b27a2c8e541cac071165048250e85a7216df" +# luasec v1.2.0 +echo "ℹ️ Downloading luasec" +git_secure_clone "https://github.com/brunoos/luasec.git" "d9215ee00f6694a228daad50ee85827a4cd13583" -# lua-resty-ipmatcher v0.6.1 (1 commit after just in case) -echo "ℹ️ Download lua-resty-ipmatcher" +# lua-resty-ipmatcher v0.6.1 (3 commits after just in case) +echo "ℹ️ Downloading lua-resty-ipmatcher" dopatch="no" if [ ! -d "deps/src/lua-resty-ipmatcher" ] ; then dopatch="yes" fi -git_secure_clone "https://github.com/api7/lua-resty-ipmatcher.git" "3948a92d2e168db14fa5ecd4bb10a7c0fe7ead70" +git_secure_clone "https://github.com/api7/lua-resty-ipmatcher.git" "7fbb618f7221b1af1451027d3c64e51f3182761c" if [ "$dopatch" = "yes" ] ; then do_and_check_cmd patch deps/src/lua-resty-ipmatcher/resty/ipmatcher.lua deps/misc/ipmatcher.patch fi # lua-resty-redis v0.29 -echo "ℹ️ Download lua-resty-redis" +echo "ℹ️ Downloading lua-resty-redis" git_secure_clone "https://github.com/openresty/lua-resty-redis.git" "053f989c7f43d8edc79d5151e73b79249c6b5d94" -# lua-resty-upload v0.10 -echo "ℹ️ Download lua-resty-upload" -git_secure_clone "https://github.com/openresty/lua-resty-upload.git" "cae01f590456561bc8d95da3d2d9f937bef57bec" +# lua-resty-upload v0.10 (8 commits after just in case) +echo "ℹ️ Downloading lua-resty-upload" +git_secure_clone "https://github.com/openresty/lua-resty-upload.git" "73c89846e866bf5d0660ffa881df37fd63f04391" # luajit-geoip v2.1.0 -echo "ℹ️ Download luajit-geoip" +echo "ℹ️ Downloading luajit-geoip" dopatch="no" if [ ! -d "deps/src/luajit-geoip" ] ; then dopatch="yes" @@ -235,59 +235,60 @@ if [ "$dopatch" = "yes" ] ; then fi # lbase64 v1.5.3 -echo "ℹ️ Download lbase64" +echo "ℹ️ Downloading lbase64" git_secure_clone "https://github.com/iskolbin/lbase64.git" "c261320edbdf82c16409d893a96c28c704aa0ab8" -# ModSecurity v3.0.4 (looks like v3.0.5 has a memleak on reload) -# TODO : test v3.0.6 -echo "ℹ️ Download ModSecurity" +# ModSecurity v3.0.8 (19 commits after just in case) +echo "ℹ️ Downloading ModSecurity" if [ ! -d "deps/src/ModSecurity" ] ; then dopatch="yes" fi -git_secure_clone "https://github.com/SpiderLabs/ModSecurity.git" "753145fbd1d6751a6b14fdd700921eb3cc3a1d35" +git_secure_clone "https://github.com/SpiderLabs/ModSecurity.git" "40f7a5067c695b1770920b881f30abc09a4e02b3" if [ "$dopatch" = "yes" ] ; then do_and_check_cmd patch deps/src/ModSecurity/configure.ac deps/misc/modsecurity.patch fi -# libinjection v? -echo "ℹ️ Download libinjection" + +# libinjection v3.10.0+ +# TODO: check if the latest commit is fine +echo "ℹ️ Downloading libinjection" git_secure_clone "https://github.com/libinjection/libinjection.git" "49904c42a6e68dc8f16c022c693e897e4010a06c" do_and_check_cmd cp -r deps/src/libinjection deps/src/ModSecurity/others -# ModSecurity-nginx v1.0.2 -echo "ℹ️ Download ModSecurity-nginx" +# ModSecurity-nginx v1.0.3 +echo "ℹ️ Downloading ModSecurity-nginx" dopatch="no" if [ ! -d "deps/src/ModSecurity-nginx" ] ; then dopatch="yes" fi -git_secure_clone "https://github.com/SpiderLabs/ModSecurity-nginx.git" "2497e6ac654d0b117b9534aa735b757c6b11c84f" +git_secure_clone "https://github.com/SpiderLabs/ModSecurity-nginx.git" "d59e4ad121df702751940fd66bcc0b3ecb51a079" if [ "$dopatch" = "yes" ] ; then do_and_check_cmd patch deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_log.c deps/misc/modsecurity-nginx.patch fi -# libmaxminddb v1.6.0 -echo "ℹ️ Download libmaxminddb" -git_secure_clone "https://github.com/maxmind/libmaxminddb.git" "2d0e6b7360b88f645e67ffc5a709b2327d361ac3" +# libmaxminddb v1.7.1 +echo "ℹ️ Downloading libmaxminddb" +git_secure_clone "https://github.com/maxmind/libmaxminddb.git" "ac4d0d2480032a8664e251588e57d7b306ca630c" -# headers-more-nginx-module v? -echo "ℹ️ Download headers-more-nginx-module" -git_secure_clone "https://github.com/openresty/headers-more-nginx-module.git" "a4a0686605161a6777d7d612d5aef79b9e7c13e0" +# headers-more-nginx-module v0.34 +echo "ℹ️ Downloading headers-more-nginx-module" +git_secure_clone "https://github.com/openresty/headers-more-nginx-module.git" "bea1be3bbf6af28f6aa8cf0c01c07ee1637e2bd0" # ngx_http_geoip2_module v3.3 -#echo "ℹ️ Download ngx_http_geoip2_module" +#echo "ℹ️ Downloading ngx_http_geoip2_module" #dosed="no" #if [ ! -d "deps/src/ngx_http_geoip2_module" ] ; then # dosed="yes" #fi #git_secure_clone "https://github.com/leev/ngx_http_geoip2_module.git" "5a83b6f958c67ea88d2899d0b3c2a5db8e36b211" #if [ "$dosed" = "yes" ] ; then -# do_and_check_cmd sed -i '1s:^:ngx_feature_path=/usr/share/bunkerweb/deps/include\n:' deps/src/ngx_http_geoip2_module/config -# do_and_check_cmd sed -i 's:^ngx_feature_libs=.*$:ngx_feature_libs="-Wl,-rpath,/usr/share/bunkerweb/deps/lib -L/usr/share/bunkerweb/deps/lib -lmaxminddb":' deps/src/ngx_http_geoip2_module/config +# do_and_check_cmd sed -i '1s:^:ngx_feature_path=/opt/bunkerweb/deps/include\n:' deps/src/ngx_http_geoip2_module/config +# do_and_check_cmd sed -i 's:^ngx_feature_libs=.*$:ngx_feature_libs="-Wl,-rpath,/opt/bunkerweb/deps/lib -L/opt/bunkerweb/deps/lib -lmaxminddb":' deps/src/ngx_http_geoip2_module/config #fi # nginx_cookie_flag_module v1.1.0 -echo "ℹ️ Download nginx_cookie_flag_module" +echo "ℹ️ Downloading nginx_cookie_flag_module" git_secure_clone "https://github.com/AirisX/nginx_cookie_flag_module.git" "4e48acf132952bbed43b28a8e6af0584dacb7b4c" -# ngx_brotli v? -echo "ℹ️ Download ngx_brotli" -git_secure_clone "https://github.com/google/ngx_brotli.git" "9aec15e2aa6feea2113119ba06460af70ab3ea62" +# ngx_brotli v1.0.0 +echo "ℹ️ Downloading ngx_brotli" +git_secure_clone "https://github.com/google/ngx_brotli.git" "6e975bcb015f62e1f303054897783355e2a877dc" diff --git a/src/deps/install.sh b/src/deps/install.sh index e61c2c767..156dcb17a 100755 --- a/src/deps/install.sh +++ b/src/deps/install.sh @@ -17,13 +17,13 @@ function do_and_check_cmd() { NTASK=$(nproc) -# Compile and install lua -echo "ℹ️ Compile and install lua-5.1.5" +# Compiling and installing lua +echo "ℹ️ Compiling and installing lua-5.1.5" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-5.1.5" do_and_check_cmd make -j $NTASK linux CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-5.1.5" do_and_check_cmd make INSTALL_TOP=/usr/share/bunkerweb/deps install -# Compile and install libmaxminddb -echo "ℹ️ Compile and install libmaxminddb" +# Compiling and installing libmaxminddb +echo "ℹ️ Compiling and installing libmaxminddb" # TODO : temp fix run it twice... cd /tmp/bunkerweb/deps/src/libmaxminddb && ./bootstrap > /dev/null 2>&1 CHANGE_DIR="/tmp/bunkerweb/deps/src/libmaxminddb" do_and_check_cmd ./bootstrap @@ -31,8 +31,8 @@ CHANGE_DIR="/tmp/bunkerweb/deps/src/libmaxminddb" do_and_check_cmd ./configure - CHANGE_DIR="/tmp/bunkerweb/deps/src/libmaxminddb" do_and_check_cmd make -j $NTASK CHANGE_DIR="/tmp/bunkerweb/deps/src/libmaxminddb" do_and_check_cmd make install -# Compile and install ModSecurity -echo "ℹ️ Compile and install ModSecurity" +# Compiling and installing ModSecurity +echo "ℹ️ Compiling and installing ModSecurity" # temp fix : Debian run it twice # TODO : patch it in clone.sh cd /tmp/bunkerweb/deps/src/ModSecurity && ./build.sh > /dev/null 2>&1 @@ -41,90 +41,91 @@ CHANGE_DIR="/tmp/bunkerweb/deps/src/ModSecurity" do_and_check_cmd ./configure -- CHANGE_DIR="/tmp/bunkerweb/deps/src/ModSecurity" do_and_check_cmd make -j $NTASK CHANGE_DIR="/tmp/bunkerweb/deps/src/ModSecurity" do_and_check_cmd make install-strip -# Compile and install luajit2 -echo "ℹ️ Compile and install luajit2" +# Compiling and installing luajit2 +echo "ℹ️ Compiling and installing luajit2" CHANGE_DIR="/tmp/bunkerweb/deps/src/luajit2" do_and_check_cmd make -j $NTASK CHANGE_DIR="/tmp/bunkerweb/deps/src/luajit2" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps install -# Install lua-resty-core -echo "ℹ️ Install openresty/lua-resty-core" +# Installing lua-resty-core +echo "ℹ️ Installing openresty/lua-resty-core" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-resty-core" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps install -# Install lua-resty-lrucache -echo "ℹ️ Install lua-resty-lrucache" +# Installing lua-resty-lrucache +echo "ℹ️ Installing lua-resty-lrucache" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-resty-lrucache" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps install -# Install lua-resty-dns -echo "ℹ️ Install lua-resty-dns" +# Installing lua-resty-dns +echo "ℹ️ Installing lua-resty-dns" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-resty-dns" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps install -# Install lua-resty-session -echo "ℹ️ Install lua-resty-session" +# Installing lua-resty-session +echo "ℹ️ Installing lua-resty-session" do_and_check_cmd cp -r /tmp/bunkerweb/deps/src/lua-resty-session/lib/resty/* /usr/share/bunkerweb/deps/lib/lua/resty -# Install lua-resty-random -echo "ℹ️ Install lua-resty-random" +# Installing lua-resty-random +echo "ℹ️ Installing lua-resty-random" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-resty-random" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps install -# Install lua-resty-string -echo "ℹ️ Install lua-resty-string" +# Installing lua-resty-string +echo "ℹ️ Installing lua-resty-string" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-resty-string" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps install -# Compile and install lua-cjson -echo "ℹ️ Compile and install lua-cjson" +# Compiling and installing lua-cjson +echo "ℹ️ Compiling and installing lua-cjson" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-cjson" do_and_check_cmd make LUA_INCLUDE_DIR=/usr/share/bunkerweb/deps/include -j $NTASK CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-cjson" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps LUA_CMODULE_DIR=/usr/share/bunkerweb/deps/lib/lua LUA_MODULE_DIR=/usr/share/bunkerweb/deps/lib/lua install CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-cjson" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps LUA_CMODULE_DIR=/usr/share/bunkerweb/deps/lib/lua LUA_MODULE_DIR=/usr/share/bunkerweb/deps/lib/lua install-extra -# Compile and install lua-gd -echo "ℹ️ Compile and install lua-gd" +# Compiling and installing lua-gd +echo "ℹ️ Compiling and installing lua-gd" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-gd" do_and_check_cmd make "CFLAGS=-O3 -Wall -fPIC -fomit-frame-pointer -I/usr/share/bunkerweb/deps/include -DVERSION=\\\"2.0.33r3\\\"" "LFLAGS=-shared -L/usr/share/bunkerweb/deps/lib -llua -lgd -Wl,-rpath=/usr/share/bunkerweb/deps/lib" LUABIN=/usr/share/bunkerweb/deps/bin/lua -j $NTASK CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-gd" do_and_check_cmd make INSTALL_PATH=/usr/share/bunkerweb/deps/lib/lua install # Download and install lua-resty-http -echo "ℹ️ Install lua-resty-http" +echo "ℹ️ Installing lua-resty-http" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-resty-http" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps install # Download and install lualogging -echo "ℹ️ Install lualogging" +echo "ℹ️ Installing lualogging" do_and_check_cmd cp -r /tmp/bunkerweb/deps/src/lualogging/src/* /usr/share/bunkerweb/deps/lib/lua -# Compile and install luasocket -echo "ℹ️ Compile and install luasocket" +# Compiling and installing luasocket +echo "ℹ️ Compiling and installing luasocket" CHANGE_DIR="/tmp/bunkerweb/deps/src/luasocket" do_and_check_cmd make LUAINC_linux=/usr/share/bunkerweb/deps/include -j $NTASK CHANGE_DIR="/tmp/bunkerweb/deps/src/luasocket" do_and_check_cmd make prefix=/usr/share/bunkerweb/deps CDIR_linux=lib/lua LDIR_linux=lib/lua install -# Compile and install luasec -echo "ℹ️ Compile and install luasec" +# Compiling and installing luasec +echo "ℹ️ Compiling and installing luasec" CHANGE_DIR="/tmp/bunkerweb/deps/src/luasec" do_and_check_cmd make INC_PATH=-I/usr/share/bunkerweb/deps/include linux -j $NTASK CHANGE_DIR="/tmp/bunkerweb/deps/src/luasec" do_and_check_cmd make LUACPATH=/usr/share/bunkerweb/deps/lib/lua LUAPATH=/usr/share/bunkerweb/deps/lib/lua install -# Install lua-resty-ipmatcher -echo "ℹ️ Install lua-resty-ipmatcher" +# Installing lua-resty-ipmatcher +echo "ℹ️ Installing lua-resty-ipmatcher" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-resty-ipmatcher" do_and_check_cmd make INST_PREFIX=/usr/share/bunkerweb/deps INST_LIBDIR=/usr/share/bunkerweb/deps/lib/lua INST_LUADIR=/usr/share/bunkerweb/deps/lib/lua install -# Install lua-resty-redis -echo "ℹ️ Install lua-resty-redis" +# Installing lua-resty-redis +echo "ℹ️ Installing lua-resty-redis" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-resty-redis" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps LUA_LIB_DIR=/usr/share/bunkerweb/deps/lib/lua install -# Install lua-resty-upload -echo "ℹ️ Install lua-resty-upload" +# Installing lua-resty-upload +echo "ℹ️ Installing lua-resty-upload" CHANGE_DIR="/tmp/bunkerweb/deps/src/lua-resty-upload" do_and_check_cmd make PREFIX=/usr/share/bunkerweb/deps LUA_LIB_DIR=/usr/share/bunkerweb/deps/lib/lua install -# Install lujit-geoip -echo "ℹ️ Install luajit-geoip" +# Installing lujit-geoip +echo "ℹ️ Installing luajit-geoip" do_and_check_cmd cp -r /tmp/bunkerweb/deps/src/luajit-geoip/geoip /usr/share/bunkerweb/deps/lib/lua -# Install lbase64 -echo "ℹ️ Install lbase64" +# Installing lbase64 +echo "ℹ️ Installing lbase64" do_and_check_cmd cp -r /tmp/bunkerweb/deps/src/lbase64/base64.lua /usr/share/bunkerweb/deps/lib/lua # Compile dynamic modules -echo "ℹ️ Compile and install dynamic modules" +echo "ℹ️ Compiling and installing dynamic modules" CONFARGS="$(nginx -V 2>&1 | sed -n -e 's/^.*arguments: //p')" CONFARGS="${CONFARGS/-Os -fomit-frame-pointer -g/-Os}" +CONFARGS="$(echo -n "$CONFARGS" | sed "s/--with-ld-opt=-Wl/--with-ld-opt='-lpcre -Wl'/")" if [ "$OS" = "fedora" ] ; then - CONFARGS="$(echo -n "$CONFARGS" | sed "s/--with-ld-opt='.*'//" | sed "s/--with-cc-opt='.*'//")" + CONFARGS="$(echo -n "$CONFARGS" | sed "s/--with-ld-opt='.*'/--with-ld-opt=-lpcre/" | sed "s/--with-cc-opt='.*'//")" fi echo '#!/bin/bash' > "/tmp/bunkerweb/deps/src/nginx-${NGINX_VERSION}/configure-fix.sh" echo "./configure $CONFARGS --add-dynamic-module=/tmp/bunkerweb/deps/src/ModSecurity-nginx --add-dynamic-module=/tmp/bunkerweb/deps/src/headers-more-nginx-module --add-dynamic-module=/tmp/bunkerweb/deps/src/nginx_cookie_flag_module --add-dynamic-module=/tmp/bunkerweb/deps/src/lua-nginx-module --add-dynamic-module=/tmp/bunkerweb/deps/src/ngx_brotli" >> "/tmp/bunkerweb/deps/src/nginx-${NGINX_VERSION}/configure-fix.sh" diff --git a/src/deps/misc/ipmatcher.patch b/src/deps/misc/ipmatcher.patch index 938104d09..e6e3ff51e 100644 --- a/src/deps/misc/ipmatcher.patch +++ b/src/deps/misc/ipmatcher.patch @@ -1,11 +1,5 @@ ---- ipmatcher.lua 2022-04-13 17:16:05.731322800 +0200 -+++ ipmatcher.lua2 2022-04-13 17:17:15.801322800 +0200 -@@ -123,7 +123,7 @@ - - +@@ -129,3 +129,3 @@ local ngx_log = ngx.log -local ngx_INFO = ngx.INFO +local ngx_INFO = ngx.DEBUG local function log_info(...) - if cur_level and ngx_INFO > cur_level then - return diff --git a/src/deps/misc/mmdb.patch b/src/deps/misc/mmdb.patch index 84dcc0757..f8c7980cc 100644 --- a/src/deps/misc/mmdb.patch +++ b/src/deps/misc/mmdb.patch @@ -1,11 +1,5 @@ ---- mmdb.lua 2022-04-04 09:32:41.456286600 +0200 -+++ mmdb2.lua 2022-04-04 09:33:25.016286600 +0200 -@@ -166,7 +166,7 @@ - MMDB_entry_data_s *const entry_data, - ...); +@@ -168,3 +168,3 @@ ]]) -local lib = ffi.load("libmaxminddb") +local lib = ffi.load("/usr/share/bunkerweb/deps/lib/libmaxminddb.so") local consume_map, consume_array - local consume_value - consume_value = function(current) diff --git a/src/deps/misc/modsecurity-nginx.patch b/src/deps/misc/modsecurity-nginx.patch index 96d031d8a..af8c2c242 100644 --- a/src/deps/misc/modsecurity-nginx.patch +++ b/src/deps/misc/modsecurity-nginx.patch @@ -1,11 +1,5 @@ ---- ngx_http_modsecurity_log.c 2022-04-25 14:30:34.444469100 +0200 -+++ ngx_http_modsecurity_log.c2 2022-04-25 14:31:25.714469100 +0200 -@@ -30,7 +30,7 @@ - } - msg = (const char *) data; +@@ -32,3 +32,3 @@ - ngx_log_error(NGX_LOG_INFO, (ngx_log_t *)log, 0, "%s", msg); + ngx_log_error(NGX_LOG_WARN, (ngx_log_t *)log, 0, "%s", msg); } - - diff --git a/src/deps/misc/modsecurity.patch b/src/deps/misc/modsecurity.patch index 19c490a03..052f89f89 100644 --- a/src/deps/misc/modsecurity.patch +++ b/src/deps/misc/modsecurity.patch @@ -1,8 +1,5 @@ ---- before/configure.ac 2022-05-19 17:06:36.921274500 +0200 -+++ after/configure.ac 2022-05-17 11:51:17.319667600 +0200 -@@ -308,14 +308,14 @@ - - +@@ -322,12 +322,12 @@ + # Decide if we want to build the tests or not. -buildTestUtilities=false -if test "x$YAJL_FOUND" = "x1"; then @@ -12,10 +9,9 @@ # But we still have the unit tests. # if test "$debugLogs" = "true"; then - buildTestUtilities=true -+# buildTestUtilities=true ++# buildTestUtilities=true # fi -fi +# fi - - - AM_CONDITIONAL([TEST_UTILITIES], [test $buildTestUtilities = true]) + + diff --git a/src/deps/src/ModSecurity-nginx/CHANGES b/src/deps/src/ModSecurity-nginx/CHANGES index 560c5895a..f4a6377f1 100644 --- a/src/deps/src/ModSecurity-nginx/CHANGES +++ b/src/deps/src/ModSecurity-nginx/CHANGES @@ -1,3 +1,11 @@ +v1.0.3 - 2022-May-24 +-------------------- + + - Support http protocol versions besides 0.9, 1.0, 1.1, 2.0 + [Issue #224 - @HQuest, @martinhsv] + - Support for building with nginx configured with PCRE2 + [Issue #260 - @defanator] + v1.0.2 - 2021-Jun-02 -------------------- diff --git a/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_common.h b/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_common.h index 60218c4b4..11fdc2d7e 100644 --- a/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_common.h +++ b/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_common.h @@ -56,7 +56,7 @@ #define MODSECURITY_NGINX_MAJOR "1" #define MODSECURITY_NGINX_MINOR "0" -#define MODSECURITY_NGINX_PATCHLEVEL "2" +#define MODSECURITY_NGINX_PATCHLEVEL "3" #define MODSECURITY_NGINX_TAG "" #define MODSECURITY_NGINX_TAG_NUM "100" @@ -140,8 +140,13 @@ extern ngx_module_t ngx_http_modsecurity_module; int ngx_http_modsecurity_process_intervention (Transaction *transaction, ngx_http_request_t *r, ngx_int_t early_log); ngx_http_modsecurity_ctx_t *ngx_http_modsecurity_create_ctx(ngx_http_request_t *r); char *ngx_str_to_char(ngx_str_t a, ngx_pool_t *p); +#if (NGX_PCRE2) +#define ngx_http_modsecurity_pcre_malloc_init(x) NULL +#define ngx_http_modsecurity_pcre_malloc_done(x) (void)x +#else ngx_pool_t *ngx_http_modsecurity_pcre_malloc_init(ngx_pool_t *pool); void ngx_http_modsecurity_pcre_malloc_done(ngx_pool_t *old_pool); +#endif /* ngx_http_modsecurity_body_filter.c */ ngx_int_t ngx_http_modsecurity_body_filter_init(void); diff --git a/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_module.c b/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_module.c index b6f33f56b..5c341e2a5 100644 --- a/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_module.c +++ b/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_module.c @@ -38,6 +38,7 @@ static void ngx_http_modsecurity_cleanup_rules(void *data); * https://github.com/openresty/lua-nginx-module/blob/master/src/ngx_http_lua_pcrefix.c */ +#if !(NGX_PCRE2) static void *(*old_pcre_malloc)(size_t); static void (*old_pcre_free)(void *ptr); static ngx_pool_t *ngx_http_modsec_pcre_pool = NULL; @@ -103,6 +104,7 @@ ngx_http_modsecurity_pcre_malloc_done(ngx_pool_t *old_pool) pcre_free = old_pcre_free; } } +#endif /* * ngx_string's are not null-terminated in common case, so we need to convert diff --git a/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_rewrite.c b/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_rewrite.c index f6f8d4139..ebf115ea8 100644 --- a/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_rewrite.c +++ b/src/deps/src/ModSecurity-nginx/src/ngx_http_modsecurity_rewrite.c @@ -138,7 +138,15 @@ ngx_http_modsecurity_rewrite_handler(ngx_http_request_t *r) break; #endif default : - http_version = "1.0"; + http_version = ngx_str_to_char(r->http_protocol, r->pool); + if (http_version == (char*)-1) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + if ((http_version != NULL) && (strlen(http_version) > 5) && (!strncmp("HTTP/", http_version, 5))) { + http_version += 5; + } else { + http_version = "1.0"; + } break; } diff --git a/src/deps/src/ModSecurity/.github/workflows/ci.yml b/src/deps/src/ModSecurity/.github/workflows/ci.yml new file mode 100644 index 000000000..63c754a53 --- /dev/null +++ b/src/deps/src/ModSecurity/.github/workflows/ci.yml @@ -0,0 +1,77 @@ +name: Quality Assurance + +on: + push: + pull_request: + +jobs: + build-linux: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04] + platform: [x32, x64] + compiler: [gcc, clang] + configure: + - {label: "with parser generation", opt: "--enable-parser-generation" } + - {label: "wo curl", opt: "--without-curl" } + - {label: "wo yajl", opt: "--without-yajl" } + - {label: "wo geoip", opt: "--without-geoip" } + - {label: "wo lmdb", opt: "--without-lmdb" } + - {label: "wo ssdeep", opt: "--without-ssdeep" } + - {label: "wo lua", opt: "--without-lua" } + - {label: "without maxmind", opt: "--without-maxmind" } + steps: + - name: Setup Dependencies + run: | + sudo add-apt-repository --yes ppa:maxmind/ppa + sudo apt-get update -y -qq + sudo apt-get install -y libfuzzy-dev libyajl-dev libgeoip-dev liblua5.2-dev liblmdb-dev cppcheck libmaxminddb-dev libcurl4-openssl-dev + - uses: actions/checkout@v2 + with: + submodules: true + - name: build.sh + run: ./build.sh + - name: configure ${{ matrix.configure.label }} + run: ./configure ${{ matrix.configure.opt }} + - uses: ammaraskar/gcc-problem-matcher@master + - name: make + run: make -j `nproc` + - name: check + run: make check + - name: check-static + run: make check-static + + build-macos: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-10.15] + compiler: [clang] + configure: + - {label: "with parser generation", opt: "--enable-parser-generation" } + - {label: "wo curl", opt: "--without-curl" } + - {label: "wo yajl", opt: "--without-yajl" } + - {label: "wo geoip", opt: "--without-geoip" } + - {label: "wo lmdb", opt: "--without-lmdb" } + - {label: "wo ssdeep", opt: "--without-ssdeep" } + - {label: "wo lua", opt: "--without-lua" } + - {label: "wo maxmind", opt: "--without-maxmind" } + steps: + - name: Setup Dependencies + run: | + brew install autoconf automake cppcheck lmdb libyaml lua ssdeep libmaxminddb bison + - uses: actions/checkout@v2 + with: + submodules: true + - name: build.sh + run: ./build.sh + - name: configure ${{ matrix.configure.label }} + run: ./configure ${{ matrix.configure.opt }} + - uses: ammaraskar/gcc-problem-matcher@master + - name: make + run: make -j `sysctl -n hw.logicalcpu` + - name: check + run: make check + - name: check-static + run: make check-static diff --git a/src/deps/src/ModSecurity/.gitmodules b/src/deps/src/ModSecurity/.gitmodules index acee72d16..e4cf1b8da 100644 --- a/src/deps/src/ModSecurity/.gitmodules +++ b/src/deps/src/ModSecurity/.gitmodules @@ -3,7 +3,7 @@ url = https://github.com/SpiderLabs/secrules-language-tests [submodule "others/libinjection"] path = others/libinjection - url = https://github.com/client9/libinjection.git + url = https://github.com/libinjection/libinjection.git [submodule "bindings/python"] path = bindings/python url = https://github.com/SpiderLabs/ModSecurity-Python-bindings.git diff --git a/src/deps/src/ModSecurity/.travis.yml b/src/deps/src/ModSecurity/.travis.yml deleted file mode 100644 index 0f7e924b3..000000000 --- a/src/deps/src/ModSecurity/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ -dist: trusty -sudo: true - -addons: - apt: - packages: - - libfuzzy-dev - - libyajl-dev - - libgeoip-dev - - liblua5.2-dev - - liblmdb-dev - - cppcheck - -language: cpp - -compiler: - - clang - - gcc - -os: - - linux - - osx - -env: - - OPTS="--enable-parser-generation $OPTS" - - OPTS="--without-curl $OPTS" - - OPTS="--without-yajl $OPTS" - - OPTS="--without-geoip $OPTS" - - OPTS="--with-lmdb $OPTS" - - OPTS="--without-ssdeep $OPTS" - - OPTS="--without-lua $OPTS" - - OPTS="--without-maxmind $OPTS" - -before_script: - - echo $TRAVIS_OS_NAME - - '[ "$TRAVIS_OS_NAME" != osx ] || brew update' - - '[ "$TRAVIS_OS_NAME" != osx ] || brew install cppcheck' - - '[ "$TRAVIS_OS_NAME" != osx ] || brew install libmaxminddb' - - '[ "$TRAVIS_OS_NAME" != osx ] || brew install lmdb' - - '[ "$TRAVIS_OS_NAME" != linux ] || sudo add-apt-repository --yes ppa:maxmind/ppa' - - '[ "$TRAVIS_OS_NAME" != linux ] || sudo apt-get update' - - '[ "$TRAVIS_OS_NAME" != linux ] || sudo apt-cache search maxmind' - - '[ "$TRAVIS_OS_NAME" != linux ] || sudo apt-get install -y libmaxminddb-dev' - -script: - - ./build.sh - - ./configure $OPTS - - make parser - - make -# -# Temporarily disabled. -# - make -j$(getconf _NPROCESSORS_ONLN) -# Leading build to crash with parser enabled. -# Not sure why. -# - - make check - - make check-static - - - diff --git a/src/deps/src/ModSecurity/CHANGES b/src/deps/src/ModSecurity/CHANGES index 9c0fa77c9..91ef9bddb 100644 --- a/src/deps/src/ModSecurity/CHANGES +++ b/src/deps/src/ModSecurity/CHANGES @@ -1,3 +1,128 @@ +v3.x.y - YYYY-MMM-DD (to be released) +------------------------------------- + + - Use AS_HELP_STRING instead of obsolete AC_HELP_STRING macro + [Issue #2806 - @hughmcmaster] + - During configure, do not check for pcre if pcre2 specified + [Issue #2750 - @dvershinin, @martinhsv] + - Use pkg-config to find libxml2 first + [Issue #2714 - @hughmcmaster] + - Fix two rule-reload memory leak issues + [Issue #2801 - @Abce, @martinhsv] + - Correct whitespace handling for Include directive + [Issue #2800 - @877509395, @martinhsv] + + +v3.0.8 - 2022-Sep-07 +-------------------- + + - Adjust parser activation rules in modsecurity.conf-recommended + [Issue #2796 - @terjanq, @martinhsv] + - Multipart parsing fixes and new MULTIPART_PART_HEADERS collection + [Issue #2795 - @terjanq, @martinhsv] + - Prevent LMDB related segfault + [Issue #2755, #2761 - @dvershinin] + - Fix msc_transaction_cleanup function comment typo + [Issue #2788 - @lookat23] + - Fix: MULTIPART_INVALID_PART connected to wrong internal variable + [Issue #2785 - @martinhsv] + - Restore Unique_id to include random portion after timestamp + [Issue #2752, #2758 - @datkps11, @martinhsv] + +v3.0.7 - 2022-May-30 +-------------------- + + - Move PCRE2 match block from member variable + [@martinhsv] + - Add SecArgumentsLimit, 200007 to modsecurity.conf-recommended + [Issue #2738 - @jleproust, @martinhsv] + - Fix memory leak when concurrent log includes REMOTE_USER + [Issue #2727 - @liudongmiao] + - Fix LMDB initialization issues + [Issue #2688 - @ziollek, @martinhsv] + - Fix initcol error message wording + [Issue #2732 - @877509395, @martinhsv] + - Tolerate other parameters after boundary in multipart C-T + [Issue #1900 - @martinhsv] + - Add DebugLog message for bad pattern in rx operator + [Issue #2723 - @martinhsv] + - Support PCRE2 + [Issue #2668 - @martinhsv] + - Support SecRequestBodyNoFilesLimit + [Issue #2670 - @airween, @martinhsv] + - Fix misuses of LMDB API + [Issue #2601, #2602 - @hyc] + - Fix duplication typo in code comment + [Issue #2677 - @gleydsonsoares] + - Add ctl:auditEngine action support + [Issue #2606 - @alekravch, @martinhsv] + - Fix multiMatch msg, etc, population in audit log + [Issue #2573 - @Sachin-M-Desai, @martinhsv] + - Fix some name handling for ARGS_*NAMES: regex SecRuleUpdateTargetById, etc. + [Issue #2627, #2648 - @lontchianicet, @victorserbu2709, @martinhsv] + - Adjust confusing variable name in setRequestBody method + [Issue #2635 - @Mesar-Ali, @martinhsv] + - Multipart names/filenames may include single quote if double-quote enclosed + [Issue #2352 - @martinhsv] + - Add SecRequestBodyJsonDepthLimit to modsecurity.conf-recommended + [Issue #2647 - @theMiddleBlue, @airween, @877509395 ,@martinhsv] + + +v3.0.6 - 2021-Nov-19 +------------------------------------- + + - Support configurable limit on depth of JSON parsing + [@theMiddleBlue, @martinhsv] + +v3.0.5 - 2021-Jul-07 +-------------------- + + - Handle URI received with uri-fragment + [@martinhsv] + - Having ARGS_NAMES, variables proxied + [@zimmerle, @martinhsv, @KaNikita] + - Use explicit path for cross-compile environments. + [Issue #2485 - @dtoubelis] + - Fix: FILES variable does not use multipart part name for key + [Issue #2377 - @martinhsv] + - Replaces put with setenv in SetEnv action + [Issue #2469 - @martinhsv, @WGH-, @zimmerle] + - Regression: Mark the test as failed in case of segfault. + [@zimmerle] + - Regex key selection should not be case-sensitive + [Issue #2296, #2107, #2297 - @michaelgranzow-avi, @victorhora, + @airween, @martinhsv, @zimmerle] + - Fix: Only delete Multipart tmp files after rules have run + [Issue #2427 - @martinhsv] + - Fixed MatchedVar on chained rules + [Issue #2423, #2435, #2436 - @michaelgranzow-avi] + - Add support for new operator rxGlobal + [@martinhsv] + - Fix maxminddb link on FreeBSD + [Issue #2131 - @granalberto, @zimmerle] + - Fix IP address logging in Section A + [Issue #2300 - @inaratech, @zavazingo, @martinhsv] + - Adds support to lua 5.4 + [@zimmerle] + - GeoIP: switch to GEOIP_MEMORY_CACHE from GEOIP_INDEX_CACHE + [Issues #2378, #2186 - @defanator] + - rx: exit after full match (remove /g emulation); ensure capture + groups occuring after unused groups still populate TX vars + [Issue #2336 - @martinhsv] + - Correct CHANGES file entry for #2234 + - Add support to test framework for audit log content verification + and add regression tests for issues #2000, #2196 + - Support configurable limit on number of arguments processed + [Issue #2234 - @jleproust, @martinhsv] + - Multipart Content-Dispostion should allow field: filename*= + [@martinhsv] + - Fix rule-update-target for non-regex + [Issue 2251 - @martinhsv] + - Fix configure script when packaging for Buildroot + [Issue 2235 - @frankvanbever] + - modsecurity.pc.in: add Libs.private + [Issue #1918, #2253 - @ffontaine, @Dridi, @victorhora] + v3.0.4 - 2020-Jan-13 -------------------- diff --git a/src/deps/src/ModSecurity/Makefile.am b/src/deps/src/ModSecurity/Makefile.am index 83973cb64..17eb62b08 100644 --- a/src/deps/src/ModSecurity/Makefile.am +++ b/src/deps/src/ModSecurity/Makefile.am @@ -56,13 +56,17 @@ parser: cppcheck: - @cppcheck \ + @cppcheck -U YYSTYPE -U MBEDTLS_MD5_ALT -U MBEDTLS_SHA1_ALT \ + -D MS_CPPCHECK_DISABLED_FOR_PARSER -U YY_USER_INIT \ --suppressions-list=./test/cppcheck_suppressions.txt \ - --enable=all \ + --enable=warning,style,performance,portability,unusedFunction,missingInclude \ --inconclusive \ --template="warning: {file},{line},{severity},{id},{message}" \ - --std=posix . 2> cppcheck.txt - cat cppcheck.txt | grep -v "/ lalr1.cc" + -I headers -I . -I others -I src -I others/mbedtls -I src/parser \ + --error-exitcode=1 \ + -i "src/parser/seclang-parser.cc" -i "src/parser/seclang-scanner.cc" \ + --force --verbose . + check-static: cppcheck @@ -92,6 +96,7 @@ TESTS+=test/test-cases/regression/action-ctl_request_body_access.json TESTS+=test/test-cases/regression/action-ctl_request_body_processor.json TESTS+=test/test-cases/regression/action-ctl_request_body_processor_urlencoded.json TESTS+=test/test-cases/regression/action-ctl_rule_engine.json +TESTS+=test/test-cases/regression/action-ctl_audit_engine.json TESTS+=test/test-cases/regression/action-ctl_rule_remove_by_id.json TESTS+=test/test-cases/regression/action-ctl_rule_remove_by_tag.json TESTS+=test/test-cases/regression/action-ctl_rule_remove_target_by_id.json @@ -151,7 +156,12 @@ TESTS+=test/test-cases/regression/issue-1943.json TESTS+=test/test-cases/regression/issue-1956.json TESTS+=test/test-cases/regression/issue-1960.json TESTS+=test/test-cases/regression/issue-2099.json +TESTS+=test/test-cases/regression/issue-2000.json TESTS+=test/test-cases/regression/issue-2111.json +TESTS+=test/test-cases/regression/issue-2196.json +TESTS+=test/test-cases/regression/issue-2423-msg-in-chain.json +TESTS+=test/test-cases/regression/issue-2427.json +TESTS+=test/test-cases/regression/issue-2296.json TESTS+=test/test-cases/regression/issue-394.json TESTS+=test/test-cases/regression/issue-849.json TESTS+=test/test-cases/regression/issue-960.json @@ -165,6 +175,7 @@ TESTS+=test/test-cases/regression/operator-inpectFile.json TESTS+=test/test-cases/regression/operator-ipMatchFromFile.json TESTS+=test/test-cases/regression/operator-pm.json TESTS+=test/test-cases/regression/operator-rx.json +TESTS+=test/test-cases/regression/operator-rxGlobal.json TESTS+=test/test-cases/regression/operator-UnconditionalMatch.json TESTS+=test/test-cases/regression/operator-validate-byte-range.json TESTS+=test/test-cases/regression/operator-verifycc.json @@ -180,6 +191,7 @@ TESTS+=test/test-cases/regression/rule-920120.json TESTS+=test/test-cases/regression/rule-920200.json TESTS+=test/test-cases/regression/rule-920274.json TESTS+=test/test-cases/regression/secaction.json +TESTS+=test/test-cases/regression/secargumentslimit.json TESTS+=test/test-cases/regression/sec_component_signature.json TESTS+=test/test-cases/regression/secmarker.json TESTS+=test/test-cases/regression/secruleengine.json @@ -213,6 +225,7 @@ TESTS+=test/test-cases/regression/variable-MULTIPART_CRLF_LF_LINES.json TESTS+=test/test-cases/regression/variable-MULTIPART_FILENAME.json TESTS+=test/test-cases/regression/variable-MULTIPART_INVALID_HEADER_FOLDING.json TESTS+=test/test-cases/regression/variable-MULTIPART_NAME.json +TESTS+=test/test-cases/regression/variable-MULTIPART_PART_HEADERS.json TESTS+=test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json TESTS+=test/test-cases/regression/variable-MULTIPART_UNMATCHED_BOUNDARY.json TESTS+=test/test-cases/regression/variable-OUTBOUND_DATA_ERROR.json @@ -283,6 +296,7 @@ TESTS+=test/test-cases/secrules-language-tests/operators/noMatch.json TESTS+=test/test-cases/secrules-language-tests/operators/pmFromFile.json TESTS+=test/test-cases/secrules-language-tests/operators/pm.json TESTS+=test/test-cases/secrules-language-tests/operators/rx.json +TESTS+=test/test-cases/secrules-language-tests/operators/rxGlobal.json TESTS+=test/test-cases/secrules-language-tests/operators/streq.json TESTS+=test/test-cases/secrules-language-tests/operators/strmatch.json TESTS+=test/test-cases/secrules-language-tests/operators/unconditionalMatch.json diff --git a/src/deps/src/ModSecurity/README.md b/src/deps/src/ModSecurity/README.md index b90e12ffa..416e73984 100644 --- a/src/deps/src/ModSecurity/README.md +++ b/src/deps/src/ModSecurity/README.md @@ -1,8 +1,7 @@ -[![Build Status](https://travis-ci.org/SpiderLabs/ModSecurity.svg?branch=v3/master)](https://travis-ci.org/SpiderLabs/ModSecurity) -[![](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.com) +![Quality Assurance](https://github.com/SpiderLabs/ModSecurity/workflows/Quality%20Assurance/badge.svg) [![Build Status](https://sonarcloud.io/api/project_badges/measure?project=USHvY32Uy62L&metric=alert_status)](https://sonarcloud.io/dashboard?id=USHvY32Uy62L) [![](https://sonarcloud.io/api/project_badges/measure?project=USHvY32Uy62L&metric=sqale_rating )](https://sonarcloud.io/dashboard?id=USHvY32Uy62L) @@ -21,26 +20,26 @@ and applying traditional ModSecurity processing. In general, it provides the capability to load/interpret rules written in the ModSecurity SecRules format and apply them to HTTP content provided by your application via Connectors. -If you are looking for ModSecurity for Apache (aka ModSecurity v2.x), it is still under maintenence and available: +If you are looking for ModSecurity for Apache (aka ModSecurity v2.x), it is still under maintenance and available: [here](https://github.com/SpiderLabs/ModSecurity/tree/v2/master). ### What is the difference between this project and the old ModSecurity (v2.x.x)? -* All Apache dependences have been removed +* All Apache dependencies have been removed * Higher performance * New features * New architecture Libmodsecurity is a complete rewrite of the ModSecurity platform. When it was first devised the ModSecurity project started as just an Apache module. Over time the project has been extended, due to popular demand, to support other platforms including (but not limited to) Nginx and IIS. In order to provide for the growing demand for additional platform support, it has became necessary to remove the Apache dependencies underlying this project, making it more platform independent. -As a result of this goal we have rearchitechted Libmodsecurity such that it is no longer dependent on the Apache web server (both at compilation and during runtime). One side effect of this is that across all platforms users can expect increased performance. Additionally, we have taken this opprotunity to lay the groundwork for some new features that users have been long seeking. For example we are looking to nativly support auditlogs in the JSON format, along with a host of other functionality in future versions. +As a result of this goal we have rearchitected Libmodsecurity such that it is no longer dependent on the Apache web server (both at compilation and during runtime). One side effect of this is that across all platforms users can expect increased performance. Additionally, we have taken this opportunity to lay the groundwork for some new features that users have been long seeking. For example we are looking to natively support auditlogs in the JSON format, along with a host of other functionality in future versions. ### It is no longer just a module. -The 'ModSecurity' branch no longer contains the traditional module logic (for Nginx, Apache, and IIS) that has traditionally been packaged all together. Instead, this branch only contains the library portion (libmodsecurity) for this project. This library is consumed by what we have termed 'Connectors' these connectors will interface with your webserver and provide the library with a common format that it undersands. Each of these connectors is maintained as a seperate GitHub project. For instance, the Nginx connector is supplied by the ModSecurity-nginx project (https://github.com/SpiderLabs/ModSecurity-nginx). +The 'ModSecurity' branch no longer contains the traditional module logic (for Nginx, Apache, and IIS) that has traditionally been packaged all together. Instead, this branch only contains the library portion (libmodsecurity) for this project. This library is consumed by what we have termed 'Connectors' these connectors will interface with your webserver and provide the library with a common format that it understands. Each of these connectors is maintained as a separate GitHub project. For instance, the Nginx connector is supplied by the ModSecurity-nginx project (https://github.com/SpiderLabs/ModSecurity-nginx). -Keeping these connectors seperated allows each project to be have different release cycles, issues and development trees. Addtionally, it means that when you install ModSecurity v3 you only get exactly what you need, no extras you won't be using. +Keeping these connectors separated allows each project to have different release cycles, issues and development trees. Additionally, it means that when you install ModSecurity v3 you only get exactly what you need, no extras you won't be using. # Compilation @@ -78,7 +77,7 @@ Windows build is not ready yet. ## Dependencies This library is written in C++ using the C++11 standards. It also uses Flex -and Yacc to produce the “Sec Rules Language” parser. Other, manditory dependencies include YAJL, as ModSecurity uses JSON for producing logs and its testing framework, libpcre (not yet manditory) for processing regular expressions in SecRules, and libXML2 (not yet manditory) which is used for parsing XML requests. +and Yacc to produce the “Sec Rules Language” parser. Other, mandatory dependencies include YAJL, as ModSecurity uses JSON for producing logs and its testing framework, libpcre (not yet mandatory) for processing regular expressions in SecRules, and libXML2 (not yet mandatory) which is used for parsing XML requests. All others dependencies are related to operators specified within SecRules or configuration directives and may not be required for compilation. A short list of such dependencies is as follows: @@ -97,7 +96,7 @@ The library provides a C++ and C interface. Some resources are currently only available via the C++ interface, for instance, the capability to create custom logging mechanism (see the regression test to check for how those logging mechanism works). The objective is to have both APIs (C, C++) providing the same functionality, -if you find an aspect of the API that is missing via a perticular interface, please open an issue. +if you find an aspect of the API that is missing via a particular interface, please open an issue. Inside the subfolder examples, there are simple examples on how to use the API. Below some are illustrated: @@ -168,7 +167,7 @@ are willing to help with. ## Providing patches -We prefer to have your patch within the GtiHub infrastructure to facilitate our +We prefer to have your patch within the GitHub infrastructure to facilitate our review work, and our Q.A. integration. GitHub provides excellent documentation on how to perform “Pull Requests”, more information available here: https://help.github.com/articles/using-pull-requests/ @@ -199,7 +198,7 @@ A TODO list is also available as part of the Doxygen documentation. Along with the manual testing, we strongly recommend you to use the our regression tests and unit tests. If you have implemented an operator, don’t -forget to create unit tests for it. If you impliment anything else, it is encouraged that you develop complimentary regression tests for it. +forget to create unit tests for it. If you implement anything else, it is encouraged that you develop complimentary regression tests for it. The regression test and unit test utilities are native and do not demand any external tool or script, although you need to fetch the test cases from other @@ -222,7 +221,7 @@ Before start the debugging process, make sure of where your bug is. The problem could be on your connector or in libmodsecurity. In order to identify where the bug is, it is recommended that you develop a regression test that mimics the scenario where the bug is happening. If the bug is reproducible with the -regression-test utility, then it will be far simpliar to debug and ensure that it never occurs again. On Linux it is +regression-test utility, then it will be far simpler to debug and ensure that it never occurs again. On Linux it is recommended that anyone undertaking debugging utilize gdb and/or valgrind as needed. During the configuration/compilation time, you may want to disable the compiler @@ -263,15 +262,15 @@ new issue, please check if there is one already opened on the same topic. ## Bindings -The libModSecurity design allows the integration with bindings. There is an effort to avoid brake the API [binary] compatibility to make an easy integration with possible bindings. Currently, there are two notable projects maintained by the community: +The libModSecurity design allows the integration with bindings. There is an effort to avoid breaking API [binary] compatibility to make an easy integration with possible bindings. Currently, there are two notable projects maintained by the community: * Python - https://github.com/actions-security/pymodsecurity * Varnish - https://github.com/xdecock/vmod-modsecurity -## Packing +## Packaging Having our packages in distros on time is a desire that we have, so let us know if there is anything we can do to facilitate your work as a packager. +## Sponsor Note - - +Development of ModSecurity is sponsored by Trustwave. Sponsorship will end July 1, 2024. Additional information can be found here https://www.trustwave.com/en-us/resources/security-resources/software-updates/end-of-sale-and-trustwave-support-for-modsecurity-web-application-firewall/ diff --git a/src/deps/src/ModSecurity/SECURITY.md b/src/deps/src/ModSecurity/SECURITY.md new file mode 100644 index 000000000..394d05b5f --- /dev/null +++ b/src/deps/src/ModSecurity/SECURITY.md @@ -0,0 +1,9 @@ +# Security Policy + +## Supported Versions + +The latest versions of both v2.9.x and v3.0.x are supported. + +## Reporting a Vulnerability + +For information on how to report a security issue, please see https://github.com/SpiderLabs/ModSecurity#security-issue diff --git a/src/deps/src/ModSecurity/build/curl.m4 b/src/deps/src/ModSecurity/build/curl.m4 index 66126ece7..747d21fe6 100644 --- a/src/deps/src/ModSecurity/build/curl.m4 +++ b/src/deps/src/ModSecurity/build/curl.m4 @@ -17,7 +17,7 @@ AC_DEFUN([CHECK_CURL], [ AC_ARG_WITH( curl, - [AC_HELP_STRING([--with-curl=PATH],[Path to curl prefix or config script])], + [AS_HELP_STRING([--with-curl=PATH],[Path to curl prefix or config script])], [test_paths="${with_curl}"], [test_paths="/usr/local/libcurl /usr/local/curl /usr/local /opt/libcurl /opt/curl /opt /usr"]) diff --git a/src/deps/src/ModSecurity/build/libgeoip.m4 b/src/deps/src/ModSecurity/build/libgeoip.m4 index 74fb076da..c382d241d 100644 --- a/src/deps/src/ModSecurity/build/libgeoip.m4 +++ b/src/deps/src/ModSecurity/build/libgeoip.m4 @@ -9,11 +9,6 @@ dnl GEOIP_VERSION AC_DEFUN([PROG_GEOIP], [ - -# Needed if pkg-config will be used. -AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - - # Possible names for the geoip library/package (pkg-config) GEOIP_POSSIBLE_LIB_NAMES="geoip2 geoip GeoIP" diff --git a/src/deps/src/ModSecurity/build/libmaxmind.m4 b/src/deps/src/ModSecurity/build/libmaxmind.m4 index c674ca57b..656fc2506 100644 --- a/src/deps/src/ModSecurity/build/libmaxmind.m4 +++ b/src/deps/src/ModSecurity/build/libmaxmind.m4 @@ -9,13 +9,8 @@ dnl MAXMIND_VERSION AC_DEFUN([PROG_MAXMIND], [ - -# Needed if pkg-config will be used. -AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - - # Possible names for the maxmind library/package (pkg-config) -MAXMIND_POSSIBLE_LIB_NAMES="libmaxminddb maxminddb maxmind" +MAXMIND_POSSIBLE_LIB_NAMES="maxminddb maxmind" # Possible extensions for the library MAXMIND_POSSIBLE_EXTENSIONS="so la sl dll dylib" diff --git a/src/deps/src/ModSecurity/build/libxml.m4 b/src/deps/src/ModSecurity/build/libxml.m4 index ba8c50acb..f10fd1f8d 100644 --- a/src/deps/src/ModSecurity/build/libxml.m4 +++ b/src/deps/src/ModSecurity/build/libxml.m4 @@ -4,20 +4,7 @@ dnl Sets: dnl LIBXML2_CFLAGS dnl LIBXML2_LIBS -LIBXML2_CONFIG="" -LIBXML2_VERSION="" -LIBXML2_CFLAGS="" -LIBXML2_CPPFLAGS="" -LIBXML2_LDADD="" -LIBXML2_LDFLAGS="" - -AC_DEFUN([CHECK_LIBXML2], [ - -AC_ARG_WITH( - libxml, - [AC_HELP_STRING([--with-libxml=PATH],[Path to libxml2 prefix or config script])], - [test_paths="${with_libxml}"], - [test_paths="/usr/local/libxml2 /usr/local/xml2 /usr/local/xml /usr/local /opt/libxml2 /opt/libxml /opt/xml2 /opt/xml /opt /usr"]) +AC_DEFUN([CHECK_XML2CONFIG], [ AC_MSG_CHECKING([for libxml2 config script]) @@ -58,19 +45,56 @@ if test -n "${libxml2_path}"; then LIBXML2_LDADD="`${LIBXML2_CONFIG} --libs`" if test ! -z "${LIBXML2_LDADD}"; then AC_MSG_NOTICE(xml LDADD: $LIBXML2_LDADD); fi - AC_MSG_CHECKING([if libxml2 is at least v2.6.29]) - libxml2_min_ver=`echo 2.6.29 | awk -F. '{print (\$ 1 * 1000000) + (\$ 2 * 1000) + \$ 3}'` + AC_MSG_CHECKING([if libxml2 is at least v${LIBXML2_MIN_VERSION}]) + libxml2_min_ver=`echo ${LIBXML2_MIN_VERSION} | awk -F. '{print (\$ 1 * 1000000) + (\$ 2 * 1000) + \$ 3}'` libxml2_ver=`echo ${LIBXML2_VERSION} | awk -F. '{print (\$ 1 * 1000000) + (\$ 2 * 1000) + \$ 3}'` if test "$libxml2_ver" -ge "$libxml2_min_ver"; then AC_MSG_RESULT([yes, $LIBXML2_VERSION]) else AC_MSG_RESULT([no, $LIBXML2_VERSION]) - AC_MSG_ERROR([NOTE: libxml2 library must be at least 2.6.29]) + AC_MSG_ERROR([NOTE: libxml2 library must be at least ${LIBXML2_MIN_VERSION}]) fi else AC_MSG_RESULT([no]) fi +]) + +AC_DEFUN([CHECK_LIBXML2], [ + +AC_ARG_WITH( + libxml, + [AS_HELP_STRING([--with-libxml=PATH],[Path to libxml2 prefix or config script])], + [test_paths="${with_libxml}"], + [test_paths="/usr/local/libxml2 /usr/local/xml2 /usr/local/xml /usr/local /opt/libxml2 /opt/libxml /opt/xml2 /opt/xml /opt /usr"]) + +LIBXML2_MIN_VERSION="2.6.29" +LIBXML2_PKG_NAME="libxml-2.0" +LIBXML2_CONFIG="" +LIBXML2_VERSION="" +LIBXML2_CFLAGS="" +LIBXML2_CPPFLAGS="" +LIBXML2_LDADD="" +LIBXML2_LDFLAGS="" + +if test "x${with_libxml}" != "xno"; then + if test -n "${PKG_CONFIG}"; then + AC_MSG_CHECKING([for libxml2 >= ${LIBXML2_MIN_VERSION} via pkg-config]) + if `${PKG_CONFIG} --exists "${LIBXML2_PKG_NAME} >= ${LIBXML2_MIN_VERSION}"`; then + LIBXML2_VERSION="`${PKG_CONFIG} --modversion ${LIBXML2_PKG_NAME}`" + LIBXML2_CFLAGS="`${PKG_CONFIG} --cflags ${LIBXML2_PKG_NAME}` -DWITH_LIBXML2" + LIBXML2_LDADD="`${PKG_CONFIG} --libs-only-l ${LIBXML2_PKG_NAME}`" + LIBXML2_LDFLAGS="`${PKG_CONFIG} --libs-only-L --libs-only-other ${LIBXML2_PKG_NAME}`" + AC_MSG_RESULT([found version ${LIBXML2_VERSION}]) + else + AC_MSG_RESULT([not found]) + fi + fi + + if test -z "${LIBXML2_VERSION}"; then + CHECK_XML2CONFIG + fi +fi AC_SUBST(LIBXML2_CONFIG) AC_SUBST(LIBXML2_VERSION) diff --git a/src/deps/src/ModSecurity/build/lmdb.m4 b/src/deps/src/ModSecurity/build/lmdb.m4 index f413226c8..1488617e3 100644 --- a/src/deps/src/ModSecurity/build/lmdb.m4 +++ b/src/deps/src/ModSecurity/build/lmdb.m4 @@ -3,10 +3,6 @@ dnl CHECK_LMDB(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN([PROG_LMDB], [ -# Needed if pkg-config will be used.LMDB -AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - - # Possible names for the lmdb library/package (pkg-config) LMDB_POSSIBLE_LIB_NAMES="lmdb" @@ -25,10 +21,7 @@ LMDB_LDFLAGS="" AC_ARG_WITH( lmdb, - AC_HELP_STRING( - [--with-lmdb=PATH], - [Path to lmdb prefix or config script] - ) + [AS_HELP_STRING([--with-lmdb=PATH],[Path to lmdb prefix or config script])] ) if test "x${with_lmdb}" == "xno"; then diff --git a/src/deps/src/ModSecurity/build/lua.m4 b/src/deps/src/ModSecurity/build/lua.m4 index 49a54b485..4780d32fc 100644 --- a/src/deps/src/ModSecurity/build/lua.m4 +++ b/src/deps/src/ModSecurity/build/lua.m4 @@ -6,13 +6,13 @@ AC_DEFUN([CHECK_LUA], [dnl # Possible names for the lua library/package (pkg-config) -LUA_POSSIBLE_LIB_NAMES="luajit luajit-5.1 lua53 lua5.3 lua-5.3 lua52 lua5.2 lua-5.2 lua51 lua5.1 lua-5.1 lua" +LUA_POSSIBLE_LIB_NAMES="lua54 lua5.4 lua-5.4 lua53 lua5.3 lua-5.3 lua52 lua5.2 lua-5.2 lua51 lua5.1 lua-5.1 lua" # Possible extensions for the library -LUA_POSSIBLE_EXTENSIONS="so so0 la sl dll dylib so.0.0.0" +LUA_POSSIBLE_EXTENSIONS="so la sl dll dylib" # Possible paths (if pkg-config was not found, proceed with the file lookup) -LUA_POSSIBLE_PATHS="/usr/lib /usr/local/lib /usr/local/lib64 /usr/local/lua /usr/local/liblua /usr/local /opt /usr /usr/lib64 /opt/local" +LUA_POSSIBLE_PATHS="/usr/lib /usr/local/lib /usr/local/lib64 /usr/local/lua /usr/local/liblua /usr/local /opt /usr /usr/lib64 /opt/local /usr/lib/lua5.3/liblua /usr/lib/lua5.2/liblua" # Variables to be set by this very own script. LUA_CFLAGS="" @@ -22,10 +22,7 @@ LUA_DISPLAY="" AC_ARG_WITH( lua, - AC_HELP_STRING( - [--with-lua=PATH], - [Path to lua prefix] - ) + [AS_HELP_STRING([--with-lua=PATH],[Path to lua prefix])] ) @@ -68,6 +65,8 @@ else case $LUA_PKG_VERSION in (5.1*) LUA_CFLAGS="-DWITH_LUA_5_1 ${LUA_CFLAGS}" ; lua_5_1=1 ;; (5.2*) LUA_CFLAGS="-DWITH_LUA_5_2 ${LUA_CFLAGS}" ; lua_5_2=1 ;; + (5.3*) LUA_CFLAGS="-DWITH_LUA_5_3 ${LUA_CFLAGS}" ; lua_5_3=1 ;; + (5.4*) LUA_CFLAGS="-DWITH_LUA_5_4 ${LUA_CFLAGS}" ; lua_5_4=1 ;; (2.0*) LUA_CFLAGS="-DWITH_LUA_5_1 ${LUA_CFLAGS}" ; lua_5_1=1 ;; (2.1*) LUA_CFLAGS="-DWITH_LUA_5_1 -DWITH_LUA_JIT_2_1 ${LUA_CFLAGS}" ; lua_5_1=1 ;; esac @@ -162,6 +161,9 @@ AC_DEFUN([CHECK_FOR_LUA_AT], [ lua_inc_path="${path}" elif test -e "${path}/include/lua/lua.h"; then lua_inc_path="${path}/include/lua" + elif test -e "${path}/include/lua5.4/lua.h"; then + lua_inc_path="${path}/include/lua5.4" + LUA_VERSION=504 elif test -e "${path}/include/lua5.3/lua.h"; then lua_inc_path="${path}/include/lua5.3" LUA_VERSION=503 @@ -207,6 +209,14 @@ AC_DEFUN([CHECK_FOR_LUA_AT], [ #endif ], [ LUA_VERSION=502 ], [ lua_5_2=0 ] ) + AC_TRY_COMPILE([ #include ], + [ #if (LUA_VERSION_NUM == 504) + return 0; + #else + #error Lua 5.4 not detected + #endif ], + [ LUA_VERSION=504 ], [ lua_5_4=0 ] + ) if test -z "${LUA_VERSION}" ; then # As a last resort, try to find LUA version from $lua_inc_path @@ -214,8 +224,9 @@ AC_DEFUN([CHECK_FOR_LUA_AT], [ do case "$line" in (\#define\ LUA_VERSION_NUM*501*) LUA_VERSION=501 ;; - (\#define\ LUA_VERSION_NUM*502*) LUA_VERSION=501 ;; - (\#define\ LUA_VERSION_NUM*503*) LUA_VERSION=503 + (\#define\ LUA_VERSION_NUM*502*) LUA_VERSION=502 ;; + (\#define\ LUA_VERSION_NUM*503*) LUA_VERSION=503 ;; + (\#define\ LUA_VERSION_NUM*504*) LUA_VERSION=504 esac done <"${lua_inc_path}/lua.h" AC_MSG_NOTICE([LUA_VERSION is ${LUA_VERSION} found at: ${lua_inc_path}]) @@ -226,6 +237,8 @@ AC_DEFUN([CHECK_FOR_LUA_AT], [ case $LUA_VERSION in (501) LUA_CFLAGS="-DWITH_LUA_5_1 ${LUA_CFLAGS}" ; lua_5_1=1 ;; (502) LUA_CFLAGS="-DWITH_LUA_5_2 ${LUA_CFLAGS}" ; lua_5_2=1 ;; + (503) LUA_CFLAGS="-DWITH_LUA_5_3 ${LUA_CFLAGS}" ; lua_5_3=1 ;; + (504) LUA_CFLAGS="-DWITH_LUA_5_4 ${LUA_CFLAGS}" ; lua_5_4=1 ;; esac fi diff --git a/src/deps/src/ModSecurity/build/pcre.m4 b/src/deps/src/ModSecurity/build/pcre.m4 index 0de3c9c99..f338aa502 100644 --- a/src/deps/src/ModSecurity/build/pcre.m4 +++ b/src/deps/src/ModSecurity/build/pcre.m4 @@ -17,93 +17,97 @@ AC_DEFUN([CHECK_PCRE], AC_ARG_WITH( pcre, - [AC_HELP_STRING([--with-pcre=PATH],[Path to pcre prefix or config script])], + [AS_HELP_STRING([--with-pcre=PATH],[Path to pcre prefix or config script])], [test_paths="${with_pcre}"], [test_paths="/usr/local/libpcre /usr/local/pcre /usr/local /opt/libpcre /opt/pcre /opt /usr /opt/local"]) -AC_MSG_CHECKING([for libpcre config script]) +if test "x${with_pcre2}" != "x" && test "x${with_pcre2}" != "xno"; then + AC_MSG_NOTICE([pcre2 specified; omitting check for pcre]) +else -for x in ${test_paths}; do - dnl # Determine if the script was specified and use it directly - if test ! -d "$x" -a -e "$x"; then - PCRE_CONFIG=$x - pcre_path="no" - break - fi + AC_MSG_CHECKING([for libpcre config script]) - dnl # Try known config script names/locations - for PCRE_CONFIG in pcre-config; do - if test -e "${x}/bin/${PCRE_CONFIG}"; then - pcre_path="${x}/bin" + for x in ${test_paths}; do + dnl # Determine if the script was specified and use it directly + if test ! -d "$x" -a -e "$x"; then + PCRE_CONFIG=$x + pcre_path="no" break - elif test -e "${x}/${PCRE_CONFIG}"; then - pcre_path="${x}" + fi + + dnl # Try known config script names/locations + for PCRE_CONFIG in pcre-config; do + if test -e "${x}/bin/${PCRE_CONFIG}"; then + pcre_path="${x}/bin" + break + elif test -e "${x}/${PCRE_CONFIG}"; then + pcre_path="${x}" + break + else + pcre_path="" + fi + done + if test -n "$pcre_path"; then break - else - pcre_path="" fi done - if test -n "$pcre_path"; then - break - fi -done -if test -n "${pcre_path}"; then - if test "${pcre_path}" != "no"; then - PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}" - fi - AC_MSG_RESULT([${PCRE_CONFIG}]) - PCRE_VERSION="`${PCRE_CONFIG} --version`" - if test ! -z "${PCRE_VERSION}"; then AC_MSG_NOTICE(pcre VERSION: $PCRE_VERSION); fi - PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`" - if test ! -z "${PCRE_CFLAGS}"; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi - PCRE_LDADD="`${PCRE_CONFIG} --libs`" - if test ! -z "${PCRE_LDADD}"; then AC_MSG_NOTICE(pcre LDADD: $PCRE_LDADD); fi - PCRE_LD_PATH="/`${PCRE_CONFIG} --libs | cut -d'/' -f2,3,4,5,6 | cut -d ' ' -f1`" - if test ! -z "${PCRE_LD_PATH}"; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi -else - AC_MSG_RESULT([no]) -fi - -if test -n "${PCRE_VERSION}"; then - AC_MSG_CHECKING(for PCRE JIT) - save_CFLAGS=$CFLAGS - save_LDFLAGS=$LDFLAGS - CFLAGS="${PCRE_CFLAGS} ${CFLAGS}" - LDFLAGS="${LDFLAGS} ${PCRE_LDADD}" - AC_TRY_COMPILE([ #include - #include ], - [ int jit = 0; - pcre_free_study(NULL); - pcre_config(PCRE_CONFIG_JIT, &jit); - if (jit != 1) return 1; ], - [ pcre_jit_available=yes ], [:] - ) - - if test "x$pcre_jit_available" = "xyes"; then - AC_MSG_RESULT(yes) - PCRE_CFLAGS="${PCRE_CFLAGS} -DPCRE_HAVE_JIT" + if test -n "${pcre_path}"; then + if test "${pcre_path}" != "no"; then + PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}" + fi + AC_MSG_RESULT([${PCRE_CONFIG}]) + PCRE_VERSION="`${PCRE_CONFIG} --version`" + if test ! -z "${PCRE_VERSION}"; then AC_MSG_NOTICE(pcre VERSION: $PCRE_VERSION); fi + PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`" + if test ! -z "${PCRE_CFLAGS}"; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi + PCRE_LDADD="`${PCRE_CONFIG} --libs`" + if test ! -z "${PCRE_LDADD}"; then AC_MSG_NOTICE(pcre LDADD: $PCRE_LDADD); fi + PCRE_LD_PATH="/`${PCRE_CONFIG} --libs | cut -d'/' -f2,3,4,5,6 | cut -d ' ' -f1`" + if test ! -z "${PCRE_LD_PATH}"; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi - CFLAGS=$save_CFLAGS - LDFLAGS=$save_$LDFLAGS + + if test -n "${PCRE_VERSION}"; then + AC_MSG_CHECKING(for PCRE JIT) + save_CFLAGS=$CFLAGS + save_LDFLAGS=$LDFLAGS + save_LIBS=$LIBS + CFLAGS="${PCRE_CFLAGS} ${CFLAGS}" + LDFLAGS="${PCRE_LDADD} ${LDFLAGS}" + LIBS="${PCRE_LDADD} ${LIBS}" + AC_TRY_LINK([ #include ], + [ pcre_jit_exec(NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL); ], + [ pcre_jit_available=yes ], [:] + ) + + if test "x$pcre_jit_available" = "xyes"; then + AC_MSG_RESULT(yes) + PCRE_CFLAGS="${PCRE_CFLAGS} -DPCRE_HAVE_JIT" + else + AC_MSG_RESULT(no) + fi + CFLAGS=$save_CFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + fi + + AC_SUBST(PCRE_CONFIG) + AC_SUBST(PCRE_VERSION) + AC_SUBST(PCRE_CPPFLAGS) + AC_SUBST(PCRE_CFLAGS) + AC_SUBST(PCRE_LDFLAGS) + AC_SUBST(PCRE_LDADD) + AC_SUBST(PCRE_LD_PATH) + + if test -z "${PCRE_VERSION}"; then + AC_MSG_NOTICE([*** pcre library not found.]) + ifelse([$2], , AC_MSG_ERROR([pcre library is required]), $2) + else + AC_MSG_NOTICE([using pcre v${PCRE_VERSION}]) + ifelse([$1], , , $1) + PCRE_LDADD="${PCRE_LDADD} -lpcre" + fi fi - -AC_SUBST(PCRE_CONFIG) -AC_SUBST(PCRE_VERSION) -AC_SUBST(PCRE_CPPFLAGS) -AC_SUBST(PCRE_CFLAGS) -AC_SUBST(PCRE_LDFLAGS) -AC_SUBST(PCRE_LDADD) -AC_SUBST(PCRE_LD_PATH) - -if test -z "${PCRE_VERSION}"; then - AC_MSG_NOTICE([*** pcre library not found.]) - ifelse([$2], , AC_MSG_ERROR([pcre library is required]), $2) -else - AC_MSG_NOTICE([using pcre v${PCRE_VERSION}]) - ifelse([$1], , , $1) - PCRE_LDADD="${PCRE_LDADD} -lpcre" -fi ]) diff --git a/src/deps/src/ModSecurity/build/pcre2.m4 b/src/deps/src/ModSecurity/build/pcre2.m4 new file mode 100644 index 000000000..0303bc29f --- /dev/null +++ b/src/deps/src/ModSecurity/build/pcre2.m4 @@ -0,0 +1,180 @@ +dnl Check for PCRE2 Libraries +dnl CHECK_PCRE2(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) + +AC_DEFUN([PROG_PCRE2], [ + +# Possible names for the pcre2 library/package (pkg-config) +PCRE2_POSSIBLE_LIB_NAMES="pcre2 pcre2-8" + +# Possible extensions for the library +PCRE2_POSSIBLE_EXTENSIONS="so so0 la sl dll dylib so.0.0.0" + +# Possible paths (if pkg-config was not found, proceed with the file lookup) +PCRE2_POSSIBLE_PATHS="/usr/lib /usr/local/lib /usr/local/libpcre2-8 /usr/local/pcre2 /usr/local /opt/libpcre2-8 /opt/pcre2 /opt /usr /usr/lib64 /opt/local" + +# Variables to be set by this very own script. +PCRE2_VERSION="" +PCRE2_CFLAGS="" +PCRE2_CPPFLAGS="" +PCRE2_LDADD="" +PCRE2_LDFLAGS="" + +AC_ARG_WITH( + pcre2, + [AS_HELP_STRING([--with-pcre2=PATH],[Path to pcre2 prefix or config script])] +) + +if test "x${with_pcre2}" == "xno"; then + AC_DEFINE(HAVE_PCRE2, 0, [Support for PCRE2 was disabled by the utilization of --without-pcre2 or --with-pcre2=no]) + AC_MSG_NOTICE([Support for PCRE2 was disabled by the utilization of --without-pcre2 or --with-pcre2=no]) + PCRE2_DISABLED=yes +else + if test "x${with_pcre2}" == "xyes"; then + PCRE2_MANDATORY=yes + AC_MSG_NOTICE([PCRE2 support was marked as mandatory by the utilization of --with-pcre2=yes]) + fi +# for x in ${PCRE2_POSSIBLE_LIB_NAMES}; do +# CHECK_FOR_PCRE2_AT(${x}) +# if test -n "${PCRE2_VERSION}"; then +# break +# fi +# done + +# if test "x${with_pcre2}" != "xyes" or test "x${with_pcre2}" == "xyes"; then + if test "x${with_pcre2}" == "x" || test "x${with_pcre2}" == "xyes"; then + # Nothing about PCRE2 was informed, using the pkg-config to figure things out. + if test -n "${PKG_CONFIG}"; then + PCRE2_PKG_NAME="" + for x in ${PCRE2_POSSIBLE_LIB_NAMES}; do + if ${PKG_CONFIG} --exists ${x}; then + PCRE2_PKG_NAME="$x" + break + fi + done + fi + AC_MSG_NOTICE([Nothing about PCRE2 was informed during the configure phase. Trying to detect it on the platform...]) + if test -n "${PCRE2_PKG_NAME}"; then + # Package was found using the pkg-config scripts + PCRE2_VERSION="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --modversion`" + PCRE2_CFLAGS="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --cflags`" + PCRE2_LDADD="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --libs-only-l`" + PCRE2_LDFLAGS="`${PKG_CONFIG} ${PCRE2_PKG_NAME} --libs-only-L --libs-only-other`" + PCRE2_DISPLAY="${PCRE2_LDADD}, ${PCRE2_CFLAGS}" + else + # If pkg-config did not find anything useful, go over file lookup. + for x in ${PCRE2_POSSIBLE_PATHS}; do + CHECK_FOR_PCRE2_AT(${x}) + if test -n "${PCRE2_VERSION}"; then + break + fi + done + fi + fi + if test "x${with_pcre2}" != "x"; then + # An specific path was informed, lets check. + PCRE2_MANDATORY=yes + CHECK_FOR_PCRE2_AT(${with_pcre2}) + fi +# fi +fi + +if test -z "${PCRE2_LDADD}"; then + if test -z "${PCRE2_MANDATORY}"; then + if test -z "${PCRE2_DISABLED}"; then + AC_MSG_NOTICE([PCRE2 library was not found]) + PCRE2_FOUND=0 + else + PCRE2_FOUND=2 + fi + else + AC_MSG_ERROR([PCRE2 was explicitly referenced but it was not found]) + PCRE2_FOUND=-1 + fi +else + if test -z "${PCRE2_MANDATORY}"; then + PCRE2_FOUND=2 + AC_MSG_NOTICE([PCRE2 is disabled by default.]) + else + PCRE2_FOUND=1 + AC_MSG_NOTICE([using PCRE2 v${PCRE2_VERSION}]) + PCRE2_CFLAGS="-DWITH_PCRE2 ${PCRE2_CFLAGS}" + PCRE2_DISPLAY="${PCRE2_LDADD}, ${PCRE2_CFLAGS}" + AC_SUBST(PCRE2_VERSION) + AC_SUBST(PCRE2_LDADD) + AC_SUBST(PCRE2_LIBS) + AC_SUBST(PCRE2_LDFLAGS) + AC_SUBST(PCRE2_CFLAGS) + AC_SUBST(PCRE2_DISPLAY) + fi +fi + + +AC_SUBST(PCRE2_FOUND) + +]) # AC_DEFUN [PROG_PCRE2] + + +AC_DEFUN([CHECK_FOR_PCRE2_AT], [ + path=$1 + echo "*** LOOKING AT PATH: " ${path} + for y in ${PCRE2_POSSIBLE_EXTENSIONS}; do + for z in ${PCRE2_POSSIBLE_LIB_NAMES}; do + if test -e "${path}/${z}.${y}"; then + pcre2_lib_path="${path}/" + pcre2_lib_name="${z}" + pcre2_lib_file="${pcre2_lib_path}/${z}.${y}" + break + fi + if test -e "${path}/lib${z}.${y}"; then + pcre2_lib_path="${path}/" + pcre2_lib_name="${z}" + pcre2_lib_file="${pcre2_lib_path}/lib${z}.${y}" + break + fi + if test -e "${path}/lib/lib${z}.${y}"; then + pcre2_lib_path="${path}/lib/" + pcre2_lib_name="${z}" + pcre2_lib_file="${pcre2_lib_path}/lib${z}.${y}" + break + fi + if test -e "${path}/lib/x86_64-linux-gnu/lib${z}.${y}"; then + pcre2_lib_path="${path}/lib/x86_64-linux-gnu/" + pcre2_lib_name="${z}" + pcre2_lib_file="${pcre2_lib_path}/lib${z}.${y}" + break + fi + if test -e "${path}/lib/i386-linux-gnu/lib${z}.${y}"; then + pcre2_lib_path="${path}/lib/i386-linux-gnu/" + pcre2_lib_name="${z}" + pcre2_lib_file="${pcre2_lib_path}/lib${z}.${y}" + break + fi + done + if test -n "$pcre2_lib_path"; then + break + fi + done + if test -e "${path}/include/pcre2.h"; then + pcre2_inc_path="${path}/include" + elif test -e "${path}/pcre2.h"; then + pcre2_inc_path="${path}" + elif test -e "${path}/include/pcre2/pcre2.h"; then + pcre2_inc_path="${path}/include" + fi + + if test -n "${pcre2_lib_path}"; then + AC_MSG_NOTICE([PCRE2 library found at: ${pcre2_lib_file}]) + fi + + if test -n "${pcre2_inc_path}"; then + AC_MSG_NOTICE([PCRE2 headers found at: ${pcre2_inc_path}]) + fi + + if test -n "${pcre2_lib_path}" -a -n "${pcre2_inc_path}"; then + # TODO: Compile a piece of code to check the version. + PCRE2_CFLAGS="-I${pcre2_inc_path}" + PCRE2_LDADD="-l${pcre2_lib_name}" + PCRE2_LDFLAGS="-L${pcre2_lib_path}" + PCRE2_DISPLAY="${pcre2_lib_file}, ${pcre2_inc_path}" + fi +]) # AC_DEFUN [CHECK_FOR_PCRE2_AT] diff --git a/src/deps/src/ModSecurity/build/ssdeep.m4 b/src/deps/src/ModSecurity/build/ssdeep.m4 index ec9747fbc..44e783271 100644 --- a/src/deps/src/ModSecurity/build/ssdeep.m4 +++ b/src/deps/src/ModSecurity/build/ssdeep.m4 @@ -22,10 +22,7 @@ SSDEEP_DISPLAY="" AC_ARG_WITH( ssdeep, - AC_HELP_STRING( - [--with-ssdeep=PATH], - [Path to ssdeep prefix] - ) + [AS_HELP_STRING([--with-ssdeep=PATH],[Path to ssdeep prefix])] ) diff --git a/src/deps/src/ModSecurity/build/yajl.m4 b/src/deps/src/ModSecurity/build/yajl.m4 index 7bd9a0beb..dd6957156 100644 --- a/src/deps/src/ModSecurity/build/yajl.m4 +++ b/src/deps/src/ModSecurity/build/yajl.m4 @@ -3,10 +3,6 @@ dnl CHECK_YAJL(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN([PROG_YAJL], [ -# Needed if pkg-config will be used. -AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - - # Possible names for the yajl library/package (pkg-config) YAJL_POSSIBLE_LIB_NAMES="yajl2 yajl" @@ -25,20 +21,17 @@ YAJL_LDFLAGS="" AC_ARG_WITH( yajl, - AC_HELP_STRING( - [--with-yajl=PATH], - [Path to yajl prefix or config script] - ) + [AS_HELP_STRING([--with-yajl=PATH],[Path to yajl prefix or config script])] ) if test "x${with_yajl}" == "xno"; then - AC_DEFINE(HAVE_GEOIP, 0, [Support for GeoIP was disabled by the utilization of --without-yajl or --with-yajl=no]) - AC_MSG_NOTICE([Support for GeoIP was disabled by the utilization of --without-yajl or --with-yajl=no]) + AC_DEFINE(HAVE_YAJL, 0, [Support for YAJL was disabled by the utilization of --without-yajl or --with-yajl=no]) + AC_MSG_NOTICE([Support for YAJL was disabled by the utilization of --without-yajl or --with-yajl=no]) YAJL_DISABLED=yes else if test "x${with_yajl}" == "xyes"; then YAJL_MANDATORY=yes - AC_MSG_NOTICE([GeoIP support was marked as mandatory by the utilization of --with-yajl=yes]) + AC_MSG_NOTICE([YAJL support was marked as mandatory by the utilization of --with-yajl=yes]) fi # for x in ${YAJL_POSSIBLE_LIB_NAMES}; do # CHECK_FOR_YAJL_AT(${x}) @@ -49,7 +42,7 @@ else # if test "x${with_yajl}" != "xyes" or test "x${with_yajl}" == "xyes"; then if test "x${with_yajl}" == "x" || test "x${with_yajl}" == "xyes"; then - # Nothing about GeoIP was informed, using the pkg-config to figure things out. + # Nothing about YAJL was informed, using the pkg-config to figure things out. if test -n "${PKG_CONFIG}"; then YAJL_PKG_NAME="" for x in ${YAJL_POSSIBLE_LIB_NAMES}; do @@ -59,7 +52,7 @@ else fi done fi - AC_MSG_NOTICE([Nothing about GeoIP was informed during the configure phase. Trying to detect it on the platform...]) + AC_MSG_NOTICE([Nothing about YAJL was informed during the configure phase. Trying to detect it on the platform...]) if test -n "${YAJL_PKG_NAME}"; then # Package was found using the pkg-config scripts YAJL_VERSION="`${PKG_CONFIG} ${YAJL_PKG_NAME} --modversion`" diff --git a/src/deps/src/ModSecurity/configure.ac b/src/deps/src/ModSecurity/configure.ac index bd606aa68..1483a3592 100644 --- a/src/deps/src/ModSecurity/configure.ac +++ b/src/deps/src/ModSecurity/configure.ac @@ -49,13 +49,14 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) AC_PROG_CXX AM_PROG_AR AC_PROG_MAKE_SET +PKG_PROG_PKG_CONFIG # Check if the compiler is c++11 compatible. # AX_CXX_COMPILE_STDCXX_11(,mandatory) # Check for libinjection -if ! test -f "others/libinjection/src/libinjection_html5.c"; then +if ! test -f "${srcdir}/others/libinjection/src/libinjection_html5.c"; then AC_MSG_ERROR([\ @@ -128,6 +129,13 @@ CHECK_LIBXML2 CHECK_PCRE +# +# Check for pcre2 +# +PROG_PCRE2 +AM_CONDITIONAL([PCRE2_CFLAGS], [test "PCRE2_CFLAGS" != ""]) + + # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([string]) @@ -157,7 +165,7 @@ case $host in AC_DEFINE([MACOSX], [1], [Define if the operating system is Macintosh OSX]) PLATFORM="MacOSX" ;; - *-*-linux*) + *-*-linux* | *-*uclinux*) echo "Checking platform... Identified as Linux" AC_DEFINE([LINUX], [1], [Define if the operating system is LINUX]) PLATFORM="Linux" @@ -187,6 +195,11 @@ case $host in AC_DEFINE([FREEBSD], [1], [Define if the operating system is FREEBSD]) PLATFORM="kFreeBSD" ;; + *-*-dragonfly*) + echo "Checking platform... Identified as DragonFlyBSD, treating as linux" + AC_DEFINE([DRAGONFLY], [1], [Define if the operating system is DRAGONFLY]) + PLATFORM="DragonFly" + ;; *-*-gnu*.*) echo "Checking platform... Identified as HURD, treating as linux" AC_DEFINE([LINUX], [1], [Define if the operating system is LINUX]) @@ -194,7 +207,7 @@ case $host in ;; *) echo "Unknown CANONICAL_HOST $host" - exit + exit 1 ;; esac @@ -216,7 +229,7 @@ AC_SUBST([MSC_GIT_VERSION]) AC_ARG_ENABLE(debug-logs, - [AC_HELP_STRING([--disable-debug-logs],[Turn off the SecDebugLog feature])], + [AS_HELP_STRING([--disable-debug-logs],[Turn off the SecDebugLog feature])], [case "${enableval}" in yes) debugLogs=true ;; @@ -234,7 +247,7 @@ fi # Fuzzer AC_ARG_ENABLE(afl-fuzz, - [AC_HELP_STRING([--enable-afl-fuzz],[Turn on the afl fuzzer compilation utilities])], + [AS_HELP_STRING([--enable-afl-fuzz],[Turn on the afl fuzzer compilation utilities])], [case "${enableval}" in yes) aflFuzzer=true ;; @@ -247,7 +260,7 @@ AC_ARG_ENABLE(afl-fuzz, # Examples AC_ARG_ENABLE(examples, - [AC_HELP_STRING([--enable-examples],[Turn on the examples compilation (default option)])], + [AS_HELP_STRING([--enable-examples],[Turn on the examples compilation (default option)])], [case "${enableval}" in yes) buildExamples=true ;; @@ -260,7 +273,7 @@ AC_ARG_ENABLE(examples, # Parser AC_ARG_ENABLE(parser-generation, - [AC_HELP_STRING([--enable-parser-generation],[Enables parser generation during the build])], + [AS_HELP_STRING([--enable-parser-generation],[Enables parser generation during the build])], [case "${enableval}" in yes) buildParser=true ;; @@ -273,7 +286,7 @@ AC_ARG_ENABLE(parser-generation, # Mutex AC_ARG_ENABLE(mutex-on-pm, - [AC_HELP_STRING([--enable-mutex-on-pm],[Treats pm operations as a critical section])], + [AS_HELP_STRING([--enable-mutex-on-pm],[Treats pm operations as a critical section])], [case "${enableval}" in yes) mutexPm=true ;; @@ -313,7 +326,7 @@ fi # Regression tests will not be able to run without the logging support. # But we still have the unit tests. # if test "$debugLogs" = "true"; then -# buildTestUtilities=true +# buildTestUtilities=true # fi # fi @@ -549,6 +562,23 @@ if test "x$LUA_FOUND" = "x2"; then fi +## PCRE2 +if test "x$PCRE2_FOUND" = "x0"; then + echo " + PCRE2 ....not found" +fi +if test "x$PCRE2_FOUND" = "x1"; then + echo -n " + PCRE2 ....found " + if ! test "x$PCRE2_VERSION" = "x"; then + echo "v${PCRE2_VERSION}" + else + echo "" + fi + echo " ${PCRE2_DISPLAY}" +fi +if test "x$PCRE2_FOUND" = "x2"; then + echo " + PCRE2 ....disabled" +fi + echo " " echo " Other Options" if test $buildTestUtilities = true; then diff --git a/src/deps/src/ModSecurity/doc/doxygen.cfg b/src/deps/src/ModSecurity/doc/doxygen.cfg index 44326e01d..648da83f8 100644 --- a/src/deps/src/ModSecurity/doc/doxygen.cfg +++ b/src/deps/src/ModSecurity/doc/doxygen.cfg @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = ModSecurty +PROJECT_NAME = ModSecurity # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -51,7 +51,7 @@ PROJECT_BRIEF = "ModSecurity is an open source, cross platform web appl # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo # to the output directory. -PROJECT_LOGO = doc/ms-doxygen-logo.png +PROJECT_LOGO = ../doc/ms-doxygen-logo.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is diff --git a/src/deps/src/ModSecurity/examples/multiprocess_c/multi.c b/src/deps/src/ModSecurity/examples/multiprocess_c/multi.c index caff92b5d..6c2ae5218 100644 --- a/src/deps/src/ModSecurity/examples/multiprocess_c/multi.c +++ b/src/deps/src/ModSecurity/examples/multiprocess_c/multi.c @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -24,12 +24,13 @@ #include #include + #define FORKS 5 #define REQUESTS_PER_PROCESS 100 char main_rule_uri[] = "basic_rules.conf"; -Rules *rules = NULL; +RulesSet *rules = NULL; ModSecurity *modsec = NULL; @@ -41,11 +42,14 @@ void process_special_request (int j) { msc_process_uri(transaction, "http://www.modsecurity.org/test?foo=herewego", "GET", "1.1"); - msc_add_request_header(transaction, "User-Agent", - "Basic ModSecurity example"); + msc_add_request_header(transaction, + (const unsigned char *) "User-Agent", + (const unsigned char *) "Basic ModSecurity example"); msc_process_request_headers(transaction); msc_process_request_body(transaction); - msc_add_response_header(transaction, "Content-type", "text/html"); + msc_add_response_header(transaction, + (const unsigned char *) "Content-type", + (const unsigned char *) "text/html"); msc_process_response_headers(transaction, 200, "HTTP 1.0"); msc_process_response_body(transaction); msc_process_logging(transaction); @@ -69,11 +73,14 @@ void process_request (int j) { msc_process_uri(transaction, "http://www.modsecurity.org/test?key1=value1&key2=value2&key3=value3", "GET", "1.1"); - msc_add_request_header(transaction, "User-Agent", - "Basic ModSecurity example"); + msc_add_request_header(transaction, + (const unsigned char *) "User-Agent", + (const unsigned char *) "Basic ModSecurity example"); msc_process_request_headers(transaction); msc_process_request_body(transaction); - msc_add_response_header(transaction, "Content-type", "text/html"); + msc_add_response_header(transaction, + (const unsigned char *) "Content-type", + (const unsigned char *) "text/html"); msc_process_response_headers(transaction, 200, "HTTP 1.0"); msc_process_response_body(transaction); msc_process_logging(transaction); @@ -90,7 +97,6 @@ int main (int argc, char **argv) { int ret; const char *error = NULL; - int i = 0; pid_t pid; int f; diff --git a/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/Makefile.am b/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/Makefile.am index 48e884930..797ac752b 100644 --- a/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/Makefile.am +++ b/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/Makefile.am @@ -6,7 +6,6 @@ simple_request_SOURCES = \ simple_request.cc simple_request_LDADD = \ - $(top_builddir)/src/.libs/libmodsecurity.a \ $(CURL_LDADD) \ $(GEOIP_LDADD) \ $(GLOBAL_LDADD) \ @@ -19,9 +18,13 @@ simple_request_LDADD = \ $(YAJL_LDADD) simple_request_LDFLAGS = \ + -L$(top_builddir)/src/.libs/ \ $(GEOIP_LDFLAGS) \ - $(LMDB_LDFLAGS) \ + -lmodsecurity \ -lpthread \ + -lm \ + -lstdc++ \ + $(LMDB_LDFLAGS) \ $(LUA_LDFLAGS) \ $(MAXMIND_LDFLAGS) \ $(SSDEEP_LDFLAGS) \ @@ -36,6 +39,7 @@ simple_request_CPPFLAGS = \ -I../others \ -fPIC \ -O3 \ + $(CURL_CFLAGS) \ $(GEOIP_CFLAGS) \ $(GLOBAL_CPPFLAGS) \ $(MODSEC_NO_LOGS) \ diff --git a/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/reading_logs_via_rule_message.h b/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/reading_logs_via_rule_message.h index 52ce11eda..58cbba8b2 100644 --- a/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/reading_logs_via_rule_message.h +++ b/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/reading_logs_via_rule_message.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -69,14 +69,14 @@ char ip[] = "200.249.12.31"; struct data_ms { modsecurity::ModSecurity *modsec; - modsecurity::Rules *rules; + modsecurity::RulesSet *rules; }; static void *process_request(void *data) { struct data_ms *a = (struct data_ms *)data; modsecurity::ModSecurity *modsec = a->modsec; - modsecurity::Rules *rules = a->rules; + modsecurity::RulesSet *rules = a->rules; int z = 0; for (z = 0; z < 10000; z++) { @@ -115,7 +115,7 @@ class ReadingLogsViaRuleMessage { char *response_headers, char *response_body, char *ip, - std::string rules) : + const std::string &rules) : m_request_header(request_header), m_request_uri(request_uri), m_request_body(request_body), @@ -132,8 +132,7 @@ class ReadingLogsViaRuleMessage { void *status; modsecurity::ModSecurity *modsec; - modsecurity::Rules *rules; - modsecurity::ModSecurityIntervention it; + modsecurity::RulesSet *rules; modsec = new modsecurity::ModSecurity(); modsec->setConnectorInformation("ModSecurity-test v0.0.1-alpha" \ @@ -141,7 +140,7 @@ class ReadingLogsViaRuleMessage { modsec->setServerLogCb(logCb, modsecurity::RuleMessageLogProperty | modsecurity::IncludeFullHighlightLogProperty); - rules = new modsecurity::Rules(); + rules = new modsecurity::RulesSet(); if (rules->loadFromUri(m_rules.c_str()) < 0) { std::cout << "Problems loading the rules..." << std::endl; std::cout << rules->m_parserError.str() << std::endl; @@ -168,8 +167,6 @@ class ReadingLogsViaRuleMessage { delete modsec; pthread_exit(NULL); return 0; -end: - return -1; } static void logCb(void *data, const void *ruleMessagev) { diff --git a/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/simple_request.cc b/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/simple_request.cc index 0487abc77..1d3b1deb2 100644 --- a/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/simple_request.cc +++ b/src/deps/src/ModSecurity/examples/reading_logs_via_rule_message/simple_request.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -17,7 +17,7 @@ #include #include -#include +#include #include "examples/reading_logs_via_rule_message/reading_logs_via_rule_message.h" @@ -29,8 +29,8 @@ int main(int argc, char **argv) { return -1; } - *(argv++); - std::string rules(*argv); + char *rule = *(++argv); + std::string rules(rule); ReadingLogsViaRuleMessage rlvrm(request_header, request_uri, request_body, response_headers, response_body, ip, rules); rlvrm.process(); diff --git a/src/deps/src/ModSecurity/examples/reading_logs_with_offset/Makefile.am b/src/deps/src/ModSecurity/examples/reading_logs_with_offset/Makefile.am index d3ff13451..b798c8c54 100644 --- a/src/deps/src/ModSecurity/examples/reading_logs_with_offset/Makefile.am +++ b/src/deps/src/ModSecurity/examples/reading_logs_with_offset/Makefile.am @@ -6,7 +6,6 @@ read_SOURCES = \ read.cc read_LDADD = \ - $(top_builddir)/src/.libs/libmodsecurity.a \ $(CURL_LDADD) \ $(GEOIP_LDADD) \ $(MAXMIND_LDADD) \ @@ -19,7 +18,12 @@ read_LDADD = \ $(YAJL_LDADD) read_LDFLAGS = \ + -L$(top_builddir)/src/.libs/ \ $(GEOIP_LDFLAGS) \ + -lmodsecurity \ + -lpthread \ + -lm \ + -lstdc++ \ $(LMDB_LDFLAGS) \ $(LUA_LDFLAGS) \ $(SSDEEP_LDFLAGS) \ @@ -35,6 +39,7 @@ read_CPPFLAGS = \ -I../others \ -fPIC \ -O3 \ + $(CURL_CFLAGS) \ $(GEOIP_CFLAGS) \ $(MAXMIND_CFLAGS) \ $(GLOBAL_CPPFLAGS) \ diff --git a/src/deps/src/ModSecurity/examples/simple_example_using_c/test.c b/src/deps/src/ModSecurity/examples/simple_example_using_c/test.c index 4a6358303..c7ed91b28 100644 --- a/src/deps/src/ModSecurity/examples/simple_example_using_c/test.c +++ b/src/deps/src/ModSecurity/examples/simple_example_using_c/test.c @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,7 +18,7 @@ #include #include "modsecurity/modsecurity.h" -#include "modsecurity/rules.h" +#include "modsecurity/rules_set.h" char main_rule_uri[] = "basic_rules.conf"; @@ -29,7 +29,7 @@ int main (int argc, char **argv) const char *error = NULL; ModSecurity *modsec; Transaction *transaction = NULL; - Rules *rules; + RulesSet *rules; modsec = msc_init(); diff --git a/src/deps/src/ModSecurity/examples/using_bodies_in_chunks/Makefile.am b/src/deps/src/ModSecurity/examples/using_bodies_in_chunks/Makefile.am index 160e7ae90..799efe781 100644 --- a/src/deps/src/ModSecurity/examples/using_bodies_in_chunks/Makefile.am +++ b/src/deps/src/ModSecurity/examples/using_bodies_in_chunks/Makefile.am @@ -6,7 +6,6 @@ simple_request_SOURCES = \ simple_request.cc simple_request_LDADD = \ - $(top_builddir)/src/.libs/libmodsecurity.a \ $(CURL_LDADD) \ $(GEOIP_LDADD) \ $(MAXMIND_LDADD) \ @@ -19,7 +18,12 @@ simple_request_LDADD = \ $(YAJL_LDADD) simple_request_LDFLAGS = \ + -L$(top_builddir)/src/.libs/ \ $(GEOIP_LDFLAGS) \ + -lmodsecurity \ + -lpthread \ + -lm \ + -lstdc++ \ $(MAXMIND_LDFLAGS) \ $(LMDB_LDFLAGS) \ -lpthread \ @@ -37,6 +41,7 @@ simple_request_CPPFLAGS = \ -fPIC \ -O3 \ $(GEOIP_CFLAGS) \ + $(CURL_CFLAGS) \ $(MAXMIND_CFLAGS) \ $(GLOBAL_CPPFLAGS) \ $(MODSEC_NO_LOGS) \ diff --git a/src/deps/src/ModSecurity/examples/using_bodies_in_chunks/simple_request.cc b/src/deps/src/ModSecurity/examples/using_bodies_in_chunks/simple_request.cc index 0a766bc27..ec8795fe8 100644 --- a/src/deps/src/ModSecurity/examples/using_bodies_in_chunks/simple_request.cc +++ b/src/deps/src/ModSecurity/examples/using_bodies_in_chunks/simple_request.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,7 +19,7 @@ #include -#include +#include #include @@ -28,6 +28,7 @@ + char request_uri[] = "/test.pl?param1=test¶2=test2"; char request_body_first[] = "" \ @@ -125,17 +126,15 @@ int process_intervention(modsecurity::Transaction *transaction) { int main(int argc, char **argv) { modsecurity::ModSecurity *modsec; - modsecurity::Rules *rules; - modsecurity::ModSecurityIntervention it; + modsecurity::RulesSet *rules; if (argc < 2) { std::cout << "Use " << *argv << " test-case-file.conf"; std::cout << std::endl << std::endl; return -1; } - *(argv++); - - std::string rules_arg(*argv); + char *rule = *(++argv); + std::string rules_arg(rule); /** * ModSecurity initial setup @@ -151,7 +150,7 @@ int main(int argc, char **argv) { * loading the rules.... * */ - rules = new modsecurity::Rules(); + rules = new modsecurity::RulesSet(); if (rules->loadFromUri(rules_arg.c_str()) < 0) { std::cout << "Problems loading the rules..." << std::endl; std::cout << rules->m_parserError.str() << std::endl; diff --git a/src/deps/src/ModSecurity/headers/modsecurity/actions/action.h b/src/deps/src/ModSecurity/headers/modsecurity/actions/action.h index b1e0efc76..374b77d6c 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/actions/action.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/actions/action.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -23,6 +23,7 @@ #include "modsecurity/intervention.h" #include "modsecurity/rule.h" +#include "modsecurity/rule_with_actions.h" #ifndef HEADERS_MODSECURITY_ACTIONS_ACTION_H_ #define HEADERS_MODSECURITY_ACTIONS_ACTION_H_ @@ -31,7 +32,7 @@ namespace modsecurity { class Transaction; -class Rule; +class RuleWithOperator; namespace actions { @@ -42,27 +43,41 @@ class Action { : m_isNone(false), temporaryAction(false), action_kind(2), - m_name(""), - m_parser_payload(""), - m_referenceCount(1) { + m_name(nullptr), + m_parser_payload("") { set_name_and_payload(_action); } explicit Action(const std::string& _action, int kind) : m_isNone(false), temporaryAction(false), action_kind(kind), - m_name(""), - m_parser_payload(""), - m_referenceCount(1) { + m_name(nullptr), + m_parser_payload("") { set_name_and_payload(_action); } + Action(const Action &a) + : m_isNone(a.m_isNone), + temporaryAction(a.temporaryAction), + action_kind(a.action_kind), + m_name(a.m_name), + m_parser_payload(a.m_parser_payload) { } + + Action &operator=(const Action& a) { + m_isNone = a.m_isNone; + temporaryAction = a.temporaryAction; + action_kind = a.action_kind; + m_name = a.m_name; + m_parser_payload = a.m_parser_payload; + return *this; + } + virtual ~Action() { } - virtual std::string evaluate(std::string exp, + virtual std::string evaluate(const std::string &exp, Transaction *transaction); - virtual bool evaluate(Rule *rule, Transaction *transaction); - virtual bool evaluate(Rule *rule, Transaction *transaction, + virtual bool evaluate(RuleWithActions *rule, Transaction *transaction); + virtual bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr ruleMessage) { return evaluate(rule, transaction); } @@ -79,11 +94,11 @@ class Action { } if (pos == std::string::npos) { - m_name = data; + m_name = std::shared_ptr(new std::string(data)); return; } - m_name = std::string(data, 0, pos); + m_name = std::shared_ptr(new std::string(data, 0, pos)); m_parser_payload = std::string(data, pos + 1, data.length()); if (m_parser_payload.at(0) == '\'' && m_parser_payload.size() > 2) { @@ -92,23 +107,10 @@ class Action { } } - int refCountDecreaseAndCheck() { - this->m_referenceCount--; - if (this->m_referenceCount == 0) { - delete this; - return 1; - } - return 0; - } - - void refCountIncrease() { - this->m_referenceCount++; - } - bool m_isNone; bool temporaryAction; int action_kind; - std::string m_name; + std::shared_ptr m_name; std::string m_parser_payload; /** @@ -142,10 +144,7 @@ class Action { */ RunTimeOnlyIfMatchKind, }; - - private: - int m_referenceCount; -}; + }; } // namespace actions diff --git a/src/deps/src/ModSecurity/headers/modsecurity/anchored_set_variable.h b/src/deps/src/ModSecurity/headers/modsecurity/anchored_set_variable.h index f20204948..5b41e8502 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/anchored_set_variable.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/anchored_set_variable.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -71,7 +71,7 @@ struct MyHash{ class AnchoredSetVariable : public std::unordered_multimap { public: - AnchoredSetVariable(Transaction *t, std::string name); + AnchoredSetVariable(Transaction *t, const std::string &name); ~AnchoredSetVariable(); void unset(); diff --git a/src/deps/src/ModSecurity/headers/modsecurity/anchored_set_variable_translation_proxy.h b/src/deps/src/ModSecurity/headers/modsecurity/anchored_set_variable_translation_proxy.h new file mode 100644 index 000000000..da0601bf6 --- /dev/null +++ b/src/deps/src/ModSecurity/headers/modsecurity/anchored_set_variable_translation_proxy.h @@ -0,0 +1,126 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#endif + +#include "modsecurity/variable_value.h" +#include "modsecurity/anchored_set_variable.h" + + +#ifndef HEADERS_MODSECURITY_ANCHORED_SET_VARIABLE_TRANSLATION_PROXY_H_ +#define HEADERS_MODSECURITY_ANCHORED_SET_VARIABLE_TRANSLATION_PROXY_H_ + +#ifdef __cplusplus + +namespace modsecurity { + + +class AnchoredSetVariableTranslationProxy { + public: + AnchoredSetVariableTranslationProxy( + const std::string &name, + AnchoredSetVariable *fount) + : m_name(name), + m_fount(fount) + { + m_translate = [](std::string *name, std::vector *l) { + for (int i = 0; i < l->size(); ++i) { + VariableValue *newVariableValue = new VariableValue(name, &l->at(i)->getKey(), &l->at(i)->getKey()); + const VariableValue *oldVariableValue = l->at(i); + l->at(i) = newVariableValue; + for (auto &oldOrigin : oldVariableValue->getOrigin()) { + std::unique_ptr newOrigin(new VariableOrigin); + newOrigin->m_length = oldVariableValue->getKey().size(); + newOrigin->m_offset = oldOrigin->m_offset - oldVariableValue->getKey().size() - 1; + newVariableValue->addOrigin(std::move(newOrigin)); + } + delete oldVariableValue; + } + }; + } + + virtual ~AnchoredSetVariableTranslationProxy() + { } + + void resolve(std::vector *l) { + m_fount->resolve(l); + m_translate(&m_name, l); + } + + void resolve(std::vector *l, + variables::KeyExclusions &ke) { + m_fount->resolve(l, ke); + m_translate(&m_name, l); + } + + void resolve(const std::string &key, + std::vector *l) { + m_fount->resolve(key, l); + m_translate(&m_name, l); + }; + + void resolveRegularExpression(Utils::Regex *r, + std::vector *l) { + m_fount->resolveRegularExpression(r, l); + m_translate(&m_name, l); + }; + + void resolveRegularExpression(Utils::Regex *r, + std::vector *l, + variables::KeyExclusions &ke) { + m_fount->resolveRegularExpression(r, l, ke); + m_translate(&m_name, l); + }; + + std::unique_ptr resolveFirst(const std::string &key) { + std::vector l; + resolve(&l); + + if (l.empty()) { + return nullptr; + } + + std::unique_ptr ret(new std::string("")); + + ret->assign(l.at(0)->getValue()); + + while (!l.empty()) { + auto &a = l.back(); + l.pop_back(); + delete a; + } + + return ret; + } + + std::string m_name; + private: + AnchoredSetVariable *m_fount; + std::function *l)> m_translate; +}; + +} // namespace modsecurity + +#endif + + +#endif // HEADERS_MODSECURITY_ANCHORED_SET_VARIABLE_TRANSLATION_PROXY_H_ diff --git a/src/deps/src/ModSecurity/headers/modsecurity/anchored_variable.h b/src/deps/src/ModSecurity/headers/modsecurity/anchored_variable.h index 03ccef49a..703a4f9d1 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/anchored_variable.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/anchored_variable.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -42,7 +42,19 @@ class Transaction; class AnchoredVariable { public: - AnchoredVariable(Transaction* t, std::string name); + AnchoredVariable(Transaction* t, const std::string &name); + + AnchoredVariable(const AnchoredVariable &a) = delete; + AnchoredVariable &operator= (const AnchoredVariable &a) = delete; + + /* + : m_transaction(a.m_transaction), + m_offset(a.m_offset), + m_name(a.m_name), + m_value(a.m_value), + m_var(a.m_var) { } + */ + ~AnchoredVariable(); void unset(); diff --git a/src/deps/src/ModSecurity/headers/modsecurity/audit_log.h b/src/deps/src/ModSecurity/headers/modsecurity/audit_log.h index 924739dd8..e379faade 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/audit_log.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/audit_log.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -22,12 +22,11 @@ #ifndef HEADERS_MODSECURITY_AUDIT_LOG_H_ #define HEADERS_MODSECURITY_AUDIT_LOG_H_ -#include "modsecurity/transaction.h" - #ifdef __cplusplus namespace modsecurity { +class Transaction; namespace audit_log { namespace writer { class Writer; @@ -37,7 +36,9 @@ class Writer; class AuditLog { public: AuditLog(); - ~AuditLog(); + virtual ~AuditLog(); + + AuditLog(const AuditLog &a) = delete; enum AuditLogType { NotSetAuditLogType, @@ -158,22 +159,26 @@ class AuditLog { bool setStorageDir(const std::basic_string& path); bool setFormat(AuditLogFormat fmt); - int getDirectoryPermission(); - int getFilePermission(); - int getParts(); + int getDirectoryPermission() const; + int getFilePermission() const; + int getParts() const; bool setParts(const std::basic_string& new_parts); bool setType(AuditLogType audit_type); bool init(std::string *error); - bool close(); + virtual bool close(); bool saveIfRelevant(Transaction *transaction); bool saveIfRelevant(Transaction *transaction, int parts); bool isRelevant(int status); - int addParts(int parts, const std::string& new_parts); - int removeParts(int parts, const std::string& new_parts); + static int addParts(int parts, const std::string& new_parts); + static int removeParts(int parts, const std::string& new_parts); + + void setCtlAuditEngineActive() { + m_ctlAuditEngineActive = true; + } bool merge(AuditLog *from, std::string *error); @@ -181,18 +186,6 @@ class AuditLog { std::string m_path2; std::string m_storage_dir; - void refCountIncrease() { - m_refereceCount++; - } - - bool refCountDecreaseAndCheck() { - m_refereceCount--; - if (m_refereceCount == 0) { - delete this; - return true; - } - return false; - } AuditLogFormat m_format; protected: @@ -213,7 +206,7 @@ class AuditLog { std::string m_relevant; audit_log::writer::Writer *m_writer; - int m_refereceCount; + bool m_ctlAuditEngineActive; // rules have at least one action On or RelevantOnly }; diff --git a/src/deps/src/ModSecurity/headers/modsecurity/collection/collection.h b/src/deps/src/ModSecurity/headers/modsecurity/collection/collection.h index 4c93495cc..1ca7b0d46 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/collection/collection.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/collection/collection.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -44,7 +44,7 @@ namespace collection { class Collection { public: - explicit Collection(std::string a) : m_name(a) { } + explicit Collection(const std::string &a) : m_name(a) { } virtual ~Collection() { } virtual void store(std::string key, std::string value) = 0; diff --git a/src/deps/src/ModSecurity/headers/modsecurity/collection/collections.h b/src/deps/src/ModSecurity/headers/modsecurity/collection/collections.h index 9961a04fc..f04c37aa6 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/collection/collections.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/collection/collections.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -49,6 +49,9 @@ class Collections { Collection *user, Collection *resource); ~Collections(); + Collections(const Collections &c) = delete; + Collections& operator =(const Collections &c) = delete; + std::string m_global_collection_key; std::string m_ip_collection_key; std::string m_session_collection_key; diff --git a/src/deps/src/ModSecurity/headers/modsecurity/debug_log.h b/src/deps/src/ModSecurity/headers/modsecurity/debug_log.h index c2501cf1d..f56bc4c69 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/debug_log.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/debug_log.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -43,11 +43,11 @@ class DebugLog { virtual void write(int level, const std::string &msg); virtual void write(int level, const std::string &id, const std::string &uri, const std::string &msg); - bool isLogFileSet(); - bool isLogLevelSet(); - void setDebugLogLevel(int level); - void setDebugLogFile(const std::string &fileName, std::string *error); - const std::string& getDebugLogFile(); + virtual bool isLogFileSet(); + virtual bool isLogLevelSet(); + virtual void setDebugLogLevel(int level); + virtual void setDebugLogFile(const std::string &fileName, std::string *error); + virtual const std::string& getDebugLogFile(); virtual int getDebugLogLevel(); int m_debugLevel; diff --git a/src/deps/src/ModSecurity/headers/modsecurity/intervention.h b/src/deps/src/ModSecurity/headers/modsecurity/intervention.h index daab95423..af88e8581 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/intervention.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/intervention.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/headers/modsecurity/modsecurity.h b/src/deps/src/ModSecurity/headers/modsecurity/modsecurity.h index 4e4055bee..b23500f45 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/modsecurity.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/modsecurity.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -190,7 +190,7 @@ namespace modsecurity { #define MODSECURITY_MAJOR "3" #define MODSECURITY_MINOR "0" -#define MODSECURITY_PATCHLEVEL "4" +#define MODSECURITY_PATCHLEVEL "8" #define MODSECURITY_TAG "" #define MODSECURITY_TAG_NUM "100" @@ -198,9 +198,9 @@ namespace modsecurity { MODSECURITY_MINOR "." MODSECURITY_PATCHLEVEL \ MODSECURITY_TAG -#define MODSECURITY_VERSION_NUM MODSECURITY_MAJOR \ - MODSECURITY_MINOR MODSECURITY_PATCHLEVEL MODSECURITY_TAG_NUM +#define MODSECURITY_VERSION_NUM 3080100 +#define MODSECURITY_CHECK_VERSION(a) (MODSECURITY_VERSION_NUM <= a) /* * @name ModSecLogCb @@ -229,7 +229,7 @@ namespace modsecurity { namespace actions { class Action; } -class Rule; +class RuleWithOperator; #ifdef __cplusplus extern "C" { @@ -278,8 +278,11 @@ class ModSecurity { ModSecurity(); ~ModSecurity(); + ModSecurity(const ModSecurity &m) = delete; + ModSecurity& operator= (const ModSecurity &m) = delete; + const std::string& whoAmI(); - void setConnectorInformation(std::string connector); + void setConnectorInformation(const std::string &connector); void setServerLogCb(ModSecLogCb cb); /** * @@ -291,9 +294,9 @@ class ModSecurity { void serverLog(void *data, std::shared_ptr rm); - const std::string& getConnectorInformation(); + const std::string& getConnectorInformation() const; - int processContentOffset(const char *content, size_t len, + static int processContentOffset(const char *content, size_t len, const char *matchString, std::string *json, const char **err); collection::Collection *m_global_collection; diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rule.h b/src/deps/src/ModSecurity/headers/modsecurity/rule.h index 0660c6265..1d5570a8d 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/rule.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/rule.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -26,9 +26,9 @@ #define HEADERS_MODSECURITY_RULE_H_ #include "modsecurity/transaction.h" +#include "modsecurity/modsecurity.h" #include "modsecurity/variable_value.h" - #ifdef __cplusplus namespace modsecurity { @@ -44,115 +44,81 @@ class Msg; class Rev; class SetVar; class Tag; +namespace transformations { +class Transformation; +} } namespace operators { class Operator; } +using TransformationResult = std::pair, + std::shared_ptr>; +using TransformationResults = std::list; + +using Transformation = actions::transformations::Transformation; +using Transformations = std::vector; + +using Actions = std::vector; + +using Tags = std::vector; +using SetVars = std::vector; +using MatchActions = std::vector; + class Rule { public: - Rule(operators::Operator *_op, - variables::Variables *_variables, - std::vector *_actions, - std::string fileName, - int lineNumber); - explicit Rule(std::string marker); - virtual ~Rule(); + Rule(std::unique_ptr fileName, int lineNumber) + : m_fileName(std::make_shared(*fileName)), + m_lineNumber(lineNumber), + m_phase(modsecurity::Phases::RequestHeadersPhase) { + } + + Rule(const Rule &other) : + m_fileName(other.m_fileName), + m_lineNumber(other.m_lineNumber), + m_phase(other.m_phase) + { } + + Rule &operator=(const Rule& other) { + m_fileName = other.m_fileName; + m_lineNumber = other.m_lineNumber; + m_phase = other.m_phase; + return *this; + } + + virtual ~Rule() {} + + virtual bool evaluate(Transaction *transaction) = 0; virtual bool evaluate(Transaction *transaction, - std::shared_ptr rm); + std::shared_ptr rm) = 0; - void organizeActions(std::vector *actions); - void cleanUpActions(); - void executeAction(Transaction *trans, - bool containsBlock, std::shared_ptr ruleMessage, - actions::Action *a, bool context); + std::shared_ptr getFileName() const { + return m_fileName; + } - inline void executeTransformation(actions::Action *a, - std::shared_ptr *value, - Transaction *trans, - std::list, - std::shared_ptr>> *ret, - std::string *path, - int *nth); + int getLineNumber() const { + return m_lineNumber; + } - void getVariablesExceptions(Transaction *t, - variables::Variables *exclusion, variables::Variables *addition); - inline void getFinalVars(variables::Variables *vars, - variables::Variables *eclusion, Transaction *trans); - void executeActionsAfterFullMatch(Transaction *trasn, - bool containsDisruptive, std::shared_ptr ruleMessage); + int getPhase() const { return m_phase; } + void setPhase(int phase) { m_phase = phase; } - std::list, - std::shared_ptr>> executeDefaultTransformations( - Transaction *trasn, const std::string &value); - - bool executeOperatorAt(Transaction *trasn, std::string key, - std::string value, std::shared_ptr rm); - void executeActionsIndependentOfChainedRuleResult(Transaction *trasn, - bool *b, std::shared_ptr ruleMessage); - inline void updateMatchedVars(Transaction *trasn, const std::string &key, - const std::string &value); - inline void cleanMatchedVars(Transaction *trasn); - - std::vector getActionsByName(const std::string& name, - Transaction *t); - bool containsTag(const std::string& name, Transaction *t); - bool containsMsg(const std::string& name, Transaction *t); - - int refCountDecreaseAndCheck() { - m_referenceCount--; - if (m_referenceCount == 0) { - delete this; - return 1; + virtual std::string getReference() { + if (m_fileName) { + return *m_fileName + ":" + std::to_string(m_lineNumber); } - return 0; + return "<>:" + std::to_string(m_lineNumber); } - void refCountIncrease() { - m_referenceCount++; - } + virtual bool isMarker() { return false; } - void executeTransformations( - actions::Action *a, - std::shared_ptr newValue, - std::shared_ptr value, - Transaction *trans, - std::list, - std::shared_ptr>> *ret, - std::shared_ptr transStr, - int nth); - - actions::Action *m_theDisruptiveAction; - actions::LogData *m_logData; - actions::Msg *m_msg; - actions::Severity *m_severity; - bool m_chained; - bool m_containsCaptureAction; - bool m_containsMultiMatchAction; - bool m_containsStaticBlockAction; - bool m_secMarker; - int64_t m_ruleId; - int m_accuracy; - int m_lineNumber; - int m_maturity; - int m_phase; - modsecurity::variables::Variables *m_variables; - operators::Operator *m_op; - Rule *m_chainedRuleChild; - Rule *m_chainedRuleParent; - std::string m_fileName; - std::string m_marker; - std::string m_rev; - std::string m_ver; - std::vector m_actionsRuntimePos; - std::vector m_actionsRuntimePre; - std::vector m_actionsSetVar; - std::vector m_actionsTag; private: - bool m_unconditional; - int m_referenceCount; + std::shared_ptr m_fileName; + int m_lineNumber; + // FIXME: phase may not be neede to SecMarker. + int m_phase; }; diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rule_marker.h b/src/deps/src/ModSecurity/headers/modsecurity/rule_marker.h new file mode 100644 index 000000000..b8b835efd --- /dev/null +++ b/src/deps/src/ModSecurity/headers/modsecurity/rule_marker.h @@ -0,0 +1,91 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#endif + +#ifndef HEADERS_MODSECURITY_RULE_MARKER_H_ +#define HEADERS_MODSECURITY_RULE_MARKER_H_ + +#include "modsecurity/transaction.h" +#include "modsecurity/modsecurity.h" +#include "modsecurity/variable_value.h" +#include "modsecurity/rule.h" + +#ifdef __cplusplus + +namespace modsecurity { + + +class RuleMarker : public Rule { + public: + RuleMarker( + const std::string &name, + std::unique_ptr fileName, + int lineNumber) + : Rule(std::move(fileName), lineNumber), + m_name(std::make_shared(name)) { } + + RuleMarker(const RuleMarker& r) : + Rule(r), + m_name(r.m_name) + { } + + RuleMarker &operator =(const RuleMarker& r) { + Rule::operator = (r); + m_name = r.m_name; + return *this; + } + + virtual bool evaluate(Transaction *transaction, + std::shared_ptr rm) override { + return evaluate(transaction); + } + + virtual bool evaluate(Transaction *transaction) override { + if (transaction->isInsideAMarker()) { + if (*transaction->getCurrentMarker() == *m_name) { + transaction->removeMarker(); + // FIXME: Move this to .cc + // ms_dbg_a(transaction, 4, "Out of a SecMarker " + *m_name); + } + } + + return true; + }; + + + std::shared_ptr getName() { + return m_name; + } + + bool isMarker() override { return true; } + + private: + std::shared_ptr m_name; +}; + + +} // namespace modsecurity + +#endif + +#endif // HEADERS_MODSECURITY_RULE_MARKER_H_ diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rule_message.h b/src/deps/src/ModSecurity/headers/modsecurity/rule_message.h index 2362a6070..51eca0e8e 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/rule_message.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/rule_message.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -26,6 +26,7 @@ #include "modsecurity/transaction.h" #include "modsecurity/rule.h" +#include "modsecurity/rule_with_operator.h" #ifdef __cplusplus @@ -41,7 +42,13 @@ class RuleMessage { ClientLogMessageInfo = 4 }; - explicit RuleMessage(Rule *rule, Transaction *trans) : + /** + * + * FIXME: RuleMessage is currently too big, doing a lot of + * unnecessary data duplication. Needs to be shrink down. + * + */ + RuleMessage(RuleWithActions *rule, Transaction *trans) : m_accuracy(rule->m_accuracy), m_clientIpAddress(trans->m_clientIpAddress), m_data(""), @@ -51,50 +58,135 @@ class RuleMessage { m_maturity(rule->m_maturity), m_message(""), m_noAuditLog(false), - m_phase(rule->m_phase - 1), + m_phase(rule->getPhase() - 1), m_reference(""), m_rev(rule->m_rev), m_rule(rule), - m_ruleFile(rule->m_fileName), + m_ruleFile(rule->getFileName()), m_ruleId(rule->m_ruleId), - m_ruleLine(rule->m_lineNumber), + m_ruleLine(rule->getLineNumber()), m_saveMessage(true), m_serverIpAddress(trans->m_serverIpAddress), m_severity(0), m_uriNoQueryStringDecoded(trans->m_uri_no_query_string_decoded), - m_ver(rule->m_ver) + m_ver(rule->m_ver), + m_tags() { } + explicit RuleMessage(RuleMessage *rule) : + m_accuracy(rule->m_accuracy), + m_clientIpAddress(rule->m_clientIpAddress), + m_data(rule->m_data), + m_id(rule->m_id), + m_isDisruptive(rule->m_isDisruptive), + m_match(rule->m_match), + m_maturity(rule->m_maturity), + m_message(rule->m_message), + m_noAuditLog(rule->m_noAuditLog), + m_phase(rule->m_phase), + m_reference(rule->m_reference), + m_rev(rule->m_rev), + m_rule(rule->m_rule), + m_ruleFile(rule->m_ruleFile), + m_ruleId(rule->m_ruleId), + m_ruleLine(rule->m_ruleLine), + m_saveMessage(rule->m_saveMessage), + m_serverIpAddress(rule->m_serverIpAddress), + m_severity(rule->m_severity), + m_uriNoQueryStringDecoded(rule->m_uriNoQueryStringDecoded), + m_ver(rule->m_ver), + m_tags(rule->m_tags) + { } + + RuleMessage(const RuleMessage& ruleMessage) + : m_accuracy(ruleMessage.m_accuracy), + m_clientIpAddress(ruleMessage.m_clientIpAddress), + m_data(ruleMessage.m_data), + m_id(ruleMessage.m_id), + m_isDisruptive(ruleMessage.m_isDisruptive), + m_match(ruleMessage.m_match), + m_maturity(ruleMessage.m_maturity), + m_message(ruleMessage.m_message), + m_noAuditLog(ruleMessage.m_noAuditLog), + m_phase(ruleMessage.m_phase), + m_reference(ruleMessage.m_reference), + m_rev(ruleMessage.m_rev), + m_rule(ruleMessage.m_rule), + m_ruleFile(ruleMessage.m_ruleFile), + m_ruleId(ruleMessage.m_ruleId), + m_ruleLine(ruleMessage.m_ruleLine), + m_saveMessage(ruleMessage.m_saveMessage), + m_serverIpAddress(ruleMessage.m_serverIpAddress), + m_severity(ruleMessage.m_severity), + m_uriNoQueryStringDecoded(ruleMessage.m_uriNoQueryStringDecoded), + m_ver(ruleMessage.m_ver), + m_tags(ruleMessage.m_tags) + { } + + RuleMessage &operator=(const RuleMessage& ruleMessage) { + m_accuracy = ruleMessage.m_accuracy; + m_clientIpAddress = ruleMessage.m_clientIpAddress; + m_data = ruleMessage.m_data; + m_id = ruleMessage.m_id; + m_isDisruptive = ruleMessage.m_isDisruptive; + m_match = ruleMessage.m_match; + m_maturity = ruleMessage.m_maturity; + m_message = ruleMessage.m_message; + m_noAuditLog = ruleMessage.m_noAuditLog; + m_phase = ruleMessage.m_phase; + m_reference = ruleMessage.m_reference; + m_rev = ruleMessage.m_rev; + m_rule = ruleMessage.m_rule; + m_ruleFile = ruleMessage.m_ruleFile; + m_ruleId = ruleMessage.m_ruleId; + m_ruleLine = ruleMessage.m_ruleLine; + m_saveMessage = ruleMessage.m_saveMessage; + m_serverIpAddress = ruleMessage.m_serverIpAddress; + m_severity = ruleMessage.m_severity; + m_uriNoQueryStringDecoded = ruleMessage.m_uriNoQueryStringDecoded; + m_ver = ruleMessage.m_ver; + m_tags = ruleMessage.m_tags; + return *this; + } + + void clean() { + m_data = ""; + m_match = ""; + m_isDisruptive = false; + m_reference = ""; + m_severity = 0; + m_ver = ""; + } std::string log() { - return RuleMessage::log(this, 0); + return log(this, 0); } std::string log(int props) { - return RuleMessage::log(this, props); + return log(this, props); } std::string log(int props, int responseCode) { - return RuleMessage::log(this, props, responseCode); + return log(this, props, responseCode); } std::string errorLog() { - return RuleMessage::log(this, + return log(this, ClientLogMessageInfo | ErrorLogTailLogMessageInfo); } static std::string log(const RuleMessage *rm, int props, int code); static std::string log(const RuleMessage *rm, int props) { - return RuleMessage::log(rm, props, -1); + return log(rm, props, -1); } static std::string log(const RuleMessage *rm) { - return RuleMessage::log(rm, 0); + return log(rm, 0); } static std::string _details(const RuleMessage *rm); static std::string _errorLogTail(const RuleMessage *rm); int m_accuracy; - std::string m_clientIpAddress; + std::shared_ptr m_clientIpAddress; std::string m_data; - std::string m_id; + std::shared_ptr m_id; bool m_isDisruptive; std::string m_match; int m_maturity; @@ -103,14 +195,14 @@ class RuleMessage { int m_phase; std::string m_reference; std::string m_rev; - Rule *m_rule; - std::string m_ruleFile; + RuleWithActions *m_rule; + std::shared_ptr m_ruleFile; int m_ruleId; int m_ruleLine; bool m_saveMessage; - std::string m_serverIpAddress; + std::shared_ptr m_serverIpAddress; int m_severity; - std::string m_uriNoQueryStringDecoded; + std::shared_ptr m_uriNoQueryStringDecoded; std::string m_ver; std::list m_tags; diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rule_unconditional.h b/src/deps/src/ModSecurity/headers/modsecurity/rule_unconditional.h new file mode 100644 index 000000000..c66fa7c1e --- /dev/null +++ b/src/deps/src/ModSecurity/headers/modsecurity/rule_unconditional.h @@ -0,0 +1,68 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#endif + +#ifndef HEADERS_MODSECURITY_RULE_UNCONDITIONAL_H_ +#define HEADERS_MODSECURITY_RULE_UNCONDITIONAL_H_ + +#include "modsecurity/modsecurity.h" +#include "modsecurity/variable_value.h" +#include "modsecurity/rule.h" +#include "modsecurity/rules_set.h" +#include "modsecurity/rule_with_actions.h" +#include "modsecurity/actions/action.h" + +#ifdef __cplusplus + +namespace modsecurity { + + +class RuleUnconditional : public RuleWithActions { + public: + RuleUnconditional( + std::vector *actions, + Transformations *transformations, + std::unique_ptr fileName, + int lineNumber) + : RuleWithActions(actions, transformations, std::move(fileName), lineNumber) { } + + RuleUnconditional(const RuleUnconditional& r) + : RuleWithActions(r) + { } + + RuleUnconditional &operator=(const RuleUnconditional& r) { + RuleWithActions::operator = (r); + return *this; + } + + virtual bool evaluate(Transaction *transaction, std::shared_ptr ruleMessage) override; + + private: +}; + + +} // namespace modsecurity + +#endif + +#endif // HEADERS_MODSECURITY_RULE_UNCONDITIONAL_H_ diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rule_with_actions.h b/src/deps/src/ModSecurity/headers/modsecurity/rule_with_actions.h new file mode 100644 index 000000000..4b7db43f7 --- /dev/null +++ b/src/deps/src/ModSecurity/headers/modsecurity/rule_with_actions.h @@ -0,0 +1,191 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#endif + +#ifndef HEADERS_MODSECURITY_RULE_WITH_ACTIONS_H_ +#define HEADERS_MODSECURITY_RULE_WITH_ACTIONS_H_ + +#include "modsecurity/transaction.h" +#include "modsecurity/modsecurity.h" +#include "modsecurity/variable_value.h" +#include "modsecurity/rule.h" + +#ifdef __cplusplus + +namespace modsecurity { + + +class RuleWithActions : public Rule { + public: + RuleWithActions( + Actions *a, + Transformations *t, + std::unique_ptr fileName, + int lineNumber); + + ~RuleWithActions(); + + RuleWithActions(const RuleWithActions& r) + : Rule(r), + m_rev(r.m_rev), + m_ver(r.m_ver), + m_accuracy(r.m_accuracy), + m_maturity(r.m_maturity), + m_ruleId(r.m_ruleId), + m_chainedRuleChild(r.m_chainedRuleChild), + m_chainedRuleParent(r.m_chainedRuleParent), + m_disruptiveAction(r.m_disruptiveAction), + m_logData(r.m_logData), + m_msg(r.m_msg), + m_severity(r.m_severity), + m_actionsRuntimePos(r.m_actionsRuntimePos), + m_actionsSetVar(r.m_actionsSetVar), + m_actionsTag(r.m_actionsTag), + m_transformations(r.m_transformations), + m_containsCaptureAction(r.m_containsCaptureAction), + m_containsMultiMatchAction(r.m_containsMultiMatchAction), + m_containsStaticBlockAction(r.m_containsStaticBlockAction), + m_isChained(r.m_isChained) + { } + + RuleWithActions &operator=(const RuleWithActions& r) { + Rule::operator = (r); + m_rev = r.m_rev; + m_ver = r.m_ver; + m_accuracy = r.m_accuracy; + m_maturity = r.m_maturity; + m_ruleId = r.m_ruleId; + m_chainedRuleChild = r.m_chainedRuleChild; + m_chainedRuleParent = r.m_chainedRuleParent; + + m_disruptiveAction = r.m_disruptiveAction; + m_logData = r.m_logData; + m_msg = r.m_msg; + m_severity = r.m_severity; + m_actionsRuntimePos = r.m_actionsRuntimePos; + m_actionsSetVar = r.m_actionsSetVar; + m_actionsTag = r.m_actionsTag; + + m_transformations = r.m_transformations; + + m_containsCaptureAction = r.m_containsCaptureAction; + m_containsMultiMatchAction = r.m_containsMultiMatchAction; + m_containsStaticBlockAction = r.m_containsStaticBlockAction; + m_isChained = r.m_isChained; + + return *this; + } + + virtual bool evaluate(Transaction *transaction, std::shared_ptr ruleMessage) override; + + virtual bool evaluate(Transaction *transaction) override; + + + void executeActionsIndependentOfChainedRuleResult( + Transaction *trasn, + bool *containsDisruptive, + std::shared_ptr ruleMessage); + + void executeActionsAfterFullMatch( + Transaction *trasn, + bool containsDisruptive, + std::shared_ptr ruleMessage); + + void executeAction(Transaction *trans, + bool containsBlock, + std::shared_ptr ruleMessage, + actions::Action *a, + bool context); + + + void executeTransformations( + Transaction *trasn, const std::string &value, TransformationResults &ret); + + inline void executeTransformation( + actions::transformations::Transformation *a, + std::shared_ptr *value, + Transaction *trans, + TransformationResults *ret, + std::string *path, + int *nth) const; + + + void performLogging(Transaction *trans, + std::shared_ptr ruleMessage, + bool lastLog = true, + bool chainedParentNull = false); + + std::vector getActionsByName(const std::string& name, + Transaction *t); + bool containsTag(const std::string& name, Transaction *t); + bool containsMsg(const std::string& name, Transaction *t); + + inline bool isChained() const { return m_isChained == true; } + inline bool hasCaptureAction() const { return m_containsCaptureAction == true; } + inline void setChained(bool b) { m_isChained = b; } + inline bool hasDisruptiveAction() const { return m_disruptiveAction != NULL; } + inline bool hasBlockAction() const { return m_containsStaticBlockAction == true; } + inline bool hasMultimatch() const { return m_containsMultiMatchAction == true; } + + inline bool hasLogData() const { return m_logData != NULL; } + std::string logData(Transaction *t); + inline bool hasMsg() const { return m_msg != NULL; } + std::string msg(Transaction *t); + inline bool hasSeverity() const { return m_severity != NULL; } + int severity() const; + + std::string m_rev; + std::string m_ver; + int m_accuracy; + int m_maturity; + + + int64_t m_ruleId; + + std::shared_ptr m_chainedRuleChild; + RuleWithActions *m_chainedRuleParent; + + private: + /* actions */ + actions::Action *m_disruptiveAction; + actions::LogData *m_logData; + actions::Msg *m_msg; + actions::Severity *m_severity; + MatchActions m_actionsRuntimePos; + SetVars m_actionsSetVar; + Tags m_actionsTag; + + /* actions > transformations */ + Transformations m_transformations; + + bool m_containsCaptureAction:1; + bool m_containsMultiMatchAction:1; + bool m_containsStaticBlockAction:1; + bool m_isChained:1; +}; + +} // namespace modsecurity +#endif + + +#endif // HEADERS_MODSECURITY_RULE_WITH_ACTIONS_H_ \ No newline at end of file diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rule_with_operator.h b/src/deps/src/ModSecurity/headers/modsecurity/rule_with_operator.h new file mode 100644 index 000000000..e2fea4e6a --- /dev/null +++ b/src/deps/src/ModSecurity/headers/modsecurity/rule_with_operator.h @@ -0,0 +1,82 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#endif + +#ifndef HEADERS_MODSECURITY_RULE_WITH_OPERATOR_H_ +#define HEADERS_MODSECURITY_RULE_WITH_OPERATOR_H_ + +#include "modsecurity/transaction.h" +#include "modsecurity/modsecurity.h" +#include "modsecurity/variable_value.h" +#include "modsecurity/rule.h" +#include "modsecurity/rule_with_actions.h" + +#ifdef __cplusplus + +namespace modsecurity { + + +class RuleWithOperator : public RuleWithActions { + public: + RuleWithOperator(operators::Operator *op, + variables::Variables *variables, + std::vector *actions, + Transformations *transformations, + std::unique_ptr fileName, + int lineNumber); + + virtual ~RuleWithOperator(); + + bool evaluate(Transaction *transaction, + std::shared_ptr rm) override; + + void getVariablesExceptions(Transaction *t, + variables::Variables *exclusion, variables::Variables *addition); + inline void getFinalVars(variables::Variables *vars, + variables::Variables *eclusion, Transaction *trans); + + bool executeOperatorAt(Transaction *trasn, const std::string &key, + const std::string &value, std::shared_ptr rm); + + static void updateMatchedVars(Transaction *trasn, const std::string &key, + const std::string &value); + static void cleanMatchedVars(Transaction *trasn); + + + std::string getOperatorName() const; + + virtual std::string getReference() override { + return std::to_string(m_ruleId); + } + + private: + modsecurity::variables::Variables *m_variables; + operators::Operator *m_operator; +}; + + +} // namespace modsecurity +#endif + + +#endif // HEADERS_MODSECURITY_RULE_WITH_OPERATOR_H_ diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rules.h b/src/deps/src/ModSecurity/headers/modsecurity/rules.h index d78b77087..1aaa65b54 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/rules.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/rules.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,6 +13,7 @@ * */ + #include #include @@ -22,92 +23,74 @@ #include #include #include +#include #endif +#include "modsecurity/rule.h" +#include "modsecurity/rule_with_operator.h" +#include "modsecurity/rule_with_actions.h" #ifndef HEADERS_MODSECURITY_RULES_H_ #define HEADERS_MODSECURITY_RULES_H_ -#include "modsecurity/rules_properties.h" -#include "modsecurity/modsecurity.h" -#include "modsecurity/transaction.h" #ifdef __cplusplus - namespace modsecurity { -class Rule; -namespace Parser { -class Driver; -} -/** @ingroup ModSecurity_CPP_API */ -class Rules : public RulesProperties { +class Rules { public: - Rules() - : RulesProperties(new DebugLog()), - unicode_codepage(0), -#ifndef NO_LOGS - m_secmarker_skipped(0), -#endif - m_referenceCount(0) { } + void dump() const { + for (int j = 0; j < m_rules.size(); j++) { + std::cout << " Rule ID: " << m_rules.at(j)->getReference(); + std::cout << "--" << m_rules.at(j) << std::endl; + } + } - explicit Rules(DebugLog *customLog) - : RulesProperties(customLog), - unicode_codepage(0), -#ifndef NO_LOGS - m_secmarker_skipped(0), -#endif - m_referenceCount(0) { } + int append(Rules *from, const std::vector &ids, std::ostringstream *err) { + size_t j = 0; + for (; j < from->size(); j++) { + RuleWithOperator *rule = dynamic_cast(from->at(j).get()); + if (rule && std::binary_search(ids.begin(), ids.end(), rule->m_ruleId)) { + if (err != NULL) { + *err << "Rule id: " << std::to_string(rule->m_ruleId) \ + << " is duplicated" << std::endl; + } + return -1; + } + } + m_rules.insert(m_rules.end(), from->m_rules.begin(), from->m_rules.end()); + return j; + } - ~Rules() { } + bool insert(const std::shared_ptr &rule) { + return insert(rule, nullptr, nullptr); + } - void incrementReferenceCount(void); - void decrementReferenceCount(void); + bool insert(std::shared_ptr rule, const std::vector *ids, std::ostringstream *err) { + RuleWithOperator *r = dynamic_cast(rule.get()); + if (r && ids != nullptr && std::binary_search(ids->begin(), ids->end(), r->m_ruleId)) { + if (err != nullptr) { + *err << "Rule id: " << std::to_string(r->m_ruleId) \ + << " is duplicated" << std::endl; + } + return false; + } + m_rules.push_back(rule); + return true; + } - int loadFromUri(const char *uri); - int loadRemote(const char *key, const char *uri); - int load(const char *rules); - int load(const char *rules, const std::string &ref); + size_t size() const { return m_rules.size(); } + std::shared_ptr operator[](int index) const { return m_rules[index]; } + std::shared_ptr at(int index) const { return m_rules[index]; } - void dump(); - - int merge(Parser::Driver *driver); - int merge(Rules *rules); - - int evaluate(int phase, Transaction *transaction); - std::string getParserError(); - - void debug(int level, const std::string &id, const std::string &uri, - const std::string &msg); - - int64_t unicode_codepage; - - private: - int m_referenceCount; -#ifndef NO_LOGS - uint8_t m_secmarker_skipped; -#endif + std::vector > m_rules; }; -#endif -#ifdef __cplusplus -extern "C" { -#endif - -Rules *msc_create_rules_set(void); -void msc_rules_dump(Rules *rules); -int msc_rules_merge(Rules *rules_dst, Rules *rules_from, const char **error); -int msc_rules_add_remote(Rules *rules, const char *key, const char *uri, - const char **error); -int msc_rules_add_file(Rules *rules, const char *file, const char **error); -int msc_rules_add(Rules *rules, const char *plain_rules, const char **error); -int msc_rules_cleanup(Rules *rules); - -#ifdef __cplusplus -} } // namespace modsecurity #endif + #endif // HEADERS_MODSECURITY_RULES_H_ + diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rules_exceptions.h b/src/deps/src/ModSecurity/headers/modsecurity/rules_exceptions.h index 2df2fef34..8d513e76d 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/rules_exceptions.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/rules_exceptions.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rules_properties.h b/src/deps/src/ModSecurity/headers/modsecurity/rules_properties.h index c43578faa..fbde08d2f 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/rules_properties.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/rules_properties.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,549 +13,6 @@ * */ +#include -#ifdef __cplusplus -#include -#include -#include -#include -#include -#include -#include -#endif - -#ifndef HEADERS_MODSECURITY_RULES_PROPERTIES_H_ -#define HEADERS_MODSECURITY_RULES_PROPERTIES_H_ - - -#include "modsecurity/modsecurity.h" -#include "modsecurity/rule.h" -#include "modsecurity/rules_exceptions.h" -#include "modsecurity/actions/action.h" -#include "modsecurity/audit_log.h" - -#define CODEPAGE_SEPARATORS " \t\n\r" - -#define merge_boolean_value(to, from, default) \ - if (to == PropertyNotSetConfigBoolean) { \ - to = (from == PropertyNotSetConfigBoolean) ? default : from; \ - } - -#define merge_ruleengine_value(to, from, default) \ - if (to == PropertyNotSetRuleEngine) { \ - to = (from == PropertyNotSetRuleEngine) ? default : from; \ - } - -#define merge_bodylimitaction_value(to, from, default) \ - if (to == PropertyNotSetBodyLimitAction) { \ - to = (from == PropertyNotSetBodyLimitAction) ? default : from; \ - } - -#ifdef __cplusplus - -namespace modsecurity { -class RulesExceptions; -namespace Parser { -class Driver; -} - -using modsecurity::debug_log::DebugLog; -using modsecurity::audit_log::AuditLog; - -/** @ingroup ModSecurity_CPP_API */ -class ConfigInt { - public: - ConfigInt() : m_set(false), m_value(0) { } - bool m_set; - int m_value; - - void merge(ConfigInt *from) { - if (m_set == true || from->m_set == false) { - return; - } - m_set = true; - m_value = from->m_value; - return; - } -}; - - -class ConfigDouble { - public: - ConfigDouble() : m_set(false), m_value(0) { } - bool m_set; - double m_value; - - void merge(ConfigDouble *from) { - if (m_set == true || from->m_set == false) { - return; - } - m_set = true; - m_value = from->m_value; - return; - } -}; - - -class ConfigString { - public: - ConfigString() : m_set(false), m_value("") { } - bool m_set; - std::string m_value; - - void merge(ConfigString *from) { - if (m_set == true || from->m_set == false) { - return; - } - m_set = true; - m_value = from->m_value; - return; - } -}; - - -class ConfigSet { - public: - ConfigSet() : m_set(false), m_clear(false) { } - bool m_set; - bool m_clear; - std::set m_value; -}; - - -class UnicodeMapHolder { - public: - UnicodeMapHolder() { - memset(m_data, -1, (sizeof(int)*65536)); - }; - - int& operator[](int index) { return m_data[index]; } - int operator[](int index) const { return m_data[index]; } - - int at(int index) const { return m_data[index]; } - void change(int i, int a) { m_data[i] = a; } - - int m_data[65536]; -}; - - -class RulesProperties; -class ConfigUnicodeMap { - public: - ConfigUnicodeMap() : m_set(false), - m_unicodeCodePage(0), - m_unicodeMapTable(NULL) { } - - static void loadConfig(std::string f, double codePage, - RulesProperties *driver, std::string *errg); - - void merge(ConfigUnicodeMap *from) { - if (from->m_set == false) { - return; - } - - m_set = true; - m_unicodeCodePage = from->m_unicodeCodePage; - m_unicodeMapTable = from->m_unicodeMapTable; - - return; - } - - bool m_set; - double m_unicodeCodePage; - std::shared_ptr m_unicodeMapTable; -}; - - -class RulesProperties { - public: - RulesProperties() : - m_auditLog(new AuditLog()), - m_requestBodyLimitAction(PropertyNotSetBodyLimitAction), - m_responseBodyLimitAction(PropertyNotSetBodyLimitAction), - m_secRequestBodyAccess(PropertyNotSetConfigBoolean), - m_secResponseBodyAccess(PropertyNotSetConfigBoolean), - m_secXMLExternalEntity(PropertyNotSetConfigBoolean), - m_tmpSaveUploadedFiles(PropertyNotSetConfigBoolean), - m_uploadKeepFiles(PropertyNotSetConfigBoolean), - m_debugLog(new DebugLog()), - m_remoteRulesActionOnFailed(PropertyNotSetRemoteRulesAction), - m_secRuleEngine(PropertyNotSetRuleEngine) { } - - - explicit RulesProperties(DebugLog *debugLog) : - m_auditLog(new AuditLog()), - m_requestBodyLimitAction(PropertyNotSetBodyLimitAction), - m_responseBodyLimitAction(PropertyNotSetBodyLimitAction), - m_secRequestBodyAccess(PropertyNotSetConfigBoolean), - m_secResponseBodyAccess(PropertyNotSetConfigBoolean), - m_secXMLExternalEntity(PropertyNotSetConfigBoolean), - m_tmpSaveUploadedFiles(PropertyNotSetConfigBoolean), - m_uploadKeepFiles(PropertyNotSetConfigBoolean), - m_debugLog(debugLog), - m_remoteRulesActionOnFailed(PropertyNotSetRemoteRulesAction), - m_secRuleEngine(PropertyNotSetRuleEngine) { } - - - ~RulesProperties() { - int i = 0; - /** Cleanup the rules */ - for (i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { - std::vector rules = m_rules[i]; - while (rules.empty() == false) { - Rule *rule = rules.back(); - rules.pop_back(); - if (rule->refCountDecreaseAndCheck()) { - rule = NULL; - } - } - } - for (i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { - std::vector *tmp = &m_defaultActions[i]; - while (tmp->empty() == false) { - actions::Action *a = tmp->back(); - tmp->pop_back(); - if (a->refCountDecreaseAndCheck()) { - a = NULL; - } - } - } - - delete m_debugLog; - delete m_auditLog; - } - - - /** - * - * - */ - enum ConfigBoolean { - TrueConfigBoolean, - FalseConfigBoolean, - PropertyNotSetConfigBoolean - }; - - - /** - * - * The RuleEngine enumerator consists in mapping the different states - * of the rule engine. - * - */ - enum RuleEngine { - /** - * - * Rules won't be evaluated if Rule Engine is set to DisabledRuleEngine - * - */ - DisabledRuleEngine, - /** - * - * Rules will be evaluated and disturb actions will take place if needed. - * - */ - EnabledRuleEngine, - /** - * Rules will be evaluated but it won't generate any disruptive action. - * - */ - DetectionOnlyRuleEngine, - /** - * - */ - PropertyNotSetRuleEngine - }; - - - /** - * - * Defines what actions should be taken in case the body (response or - * request) is bigger than the expected size. - * - */ - enum BodyLimitAction { - /** - * - * Process partial - * - */ - ProcessPartialBodyLimitAction, - /** - * - * Reject the request - * - */ - RejectBodyLimitAction, - /** - * - */ - PropertyNotSetBodyLimitAction - }; - - - /** - * - * Defines what actions should be taken in case the remote rules failed to - * be downloaded (independent of the circumstances) - * - * - */ - enum OnFailedRemoteRulesAction { - /** - * - * Abort - * - */ - AbortOnFailedRemoteRulesAction, - /** - * - * Warn on logging - * - */ - WarnOnFailedRemoteRulesAction, - /** - * - */ - PropertyNotSetRemoteRulesAction - }; - - - static const char *ruleEngineStateString(RuleEngine i) { - switch (i) { - case DisabledRuleEngine: - return "Disabled"; - case EnabledRuleEngine: - return "Enabled"; - case DetectionOnlyRuleEngine: - return "DetectionOnly"; - case PropertyNotSetRuleEngine: - return "PropertyNotSet/DetectionOnly"; - } - return NULL; - } - - - static std::string configBooleanString(ConfigBoolean i) { - switch (i) { - case TrueConfigBoolean: - return "True"; - case FalseConfigBoolean: - return "False"; - case PropertyNotSetConfigBoolean: - return "Not set"; - } - return NULL; - } - - - static int mergeProperties(RulesProperties *from, RulesProperties *to, - std::ostringstream *err) { - int amount_of_rules = 0; - - amount_of_rules = appendRules(from->m_rules, to->m_rules, err); - if (amount_of_rules < 0) { - return amount_of_rules; - } - - merge_ruleengine_value(to->m_secRuleEngine, from->m_secRuleEngine, - PropertyNotSetRuleEngine); - - merge_boolean_value(to->m_secRequestBodyAccess, - from->m_secRequestBodyAccess, - PropertyNotSetConfigBoolean); - - merge_boolean_value(to->m_secResponseBodyAccess, - from->m_secResponseBodyAccess, - PropertyNotSetConfigBoolean); - - merge_boolean_value(to->m_secXMLExternalEntity, - from->m_secXMLExternalEntity, - PropertyNotSetConfigBoolean); - - merge_boolean_value(to->m_uploadKeepFiles, - from->m_uploadKeepFiles, - PropertyNotSetConfigBoolean); - - merge_boolean_value(to->m_tmpSaveUploadedFiles, - from->m_tmpSaveUploadedFiles, - PropertyNotSetConfigBoolean); - - to->m_requestBodyLimit.merge(&from->m_requestBodyLimit); - to->m_responseBodyLimit.merge(&from->m_responseBodyLimit); - - merge_bodylimitaction_value(to->m_requestBodyLimitAction, - from->m_requestBodyLimitAction, - PropertyNotSetBodyLimitAction); - - merge_bodylimitaction_value(to->m_responseBodyLimitAction, - from->m_responseBodyLimitAction, - PropertyNotSetBodyLimitAction); - - to->m_uploadFileLimit.merge(&from->m_uploadFileLimit); - to->m_uploadFileMode.merge(&from->m_uploadFileMode); - to->m_uploadDirectory.merge(&from->m_uploadDirectory); - to->m_uploadTmpDirectory.merge(&from->m_uploadTmpDirectory); - - to->m_secArgumentSeparator.merge(&from->m_secArgumentSeparator); - - to->m_secWebAppId.merge(&from->m_secWebAppId); - - to->m_unicodeMapTable.merge(&from->m_unicodeMapTable); - - to->m_httpblKey.merge(&from->m_httpblKey); - - to->m_exceptions.merge(&from->m_exceptions); - - to->m_components.insert(to->m_components.end(), - from->m_components.begin(), from->m_components.end()); - - if (from->m_responseBodyTypeToBeInspected.m_set == true) { - if (from->m_responseBodyTypeToBeInspected.m_clear == true) { - to->m_responseBodyTypeToBeInspected.m_value.clear(); - from->m_responseBodyTypeToBeInspected.m_value.clear(); - } else { - for (std::set::iterator - it = from->m_responseBodyTypeToBeInspected.m_value.begin(); - it != from->m_responseBodyTypeToBeInspected.m_value.end(); - ++it) { - to->m_responseBodyTypeToBeInspected.m_value.insert(*it); - } - } - to->m_responseBodyTypeToBeInspected.m_set = true; - } - - for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { - std::vector *actions_from = \ - from->m_defaultActions+i; - std::vector *actions_to = to->m_defaultActions+i; - for (size_t j = 0; j < actions_from->size(); j++) { - actions::Action *action = actions_from->at(j); - action->refCountIncrease(); - actions_to->push_back(action); - } - } - - if (to->m_auditLog) { - std::string error; - to->m_auditLog->merge(from->m_auditLog, &error); - if (error.size() > 0) { - *err << error; - return -1; - } - } - - if (from->m_debugLog && to->m_debugLog && - from->m_debugLog->isLogFileSet()) { - if (to->m_debugLog->isLogFileSet() == false) { - std::string error; - to->m_debugLog->setDebugLogFile( - from->m_debugLog->getDebugLogFile(), - &error); - if (error.size() > 0) { - *err << error; - return -1; - } - } - } - - if (from->m_debugLog && to->m_debugLog && - from->m_debugLog->isLogLevelSet()) { - if (to->m_debugLog->isLogLevelSet() == false) { - to->m_debugLog->setDebugLogLevel( - from->m_debugLog->getDebugLogLevel()); - } - } - - return amount_of_rules; - } - - - static int appendRules( - std::vector *from, - std::vector *to, - std::ostringstream *err) { - int amount_of_rules = 0; - // TODO: std::vector could be replaced with something more efficient. - std::vector v; - for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { - std::vector *rules_to = to+i; - v.reserve(rules_to->size()); - for (size_t z = 0; z < rules_to->size(); z++) { - Rule *rule_ckc = rules_to->at(z); - if (rule_ckc->m_secMarker == true) { - continue; - } - v.push_back(rule_ckc->m_ruleId); - } - } - std::sort (v.begin(), v.end()); - - for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { - std::vector *rules_from = from+i; - std::vector *rules_to = to+i; - for (size_t j = 0; j < rules_from->size(); j++) { - Rule *rule = rules_from->at(j); - if (std::binary_search(v.begin(), v.end(), rule->m_ruleId)) { - if (err != NULL) { - *err << "Rule id: " << std::to_string(rule->m_ruleId) \ - << " is duplicated" << std::endl; - } - return -1; - } - amount_of_rules++; - rule->refCountIncrease(); - rules_to->push_back(rule); - } - } - return amount_of_rules; - } - - - std::vector *getRulesForPhase(int phase) { - if (phase >= modsecurity::Phases::NUMBER_OF_PHASES) { - return NULL; - } - return &m_rules[phase]; - } - - - audit_log::AuditLog *m_auditLog; - BodyLimitAction m_requestBodyLimitAction; - BodyLimitAction m_responseBodyLimitAction; - ConfigBoolean m_secRequestBodyAccess; - ConfigBoolean m_secResponseBodyAccess; - ConfigBoolean m_secXMLExternalEntity; - ConfigBoolean m_tmpSaveUploadedFiles; - ConfigBoolean m_uploadKeepFiles; - ConfigDouble m_requestBodyLimit; - ConfigDouble m_requestBodyNoFilesLimit; - ConfigDouble m_responseBodyLimit; - ConfigInt m_uploadFileLimit; - ConfigInt m_uploadFileMode; - DebugLog *m_debugLog; - OnFailedRemoteRulesAction m_remoteRulesActionOnFailed; - RuleEngine m_secRuleEngine; - RulesExceptions m_exceptions; - std::list m_components; - std::ostringstream m_parserError; - ConfigSet m_responseBodyTypeToBeInspected; - ConfigString m_httpblKey; - ConfigString m_uploadDirectory; - ConfigString m_uploadTmpDirectory; - ConfigString m_secArgumentSeparator; - ConfigString m_secWebAppId; - std::vector m_defaultActions[modsecurity::Phases::NUMBER_OF_PHASES]; - std::vector m_rules[modsecurity::Phases::NUMBER_OF_PHASES]; - ConfigUnicodeMap m_unicodeMapTable; -}; - - -#endif - -#ifdef __cplusplus -} // namespace modsecurity -#endif - -#endif // HEADERS_MODSECURITY_RULES_PROPERTIES_H_ diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rules_set.h b/src/deps/src/ModSecurity/headers/modsecurity/rules_set.h new file mode 100644 index 000000000..4af55f405 --- /dev/null +++ b/src/deps/src/ModSecurity/headers/modsecurity/rules_set.h @@ -0,0 +1,109 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include +#include + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#endif + + +#ifndef HEADERS_MODSECURITY_RULES_SET_H_ +#define HEADERS_MODSECURITY_RULES_SET_H_ + +#include "modsecurity/rules_set_properties.h" +#include "modsecurity/modsecurity.h" +#include "modsecurity/transaction.h" +#include "modsecurity/rule.h" +#include "modsecurity/rules_set_phases.h" + +#ifdef __cplusplus + +namespace modsecurity { +class RuleWithOperator; +namespace Parser { +class Driver; +} + + + +/** @ingroup ModSecurity_CPP_API */ +class RulesSet : public RulesSetProperties { + public: + RulesSet() + : RulesSetProperties(new DebugLog()) +#ifndef NO_LOGS + ,m_secmarker_skipped(0) +#endif + { } + + explicit RulesSet(DebugLog *customLog) + : RulesSetProperties(customLog) +#ifndef NO_LOGS + ,m_secmarker_skipped(0) +#endif + { } + + ~RulesSet() { } + + int loadFromUri(const char *uri); + int loadRemote(const char *key, const char *uri); + int load(const char *rules); + int load(const char *rules, const std::string &ref); + + void dump() const; + + int merge(Parser::Driver *driver); + int merge(RulesSet *rules); + + int evaluate(int phase, Transaction *transaction); + std::string getParserError(); + + void debug(int level, const std::string &id, const std::string &uri, + const std::string &msg); + + RulesSetPhases m_rulesSetPhases; + private: +#ifndef NO_LOGS + uint8_t m_secmarker_skipped; +#endif +}; + +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +RulesSet *msc_create_rules_set(void); +void msc_rules_dump(RulesSet *rules); +int msc_rules_merge(RulesSet *rules_dst, RulesSet *rules_from, const char **error); +int msc_rules_add_remote(RulesSet *rules, const char *key, const char *uri, + const char **error); +int msc_rules_add_file(RulesSet *rules, const char *file, const char **error); +int msc_rules_add(RulesSet *rules, const char *plain_rules, const char **error); +int msc_rules_cleanup(RulesSet *rules); + +#ifdef __cplusplus +} +} // namespace modsecurity +#endif + +#endif // HEADERS_MODSECURITY_RULES_SET_H_ diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rules_set_phases.h b/src/deps/src/ModSecurity/headers/modsecurity/rules_set_phases.h new file mode 100644 index 000000000..849d8ec1b --- /dev/null +++ b/src/deps/src/ModSecurity/headers/modsecurity/rules_set_phases.h @@ -0,0 +1,63 @@ + +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include +#include + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#endif + + +#ifndef HEADERS_MODSECURITY_RULES_SET_PHASES_H_ +#define HEADERS_MODSECURITY_RULES_SET_PHASES_H_ + +#include "modsecurity/rules.h" + +#ifdef __cplusplus + +namespace modsecurity { +class RuleWithOperator; +namespace Parser { +class Driver; +} + +/** @ingroup ModSecurity_CPP_API */ +class RulesSetPhases { + public: + + bool insert(std::shared_ptr rule); + + int append(RulesSetPhases *from, std::ostringstream *err); + void dump() const; + + Rules *operator[](int index) { return &m_rulesAtPhase[index]; } + Rules *at(int index) { return &m_rulesAtPhase[index]; } + + private: + Rules m_rulesAtPhase[8]; + +}; + + +} // namespace modsecurity +#endif + +#endif // HEADERS_MODSECURITY_RULES_SET_PHASES_H_ \ No newline at end of file diff --git a/src/deps/src/ModSecurity/headers/modsecurity/rules_set_properties.h b/src/deps/src/ModSecurity/headers/modsecurity/rules_set_properties.h new file mode 100644 index 000000000..00cf9ee3c --- /dev/null +++ b/src/deps/src/ModSecurity/headers/modsecurity/rules_set_properties.h @@ -0,0 +1,499 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#include +#endif + + +#ifndef HEADERS_MODSECURITY_RULES_SET_PROPERTIES_H_ +#define HEADERS_MODSECURITY_RULES_SET_PROPERTIES_H_ + + +#include "modsecurity/modsecurity.h" +#include "modsecurity/rule.h" +#include "modsecurity/rules_exceptions.h" +#include "modsecurity/actions/action.h" +#include "modsecurity/audit_log.h" + +#define CODEPAGE_SEPARATORS " \t\n\r" + +#define merge_boolean_value(to, from, default) \ + if (to == PropertyNotSetConfigBoolean) { \ + to = (from == PropertyNotSetConfigBoolean) ? default : from; \ + } + +#define merge_ruleengine_value(to, from, default) \ + if (to == PropertyNotSetRuleEngine) { \ + to = (from == PropertyNotSetRuleEngine) ? default : from; \ + } + +#define merge_bodylimitaction_value(to, from, default) \ + if (to == PropertyNotSetBodyLimitAction) { \ + to = (from == PropertyNotSetBodyLimitAction) ? default : from; \ + } + +#ifdef __cplusplus + +namespace modsecurity { +class RulesExceptions; +namespace Parser { +class Driver; +} + +using modsecurity::debug_log::DebugLog; +using modsecurity::audit_log::AuditLog; + +/** @ingroup ModSecurity_CPP_API */ +class ConfigInt { + public: + ConfigInt() : m_set(false), m_value(0) { } + bool m_set; + int m_value; + + void merge(ConfigInt *from) { + if (m_set == true || from->m_set == false) { + return; + } + m_set = true; + m_value = from->m_value; + return; + } +}; + + +class ConfigDouble { + public: + ConfigDouble() : m_set(false), m_value(0) { } + bool m_set; + double m_value; + + void merge(ConfigDouble *from) { + if (m_set == true || from->m_set == false) { + return; + } + m_set = true; + m_value = from->m_value; + return; + } +}; + + +class ConfigString { + public: + ConfigString() : m_set(false), m_value("") { } + bool m_set; + std::string m_value; + + void merge(ConfigString *from) { + if (m_set == true || from->m_set == false) { + return; + } + m_set = true; + m_value = from->m_value; + return; + } +}; + + +class ConfigSet { + public: + ConfigSet() : m_set(false), m_clear(false) { } + bool m_set; + bool m_clear; + std::set m_value; +}; + + +class UnicodeMapHolder { + public: + UnicodeMapHolder() { + memset(m_data, -1, (sizeof(int)*65536)); + }; + + int& operator[](int index) { return m_data[index]; } + int operator[](int index) const { return m_data[index]; } + + int at(int index) const { return m_data[index]; } + void change(int i, int a) { m_data[i] = a; } + + int m_data[65536]; +}; + + +class RulesSetProperties; +class ConfigUnicodeMap { + public: + ConfigUnicodeMap() : m_set(false), + m_unicodeCodePage(0), + m_unicodeMapTable(NULL) { } + + static void loadConfig(std::string f, double codePage, + RulesSetProperties *driver, std::string *errg); + + void merge(ConfigUnicodeMap *from) { + if (from->m_set == false) { + return; + } + + m_set = true; + m_unicodeCodePage = from->m_unicodeCodePage; + m_unicodeMapTable = from->m_unicodeMapTable; + + return; + } + + bool m_set; + double m_unicodeCodePage; + std::shared_ptr m_unicodeMapTable; +}; + + +class RulesSetProperties { + public: + RulesSetProperties() : + m_auditLog(new AuditLog()), + m_requestBodyLimitAction(PropertyNotSetBodyLimitAction), + m_responseBodyLimitAction(PropertyNotSetBodyLimitAction), + m_secRequestBodyAccess(PropertyNotSetConfigBoolean), + m_secResponseBodyAccess(PropertyNotSetConfigBoolean), + m_secXMLExternalEntity(PropertyNotSetConfigBoolean), + m_tmpSaveUploadedFiles(PropertyNotSetConfigBoolean), + m_uploadKeepFiles(PropertyNotSetConfigBoolean), + m_debugLog(new DebugLog()), + m_remoteRulesActionOnFailed(PropertyNotSetRemoteRulesAction), + m_secRuleEngine(PropertyNotSetRuleEngine) { } + + + explicit RulesSetProperties(DebugLog *debugLog) : + m_auditLog(new AuditLog()), + m_requestBodyLimitAction(PropertyNotSetBodyLimitAction), + m_responseBodyLimitAction(PropertyNotSetBodyLimitAction), + m_secRequestBodyAccess(PropertyNotSetConfigBoolean), + m_secResponseBodyAccess(PropertyNotSetConfigBoolean), + m_secXMLExternalEntity(PropertyNotSetConfigBoolean), + m_tmpSaveUploadedFiles(PropertyNotSetConfigBoolean), + m_uploadKeepFiles(PropertyNotSetConfigBoolean), + m_debugLog(debugLog), + m_remoteRulesActionOnFailed(PropertyNotSetRemoteRulesAction), + m_secRuleEngine(PropertyNotSetRuleEngine) { } + + RulesSetProperties(const RulesSetProperties &r) = delete; + RulesSetProperties &operator =(const RulesSetProperties &r) = delete; + + ~RulesSetProperties() { + int i = 0; + + for (i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { + std::vector > *tmp = \ + &m_defaultActions[i]; + while (tmp->empty() == false) { + tmp->pop_back(); + } + } + + delete m_debugLog; + delete m_auditLog; + } + + + /** + * + * + */ + enum ConfigBoolean { + TrueConfigBoolean, + FalseConfigBoolean, + PropertyNotSetConfigBoolean + }; + + + /** + * + * The RuleEngine enumerator consists in mapping the different states + * of the rule engine. + * + */ + enum RuleEngine { + /** + * + * Rules won't be evaluated if Rule Engine is set to DisabledRuleEngine + * + */ + DisabledRuleEngine, + /** + * + * Rules will be evaluated and disturb actions will take place if needed. + * + */ + EnabledRuleEngine, + /** + * Rules will be evaluated but it won't generate any disruptive action. + * + */ + DetectionOnlyRuleEngine, + /** + * + */ + PropertyNotSetRuleEngine + }; + + + /** + * + * Defines what actions should be taken in case the body (response or + * request) is bigger than the expected size. + * + */ + enum BodyLimitAction { + /** + * + * Process partial + * + */ + ProcessPartialBodyLimitAction, + /** + * + * Reject the request + * + */ + RejectBodyLimitAction, + /** + * + */ + PropertyNotSetBodyLimitAction + }; + + + /** + * + * Defines what actions should be taken in case the remote rules failed to + * be downloaded (independent of the circumstances) + * + * + */ + enum OnFailedRemoteRulesAction { + /** + * + * Abort + * + */ + AbortOnFailedRemoteRulesAction, + /** + * + * Warn on logging + * + */ + WarnOnFailedRemoteRulesAction, + /** + * + */ + PropertyNotSetRemoteRulesAction + }; + + + static const char *ruleEngineStateString(RuleEngine i) { + switch (i) { + case DisabledRuleEngine: + return "Disabled"; + case EnabledRuleEngine: + return "Enabled"; + case DetectionOnlyRuleEngine: + return "DetectionOnly"; + case PropertyNotSetRuleEngine: + return "PropertyNotSet/DetectionOnly"; + } + return NULL; + } + + + static std::string configBooleanString(ConfigBoolean i) { + switch (i) { + case TrueConfigBoolean: + return "True"; + case FalseConfigBoolean: + return "False"; + case PropertyNotSetConfigBoolean: + return "Not set"; + } + return NULL; + } + + + static int mergeProperties(RulesSetProperties *from, + RulesSetProperties *to, std::ostringstream *err) { + + merge_ruleengine_value(to->m_secRuleEngine, from->m_secRuleEngine, + PropertyNotSetRuleEngine); + + merge_boolean_value(to->m_secRequestBodyAccess, + from->m_secRequestBodyAccess, + PropertyNotSetConfigBoolean); + + merge_boolean_value(to->m_secResponseBodyAccess, + from->m_secResponseBodyAccess, + PropertyNotSetConfigBoolean); + + merge_boolean_value(to->m_secXMLExternalEntity, + from->m_secXMLExternalEntity, + PropertyNotSetConfigBoolean); + + merge_boolean_value(to->m_uploadKeepFiles, + from->m_uploadKeepFiles, + PropertyNotSetConfigBoolean); + + merge_boolean_value(to->m_tmpSaveUploadedFiles, + from->m_tmpSaveUploadedFiles, + PropertyNotSetConfigBoolean); + + to->m_argumentsLimit.merge(&from->m_argumentsLimit); + to->m_requestBodyJsonDepthLimit.merge(&from->m_requestBodyJsonDepthLimit); + to->m_requestBodyLimit.merge(&from->m_requestBodyLimit); + to->m_requestBodyNoFilesLimit.merge(&from->m_requestBodyNoFilesLimit); + to->m_responseBodyLimit.merge(&from->m_responseBodyLimit); + + merge_bodylimitaction_value(to->m_requestBodyLimitAction, + from->m_requestBodyLimitAction, + PropertyNotSetBodyLimitAction); + + merge_bodylimitaction_value(to->m_responseBodyLimitAction, + from->m_responseBodyLimitAction, + PropertyNotSetBodyLimitAction); + + to->m_uploadFileLimit.merge(&from->m_uploadFileLimit); + to->m_uploadFileMode.merge(&from->m_uploadFileMode); + to->m_uploadDirectory.merge(&from->m_uploadDirectory); + to->m_uploadTmpDirectory.merge(&from->m_uploadTmpDirectory); + + to->m_secArgumentSeparator.merge(&from->m_secArgumentSeparator); + + to->m_secWebAppId.merge(&from->m_secWebAppId); + + to->m_unicodeMapTable.merge(&from->m_unicodeMapTable); + + to->m_httpblKey.merge(&from->m_httpblKey); + + to->m_exceptions.merge(&from->m_exceptions); + + to->m_components.insert(to->m_components.end(), + from->m_components.begin(), from->m_components.end()); + + if (from->m_responseBodyTypeToBeInspected.m_set == true) { + if (from->m_responseBodyTypeToBeInspected.m_clear == true) { + to->m_responseBodyTypeToBeInspected.m_value.clear(); + from->m_responseBodyTypeToBeInspected.m_value.clear(); + } else { + for (std::set::iterator + it = from->m_responseBodyTypeToBeInspected.m_value.begin(); + it != from->m_responseBodyTypeToBeInspected.m_value.end(); + ++it) { + to->m_responseBodyTypeToBeInspected.m_value.insert(*it); + } + } + to->m_responseBodyTypeToBeInspected.m_set = true; + } + + for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { + std::vector > *actions_from = \ + &from->m_defaultActions[i]; + std::vector > *actions_to = \ + &to->m_defaultActions[i]; + for (size_t j = 0; j < actions_from->size(); j++) { + actions_to->push_back(actions_from->at(j)); + } + } + + if (to->m_auditLog) { + std::string error; + to->m_auditLog->merge(from->m_auditLog, &error); + if (error.size() > 0) { + *err << error; + return -1; + } + } + + if (from->m_debugLog && to->m_debugLog && + from->m_debugLog->isLogFileSet()) { + if (to->m_debugLog->isLogFileSet() == false) { + std::string error; + to->m_debugLog->setDebugLogFile( + from->m_debugLog->getDebugLogFile(), + &error); + if (error.size() > 0) { + *err << error; + return -1; + } + } + } + + if (from->m_debugLog && to->m_debugLog && + from->m_debugLog->isLogLevelSet()) { + if (to->m_debugLog->isLogLevelSet() == false) { + to->m_debugLog->setDebugLogLevel( + from->m_debugLog->getDebugLogLevel()); + } + } + + return 1; + } + + + audit_log::AuditLog *m_auditLog; + BodyLimitAction m_requestBodyLimitAction; + BodyLimitAction m_responseBodyLimitAction; + ConfigBoolean m_secRequestBodyAccess; + ConfigBoolean m_secResponseBodyAccess; + ConfigBoolean m_secXMLExternalEntity; + ConfigBoolean m_tmpSaveUploadedFiles; + ConfigBoolean m_uploadKeepFiles; + ConfigDouble m_argumentsLimit; + ConfigDouble m_requestBodyJsonDepthLimit; + ConfigDouble m_requestBodyLimit; + ConfigDouble m_requestBodyNoFilesLimit; + ConfigDouble m_responseBodyLimit; + ConfigInt m_uploadFileLimit; + ConfigInt m_uploadFileMode; + DebugLog *m_debugLog; + OnFailedRemoteRulesAction m_remoteRulesActionOnFailed; + RuleEngine m_secRuleEngine; + RulesExceptions m_exceptions; + std::list m_components; + std::ostringstream m_parserError; + ConfigSet m_responseBodyTypeToBeInspected; + ConfigString m_httpblKey; + ConfigString m_uploadDirectory; + ConfigString m_uploadTmpDirectory; + ConfigString m_secArgumentSeparator; + ConfigString m_secWebAppId; + std::vector > \ + m_defaultActions[modsecurity::Phases::NUMBER_OF_PHASES]; + ConfigUnicodeMap m_unicodeMapTable; +}; + + +#endif + +#ifdef __cplusplus +} // namespace modsecurity +#endif + +#endif // HEADERS_MODSECURITY_RULES_SET_PROPERTIES_H_ diff --git a/src/deps/src/ModSecurity/headers/modsecurity/transaction.h b/src/deps/src/ModSecurity/headers/modsecurity/transaction.h index dd2e9cf83..4244ddd35 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/transaction.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/transaction.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -26,6 +26,7 @@ #include #include #include +#include #endif #include @@ -37,7 +38,7 @@ #ifndef __cplusplus typedef struct ModSecurity_t ModSecurity; typedef struct Transaction_t Transaction; -typedef struct Rules_t Rules; +typedef struct Rules_t RulesSet; #endif #include "modsecurity/anchored_set_variable.h" @@ -47,12 +48,15 @@ typedef struct Rules_t Rules; #include "modsecurity/variable_value.h" #include "modsecurity/collection/collection.h" #include "modsecurity/variable_origin.h" +#include "modsecurity/anchored_set_variable_translation_proxy.h" +#include "modsecurity/audit_log.h" + #ifndef NO_LOGS #define ms_dbg(b, c) \ do { \ if (m_rules && m_rules->m_debugLog && m_rules->m_debugLog->m_debugLevel >= b) { \ - m_rules->debug(b, m_id, m_uri, c); \ + m_rules->debug(b, *m_id.get(), m_uri, c); \ } \ } while (0); #else @@ -98,7 +102,7 @@ namespace modsecurity { class ModSecurity; class Transaction; -class Rules; +class RulesSet; class RuleMessage; namespace actions { class Action; @@ -109,6 +113,7 @@ enum AllowType : int; namespace RequestBodyProcessor { class XML; class JSON; +class MultipartPartTmpFile; } namespace operators { class Operator; @@ -118,10 +123,7 @@ class Operator; class TransactionAnchoredVariables { public: explicit TransactionAnchoredVariables(Transaction *t) - : m_variableArgsNames(t, "ARGS_NAMES"), - m_variableArgsGetNames(t, "ARGS_GET_NAMES"), - m_variableArgsPostNames(t, "ARGS_POST_NAMES"), - m_variableRequestHeadersNames(t, "REQUEST_HEADERS_NAMES"), + : m_variableRequestHeadersNames(t, "REQUEST_HEADERS_NAMES"), m_variableResponseContentType(t, "RESPONSE_CONTENT_TYPE"), m_variableResponseHeadersNames(t, "RESPONSE_HEADERS_NAMES"), m_variableARGScombinedSize(t, "ARGS_COMBINED_SIZE"), @@ -199,12 +201,13 @@ class TransactionAnchoredVariables { m_variableGeo(t, "GEO"), m_variableRequestCookiesNames(t, "REQUEST_COOKIES_NAMES"), m_variableFilesTmpNames(t, "FILES_TMPNAMES"), - m_variableOffset(0) + m_variableMultipartPartHeaders(t, "MULTIPART_PART_HEADERS"), + m_variableOffset(0), + m_variableArgsNames("ARGS_NAMES", &m_variableArgs), + m_variableArgsGetNames("ARGS_GET_NAMES", &m_variableArgsGet), + m_variableArgsPostNames("ARGS_POST_NAMES", &m_variableArgsPost) { } - AnchoredSetVariable m_variableArgsNames; - AnchoredSetVariable m_variableArgsGetNames; - AnchoredSetVariable m_variableArgsPostNames; AnchoredSetVariable m_variableRequestHeadersNames; AnchoredVariable m_variableResponseContentType; AnchoredSetVariable m_variableResponseHeadersNames; @@ -280,19 +283,57 @@ class TransactionAnchoredVariables { AnchoredSetVariable m_variableGeo; AnchoredSetVariable m_variableRequestCookiesNames; AnchoredSetVariable m_variableFilesTmpNames; + AnchoredSetVariable m_variableMultipartPartHeaders; int m_variableOffset; + + AnchoredSetVariableTranslationProxy m_variableArgsNames; + AnchoredSetVariableTranslationProxy m_variableArgsGetNames; + AnchoredSetVariableTranslationProxy m_variableArgsPostNames; }; +class TransactionSecMarkerManagement { + public: + bool isInsideAMarker() const { + if (m_marker) { + return true; + } + + return false; + } + + std::shared_ptr getCurrentMarker() const { + if (m_marker) { + return m_marker; + } else { + throw; + } + } + + void removeMarker() { + m_marker.reset(); + } + + void addMarker(const std::shared_ptr &name) { + m_marker = name; + } + + private: + std::shared_ptr m_marker; +}; /** @ingroup ModSecurity_CPP_API */ -class Transaction : public TransactionAnchoredVariables { +class Transaction : public TransactionAnchoredVariables, public TransactionSecMarkerManagement { public: - Transaction(ModSecurity *transaction, Rules *rules, void *logCbData); - Transaction(ModSecurity *transaction, Rules *rules, char *id, + Transaction(ModSecurity *transaction, RulesSet *rules, void *logCbData); + Transaction(ModSecurity *transaction, RulesSet *rules, char *id, void *logCbData); ~Transaction(); + Transaction ( const Transaction & ) = delete; + bool operator ==(const Transaction &b) const { return false; }; + Transaction &operator =(const Transaction &b) const = delete; + /** TODO: Should be an structure that fits an IP address */ int processConnection(const char *client, int cPort, const char *server, int sPort); @@ -355,16 +396,16 @@ class Transaction : public TransactionAnchoredVariables { bool extractArguments(const std::string &orig, const std::string& buf, size_t offset); - const char *getResponseBody(); + const char *getResponseBody() const; size_t getResponseBodyLength(); size_t getRequestBodyLength(); #ifndef NO_LOGS - void debug(int, std::string) const; + void debug(int, const std::string&) const; #endif void serverLog(std::shared_ptr rm); - int getRuleEngineState(); + int getRuleEngineState() const; std::string toJSON(int parts); std::string toOldAuditLogFormat(int parts, const std::string &trailer); @@ -386,7 +427,7 @@ class Transaction : public TransactionAnchoredVariables { /** * Holds the client IP address. */ - std::string m_clientIpAddress; + std::shared_ptr m_clientIpAddress; /** * Holds the HTTP version: 1.2, 2.0, 3.0 and so on.... @@ -396,7 +437,7 @@ class Transaction : public TransactionAnchoredVariables { /** * Holds the server IP Address */ - std::string m_serverIpAddress; + std::shared_ptr m_serverIpAddress; /** * Holds the raw URI that was requested. @@ -406,7 +447,7 @@ class Transaction : public TransactionAnchoredVariables { /** * Holds the URI that was requests (without the query string). */ - std::string m_uri_no_query_string_decoded; + std::shared_ptr m_uri_no_query_string_decoded; /** * Holds the combined size of all arguments, later used to fill the @@ -455,7 +496,7 @@ class Transaction : public TransactionAnchoredVariables { /** * Rules object utilized during this specific transaction. */ - Rules *m_rules; + RulesSet *m_rules; /** * @@ -491,6 +532,12 @@ class Transaction : public TransactionAnchoredVariables { */ std::list< std::pair > m_auditLogModifier; + /** + * This transaction's most recent action ctl:auditEngine + * + */ + audit_log::AuditLog::AuditLogStatus m_ctlAuditEngine; + /** * This variable holds all the messages asked to be save by the utilization * of the actions: `log_data' and `msg'. These should be included on the @@ -512,13 +559,7 @@ class Transaction : public TransactionAnchoredVariables { * Contains the unique ID of the transaction. Use by the variable * `UNIQUE_ID'. This unique id is also saved as part of the AuditLog. */ - std::string m_id; - - /** - * Holds the SecMarker name that this transaction should wait to perform - * rules evaluation again. - */ - std::string m_marker; + std::shared_ptr m_id; /** * Holds the amount of rules that should be skipped. If bigger than 0 the @@ -583,6 +624,8 @@ class Transaction : public TransactionAnchoredVariables { std::string m_variableTimeWDay; std::string m_variableTimeYear; + std::vector> m_multipartPartTmpFiles; + private: /** * Pointer to the callback function that will be called to fill @@ -600,11 +643,11 @@ extern "C" { /** @ingroup ModSecurity_C_API */ Transaction *msc_new_transaction(ModSecurity *ms, - Rules *rules, void *logCbData); + RulesSet *rules, void *logCbData); /** @ingroup ModSecurity_C_API */ Transaction *msc_new_transaction_with_id(ModSecurity *ms, - Rules *rules, char *id, void *logCbData); + RulesSet *rules, char *id, void *logCbData); /** @ingroup ModSecurity_C_API */ int msc_process_connection(Transaction *transaction, diff --git a/src/deps/src/ModSecurity/headers/modsecurity/variable_origin.h b/src/deps/src/ModSecurity/headers/modsecurity/variable_origin.h index 37e1f8ef6..80ec177b9 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/variable_origin.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/variable_origin.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/headers/modsecurity/variable_value.h b/src/deps/src/ModSecurity/headers/modsecurity/variable_value.h index 7c36170b5..f78717762 100644 --- a/src/deps/src/ModSecurity/headers/modsecurity/variable_value.h +++ b/src/deps/src/ModSecurity/headers/modsecurity/variable_value.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -39,28 +39,28 @@ class VariableValue { public: using Origins = std::list>; - VariableValue(const std::string *key, + explicit VariableValue(const std::string *key, const std::string *value = nullptr) - : m_key(*key), + : m_collection(""), + m_key(*key), m_keyWithCollection(*key), - m_collection(""), m_value(value != nullptr?*value:"") { } VariableValue(const std::string *collection, const std::string *key, const std::string *value) - : m_key(*key), + : m_collection(*collection), + m_key(*key), m_keyWithCollection(*collection + ":" + *key), - m_collection(*collection), m_value(*value) { } explicit VariableValue(const VariableValue *o) : - m_key(o->m_key), - m_value(o->m_value), m_collection(o->m_collection), - m_keyWithCollection(o->m_keyWithCollection) + m_key(o->m_key), + m_keyWithCollection(o->m_keyWithCollection), + m_value(o->m_value) { for (auto &i : o->m_orign) { std::unique_ptr origin(new VariableOrigin()); @@ -70,6 +70,8 @@ class VariableValue { } } + VariableValue(const VariableValue &v) = delete; + const std::string& getKey() const { return m_key; diff --git a/src/deps/src/ModSecurity/modsecurity.conf-recommended b/src/deps/src/ModSecurity/modsecurity.conf-recommended index 50743891b..395d82ced 100644 --- a/src/deps/src/ModSecurity/modsecurity.conf-recommended +++ b/src/deps/src/ModSecurity/modsecurity.conf-recommended @@ -19,16 +19,23 @@ SecRequestBodyAccess On # Enable XML request body parser. # Initiate XML Processor in case of xml content-type # -SecRule REQUEST_HEADERS:Content-Type "(?:application(?:/soap\+|/)|text/)xml" \ +SecRule REQUEST_HEADERS:Content-Type "^(?:application(?:/soap\+|/)|text/)xml" \ "id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML" # Enable JSON request body parser. # Initiate JSON Processor in case of JSON content-type; change accordingly # if your application does not use 'application/json' # -SecRule REQUEST_HEADERS:Content-Type "application/json" \ +SecRule REQUEST_HEADERS:Content-Type "^application/json" \ "id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON" +# Sample rule to enable JSON request body parser for more subtypes. +# Uncomment or adapt this rule if you want to engage the JSON +# Processor for "+json" subtypes +# +#SecRule REQUEST_HEADERS:Content-Type "^application/[a-z0-9.-]+[+]json" \ +# "id:'200006',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON" + # Maximum request body size we will accept for buffering. If you support # file uploads then the value given on the first line has to be as large # as the largest file you are willing to accept. The second value refers @@ -38,13 +45,28 @@ SecRule REQUEST_HEADERS:Content-Type "application/json" \ SecRequestBodyLimit 13107200 SecRequestBodyNoFilesLimit 131072 -# What do do if the request body size is above our configured limit. +# What to do if the request body size is above our configured limit. # Keep in mind that this setting will automatically be set to ProcessPartial # when SecRuleEngine is set to DetectionOnly mode in order to minimize # disruptions when initially deploying ModSecurity. # SecRequestBodyLimitAction Reject +# Maximum parsing depth allowed for JSON objects. You want to keep this +# value as low as practical. +# +SecRequestBodyJsonDepthLimit 512 + +# Maximum number of args allowed per request. You want to keep this +# value as low as practical. The value should match that in rule 200007. +SecArgumentsLimit 1000 + +# If SecArgumentsLimit has been set, you probably want to reject any +# request body that has only been partly parsed. The value used in this +# rule should match what was used with SecArgumentsLimit +SecRule &ARGS "@ge 1000" \ +"id:'200007', phase:2,t:none,log,deny,status:400,msg:'Failed to fully parse request body due to large argument count',severity:2" + # Verify that we've correctly processed the request body. # As a rule of thumb, when failing to process a request body # you should reject the request (when deployed in blocking mode) diff --git a/src/deps/src/ModSecurity/modsecurity.pc.in b/src/deps/src/ModSecurity/modsecurity.pc.in index e753d86a7..96cdf5ca7 100644 --- a/src/deps/src/ModSecurity/modsecurity.pc.in +++ b/src/deps/src/ModSecurity/modsecurity.pc.in @@ -8,3 +8,4 @@ Description: ModSecurity API Version: @MSC_VERSION_WITH_PATCHLEVEL@ Cflags: -I@includedir@ Libs: -L@libdir@ -lmodsecurity +Libs.private: @CURL_LDADD@ @GEOIP_LDADD@ @MAXMIND_LDADD@ @GLOBAL_LDADD@ @LIBXML2_LDADD@ @LMDB_LDADD@ @LUA_LDADD@ @PCRE_LDADD@ @SSDEEP_LDADD@ @YAJL_LDADD@ diff --git a/src/deps/src/ModSecurity/src/Makefile.am b/src/deps/src/ModSecurity/src/Makefile.am index 54c54fb32..605f22dbc 100644 --- a/src/deps/src/ModSecurity/src/Makefile.am +++ b/src/deps/src/ModSecurity/src/Makefile.am @@ -35,6 +35,7 @@ MAINTAINERCLEANFILES = \ pkginclude_HEADERS = \ + ../headers/modsecurity/anchored_set_variable_translation_proxy.h \ ../headers/modsecurity/anchored_set_variable.h \ ../headers/modsecurity/anchored_variable.h \ ../headers/modsecurity/audit_log.h \ @@ -42,10 +43,16 @@ pkginclude_HEADERS = \ ../headers/modsecurity/intervention.h \ ../headers/modsecurity/modsecurity.h \ ../headers/modsecurity/rule.h \ - ../headers/modsecurity/rule_message.h \ + ../headers/modsecurity/rule_marker.h \ + ../headers/modsecurity/rule_unconditional.h \ + ../headers/modsecurity/rule_with_actions.h \ + ../headers/modsecurity/rule_with_operator.h \ ../headers/modsecurity/rules.h \ + ../headers/modsecurity/rule_message.h \ + ../headers/modsecurity/rules_set.h \ + ../headers/modsecurity/rules_set_phases.h \ + ../headers/modsecurity/rules_set_properties.h \ ../headers/modsecurity/rules_exceptions.h \ - ../headers/modsecurity/rules_properties.h \ ../headers/modsecurity/transaction.h \ ../headers/modsecurity/variable_origin.h \ ../headers/modsecurity/variable_value.h @@ -111,6 +118,7 @@ ACTIONS = \ actions/capture.cc \ actions/chain.cc \ actions/ctl/audit_log_parts.cc \ + actions/ctl/audit_engine.cc \ actions/ctl/rule_engine.cc \ actions/ctl/request_body_processor_json.cc \ actions/ctl/request_body_processor_xml.cc \ @@ -215,6 +223,7 @@ OPERATORS = \ operators/rbl.cc \ operators/rsub.cc \ operators/rx.cc \ + operators/rx_global.cc \ operators/str_eq.cc \ operators/str_match.cc \ operators/validate_byte_range.cc \ @@ -273,16 +282,20 @@ libmodsecurity_la_SOURCES = \ audit_log/writer/serial.cc \ audit_log/writer/parallel.cc \ modsecurity.cc \ - rules.cc \ + rules_set.cc \ + rules_set_phases.cc \ + rules_set_properties.cc \ debug_log/debug_log.cc \ debug_log/debug_log_writer.cc \ run_time_string.cc \ rule.cc \ + rule_unconditional.cc \ + rule_with_actions.cc \ + rule_with_operator.cc \ rule_message.cc \ rule_script.cc \ unique_id.cc \ rules_exceptions.cc \ - rules_properties.cc \ ${BODY_PROCESSORS} \ ${ACTIONS} \ ${ENGINES} \ @@ -303,6 +316,7 @@ libmodsecurity_la_CPPFLAGS = \ -fPIC \ -O3 \ -I../headers \ + $(CURL_CFLAGS) \ $(GEOIP_CFLAGS) \ $(GLOBAL_CPPFLAGS) \ $(MODSEC_NO_LOGS) \ @@ -310,6 +324,7 @@ libmodsecurity_la_CPPFLAGS = \ $(YAJL_CFLAGS) \ $(LMDB_CFLAGS) \ $(PCRE_CFLAGS) \ + $(PCRE2_CFLAGS) \ $(SSDEEP_CFLAGS) \ $(MAXMIND_CFLAGS) \ $(LUA_CFLAGS) \ @@ -325,6 +340,7 @@ libmodsecurity_la_LDFLAGS = \ $(LMDB_LDFLAGS) \ $(LUA_LDFLAGS) \ $(PCRE_LDFLAGS) \ + $(PCRE2_LDFLAGS) \ $(SSDEEP_LDFLAGS) \ $(MAXMIND_LDFLAGS) \ $(YAJL_LDFLAGS) \ @@ -341,6 +357,7 @@ libmodsecurity_la_LIBADD = \ ../others/libinjection.la \ ../others/libmbedtls.la \ $(PCRE_LDADD) \ + $(PCRE2_LDADD) \ $(MAXMIND_LDADD) \ $(SSDEEP_LDADD) \ $(YAJL_LDADD) diff --git a/src/deps/src/ModSecurity/src/actions/accuracy.cc b/src/deps/src/ModSecurity/src/actions/accuracy.cc index c94ef39f7..c8cfca72a 100644 --- a/src/deps/src/ModSecurity/src/actions/accuracy.cc +++ b/src/deps/src/ModSecurity/src/actions/accuracy.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -39,7 +39,7 @@ bool Accuracy::init(std::string *error) { } -bool Accuracy::evaluate(Rule *rule, Transaction *transaction) { +bool Accuracy::evaluate(RuleWithActions *rule, Transaction *transaction) { rule->m_accuracy = m_accuracy; return true; } diff --git a/src/deps/src/ModSecurity/src/actions/accuracy.h b/src/deps/src/ModSecurity/src/actions/accuracy.h index 6e78a4227..f787af190 100644 --- a/src/deps/src/ModSecurity/src/actions/accuracy.h +++ b/src/deps/src/ModSecurity/src/actions/accuracy.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,11 +29,11 @@ namespace actions { class Accuracy : public Action { public: - explicit Accuracy(std::string action) + explicit Accuracy(const std::string &action) : Action(action, ConfigurationKind), m_accuracy(0) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: diff --git a/src/deps/src/ModSecurity/src/actions/action.cc b/src/deps/src/ModSecurity/src/actions/action.cc index 505b82769..e58e2067e 100644 --- a/src/deps/src/ModSecurity/src/actions/action.cc +++ b/src/deps/src/ModSecurity/src/actions/action.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -45,13 +45,13 @@ namespace modsecurity { namespace actions { -std::string Action::evaluate(std::string value, +std::string Action::evaluate(const std::string &value, Transaction *transaction) { return value; } -bool Action::evaluate(Rule *rule, Transaction *transaction) { +bool Action::evaluate(RuleWithActions *rule, Transaction *transaction) { return true; } diff --git a/src/deps/src/ModSecurity/src/actions/audit_log.cc b/src/deps/src/ModSecurity/src/actions/audit_log.cc index 258591cc4..c628ac236 100644 --- a/src/deps/src/ModSecurity/src/actions/audit_log.cc +++ b/src/deps/src/ModSecurity/src/actions/audit_log.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -21,13 +21,13 @@ #include "modsecurity/transaction.h" #include "modsecurity/rule_message.h" -#include "modsecurity/rules.h" +#include "modsecurity/rules_set.h" namespace modsecurity { namespace actions { -bool AuditLog::evaluate(Rule *rule, Transaction *transaction, +bool AuditLog::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { rm->m_noAuditLog = false; ms_dbg_a(transaction, 9, "Saving transaction to logs"); diff --git a/src/deps/src/ModSecurity/src/actions/audit_log.h b/src/deps/src/ModSecurity/src/actions/audit_log.h index f63198f03..d870de2ac 100644 --- a/src/deps/src/ModSecurity/src/actions/audit_log.h +++ b/src/deps/src/ModSecurity/src/actions/audit_log.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,10 +32,10 @@ namespace actions { class AuditLog : public Action { public: - explicit AuditLog(std::string action) + explicit AuditLog(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/block.cc b/src/deps/src/ModSecurity/src/actions/block.cc index 7227846e7..bde5e6346 100644 --- a/src/deps/src/ModSecurity/src/actions/block.cc +++ b/src/deps/src/ModSecurity/src/actions/block.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,9 +19,9 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" -#include "modsecurity/rules.h" #include "modsecurity/intervention.h" #include "src/actions/data/status.h" @@ -29,11 +29,11 @@ namespace modsecurity { namespace actions { -bool Block::evaluate(Rule *rule, Transaction *transaction, +bool Block::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { ms_dbg_a(transaction, 8, "Marking request as disruptive."); - for (Action *a : transaction->m_rules->m_defaultActions[rule->m_phase]) { + for (auto &a : transaction->m_rules->m_defaultActions[rule->getPhase()]) { if (a->isDisruptive() == false) { continue; } diff --git a/src/deps/src/ModSecurity/src/actions/block.h b/src/deps/src/ModSecurity/src/actions/block.h index ecd73d8cd..7c40bbd83 100644 --- a/src/deps/src/ModSecurity/src/actions/block.h +++ b/src/deps/src/ModSecurity/src/actions/block.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,9 +33,9 @@ namespace actions { class Block : public Action { public: - explicit Block(std::string action) : Action(action) { } + explicit Block(const std::string &action) : Action(action) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/capture.cc b/src/deps/src/ModSecurity/src/actions/capture.cc index a02c2c785..62b86fc97 100644 --- a/src/deps/src/ModSecurity/src/actions/capture.cc +++ b/src/deps/src/ModSecurity/src/actions/capture.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace modsecurity { namespace actions { -bool Capture::evaluate(Rule *rule, Transaction *transaction) { +bool Capture::evaluate(RuleWithActions *rule, Transaction *transaction) { return true; } diff --git a/src/deps/src/ModSecurity/src/actions/capture.h b/src/deps/src/ModSecurity/src/actions/capture.h index be3cbae18..33207439c 100644 --- a/src/deps/src/ModSecurity/src/actions/capture.h +++ b/src/deps/src/ModSecurity/src/actions/capture.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -22,16 +22,16 @@ namespace modsecurity { -class Rule; +class RuleWithOperator; namespace actions { class Capture : public Action { public: - explicit Capture(std::string action) + explicit Capture(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/chain.cc b/src/deps/src/ModSecurity/src/actions/chain.cc index d5642674f..197f861ff 100644 --- a/src/deps/src/ModSecurity/src/actions/chain.cc +++ b/src/deps/src/ModSecurity/src/actions/chain.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,8 +25,8 @@ namespace modsecurity { namespace actions { -bool Chain::evaluate(Rule *rule, Transaction *transaction) { - rule->m_chained = true; +bool Chain::evaluate(RuleWithActions *rule, Transaction *transaction) { + rule->setChained(true); return true; } diff --git a/src/deps/src/ModSecurity/src/actions/chain.h b/src/deps/src/ModSecurity/src/actions/chain.h index 649625189..c5642baa6 100644 --- a/src/deps/src/ModSecurity/src/actions/chain.h +++ b/src/deps/src/ModSecurity/src/actions/chain.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,17 +25,17 @@ class Transaction; namespace modsecurity { class Transaction; -class Rule; +class RuleWithOperator; namespace actions { class Chain : public Action { public: - explicit Chain(std::string action) + explicit Chain(const std::string &action) : Action(action, ConfigurationKind) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; }; } // namespace actions diff --git a/src/deps/src/ModSecurity/src/actions/ctl/audit_engine.cc b/src/deps/src/ModSecurity/src/actions/ctl/audit_engine.cc new file mode 100644 index 000000000..d3d6650d3 --- /dev/null +++ b/src/deps/src/ModSecurity/src/actions/ctl/audit_engine.cc @@ -0,0 +1,63 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2022 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include "src/actions/ctl/audit_engine.h" + +#include + +#include "modsecurity/rules_set_properties.h" +#include "modsecurity/rules_set.h" +#include "modsecurity/transaction.h" + +namespace modsecurity { +namespace actions { +namespace ctl { + + +bool AuditEngine::init(std::string *error) { + + std::string what(m_parser_payload, 12, m_parser_payload.size() - 12); + + if (what == "on") { + m_auditEngine = audit_log::AuditLog::AuditLogStatus::OnAuditLogStatus; + } else if (what == "off") { + m_auditEngine = audit_log::AuditLog::AuditLogStatus::OffAuditLogStatus; + } else if (what == "relevantonly") { + m_auditEngine = audit_log::AuditLog::AuditLogStatus::RelevantOnlyAuditLogStatus; + } else { + error->assign("Internal error. Expected: On, Off or RelevantOnly; " \ + "got: " + m_parser_payload); + return false; + } + + return true; +} + +bool AuditEngine::evaluate(RuleWithActions *rule, Transaction *transaction) { + std::stringstream a; + a << "Setting SecAuditEngine to "; + a << std::to_string(m_auditEngine); + a << " as requested by a ctl:auditEngine action"; + + ms_dbg_a(transaction, 8, a.str()); + + transaction->m_ctlAuditEngine = m_auditEngine; + return true; +} + + +} // namespace ctl +} // namespace actions +} // namespace modsecurity diff --git a/src/deps/src/ModSecurity/src/actions/ctl/audit_engine.h b/src/deps/src/ModSecurity/src/actions/ctl/audit_engine.h new file mode 100644 index 000000000..03e0cb4cc --- /dev/null +++ b/src/deps/src/ModSecurity/src/actions/ctl/audit_engine.h @@ -0,0 +1,51 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2022 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include + +#include "modsecurity/rules_set_properties.h" +#include "modsecurity/actions/action.h" + +#include "modsecurity/audit_log.h" + + +#ifndef SRC_ACTIONS_CTL_AUDIT_ENGINE_H_ +#define SRC_ACTIONS_CTL_AUDIT_ENGINE_H_ + +namespace modsecurity { +class Transaction; + +namespace actions { +namespace ctl { + + +class AuditEngine : public Action { + public: + explicit AuditEngine(const std::string &action) + : Action(action, RunTimeOnlyIfMatchKind), + m_auditEngine(audit_log::AuditLog::AuditLogStatus::NotSetLogStatus) { } + + bool init(std::string *error) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; + + audit_log::AuditLog::AuditLogStatus m_auditEngine; +}; + + +} // namespace ctl +} // namespace actions +} // namespace modsecurity + +#endif // SRC_ACTIONS_CTL_AUDIT_ENGINE_H_ diff --git a/src/deps/src/ModSecurity/src/actions/ctl/audit_log_parts.cc b/src/deps/src/ModSecurity/src/actions/ctl/audit_log_parts.cc index 522dd6131..8420b4925 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/audit_log_parts.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/audit_log_parts.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -38,7 +38,7 @@ bool AuditLogParts::init(std::string *error) { return true; } -bool AuditLogParts::evaluate(Rule *rule, Transaction *transaction) { +bool AuditLogParts::evaluate(RuleWithActions *rule, Transaction *transaction) { transaction->m_auditLogModifier.push_back( std::make_pair(mPartsAction, mParts)); return true; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/audit_log_parts.h b/src/deps/src/ModSecurity/src/actions/ctl/audit_log_parts.h index e1d3546ca..f4980780e 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/audit_log_parts.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/audit_log_parts.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,12 +28,12 @@ namespace ctl { class AuditLogParts : public Action { public: - explicit AuditLogParts(std::string action) + explicit AuditLogParts(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), mPartsAction(0), mParts("") { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; protected: diff --git a/src/deps/src/ModSecurity/src/actions/ctl/request_body_access.cc b/src/deps/src/ModSecurity/src/actions/ctl/request_body_access.cc index f811e9416..0d3415551 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/request_body_access.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/request_body_access.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,7 +18,7 @@ #include #include -#include "modsecurity/rules_properties.h" +#include "modsecurity/rules_set_properties.h" #include "modsecurity/transaction.h" namespace modsecurity { @@ -42,11 +42,11 @@ bool RequestBodyAccess::init(std::string *error) { return true; } -bool RequestBodyAccess::evaluate(Rule *rule, Transaction *transaction) { +bool RequestBodyAccess::evaluate(RuleWithActions *rule, Transaction *transaction) { if (m_request_body_access) { - transaction->m_requestBodyAccess = RulesProperties::TrueConfigBoolean; + transaction->m_requestBodyAccess = RulesSetProperties::TrueConfigBoolean; } else { - transaction->m_requestBodyAccess = RulesProperties::FalseConfigBoolean; + transaction->m_requestBodyAccess = RulesSetProperties::FalseConfigBoolean; } return true; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/request_body_access.h b/src/deps/src/ModSecurity/src/actions/ctl/request_body_access.h index 8f2f05e93..afe3b3d48 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/request_body_access.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/request_body_access.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,12 +29,12 @@ namespace ctl { class RequestBodyAccess : public Action { public: - explicit RequestBodyAccess(std::string action) + explicit RequestBodyAccess(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_request_body_access(false) { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool m_request_body_access; }; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_json.cc b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_json.cc index 38f9a6e1e..5a9593a35 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_json.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_json.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,7 +25,7 @@ namespace actions { namespace ctl { -bool RequestBodyProcessorJSON::evaluate(Rule *rule, +bool RequestBodyProcessorJSON::evaluate(RuleWithActions *rule, Transaction *transaction) { transaction->m_requestBodyProcessor = Transaction::JSONRequestBody; transaction->m_variableReqbodyProcessor.set("JSON", diff --git a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_json.h b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_json.h index dca4d608f..48125597e 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_json.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_json.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,10 +28,10 @@ namespace ctl { class RequestBodyProcessorJSON : public Action { public: - explicit RequestBodyProcessorJSON(std::string action) + explicit RequestBodyProcessorJSON(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_urlencoded.cc b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_urlencoded.cc index ce8886fdf..2fecee79c 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_urlencoded.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_urlencoded.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,7 +25,7 @@ namespace actions { namespace ctl { -bool RequestBodyProcessorURLENCODED::evaluate(Rule *rule, +bool RequestBodyProcessorURLENCODED::evaluate(RuleWithActions *rule, Transaction *transaction) { transaction->m_requestBodyType = Transaction::WWWFormUrlEncoded; transaction->m_variableReqbodyProcessor.set("URLENCODED", diff --git a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_urlencoded.h b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_urlencoded.h index 920b05532..5b5557d43 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_urlencoded.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_urlencoded.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,10 +28,10 @@ namespace ctl { class RequestBodyProcessorURLENCODED : public Action { public: - explicit RequestBodyProcessorURLENCODED(std::string action) + explicit RequestBodyProcessorURLENCODED(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_xml.cc b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_xml.cc index 77288b40e..02c41bb2b 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_xml.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_xml.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,7 +25,7 @@ namespace actions { namespace ctl { -bool RequestBodyProcessorXML::evaluate(Rule *rule, +bool RequestBodyProcessorXML::evaluate(RuleWithActions *rule, Transaction *transaction) { transaction->m_requestBodyProcessor = Transaction::XMLRequestBody; transaction->m_variableReqbodyProcessor.set("XML", diff --git a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_xml.h b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_xml.h index 449eec125..9084d1d98 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_xml.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/request_body_processor_xml.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,10 +28,10 @@ namespace ctl { class RequestBodyProcessorXML : public Action { public: - explicit RequestBodyProcessorXML(std::string action) + explicit RequestBodyProcessorXML(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_engine.cc b/src/deps/src/ModSecurity/src/actions/ctl/rule_engine.cc index 34250269c..66809f4b1 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_engine.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_engine.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,8 +18,8 @@ #include #include -#include "modsecurity/rules_properties.h" -#include "modsecurity/rules.h" +#include "modsecurity/rules_set_properties.h" +#include "modsecurity/rules_set.h" #include "modsecurity/transaction.h" namespace modsecurity { @@ -31,11 +31,11 @@ bool RuleEngine::init(std::string *error) { std::string what(m_parser_payload, 11, m_parser_payload.size() - 11); if (what == "on") { - m_ruleEngine = RulesProperties::EnabledRuleEngine; + m_ruleEngine = RulesSetProperties::EnabledRuleEngine; } else if (what == "off") { - m_ruleEngine = RulesProperties::DisabledRuleEngine; + m_ruleEngine = RulesSetProperties::DisabledRuleEngine; } else if (what == "detectiononly") { - m_ruleEngine = RulesProperties::DetectionOnlyRuleEngine; + m_ruleEngine = RulesSetProperties::DetectionOnlyRuleEngine; } else { error->assign("Internal error. Expected: On, Off or DetectionOnly; " \ "got: " + m_parser_payload); @@ -45,10 +45,10 @@ bool RuleEngine::init(std::string *error) { return true; } -bool RuleEngine::evaluate(Rule *rule, Transaction *transaction) { +bool RuleEngine::evaluate(RuleWithActions *rule, Transaction *transaction) { std::stringstream a; a << "Setting SecRuleEngine to "; - a << modsecurity::RulesProperties::ruleEngineStateString(m_ruleEngine); + a << modsecurity::RulesSetProperties::ruleEngineStateString(m_ruleEngine); a << " as requested by a ctl:ruleEngine action"; ms_dbg_a(transaction, 8, a.str()); diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_engine.h b/src/deps/src/ModSecurity/src/actions/ctl/rule_engine.h index 93ef894ca..fca5d39b1 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_engine.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_engine.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,9 +15,9 @@ #include +#include "modsecurity/rules_set_properties.h" #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" -#include "modsecurity/rules_properties.h" #ifndef SRC_ACTIONS_CTL_RULE_ENGINE_H_ @@ -30,14 +30,14 @@ namespace ctl { class RuleEngine : public Action { public: - explicit RuleEngine(std::string action) + explicit RuleEngine(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), - m_ruleEngine(RulesProperties::PropertyNotSetRuleEngine) { } + m_ruleEngine(RulesSetProperties::PropertyNotSetRuleEngine) { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; - RulesProperties::RuleEngine m_ruleEngine; + RulesSetProperties::RuleEngine m_ruleEngine; }; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_id.cc b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_id.cc index c1f602854..e76a3119d 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_id.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_id.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -83,7 +83,7 @@ bool RuleRemoveById::init(std::string *error) { return false; } -bool RuleRemoveById::evaluate(Rule *rule, Transaction *transaction) { +bool RuleRemoveById::evaluate(RuleWithActions *rule, Transaction *transaction) { for (auto &i : m_ids) { transaction->m_ruleRemoveById.push_back(i); } diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_id.h b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_id.h index efb0dc851..e0f0902b8 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_id.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_id.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,11 +29,11 @@ namespace ctl { class RuleRemoveById : public Action { public: - explicit RuleRemoveById(std::string action) + explicit RuleRemoveById(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; std::list > m_ranges; std::list m_ids; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_tag.cc b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_tag.cc index 22377ebc6..76e7406fc 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_tag.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_tag.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ bool RuleRemoveByTag::init(std::string *error) { return true; } -bool RuleRemoveByTag::evaluate(Rule *rule, Transaction *transaction) { +bool RuleRemoveByTag::evaluate(RuleWithActions *rule, Transaction *transaction) { transaction->m_ruleRemoveByTag.push_back(m_tag); return true; } diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_tag.h b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_tag.h index 6f9778835..5689b7b16 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_tag.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_by_tag.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,12 +29,12 @@ namespace ctl { class RuleRemoveByTag : public Action { public: - explicit RuleRemoveByTag(std::string action) + explicit RuleRemoveByTag(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_tag("") { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; std::string m_tag; }; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_id.cc b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_id.cc index 2dada6a87..0776e3448 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_id.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_id.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -51,7 +51,7 @@ bool RuleRemoveTargetById::init(std::string *error) { return true; } -bool RuleRemoveTargetById::evaluate(Rule *rule, Transaction *transaction) { +bool RuleRemoveTargetById::evaluate(RuleWithActions *rule, Transaction *transaction) { transaction->m_ruleRemoveTargetById.push_back( std::make_pair(m_id, m_target)); return true; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_id.h b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_id.h index 03941f4a1..d71e4fc21 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_id.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_id.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,13 +29,13 @@ namespace ctl { class RuleRemoveTargetById : public Action { public: - explicit RuleRemoveTargetById(std::string action) + explicit RuleRemoveTargetById(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_id(0), m_target("") { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; int m_id; std::string m_target; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_tag.cc b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_tag.cc index e0e792faf..1be6603fd 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_tag.cc +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_tag.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -44,7 +44,7 @@ bool RuleRemoveTargetByTag::init(std::string *error) { return true; } -bool RuleRemoveTargetByTag::evaluate(Rule *rule, Transaction *transaction) { +bool RuleRemoveTargetByTag::evaluate(RuleWithActions *rule, Transaction *transaction) { transaction->m_ruleRemoveTargetByTag.push_back( std::make_pair(m_tag, m_target)); return true; diff --git a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_tag.h b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_tag.h index 3acf4c8be..7863e5a52 100644 --- a/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_tag.h +++ b/src/deps/src/ModSecurity/src/actions/ctl/rule_remove_target_by_tag.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,11 +29,11 @@ namespace ctl { class RuleRemoveTargetByTag : public Action { public: - explicit RuleRemoveTargetByTag(std::string action) + explicit RuleRemoveTargetByTag(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; std::string m_tag; std::string m_target; diff --git a/src/deps/src/ModSecurity/src/actions/data/status.cc b/src/deps/src/ModSecurity/src/actions/data/status.cc index 65764c38a..942997385 100644 --- a/src/deps/src/ModSecurity/src/actions/data/status.cc +++ b/src/deps/src/ModSecurity/src/actions/data/status.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -38,7 +38,7 @@ bool Status::init(std::string *error) { } -bool Status::evaluate(Rule *rule, Transaction *transaction, +bool Status::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { transaction->m_it.status = m_status; return true; diff --git a/src/deps/src/ModSecurity/src/actions/data/status.h b/src/deps/src/ModSecurity/src/actions/data/status.h index 8a0232fdc..d792247d6 100644 --- a/src/deps/src/ModSecurity/src/actions/data/status.h +++ b/src/deps/src/ModSecurity/src/actions/data/status.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,11 +33,11 @@ namespace data { class Status : public Action { public: - explicit Status(std::string action) : Action(action, 2), + explicit Status(const std::string &action) : Action(action, 2), m_status(0) { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; int m_status; diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/allow.cc b/src/deps/src/ModSecurity/src/actions/disruptive/allow.cc index bc2c614e0..59e17374a 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/allow.cc +++ b/src/deps/src/ModSecurity/src/actions/disruptive/allow.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,9 +18,9 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" -#include "modsecurity/rules.h" #include "src/utils/string.h" #include "modsecurity/modsecurity.h" @@ -49,7 +49,7 @@ bool Allow::init(std::string *error) { } -bool Allow::evaluate(Rule *rule, Transaction *transaction) { +bool Allow::evaluate(RuleWithActions *rule, Transaction *transaction) { ms_dbg_a(transaction, 4, "Dropping the evaluation of upcoming rules " \ "in favor of an `allow' action of type: " \ + allowTypeToName(m_allowType)); diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/allow.h b/src/deps/src/ModSecurity/src/actions/disruptive/allow.h index 220f94faa..d9a716cec 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/allow.h +++ b/src/deps/src/ModSecurity/src/actions/disruptive/allow.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,7 +25,7 @@ class Transaction; namespace modsecurity { class Transaction; -class Rule; +class RuleWithOperator; namespace actions { namespace disruptive { @@ -53,13 +53,13 @@ enum AllowType : int { class Allow : public Action { public: - explicit Allow(std::string action) + explicit Allow(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_allowType(NoneAllowType) { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool isDisruptive() override { return true; } AllowType m_allowType; diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/deny.cc b/src/deps/src/ModSecurity/src/actions/disruptive/deny.cc index 44dfd9951..e105d6512 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/deny.cc +++ b/src/deps/src/ModSecurity/src/actions/disruptive/deny.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,7 +28,7 @@ namespace actions { namespace disruptive { -bool Deny::evaluate(Rule *rule, Transaction *transaction, +bool Deny::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { ms_dbg_a(transaction, 8, "Running action deny"); diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/deny.h b/src/deps/src/ModSecurity/src/actions/disruptive/deny.h index 0d8871ec6..fb841a49a 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/deny.h +++ b/src/deps/src/ModSecurity/src/actions/disruptive/deny.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -16,9 +16,9 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" -#include "modsecurity/rules.h" #include "modsecurity/rule_message.h" #ifndef SRC_ACTIONS_DISRUPTIVE_DENY_H_ @@ -31,9 +31,9 @@ namespace disruptive { class Deny : public Action { public: - explicit Deny(std::string action) : Action(action) { } + explicit Deny(const std::string &action) : Action(action) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; bool isDisruptive() override { return true; } }; diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/drop.cc b/src/deps/src/ModSecurity/src/actions/disruptive/drop.cc index 4af751b93..18a3b5528 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/drop.cc +++ b/src/deps/src/ModSecurity/src/actions/disruptive/drop.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -21,14 +21,18 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/transaction.h" +#include "modsecurity/rule.h" +#include "src/utils/string.h" +#include "modsecurity/modsecurity.h" namespace modsecurity { namespace actions { namespace disruptive { -bool Drop::evaluate(Rule *rule, Transaction *transaction, +bool Drop::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { ms_dbg_a(transaction, 8, "Running action drop " \ "[executing deny instead of drop.]"); diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/drop.h b/src/deps/src/ModSecurity/src/actions/disruptive/drop.h index fc96aeeb7..f60eddfa6 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/drop.h +++ b/src/deps/src/ModSecurity/src/actions/disruptive/drop.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" -#include "modsecurity/rules.h" #include "modsecurity/rule_message.h" #ifndef SRC_ACTIONS_DISRUPTIVE_DROP_H_ @@ -31,9 +30,9 @@ namespace disruptive { class Drop : public Action { public: - explicit Drop(std::string action) : Action(action) { } + explicit Drop(const std::string &action) : Action(action) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; bool isDisruptive() override { return true; } }; diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/pass.cc b/src/deps/src/ModSecurity/src/actions/disruptive/pass.cc index d07763ab1..e0f038c4c 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/pass.cc +++ b/src/deps/src/ModSecurity/src/actions/disruptive/pass.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,9 +19,9 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" -#include "modsecurity/rules.h" #include "modsecurity/rule_message.h" namespace modsecurity { @@ -29,7 +29,7 @@ namespace actions { namespace disruptive { -bool Pass::evaluate(Rule *rule, Transaction *transaction, +bool Pass::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { intervention::free(&transaction->m_it); intervention::reset(&transaction->m_it); diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/pass.h b/src/deps/src/ModSecurity/src/actions/disruptive/pass.h index 50f8fd53b..0c09d2874 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/pass.h +++ b/src/deps/src/ModSecurity/src/actions/disruptive/pass.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,9 +29,9 @@ namespace disruptive { class Pass : public Action { public: - explicit Pass(std::string action) : Action(action) { } + explicit Pass(const std::string &action) : Action(action) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; bool isDisruptive() override { return true; } }; diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/redirect.cc b/src/deps/src/ModSecurity/src/actions/disruptive/redirect.cc index 0b9b8eb8f..ac2993b4c 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/redirect.cc +++ b/src/deps/src/ModSecurity/src/actions/disruptive/redirect.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ bool Redirect::init(std::string *error) { } -bool Redirect::evaluate(Rule *rule, Transaction *transaction, +bool Redirect::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { std::string m_urlExpanded(m_string->evaluate(transaction)); /* if it was changed before, lets keep it. */ diff --git a/src/deps/src/ModSecurity/src/actions/disruptive/redirect.h b/src/deps/src/ModSecurity/src/actions/disruptive/redirect.h index b982a86b5..46b5d51a9 100644 --- a/src/deps/src/ModSecurity/src/actions/disruptive/redirect.h +++ b/src/deps/src/ModSecurity/src/actions/disruptive/redirect.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -38,13 +38,15 @@ class Redirect : public Action { public: explicit Redirect(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), - m_status(0) { } + m_status(0), + m_string(nullptr) { } explicit Redirect(std::unique_ptr z) : Action("redirert", RunTimeOnlyIfMatchKind), + m_status(0), m_string(std::move(z)) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; bool init(std::string *error) override; bool isDisruptive() override { return true; } diff --git a/src/deps/src/ModSecurity/src/actions/exec.cc b/src/deps/src/ModSecurity/src/actions/exec.cc index eda7d29f7..8ed21d73e 100644 --- a/src/deps/src/ModSecurity/src/actions/exec.cc +++ b/src/deps/src/ModSecurity/src/actions/exec.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,10 +18,10 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" -#include "modsecurity/rules.h" #include "src/utils/system.h" #include "src/engine/lua.h" @@ -49,7 +49,7 @@ bool Exec::init(std::string *error) { } -bool Exec::evaluate(Rule *rule, Transaction *t) { +bool Exec::evaluate(RuleWithActions *rule, Transaction *t) { ms_dbg_a(t, 8, "Running script... " + m_script); m_lua.run(t); return true; diff --git a/src/deps/src/ModSecurity/src/actions/exec.h b/src/deps/src/ModSecurity/src/actions/exec.h index cffffb792..f89998218 100644 --- a/src/deps/src/ModSecurity/src/actions/exec.h +++ b/src/deps/src/ModSecurity/src/actions/exec.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,13 +30,13 @@ namespace actions { class Exec : public Action { public: - explicit Exec(std::string action) + explicit Exec(const std::string &action) : Action(action), m_script("") { } ~Exec() { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: diff --git a/src/deps/src/ModSecurity/src/actions/init_col.cc b/src/deps/src/ModSecurity/src/actions/init_col.cc index 9338ea47f..0c6fafe95 100644 --- a/src/deps/src/ModSecurity/src/actions/init_col.cc +++ b/src/deps/src/ModSecurity/src/actions/init_col.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -46,7 +46,7 @@ bool InitCol::init(std::string *error) { m_collection_key != "global" && m_collection_key != "resource") { error->assign("Something wrong with initcol: collection must be " \ - "`ip' or `global'"); + "`ip', `global' or `resource'"); return false; } @@ -54,7 +54,7 @@ bool InitCol::init(std::string *error) { } -bool InitCol::evaluate(Rule *rule, Transaction *t) { +bool InitCol::evaluate(RuleWithActions *rule, Transaction *t) { std::string collectionName(m_string->evaluate(t)); if (m_collection_key == "ip") { diff --git a/src/deps/src/ModSecurity/src/actions/init_col.h b/src/deps/src/ModSecurity/src/actions/init_col.h index bd06bf6f0..16d7ace92 100644 --- a/src/deps/src/ModSecurity/src/actions/init_col.h +++ b/src/deps/src/ModSecurity/src/actions/init_col.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,13 +32,13 @@ namespace actions { class InitCol : public Action { public: - explicit InitCol(std::string action) : Action(action) { } + explicit InitCol(const std::string &action) : Action(action) { } - InitCol(std::string action, std::unique_ptr z) + InitCol(const std::string &action, std::unique_ptr z) : Action(action, RunTimeOnlyIfMatchKind), m_string(std::move(z)) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: std::string m_collection_key; diff --git a/src/deps/src/ModSecurity/src/actions/log.cc b/src/deps/src/ModSecurity/src/actions/log.cc index 13a283cb3..6ca507cdb 100644 --- a/src/deps/src/ModSecurity/src/actions/log.cc +++ b/src/deps/src/ModSecurity/src/actions/log.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,7 +28,7 @@ namespace modsecurity { namespace actions { -bool Log::evaluate(Rule *rule, Transaction *transaction, +bool Log::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { ms_dbg_a(transaction, 9, "Saving transaction to logs"); rm->m_saveMessage = true; diff --git a/src/deps/src/ModSecurity/src/actions/log.h b/src/deps/src/ModSecurity/src/actions/log.h index 1d7262f02..736d4a130 100644 --- a/src/deps/src/ModSecurity/src/actions/log.h +++ b/src/deps/src/ModSecurity/src/actions/log.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,10 +30,10 @@ namespace actions { class Log : public Action { public: - explicit Log(std::string action) + explicit Log(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/log_data.cc b/src/deps/src/ModSecurity/src/actions/log_data.cc index 658eb601d..49c539cfc 100644 --- a/src/deps/src/ModSecurity/src/actions/log_data.cc +++ b/src/deps/src/ModSecurity/src/actions/log_data.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,7 +29,7 @@ namespace modsecurity { namespace actions { -bool LogData::evaluate(Rule *rule, Transaction *transaction, +bool LogData::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { rm->m_data = data(transaction); diff --git a/src/deps/src/ModSecurity/src/actions/log_data.h b/src/deps/src/ModSecurity/src/actions/log_data.h index 800563700..da2fbf4df 100644 --- a/src/deps/src/ModSecurity/src/actions/log_data.h +++ b/src/deps/src/ModSecurity/src/actions/log_data.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,14 +32,14 @@ namespace actions { class LogData : public Action { public: - explicit LogData(std::string action) + explicit LogData(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } explicit LogData(std::unique_ptr z) : Action("logdata", RunTimeOnlyIfMatchKind), m_string(std::move(z)) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; std::string data(Transaction *Transaction); diff --git a/src/deps/src/ModSecurity/src/actions/maturity.cc b/src/deps/src/ModSecurity/src/actions/maturity.cc index 55c308df7..131d2148b 100644 --- a/src/deps/src/ModSecurity/src/actions/maturity.cc +++ b/src/deps/src/ModSecurity/src/actions/maturity.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -39,7 +39,7 @@ bool Maturity::init(std::string *error) { } -bool Maturity::evaluate(Rule *rule, Transaction *transaction) { +bool Maturity::evaluate(RuleWithActions *rule, Transaction *transaction) { rule->m_maturity = m_maturity; return true; } diff --git a/src/deps/src/ModSecurity/src/actions/maturity.h b/src/deps/src/ModSecurity/src/actions/maturity.h index 6227fadab..dd185efaa 100644 --- a/src/deps/src/ModSecurity/src/actions/maturity.h +++ b/src/deps/src/ModSecurity/src/actions/maturity.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,11 +29,11 @@ namespace actions { class Maturity : public Action { public: - explicit Maturity(std::string action) + explicit Maturity(const std::string &action) : Action(action, ConfigurationKind), m_maturity(0) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: diff --git a/src/deps/src/ModSecurity/src/actions/msg.cc b/src/deps/src/ModSecurity/src/actions/msg.cc index 5e274846f..1f0b3538d 100644 --- a/src/deps/src/ModSecurity/src/actions/msg.cc +++ b/src/deps/src/ModSecurity/src/actions/msg.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -46,7 +46,7 @@ namespace modsecurity { namespace actions { -bool Msg::evaluate(Rule *rule, Transaction *transaction, +bool Msg::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { std::string msg = data(transaction); rm->m_message = msg; diff --git a/src/deps/src/ModSecurity/src/actions/msg.h b/src/deps/src/ModSecurity/src/actions/msg.h index 6206ca171..61661194b 100644 --- a/src/deps/src/ModSecurity/src/actions/msg.h +++ b/src/deps/src/ModSecurity/src/actions/msg.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,14 +33,14 @@ namespace actions { class Msg : public Action { public: - explicit Msg(std::string action) + explicit Msg(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } explicit Msg(std::unique_ptr z) : Action("msg", RunTimeOnlyIfMatchKind), m_string(std::move(z)) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; std::string data(Transaction *Transaction); diff --git a/src/deps/src/ModSecurity/src/actions/multi_match.cc b/src/deps/src/ModSecurity/src/actions/multi_match.cc index 6bf785a21..fb30f1551 100644 --- a/src/deps/src/ModSecurity/src/actions/multi_match.cc +++ b/src/deps/src/ModSecurity/src/actions/multi_match.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,7 +25,7 @@ namespace modsecurity { namespace actions { -bool MultiMatch::evaluate(Rule *rule, Transaction *transaction) { +bool MultiMatch::evaluate(RuleWithActions *rule, Transaction *transaction) { return true; } diff --git a/src/deps/src/ModSecurity/src/actions/multi_match.h b/src/deps/src/ModSecurity/src/actions/multi_match.h index 6f74a414f..b0fd2c767 100644 --- a/src/deps/src/ModSecurity/src/actions/multi_match.h +++ b/src/deps/src/ModSecurity/src/actions/multi_match.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,17 +25,17 @@ class Transaction; namespace modsecurity { class Transaction; -class Rule; +class RuleWithOperator; namespace actions { class MultiMatch : public Action { public: - explicit MultiMatch(std::string action) + explicit MultiMatch(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; }; } // namespace actions diff --git a/src/deps/src/ModSecurity/src/actions/no_audit_log.cc b/src/deps/src/ModSecurity/src/actions/no_audit_log.cc index ca7e0ce01..e4a59f736 100644 --- a/src/deps/src/ModSecurity/src/actions/no_audit_log.cc +++ b/src/deps/src/ModSecurity/src/actions/no_audit_log.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -26,7 +26,7 @@ namespace modsecurity { namespace actions { -bool NoAuditLog::evaluate(Rule *rule, Transaction *transaction, +bool NoAuditLog::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { rm->m_noAuditLog = true; rm->m_saveMessage = false; diff --git a/src/deps/src/ModSecurity/src/actions/no_audit_log.h b/src/deps/src/ModSecurity/src/actions/no_audit_log.h index d0543a9ff..dbd5d098f 100644 --- a/src/deps/src/ModSecurity/src/actions/no_audit_log.h +++ b/src/deps/src/ModSecurity/src/actions/no_audit_log.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,10 +32,10 @@ namespace actions { class NoAuditLog : public Action { public: - explicit NoAuditLog(std::string action) + explicit NoAuditLog(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/no_log.cc b/src/deps/src/ModSecurity/src/actions/no_log.cc index 8d0a71a5d..501ea4da4 100644 --- a/src/deps/src/ModSecurity/src/actions/no_log.cc +++ b/src/deps/src/ModSecurity/src/actions/no_log.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,7 +29,7 @@ namespace modsecurity { namespace actions { -bool NoLog::evaluate(Rule *rule, Transaction *transaction, +bool NoLog::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { rm->m_saveMessage = false; return true; diff --git a/src/deps/src/ModSecurity/src/actions/no_log.h b/src/deps/src/ModSecurity/src/actions/no_log.h index 9d4878bef..87d4e3059 100644 --- a/src/deps/src/ModSecurity/src/actions/no_log.h +++ b/src/deps/src/ModSecurity/src/actions/no_log.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,10 +30,10 @@ namespace actions { class NoLog : public Action { public: - explicit NoLog(std::string action) + explicit NoLog(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/phase.cc b/src/deps/src/ModSecurity/src/actions/phase.cc index 1c6d47931..2e9e72778 100644 --- a/src/deps/src/ModSecurity/src/actions/phase.cc +++ b/src/deps/src/ModSecurity/src/actions/phase.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -72,8 +72,8 @@ bool Phase::init(std::string *error) { } -bool Phase::evaluate(Rule *rule, Transaction *transaction) { - rule->m_phase = m_phase; +bool Phase::evaluate(RuleWithActions *rule, Transaction *transaction) { + rule->setPhase(m_phase); return true; } diff --git a/src/deps/src/ModSecurity/src/actions/phase.h b/src/deps/src/ModSecurity/src/actions/phase.h index 99f0176f7..0fada3c3c 100644 --- a/src/deps/src/ModSecurity/src/actions/phase.h +++ b/src/deps/src/ModSecurity/src/actions/phase.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,19 +25,19 @@ class Transaction; namespace modsecurity { class Transaction; -class Rule; +class RuleWithOperator; namespace actions { class Phase : public Action { public: - explicit Phase(std::string action) : Action(action, ConfigurationKind), + explicit Phase(const std::string &action) : Action(action, ConfigurationKind), m_phase(0), m_secRulesPhase(0) { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; int m_phase; int m_secRulesPhase; diff --git a/src/deps/src/ModSecurity/src/actions/rev.cc b/src/deps/src/ModSecurity/src/actions/rev.cc index b489abf47..43d8d1be4 100644 --- a/src/deps/src/ModSecurity/src/actions/rev.cc +++ b/src/deps/src/ModSecurity/src/actions/rev.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,7 +33,7 @@ bool Rev::init(std::string *error) { } -bool Rev::evaluate(Rule *rule, Transaction *transaction) { +bool Rev::evaluate(RuleWithActions *rule, Transaction *transaction) { rule->m_rev = m_rev; return true; } diff --git a/src/deps/src/ModSecurity/src/actions/rev.h b/src/deps/src/ModSecurity/src/actions/rev.h index 052085b0e..9e3c1bfb6 100644 --- a/src/deps/src/ModSecurity/src/actions/rev.h +++ b/src/deps/src/ModSecurity/src/actions/rev.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,9 +29,9 @@ namespace actions { class Rev : public Action { public: - explicit Rev(std::string action) : Action(action, ConfigurationKind) { } + explicit Rev(const std::string &action) : Action(action, ConfigurationKind) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: diff --git a/src/deps/src/ModSecurity/src/actions/rule_id.cc b/src/deps/src/ModSecurity/src/actions/rule_id.cc index 1c92041d1..d16bf63be 100644 --- a/src/deps/src/ModSecurity/src/actions/rule_id.cc +++ b/src/deps/src/ModSecurity/src/actions/rule_id.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -48,7 +48,7 @@ bool RuleId::init(std::string *error) { } -bool RuleId::evaluate(Rule *rule, Transaction *transaction) { +bool RuleId::evaluate(RuleWithActions *rule, Transaction *transaction) { rule->m_ruleId = m_ruleId; return true; } diff --git a/src/deps/src/ModSecurity/src/actions/rule_id.h b/src/deps/src/ModSecurity/src/actions/rule_id.h index b327d2a2a..2e26f87f5 100644 --- a/src/deps/src/ModSecurity/src/actions/rule_id.h +++ b/src/deps/src/ModSecurity/src/actions/rule_id.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,19 +25,19 @@ class Transaction; namespace modsecurity { class Transaction; -class Rule; +class RuleWithOperator; namespace actions { class RuleId : public Action { public: - explicit RuleId(std::string action) + explicit RuleId(const std::string &action) : Action(action, ConfigurationKind), m_ruleId(0) { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; private: double m_ruleId; diff --git a/src/deps/src/ModSecurity/src/actions/set_env.cc b/src/deps/src/ModSecurity/src/actions/set_env.cc index ad541703f..e1c3afdba 100644 --- a/src/deps/src/ModSecurity/src/actions/set_env.cc +++ b/src/deps/src/ModSecurity/src/actions/set_env.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,13 +31,13 @@ bool SetENV::init(std::string *error) { } -bool SetENV::evaluate(Rule *rule, Transaction *t) { +bool SetENV::evaluate(RuleWithActions *rule, Transaction *t) { std::string colNameExpanded(m_string->evaluate(t)); - ms_dbg_a(t, 8, "Setting envoriment variable: " - + colNameExpanded + "."); - - putenv(strdup(colNameExpanded.c_str())); + auto pair = utils::string::ssplit_pair(colNameExpanded, '='); + ms_dbg_a(t, 8, "Setting environment variable: " + + pair.first + " to " + pair.second); + setenv(pair.first.c_str(), pair.second.c_str(), /*overwrite*/ 1); return true; } diff --git a/src/deps/src/ModSecurity/src/actions/set_env.h b/src/deps/src/ModSecurity/src/actions/set_env.h index 194ee2394..33ccfc338 100644 --- a/src/deps/src/ModSecurity/src/actions/set_env.h +++ b/src/deps/src/ModSecurity/src/actions/set_env.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,14 +32,14 @@ namespace actions { class SetENV : public Action { public: - explicit SetENV(std::string _action) + explicit SetENV(const std::string &_action) : Action(_action) { } explicit SetENV(std::unique_ptr z) : Action("setenv", RunTimeOnlyIfMatchKind), m_string(std::move(z)) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: diff --git a/src/deps/src/ModSecurity/src/actions/set_rsc.cc b/src/deps/src/ModSecurity/src/actions/set_rsc.cc index c5fc10017..8464a9b68 100644 --- a/src/deps/src/ModSecurity/src/actions/set_rsc.cc +++ b/src/deps/src/ModSecurity/src/actions/set_rsc.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ bool SetRSC::init(std::string *error) { } -bool SetRSC::evaluate(Rule *rule, Transaction *t) { +bool SetRSC::evaluate(RuleWithActions *rule, Transaction *t) { std::string colNameExpanded(m_string->evaluate(t)); ms_dbg_a(t, 8, "RESOURCE initiated with value: \'" + colNameExpanded + "\'."); diff --git a/src/deps/src/ModSecurity/src/actions/set_rsc.h b/src/deps/src/ModSecurity/src/actions/set_rsc.h index b33540020..5913b7c79 100644 --- a/src/deps/src/ModSecurity/src/actions/set_rsc.h +++ b/src/deps/src/ModSecurity/src/actions/set_rsc.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,14 +32,14 @@ namespace actions { class SetRSC : public Action { public: - explicit SetRSC(std::string _action) + explicit SetRSC(const std::string &_action) : Action(_action) { } explicit SetRSC(std::unique_ptr z) : Action("setsrc", RunTimeOnlyIfMatchKind), m_string(std::move(z)) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: diff --git a/src/deps/src/ModSecurity/src/actions/set_sid.cc b/src/deps/src/ModSecurity/src/actions/set_sid.cc index ca9fed272..c7a0db687 100644 --- a/src/deps/src/ModSecurity/src/actions/set_sid.cc +++ b/src/deps/src/ModSecurity/src/actions/set_sid.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ bool SetSID::init(std::string *error) { } -bool SetSID::evaluate(Rule *rule, Transaction *t) { +bool SetSID::evaluate(RuleWithActions *rule, Transaction *t) { std::string colNameExpanded(m_string->evaluate(t)); ms_dbg_a(t, 8, "Session ID initiated with value: \'" + colNameExpanded + "\'."); diff --git a/src/deps/src/ModSecurity/src/actions/set_sid.h b/src/deps/src/ModSecurity/src/actions/set_sid.h index 727745dd3..64f8f3cc7 100644 --- a/src/deps/src/ModSecurity/src/actions/set_sid.h +++ b/src/deps/src/ModSecurity/src/actions/set_sid.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,14 +32,14 @@ namespace actions { class SetSID : public Action { public: - explicit SetSID(std::string _action) + explicit SetSID(const std::string &_action) : Action(_action) { } explicit SetSID(std::unique_ptr z) : Action("setsid", RunTimeOnlyIfMatchKind), m_string(std::move(z)) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: diff --git a/src/deps/src/ModSecurity/src/actions/set_uid.cc b/src/deps/src/ModSecurity/src/actions/set_uid.cc index 75d39b0c4..997df77b6 100644 --- a/src/deps/src/ModSecurity/src/actions/set_uid.cc +++ b/src/deps/src/ModSecurity/src/actions/set_uid.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ bool SetUID::init(std::string *error) { } -bool SetUID::evaluate(Rule *rule, Transaction *t) { +bool SetUID::evaluate(RuleWithActions *rule, Transaction *t) { std::string colNameExpanded(m_string->evaluate(t)); ms_dbg_a(t, 8, "User collection initiated with value: \'" + colNameExpanded + "\'."); diff --git a/src/deps/src/ModSecurity/src/actions/set_uid.h b/src/deps/src/ModSecurity/src/actions/set_uid.h index 38c5aaa79..b8c3a0db7 100644 --- a/src/deps/src/ModSecurity/src/actions/set_uid.h +++ b/src/deps/src/ModSecurity/src/actions/set_uid.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,14 +32,14 @@ namespace actions { class SetUID : public Action { public: - explicit SetUID(std::string _action) + explicit SetUID(const std::string &_action) : Action(_action) { } explicit SetUID(std::unique_ptr z) : Action("setuid", RunTimeOnlyIfMatchKind), m_string(std::move(z)) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: diff --git a/src/deps/src/ModSecurity/src/actions/set_var.cc b/src/deps/src/ModSecurity/src/actions/set_var.cc index 427e11f25..6befdf0cc 100644 --- a/src/deps/src/ModSecurity/src/actions/set_var.cc +++ b/src/deps/src/ModSecurity/src/actions/set_var.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,8 +19,8 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/transaction.h" -#include "modsecurity/rules.h" #include "modsecurity/rule.h" #include "src/utils/string.h" #include "src/variables/global.h" @@ -40,7 +40,7 @@ bool SetVar::init(std::string *error) { } -bool SetVar::evaluate(Rule *rule, Transaction *t) { +bool SetVar::evaluate(RuleWithActions *rule, Transaction *t) { std::string targetValue; std::string resolvedPre; @@ -49,7 +49,6 @@ bool SetVar::evaluate(Rule *rule, Transaction *t) { } std::string m_variableNameExpanded; - std::vector l; auto *v = m_variable.get(); variables::Tx_DynamicElement *tx = dynamic_cast< @@ -113,7 +112,8 @@ bool SetVar::evaluate(Rule *rule, Transaction *t) { try { std::vector l; - m_variable->evaluate(t, rule, &l); + RuleWithOperator *rr = dynamic_cast(rule); + m_variable->evaluate(t, rr, &l); if (l.size() == 0) { value = 0; } else { diff --git a/src/deps/src/ModSecurity/src/actions/set_var.h b/src/deps/src/ModSecurity/src/actions/set_var.h index fe123cc17..5fe9de032 100644 --- a/src/deps/src/ModSecurity/src/actions/set_var.h +++ b/src/deps/src/ModSecurity/src/actions/set_var.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,7 +25,7 @@ namespace modsecurity { class Transaction; -class Rule; +class RuleWithOperator; namespace actions { @@ -58,7 +58,7 @@ class SetVar : public Action { m_operation(operation), m_variable(std::move(variable)) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; bool init(std::string *error) override; private: diff --git a/src/deps/src/ModSecurity/src/actions/severity.cc b/src/deps/src/ModSecurity/src/actions/severity.cc index d90ce63b6..8344e1052 100644 --- a/src/deps/src/ModSecurity/src/actions/severity.cc +++ b/src/deps/src/ModSecurity/src/actions/severity.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,10 +19,10 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" -#include "modsecurity/rules.h" #include "src/utils/string.h" #include "modsecurity/rule_message.h" @@ -71,7 +71,7 @@ bool Severity::init(std::string *error) { } -bool Severity::evaluate(Rule *rule, Transaction *transaction, +bool Severity::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { ms_dbg_a(transaction, 9, "This rule severity is: " + \ std::to_string(this->m_severity) + " current transaction is: " + \ diff --git a/src/deps/src/ModSecurity/src/actions/severity.h b/src/deps/src/ModSecurity/src/actions/severity.h index e67633d69..32a223e00 100644 --- a/src/deps/src/ModSecurity/src/actions/severity.h +++ b/src/deps/src/ModSecurity/src/actions/severity.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,11 +31,11 @@ namespace actions { class Severity : public Action { public: - explicit Severity(std::string action) + explicit Severity(const std::string &action) : Action(action), m_severity(0) { } - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; bool init(std::string *error) override; diff --git a/src/deps/src/ModSecurity/src/actions/skip.cc b/src/deps/src/ModSecurity/src/actions/skip.cc index 1b618fe0b..fd2abfe21 100644 --- a/src/deps/src/ModSecurity/src/actions/skip.cc +++ b/src/deps/src/ModSecurity/src/actions/skip.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,9 +18,9 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" -#include "modsecurity/rules.h" namespace modsecurity { namespace actions { @@ -38,7 +38,7 @@ bool Skip::init(std::string *error) { } -bool Skip::evaluate(Rule *rule, Transaction *transaction) { +bool Skip::evaluate(RuleWithActions *rule, Transaction *transaction) { ms_dbg_a(transaction, 5, "Skipping the next " + \ std::to_string(m_skip_next) + " rules."); diff --git a/src/deps/src/ModSecurity/src/actions/skip.h b/src/deps/src/ModSecurity/src/actions/skip.h index 0d7160ee4..71e5d7aa0 100644 --- a/src/deps/src/ModSecurity/src/actions/skip.h +++ b/src/deps/src/ModSecurity/src/actions/skip.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,12 +29,12 @@ namespace actions { class Skip : public Action { public: - explicit Skip(std::string action) + explicit Skip(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_skip_next(0) { } bool init(std::string *error) override; - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; int m_skip_next; }; diff --git a/src/deps/src/ModSecurity/src/actions/skip_after.cc b/src/deps/src/ModSecurity/src/actions/skip_after.cc index ba07e73a2..64cccb48d 100644 --- a/src/deps/src/ModSecurity/src/actions/skip_after.cc +++ b/src/deps/src/ModSecurity/src/actions/skip_after.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,18 +18,18 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" -#include "modsecurity/rules.h" namespace modsecurity { namespace actions { -bool SkipAfter::evaluate(Rule *rule, Transaction *transaction) { - ms_dbg_a(transaction, 5, "Setting skipAfter for: " + m_parser_payload); - transaction->m_marker = m_parser_payload; +bool SkipAfter::evaluate(RuleWithActions *rule, Transaction *transaction) { + ms_dbg_a(transaction, 5, "Setting skipAfter for: " + *m_skipName); + transaction->addMarker(m_skipName); return true; } diff --git a/src/deps/src/ModSecurity/src/actions/skip_after.h b/src/deps/src/ModSecurity/src/actions/skip_after.h index a0017c090..f7e0680d7 100644 --- a/src/deps/src/ModSecurity/src/actions/skip_after.h +++ b/src/deps/src/ModSecurity/src/actions/skip_after.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -14,6 +14,7 @@ */ #include +#include #include "modsecurity/actions/action.h" @@ -29,10 +30,13 @@ namespace actions { class SkipAfter : public Action { public: - explicit SkipAfter(std::string action) - : Action(action, RunTimeOnlyIfMatchKind) { } + explicit SkipAfter(const std::string &action) + : Action(action, RunTimeOnlyIfMatchKind), + m_skipName(std::make_shared(m_parser_payload)) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; + private: + std::shared_ptr m_skipName; }; diff --git a/src/deps/src/ModSecurity/src/actions/tag.cc b/src/deps/src/ModSecurity/src/actions/tag.cc index 40a83324f..3b1b6fd53 100644 --- a/src/deps/src/ModSecurity/src/actions/tag.cc +++ b/src/deps/src/ModSecurity/src/actions/tag.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -24,6 +24,7 @@ #include "modsecurity/rule.h" #include "modsecurity/rule_message.h" +#ifdef MSC_DOCUMENTATION /** * Description: Assigns a tag (category) to a rule or a chain. * @@ -44,7 +45,7 @@ * * */ - +#endif namespace modsecurity { namespace actions { @@ -56,7 +57,7 @@ std::string Tag::getName(Transaction *transaction) { } -bool Tag::evaluate(Rule *rule, Transaction *transaction, +bool Tag::evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) { std::string tag = getName(transaction); ms_dbg_a(transaction, 9, "Rule tag: " + tag); diff --git a/src/deps/src/ModSecurity/src/actions/tag.h b/src/deps/src/ModSecurity/src/actions/tag.h index 10b6b33c5..75369f5f7 100644 --- a/src/deps/src/ModSecurity/src/actions/tag.h +++ b/src/deps/src/ModSecurity/src/actions/tag.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -38,7 +38,7 @@ class Tag : public Action { std::string getName(Transaction *transaction); - bool evaluate(Rule *rule, Transaction *transaction, + bool evaluate(RuleWithActions *rule, Transaction *transaction, std::shared_ptr rm) override; protected: diff --git a/src/deps/src/ModSecurity/src/actions/transformations/base64_decode.cc b/src/deps/src/ModSecurity/src/actions/transformations/base64_decode.cc index cc1189678..8ddfe2352 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/base64_decode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/base64_decode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace actions { namespace transformations { -std::string Base64Decode::evaluate(std::string value, +std::string Base64Decode::evaluate(const std::string &value, Transaction *transaction) { std::string ret = Utils::Base64::decode(value); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/base64_decode.h b/src/deps/src/ModSecurity/src/actions/transformations/base64_decode.h index e16c132fb..a82276990 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/base64_decode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/base64_decode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,9 +30,9 @@ namespace transformations { class Base64Decode : public Transformation { public: - explicit Base64Decode(std::string action) : Transformation(action) { } + explicit Base64Decode(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/base64_decode_ext.cc b/src/deps/src/ModSecurity/src/actions/transformations/base64_decode_ext.cc index 23d2ad3d1..ee8e4b5b2 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/base64_decode_ext.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/base64_decode_ext.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace actions { namespace transformations { -std::string Base64DecodeExt::evaluate(std::string value, +std::string Base64DecodeExt::evaluate(const std::string &value, Transaction *transaction) { std::string ret = Utils::Base64::decode_forgiven(value); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/base64_decode_ext.h b/src/deps/src/ModSecurity/src/actions/transformations/base64_decode_ext.h index 903ccdd02..ad0efbdc0 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/base64_decode_ext.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/base64_decode_ext.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,9 +30,9 @@ namespace transformations { class Base64DecodeExt : public Transformation { public: - explicit Base64DecodeExt(std::string action) : Transformation(action) { } + explicit Base64DecodeExt(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/base64_encode.cc b/src/deps/src/ModSecurity/src/actions/transformations/base64_encode.cc index a7671c3d0..8be748033 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/base64_encode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/base64_encode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace actions { namespace transformations { -std::string Base64Encode::evaluate(std::string value, +std::string Base64Encode::evaluate(const std::string &value, Transaction *transaction) { std::string ret = Utils::Base64::encode(value); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/base64_encode.h b/src/deps/src/ModSecurity/src/actions/transformations/base64_encode.h index b04d6b65f..0f7fd1fe5 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/base64_encode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/base64_encode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,9 +30,9 @@ namespace transformations { class Base64Encode : public Transformation { public: - explicit Base64Encode(std::string action) : Transformation(action) { } + explicit Base64Encode(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/cmd_line.cc b/src/deps/src/ModSecurity/src/actions/transformations/cmd_line.cc index 3042262d8..72087e36b 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/cmd_line.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/cmd_line.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ namespace actions { namespace transformations { -std::string CmdLine::evaluate(std::string value, +std::string CmdLine::evaluate(const std::string &value, Transaction *transaction) { std::string ret; int space = 0; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/cmd_line.h b/src/deps/src/ModSecurity/src/actions/transformations/cmd_line.h index 13843ad9b..851f29385 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/cmd_line.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/cmd_line.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,10 +30,10 @@ namespace transformations { class CmdLine : public Transformation { public: - explicit CmdLine(std::string action) + explicit CmdLine(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/compress_whitespace.cc b/src/deps/src/ModSecurity/src/actions/transformations/compress_whitespace.cc index b51654aa1..506de2483 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/compress_whitespace.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/compress_whitespace.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace modsecurity { namespace actions { namespace transformations { -CompressWhitespace::CompressWhitespace(std::string action) +CompressWhitespace::CompressWhitespace(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string CompressWhitespace::evaluate(std::string value, +std::string CompressWhitespace::evaluate(const std::string &value, Transaction *transaction) { std::string a; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/compress_whitespace.h b/src/deps/src/ModSecurity/src/actions/transformations/compress_whitespace.h index 3b5695953..184ddcfab 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/compress_whitespace.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/compress_whitespace.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,10 @@ namespace transformations { class CompressWhitespace : public Transformation { public: - explicit CompressWhitespace(std::string action); - std::string evaluate(std::string exp, + + explicit CompressWhitespace(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/css_decode.cc b/src/deps/src/ModSecurity/src/actions/transformations/css_decode.cc index ec41e4fbc..f80851238 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/css_decode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/css_decode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace actions { namespace transformations { -std::string CssDecode::evaluate(std::string value, +std::string CssDecode::evaluate(const std::string &value, Transaction *transaction) { char *tmp = reinterpret_cast( diff --git a/src/deps/src/ModSecurity/src/actions/transformations/css_decode.h b/src/deps/src/ModSecurity/src/actions/transformations/css_decode.h index 6861ea4b3..a6769bad3 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/css_decode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/css_decode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,9 +31,9 @@ namespace transformations { class CssDecode : public Transformation { public: - explicit CssDecode(std::string action) + explicit CssDecode(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; static int css_decode_inplace(unsigned char *input, int64_t input_len); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/escape_seq_decode.cc b/src/deps/src/ModSecurity/src/actions/transformations/escape_seq_decode.cc index 2525e3066..03303272e 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/escape_seq_decode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/escape_seq_decode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ namespace modsecurity { namespace actions { namespace transformations { -EscapeSeqDecode::EscapeSeqDecode(std::string action) +EscapeSeqDecode::EscapeSeqDecode(const std::string &action) : Transformation(action) { this->action_kind = 1; } @@ -140,7 +140,7 @@ int EscapeSeqDecode::ansi_c_sequences_decode_inplace(unsigned char *input, } -std::string EscapeSeqDecode::evaluate(std::string value, +std::string EscapeSeqDecode::evaluate(const std::string &value, Transaction *transaction) { unsigned char *tmp = (unsigned char *) malloc(sizeof(char) diff --git a/src/deps/src/ModSecurity/src/actions/transformations/escape_seq_decode.h b/src/deps/src/ModSecurity/src/actions/transformations/escape_seq_decode.h index 3ada2fbbb..d68f33b56 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/escape_seq_decode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/escape_seq_decode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,10 @@ namespace transformations { class EscapeSeqDecode : public Transformation { public: - explicit EscapeSeqDecode(std::string action); - std::string evaluate(std::string exp, + + explicit EscapeSeqDecode(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; int ansi_c_sequences_decode_inplace(unsigned char *input, int input_len); }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/hex_decode.cc b/src/deps/src/ModSecurity/src/actions/transformations/hex_decode.cc index 54e0cc8fe..e626bc5f3 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/hex_decode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/hex_decode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace actions { namespace transformations { -std::string HexDecode::evaluate(std::string value, +std::string HexDecode::evaluate(const std::string &value, Transaction *transaction) { std::string ret; unsigned char *input; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/hex_decode.h b/src/deps/src/ModSecurity/src/actions/transformations/hex_decode.h index fe9514387..a2f48c6d8 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/hex_decode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/hex_decode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,9 +30,9 @@ namespace transformations { class HexDecode : public Transformation { public: - explicit HexDecode(std::string action) : Transformation(action) { } + explicit HexDecode(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; static int inplace(unsigned char *data, int len); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/hex_encode.cc b/src/deps/src/ModSecurity/src/actions/transformations/hex_encode.cc index 4f55d1fe1..4e6121df6 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/hex_encode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/hex_encode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,12 +31,12 @@ namespace modsecurity { namespace actions { namespace transformations { -HexEncode::HexEncode(std::string action) +HexEncode::HexEncode(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string HexEncode::evaluate(std::string value, +std::string HexEncode::evaluate(const std::string &value, Transaction *transaction) { std::stringstream result; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/hex_encode.h b/src/deps/src/ModSecurity/src/actions/transformations/hex_encode.h index 74d126044..1ba39c56a 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/hex_encode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/hex_encode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,10 @@ namespace transformations { class HexEncode : public Transformation { public: - explicit HexEncode(std::string action); - std::string evaluate(std::string exp, + + explicit HexEncode(const std::string &action); + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/html_entity_decode.cc b/src/deps/src/ModSecurity/src/actions/transformations/html_entity_decode.cc index ed1198563..b9268df55 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/html_entity_decode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/html_entity_decode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,7 +33,7 @@ namespace actions { namespace transformations { -std::string HtmlEntityDecode::evaluate(std::string value, +std::string HtmlEntityDecode::evaluate(const std::string &value, Transaction *transaction) { std::string ret; unsigned char *input; @@ -60,7 +60,7 @@ int HtmlEntityDecode::inplace(unsigned char *input, uint64_t input_len) { unsigned char *d = input; int i, count; - if ((input == NULL) || (input_len <= 0)) { + if ((input == NULL) || (input_len == 0)) { return 0; } diff --git a/src/deps/src/ModSecurity/src/actions/transformations/html_entity_decode.h b/src/deps/src/ModSecurity/src/actions/transformations/html_entity_decode.h index bd1b52505..44fcc3231 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/html_entity_decode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/html_entity_decode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,10 +33,10 @@ namespace transformations { class HtmlEntityDecode : public Transformation { public: - explicit HtmlEntityDecode(std::string action) + explicit HtmlEntityDecode(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; static int inplace(unsigned char *input, uint64_t input_len); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/js_decode.cc b/src/deps/src/ModSecurity/src/actions/transformations/js_decode.cc index be8fce45b..2f4cf8bb5 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/js_decode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/js_decode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace actions { namespace transformations { -std::string JsDecode::evaluate(std::string value, +std::string JsDecode::evaluate(const std::string &value, Transaction *transaction) { std::string ret; unsigned char *input; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/js_decode.h b/src/deps/src/ModSecurity/src/actions/transformations/js_decode.h index 86f6b3306..60d6617b3 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/js_decode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/js_decode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,10 +30,10 @@ namespace transformations { class JsDecode : public Transformation { public: - explicit JsDecode(std::string action) + explicit JsDecode(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; static int inplace(unsigned char *input, uint64_t input_len); }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/length.cc b/src/deps/src/ModSecurity/src/actions/transformations/length.cc index 7c32f80fc..61015b82b 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/length.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/length.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace modsecurity { namespace actions { namespace transformations { -Length::Length(std::string action) +Length::Length(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string Length::evaluate(std::string value, +std::string Length::evaluate(const std::string &value, Transaction *transaction) { return std::to_string(value.size()); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/length.h b/src/deps/src/ModSecurity/src/actions/transformations/length.h index 0a2ef6bc3..8892a9dcd 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/length.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/length.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,10 @@ namespace transformations { class Length : public Transformation { public: - explicit Length(std::string action); - std::string evaluate(std::string exp, + + explicit Length(const std::string &action); + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/lower_case.cc b/src/deps/src/ModSecurity/src/actions/transformations/lower_case.cc index 8dd0bcae6..d00ab40cb 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/lower_case.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/lower_case.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -27,13 +27,14 @@ namespace actions { namespace transformations { -LowerCase::LowerCase(std::string a) +LowerCase::LowerCase(const std::string &a) : Transformation(a) { } -std::string LowerCase::evaluate(std::string value, +std::string LowerCase::evaluate(const std::string &val, Transaction *transaction) { std::locale loc; + std::string value(val); for (std::string::size_type i=0; i < value.length(); ++i) { value[i] = std::tolower(value[i], loc); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/lower_case.h b/src/deps/src/ModSecurity/src/actions/transformations/lower_case.h index 41e817614..590498405 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/lower_case.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/lower_case.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,8 +32,8 @@ namespace transformations { class LowerCase : public Transformation { public: - explicit LowerCase(std::string action); - std::string evaluate(std::string exp, + explicit LowerCase(const std::string &action); + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/md5.cc b/src/deps/src/ModSecurity/src/actions/transformations/md5.cc index 6453972d9..71c36bc30 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/md5.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/md5.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,9 +31,9 @@ namespace actions { namespace transformations { -std::string Md5::evaluate(std::string value, +std::string Md5::evaluate(const std::string &value, Transaction *transaction) { - std::string ret = Utils::Md5::digest(value); + std::string ret = Utils::Md5::digest(value); return ret; } diff --git a/src/deps/src/ModSecurity/src/actions/transformations/md5.h b/src/deps/src/ModSecurity/src/actions/transformations/md5.h index b53b21fbd..37f22473f 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/md5.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/md5.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,9 +30,9 @@ namespace transformations { class Md5 : public Transformation { public: - explicit Md5(std::string action) : Transformation(action) { } + explicit Md5(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/none.cc b/src/deps/src/ModSecurity/src/actions/transformations/none.cc index 880292fa9..f122bf035 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/none.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/none.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ namespace actions { namespace transformations { -std::string None::evaluate(std::string value, +std::string None::evaluate(const std::string &value, Transaction *transaction) { return value; } diff --git a/src/deps/src/ModSecurity/src/actions/transformations/none.h b/src/deps/src/ModSecurity/src/actions/transformations/none.h index 5d868d1fe..e8a0e9d95 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/none.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/none.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,11 +30,11 @@ namespace transformations { class None : public Transformation { public: - explicit None(std::string action) + explicit None(const std::string &action) : Transformation(action) { m_isNone = true; } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/normalise_path.cc b/src/deps/src/ModSecurity/src/actions/transformations/normalise_path.cc index 5d17e0ed3..e75b98498 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/normalise_path.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/normalise_path.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,12 +32,12 @@ namespace modsecurity { namespace actions { namespace transformations { -NormalisePath::NormalisePath(std::string action) +NormalisePath::NormalisePath(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string NormalisePath::evaluate(std::string value, +std::string NormalisePath::evaluate(const std::string &value, Transaction *transaction) { int changed = 0; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/normalise_path.h b/src/deps/src/ModSecurity/src/actions/transformations/normalise_path.h index 1df1ce55e..b3869bea0 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/normalise_path.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/normalise_path.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,10 @@ namespace transformations { class NormalisePath : public Transformation { public: - explicit NormalisePath(std::string action); - std::string evaluate(std::string exp, + + explicit NormalisePath(const std::string &action); + + std::string evaluate(const std::string &exp, Transaction *transaction) override; static int normalize_path_inplace(unsigned char *input, int input_len, diff --git a/src/deps/src/ModSecurity/src/actions/transformations/normalise_path_win.cc b/src/deps/src/ModSecurity/src/actions/transformations/normalise_path_win.cc index 16aa673c4..6c171a59c 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/normalise_path_win.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/normalise_path_win.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace actions { namespace transformations { -std::string NormalisePathWin::evaluate(std::string value, +std::string NormalisePathWin::evaluate(const std::string &value, Transaction *transaction) { int changed; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/normalise_path_win.h b/src/deps/src/ModSecurity/src/actions/transformations/normalise_path_win.h index f0449529b..a1f8c5f74 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/normalise_path_win.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/normalise_path_win.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,10 +30,10 @@ namespace transformations { class NormalisePathWin : public Transformation { public: - explicit NormalisePathWin(std::string action) + explicit NormalisePathWin(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/parity_even_7bit.cc b/src/deps/src/ModSecurity/src/actions/transformations/parity_even_7bit.cc index a1a877c10..2c0be31cd 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/parity_even_7bit.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/parity_even_7bit.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace actions { namespace transformations { -std::string ParityEven7bit::evaluate(std::string value, +std::string ParityEven7bit::evaluate(const std::string &value, Transaction *transaction) { std::string ret; unsigned char *input; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/parity_even_7bit.h b/src/deps/src/ModSecurity/src/actions/transformations/parity_even_7bit.h index 672c406ba..08aa88230 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/parity_even_7bit.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/parity_even_7bit.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,9 +30,9 @@ namespace transformations { class ParityEven7bit : public Transformation { public: - explicit ParityEven7bit(std::string action) : Transformation(action) { } + explicit ParityEven7bit(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, Transaction *transaction) override; + std::string evaluate(const std::string &exp, Transaction *transaction) override; static bool inplace(unsigned char *input, uint64_t input_len); }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/parity_odd_7bit.cc b/src/deps/src/ModSecurity/src/actions/transformations/parity_odd_7bit.cc index 7c328ab73..5ac38d20d 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/parity_odd_7bit.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/parity_odd_7bit.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace actions { namespace transformations { -std::string ParityOdd7bit::evaluate(std::string value, +std::string ParityOdd7bit::evaluate(const std::string &value, Transaction *transaction) { std::string ret; unsigned char *input; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/parity_odd_7bit.h b/src/deps/src/ModSecurity/src/actions/transformations/parity_odd_7bit.h index 14fa9ff85..8b7e34d28 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/parity_odd_7bit.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/parity_odd_7bit.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,9 +30,9 @@ namespace transformations { class ParityOdd7bit : public Transformation { public: - explicit ParityOdd7bit(std::string action) : Transformation(action) { } + explicit ParityOdd7bit(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, Transaction *transaction) override; + std::string evaluate(const std::string &exp, Transaction *transaction) override; static bool inplace(unsigned char *input, uint64_t input_len); }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/parity_zero_7bit.cc b/src/deps/src/ModSecurity/src/actions/transformations/parity_zero_7bit.cc index e28f63d19..7bb846362 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/parity_zero_7bit.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/parity_zero_7bit.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace actions { namespace transformations { -std::string ParityZero7bit::evaluate(std::string value, +std::string ParityZero7bit::evaluate(const std::string &value, Transaction *transaction) { std::string ret; unsigned char *input; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/parity_zero_7bit.h b/src/deps/src/ModSecurity/src/actions/transformations/parity_zero_7bit.h index 3904c3a4d..4b4ccd23e 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/parity_zero_7bit.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/parity_zero_7bit.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,9 +30,9 @@ namespace transformations { class ParityZero7bit : public Transformation { public: - explicit ParityZero7bit(std::string action) : Transformation(action) { } + explicit ParityZero7bit(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, Transaction *transaction) override; + std::string evaluate(const std::string &exp, Transaction *transaction) override; static bool inplace(unsigned char *input, uint64_t input_len); }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/remove_comments.cc b/src/deps/src/ModSecurity/src/actions/transformations/remove_comments.cc index 89a8c7064..043dd9505 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/remove_comments.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/remove_comments.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace actions { namespace transformations { -std::string RemoveComments::evaluate(std::string value, +std::string RemoveComments::evaluate(const std::string &value, Transaction *transaction) { std::string ret; unsigned char *input; @@ -59,14 +59,14 @@ std::string RemoveComments::evaluate(std::string value, } else if ((input[i] == '<') && (i + 1 < input_len) && (input[i + 1] == '!') && (i + 2 < input_len) && (input[i+2] == '-') && (i + 3 < input_len) - && (input[i + 3] == '-') && (incomment == 0)) { + && (input[i + 3] == '-')) { incomment = 1; i += 4; } else if ((input[i] == '-') && (i + 1 < input_len) - && (input[i + 1] == '-') && (incomment == 0)) { + && (input[i + 1] == '-')) { input[i] = ' '; break; - } else if (input[i] == '#' && (incomment == 0)) { + } else if (input[i] == '#') { input[i] = ' '; break; } else { diff --git a/src/deps/src/ModSecurity/src/actions/transformations/remove_comments.h b/src/deps/src/ModSecurity/src/actions/transformations/remove_comments.h index 481a1d14a..78dd213d6 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/remove_comments.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/remove_comments.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,9 +31,9 @@ namespace transformations { class RemoveComments : public Transformation { public: - explicit RemoveComments(std::string action) : Transformation(action) { } + explicit RemoveComments(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/remove_comments_char.cc b/src/deps/src/ModSecurity/src/actions/transformations/remove_comments_char.cc index 150235ba8..529f3a67f 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/remove_comments_char.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/remove_comments_char.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,14 +30,15 @@ namespace modsecurity { namespace actions { namespace transformations { -RemoveCommentsChar::RemoveCommentsChar(std::string action) +RemoveCommentsChar::RemoveCommentsChar(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string RemoveCommentsChar::evaluate(std::string value, +std::string RemoveCommentsChar::evaluate(const std::string &val, Transaction *transaction) { int64_t i; + std::string value(val); i = 0; while (i < value.size()) { diff --git a/src/deps/src/ModSecurity/src/actions/transformations/remove_comments_char.h b/src/deps/src/ModSecurity/src/actions/transformations/remove_comments_char.h index adae0a071..722aba592 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/remove_comments_char.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/remove_comments_char.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,9 @@ namespace transformations { class RemoveCommentsChar : public Transformation { public: - explicit RemoveCommentsChar(std::string action); - std::string evaluate(std::string exp, + explicit RemoveCommentsChar(const std::string &action); + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/remove_nulls.cc b/src/deps/src/ModSecurity/src/actions/transformations/remove_nulls.cc index 652d3774b..5dd576cb4 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/remove_nulls.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/remove_nulls.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,9 +33,10 @@ namespace actions { namespace transformations { -std::string RemoveNulls::evaluate(std::string value, +std::string RemoveNulls::evaluate(const std::string &val, Transaction *transaction) { int64_t i; + std::string value(val); i = 0; while (i < value.size()) { diff --git a/src/deps/src/ModSecurity/src/actions/transformations/remove_nulls.h b/src/deps/src/ModSecurity/src/actions/transformations/remove_nulls.h index f09fddfce..eeb33b363 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/remove_nulls.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/remove_nulls.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,10 +30,10 @@ namespace transformations { class RemoveNulls : public Transformation { public: - explicit RemoveNulls(std::string action) + explicit RemoveNulls(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/remove_whitespace.cc b/src/deps/src/ModSecurity/src/actions/transformations/remove_whitespace.cc index 4297a3ee0..b9ffcc064 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/remove_whitespace.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/remove_whitespace.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,26 +25,30 @@ #include "modsecurity/transaction.h" #include "src/actions/transformations/transformation.h" -#define NBSP 160 // non breaking space char namespace modsecurity { namespace actions { namespace transformations { -RemoveWhitespace::RemoveWhitespace(std::string action) +RemoveWhitespace::RemoveWhitespace(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string RemoveWhitespace::evaluate(std::string value, +std::string RemoveWhitespace::evaluate(const std::string &val, Transaction *transaction) { + std::string value(val); int64_t i = 0; + const char nonBreakingSpaces = 0xa0; + const char nonBreakingSpaces2 = 0xc2; // loop through all the chars while (i < value.size()) { // remove whitespaces and non breaking spaces (NBSP) - if (isspace(value[i]) || (value[i] == NBSP)) { + if (std::isspace(static_cast(value[i])) + || (value[i] == nonBreakingSpaces) + || value[i] == nonBreakingSpaces2) { value.erase(i, 1); } else { /* if the space is not a whitespace char, increment counter diff --git a/src/deps/src/ModSecurity/src/actions/transformations/remove_whitespace.h b/src/deps/src/ModSecurity/src/actions/transformations/remove_whitespace.h index ecafb34de..f977914cb 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/remove_whitespace.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/remove_whitespace.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,9 @@ namespace transformations { class RemoveWhitespace : public Transformation { public: - explicit RemoveWhitespace(std::string action); - std::string evaluate(std::string exp, + explicit RemoveWhitespace(const std::string &action); + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/replace_comments.cc b/src/deps/src/ModSecurity/src/actions/transformations/replace_comments.cc index b2c61086b..77e3e3b70 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/replace_comments.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/replace_comments.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,12 +31,12 @@ namespace modsecurity { namespace actions { namespace transformations { -ReplaceComments::ReplaceComments(std::string action) +ReplaceComments::ReplaceComments(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string ReplaceComments::evaluate(std::string value, +std::string ReplaceComments::evaluate(const std::string &value, Transaction *transaction) { uint64_t i, j, incomment; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/replace_comments.h b/src/deps/src/ModSecurity/src/actions/transformations/replace_comments.h index 1bbe735fd..6808f426c 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/replace_comments.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/replace_comments.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,10 @@ namespace transformations { class ReplaceComments : public Transformation { public: - explicit ReplaceComments(std::string action); - std::string evaluate(std::string exp, + + explicit ReplaceComments(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/replace_nulls.cc b/src/deps/src/ModSecurity/src/actions/transformations/replace_nulls.cc index 01996cc34..0a3714900 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/replace_nulls.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/replace_nulls.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,14 +30,15 @@ namespace modsecurity { namespace actions { namespace transformations { -ReplaceNulls::ReplaceNulls(std::string action) +ReplaceNulls::ReplaceNulls(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string ReplaceNulls::evaluate(std::string value, +std::string ReplaceNulls::evaluate(const std::string &val, Transaction *transaction) { int64_t i; + std::string value(val); i = 0; while (i < value.size()) { diff --git a/src/deps/src/ModSecurity/src/actions/transformations/replace_nulls.h b/src/deps/src/ModSecurity/src/actions/transformations/replace_nulls.h index 353a4943c..8e2d315fc 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/replace_nulls.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/replace_nulls.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,10 @@ namespace transformations { class ReplaceNulls : public Transformation { public: - explicit ReplaceNulls(std::string action); - std::string evaluate(std::string exp, + + explicit ReplaceNulls(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/sha1.cc b/src/deps/src/ModSecurity/src/actions/transformations/sha1.cc index 0e1f8bb23..9e0c7f53e 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/sha1.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/sha1.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,12 +31,12 @@ namespace modsecurity { namespace actions { namespace transformations { -Sha1::Sha1(std::string action) +Sha1::Sha1(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string Sha1::evaluate(std::string value, +std::string Sha1::evaluate(const std::string &value, Transaction *transaction) { return Utils::Sha1::digest(value); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/sha1.h b/src/deps/src/ModSecurity/src/actions/transformations/sha1.h index 61026decf..eb5fb3f13 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/sha1.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/sha1.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,8 @@ namespace transformations { class Sha1 : public Transformation { public: - explicit Sha1(std::string action); - std::string evaluate(std::string exp, + explicit Sha1(const std::string &action) ; + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/sql_hex_decode.cc b/src/deps/src/ModSecurity/src/actions/transformations/sql_hex_decode.cc index b5545ff80..8c8805ff6 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/sql_hex_decode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/sql_hex_decode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -41,7 +41,7 @@ namespace transformations { #define ISODIGIT(X) ((X >= '0') && (X <= '7')) #endif -std::string SqlHexDecode::evaluate(std::string value, +std::string SqlHexDecode::evaluate(const std::string &value, Transaction *transaction) { std::string ret; unsigned char *input; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/sql_hex_decode.h b/src/deps/src/ModSecurity/src/actions/transformations/sql_hex_decode.h index 6d05415dc..9a3afe0f5 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/sql_hex_decode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/sql_hex_decode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,9 +30,9 @@ namespace transformations { class SqlHexDecode : public Transformation { public: - explicit SqlHexDecode(std::string action) : Transformation(action) { } + explicit SqlHexDecode(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; static int inplace(unsigned char *data, int len); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/transformation.cc b/src/deps/src/ModSecurity/src/actions/transformations/transformation.cc index 77cbf7e4c..3b38431ad 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/transformation.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/transformation.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -69,7 +69,7 @@ namespace actions { namespace transformations { -std::string Transformation::evaluate(std::string value, +std::string Transformation::evaluate(const std::string &value, Transaction *transaction) { return value; } diff --git a/src/deps/src/ModSecurity/src/actions/transformations/transformation.h b/src/deps/src/ModSecurity/src/actions/transformations/transformation.h index 8741cf7e4..f1d81503e 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/transformation.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/transformation.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -35,7 +35,7 @@ class Transformation : public Action { explicit Transformation(const std::string& _action, int kind) : Action(_action, kind) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; static Transformation* instantiate(std::string a); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/trim.cc b/src/deps/src/ModSecurity/src/actions/transformations/trim.cc index cd70ac7dd..5902497f4 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/trim.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/trim.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,15 +32,25 @@ namespace transformations { std::string *Trim::ltrim(std::string *s) { - s->erase(s->begin(), std::find_if(s->begin(), s->end(), - std::not1(std::ptr_fun(std::isspace)))); + s->erase( + s->begin(), + std::find_if(s->begin(), s->end(), [](unsigned char c) { + return !std::isspace(c); + }) + ); + return s; } std::string *Trim::rtrim(std::string *s) { - s->erase(std::find_if(s->rbegin(), s->rend(), - std::not1(std::ptr_fun(std::isspace))).base(), s->end()); + s->erase( + std::find_if(s->rbegin(), s->rend(), [](unsigned char c) { + return !std::isspace(c); + }).base(), + s->end() + ); + return s; } @@ -50,15 +60,16 @@ std::string *Trim::trim(std::string *s) { } -Trim::Trim(std::string action) +Trim::Trim(const std::string &action) : Transformation(action) { this->action_kind = 1; } std::string -Trim::evaluate(std::string value, +Trim::evaluate(const std::string &val, Transaction *transaction) { + std::string value(val); return *this->trim(&value); } diff --git a/src/deps/src/ModSecurity/src/actions/transformations/trim.h b/src/deps/src/ModSecurity/src/actions/transformations/trim.h index 064e60837..ac16050cf 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/trim.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/trim.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,10 @@ namespace transformations { class Trim : public Transformation { public: - explicit Trim(std::string action); - std::string evaluate(std::string exp, + + explicit Trim(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; std::string *ltrim(std::string *s); diff --git a/src/deps/src/ModSecurity/src/actions/transformations/trim_left.cc b/src/deps/src/ModSecurity/src/actions/transformations/trim_left.cc index b2ea6af5b..50c0cc6aa 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/trim_left.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/trim_left.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,13 +33,14 @@ namespace transformations { -TrimLeft::TrimLeft(std::string action) +TrimLeft::TrimLeft(const std::string &action) : Trim(action) { this->action_kind = 1; } -std::string TrimLeft::evaluate(std::string value, +std::string TrimLeft::evaluate(const std::string &val, Transaction *transaction) { + std::string value(val); return *ltrim(&value); } diff --git a/src/deps/src/ModSecurity/src/actions/transformations/trim_left.h b/src/deps/src/ModSecurity/src/actions/transformations/trim_left.h index f665cd63d..54e4885c0 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/trim_left.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/trim_left.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,8 +31,9 @@ namespace transformations { class TrimLeft : public Trim { public: - explicit TrimLeft(std::string action); - std::string evaluate(std::string exp, + explicit TrimLeft(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/trim_right.cc b/src/deps/src/ModSecurity/src/actions/transformations/trim_right.cc index d543bd4b6..92383f7e0 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/trim_right.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/trim_right.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,13 +31,14 @@ namespace actions { namespace transformations { -TrimRight::TrimRight(std::string action) +TrimRight::TrimRight(const std::string &action) : Trim(action) { this->action_kind = 1; } -std::string TrimRight::evaluate(std::string value, +std::string TrimRight::evaluate(const std::string &val, Transaction *transaction) { + std::string value(val); return *this->rtrim(&value); } diff --git a/src/deps/src/ModSecurity/src/actions/transformations/trim_right.h b/src/deps/src/ModSecurity/src/actions/transformations/trim_right.h index d2b5e654e..9a96b4c5c 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/trim_right.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/trim_right.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,8 +31,9 @@ namespace transformations { class TrimRight : public Trim { public: - explicit TrimRight(std::string action); - std::string evaluate(std::string exp, + explicit TrimRight(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/upper_case.cc b/src/deps/src/ModSecurity/src/actions/transformations/upper_case.cc index ff082e8e0..118696ad4 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/upper_case.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/upper_case.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -27,12 +27,13 @@ namespace actions { namespace transformations { -UpperCase::UpperCase(std::string a) +UpperCase::UpperCase(const std::string &a) : Transformation(a) { } -std::string UpperCase::evaluate(std::string value, +std::string UpperCase::evaluate(const std::string &val, Transaction *transaction) { + std::string value(val); std::locale loc; for (std::string::size_type i=0; i < value.length(); ++i) { diff --git a/src/deps/src/ModSecurity/src/actions/transformations/upper_case.h b/src/deps/src/ModSecurity/src/actions/transformations/upper_case.h index 6738cd17c..f4a77220c 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/upper_case.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/upper_case.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,8 +32,9 @@ namespace transformations { class UpperCase : public Transformation { public: - explicit UpperCase(std::string action); - std::string evaluate(std::string exp, + explicit UpperCase(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/url_decode.cc b/src/deps/src/ModSecurity/src/actions/transformations/url_decode.cc index 3c2e3e6df..845c6a647 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/url_decode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/url_decode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,14 +32,14 @@ namespace actions { namespace transformations { -UrlDecode::UrlDecode(std::string action) +UrlDecode::UrlDecode(const std::string &action) : Transformation(action) { this->action_kind = 1; } -std::string UrlDecode::evaluate(std::string value, +std::string UrlDecode::evaluate(const std::string &value, Transaction *transaction) { - unsigned char *val = NULL; + unsigned char *val(NULL); int invalid_count = 0; int changed; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/url_decode.h b/src/deps/src/ModSecurity/src/actions/transformations/url_decode.h index 9777153bc..e965dae7f 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/url_decode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/url_decode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,8 +32,10 @@ namespace transformations { class UrlDecode : public Transformation { public: - explicit UrlDecode(std::string action); - std::string evaluate(std::string exp, + + explicit UrlDecode(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/url_decode_uni.cc b/src/deps/src/ModSecurity/src/actions/transformations/url_decode_uni.cc index 88de1a4eb..ad5b8111c 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/url_decode_uni.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/url_decode_uni.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,12 +25,12 @@ #include #include +#include "modsecurity/rules_set_properties.h" +#include "modsecurity/rules_set.h" #include "modsecurity/transaction.h" #include "src/actions/transformations/transformation.h" #include "src/utils/string.h" #include "src/utils/system.h" -#include "modsecurity/rules.h" -#include "modsecurity/rules_properties.h" namespace modsecurity { @@ -38,7 +38,7 @@ namespace actions { namespace transformations { -std::string UrlDecodeUni::evaluate(std::string value, +std::string UrlDecodeUni::evaluate(const std::string &value, Transaction *t) { std::string ret; unsigned char *input; @@ -108,7 +108,7 @@ int UrlDecodeUni::inplace(unsigned char *input, uint64_t input_len, } if (Code >= 0 && Code <= 65535) { - Rules *r = t->m_rules; + RulesSet *r = t->m_rules; hmap = r->m_unicodeMapTable.m_unicodeMapTable->at(Code); } } diff --git a/src/deps/src/ModSecurity/src/actions/transformations/url_decode_uni.h b/src/deps/src/ModSecurity/src/actions/transformations/url_decode_uni.h index fc08f9a90..d7b0dd215 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/url_decode_uni.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/url_decode_uni.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,8 +15,8 @@ #include +#include "modsecurity/rules_set_properties.h" #include "modsecurity/actions/action.h" -#include "modsecurity/rules_properties.h" #include "src/actions/transformations/transformation.h" #ifndef SRC_ACTIONS_TRANSFORMATIONS_URL_DECODE_UNI_H_ @@ -31,9 +31,9 @@ namespace transformations { class UrlDecodeUni : public Transformation { public: - explicit UrlDecodeUni(std::string action) : Transformation(action) { } + explicit UrlDecodeUni(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, Transaction *transaction) override; + std::string evaluate(const std::string &exp, Transaction *transaction) override; static int inplace(unsigned char *input, uint64_t input_len, Transaction *transaction); }; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/url_encode.cc b/src/deps/src/ModSecurity/src/actions/transformations/url_encode.cc index b3580a9f6..19ecb3349 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/url_encode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/url_encode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ namespace actions { namespace transformations { -UrlEncode::UrlEncode(std::string action) +UrlEncode::UrlEncode(const std::string &action) : Transformation(action) { this->action_kind = 1; } @@ -87,7 +87,7 @@ std::string UrlEncode::url_enc(const char *input, } -std::string UrlEncode::evaluate(std::string value, +std::string UrlEncode::evaluate(const std::string &value, Transaction *transaction) { int changed; diff --git a/src/deps/src/ModSecurity/src/actions/transformations/url_encode.h b/src/deps/src/ModSecurity/src/actions/transformations/url_encode.h index 4f1dcc136..a45be5640 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/url_encode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/url_encode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,8 +30,10 @@ namespace transformations { class UrlEncode : public Transformation { public: - explicit UrlEncode(std::string action); - std::string evaluate(std::string exp, + + explicit UrlEncode(const std::string &action) ; + + std::string evaluate(const std::string &exp, Transaction *transaction) override; std::string url_enc(const char *input, diff --git a/src/deps/src/ModSecurity/src/actions/transformations/utf8_to_unicode.cc b/src/deps/src/ModSecurity/src/actions/transformations/utf8_to_unicode.cc index 1cdf1ddb7..70c1f9c8e 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/utf8_to_unicode.cc +++ b/src/deps/src/ModSecurity/src/actions/transformations/utf8_to_unicode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,7 +33,7 @@ namespace actions { namespace transformations { -std::string Utf8ToUnicode::evaluate(std::string value, +std::string Utf8ToUnicode::evaluate(const std::string &value, Transaction *transaction) { std::string ret; unsigned char *input; @@ -63,7 +63,6 @@ std::string Utf8ToUnicode::evaluate(std::string value, char *Utf8ToUnicode::inplace(unsigned char *input, uint64_t input_len, int *changed) { - int length = 0; unsigned int count = 0; char *data; char *data_orig; @@ -120,6 +119,7 @@ char *Utf8ToUnicode::inplace(unsigned char *input, unicode_len = 2; count+=6; if (count <= len) { + int length = 0; /* compute character number */ d = ((c & 0x1F) << 6) | (*(utf + 1) & 0x3F); *data++ = '%'; @@ -169,6 +169,7 @@ char *Utf8ToUnicode::inplace(unsigned char *input, unicode_len = 3; count+=6; if (count <= len) { + int length = 0; /* compute character number */ d = ((c & 0x0F) << 12) | ((*(utf + 1) & 0x3F) << 6) @@ -229,6 +230,7 @@ char *Utf8ToUnicode::inplace(unsigned char *input, unicode_len = 4; count+=7; if (count <= len) { + int length = 0; /* compute character number */ d = ((c & 0x07) << 18) | ((*(utf + 1) & 0x3F) << 12) diff --git a/src/deps/src/ModSecurity/src/actions/transformations/utf8_to_unicode.h b/src/deps/src/ModSecurity/src/actions/transformations/utf8_to_unicode.h index 2a011517b..4d488410e 100644 --- a/src/deps/src/ModSecurity/src/actions/transformations/utf8_to_unicode.h +++ b/src/deps/src/ModSecurity/src/actions/transformations/utf8_to_unicode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -35,9 +35,9 @@ namespace transformations { class Utf8ToUnicode : public Transformation { public: - explicit Utf8ToUnicode(std::string action) : Transformation(action) { } + explicit Utf8ToUnicode(const std::string &action) : Transformation(action) { } - std::string evaluate(std::string exp, + std::string evaluate(const std::string &exp, Transaction *transaction) override; static char *inplace(unsigned char *input, uint64_t input_len, diff --git a/src/deps/src/ModSecurity/src/actions/ver.cc b/src/deps/src/ModSecurity/src/actions/ver.cc index 1f46cb15a..43b8b832e 100644 --- a/src/deps/src/ModSecurity/src/actions/ver.cc +++ b/src/deps/src/ModSecurity/src/actions/ver.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -27,7 +27,7 @@ namespace modsecurity { namespace actions { -bool Ver::evaluate(Rule *rule, Transaction *transaction) { +bool Ver::evaluate(RuleWithActions *rule, Transaction *transaction) { rule->m_ver = m_parser_payload; return true; } diff --git a/src/deps/src/ModSecurity/src/actions/ver.h b/src/deps/src/ModSecurity/src/actions/ver.h index 4d8e53f91..364d567b3 100644 --- a/src/deps/src/ModSecurity/src/actions/ver.h +++ b/src/deps/src/ModSecurity/src/actions/ver.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,9 +29,9 @@ namespace actions { class Ver : public Action { public: - explicit Ver(std::string action) : Action(action, ConfigurationKind) { } + explicit Ver(const std::string &action) : Action(action, ConfigurationKind) { } - bool evaluate(Rule *rule, Transaction *transaction) override; + bool evaluate(RuleWithActions *rule, Transaction *transaction) override; private: std::string m_ver; diff --git a/src/deps/src/ModSecurity/src/actions/xmlns.cc b/src/deps/src/ModSecurity/src/actions/xmlns.cc index 3a3e45de9..bca3b32fe 100644 --- a/src/deps/src/ModSecurity/src/actions/xmlns.cc +++ b/src/deps/src/ModSecurity/src/actions/xmlns.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/actions/xmlns.h b/src/deps/src/ModSecurity/src/actions/xmlns.h index 23dc83193..7b8e2f1e4 100644 --- a/src/deps/src/ModSecurity/src/actions/xmlns.h +++ b/src/deps/src/ModSecurity/src/actions/xmlns.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,9 +29,9 @@ namespace actions { class XmlNS : public Action { public: - explicit XmlNS(std::string action) : Action(action) { } + explicit XmlNS(const std::string &action) : Action(action) { } - bool evaluate(Rule *rule, Transaction *transaction) override { + bool evaluate(RuleWithActions *rule, Transaction *transaction) override { return true; } diff --git a/src/deps/src/ModSecurity/src/anchored_set_variable.cc b/src/deps/src/ModSecurity/src/anchored_set_variable.cc index 622d977c2..32bddf880 100644 --- a/src/deps/src/ModSecurity/src/anchored_set_variable.cc +++ b/src/deps/src/ModSecurity/src/anchored_set_variable.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,7 +28,8 @@ namespace modsecurity { -AnchoredSetVariable::AnchoredSetVariable(Transaction *t, std::string name) +AnchoredSetVariable::AnchoredSetVariable(Transaction *t, + const std::string &name) : m_transaction(t), m_name(name) { reserve(10); diff --git a/src/deps/src/ModSecurity/src/anchored_variable.cc b/src/deps/src/ModSecurity/src/anchored_variable.cc index 2bedc8fdd..63128bb28 100644 --- a/src/deps/src/ModSecurity/src/anchored_variable.cc +++ b/src/deps/src/ModSecurity/src/anchored_variable.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,12 +28,12 @@ namespace modsecurity { AnchoredVariable::AnchoredVariable(Transaction *t, - std::string name) + const std::string &name) : m_transaction(t), - m_var(NULL), m_offset(0), m_name(""), - m_value("") { + m_value(""), + m_var(NULL) { m_name.append(name); m_var = new VariableValue(&m_name); } diff --git a/src/deps/src/ModSecurity/src/audit_log/audit_log.cc b/src/deps/src/ModSecurity/src/audit_log/audit_log.cc index fb7fe6254..307819f07 100644 --- a/src/deps/src/ModSecurity/src/audit_log/audit_log.cc +++ b/src/deps/src/ModSecurity/src/audit_log/audit_log.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -21,6 +21,7 @@ #include +#include "modsecurity/transaction.h" #include "modsecurity/rule_message.h" #include "src/audit_log/writer/https.h" #include "src/audit_log/writer/parallel.h" @@ -54,15 +55,15 @@ AuditLog::AuditLog() : m_path1(""), m_path2(""), m_storage_dir(""), + m_format(NotSetAuditLogFormat), + m_parts(-1), m_filePermission(-1), m_directoryPermission(-1), - m_parts(-1), m_status(NotSetLogStatus), m_type(NotSetAuditLogType), - m_format(NotSetAuditLogFormat), m_relevant(""), m_writer(NULL), - m_refereceCount(1) { } + m_ctlAuditEngineActive(false) { } AuditLog::~AuditLog() { @@ -85,7 +86,7 @@ bool AuditLog::setFileMode(int permission) { } -int AuditLog::getFilePermission() { +int AuditLog::getFilePermission() const { if (m_filePermission == -1) { return m_defaultFilePermission; } @@ -93,7 +94,7 @@ int AuditLog::getFilePermission() { return m_filePermission; } -int AuditLog::getDirectoryPermission() { +int AuditLog::getDirectoryPermission() const { if (m_directoryPermission == -1) { return m_defaultDirectoryPermission; } @@ -192,7 +193,7 @@ bool AuditLog::setParts(const std::basic_string& new_parts) { } -int AuditLog::getParts() { +int AuditLog::getParts() const { if (m_parts == -1) { return m_defaultParts; } @@ -211,7 +212,8 @@ bool AuditLog::setType(AuditLogType audit_type) { bool AuditLog::init(std::string *error) { audit_log::writer::Writer *tmp_writer; - if (m_status == OffAuditLogStatus || m_status == NotSetLogStatus) { + if ((m_status == OffAuditLogStatus || m_status == NotSetLogStatus) + && !m_ctlAuditEngineActive) { if (m_writer) { delete m_writer; m_writer = NULL; @@ -242,21 +244,6 @@ bool AuditLog::init(std::string *error) { return false; } - /* Sanity check */ - if (m_status == RelevantOnlyAuditLogStatus) { - if (m_relevant.empty()) { - /* - error->assign("m_relevant cannot be null while status is set to " \ - "RelevantOnly"); - return false; - */ - // FIXME: this should be a warning. There is not point to - // have the logs on relevant only if nothing is relevant. - // - // Not returning an error to keep the compatibility with v2. - } - } - if (m_writer) { delete m_writer; } @@ -291,7 +278,13 @@ bool AuditLog::saveIfRelevant(Transaction *transaction) { bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) { bool saveAnyway = false; - if (m_status == OffAuditLogStatus || m_status == NotSetLogStatus) { + + AuditLogStatus transactionAuditLogStatus(m_status); + if (transaction->m_ctlAuditEngine != NotSetLogStatus) { + transactionAuditLogStatus = transaction->m_ctlAuditEngine; + } + + if (transactionAuditLogStatus == OffAuditLogStatus || transactionAuditLogStatus == NotSetLogStatus) { ms_dbg_a(transaction, 5, "Audit log engine was not set."); return true; } @@ -303,7 +296,7 @@ bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) { } } - if ((m_status == RelevantOnlyAuditLogStatus + if ((transactionAuditLogStatus == RelevantOnlyAuditLogStatus && this->isRelevant(transaction->m_httpCodeReturned) == false) && saveAnyway == false) { ms_dbg_a(transaction, 9, "Return code `" + @@ -369,6 +362,10 @@ bool AuditLog::merge(AuditLog *from, std::string *error) { m_format = from->m_format; } + if (from->m_ctlAuditEngineActive) { + m_ctlAuditEngineActive = from->m_ctlAuditEngineActive; + } + return init(error); } diff --git a/src/deps/src/ModSecurity/src/audit_log/writer/https.cc b/src/deps/src/ModSecurity/src/audit_log/writer/https.cc index 17cd37189..1f1b7e2fb 100644 --- a/src/deps/src/ModSecurity/src/audit_log/writer/https.cc +++ b/src/deps/src/ModSecurity/src/audit_log/writer/https.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,9 +25,9 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/audit_log.h" #include "modsecurity/transaction.h" -#include "modsecurity/rules.h" #include "src/utils/md5.h" #include "src/utils/https_client.h" @@ -53,7 +53,7 @@ bool Https::write(Transaction *transaction, int parts, std::string *error) { std::string log = transaction->toJSON(parts); m_http_client.setRequestType("application/json"); - m_http_client.setRequestBody(log.c_str()); + m_http_client.setRequestBody(log); m_http_client.download(m_audit->m_path1); return true; } diff --git a/src/deps/src/ModSecurity/src/audit_log/writer/https.h b/src/deps/src/ModSecurity/src/audit_log/writer/https.h index f802377ea..12988953e 100644 --- a/src/deps/src/ModSecurity/src/audit_log/writer/https.h +++ b/src/deps/src/ModSecurity/src/audit_log/writer/https.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/audit_log/writer/parallel.cc b/src/deps/src/ModSecurity/src/audit_log/writer/parallel.cc index bba7b284f..0a9777bfa 100644 --- a/src/deps/src/ModSecurity/src/audit_log/writer/parallel.cc +++ b/src/deps/src/ModSecurity/src/audit_log/writer/parallel.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -75,7 +75,7 @@ inline std::string Parallel::logFilePath(time_t *t, bool Parallel::init(std::string *error) { - bool ret = true; + bool ret; if (!m_audit->m_path1.empty()) { ret = utils::SharedFiles::getInstance().open(m_audit->m_path1, error); if (!ret) { @@ -119,7 +119,7 @@ bool Parallel::write(Transaction *transaction, int parts, std::string *error) { } std::string logPath = m_audit->m_storage_dir; - fileName = logPath + fileName + "-" + transaction->m_id; + fileName = logPath + fileName + "-" + *transaction->m_id.get(); if (logPath.empty()) { error->assign("Log path is not valid."); diff --git a/src/deps/src/ModSecurity/src/audit_log/writer/parallel.h b/src/deps/src/ModSecurity/src/audit_log/writer/parallel.h index 3a24a5594..04fad79f6 100644 --- a/src/deps/src/ModSecurity/src/audit_log/writer/parallel.h +++ b/src/deps/src/ModSecurity/src/audit_log/writer/parallel.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -22,7 +22,7 @@ #include "modsecurity/transaction.h" #include "modsecurity/audit_log.h" #include "src/utils/shared_files.h" -#include "modsecurity/rules.h" +#include "modsecurity/rules_set.h" #ifdef __cplusplus @@ -65,7 +65,7 @@ class Parallel : public Writer { YearMonthDayAndTimeFileName = 8, }; - inline std::string logFilePath(time_t *t, int part); + static inline std::string logFilePath(time_t *t, int part); }; } // namespace writer diff --git a/src/deps/src/ModSecurity/src/audit_log/writer/serial.cc b/src/deps/src/ModSecurity/src/audit_log/writer/serial.cc index 09e71d0aa..5d5f46229 100644 --- a/src/deps/src/ModSecurity/src/audit_log/writer/serial.cc +++ b/src/deps/src/ModSecurity/src/audit_log/writer/serial.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/audit_log/writer/serial.h b/src/deps/src/ModSecurity/src/audit_log/writer/serial.h index 0cc127596..34afa8643 100644 --- a/src/deps/src/ModSecurity/src/audit_log/writer/serial.h +++ b/src/deps/src/ModSecurity/src/audit_log/writer/serial.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -26,7 +26,7 @@ #include "src/utils/shared_files.h" #include "modsecurity/transaction.h" #include "modsecurity/audit_log.h" -#include "modsecurity/rules.h" +#include "modsecurity/rules_set.h" #ifdef __cplusplus diff --git a/src/deps/src/ModSecurity/src/audit_log/writer/writer.cc b/src/deps/src/ModSecurity/src/audit_log/writer/writer.cc index 44c1d9d3a..082e646d0 100644 --- a/src/deps/src/ModSecurity/src/audit_log/writer/writer.cc +++ b/src/deps/src/ModSecurity/src/audit_log/writer/writer.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/audit_log/writer/writer.h b/src/deps/src/ModSecurity/src/audit_log/writer/writer.h index a83c7e28c..093f271c1 100644 --- a/src/deps/src/ModSecurity/src/audit_log/writer/writer.h +++ b/src/deps/src/ModSecurity/src/audit_log/writer/writer.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -42,8 +42,7 @@ namespace writer { class Writer { public: explicit Writer(AuditLog *audit) - : m_audit(audit), - m_refereceCount(1) { } + : m_audit(audit) { } virtual ~Writer() { } @@ -51,25 +50,10 @@ class Writer { virtual bool write(Transaction *transaction, int parts, std::string *error) = 0; - void generateBoundary(std::string *boundary); - - void refCountIncrease() { - m_refereceCount++; - } - - - bool refCountDecreaseAndCheck() { - m_refereceCount--; - if (m_refereceCount == 0) { - delete this; - return true; - } - return false; - } + static void generateBoundary(std::string *boundary); protected: AuditLog *m_audit; - int m_refereceCount; }; diff --git a/src/deps/src/ModSecurity/src/collection/backend/in_memory-per_process.cc b/src/deps/src/ModSecurity/src/collection/backend/in_memory-per_process.cc index a3796486e..4963206e5 100644 --- a/src/deps/src/ModSecurity/src/collection/backend/in_memory-per_process.cc +++ b/src/deps/src/ModSecurity/src/collection/backend/in_memory-per_process.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -36,7 +36,7 @@ namespace collection { namespace backend { -InMemoryPerProcess::InMemoryPerProcess(std::string name) : +InMemoryPerProcess::InMemoryPerProcess(const std::string &name) : Collection(name) { this->reserve(1000); pthread_mutex_init(&m_lock, NULL); @@ -134,7 +134,7 @@ void InMemoryPerProcess::resolveRegularExpression(const std::string& var, //std::string name = std::string(var, var.find(":") + 2, // var.size() - var.find(":") - 3); //size_t keySize = col.size(); - Utils::Regex r(var); + Utils::Regex r(var, true); for (const auto& x : *this) { //if (x.first.size() <= keySize + 1) { diff --git a/src/deps/src/ModSecurity/src/collection/backend/in_memory-per_process.h b/src/deps/src/ModSecurity/src/collection/backend/in_memory-per_process.h index 98b6f7b95..4e4566c07 100644 --- a/src/deps/src/ModSecurity/src/collection/backend/in_memory-per_process.h +++ b/src/deps/src/ModSecurity/src/collection/backend/in_memory-per_process.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -72,7 +72,7 @@ class InMemoryPerProcess : /*std::hash*/MyHash, MyEqual>, public Collection { public: - explicit InMemoryPerProcess(std::string name); + explicit InMemoryPerProcess(const std::string &name); ~InMemoryPerProcess(); void store(std::string key, std::string value) override; diff --git a/src/deps/src/ModSecurity/src/collection/backend/lmdb.cc b/src/deps/src/ModSecurity/src/collection/backend/lmdb.cc index 2ad25a222..1ffca80ac 100644 --- a/src/deps/src/ModSecurity/src/collection/backend/lmdb.cc +++ b/src/deps/src/ModSecurity/src/collection/backend/lmdb.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -22,6 +22,8 @@ #include #include +#include + #include "modsecurity/variable_value.h" #include "src/utils/regex.h" #include "src/variables/variable.h" @@ -36,18 +38,22 @@ namespace backend { #ifdef WITH_LMDB LMDB::LMDB(std::string name) : - Collection(name), m_env(NULL) { - mdb_env_create(&m_env); - mdb_env_open(m_env, "./modsec-shared-collections", - MDB_WRITEMAP | MDB_NOSUBDIR, 0664); + Collection(name), m_env(NULL), isOpen(false) {} + +int LMDB::txn_begin(unsigned int flags, MDB_txn **ret) { + if (!isOpen) { + m_env = MDBEnvProvider::GetInstance().GetEnv(); + m_dbi = *(MDBEnvProvider::GetInstance().GetDBI()); + isOpen = true; + } + + if (MDBEnvProvider::GetInstance().isValid()) { + return mdb_txn_begin(m_env, NULL, flags, ret); + } else { + return -1; + } } - -LMDB::~LMDB() { - mdb_env_close(m_env); -} - - void LMDB::string2val(const std::string& str, MDB_val *val) { val->mv_size = sizeof(char)*(str.size()); val->mv_data = const_cast(str.c_str()); @@ -89,23 +95,6 @@ void LMDB::lmdb_debug(int rc, std::string op, std::string scope) { break; } std::cout << std::endl; - } else if (op == "dbi") { - std::cout << scope << ", LMDB failure while opening dbi: "; - switch (rc) { - case MDB_NOTFOUND: - std::cout << "not found: the specified database doesn't "; - std::cout << "exist in the environment and MDB_CREATE was "; - std::cout << "not specified."; - break; - case MDB_DBS_FULL: - std::cout << "full: too many databases have been opened. See "; - std::cout << "mdb_env_set_maxdbs()."; - break; - default: - std::cout << "not sure what is wrong."; - break; - } - std::cout << std::endl; } else if (op == "get") { std::cout << scope << ", LMDB failure while getting the key: "; switch (rc) { @@ -169,21 +158,15 @@ std::unique_ptr LMDB::resolveFirst(const std::string& var) { MDB_val mdb_value_ret; std::unique_ptr ret = NULL; MDB_txn *txn = NULL; - MDB_dbi dbi; string2val(var, &mdb_key); - rc = mdb_txn_begin(m_env, NULL, 0, &txn); + rc = txn_begin(MDB_RDONLY, &txn); lmdb_debug(rc, "txn", "resolveFirst"); if (rc != 0) { goto end_txn; } - rc = mdb_dbi_open(txn, NULL, MDB_CREATE | MDB_DUPSORT, &dbi); - lmdb_debug(rc, "dbi", "resolveFirst"); - if (rc != 0) { - goto end_dbi; - } - rc = mdb_get(txn, dbi, &mdb_key, &mdb_value_ret); + rc = mdb_get(txn, m_dbi, &mdb_key, &mdb_value_ret); lmdb_debug(rc, "get", "resolveFirst"); if (rc != 0) { goto end_get; @@ -194,8 +177,6 @@ std::unique_ptr LMDB::resolveFirst(const std::string& var) { mdb_value_ret.mv_size)); end_get: - mdb_dbi_close(m_env, dbi); -end_dbi: mdb_txn_abort(txn); end_txn: return ret; @@ -206,7 +187,6 @@ bool LMDB::storeOrUpdateFirst(const std::string &key, const std::string &value) { int rc; MDB_txn *txn; - MDB_dbi dbi; MDB_val mdb_key; MDB_val mdb_value; MDB_val mdb_value_ret; @@ -214,29 +194,23 @@ bool LMDB::storeOrUpdateFirst(const std::string &key, string2val(key, &mdb_key); string2val(value, &mdb_value); - rc = mdb_txn_begin(m_env, NULL, 0, &txn); + rc = txn_begin(0, &txn); lmdb_debug(rc, "txn", "storeOrUpdateFirst"); if (rc != 0) { goto end_txn; } - rc = mdb_dbi_open(txn, NULL, MDB_CREATE | MDB_DUPSORT, &dbi); - lmdb_debug(rc, "dbi", "storeOrUpdateFirst"); - if (rc != 0) { - goto end_dbi; - } - - rc = mdb_get(txn, dbi, &mdb_key, &mdb_value_ret); + rc = mdb_get(txn, m_dbi, &mdb_key, &mdb_value_ret); lmdb_debug(rc, "get", "storeOrUpdateFirst"); if (rc == 0) { - rc = mdb_del(txn, dbi, &mdb_key, &mdb_value_ret); + rc = mdb_del(txn, m_dbi, &mdb_key, &mdb_value_ret); lmdb_debug(rc, "del", "storeOrUpdateFirst"); if (rc != 0) { goto end_del; } } - rc = mdb_put(txn, dbi, &mdb_key, &mdb_value, 0); + rc = mdb_put(txn, m_dbi, &mdb_key, &mdb_value, 0); lmdb_debug(rc, "put", "storeOrUpdateFirst"); if (rc != 0) { goto end_put; @@ -248,14 +222,12 @@ bool LMDB::storeOrUpdateFirst(const std::string &key, goto end_commit; } -end_commit: end_put: end_del: - mdb_dbi_close(m_env, dbi); -end_dbi: if (rc != 0) { mdb_txn_abort(txn); } +end_commit: end_txn: return true; } @@ -265,26 +237,20 @@ void LMDB::resolveSingleMatch(const std::string& var, std::vector *l) { int rc; MDB_txn *txn; - MDB_dbi dbi; MDB_val mdb_key; MDB_val mdb_value; MDB_val mdb_value_ret; MDB_cursor *cursor; - rc = mdb_txn_begin(m_env, NULL, 0, &txn); + rc = txn_begin(MDB_RDONLY, &txn); lmdb_debug(rc, "txn", "resolveSingleMatch"); if (rc != 0) { goto end_txn; } - rc = mdb_dbi_open(txn, NULL, MDB_CREATE | MDB_DUPSORT, &dbi); - lmdb_debug(rc, "dbi", "resolveSingleMatch"); - if (rc != 0) { - goto end_dbi; - } string2val(var, &mdb_key); - rc = mdb_cursor_open(txn, dbi, &cursor); + mdb_cursor_open(txn, m_dbi, &cursor); while ((rc = mdb_cursor_get(cursor, &mdb_key, &mdb_value_ret, MDB_NEXT_DUP)) == 0) { std::string *a = new std::string( @@ -295,9 +261,6 @@ void LMDB::resolveSingleMatch(const std::string& var, } mdb_cursor_close(cursor); - - mdb_dbi_close(m_env, dbi); -end_dbi: mdb_txn_abort(txn); end_txn: return; @@ -307,24 +270,18 @@ end_txn: void LMDB::store(std::string key, std::string value) { MDB_val mdb_key, mdb_data; MDB_txn *txn = NULL; - MDB_dbi dbi; int rc; MDB_stat mst; - rc = mdb_txn_begin(m_env, NULL, 0, &txn); + rc = txn_begin(0, &txn); lmdb_debug(rc, "txn", "store"); if (rc != 0) { goto end_txn; } - rc = mdb_dbi_open(txn, NULL, MDB_CREATE | MDB_DUPSORT, &dbi); - lmdb_debug(rc, "dbi", "store"); - if (rc != 0) { - goto end_dbi; - } string2val(key, &mdb_key); string2val(value, &mdb_data); - rc = mdb_put(txn, dbi, &mdb_key, &mdb_data, 0); + rc = mdb_put(txn, m_dbi, &mdb_key, &mdb_data, 0); lmdb_debug(rc, "put", "store"); if (rc != 0) { goto end_put; @@ -336,13 +293,12 @@ void LMDB::store(std::string key, std::string value) { goto end_commit; } -end_commit: end_put: - mdb_dbi_close(m_env, dbi); end_dbi: if (rc != 0) { mdb_txn_abort(txn); } +end_commit: end_txn: return; } @@ -352,39 +308,32 @@ bool LMDB::updateFirst(const std::string &key, const std::string &value) { int rc; MDB_txn *txn; - MDB_dbi dbi; MDB_val mdb_key; MDB_val mdb_value; MDB_val mdb_value_ret; - rc = mdb_txn_begin(m_env, NULL, 0, &txn); + rc = txn_begin(0, &txn); lmdb_debug(rc, "txn", "updateFirst"); if (rc != 0) { goto end_txn; } - rc = mdb_dbi_open(txn, NULL, MDB_CREATE | MDB_DUPSORT, &dbi); - lmdb_debug(rc, "dbi", "updateFirst"); - if (rc != 0) { - goto end_dbi; - } - string2val(key, &mdb_key); string2val(value, &mdb_value); - rc = mdb_get(txn, dbi, &mdb_key, &mdb_value_ret); + rc = mdb_get(txn, m_dbi, &mdb_key, &mdb_value_ret); lmdb_debug(rc, "get", "updateFirst"); if (rc != 0) { goto end_get; } - rc = mdb_del(txn, dbi, &mdb_key, &mdb_value_ret); + rc = mdb_del(txn, m_dbi, &mdb_key, &mdb_value_ret); lmdb_debug(rc, "del", "updateFirst"); if (rc != 0) { goto end_del; } - rc = mdb_put(txn, dbi, &mdb_key, &mdb_value, 0); + rc = mdb_put(txn, m_dbi, &mdb_key, &mdb_value, 0); lmdb_debug(rc, "put", "updateFirst"); if (rc != 0) { goto end_put; @@ -396,15 +345,13 @@ bool LMDB::updateFirst(const std::string &key, goto end_commit; } -end_commit: end_put: end_del: end_get: - mdb_dbi_close(m_env, dbi); -end_dbi: if (rc != 0) { mdb_txn_abort(txn); } +end_commit: end_txn: return rc == 0; @@ -414,33 +361,26 @@ end_txn: void LMDB::del(const std::string& key) { int rc; MDB_txn *txn; - MDB_dbi dbi; MDB_val mdb_key; MDB_val mdb_value; MDB_val mdb_value_ret; MDB_stat mst; - rc = mdb_txn_begin(m_env, NULL, 0, &txn); + rc = txn_begin(0, &txn); lmdb_debug(rc, "txn", "del"); if (rc != 0) { goto end_txn; } - rc = mdb_dbi_open(txn, NULL, MDB_CREATE | MDB_DUPSORT, &dbi); - lmdb_debug(rc, "dbi", "del"); - if (rc != 0) { - goto end_dbi; - } - string2val(key, &mdb_key); - rc = mdb_get(txn, dbi, &mdb_key, &mdb_value_ret); + rc = mdb_get(txn, m_dbi, &mdb_key, &mdb_value_ret); lmdb_debug(rc, "get", "del"); if (rc != 0) { goto end_get; } - rc = mdb_del(txn, dbi, &mdb_key, &mdb_value_ret); + rc = mdb_del(txn, m_dbi, &mdb_key, &mdb_value_ret); lmdb_debug(rc, "del", "del"); if (rc != 0) { goto end_del; @@ -452,14 +392,12 @@ void LMDB::del(const std::string& key) { goto end_commit; } -end_commit: end_del: end_get: - mdb_dbi_close(m_env, dbi); -end_dbi: if (rc != 0) { mdb_txn_abort(txn); } +end_commit: end_txn: return; } @@ -470,25 +408,18 @@ void LMDB::resolveMultiMatches(const std::string& var, variables::KeyExclusions &ke) { MDB_val key, data; MDB_txn *txn = NULL; - MDB_dbi dbi; int rc; MDB_stat mst; size_t keySize = var.size(); MDB_cursor *cursor; - rc = mdb_txn_begin(m_env, NULL, 0, &txn); + rc = txn_begin(MDB_RDONLY, &txn); lmdb_debug(rc, "txn", "resolveMultiMatches"); if (rc != 0) { goto end_txn; } - rc = mdb_dbi_open(txn, NULL, MDB_CREATE | MDB_DUPSORT, &dbi); - lmdb_debug(rc, "dbi", "resolveMultiMatches"); - if (rc != 0) { - goto end_dbi; - } - - rc = mdb_cursor_open(txn, dbi, &cursor); + rc = mdb_cursor_open(txn, m_dbi, &cursor); lmdb_debug(rc, "cursor_open", "resolveMultiMatches"); if (rc != 0) { goto end_cursor_open; @@ -519,8 +450,6 @@ void LMDB::resolveMultiMatches(const std::string& var, mdb_cursor_close(cursor); end_cursor_open: - mdb_dbi_close(m_env, dbi); -end_dbi: mdb_txn_abort(txn); end_txn: return; @@ -532,27 +461,19 @@ void LMDB::resolveRegularExpression(const std::string& var, variables::KeyExclusions &ke) { MDB_val key, data; MDB_txn *txn = NULL; - MDB_dbi dbi; int rc; MDB_stat mst; MDB_cursor *cursor; - size_t pos; - Utils::Regex r(var); + Utils::Regex r(var, true); - rc = mdb_txn_begin(m_env, NULL, 0, &txn); + rc = txn_begin(MDB_RDONLY, &txn); lmdb_debug(rc, "txn", "resolveRegularExpression"); if (rc != 0) { goto end_txn; } - rc = mdb_dbi_open(txn, NULL, MDB_CREATE | MDB_DUPSORT, &dbi); - lmdb_debug(rc, "dbi", "resolveRegularExpression"); - if (rc != 0) { - goto end_dbi; - } - - rc = mdb_cursor_open(txn, dbi, &cursor); + rc = mdb_cursor_open(txn, m_dbi, &cursor); lmdb_debug(rc, "cursor_open", "resolveRegularExpression"); if (rc != 0) { goto end_cursor_open; @@ -579,13 +500,44 @@ void LMDB::resolveRegularExpression(const std::string& var, mdb_cursor_close(cursor); end_cursor_open: - mdb_dbi_close(m_env, dbi); -end_dbi: mdb_txn_abort(txn); end_txn: return; } + +MDBEnvProvider::MDBEnvProvider() : m_env(NULL), valid(false) { + int rc; + MDB_txn *txn; + mdb_env_create(&m_env); + rc = mdb_env_open(m_env, "./modsec-shared-collections", + MDB_WRITEMAP | MDB_NOSUBDIR, 0664); + + if (rc == 0) { + valid = true; + mdb_txn_begin(m_env, NULL, 0, &txn); + mdb_dbi_open(txn, NULL, MDB_CREATE | MDB_DUPSORT, &m_dbi); + mdb_txn_commit(txn); + } +} + +MDB_env* MDBEnvProvider::GetEnv() { + return m_env; +} + +MDB_dbi* MDBEnvProvider::GetDBI() { + return &m_dbi; +} + +bool MDBEnvProvider::isValid() { + return valid; +} + +MDBEnvProvider::~MDBEnvProvider() { + mdb_dbi_close(m_env, m_dbi); + mdb_env_close(m_env); +} + #endif } // namespace backend diff --git a/src/deps/src/ModSecurity/src/collection/backend/lmdb.h b/src/deps/src/ModSecurity/src/collection/backend/lmdb.h index 60b8ff072..3baa91457 100644 --- a/src/deps/src/ModSecurity/src/collection/backend/lmdb.h +++ b/src/deps/src/ModSecurity/src/collection/backend/lmdb.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -48,11 +48,56 @@ namespace modsecurity { namespace collection { namespace backend { + +/** + * The MDBEnvProvider class defines the `GetInstance` method that serves as an + * alternative to constructor and lets clients access the same instance of this + * class over and over. Its used to provide single MDB_env instance for each collection + * that uses lmdb to store and retrieve data. That approach satisfies lmdb requirement: + * + * "LMDB uses POSIX locks on files, and these locks have issues if one process opens + * a file multiple times. Because of this, do not mdb_env_open() a file multiple + * times from a single process." + * + * Creation of MDB_env is delayed to moment when first transaction is opened. + * This approach prevents passing env object to forked processes. + * In that way next lmdb requirement be satisfied: + * + * "Use an MDB_env* in the process which opened it, without fork()ing." + */ +class MDBEnvProvider { + + public: + MDBEnvProvider(MDBEnvProvider &other) = delete; + void operator=(const MDBEnvProvider &) = delete; + + /** + * This is the static method that controls the access to the singleton + * instance. On the first run, it creates a singleton object and places it + * into the static field. On subsequent runs, it returns the client existing + * object stored in the static field (Meyers Singleton implementation). + */ + static MDBEnvProvider& GetInstance() { + static MDBEnvProvider instance; + return instance; + } + MDB_env* GetEnv(); + MDB_dbi* GetDBI(); + bool isValid(); + + ~MDBEnvProvider(); + private: + MDB_env *m_env; + MDB_dbi m_dbi; + bool valid; + + MDBEnvProvider(); +}; + class LMDB : public Collection { public: explicit LMDB(std::string name); - ~LMDB(); void store(std::string key, std::string value) override; bool storeOrUpdateFirst(const std::string &key, @@ -75,10 +120,13 @@ class LMDB : variables::KeyExclusions &ke) override; private: + int txn_begin(unsigned int flags, MDB_txn **ret); void string2val(const std::string& str, MDB_val *val); void inline lmdb_debug(int rc, std::string op, std::string scope); MDB_env *m_env; + MDB_dbi m_dbi; + bool isOpen; }; } // namespace backend diff --git a/src/deps/src/ModSecurity/src/collection/collections.cc b/src/deps/src/ModSecurity/src/collection/collections.cc index c03d0d356..3e810a48e 100644 --- a/src/deps/src/ModSecurity/src/collection/collections.cc +++ b/src/deps/src/ModSecurity/src/collection/collections.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -36,14 +36,17 @@ namespace collection { Collections::Collections(Collection *global, Collection *ip, Collection *session, Collection *user, - Collection *resource) : m_global_collection_key(""), + Collection *resource) + : m_global_collection_key(""), m_ip_collection_key(""), + m_session_collection_key(""), + m_user_collection_key(""), m_resource_collection_key(""), m_global_collection(global), - m_resource_collection(resource), m_ip_collection(ip), m_session_collection(session), m_user_collection(user), + m_resource_collection(resource), m_tx_collection(new backend::InMemoryPerProcess("TX")) { } diff --git a/src/deps/src/ModSecurity/src/debug_log/debug_log.cc b/src/deps/src/ModSecurity/src/debug_log/debug_log.cc index f863735fe..54d86bda0 100644 --- a/src/deps/src/ModSecurity/src/debug_log/debug_log.cc +++ b/src/deps/src/ModSecurity/src/debug_log/debug_log.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/debug_log/debug_log_writer.cc b/src/deps/src/ModSecurity/src/debug_log/debug_log_writer.cc index 1ae8e94a3..86facfed3 100644 --- a/src/deps/src/ModSecurity/src/debug_log/debug_log_writer.cc +++ b/src/deps/src/ModSecurity/src/debug_log/debug_log_writer.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/debug_log/debug_log_writer.h b/src/deps/src/ModSecurity/src/debug_log/debug_log_writer.h index 0fdba01bc..1f4f43df5 100644 --- a/src/deps/src/ModSecurity/src/debug_log/debug_log_writer.h +++ b/src/deps/src/ModSecurity/src/debug_log/debug_log_writer.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -40,9 +40,9 @@ class DebugLogWriter { return instance; } - void write_log(const std::string& file, const std::string& msg); - void close(const std::string& m_fileName); - int open(const std::string& m_fileName, std::string *error); + static void write_log(const std::string& file, const std::string& msg); + static void close(const std::string& m_fileName); + static int open(const std::string& m_fileName, std::string *error); private: DebugLogWriter() : m_first(NULL) { } diff --git a/src/deps/src/ModSecurity/src/debug_log_writer_agent.h b/src/deps/src/ModSecurity/src/debug_log_writer_agent.h index ae4efc0e9..43b45b2ad 100644 --- a/src/deps/src/ModSecurity/src/debug_log_writer_agent.h +++ b/src/deps/src/ModSecurity/src/debug_log_writer_agent.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,19 +33,7 @@ class DebugLogWriterAgent : public std::ofstream { } void write(const std::string& msg); - bool refCountDecreaseAndCheck() { - this->m_referenceCount--; - if (this->m_referenceCount == 0) { - return true; - } - return false; - } - void refCountIncrease() { - this->m_referenceCount++; - } - - int m_referenceCount; std::string m_fileName; }; diff --git a/src/deps/src/ModSecurity/src/engine/lua.cc b/src/deps/src/ModSecurity/src/engine/lua.cc index 12f1ba450..0fac4f647 100644 --- a/src/deps/src/ModSecurity/src/engine/lua.cc +++ b/src/deps/src/ModSecurity/src/engine/lua.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -39,7 +39,7 @@ namespace modsecurity { namespace engine { -bool Lua::isCompatible(std::string script, Lua *l, std::string *error) { +bool Lua::isCompatible(const std::string &script, Lua *l, std::string *error) { #ifdef WITH_LUA std::string lua(".lua"); std::string err; @@ -63,10 +63,9 @@ bool Lua::isCompatible(std::string script, Lua *l, std::string *error) { } -bool Lua::load(std::string script, std::string *err) { +bool Lua::load(const std::string &script, std::string *err) { #ifdef WITH_LUA - lua_State *L = NULL; - L = luaL_newstate(); + lua_State *L = luaL_newstate(); luaL_openlibs(L); m_scriptName = script; @@ -155,7 +154,7 @@ int Lua::run(Transaction *t, const std::string &str) { case LUA_ERRMEM: e.assign("Memory error. "); break; -#ifndef WITH_LUA_5_1 +#if !defined(WITH_LUA_5_1) and !defined(WITH_LUA_5_4) case LUA_ERRGCMM: e.assign("Garbage Collector error. "); break; @@ -234,7 +233,7 @@ err: #ifdef WITH_LUA int Lua::log(lua_State *L) { - const Transaction *t = NULL; + const Transaction *t(NULL); const char *text; int level; @@ -256,9 +255,9 @@ int Lua::log(lua_State *L) { int Lua::getvar(lua_State *L) { - const char *varname = NULL; - Transaction *t = NULL; - void *z = NULL; + const char *varname(NULL); + Transaction *t(NULL); + void *z(NULL); /* Retrieve parameters. */ varname = reinterpret_cast(luaL_checkstring(L, 1)); @@ -282,9 +281,9 @@ int Lua::getvar(lua_State *L) { int Lua::getvars(lua_State *L) { - const char *varname = NULL; - Transaction *t = NULL; - void *z = NULL; + const char *varname(NULL); + Transaction *t(NULL); + void *z(NULL); std::vector l; int idx = 1; @@ -323,16 +322,15 @@ int Lua::getvars(lua_State *L) { int Lua::setvar(lua_State *L) { - Transaction *t = NULL; - const char *var_value = NULL; - const char *var_name = NULL; + Transaction *t(NULL); + const char *var_value(NULL); + const char *var_name(NULL); std::string vname; std::string collection; std::string variableName; int nargs = lua_gettop(L); - char *chr = NULL; size_t pos; - void *z = NULL; + void *z(NULL); lua_getglobal(L, "__transaction"); z = const_cast(lua_topointer(L, -1)); @@ -453,7 +451,7 @@ std::string Lua::applyTransformations(lua_State *L, Transaction *t, } if (lua_isstring(L, idx)) { - const char *name = NULL; + const char *name(NULL); name = reinterpret_cast(luaL_checkstring(L, idx)); actions::transformations::Transformation *tfn = \ diff --git a/src/deps/src/ModSecurity/src/engine/lua.h b/src/deps/src/ModSecurity/src/engine/lua.h index 9a0c0c47a..9a678fd74 100644 --- a/src/deps/src/ModSecurity/src/engine/lua.h +++ b/src/deps/src/ModSecurity/src/engine/lua.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -45,15 +45,14 @@ class LuaScriptBlob { void write(const void *data, size_t len) { - unsigned char *d = NULL; - d = (unsigned char *)realloc((unsigned char *)m_data, len + m_len); + unsigned char *d = (unsigned char *)realloc((unsigned char *)m_data, len + m_len); std::memcpy(d + m_len, data, len); m_len = m_len + len; m_data = d; } - const char *read(size_t *len) { + const char *read(size_t *len) const { *len = m_len; return (const char *)m_data; } @@ -68,9 +67,9 @@ class Lua { public: Lua() { } - bool load(std::string script, std::string *err); + bool load(const std::string &script, std::string *err); int run(Transaction *t, const std::string &str=""); - static bool isCompatible(std::string script, Lua *l, std::string *error); + static bool isCompatible(const std::string &script, Lua *l, std::string *error); #ifdef WITH_LUA static int blob_keeper(lua_State *L, const void *p, size_t sz, void *ud); diff --git a/src/deps/src/ModSecurity/src/modsecurity.cc b/src/deps/src/ModSecurity/src/modsecurity.cc index ab9bba2ef..854ec31ea 100644 --- a/src/deps/src/ModSecurity/src/modsecurity.cc +++ b/src/deps/src/ModSecurity/src/modsecurity.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -60,8 +60,7 @@ namespace modsecurity { * @endcode */ ModSecurity::ModSecurity() - : m_connector(""), - m_whoami(""), + : #ifdef WITH_LMDB m_global_collection(new collection::backend::LMDB("GLOBAL")), m_resource_collection(new collection::backend::LMDB("RESOURCE")), @@ -70,14 +69,17 @@ ModSecurity::ModSecurity() m_user_collection(new collection::backend::LMDB("USER")), #else m_global_collection(new collection::backend::InMemoryPerProcess("GLOBAL")), - m_ip_collection(new collection::backend::InMemoryPerProcess("IP")), m_resource_collection( new collection::backend::InMemoryPerProcess("RESOURCE")), + m_ip_collection(new collection::backend::InMemoryPerProcess("IP")), m_session_collection( new collection::backend::InMemoryPerProcess("SESSION")), m_user_collection(new collection::backend::InMemoryPerProcess("USER")), #endif - m_logCb(NULL) { + m_connector(""), + m_whoami(""), + m_logCb(NULL), + m_logProperties(0) { UniqueId::uniqueId(); srand(time(NULL)); #ifdef MSC_WITH_CURL @@ -136,6 +138,8 @@ const std::string& ModSecurity::whoAmI() { platform = "MacOSX"; #elif FREEBSD platform = "FreeBSD"; +#elif DRAGONFLY + platform = "DragonFlyBSD"; #elif NETBSD platform = "NetBSD"; #elif WIN32 @@ -167,7 +171,7 @@ const std::string& ModSecurity::whoAmI() { * @param connector Information about the connector. * */ -void ModSecurity::setConnectorInformation(std::string connector) { +void ModSecurity::setConnectorInformation(const std::string &connector) { m_connector = connector; } @@ -182,7 +186,7 @@ void ModSecurity::setConnectorInformation(std::string connector) { * @retval "" Nothing was informed about the connector. * @retval !="" Connector information. */ -const std::string& ModSecurity::getConnectorInformation() { +const std::string& ModSecurity::getConnectorInformation() const { return m_connector; } @@ -224,7 +228,6 @@ int ModSecurity::processContentOffset(const char *content, size_t len, Utils::Regex transformations("t:(?:(?!t:).)+"); yajl_gen g; std::string varValue; - std::string opValue; const unsigned char *buf; size_t jsonSize; @@ -255,7 +258,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len, strlen("highlight")); yajl_gen_array_open(g); - while (vars.size() > 0) { + while (vars.size() > 3) { std::string value; yajl_gen_map_open(g); vars.pop_back(); @@ -302,7 +305,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len, varValue.size()); yajl_gen_map_close(g); - while (trans.size() > 0) { + while (!trans.empty()) { modsecurity::actions::transformations::Transformation *t; std::string varValueRes; yajl_gen_map_open(g); @@ -337,7 +340,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len, yajl_gen_map_open(g); - while (ops.size() > 0) { + while (ops.size() > 3) { std::string value; yajl_gen_string(g, reinterpret_cast("highlight"), strlen("highlight")); @@ -391,11 +394,11 @@ int ModSecurity::processContentOffset(const char *content, size_t len, json->append("\n"); yajl_gen_free(g); + return 0; #else *err = "Without YAJL support, we cannot generate JSON."; return -1; #endif - return 0; } diff --git a/src/deps/src/ModSecurity/src/operators/begins_with.cc b/src/deps/src/ModSecurity/src/operators/begins_with.cc index c6d38ed66..a2f89fce9 100644 --- a/src/deps/src/ModSecurity/src/operators/begins_with.cc +++ b/src/deps/src/ModSecurity/src/operators/begins_with.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -24,7 +24,7 @@ namespace modsecurity { namespace operators { -bool BeginsWith::evaluate(Transaction *transaction, Rule *rule, +bool BeginsWith::evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) { std::string p(m_string->evaluate(transaction)); diff --git a/src/deps/src/ModSecurity/src/operators/begins_with.h b/src/deps/src/ModSecurity/src/operators/begins_with.h index 9c73b5b27..c9fcee467 100644 --- a/src/deps/src/ModSecurity/src/operators/begins_with.h +++ b/src/deps/src/ModSecurity/src/operators/begins_with.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ class BeginsWith : public Operator { explicit BeginsWith(std::unique_ptr param) : Operator("BeginsWith", std::move(param)) { } - bool evaluate(Transaction *transaction, Rule *rule, const std::string &str, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) override; }; diff --git a/src/deps/src/ModSecurity/src/operators/contains.cc b/src/deps/src/ModSecurity/src/operators/contains.cc index e02d682e3..95c2702a8 100644 --- a/src/deps/src/ModSecurity/src/operators/contains.cc +++ b/src/deps/src/ModSecurity/src/operators/contains.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -21,7 +21,7 @@ namespace modsecurity { namespace operators { -bool Contains::evaluate(Transaction *transaction, Rule *rule, +bool Contains::evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &input, std::shared_ptr ruleMessage) { std::string p(m_string->evaluate(transaction)); size_t offset = input.find(p); diff --git a/src/deps/src/ModSecurity/src/operators/contains.h b/src/deps/src/ModSecurity/src/operators/contains.h index c597a2ffd..13fcda922 100644 --- a/src/deps/src/ModSecurity/src/operators/contains.h +++ b/src/deps/src/ModSecurity/src/operators/contains.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ class Contains : public Operator { /** @ingroup ModSecurity_Operator */ explicit Contains(std::unique_ptr param) : Operator("Contains", std::move(param)) { } - bool evaluate(Transaction *transaction, Rule *rule, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) override; }; diff --git a/src/deps/src/ModSecurity/src/operators/contains_word.cc b/src/deps/src/ModSecurity/src/operators/contains_word.cc index 5b5487393..9bcdbd6cf 100644 --- a/src/deps/src/ModSecurity/src/operators/contains_word.cc +++ b/src/deps/src/ModSecurity/src/operators/contains_word.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -36,37 +36,37 @@ bool ContainsWord::acceptableChar(const std::string& a, size_t pos) { return true; } -bool ContainsWord::evaluate(Transaction *transaction, Rule *rule, - const std::string &input, std::shared_ptr ruleMessage) { +bool ContainsWord::evaluate(Transaction *transaction, RuleWithActions *rule, + const std::string &str, std::shared_ptr ruleMessage) { std::string paramTarget(m_string->evaluate(transaction)); if (paramTarget.empty()) { return true; } - if (input.empty()) { + if (str.empty()) { return false; } - if (input == paramTarget) { + if (str == paramTarget) { return true; } - size_t pos = input.find(paramTarget); + size_t pos = str.find(paramTarget); while (pos != std::string::npos) { - if (pos == 0 && acceptableChar(input, paramTarget.size())) { + if (pos == 0 && acceptableChar(str, paramTarget.size())) { logOffset(ruleMessage, 0, paramTarget.size()); return true; } - if (pos + paramTarget.size() == input.size() && - acceptableChar(input, pos - 1)) { + if (pos + paramTarget.size() == str.size() && + acceptableChar(str, pos - 1)) { logOffset(ruleMessage, pos, paramTarget.size()); return true; } - if (acceptableChar(input, pos - 1) && - acceptableChar(input, pos + paramTarget.size())) { + if (acceptableChar(str, pos - 1) && + acceptableChar(str, pos + paramTarget.size())) { logOffset(ruleMessage, pos, paramTarget.size()); return true; } - pos = input.find(paramTarget, pos + 1); + pos = str.find(paramTarget, pos + 1); } return false; diff --git a/src/deps/src/ModSecurity/src/operators/contains_word.h b/src/deps/src/ModSecurity/src/operators/contains_word.h index d60b609a0..c15e39908 100644 --- a/src/deps/src/ModSecurity/src/operators/contains_word.h +++ b/src/deps/src/ModSecurity/src/operators/contains_word.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,11 +32,12 @@ class ContainsWord : public Operator { explicit ContainsWord(std::unique_ptr param) : Operator("ContainsWord", std::move(param)) { } - bool evaluate(Transaction *transaction, Rule *rule, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) override; - bool acceptableChar(const std::string& a, size_t pos); + private: + static bool acceptableChar(const std::string& a, size_t pos); }; } // namespace operators diff --git a/src/deps/src/ModSecurity/src/operators/detect_sqli.cc b/src/deps/src/ModSecurity/src/operators/detect_sqli.cc index a0fbfd1a2..793d56440 100644 --- a/src/deps/src/ModSecurity/src/operators/detect_sqli.cc +++ b/src/deps/src/ModSecurity/src/operators/detect_sqli.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,33 +25,34 @@ namespace modsecurity { namespace operators { -bool DetectSQLi::evaluate(Transaction *t, Rule *rule, +bool DetectSQLi::evaluate(Transaction *t, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) { char fingerprint[8]; int issqli; issqli = libinjection_sqli(input.c_str(), input.length(), fingerprint); - if (issqli) { - if (t) { - t->m_matched.push_back(fingerprint); - ms_dbg_a(t, 4, "detected SQLi using libinjection with " \ - "fingerprint '" + std::string(fingerprint) + "' at: '" + - input + "'"); - if (rule && t && rule->m_containsCaptureAction) { - t->m_collections.m_tx_collection->storeOrUpdateFirst( - "0", std::string(fingerprint)); - ms_dbg_a(t, 7, "Added DetectSQLi match TX.0: " + \ - std::string(fingerprint)); - } - } - } else { - if (t) { - ms_dbg_a(t, 9, "detected SQLi: not able to find an " \ - "inject on '" + input + "'"); - } + if (!t) { + goto tisempty; } + if (issqli) { + t->m_matched.push_back(fingerprint); + ms_dbg_a(t, 4, "detected SQLi using libinjection with " \ + "fingerprint '" + std::string(fingerprint) + "' at: '" + + input + "'"); + if (rule && rule->hasCaptureAction()) { + t->m_collections.m_tx_collection->storeOrUpdateFirst( + "0", std::string(fingerprint)); + ms_dbg_a(t, 7, "Added DetectSQLi match TX.0: " + \ + std::string(fingerprint)); + } + } else { + ms_dbg_a(t, 9, "detected SQLi: not able to find an " \ + "inject on '" + input + "'"); + } + +tisempty: return issqli != 0; } diff --git a/src/deps/src/ModSecurity/src/operators/detect_sqli.h b/src/deps/src/ModSecurity/src/operators/detect_sqli.h index 9621576cd..237e6a2ff 100644 --- a/src/deps/src/ModSecurity/src/operators/detect_sqli.h +++ b/src/deps/src/ModSecurity/src/operators/detect_sqli.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ class DetectSQLi : public Operator { m_match_message.assign("detected SQLi using libinjection."); } - bool evaluate(Transaction *t, Rule *rule, + bool evaluate(Transaction *t, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) override; }; diff --git a/src/deps/src/ModSecurity/src/operators/detect_xss.cc b/src/deps/src/ModSecurity/src/operators/detect_xss.cc index 14b79e3dc..6c89ef720 100644 --- a/src/deps/src/ModSecurity/src/operators/detect_xss.cc +++ b/src/deps/src/ModSecurity/src/operators/detect_xss.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,7 +25,7 @@ namespace modsecurity { namespace operators { -bool DetectXSS::evaluate(Transaction *t, Rule *rule, +bool DetectXSS::evaluate(Transaction *t, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) { int is_xss; @@ -34,7 +34,7 @@ bool DetectXSS::evaluate(Transaction *t, Rule *rule, if (t) { if (is_xss) { ms_dbg_a(t, 5, "detected XSS using libinjection."); - if (rule && t && rule->m_containsCaptureAction) { + if (rule && rule->hasCaptureAction()) { t->m_collections.m_tx_collection->storeOrUpdateFirst( "0", std::string(input)); ms_dbg_a(t, 7, "Added DetectXSS match TX.0: " + \ diff --git a/src/deps/src/ModSecurity/src/operators/detect_xss.h b/src/deps/src/ModSecurity/src/operators/detect_xss.h index 5d1c93f8b..c45546251 100644 --- a/src/deps/src/ModSecurity/src/operators/detect_xss.h +++ b/src/deps/src/ModSecurity/src/operators/detect_xss.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ class DetectXSS : public Operator { m_match_message.assign("detected XSS using libinjection."); } - bool evaluate(Transaction *t, Rule *rule, + bool evaluate(Transaction *t, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) override; }; diff --git a/src/deps/src/ModSecurity/src/operators/ends_with.cc b/src/deps/src/ModSecurity/src/operators/ends_with.cc index f1f20247c..404f3ffd0 100644 --- a/src/deps/src/ModSecurity/src/operators/ends_with.cc +++ b/src/deps/src/ModSecurity/src/operators/ends_with.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -23,16 +23,16 @@ namespace modsecurity { namespace operators { -bool EndsWith::evaluate(Transaction *transaction, Rule *rule, - const std::string &input, std::shared_ptr ruleMessage) { +bool EndsWith::evaluate(Transaction *transaction, RuleWithActions *rule, + const std::string &str, std::shared_ptr ruleMessage) { bool ret = false; std::string p(m_string->evaluate(transaction)); - if (input.length() >= p.length()) { - ret = (0 == input.compare(input.length() - p.length(), + if (str.length() >= p.length()) { + ret = (0 == str.compare(str.length() - p.length(), p.length(), p)); if (ret) { - logOffset(ruleMessage, input.length() - p.length(), + logOffset(ruleMessage, str.length() - p.length(), p.size()); } } diff --git a/src/deps/src/ModSecurity/src/operators/ends_with.h b/src/deps/src/ModSecurity/src/operators/ends_with.h index e9d35bed4..47e42c3fd 100644 --- a/src/deps/src/ModSecurity/src/operators/ends_with.h +++ b/src/deps/src/ModSecurity/src/operators/ends_with.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,7 +33,7 @@ class EndsWith : public Operator { : Operator("EndsWith", std::move(param)) { m_couldContainsMacro = true; } - bool evaluate(Transaction *transaction, Rule *rule, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) override; }; diff --git a/src/deps/src/ModSecurity/src/operators/eq.cc b/src/deps/src/ModSecurity/src/operators/eq.cc index a48586509..473356d30 100644 --- a/src/deps/src/ModSecurity/src/operators/eq.cc +++ b/src/deps/src/ModSecurity/src/operators/eq.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/eq.h b/src/deps/src/ModSecurity/src/operators/eq.h index e1ccbdc57..02494f6f9 100644 --- a/src/deps/src/ModSecurity/src/operators/eq.h +++ b/src/deps/src/ModSecurity/src/operators/eq.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/fuzzy_hash.cc b/src/deps/src/ModSecurity/src/operators/fuzzy_hash.cc index 9860bd659..df31a98c2 100644 --- a/src/deps/src/ModSecurity/src/operators/fuzzy_hash.cc +++ b/src/deps/src/ModSecurity/src/operators/fuzzy_hash.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/fuzzy_hash.h b/src/deps/src/ModSecurity/src/operators/fuzzy_hash.h index cafe5780e..b555eff55 100644 --- a/src/deps/src/ModSecurity/src/operators/fuzzy_hash.h +++ b/src/deps/src/ModSecurity/src/operators/fuzzy_hash.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -40,8 +40,8 @@ class FuzzyHash : public Operator { /** @ingroup ModSecurity_Operator */ explicit FuzzyHash(std::unique_ptr param) : Operator("FuzzyHash", std::move(param)), - m_head(NULL), - m_threshold(0) { } + m_threshold(0), + m_head(NULL) { } ~FuzzyHash(); bool evaluate(Transaction *transaction, const std::string &std) override; diff --git a/src/deps/src/ModSecurity/src/operators/ge.cc b/src/deps/src/ModSecurity/src/operators/ge.cc index f1c3def7a..2a3b39ec8 100644 --- a/src/deps/src/ModSecurity/src/operators/ge.cc +++ b/src/deps/src/ModSecurity/src/operators/ge.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/ge.h b/src/deps/src/ModSecurity/src/operators/ge.h index dbb867efd..4830e91ea 100644 --- a/src/deps/src/ModSecurity/src/operators/ge.h +++ b/src/deps/src/ModSecurity/src/operators/ge.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/geo_lookup.cc b/src/deps/src/ModSecurity/src/operators/geo_lookup.cc index eb0116e37..5717b7afb 100644 --- a/src/deps/src/ModSecurity/src/operators/geo_lookup.cc +++ b/src/deps/src/ModSecurity/src/operators/geo_lookup.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,11 +33,6 @@ namespace modsecurity { namespace operators { -bool GeoLookup::debug(Transaction *transaction, int x, std::string a) { - ms_dbg_a(transaction, x, a); - return true; -} - bool GeoLookup::evaluate(Transaction *trans, const std::string &exp) { using std::placeholders::_1; diff --git a/src/deps/src/ModSecurity/src/operators/geo_lookup.h b/src/deps/src/ModSecurity/src/operators/geo_lookup.h index a411fdb5e..e01937825 100644 --- a/src/deps/src/ModSecurity/src/operators/geo_lookup.h +++ b/src/deps/src/ModSecurity/src/operators/geo_lookup.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,10 @@ class GeoLookup : public Operator { bool evaluate(Transaction *transaction, const std::string &exp) override; protected: - bool debug(Transaction *transaction, int x, std::string a); + bool debug(Transaction *transaction, int x, const std::string &a) { + ms_dbg_a(transaction, x, a); + return true; + } }; } // namespace operators diff --git a/src/deps/src/ModSecurity/src/operators/gsblookup.cc b/src/deps/src/ModSecurity/src/operators/gsblookup.cc index 530752f7e..ca934b477 100644 --- a/src/deps/src/ModSecurity/src/operators/gsblookup.cc +++ b/src/deps/src/ModSecurity/src/operators/gsblookup.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/gsblookup.h b/src/deps/src/ModSecurity/src/operators/gsblookup.h index 1473991ea..63c32ae2e 100644 --- a/src/deps/src/ModSecurity/src/operators/gsblookup.h +++ b/src/deps/src/ModSecurity/src/operators/gsblookup.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ class GsbLookup : public Operator { explicit GsbLookup(std::unique_ptr param) : Operator("GsbLookup", std::move(param)) { } - bool evaluate(Transaction *transaction, const std::string &str); + bool evaluate(Transaction *transaction, const std::string &str) override; }; } // namespace operators diff --git a/src/deps/src/ModSecurity/src/operators/gt.cc b/src/deps/src/ModSecurity/src/operators/gt.cc index 9f45f3c1c..47bb2fb78 100644 --- a/src/deps/src/ModSecurity/src/operators/gt.cc +++ b/src/deps/src/ModSecurity/src/operators/gt.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/gt.h b/src/deps/src/ModSecurity/src/operators/gt.h index b50c904af..0e80853f9 100644 --- a/src/deps/src/ModSecurity/src/operators/gt.h +++ b/src/deps/src/ModSecurity/src/operators/gt.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/inspect_file.cc b/src/deps/src/ModSecurity/src/operators/inspect_file.cc index fa194f5f1..9ce43af0d 100644 --- a/src/deps/src/ModSecurity/src/operators/inspect_file.cc +++ b/src/deps/src/ModSecurity/src/operators/inspect_file.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/inspect_file.h b/src/deps/src/ModSecurity/src/operators/inspect_file.h index 0212b6b92..e398eb30c 100644 --- a/src/deps/src/ModSecurity/src/operators/inspect_file.h +++ b/src/deps/src/ModSecurity/src/operators/inspect_file.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/ip_match.cc b/src/deps/src/ModSecurity/src/operators/ip_match.cc index 4154c1014..35a993fbe 100644 --- a/src/deps/src/ModSecurity/src/operators/ip_match.cc +++ b/src/deps/src/ModSecurity/src/operators/ip_match.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/ip_match.h b/src/deps/src/ModSecurity/src/operators/ip_match.h index 00fdedfcc..b0c080c75 100644 --- a/src/deps/src/ModSecurity/src/operators/ip_match.h +++ b/src/deps/src/ModSecurity/src/operators/ip_match.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ class IpMatch : public Operator { /** @ingroup ModSecurity_Operator */ explicit IpMatch(std::unique_ptr param) : Operator("IpMatch", std::move(param)) { } - IpMatch(std::string n, std::unique_ptr param) + IpMatch(const std::string &n, std::unique_ptr param) : Operator(n, std::move(param)) { } bool evaluate(Transaction *transaction, const std::string &input) override; diff --git a/src/deps/src/ModSecurity/src/operators/ip_match_f.cc b/src/deps/src/ModSecurity/src/operators/ip_match_f.cc index a6e177a4e..0b19c8212 100644 --- a/src/deps/src/ModSecurity/src/operators/ip_match_f.cc +++ b/src/deps/src/ModSecurity/src/operators/ip_match_f.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/ip_match_f.h b/src/deps/src/ModSecurity/src/operators/ip_match_f.h index df473f85c..9b704dfbd 100644 --- a/src/deps/src/ModSecurity/src/operators/ip_match_f.h +++ b/src/deps/src/ModSecurity/src/operators/ip_match_f.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/ip_match_from_file.cc b/src/deps/src/ModSecurity/src/operators/ip_match_from_file.cc index 7b0bccc3f..a838fb45f 100644 --- a/src/deps/src/ModSecurity/src/operators/ip_match_from_file.cc +++ b/src/deps/src/ModSecurity/src/operators/ip_match_from_file.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/ip_match_from_file.h b/src/deps/src/ModSecurity/src/operators/ip_match_from_file.h index c4d72b044..85d75b39f 100644 --- a/src/deps/src/ModSecurity/src/operators/ip_match_from_file.h +++ b/src/deps/src/ModSecurity/src/operators/ip_match_from_file.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,7 +29,7 @@ class IpMatchFromFile : public IpMatch { /** @ingroup ModSecurity_Operator */ explicit IpMatchFromFile(std::unique_ptr param) : IpMatch("IpMatchFromFile", std::move(param)) { } - IpMatchFromFile(std::string n, std::unique_ptr param) + IpMatchFromFile(const std::string &n, std::unique_ptr param) : IpMatch(n, std::move(param)) { } bool init(const std::string& file, std::string *error) override; }; diff --git a/src/deps/src/ModSecurity/src/operators/le.cc b/src/deps/src/ModSecurity/src/operators/le.cc index ac944d3e4..e448a383f 100644 --- a/src/deps/src/ModSecurity/src/operators/le.cc +++ b/src/deps/src/ModSecurity/src/operators/le.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/le.h b/src/deps/src/ModSecurity/src/operators/le.h index 621b714cc..2549112ec 100644 --- a/src/deps/src/ModSecurity/src/operators/le.h +++ b/src/deps/src/ModSecurity/src/operators/le.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/lt.cc b/src/deps/src/ModSecurity/src/operators/lt.cc index 104c7c722..2cb05c6cf 100644 --- a/src/deps/src/ModSecurity/src/operators/lt.cc +++ b/src/deps/src/ModSecurity/src/operators/lt.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/lt.h b/src/deps/src/ModSecurity/src/operators/lt.h index fa24c6064..aa5c4b82d 100644 --- a/src/deps/src/ModSecurity/src/operators/lt.h +++ b/src/deps/src/ModSecurity/src/operators/lt.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/no_match.cc b/src/deps/src/ModSecurity/src/operators/no_match.cc index d288a834f..4509bf5fa 100644 --- a/src/deps/src/ModSecurity/src/operators/no_match.cc +++ b/src/deps/src/ModSecurity/src/operators/no_match.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/no_match.h b/src/deps/src/ModSecurity/src/operators/no_match.h index c9b0cb1da..e6012cb3a 100644 --- a/src/deps/src/ModSecurity/src/operators/no_match.h +++ b/src/deps/src/ModSecurity/src/operators/no_match.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/operator.cc b/src/deps/src/ModSecurity/src/operators/operator.cc index 28ba1bbff..57974bacf 100644 --- a/src/deps/src/ModSecurity/src/operators/operator.cc +++ b/src/deps/src/ModSecurity/src/operators/operator.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -47,6 +47,7 @@ #include "src/operators/rbl.h" #include "src/operators/rsub.h" #include "src/operators/rx.h" +#include "src/operators/rx_global.h" #include "src/operators/str_eq.h" #include "src/operators/str_match.h" #include "src/operators/validate_byte_range.h" @@ -70,7 +71,7 @@ namespace operators { bool Operator::evaluateInternal(Transaction *transaction, - Rule *rule, const std::string& a, std::shared_ptr rm) { + RuleWithActions *rule, const std::string& a, std::shared_ptr rm) { bool res = evaluate(transaction, rule, a, rm); if (m_negation) { @@ -81,7 +82,7 @@ bool Operator::evaluateInternal(Transaction *transaction, } bool Operator::evaluateInternal(Transaction *transaction, - Rule *rule, const std::string& a) { + RuleWithActions *rule, const std::string& a) { bool res = evaluate(transaction, rule, a); if (m_negation) { @@ -137,7 +138,7 @@ bool Operator::evaluate(Transaction *transaction, const std::string& a) { return true; } -Operator *Operator::instantiate(std::string op, std::string param_str) { +Operator *Operator::instantiate(const std::string& op, const std::string& param_str) { std::string op_ = utils::string::tolower(op); std::unique_ptr param(new RunTimeString()); param->appendText(param_str); @@ -169,6 +170,7 @@ Operator *Operator::instantiate(std::string op, std::string param_str) { IF_MATCH(rbl) { return new Rbl(std::move(param)); } IF_MATCH(rsub) { return new Rsub(std::move(param)); } IF_MATCH(rx) { return new Rx(std::move(param)); } + IF_MATCH(rxglobal) { return new RxGlobal(std::move(param)); } IF_MATCH(streq) { return new StrEq(std::move(param)); } IF_MATCH(strmatch) { return new StrMatch(std::move(param)); } IF_MATCH(validatebyterange) { diff --git a/src/deps/src/ModSecurity/src/operators/operator.h b/src/deps/src/ModSecurity/src/operators/operator.h index c147d12eb..bcf14e9dc 100644 --- a/src/deps/src/ModSecurity/src/operators/operator.h +++ b/src/deps/src/ModSecurity/src/operators/operator.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -42,7 +42,7 @@ class Operator { } } - Operator(std::string opName, std::string param, bool negation) + Operator(const std::string &opName, const std::string ¶m, bool negation) : m_match_message(""), m_negation(negation), m_op(opName), @@ -53,7 +53,7 @@ class Operator { } } - Operator(std::string opName, std::unique_ptr param, + Operator(const std::string &opName, std::unique_ptr param, bool negation) : m_match_message(""), m_negation(negation), @@ -66,7 +66,7 @@ class Operator { } } - Operator(std::string opName, std::string param) + Operator(const std::string &opName, const std::string ¶m) : m_match_message(""), m_negation(false), m_op(opName), @@ -77,7 +77,7 @@ class Operator { } } - Operator(std::string opName, std::unique_ptr param) + Operator(const std::string &opName, std::unique_ptr param) : m_match_message(""), m_negation(false), m_op(opName), @@ -89,7 +89,7 @@ class Operator { } } - explicit Operator(std::string opName) + explicit Operator(const std::string &opName) : m_match_message(""), m_negation(false), m_op(opName), @@ -101,7 +101,8 @@ class Operator { } virtual ~Operator() { } - static Operator *instantiate(std::string opName, std::string param); + static Operator *instantiate(const std::string& opName, + const std::string& param); virtual bool init(const std::string &arg, std::string *error) { return true; @@ -111,24 +112,23 @@ class Operator { std::string key, std::string value); bool evaluateInternal(Transaction *t, const std::string& a); - bool evaluateInternal(Transaction *t, Rule *rule, + bool evaluateInternal(Transaction *t, RuleWithActions *rule, const std::string& a); - bool evaluateInternal(Transaction *t, Rule *rule, + bool evaluateInternal(Transaction *t, RuleWithActions *rule, const std::string& a, std::shared_ptr ruleMessage); virtual bool evaluate(Transaction *transaction, const std::string &str); - virtual bool evaluate(Transaction *transaction, Rule *rule, + virtual bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str) { return evaluate(transaction, str); } - virtual bool evaluate(Transaction *transaction, Rule *rule, + virtual bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) { return evaluate(transaction, str); } - static void logOffset(std::shared_ptr ruleMessage, - int offset, int len) { + static void logOffset(std::shared_ptr ruleMessage, int offset, int len) { if (ruleMessage) { ruleMessage->m_reference.append("o" + std::to_string(offset) + "," diff --git a/src/deps/src/ModSecurity/src/operators/pm.cc b/src/deps/src/ModSecurity/src/operators/pm.cc index 08401cdec..ebf31c407 100644 --- a/src/deps/src/ModSecurity/src/operators/pm.cc +++ b/src/deps/src/ModSecurity/src/operators/pm.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,6 @@ namespace operators { Pm::~Pm() { acmp_node_t *root = m_p->root_node; - acmp_node_t *node = root; cleanup(root); @@ -82,9 +81,9 @@ void Pm::postOrderTraversal(acmp_btree_node_t *node) { } -bool Pm::evaluate(Transaction *transaction, Rule *rule, +bool Pm::evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &input, std::shared_ptr ruleMessage) { - int rc = -1; + int rc; ACMPT pt; pt.parser = m_p; pt.ptr = NULL; @@ -98,16 +97,16 @@ bool Pm::evaluate(Transaction *transaction, Rule *rule, #endif if (rc >= 0 && transaction) { - std::string match_(match); + std::string match_(match?match:""); logOffset(ruleMessage, rc - match_.size() + 1, match_.size()); transaction->m_matched.push_back(match_); - } - if (rule && rule->m_containsCaptureAction && transaction && rc >= 0) { - transaction->m_collections.m_tx_collection->storeOrUpdateFirst("0", - std::string(match)); - ms_dbg_a(transaction, 7, "Added pm match TX.0: " + \ - std::string(match)); + if (rule && rule->hasCaptureAction()) { + transaction->m_collections.m_tx_collection->storeOrUpdateFirst("0", + match_); + ms_dbg_a(transaction, 7, "Added pm match TX.0: " + \ + match_); + } } return rc >= 0; diff --git a/src/deps/src/ModSecurity/src/operators/pm.h b/src/deps/src/ModSecurity/src/operators/pm.h index b459937ba..b090ec5dc 100644 --- a/src/deps/src/ModSecurity/src/operators/pm.h +++ b/src/deps/src/ModSecurity/src/operators/pm.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -36,12 +36,12 @@ class Pm : public Operator { : Operator("Pm", std::move(param)) { m_p = acmp_create(0); } - explicit Pm(std::string n, std::unique_ptr param) + explicit Pm(const std::string &n, std::unique_ptr param) : Operator(n, std::move(param)) { m_p = acmp_create(0); } ~Pm(); - bool evaluate(Transaction *transaction, Rule *rule, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) override; diff --git a/src/deps/src/ModSecurity/src/operators/pm_f.cc b/src/deps/src/ModSecurity/src/operators/pm_f.cc index 6bcdc5173..bc83a33b4 100644 --- a/src/deps/src/ModSecurity/src/operators/pm_f.cc +++ b/src/deps/src/ModSecurity/src/operators/pm_f.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/pm_f.h b/src/deps/src/ModSecurity/src/operators/pm_f.h index cc46dde76..1b3fd5b9f 100644 --- a/src/deps/src/ModSecurity/src/operators/pm_f.h +++ b/src/deps/src/ModSecurity/src/operators/pm_f.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/pm_from_file.cc b/src/deps/src/ModSecurity/src/operators/pm_from_file.cc index 7ad132a96..f70677cdc 100644 --- a/src/deps/src/ModSecurity/src/operators/pm_from_file.cc +++ b/src/deps/src/ModSecurity/src/operators/pm_from_file.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/pm_from_file.h b/src/deps/src/ModSecurity/src/operators/pm_from_file.h index 432e81444..8a353c840 100644 --- a/src/deps/src/ModSecurity/src/operators/pm_from_file.h +++ b/src/deps/src/ModSecurity/src/operators/pm_from_file.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,12 +32,13 @@ class PmFromFile : public Pm { /** @ingroup ModSecurity_Operator */ explicit PmFromFile(std::unique_ptr param) : Pm("PmFromFile", std::move(param)) { } - explicit PmFromFile(std::string n, std::unique_ptr param) + explicit PmFromFile(const std::string &n, std::unique_ptr param) : Pm(n, std::move(param)) { } bool init(const std::string &file, std::string *error) override; - bool isComment(const std::string &s); +private: + static bool isComment(const std::string &s); }; diff --git a/src/deps/src/ModSecurity/src/operators/rbl.cc b/src/deps/src/ModSecurity/src/operators/rbl.cc index 5cf794d92..ffdb17a28 100644 --- a/src/deps/src/ModSecurity/src/operators/rbl.cc +++ b/src/deps/src/ModSecurity/src/operators/rbl.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,7 +15,6 @@ #include "src/operators/rbl.h" -#include #include #include #include @@ -24,17 +23,18 @@ #include +#include "modsecurity/rules_set.h" #include "src/operators/operator.h" namespace modsecurity { namespace operators { -std::string Rbl::mapIpToAddress(std::string ipStr, Transaction *trans) { +std::string Rbl::mapIpToAddress(const std::string &ipStr, Transaction *trans) const { std::string addr; int h0, h1, h2, h3; std::string key; - if (trans->m_rules->m_httpblKey.m_set == true) { + if (trans && trans->m_rules->m_httpblKey.m_set == true) { key = trans->m_rules->m_httpblKey.m_value; } @@ -67,11 +67,13 @@ std::string Rbl::mapIpToAddress(std::string ipStr, Transaction *trans) { } -void Rbl::futherInfo_httpbl(struct sockaddr_in *sin, std::string ipStr, +void Rbl::futherInfo_httpbl(struct sockaddr_in *sin, const std::string &ipStr, Transaction *trans) { char *respBl; int first, days, score, type; +#ifndef NO_LOGS std::string ptype; +#endif respBl = inet_ntoa(sin->sin_addr); @@ -85,6 +87,7 @@ void Rbl::futherInfo_httpbl(struct sockaddr_in *sin, std::string ipStr, return; } +#ifndef NO_LOGS switch (type) { case 0: ptype = "Search Engine"; @@ -113,6 +116,7 @@ void Rbl::futherInfo_httpbl(struct sockaddr_in *sin, std::string ipStr, default: ptype = " "; } +#endif ms_dbg_a(trans, 4, "RBL lookup of " + ipStr + " succeeded. %s: " \ + std::to_string(days) + " " \ @@ -121,7 +125,7 @@ void Rbl::futherInfo_httpbl(struct sockaddr_in *sin, std::string ipStr, } -void Rbl::futherInfo_spamhaus(unsigned int high8bits, std::string ipStr, +void Rbl::futherInfo_spamhaus(unsigned int high8bits, const std::string &ipStr, Transaction *trans) { switch (high8bits) { case 2: @@ -148,7 +152,7 @@ void Rbl::futherInfo_spamhaus(unsigned int high8bits, std::string ipStr, } -void Rbl::futherInfo_uribl(unsigned int high8bits, std::string ipStr, +void Rbl::futherInfo_uribl(unsigned int high8bits, const std::string &ipStr, Transaction *trans) { switch (high8bits) { case 2: @@ -175,11 +179,11 @@ void Rbl::futherInfo_uribl(unsigned int high8bits, std::string ipStr, } -void Rbl::furtherInfo(struct sockaddr_in *sin, std::string ipStr, - Transaction *trans) { +void Rbl::furtherInfo(struct sockaddr_in *sin, const std::string &ipStr, + Transaction *trans, RblProvider provider) { unsigned int high8bits = sin->sin_addr.s_addr >> 24; - switch (m_provider) { + switch (provider) { case RblProvider::UnknownProvider: ms_dbg_a(trans, 2, "RBL lookup of " + ipStr + " succeeded."); break; @@ -196,11 +200,11 @@ void Rbl::furtherInfo(struct sockaddr_in *sin, std::string ipStr, } -bool Rbl::evaluate(Transaction *t, Rule *rule, +bool Rbl::evaluate(Transaction *t, RuleWithActions *rule, const std::string& ipStr, std::shared_ptr ruleMessage) { struct addrinfo *info = NULL; - std::string host = mapIpToAddress(ipStr, t); + std::string host = Rbl::mapIpToAddress(ipStr, t); int rc = 0; if (host.empty()) { @@ -219,10 +223,10 @@ bool Rbl::evaluate(Transaction *t, Rule *rule, struct sockaddr *addr = info->ai_addr; struct sockaddr_in *sin = (struct sockaddr_in *) addr; - furtherInfo(sin, ipStr, t); + furtherInfo(sin, ipStr, t, m_provider); freeaddrinfo(info); - if (rule && t && rule->m_containsCaptureAction) { + if (rule && t && rule->hasCaptureAction()) { t->m_collections.m_tx_collection->storeOrUpdateFirst( "0", std::string(ipStr)); ms_dbg_a(t, 7, "Added RXL match TX.0: " + \ diff --git a/src/deps/src/ModSecurity/src/operators/rbl.h b/src/deps/src/ModSecurity/src/operators/rbl.h index d7d13ad09..f002d532c 100644 --- a/src/deps/src/ModSecurity/src/operators/rbl.h +++ b/src/deps/src/ModSecurity/src/operators/rbl.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -62,10 +62,11 @@ class Rbl : public Operator { /** @ingroup ModSecurity_Operator */ explicit Rbl(std::unique_ptr param) - : Operator("Rbl", std::move(param)), - m_demandsPassword(false) { + : m_service(), + m_demandsPassword(false), + m_provider(RblProvider::UnknownProvider), + Operator("Rbl", std::move(param)) { m_service = m_string->evaluate(); - m_provider = RblProvider::UnknownProvider; if (m_service.find("httpbl.org") != std::string::npos) { m_demandsPassword = true; m_provider = RblProvider::httpbl; @@ -75,21 +76,22 @@ class Rbl : public Operator { m_provider = RblProvider::httpbl; } } - bool evaluate(Transaction *transaction, Rule *rule, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) override; - std::string mapIpToAddress(std::string ipStr, Transaction *trans); + std::string mapIpToAddress(const std::string &ipStr, Transaction *trans) const; - void futherInfo_httpbl(struct sockaddr_in *sin, std::string ipStr, + static void futherInfo_httpbl(struct sockaddr_in *sin, const std::string &ipStr, Transaction *trans); - void futherInfo_spamhaus(unsigned int high8bits, std::string ipStr, + static void futherInfo_spamhaus(unsigned int high8bits, const std::string &ipStr, Transaction *trans); - void futherInfo_uribl(unsigned int high8bits, std::string ipStr, - Transaction *trans); - void furtherInfo(struct sockaddr_in *sin, std::string ipStr, + static void futherInfo_uribl(unsigned int high8bits, const std::string &ipStr, Transaction *trans); + static void furtherInfo(struct sockaddr_in *sin, const std::string &ipStr, + Transaction *trans, RblProvider provider); + private: std::string m_service; bool m_demandsPassword; RblProvider m_provider; diff --git a/src/deps/src/ModSecurity/src/operators/rsub.cc b/src/deps/src/ModSecurity/src/operators/rsub.cc index f9a7c9a97..d310185b7 100644 --- a/src/deps/src/ModSecurity/src/operators/rsub.cc +++ b/src/deps/src/ModSecurity/src/operators/rsub.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/rsub.h b/src/deps/src/ModSecurity/src/operators/rsub.h index 51464b1f3..15c80085a 100644 --- a/src/deps/src/ModSecurity/src/operators/rsub.h +++ b/src/deps/src/ModSecurity/src/operators/rsub.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/rx.cc b/src/deps/src/ModSecurity/src/operators/rx.cc index 43f6444b1..13ae7550e 100644 --- a/src/deps/src/ModSecurity/src/operators/rx.cc +++ b/src/deps/src/ModSecurity/src/operators/rx.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -36,9 +36,8 @@ bool Rx::init(const std::string &arg, std::string *error) { } -bool Rx::evaluate(Transaction *transaction, Rule *rule, +bool Rx::evaluate(Transaction *transaction, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) { - std::list matches; Regex *re; if (m_param.empty() && !m_string->m_containsMacro) { @@ -52,29 +51,33 @@ bool Rx::evaluate(Transaction *transaction, Rule *rule, re = m_re; } - matches = re->searchAll(input); - if (rule && rule->m_containsCaptureAction && transaction) { - int i = 0; - matches.reverse(); - for (const SMatch& a : matches) { + std::vector captures; + if (re->hasError()) { + ms_dbg_a(transaction, 3, "Error with regular expression: \"" + re->pattern + "\""); + return false; + } + re->searchOneMatch(input, captures); + + if (rule && rule->hasCaptureAction() && transaction) { + for (const Utils::SMatchCapture& capture : captures) { + const std::string capture_substring(input.substr(capture.m_offset,capture.m_length)); transaction->m_collections.m_tx_collection->storeOrUpdateFirst( - std::to_string(i), a.str()); + std::to_string(capture.m_group), capture_substring); ms_dbg_a(transaction, 7, "Added regex subexpression TX." + - std::to_string(i) + ": " + a.str()); - transaction->m_matched.push_back(a.str()); - i++; + std::to_string(capture.m_group) + ": " + capture_substring); + transaction->m_matched.push_back(capture_substring); } } - for (const auto & i : matches) { - logOffset(ruleMessage, i.offset(), i.str().size()); + for (const auto & capture : captures) { + logOffset(ruleMessage, capture.m_offset, capture.m_length); } if (m_string->m_containsMacro) { delete re; } - if (matches.size() > 0) { + if (!captures.empty()) { return true; } diff --git a/src/deps/src/ModSecurity/src/operators/rx.h b/src/deps/src/ModSecurity/src/operators/rx.h index 7460c396a..817e74eb0 100644 --- a/src/deps/src/ModSecurity/src/operators/rx.h +++ b/src/deps/src/ModSecurity/src/operators/rx.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -37,7 +37,8 @@ class Rx : public Operator { public: /** @ingroup ModSecurity_Operator */ explicit Rx(std::unique_ptr param) - : Operator("Rx", std::move(param)) { + : m_re(nullptr), + Operator("Rx", std::move(param)) { m_couldContainsMacro = true; } @@ -48,15 +49,7 @@ class Rx : public Operator { } } - bool evaluate(Transaction *transaction, Rule *rule, - const std::string &input) override { - return evaluate(transaction, NULL, input, NULL); - } - bool evaluate(Transaction *transaction, - const std::string &input) override { - return evaluate(transaction, NULL, input); - } - bool evaluate(Transaction *transaction, Rule *rule, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) override; diff --git a/src/deps/src/ModSecurity/src/operators/rx_global.cc b/src/deps/src/ModSecurity/src/operators/rx_global.cc new file mode 100644 index 000000000..f715a4fd1 --- /dev/null +++ b/src/deps/src/ModSecurity/src/operators/rx_global.cc @@ -0,0 +1,85 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include "src/operators/rx_global.h" + +#include +#include +#include + +#include "src/operators/operator.h" +#include "modsecurity/rule.h" +#include "modsecurity/rule_message.h" + +namespace modsecurity { +namespace operators { + + +bool RxGlobal::init(const std::string &arg, std::string *error) { + if (m_string->m_containsMacro == false) { + m_re = new Regex(m_param); + } + + return true; +} + + +bool RxGlobal::evaluate(Transaction *transaction, RuleWithActions *rule, + const std::string& input, std::shared_ptr ruleMessage) { + Regex *re; + + if (m_param.empty() && !m_string->m_containsMacro) { + return true; + } + + if (m_string->m_containsMacro) { + std::string eparam(m_string->evaluate(transaction)); + re = new Regex(eparam); + } else { + re = m_re; + } + + std::vector captures; + re->searchGlobal(input, captures); + + if (rule && rule->hasCaptureAction() && transaction) { + for (const Utils::SMatchCapture& capture : captures) { + const std::string capture_substring(input.substr(capture.m_offset,capture.m_length)); + transaction->m_collections.m_tx_collection->storeOrUpdateFirst( + std::to_string(capture.m_group), capture_substring); + ms_dbg_a(transaction, 7, "Added regex subexpression TX." + + std::to_string(capture.m_group) + ": " + capture_substring); + transaction->m_matched.push_back(capture_substring); + } + } + + for (const auto & capture : captures) { + logOffset(ruleMessage, capture.m_offset, capture.m_length); + } + + if (m_string->m_containsMacro) { + delete re; + } + + if (captures.size() > 0) { + return true; + } + + return false; +} + + +} // namespace operators +} // namespace modsecurity diff --git a/src/deps/src/ModSecurity/src/operators/rx_global.h b/src/deps/src/ModSecurity/src/operators/rx_global.h new file mode 100644 index 000000000..86e37d0d5 --- /dev/null +++ b/src/deps/src/ModSecurity/src/operators/rx_global.h @@ -0,0 +1,67 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#ifndef SRC_OPERATORS_RX_GLOBAL_H_ +#define SRC_OPERATORS_RX_GLOBAL_H_ + +#include +//#include +#include +#include + +#include "src/operators/operator.h" +#include "src/utils/regex.h" + + +namespace modsecurity { +using Utils::SMatch; +using Utils::regex_search; +using Utils::Regex; + +namespace operators { + + +class RxGlobal : public Operator { + public: + /** @ingroup ModSecurity_Operator */ + explicit RxGlobal(std::unique_ptr param) + : m_re(nullptr), + Operator("RxGlobal", std::move(param)) { + m_couldContainsMacro = true; + } + + ~RxGlobal() { + if (m_string->m_containsMacro == false && m_re != NULL) { + delete m_re; + m_re = NULL; + } + } + + bool evaluate(Transaction *transaction, RuleWithActions *rule, + const std::string& input, + std::shared_ptr ruleMessage) override; + + bool init(const std::string &arg, std::string *error) override; + + private: + Regex *m_re; +}; + + +} // namespace operators +} // namespace modsecurity + + +#endif // SRC_OPERATORS_RX_GLOBAL_H_ diff --git a/src/deps/src/ModSecurity/src/operators/str_eq.cc b/src/deps/src/ModSecurity/src/operators/str_eq.cc index a280630fb..13c036882 100644 --- a/src/deps/src/ModSecurity/src/operators/str_eq.cc +++ b/src/deps/src/ModSecurity/src/operators/str_eq.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/str_eq.h b/src/deps/src/ModSecurity/src/operators/str_eq.h index b4b98bbe1..10f38e3c2 100644 --- a/src/deps/src/ModSecurity/src/operators/str_eq.h +++ b/src/deps/src/ModSecurity/src/operators/str_eq.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/str_match.cc b/src/deps/src/ModSecurity/src/operators/str_match.cc index 7753b9b46..ce7dfb2b9 100644 --- a/src/deps/src/ModSecurity/src/operators/str_match.cc +++ b/src/deps/src/ModSecurity/src/operators/str_match.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/str_match.h b/src/deps/src/ModSecurity/src/operators/str_match.h index 0229e17b2..4f77532f2 100644 --- a/src/deps/src/ModSecurity/src/operators/str_match.h +++ b/src/deps/src/ModSecurity/src/operators/str_match.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/unconditional_match.cc b/src/deps/src/ModSecurity/src/operators/unconditional_match.cc index b71e89d10..b79275d23 100644 --- a/src/deps/src/ModSecurity/src/operators/unconditional_match.cc +++ b/src/deps/src/ModSecurity/src/operators/unconditional_match.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/unconditional_match.h b/src/deps/src/ModSecurity/src/operators/unconditional_match.h index 653d2eb40..a54c76827 100644 --- a/src/deps/src/ModSecurity/src/operators/unconditional_match.h +++ b/src/deps/src/ModSecurity/src/operators/unconditional_match.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/validate_byte_range.cc b/src/deps/src/ModSecurity/src/operators/validate_byte_range.cc index b7729f235..07b88149c 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_byte_range.cc +++ b/src/deps/src/ModSecurity/src/operators/validate_byte_range.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -110,7 +110,7 @@ bool ValidateByteRange::init(const std::string &file, } -bool ValidateByteRange::evaluate(Transaction *transaction, Rule *rule, +bool ValidateByteRange::evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &input, std::shared_ptr ruleMessage) { bool ret = true; diff --git a/src/deps/src/ModSecurity/src/operators/validate_byte_range.h b/src/deps/src/ModSecurity/src/operators/validate_byte_range.h index 09bba3aad..2c44e7692 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_byte_range.h +++ b/src/deps/src/ModSecurity/src/operators/validate_byte_range.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -37,7 +37,7 @@ class ValidateByteRange : public Operator { } ~ValidateByteRange() override { } - bool evaluate(Transaction *transaction, Rule *rule, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &input, std::shared_ptr ruleMessage) override; bool getRange(const std::string &rangeRepresentation, std::string *error); diff --git a/src/deps/src/ModSecurity/src/operators/validate_dtd.cc b/src/deps/src/ModSecurity/src/operators/validate_dtd.cc index a993fab92..f57dbed3a 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_dtd.cc +++ b/src/deps/src/ModSecurity/src/operators/validate_dtd.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/validate_dtd.h b/src/deps/src/ModSecurity/src/operators/validate_dtd.h index ffbd6cffc..ace6aad46 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_dtd.h +++ b/src/deps/src/ModSecurity/src/operators/validate_dtd.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/validate_hash.cc b/src/deps/src/ModSecurity/src/operators/validate_hash.cc index 3f5e93410..b608ac2b5 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_hash.cc +++ b/src/deps/src/ModSecurity/src/operators/validate_hash.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/validate_hash.h b/src/deps/src/ModSecurity/src/operators/validate_hash.h index e6e791f6f..47e25fdf4 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_hash.h +++ b/src/deps/src/ModSecurity/src/operators/validate_hash.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/validate_schema.cc b/src/deps/src/ModSecurity/src/operators/validate_schema.cc index 3ce49ba9a..a94ca4f8a 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_schema.cc +++ b/src/deps/src/ModSecurity/src/operators/validate_schema.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/validate_schema.h b/src/deps/src/ModSecurity/src/operators/validate_schema.h index 8bf6bd2a7..b190ef15d 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_schema.h +++ b/src/deps/src/ModSecurity/src/operators/validate_schema.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/operators/validate_url_encoding.cc b/src/deps/src/ModSecurity/src/operators/validate_url_encoding.cc index 43b63e6ab..20a86eb62 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_url_encoding.cc +++ b/src/deps/src/ModSecurity/src/operators/validate_url_encoding.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,7 +28,7 @@ int ValidateUrlEncoding::validate_url_encoding(const char *input, int i; *offset = 0; - if ((input == NULL) || (input_length <= 0)) { + if ((input == NULL) || (input_length == 0)) { return -1; } @@ -68,7 +68,7 @@ int ValidateUrlEncoding::validate_url_encoding(const char *input, } -bool ValidateUrlEncoding::evaluate(Transaction *transaction, Rule *rule, +bool ValidateUrlEncoding::evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &input, std::shared_ptr ruleMessage) { size_t offset = 0; bool res = false; diff --git a/src/deps/src/ModSecurity/src/operators/validate_url_encoding.h b/src/deps/src/ModSecurity/src/operators/validate_url_encoding.h index f52e81755..fe274dc0a 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_url_encoding.h +++ b/src/deps/src/ModSecurity/src/operators/validate_url_encoding.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,10 +31,11 @@ class ValidateUrlEncoding : public Operator { ValidateUrlEncoding() : Operator("ValidateUrlEncoding") { } - bool evaluate(Transaction *transaction, Rule *rule, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &input, std::shared_ptr ruleMessage) override; - int validate_url_encoding(const char *input, uint64_t input_length, + + static int validate_url_encoding(const char *input, uint64_t input_length, size_t *offset); }; diff --git a/src/deps/src/ModSecurity/src/operators/validate_utf8_encoding.cc b/src/deps/src/ModSecurity/src/operators/validate_utf8_encoding.cc index a0c178d17..e95061af3 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_utf8_encoding.cc +++ b/src/deps/src/ModSecurity/src/operators/validate_utf8_encoding.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -113,7 +113,7 @@ int ValidateUtf8Encoding::detect_utf8_character( return unicode_len; } -bool ValidateUtf8Encoding::evaluate(Transaction *transaction, Rule *rule, +bool ValidateUtf8Encoding::evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) { unsigned int i, bytes_left; diff --git a/src/deps/src/ModSecurity/src/operators/validate_utf8_encoding.h b/src/deps/src/ModSecurity/src/operators/validate_utf8_encoding.h index eb10dc6ec..e59eef589 100644 --- a/src/deps/src/ModSecurity/src/operators/validate_utf8_encoding.h +++ b/src/deps/src/ModSecurity/src/operators/validate_utf8_encoding.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -38,11 +38,11 @@ class ValidateUtf8Encoding : public Operator { ValidateUtf8Encoding() : Operator("ValidateUtf8Encoding") { } - bool evaluate(Transaction *transaction, Rule *rule, + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) override; - int detect_utf8_character(const unsigned char *p_read, + static int detect_utf8_character(const unsigned char *p_read, unsigned int length); }; diff --git a/src/deps/src/ModSecurity/src/operators/verify_cc.cc b/src/deps/src/ModSecurity/src/operators/verify_cc.cc index 762317769..bdb63f345 100644 --- a/src/deps/src/ModSecurity/src/operators/verify_cc.cc +++ b/src/deps/src/ModSecurity/src/operators/verify_cc.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,24 +15,28 @@ #include "src/operators/verify_cc.h" -#include #include #include #include #include "src/operators/operator.h" +#ifndef WITH_PCRE2 #if PCRE_HAVE_JIT #define pcre_study_opt PCRE_STUDY_JIT_COMPILE #else #define pcre_study_opt 0 #endif +#endif namespace modsecurity { namespace operators { VerifyCC::~VerifyCC() { +#if WITH_PCRE2 + pcre2_code_free(m_pc); +#else if (m_pc != NULL) { pcre_free(m_pc); m_pc = NULL; @@ -45,6 +49,7 @@ VerifyCC::~VerifyCC() { #endif m_pce = NULL; } +#endif } /** @@ -90,6 +95,17 @@ int VerifyCC::luhnVerify(const char *ccnumber, int len) { bool VerifyCC::init(const std::string ¶m2, std::string *error) { +#ifdef WITH_PCRE2 + PCRE2_SPTR pcre2_pattern = reinterpret_cast(m_param.c_str()); + uint32_t pcre2_options = (PCRE2_DOTALL|PCRE2_MULTILINE); + int errornumber = 0; + PCRE2_SIZE erroroffset = 0; + m_pc = pcre2_compile(pcre2_pattern, PCRE2_ZERO_TERMINATED, + pcre2_options, &errornumber, &erroroffset, NULL); + if (m_pc == NULL) { + return false; + } +#else const char *errptr = NULL; int erroffset = 0; @@ -112,19 +128,34 @@ bool VerifyCC::init(const std::string ¶m2, std::string *error) { error->assign(errptr); return false; } +#endif return true; } -bool VerifyCC::evaluate(Transaction *t, Rule *rule, +bool VerifyCC::evaluate(Transaction *t, RuleWithActions *rule, const std::string& i, std::shared_ptr ruleMessage) { +#ifdef WITH_PCRE2 + PCRE2_SIZE offset = 0; + size_t target_length = i.length(); + PCRE2_SPTR pcre2_i = reinterpret_cast(i.c_str()); + pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(m_pc, NULL); + + for (offset = 0; offset < target_length; offset++) { + int ret = pcre2_match(m_pc, pcre2_i, target_length, offset, 0, match_data, NULL); + + /* If there was no match, then we are done. */ + if (ret < 0) { + break; + } + PCRE2_SIZE *ovector = pcre2_get_ovector_pointer(match_data); + +#else int offset = 0; - bool is_cc = false; int target_length = i.length(); for (offset = 0; offset < target_length; offset++) { - std::string match; int ovector[33]; memset(ovector, 0, sizeof(ovector)); int ret = pcre_exec(m_pc, m_pce, i.c_str(), i.size(), offset, @@ -137,12 +168,13 @@ bool VerifyCC::evaluate(Transaction *t, Rule *rule, if (ret < 0) { return false; } +#endif if (ret > 0) { - match = std::string(i, ovector[0], ovector[1] - ovector[0]); - is_cc = luhnVerify(match.c_str(), match.size()); + std::string match = std::string(i, ovector[0], ovector[1] - ovector[0]); + int is_cc = luhnVerify(match.c_str(), match.size()); if (is_cc) { if (t) { - if (rule && t && rule->m_containsCaptureAction) { + if (rule && rule->hasCaptureAction()) { t->m_collections.m_tx_collection->storeOrUpdateFirst( "0", std::string(match)); ms_dbg_a(t, 7, "Added VerifyCC match TX.0: " + \ @@ -152,11 +184,18 @@ bool VerifyCC::evaluate(Transaction *t, Rule *rule, "\" at " + i + ". [offset " + std::to_string(offset) + "]"); } +#ifdef WITH_PCRE2 + pcre2_match_data_free(match_data); +#endif return true; } } } +#ifdef WITH_PCRE2 + pcre2_match_data_free(match_data); +#endif + return false; } diff --git a/src/deps/src/ModSecurity/src/operators/verify_cc.h b/src/deps/src/ModSecurity/src/operators/verify_cc.h index 47cbb057f..91195378a 100644 --- a/src/deps/src/ModSecurity/src/operators/verify_cc.h +++ b/src/deps/src/ModSecurity/src/operators/verify_cc.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -16,7 +16,14 @@ #ifndef SRC_OPERATORS_VERIFY_CC_H_ #define SRC_OPERATORS_VERIFY_CC_H_ +#if WITH_PCRE2 +#define PCRE2_CODE_UNIT_WIDTH 8 +#include +#else #include +#endif + + #include #include #include @@ -31,18 +38,26 @@ class VerifyCC : public Operator { /** @ingroup ModSecurity_Operator */ explicit VerifyCC(std::unique_ptr param) : Operator("VerifyCC", std::move(param)), +#if WITH_PCRE2 + m_pc(NULL) { } +#else m_pc(NULL), m_pce(NULL) { } +#endif ~VerifyCC(); - int luhnVerify(const char *ccnumber, int len); - bool evaluate(Transaction *t, Rule *rule, + bool evaluate(Transaction *t, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) override; bool init(const std::string ¶m, std::string *error) override; private: +#if WITH_PCRE2 + pcre2_code *m_pc; +#else pcre *m_pc; pcre_extra *m_pce; +#endif + static int luhnVerify(const char *ccnumber, int len); }; } // namespace operators diff --git a/src/deps/src/ModSecurity/src/operators/verify_cpf.cc b/src/deps/src/ModSecurity/src/operators/verify_cpf.cc index ac4874bfb..778584db6 100644 --- a/src/deps/src/ModSecurity/src/operators/verify_cpf.cc +++ b/src/deps/src/ModSecurity/src/operators/verify_cpf.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -37,31 +37,22 @@ int VerifyCPF::convert_to_int(const char c) { return n; } + bool VerifyCPF::verify(const char *cpfnumber, int len) { int factor, part_1, part_2, var_len = len; unsigned int sum = 0, i = 0, cpf_len = 11, c; int cpf[11]; char s_cpf[11]; - char bad_cpf[12][12] = { "00000000000", - "01234567890", - "11111111111", - "22222222222", - "33333333333", - "44444444444", - "55555555555", - "66666666666", - "77777777777", - "88888888888", - "99999999999"}; while ((*cpfnumber != '\0') && (var_len > 0)) { - if (*cpfnumber != '-' || *cpfnumber != '.') { + // Always true. + //if (*cpfnumber != '-' || *cpfnumber != '.') { if (i < cpf_len && isdigit(*cpfnumber)) { s_cpf[i] = *cpfnumber; cpf[i] = convert_to_int(*cpfnumber); i++; } - } + //} cpfnumber++; var_len--; } @@ -117,7 +108,7 @@ bool VerifyCPF::verify(const char *cpfnumber, int len) { } -bool VerifyCPF::evaluate(Transaction *t, Rule *rule, +bool VerifyCPF::evaluate(Transaction *t, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) { std::list matches; bool is_cpf = false; @@ -129,15 +120,15 @@ bool VerifyCPF::evaluate(Transaction *t, Rule *rule, for (i = 0; i < input.size() - 1 && is_cpf == false; i++) { matches = m_re->searchAll(input.substr(i, input.size())); - for (const auto & i : matches) { - is_cpf = verify(i.str().c_str(), i.str().size()); + for (const auto & m : matches) { + is_cpf = verify(m.str().c_str(), m.str().size()); if (is_cpf) { - logOffset(ruleMessage, i.offset(), i.str().size()); - if (rule && t && rule->m_containsCaptureAction) { + logOffset(ruleMessage, m.offset(), m.str().size()); + if (rule && t && rule->hasCaptureAction()) { t->m_collections.m_tx_collection->storeOrUpdateFirst( - "0", i.str()); + "0", m.str()); ms_dbg_a(t, 7, "Added VerifyCPF match TX.0: " + \ - i.str()); + m.str()); } goto out; diff --git a/src/deps/src/ModSecurity/src/operators/verify_cpf.h b/src/deps/src/ModSecurity/src/operators/verify_cpf.h index 893c47fb9..eecf71b1a 100644 --- a/src/deps/src/ModSecurity/src/operators/verify_cpf.h +++ b/src/deps/src/ModSecurity/src/operators/verify_cpf.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -42,23 +42,30 @@ class VerifyCPF : public Operator { ~VerifyCPF() { delete m_re; } - bool evaluate(Transaction *transaction, Rule *rule, - const std::string &input) override { - return evaluate(transaction, NULL, input, NULL); - } - bool evaluate(Transaction *transaction, - const std::string &input) override { - return evaluate(transaction, NULL, input); - } - bool evaluate(Transaction *transaction, Rule *rule, + + bool operator=(const VerifyCPF &a) = delete; + VerifyCPF(const VerifyCPF &a) = delete; + + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) override; - int convert_to_int(const char c); bool verify(const char *ssnumber, int len); private: + static int convert_to_int(const char c); Regex *m_re; + const char bad_cpf[12][12] = { "00000000000", + "01234567890", + "11111111111", + "22222222222", + "33333333333", + "44444444444", + "55555555555", + "66666666666", + "77777777777", + "88888888888", + "99999999999"}; }; } // namespace operators diff --git a/src/deps/src/ModSecurity/src/operators/verify_ssn.cc b/src/deps/src/ModSecurity/src/operators/verify_ssn.cc index deb97e6f9..59a36dd78 100644 --- a/src/deps/src/ModSecurity/src/operators/verify_ssn.cc +++ b/src/deps/src/ModSecurity/src/operators/verify_ssn.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -24,6 +24,7 @@ namespace modsecurity { namespace operators { + int VerifySSN::convert_to_int(const char c) { int n; if ((c >= '0') && (c <= '9')) { @@ -38,6 +39,7 @@ int VerifySSN::convert_to_int(const char c) { return n; } + bool VerifySSN::verify(const char *ssnumber, int len) { int i; int num[9]; @@ -108,7 +110,7 @@ invalid: } -bool VerifySSN::evaluate(Transaction *t, Rule *rule, +bool VerifySSN::evaluate(Transaction *t, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) { std::list matches; bool is_ssn = false; @@ -120,15 +122,15 @@ bool VerifySSN::evaluate(Transaction *t, Rule *rule, for (i = 0; i < input.size() - 1 && is_ssn == false; i++) { matches = m_re->searchAll(input.substr(i, input.size())); - for (const auto & i : matches) { - is_ssn = verify(i.str().c_str(), i.str().size()); + for (const auto & j : matches) { + is_ssn = verify(j.str().c_str(), j.str().size()); if (is_ssn) { - logOffset(ruleMessage, i.offset(), i.str().size()); - if (rule && t && rule->m_containsCaptureAction) { + logOffset(ruleMessage, j.offset(), j.str().size()); + if (rule && t && rule->hasCaptureAction()) { t->m_collections.m_tx_collection->storeOrUpdateFirst( - "0", i.str()); + "0", j.str()); ms_dbg_a(t, 7, "Added VerifySSN match TX.0: " + \ - i.str()); + j.str()); } goto out; diff --git a/src/deps/src/ModSecurity/src/operators/verify_ssn.h b/src/deps/src/ModSecurity/src/operators/verify_ssn.h index c8cf7f16a..7c0828fbb 100644 --- a/src/deps/src/ModSecurity/src/operators/verify_ssn.h +++ b/src/deps/src/ModSecurity/src/operators/verify_ssn.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -42,22 +42,20 @@ class VerifySSN : public Operator { ~VerifySSN() { delete m_re; } - bool evaluate(Transaction *transaction, Rule *rule, - const std::string &input) override { - return evaluate(transaction, NULL, input, NULL); - } - bool evaluate(Transaction *transaction, - const std::string &input) override { - return evaluate(transaction, NULL, input); - } - bool evaluate(Transaction *transaction, Rule *rule, + + bool operator=(const VerifySSN &a) = delete; + VerifySSN(const VerifySSN &a) = delete; + + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) override; - int convert_to_int(const char c); - bool verify(const char *ssnumber, int len); + private: + static bool verify(const char *ssnumber, int len); + static int convert_to_int(const char c); + Regex *m_re; }; diff --git a/src/deps/src/ModSecurity/src/operators/verify_svnr.cc b/src/deps/src/ModSecurity/src/operators/verify_svnr.cc index 17b491779..248e6b4ec 100644 --- a/src/deps/src/ModSecurity/src/operators/verify_svnr.cc +++ b/src/deps/src/ModSecurity/src/operators/verify_svnr.cc @@ -7,12 +7,14 @@ #include "modsecurity/rule.h" #include "modsecurity/rule_message.h" -#include "modsecurity/rules_properties.h" +#include "modsecurity/rules_set_properties.h" + + namespace modsecurity { namespace operators { -int VerifySVNR::convert_to_int(const char c) -{ + +int VerifySVNR::convert_to_int(const char c) { int n; if ((c>='0') && (c<='9')) n = c - '0'; @@ -21,28 +23,18 @@ int VerifySVNR::convert_to_int(const char c) return n; } + bool VerifySVNR::verify(const char *svnrnumber, int len) { int var_len = len; int sum = 0; unsigned int i = 0, svnr_len = 10; int svnr[11]; char s_svnr[11]; - char bad_svnr[12][11] = { "0000000000", - "0123456789", - "1234567890", - "1111111111", - "2222222222", - "3333333333", - "4444444444", - "5555555555", - "6666666666", - "7777777777", - "8888888888", - "9999999999"}; while ((*svnrnumber != '\0') && ( var_len > 0)) { - if (*svnrnumber != '-' || *svnrnumber != '.') + // Always true on the original code. + //if (*svnrnumber != '-' || *svnrnumber != '.') { if (i < svnr_len && isdigit(*svnrnumber)) { @@ -85,7 +77,7 @@ bool VerifySVNR::verify(const char *svnrnumber, int len) { } -bool VerifySVNR::evaluate(Transaction *t, Rule *rule, +bool VerifySVNR::evaluate(Transaction *t, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) { std::list matches; bool is_svnr = false; @@ -98,15 +90,15 @@ bool VerifySVNR::evaluate(Transaction *t, Rule *rule, for (i = 0; i < input.size() - 1 && is_svnr == false; i++) { matches = m_re->searchAll(input.substr(i, input.size())); - for (const auto & i : matches) { - is_svnr = verify(i.str().c_str(), i.str().size()); + for (const auto & j : matches) { + is_svnr = verify(j.str().c_str(), j.str().size()); if (is_svnr) { - logOffset(ruleMessage, i.offset(), i.str().size()); - if (rule && t && rule->m_containsCaptureAction) { + logOffset(ruleMessage, j.offset(), j.str().size()); + if (rule && t && rule->hasCaptureAction()) { t->m_collections.m_tx_collection->storeOrUpdateFirst( - "0", i.str()); + "0", j.str()); ms_dbg_a(t, 7, "Added VerifySVNR match TX.0: " + \ - i.str()); + j.str()); } goto out; diff --git a/src/deps/src/ModSecurity/src/operators/verify_svnr.h b/src/deps/src/ModSecurity/src/operators/verify_svnr.h index c3ceda50e..6fe9df9af 100644 --- a/src/deps/src/ModSecurity/src/operators/verify_svnr.h +++ b/src/deps/src/ModSecurity/src/operators/verify_svnr.h @@ -28,23 +28,31 @@ class VerifySVNR : public Operator { ~VerifySVNR() { delete m_re; } - bool evaluate(Transaction *transaction, Rule *rule, - const std::string &input) override { - return evaluate(transaction, NULL, input, NULL); - } - bool evaluate(Transaction *transaction, - const std::string &input) override { - return evaluate(transaction, NULL, input); - } - bool evaluate(Transaction *transaction, Rule *rule, + + bool operator=(const VerifySVNR &a) = delete; + VerifySVNR(const VerifySVNR &a) = delete; + + bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string& input, std::shared_ptr ruleMessage) override; - int convert_to_int(const char c); bool verify(const char *ssnumber, int len); private: Regex *m_re; + static int convert_to_int(const char c); + const char bad_svnr[12][11] = { "0000000000", + "0123456789", + "1234567890", + "1111111111", + "2222222222", + "3333333333", + "4444444444", + "5555555555", + "6666666666", + "7777777777", + "8888888888", + "9999999999"}; }; } // namespace operators diff --git a/src/deps/src/ModSecurity/src/operators/within.cc b/src/deps/src/ModSecurity/src/operators/within.cc index 507bb7697..ce781cc7d 100644 --- a/src/deps/src/ModSecurity/src/operators/within.cc +++ b/src/deps/src/ModSecurity/src/operators/within.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -24,7 +24,7 @@ namespace modsecurity { namespace operators { -bool Within::evaluate(Transaction *transaction, Rule *rule, +bool Within::evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, std::shared_ptr ruleMessage) { bool res = false; size_t pos = 0; diff --git a/src/deps/src/ModSecurity/src/operators/within.h b/src/deps/src/ModSecurity/src/operators/within.h index fccf4ff51..7fcb43091 100644 --- a/src/deps/src/ModSecurity/src/operators/within.h +++ b/src/deps/src/ModSecurity/src/operators/within.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,8 +33,8 @@ class Within : public Operator { : Operator("Within", std::move(param)) { m_couldContainsMacro = true; } - bool evaluate(Transaction *transaction, Rule *rule, - const std::string &str, std::shared_ptr ruleMessage); + bool evaluate(Transaction *transaction, RuleWithActions *rule, + const std::string &str, std::shared_ptr ruleMessage) override; }; } // namespace operators diff --git a/src/deps/src/ModSecurity/src/parser/Makefile.am b/src/deps/src/ModSecurity/src/parser/Makefile.am index 74dbb8b1b..c5605d677 100644 --- a/src/deps/src/ModSecurity/src/parser/Makefile.am +++ b/src/deps/src/ModSecurity/src/parser/Makefile.am @@ -20,6 +20,7 @@ libmodsec_parser_la_CPPFLAGS = \ -g \ -fPIC \ -O3 \ + $(CURL_CFLAGS) \ $(GEOIP_CFLAGS) \ $(GLOBAL_CPPFLAGS) \ $(MODSEC_NO_LOGS) \ diff --git a/src/deps/src/ModSecurity/src/parser/driver.cc b/src/deps/src/ModSecurity/src/parser/driver.cc index f9a729a0f..c8d15b48a 100644 --- a/src/deps/src/ModSecurity/src/parser/driver.cc +++ b/src/deps/src/ModSecurity/src/parser/driver.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,21 +15,22 @@ #include "src/parser/driver.h" +#include "modsecurity/rules_set_properties.h" #include "src/parser/seclang-parser.hh" #include "modsecurity/audit_log.h" -#include "modsecurity/rules_properties.h" +#include "modsecurity/rule_marker.h" using modsecurity::audit_log::AuditLog; -using modsecurity::Rule; +using modsecurity::RuleWithOperator; namespace modsecurity { namespace Parser { Driver::Driver() - : RulesProperties(), + : RulesSetProperties(), trace_scanning(false), trace_parsing(false), - lastRule(NULL) { } + m_lastRule(nullptr) { } Driver::~Driver() { @@ -41,86 +42,75 @@ Driver::~Driver() { } -int Driver::addSecMarker(std::string marker) { +int Driver::addSecMarker(std::string marker, std::unique_ptr fileName, int lineNumber) { + // FIXME: we might move this to the parser. for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { - Rule *rule = new Rule(marker); - rule->m_phase = i; - m_rules[i].push_back(rule); + RuleMarker *r = new RuleMarker(marker, std::unique_ptr(new std::string(*fileName)), lineNumber); + std::unique_ptr rule(r); + rule->setPhase(i); + m_rulesSetPhases.insert(std::move(rule)); } return 0; } -int Driver::addSecAction(Rule *rule) { - if (rule->m_phase >= modsecurity::Phases::NUMBER_OF_PHASES) { - m_parserError << "Unknown phase: " << std::to_string(rule->m_phase); +int Driver::addSecAction(std::unique_ptr rule) { + if (rule->getPhase() >= modsecurity::Phases::NUMBER_OF_PHASES) { + m_parserError << "Unknown phase: " << std::to_string(rule->getPhase()); m_parserError << std::endl; return false; } - m_rules[rule->m_phase].push_back(rule); + m_rulesSetPhases.insert(std::move(rule)); return true; } -int Driver::addSecRuleScript(RuleScript *rule) { - m_rules[rule->m_phase].push_back(rule); +int Driver::addSecRuleScript(std::unique_ptr rule) { + m_rulesSetPhases.insert(std::move(rule)); return true; } -int Driver::addSecRule(Rule *rule) { - if (rule->m_phase >= modsecurity::Phases::NUMBER_OF_PHASES) { - m_parserError << "Unknown phase: " << std::to_string(rule->m_phase); +int Driver::addSecRule(std::unique_ptr r) { + if (r->getPhase() >= modsecurity::Phases::NUMBER_OF_PHASES) { + m_parserError << "Unknown phase: " << std::to_string(r->getPhase()); m_parserError << std::endl; return false; } - if (lastRule && lastRule->m_chained) { - if (lastRule->m_chainedRuleChild == NULL) { - rule->m_phase = lastRule->m_phase; - if (rule->m_theDisruptiveAction) { - m_parserError << "Disruptive actions can only be specified by"; - m_parserError << " chain starter rules."; - return false; - } - lastRule->m_chainedRuleChild = rule; - rule->m_chainedRuleParent = lastRule; - return true; - } else { - Rule *a = lastRule->m_chainedRuleChild; - while (a->m_chained && a->m_chainedRuleChild != NULL) { - a = a->m_chainedRuleChild; - } - if (a->m_chained && a->m_chainedRuleChild == NULL) { - a->m_chainedRuleChild = rule; - rule->m_chainedRuleParent = a; - if (a->m_theDisruptiveAction) { - m_parserError << "Disruptive actions can only be "; - m_parserError << "specified by chain starter rules."; - return false; - } - return true; - } + /* is it a chained rule? */ + if (m_lastRule != nullptr && m_lastRule->isChained()) { + r->setPhase(m_lastRule->getPhase()); + if (r->hasDisruptiveAction()) { + m_parserError << "Disruptive actions can only be specified by"; + m_parserError << " chain starter rules."; + return false; } + m_lastRule->m_chainedRuleChild = std::move(r); + m_lastRule->m_chainedRuleChild->m_chainedRuleParent = m_lastRule; + m_lastRule = m_lastRule->m_chainedRuleChild.get(); + return true; } - + std::shared_ptr rule(std::move(r)); /* * Checking if the rule has an ID and also checking if this ID is not used * by other rule */ if (rule->m_ruleId == 0) { m_parserError << "Rules must have an ID. File: "; - m_parserError << rule->m_fileName << " at line: "; - m_parserError << std::to_string(rule->m_lineNumber) << std::endl; + m_parserError << rule->getFileName() << " at line: "; + m_parserError << std::to_string(rule->getLineNumber()) << std::endl; return false; } + for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { - std::vector rules = m_rules[i]; - for (int j = 0; j < rules.size(); j++) { - if (rules[j]->m_ruleId == rule->m_ruleId) { + Rules *rules = m_rulesSetPhases[i]; + for (int j = 0; j < rules->size(); j++) { + RuleWithOperator *lr = dynamic_cast(rules->at(j).get()); + if (lr && lr->m_ruleId == rule->m_ruleId) { m_parserError << "Rule id: " << std::to_string(rule->m_ruleId) \ << " is duplicated" << std::endl; return false; @@ -128,14 +118,15 @@ int Driver::addSecRule(Rule *rule) { } } - lastRule = rule; - m_rules[rule->m_phase].push_back(rule); + m_lastRule = rule.get(); + m_rulesSetPhases.insert(rule); + return true; } int Driver::parse(const std::string &f, const std::string &ref) { - lastRule = NULL; + m_lastRule = nullptr; loc.push_back(new yy::location()); if (ref.empty()) { loc.back()->begin.filename = loc.back()->end.filename = new std::string("<>"); @@ -154,6 +145,19 @@ int Driver::parse(const std::string &f, const std::string &ref) { int res = parser.parse(); scan_end(); + /* + * need to check for rules marked as chained but without + * a chained rule. + * + */ + /* + if (m_lastRule != nullptr && m_lastRule->isChained()) { + m_parserError << "Last rule is marked as chained but there " \ + "isn't a subsequent rule." << std::endl; + return false; + } + */ + /* if (m_auditLog->init(&error) == false) { m_parserError << "Problems while initializing the audit logs: " \ diff --git a/src/deps/src/ModSecurity/src/parser/driver.h b/src/deps/src/ModSecurity/src/parser/driver.h index 32d51feeb..864376bf3 100644 --- a/src/deps/src/ModSecurity/src/parser/driver.h +++ b/src/deps/src/ModSecurity/src/parser/driver.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -26,14 +26,16 @@ #define SRC_PARSER_DRIVER_H_ #include "modsecurity/modsecurity.h" -#include "modsecurity/rules.h" -#include "modsecurity/rules_properties.h" +#include "modsecurity/rules_set.h" +#include "modsecurity/rules_set_properties.h" #include "modsecurity/audit_log.h" #include "src/rule_script.h" +#ifndef MS_CPPCHECK_DISABLED_FOR_PARSER #include "src/parser/seclang-parser.hh" +#endif -using modsecurity::Rule; -using modsecurity::Rules; +using modsecurity::RuleWithOperator; +using modsecurity::RulesSet; # define YY_DECL \ @@ -59,15 +61,15 @@ typedef struct Driver_t Driver; * driver class. * **/ -class Driver : public RulesProperties { +class Driver : public RulesSetProperties { public: Driver(); virtual ~Driver(); - int addSecRule(Rule *rule); - int addSecAction(Rule *rule); - int addSecMarker(std::string marker); - int addSecRuleScript(RuleScript *rule); + int addSecRule(std::unique_ptr rule); + int addSecAction(std::unique_ptr rule); + int addSecMarker(std::string marker, std::unique_ptr fileName, int lineNumber); + int addSecRuleScript(std::unique_ptr rule); bool scan_begin(); void scan_end(); @@ -87,7 +89,9 @@ class Driver : public RulesProperties { std::list loc; std::string buffer; - Rule *lastRule; + RuleWithActions *m_lastRule; + + RulesSetPhases m_rulesSetPhases; }; diff --git a/src/deps/src/ModSecurity/src/parser/location.hh b/src/deps/src/ModSecurity/src/parser/location.hh index 9b178d4d5..89e9472c6 100644 --- a/src/deps/src/ModSecurity/src/parser/location.hh +++ b/src/deps/src/ModSecurity/src/parser/location.hh @@ -1,8 +1,8 @@ -// A Bison parser, made by GNU Bison 3.3.2. +// A Bison parser, made by GNU Bison 3.7.6. // Locations for Bison parsers in C++ -// Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. +// Copyright (C) 2002-2015, 2018-2021 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 @@ -15,7 +15,7 @@ // 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 . +// 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 @@ -38,7 +38,6 @@ #ifndef YY_YY_LOCATION_HH_INCLUDED # define YY_YY_LOCATION_HH_INCLUDED -# include // std::max # include # include @@ -54,17 +53,22 @@ # endif # endif - namespace yy { -#line 60 "location.hh" // location.cc:339 +#line 58 "location.hh" + /// A point in a source file. class position { public: + /// Type for file name. + typedef const std::string filename_type; + /// Type for line and column numbers. + typedef int counter_type; + /// Construct a position. - explicit position (std::string* f = YY_NULLPTR, - unsigned l = 1u, - unsigned c = 1u) + explicit position (filename_type* f = YY_NULLPTR, + counter_type l = 1, + counter_type c = 1) : filename (f) , line (l) , column (c) @@ -72,9 +76,9 @@ namespace yy { /// Initialization. - void initialize (std::string* fn = YY_NULLPTR, - unsigned l = 1u, - unsigned c = 1u) + void initialize (filename_type* fn = YY_NULLPTR, + counter_type l = 1, + counter_type c = 1) { filename = fn; line = l; @@ -84,41 +88,40 @@ namespace yy { /** \name Line and Column related manipulators ** \{ */ /// (line related) Advance to the COUNT next lines. - void lines (int count = 1) + void lines (counter_type count = 1) { if (count) { - column = 1u; + column = 1; line = add_ (line, count, 1); } } /// (column related) Advance to the COUNT next columns. - void columns (int count = 1) + void columns (counter_type count = 1) { column = add_ (column, count, 1); } /** \} */ /// File name to which this position refers. - std::string* filename; + filename_type* filename; /// Current line number. - unsigned line; + counter_type line; /// Current column number. - unsigned column; + counter_type column; private: /// Compute max (min, lhs+rhs). - static unsigned add_ (unsigned lhs, int rhs, int min) + static counter_type add_ (counter_type lhs, counter_type rhs, counter_type min) { - return static_cast (std::max (min, - static_cast (lhs) + rhs)); + return lhs + rhs < min ? min : lhs + rhs; } }; /// Add \a width columns, in place. inline position& - operator+= (position& res, int width) + operator+= (position& res, position::counter_type width) { res.columns (width); return res; @@ -126,43 +129,25 @@ namespace yy { /// Add \a width columns. inline position - operator+ (position res, int width) + operator+ (position res, position::counter_type width) { return res += width; } /// Subtract \a width columns, in place. inline position& - operator-= (position& res, int width) + operator-= (position& res, position::counter_type width) { return res += -width; } /// Subtract \a width columns. inline position - operator- (position res, int width) + operator- (position res, position::counter_type width) { return res -= width; } - /// Compare two position objects. - inline bool - operator== (const position& pos1, const position& pos2) - { - return (pos1.line == pos2.line - && pos1.column == pos2.column - && (pos1.filename == pos2.filename - || (pos1.filename && pos2.filename - && *pos1.filename == *pos2.filename))); - } - - /// Compare two position objects. - inline bool - operator!= (const position& pos1, const position& pos2) - { - return !(pos1 == pos2); - } - /** \brief Intercept output stream redirection. ** \param ostr the destination output stream ** \param pos a reference to the position to redirect @@ -180,6 +165,10 @@ namespace yy { class location { public: + /// Type for file name. + typedef position::filename_type filename_type; + /// Type for line and column numbers. + typedef position::counter_type counter_type; /// Construct a location from \a b to \a e. location (const position& b, const position& e) @@ -194,18 +183,18 @@ namespace yy { {} /// Construct a 0-width location in \a f, \a l, \a c. - explicit location (std::string* f, - unsigned l = 1u, - unsigned c = 1u) + explicit location (filename_type* f, + counter_type l = 1, + counter_type c = 1) : begin (f, l, c) , end (f, l, c) {} /// Initialization. - void initialize (std::string* f = YY_NULLPTR, - unsigned l = 1u, - unsigned c = 1u) + void initialize (filename_type* f = YY_NULLPTR, + counter_type l = 1, + counter_type c = 1) { begin.initialize (f, l, c); end = begin; @@ -221,13 +210,13 @@ namespace yy { } /// Extend the current location to the COUNT next columns. - void columns (int count = 1) + void columns (counter_type count = 1) { end += count; } /// Extend the current location to the COUNT next lines. - void lines (int count = 1) + void lines (counter_type count = 1) { end.lines (count); } @@ -242,57 +231,49 @@ namespace yy { }; /// Join two locations, in place. - inline location& operator+= (location& res, const location& end) + inline location& + operator+= (location& res, const location& end) { res.end = end.end; return res; } /// Join two locations. - inline location operator+ (location res, const location& end) + inline location + operator+ (location res, const location& end) { return res += end; } /// Add \a width columns to the end position, in place. - inline location& operator+= (location& res, int width) + inline location& + operator+= (location& res, location::counter_type width) { res.columns (width); return res; } /// Add \a width columns to the end position. - inline location operator+ (location res, int width) + inline location + operator+ (location res, location::counter_type width) { return res += width; } /// Subtract \a width columns to the end position, in place. - inline location& operator-= (location& res, int width) + inline location& + operator-= (location& res, location::counter_type width) { return res += -width; } /// Subtract \a width columns to the end position. - inline location operator- (location res, int width) + inline location + operator- (location res, location::counter_type width) { return res -= width; } - /// Compare two location objects. - inline bool - operator== (const location& loc1, const location& loc2) - { - return loc1.begin == loc2.begin && loc1.end == loc2.end; - } - - /// Compare two location objects. - inline bool - operator!= (const location& loc1, const location& loc2) - { - return !(loc1 == loc2); - } - /** \brief Intercept output stream redirection. ** \param ostr the destination output stream ** \param loc a reference to the location to redirect @@ -303,7 +284,8 @@ namespace yy { std::basic_ostream& operator<< (std::basic_ostream& ostr, const location& loc) { - unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; + location::counter_type end_col + = 0 < loc.end.column ? loc.end.column - 1 : 0; ostr << loc.begin; if (loc.end.filename && (!loc.begin.filename @@ -316,7 +298,7 @@ namespace yy { return ostr; } - } // yy -#line 322 "location.hh" // location.cc:339 +#line 303 "location.hh" + #endif // !YY_YY_LOCATION_HH_INCLUDED diff --git a/src/deps/src/ModSecurity/src/parser/position.hh b/src/deps/src/ModSecurity/src/parser/position.hh index 67f46e294..6575075df 100644 --- a/src/deps/src/ModSecurity/src/parser/position.hh +++ b/src/deps/src/ModSecurity/src/parser/position.hh @@ -1,10 +1,10 @@ -// A Bison parser, made by GNU Bison 3.3.2. +// A Bison parser, made by GNU Bison 3.7.6. // Starting with Bison 3.2, this file is useless: the structure it // used to define is now defined in "location.hh". // // To get rid of this file: -// 1. add 'require "3.2"' (or newer) to your grammar file +// 1. add '%require "3.2"' (or newer) to your grammar file // 2. remove references to this file from your build system // 3. if you used to include it, include "location.hh" instead. diff --git a/src/deps/src/ModSecurity/src/parser/seclang-parser.cc b/src/deps/src/ModSecurity/src/parser/seclang-parser.cc index 5d3f3922d..7f797bd0f 100644 --- a/src/deps/src/ModSecurity/src/parser/seclang-parser.cc +++ b/src/deps/src/ModSecurity/src/parser/seclang-parser.cc @@ -1,8 +1,8 @@ -// A Bison parser, made by GNU Bison 3.3.2. +// A Bison parser, made by GNU Bison 3.7.6. // Skeleton implementation for Bison LALR(1) parsers in C++ -// Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. +// Copyright (C) 2002-2015, 2018-2021 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 @@ -15,7 +15,7 @@ // 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 . +// 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 @@ -30,8 +30,9 @@ // 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. +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. @@ -41,11 +42,11 @@ // Unqualified %code blocks. -#line 324 "seclang-parser.yy" // lalr1.cc:435 +#line 327 "seclang-parser.yy" #include "src/parser/driver.h" -#line 49 "seclang-parser.cc" // lalr1.cc:435 +#line 50 "seclang-parser.cc" #ifndef YY_ @@ -60,6 +61,7 @@ # endif #endif + // Whether we are compiled with exception support. #ifndef YY_EXCEPTIONS # if defined __GNUC__ && !defined __EXCEPTIONS @@ -90,9 +92,6 @@ # endif -// Suppress unused-variable warnings by "using" E. -#define YYUSE(E) ((void) (E)) - // Enable debugging if requested. #if YYDEBUG @@ -118,13 +117,13 @@ # define YY_STACK_PRINT() \ do { \ if (yydebug_) \ - yystack_print_ (); \ + yy_stack_print_ (); \ } while (false) #else // !YYDEBUG # define YYCDEBUG if (false) std::cerr -# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol) +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) # define YY_REDUCE_PRINT(Rule) static_cast (0) # define YY_STACK_PRINT() static_cast (0) @@ -138,57 +137,16 @@ #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus_) - namespace yy { -#line 144 "seclang-parser.cc" // lalr1.cc:510 - - /* 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; - } - +#line 142 "seclang-parser.cc" /// Build a parser object. seclang_parser::seclang_parser (modsecurity::Parser::Driver& driver_yyarg) - : #if YYDEBUG - yydebug_ (false), + : yydebug_ (false), yycdebug_ (&std::cerr), +#else + : #endif driver (driver_yyarg) {} @@ -200,7 +158,7 @@ namespace yy { {} /*---------------. - | Symbol types. | + | symbol kinds. | `---------------*/ @@ -231,13 +189,13 @@ namespace yy { : state (s) {} - seclang_parser::symbol_number_type - seclang_parser::by_state::type_get () const YY_NOEXCEPT + seclang_parser::symbol_kind_type + seclang_parser::by_state::kind () const YY_NOEXCEPT { if (state == empty_state) - return empty_symbol; + return symbol_kind::S_YYEMPTY; else - return yystos_[state]; + return YY_CAST (symbol_kind_type, yystos_[+state]); } seclang_parser::stack_symbol_type::stack_symbol_type () @@ -246,233 +204,235 @@ namespace yy { 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 ()) + switch (that.kind ()) { - 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_REQ_BODY" - case 269: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" - case 270: // "CONFIG_DIR_REQ_BODY_LIMIT" - case 271: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" - case 272: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" - case 273: // "CONFIG_DIR_RES_BODY" - case 274: // "CONFIG_DIR_RES_BODY_LIMIT" - case 275: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" - case 276: // "CONFIG_SEC_RULE_INHERITANCE" - case 277: // "CONFIG_SEC_RULE_PERF_TIME" - case 278: // "CONFIG_DIR_RULE_ENG" - case 279: // "CONFIG_DIR_SEC_ACTION" - case 280: // "CONFIG_DIR_SEC_DEFAULT_ACTION" - case 281: // "CONFIG_DIR_SEC_MARKER" - case 282: // "CONFIG_DIR_UNICODE_MAP_FILE" - case 283: // "CONFIG_DIR_UNICODE_CODE_PAGE" - case 284: // "CONFIG_SEC_COLLECTION_TIMEOUT" - case 285: // "CONFIG_SEC_HTTP_BLKEY" - case 286: // "CONFIG_SEC_INTERCEPT_ON_ERROR" - case 287: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" - case 288: // "CONFIG_SEC_RULE_REMOVE_BY_ID" - case 289: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" - case 290: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" - case 291: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" - case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" - case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" - case 294: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" - case 295: // "CONFIG_UPDLOAD_KEEP_FILES" - case 296: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" - case 297: // "CONFIG_UPLOAD_DIR" - case 298: // "CONFIG_UPLOAD_FILE_LIMIT" - case 299: // "CONFIG_UPLOAD_FILE_MODE" - case 300: // "CONFIG_VALUE_ABORT" - case 301: // "CONFIG_VALUE_DETC" - case 302: // "CONFIG_VALUE_HTTPS" - case 303: // "CONFIG_VALUE_OFF" - case 304: // "CONFIG_VALUE_ON" - case 305: // "CONFIG_VALUE_PARALLEL" - case 306: // "CONFIG_VALUE_PROCESS_PARTIAL" - case 307: // "CONFIG_VALUE_REJECT" - case 308: // "CONFIG_VALUE_RELEVANT_ONLY" - case 309: // "CONFIG_VALUE_SERIAL" - case 310: // "CONFIG_VALUE_WARN" - case 311: // "CONFIG_XML_EXTERNAL_ENTITY" - case 312: // "CONGIG_DIR_RESPONSE_BODY_MP" - case 313: // "CONGIG_DIR_SEC_ARG_SEP" - case 314: // "CONGIG_DIR_SEC_COOKIE_FORMAT" - case 315: // "CONFIG_SEC_COOKIEV0_SEPARATOR" - case 316: // "CONGIG_DIR_SEC_DATA_DIR" - case 317: // "CONGIG_DIR_SEC_STATUS_ENGINE" - case 318: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" - case 319: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" - case 320: // "CONGIG_DIR_SEC_TMP_DIR" - case 321: // "DIRECTIVE" - case 322: // "DIRECTIVE_SECRULESCRIPT" - case 323: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" - case 324: // "QUOTATION_MARK" - case 325: // "RUN_TIME_VAR_BLD" - case 326: // "RUN_TIME_VAR_DUR" - case 327: // "RUN_TIME_VAR_HSV" - case 328: // "RUN_TIME_VAR_REMOTE_USER" - case 329: // "RUN_TIME_VAR_TIME" - case 330: // "RUN_TIME_VAR_TIME_DAY" - case 331: // "RUN_TIME_VAR_TIME_EPOCH" - case 332: // "RUN_TIME_VAR_TIME_HOUR" - case 333: // "RUN_TIME_VAR_TIME_MIN" - case 334: // "RUN_TIME_VAR_TIME_MON" - case 335: // "RUN_TIME_VAR_TIME_SEC" - case 336: // "RUN_TIME_VAR_TIME_WDAY" - case 337: // "RUN_TIME_VAR_TIME_YEAR" - case 338: // "VARIABLE" - case 339: // "Dictionary element" - case 340: // "Dictionary element, selected by regexp" + case symbol_kind::S_ACTION_ACCURACY: // "Accuracy" + case symbol_kind::S_ACTION_ALLOW: // "Allow" + case symbol_kind::S_ACTION_APPEND: // "Append" + case symbol_kind::S_ACTION_AUDIT_LOG: // "AuditLog" + case symbol_kind::S_ACTION_BLOCK: // "Block" + case symbol_kind::S_ACTION_CAPTURE: // "Capture" + case symbol_kind::S_ACTION_CHAIN: // "Chain" + case symbol_kind::S_ACTION_CTL_AUDIT_ENGINE: // "ACTION_CTL_AUDIT_ENGINE" + case symbol_kind::S_ACTION_CTL_AUDIT_LOG_PARTS: // "ACTION_CTL_AUDIT_LOG_PARTS" + case symbol_kind::S_ACTION_CTL_BDY_JSON: // "ACTION_CTL_BDY_JSON" + case symbol_kind::S_ACTION_CTL_BDY_XML: // "ACTION_CTL_BDY_XML" + case symbol_kind::S_ACTION_CTL_BDY_URLENCODED: // "ACTION_CTL_BDY_URLENCODED" + case symbol_kind::S_ACTION_CTL_FORCE_REQ_BODY_VAR: // "ACTION_CTL_FORCE_REQ_BODY_VAR" + case symbol_kind::S_ACTION_CTL_REQUEST_BODY_ACCESS: // "ACTION_CTL_REQUEST_BODY_ACCESS" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_ID: // "ACTION_CTL_RULE_REMOVE_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_TAG: // "ACTION_CTL_RULE_REMOVE_BY_TAG" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + case symbol_kind::S_ACTION_DENY: // "Deny" + case symbol_kind::S_ACTION_DEPRECATE_VAR: // "DeprecateVar" + case symbol_kind::S_ACTION_DROP: // "Drop" + case symbol_kind::S_ACTION_EXEC: // "Exec" + case symbol_kind::S_ACTION_EXPIRE_VAR: // "ExpireVar" + case symbol_kind::S_ACTION_ID: // "Id" + case symbol_kind::S_ACTION_INITCOL: // "InitCol" + case symbol_kind::S_ACTION_LOG: // "Log" + case symbol_kind::S_ACTION_LOG_DATA: // "LogData" + case symbol_kind::S_ACTION_MATURITY: // "Maturity" + case symbol_kind::S_ACTION_MSG: // "Msg" + case symbol_kind::S_ACTION_MULTI_MATCH: // "MultiMatch" + case symbol_kind::S_ACTION_NO_AUDIT_LOG: // "NoAuditLog" + case symbol_kind::S_ACTION_NO_LOG: // "NoLog" + case symbol_kind::S_ACTION_PASS: // "Pass" + case symbol_kind::S_ACTION_PAUSE: // "Pause" + case symbol_kind::S_ACTION_PHASE: // "Phase" + case symbol_kind::S_ACTION_PREPEND: // "Prepend" + case symbol_kind::S_ACTION_PROXY: // "Proxy" + case symbol_kind::S_ACTION_REDIRECT: // "Redirect" + case symbol_kind::S_ACTION_REV: // "Rev" + case symbol_kind::S_ACTION_SANITISE_ARG: // "SanitiseArg" + case symbol_kind::S_ACTION_SANITISE_MATCHED: // "SanitiseMatched" + case symbol_kind::S_ACTION_SANITISE_MATCHED_BYTES: // "SanitiseMatchedBytes" + case symbol_kind::S_ACTION_SANITISE_REQUEST_HEADER: // "SanitiseRequestHeader" + case symbol_kind::S_ACTION_SANITISE_RESPONSE_HEADER: // "SanitiseResponseHeader" + case symbol_kind::S_ACTION_SETENV: // "SetEnv" + case symbol_kind::S_ACTION_SETRSC: // "SetRsc" + case symbol_kind::S_ACTION_SETSID: // "SetSid" + case symbol_kind::S_ACTION_SETUID: // "SetUID" + case symbol_kind::S_ACTION_SEVERITY: // "Severity" + case symbol_kind::S_ACTION_SKIP: // "Skip" + case symbol_kind::S_ACTION_SKIP_AFTER: // "SkipAfter" + case symbol_kind::S_ACTION_STATUS: // "Status" + case symbol_kind::S_ACTION_TAG: // "Tag" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_ENCODE: // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE: // "ACTION_TRANSFORMATION_BASE_64_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + case symbol_kind::S_ACTION_TRANSFORMATION_CMD_LINE: // "ACTION_TRANSFORMATION_CMD_LINE" + case symbol_kind::S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_CSS_DECODE: // "ACTION_TRANSFORMATION_CSS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_ENCODE: // "ACTION_TRANSFORMATION_HEX_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_DECODE: // "ACTION_TRANSFORMATION_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_JS_DECODE: // "ACTION_TRANSFORMATION_JS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_LENGTH: // "ACTION_TRANSFORMATION_LENGTH" + case symbol_kind::S_ACTION_TRANSFORMATION_LOWERCASE: // "ACTION_TRANSFORMATION_LOWERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_MD5: // "ACTION_TRANSFORMATION_MD5" + case symbol_kind::S_ACTION_TRANSFORMATION_NONE: // "ACTION_TRANSFORMATION_NONE" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH: // "ACTION_TRANSFORMATION_NORMALISE_PATH" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_NULLS: // "ACTION_TRANSFORMATION_REMOVE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_COMMENTS: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_NULLS: // "ACTION_TRANSFORMATION_REPLACE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_SHA1: // "ACTION_TRANSFORMATION_SHA1" + case symbol_kind::S_ACTION_TRANSFORMATION_SQL_HEX_DECODE: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM: // "ACTION_TRANSFORMATION_TRIM" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_LEFT: // "ACTION_TRANSFORMATION_TRIM_LEFT" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_RIGHT: // "ACTION_TRANSFORMATION_TRIM_RIGHT" + case symbol_kind::S_ACTION_TRANSFORMATION_UPPERCASE: // "ACTION_TRANSFORMATION_UPPERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_ENCODE: // "ACTION_TRANSFORMATION_URL_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE: // "ACTION_TRANSFORMATION_URL_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE_UNI: // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + case symbol_kind::S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + case symbol_kind::S_ACTION_VER: // "Ver" + case symbol_kind::S_ACTION_XMLNS: // "xmlns" + case symbol_kind::S_CONFIG_COMPONENT_SIG: // "CONFIG_COMPONENT_SIG" + case symbol_kind::S_CONFIG_CONN_ENGINE: // "CONFIG_CONN_ENGINE" + case symbol_kind::S_CONFIG_SEC_ARGUMENT_SEPARATOR: // "CONFIG_SEC_ARGUMENT_SEPARATOR" + case symbol_kind::S_CONFIG_SEC_WEB_APP_ID: // "CONFIG_SEC_WEB_APP_ID" + case symbol_kind::S_CONFIG_SEC_SERVER_SIG: // "CONFIG_SEC_SERVER_SIG" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR: // "CONFIG_DIR_AUDIT_DIR" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR_MOD: // "CONFIG_DIR_AUDIT_DIR_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_ENG: // "CONFIG_DIR_AUDIT_ENG" + case symbol_kind::S_CONFIG_DIR_AUDIT_FLE_MOD: // "CONFIG_DIR_AUDIT_FLE_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG: // "CONFIG_DIR_AUDIT_LOG" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG2: // "CONFIG_DIR_AUDIT_LOG2" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG_P: // "CONFIG_DIR_AUDIT_LOG_P" + case symbol_kind::S_CONFIG_DIR_AUDIT_STS: // "CONFIG_DIR_AUDIT_STS" + case symbol_kind::S_CONFIG_DIR_AUDIT_TPE: // "CONFIG_DIR_AUDIT_TPE" + case symbol_kind::S_CONFIG_DIR_DEBUG_LOG: // "CONFIG_DIR_DEBUG_LOG" + case symbol_kind::S_CONFIG_DIR_DEBUG_LVL: // "CONFIG_DIR_DEBUG_LVL" + case symbol_kind::S_CONFIG_SEC_CACHE_TRANSFORMATIONS: // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + case symbol_kind::S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + case symbol_kind::S_CONFIG_SEC_HASH_ENGINE: // "CONFIG_SEC_HASH_ENGINE" + case symbol_kind::S_CONFIG_SEC_HASH_KEY: // "CONFIG_SEC_HASH_KEY" + case symbol_kind::S_CONFIG_SEC_HASH_PARAM: // "CONFIG_SEC_HASH_PARAM" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_RX: // "CONFIG_SEC_HASH_METHOD_RX" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_PM: // "CONFIG_SEC_HASH_METHOD_PM" + case symbol_kind::S_CONFIG_SEC_CHROOT_DIR: // "CONFIG_SEC_CHROOT_DIR" + case symbol_kind::S_CONFIG_DIR_GEO_DB: // "CONFIG_DIR_GEO_DB" + case symbol_kind::S_CONFIG_DIR_GSB_DB: // "CONFIG_DIR_GSB_DB" + case symbol_kind::S_CONFIG_SEC_GUARDIAN_LOG: // "CONFIG_SEC_GUARDIAN_LOG" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT: // "CONFIG_DIR_PCRE_MATCH_LIMIT" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + case symbol_kind::S_CONFIG_SEC_CONN_R_STATE_LIMIT: // "CONFIG_SEC_CONN_R_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_CONN_W_STATE_LIMIT: // "CONFIG_SEC_CONN_W_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_SENSOR_ID: // "CONFIG_SEC_SENSOR_ID" + case symbol_kind::S_CONFIG_DIR_ARGS_LIMIT: // "CONFIG_DIR_ARGS_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT: // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY: // "CONFIG_DIR_REQ_BODY" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT: // "CONFIG_DIR_REQ_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY: // "CONFIG_DIR_RES_BODY" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT: // "CONFIG_DIR_RES_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT_ACTION: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_INHERITANCE: // "CONFIG_SEC_RULE_INHERITANCE" + case symbol_kind::S_CONFIG_SEC_RULE_PERF_TIME: // "CONFIG_SEC_RULE_PERF_TIME" + case symbol_kind::S_CONFIG_DIR_RULE_ENG: // "CONFIG_DIR_RULE_ENG" + case symbol_kind::S_CONFIG_DIR_SEC_ACTION: // "CONFIG_DIR_SEC_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_DEFAULT_ACTION: // "CONFIG_DIR_SEC_DEFAULT_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_MARKER: // "CONFIG_DIR_SEC_MARKER" + case symbol_kind::S_CONFIG_DIR_UNICODE_MAP_FILE: // "CONFIG_DIR_UNICODE_MAP_FILE" + case symbol_kind::S_CONFIG_DIR_UNICODE_CODE_PAGE: // "CONFIG_DIR_UNICODE_CODE_PAGE" + case symbol_kind::S_CONFIG_SEC_COLLECTION_TIMEOUT: // "CONFIG_SEC_COLLECTION_TIMEOUT" + case symbol_kind::S_CONFIG_SEC_HTTP_BLKEY: // "CONFIG_SEC_HTTP_BLKEY" + case symbol_kind::S_CONFIG_SEC_INTERCEPT_ON_ERROR: // "CONFIG_SEC_INTERCEPT_ON_ERROR" + case symbol_kind::S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_ID: // "CONFIG_SEC_RULE_REMOVE_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_MSG: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_TAG: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + case symbol_kind::S_CONFIG_UPDLOAD_KEEP_FILES: // "CONFIG_UPDLOAD_KEEP_FILES" + case symbol_kind::S_CONFIG_UPDLOAD_SAVE_TMP_FILES: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + case symbol_kind::S_CONFIG_UPLOAD_DIR: // "CONFIG_UPLOAD_DIR" + case symbol_kind::S_CONFIG_UPLOAD_FILE_LIMIT: // "CONFIG_UPLOAD_FILE_LIMIT" + case symbol_kind::S_CONFIG_UPLOAD_FILE_MODE: // "CONFIG_UPLOAD_FILE_MODE" + case symbol_kind::S_CONFIG_VALUE_ABORT: // "CONFIG_VALUE_ABORT" + case symbol_kind::S_CONFIG_VALUE_DETC: // "CONFIG_VALUE_DETC" + case symbol_kind::S_CONFIG_VALUE_HTTPS: // "CONFIG_VALUE_HTTPS" + case symbol_kind::S_CONFIG_VALUE_OFF: // "CONFIG_VALUE_OFF" + case symbol_kind::S_CONFIG_VALUE_ON: // "CONFIG_VALUE_ON" + case symbol_kind::S_CONFIG_VALUE_PARALLEL: // "CONFIG_VALUE_PARALLEL" + case symbol_kind::S_CONFIG_VALUE_PROCESS_PARTIAL: // "CONFIG_VALUE_PROCESS_PARTIAL" + case symbol_kind::S_CONFIG_VALUE_REJECT: // "CONFIG_VALUE_REJECT" + case symbol_kind::S_CONFIG_VALUE_RELEVANT_ONLY: // "CONFIG_VALUE_RELEVANT_ONLY" + case symbol_kind::S_CONFIG_VALUE_SERIAL: // "CONFIG_VALUE_SERIAL" + case symbol_kind::S_CONFIG_VALUE_WARN: // "CONFIG_VALUE_WARN" + case symbol_kind::S_CONFIG_XML_EXTERNAL_ENTITY: // "CONFIG_XML_EXTERNAL_ENTITY" + case symbol_kind::S_CONGIG_DIR_RESPONSE_BODY_MP: // "CONGIG_DIR_RESPONSE_BODY_MP" + case symbol_kind::S_CONGIG_DIR_SEC_ARG_SEP: // "CONGIG_DIR_SEC_ARG_SEP" + case symbol_kind::S_CONGIG_DIR_SEC_COOKIE_FORMAT: // "CONGIG_DIR_SEC_COOKIE_FORMAT" + case symbol_kind::S_CONFIG_SEC_COOKIEV0_SEPARATOR: // "CONFIG_SEC_COOKIEV0_SEPARATOR" + case symbol_kind::S_CONGIG_DIR_SEC_DATA_DIR: // "CONGIG_DIR_SEC_DATA_DIR" + case symbol_kind::S_CONGIG_DIR_SEC_STATUS_ENGINE: // "CONGIG_DIR_SEC_STATUS_ENGINE" + case symbol_kind::S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + case symbol_kind::S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + case symbol_kind::S_CONGIG_DIR_SEC_TMP_DIR: // "CONGIG_DIR_SEC_TMP_DIR" + case symbol_kind::S_DIRECTIVE: // "DIRECTIVE" + case symbol_kind::S_DIRECTIVE_SECRULESCRIPT: // "DIRECTIVE_SECRULESCRIPT" + case symbol_kind::S_FREE_TEXT_QUOTE_MACRO_EXPANSION: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + case symbol_kind::S_QUOTATION_MARK: // "QUOTATION_MARK" + case symbol_kind::S_RUN_TIME_VAR_BLD: // "RUN_TIME_VAR_BLD" + case symbol_kind::S_RUN_TIME_VAR_DUR: // "RUN_TIME_VAR_DUR" + case symbol_kind::S_RUN_TIME_VAR_HSV: // "RUN_TIME_VAR_HSV" + case symbol_kind::S_RUN_TIME_VAR_REMOTE_USER: // "RUN_TIME_VAR_REMOTE_USER" + case symbol_kind::S_RUN_TIME_VAR_TIME: // "RUN_TIME_VAR_TIME" + case symbol_kind::S_RUN_TIME_VAR_TIME_DAY: // "RUN_TIME_VAR_TIME_DAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_EPOCH: // "RUN_TIME_VAR_TIME_EPOCH" + case symbol_kind::S_RUN_TIME_VAR_TIME_HOUR: // "RUN_TIME_VAR_TIME_HOUR" + case symbol_kind::S_RUN_TIME_VAR_TIME_MIN: // "RUN_TIME_VAR_TIME_MIN" + case symbol_kind::S_RUN_TIME_VAR_TIME_MON: // "RUN_TIME_VAR_TIME_MON" + case symbol_kind::S_RUN_TIME_VAR_TIME_SEC: // "RUN_TIME_VAR_TIME_SEC" + case symbol_kind::S_RUN_TIME_VAR_TIME_WDAY: // "RUN_TIME_VAR_TIME_WDAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_YEAR: // "RUN_TIME_VAR_TIME_YEAR" + case symbol_kind::S_VARIABLE: // "VARIABLE" + case symbol_kind::S_DICT_ELEMENT: // "Dictionary element" + case symbol_kind::S_DICT_ELEMENT_REGEXP: // "Dictionary element, selected by regexp" value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); break; - case 347: // op - case 348: // op_before_init + case symbol_kind::S_op: // op + case symbol_kind::S_op_before_init: // op_before_init value.YY_MOVE_OR_COPY< std::unique_ptr > (YY_MOVE (that.value)); break; - case 356: // run_time_string + case symbol_kind::S_run_time_string: // run_time_string value.YY_MOVE_OR_COPY< std::unique_ptr > (YY_MOVE (that.value)); break; - case 353: // var + case symbol_kind::S_var: // var value.YY_MOVE_OR_COPY< std::unique_ptr > (YY_MOVE (that.value)); break; - case 354: // act - case 355: // setvar_action + case symbol_kind::S_act: // act + case symbol_kind::S_setvar_action: // setvar_action value.YY_MOVE_OR_COPY< std::unique_ptr > (YY_MOVE (that.value)); break; - case 350: // variables - case 351: // variables_pre_process - case 352: // variables_may_be_quoted + case symbol_kind::S_variables: // variables + case symbol_kind::S_variables_pre_process: // variables_pre_process + case symbol_kind::S_variables_may_be_quoted: // variables_may_be_quoted value.YY_MOVE_OR_COPY< std::unique_ptr > > > (YY_MOVE (that.value)); break; - case 345: // actions - case 346: // actions_may_quoted + case symbol_kind::S_actions: // actions + case symbol_kind::S_actions_may_quoted: // actions_may_quoted value.YY_MOVE_OR_COPY< std::unique_ptr > > > (YY_MOVE (that.value)); break; @@ -489,233 +449,235 @@ namespace yy { 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 ()) + switch (that.kind ()) { - 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_REQ_BODY" - case 269: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" - case 270: // "CONFIG_DIR_REQ_BODY_LIMIT" - case 271: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" - case 272: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" - case 273: // "CONFIG_DIR_RES_BODY" - case 274: // "CONFIG_DIR_RES_BODY_LIMIT" - case 275: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" - case 276: // "CONFIG_SEC_RULE_INHERITANCE" - case 277: // "CONFIG_SEC_RULE_PERF_TIME" - case 278: // "CONFIG_DIR_RULE_ENG" - case 279: // "CONFIG_DIR_SEC_ACTION" - case 280: // "CONFIG_DIR_SEC_DEFAULT_ACTION" - case 281: // "CONFIG_DIR_SEC_MARKER" - case 282: // "CONFIG_DIR_UNICODE_MAP_FILE" - case 283: // "CONFIG_DIR_UNICODE_CODE_PAGE" - case 284: // "CONFIG_SEC_COLLECTION_TIMEOUT" - case 285: // "CONFIG_SEC_HTTP_BLKEY" - case 286: // "CONFIG_SEC_INTERCEPT_ON_ERROR" - case 287: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" - case 288: // "CONFIG_SEC_RULE_REMOVE_BY_ID" - case 289: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" - case 290: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" - case 291: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" - case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" - case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" - case 294: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" - case 295: // "CONFIG_UPDLOAD_KEEP_FILES" - case 296: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" - case 297: // "CONFIG_UPLOAD_DIR" - case 298: // "CONFIG_UPLOAD_FILE_LIMIT" - case 299: // "CONFIG_UPLOAD_FILE_MODE" - case 300: // "CONFIG_VALUE_ABORT" - case 301: // "CONFIG_VALUE_DETC" - case 302: // "CONFIG_VALUE_HTTPS" - case 303: // "CONFIG_VALUE_OFF" - case 304: // "CONFIG_VALUE_ON" - case 305: // "CONFIG_VALUE_PARALLEL" - case 306: // "CONFIG_VALUE_PROCESS_PARTIAL" - case 307: // "CONFIG_VALUE_REJECT" - case 308: // "CONFIG_VALUE_RELEVANT_ONLY" - case 309: // "CONFIG_VALUE_SERIAL" - case 310: // "CONFIG_VALUE_WARN" - case 311: // "CONFIG_XML_EXTERNAL_ENTITY" - case 312: // "CONGIG_DIR_RESPONSE_BODY_MP" - case 313: // "CONGIG_DIR_SEC_ARG_SEP" - case 314: // "CONGIG_DIR_SEC_COOKIE_FORMAT" - case 315: // "CONFIG_SEC_COOKIEV0_SEPARATOR" - case 316: // "CONGIG_DIR_SEC_DATA_DIR" - case 317: // "CONGIG_DIR_SEC_STATUS_ENGINE" - case 318: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" - case 319: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" - case 320: // "CONGIG_DIR_SEC_TMP_DIR" - case 321: // "DIRECTIVE" - case 322: // "DIRECTIVE_SECRULESCRIPT" - case 323: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" - case 324: // "QUOTATION_MARK" - case 325: // "RUN_TIME_VAR_BLD" - case 326: // "RUN_TIME_VAR_DUR" - case 327: // "RUN_TIME_VAR_HSV" - case 328: // "RUN_TIME_VAR_REMOTE_USER" - case 329: // "RUN_TIME_VAR_TIME" - case 330: // "RUN_TIME_VAR_TIME_DAY" - case 331: // "RUN_TIME_VAR_TIME_EPOCH" - case 332: // "RUN_TIME_VAR_TIME_HOUR" - case 333: // "RUN_TIME_VAR_TIME_MIN" - case 334: // "RUN_TIME_VAR_TIME_MON" - case 335: // "RUN_TIME_VAR_TIME_SEC" - case 336: // "RUN_TIME_VAR_TIME_WDAY" - case 337: // "RUN_TIME_VAR_TIME_YEAR" - case 338: // "VARIABLE" - case 339: // "Dictionary element" - case 340: // "Dictionary element, selected by regexp" + case symbol_kind::S_ACTION_ACCURACY: // "Accuracy" + case symbol_kind::S_ACTION_ALLOW: // "Allow" + case symbol_kind::S_ACTION_APPEND: // "Append" + case symbol_kind::S_ACTION_AUDIT_LOG: // "AuditLog" + case symbol_kind::S_ACTION_BLOCK: // "Block" + case symbol_kind::S_ACTION_CAPTURE: // "Capture" + case symbol_kind::S_ACTION_CHAIN: // "Chain" + case symbol_kind::S_ACTION_CTL_AUDIT_ENGINE: // "ACTION_CTL_AUDIT_ENGINE" + case symbol_kind::S_ACTION_CTL_AUDIT_LOG_PARTS: // "ACTION_CTL_AUDIT_LOG_PARTS" + case symbol_kind::S_ACTION_CTL_BDY_JSON: // "ACTION_CTL_BDY_JSON" + case symbol_kind::S_ACTION_CTL_BDY_XML: // "ACTION_CTL_BDY_XML" + case symbol_kind::S_ACTION_CTL_BDY_URLENCODED: // "ACTION_CTL_BDY_URLENCODED" + case symbol_kind::S_ACTION_CTL_FORCE_REQ_BODY_VAR: // "ACTION_CTL_FORCE_REQ_BODY_VAR" + case symbol_kind::S_ACTION_CTL_REQUEST_BODY_ACCESS: // "ACTION_CTL_REQUEST_BODY_ACCESS" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_ID: // "ACTION_CTL_RULE_REMOVE_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_TAG: // "ACTION_CTL_RULE_REMOVE_BY_TAG" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + case symbol_kind::S_ACTION_DENY: // "Deny" + case symbol_kind::S_ACTION_DEPRECATE_VAR: // "DeprecateVar" + case symbol_kind::S_ACTION_DROP: // "Drop" + case symbol_kind::S_ACTION_EXEC: // "Exec" + case symbol_kind::S_ACTION_EXPIRE_VAR: // "ExpireVar" + case symbol_kind::S_ACTION_ID: // "Id" + case symbol_kind::S_ACTION_INITCOL: // "InitCol" + case symbol_kind::S_ACTION_LOG: // "Log" + case symbol_kind::S_ACTION_LOG_DATA: // "LogData" + case symbol_kind::S_ACTION_MATURITY: // "Maturity" + case symbol_kind::S_ACTION_MSG: // "Msg" + case symbol_kind::S_ACTION_MULTI_MATCH: // "MultiMatch" + case symbol_kind::S_ACTION_NO_AUDIT_LOG: // "NoAuditLog" + case symbol_kind::S_ACTION_NO_LOG: // "NoLog" + case symbol_kind::S_ACTION_PASS: // "Pass" + case symbol_kind::S_ACTION_PAUSE: // "Pause" + case symbol_kind::S_ACTION_PHASE: // "Phase" + case symbol_kind::S_ACTION_PREPEND: // "Prepend" + case symbol_kind::S_ACTION_PROXY: // "Proxy" + case symbol_kind::S_ACTION_REDIRECT: // "Redirect" + case symbol_kind::S_ACTION_REV: // "Rev" + case symbol_kind::S_ACTION_SANITISE_ARG: // "SanitiseArg" + case symbol_kind::S_ACTION_SANITISE_MATCHED: // "SanitiseMatched" + case symbol_kind::S_ACTION_SANITISE_MATCHED_BYTES: // "SanitiseMatchedBytes" + case symbol_kind::S_ACTION_SANITISE_REQUEST_HEADER: // "SanitiseRequestHeader" + case symbol_kind::S_ACTION_SANITISE_RESPONSE_HEADER: // "SanitiseResponseHeader" + case symbol_kind::S_ACTION_SETENV: // "SetEnv" + case symbol_kind::S_ACTION_SETRSC: // "SetRsc" + case symbol_kind::S_ACTION_SETSID: // "SetSid" + case symbol_kind::S_ACTION_SETUID: // "SetUID" + case symbol_kind::S_ACTION_SEVERITY: // "Severity" + case symbol_kind::S_ACTION_SKIP: // "Skip" + case symbol_kind::S_ACTION_SKIP_AFTER: // "SkipAfter" + case symbol_kind::S_ACTION_STATUS: // "Status" + case symbol_kind::S_ACTION_TAG: // "Tag" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_ENCODE: // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE: // "ACTION_TRANSFORMATION_BASE_64_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + case symbol_kind::S_ACTION_TRANSFORMATION_CMD_LINE: // "ACTION_TRANSFORMATION_CMD_LINE" + case symbol_kind::S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_CSS_DECODE: // "ACTION_TRANSFORMATION_CSS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_ENCODE: // "ACTION_TRANSFORMATION_HEX_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_DECODE: // "ACTION_TRANSFORMATION_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_JS_DECODE: // "ACTION_TRANSFORMATION_JS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_LENGTH: // "ACTION_TRANSFORMATION_LENGTH" + case symbol_kind::S_ACTION_TRANSFORMATION_LOWERCASE: // "ACTION_TRANSFORMATION_LOWERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_MD5: // "ACTION_TRANSFORMATION_MD5" + case symbol_kind::S_ACTION_TRANSFORMATION_NONE: // "ACTION_TRANSFORMATION_NONE" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH: // "ACTION_TRANSFORMATION_NORMALISE_PATH" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_NULLS: // "ACTION_TRANSFORMATION_REMOVE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_COMMENTS: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_NULLS: // "ACTION_TRANSFORMATION_REPLACE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_SHA1: // "ACTION_TRANSFORMATION_SHA1" + case symbol_kind::S_ACTION_TRANSFORMATION_SQL_HEX_DECODE: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM: // "ACTION_TRANSFORMATION_TRIM" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_LEFT: // "ACTION_TRANSFORMATION_TRIM_LEFT" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_RIGHT: // "ACTION_TRANSFORMATION_TRIM_RIGHT" + case symbol_kind::S_ACTION_TRANSFORMATION_UPPERCASE: // "ACTION_TRANSFORMATION_UPPERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_ENCODE: // "ACTION_TRANSFORMATION_URL_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE: // "ACTION_TRANSFORMATION_URL_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE_UNI: // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + case symbol_kind::S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + case symbol_kind::S_ACTION_VER: // "Ver" + case symbol_kind::S_ACTION_XMLNS: // "xmlns" + case symbol_kind::S_CONFIG_COMPONENT_SIG: // "CONFIG_COMPONENT_SIG" + case symbol_kind::S_CONFIG_CONN_ENGINE: // "CONFIG_CONN_ENGINE" + case symbol_kind::S_CONFIG_SEC_ARGUMENT_SEPARATOR: // "CONFIG_SEC_ARGUMENT_SEPARATOR" + case symbol_kind::S_CONFIG_SEC_WEB_APP_ID: // "CONFIG_SEC_WEB_APP_ID" + case symbol_kind::S_CONFIG_SEC_SERVER_SIG: // "CONFIG_SEC_SERVER_SIG" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR: // "CONFIG_DIR_AUDIT_DIR" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR_MOD: // "CONFIG_DIR_AUDIT_DIR_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_ENG: // "CONFIG_DIR_AUDIT_ENG" + case symbol_kind::S_CONFIG_DIR_AUDIT_FLE_MOD: // "CONFIG_DIR_AUDIT_FLE_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG: // "CONFIG_DIR_AUDIT_LOG" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG2: // "CONFIG_DIR_AUDIT_LOG2" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG_P: // "CONFIG_DIR_AUDIT_LOG_P" + case symbol_kind::S_CONFIG_DIR_AUDIT_STS: // "CONFIG_DIR_AUDIT_STS" + case symbol_kind::S_CONFIG_DIR_AUDIT_TPE: // "CONFIG_DIR_AUDIT_TPE" + case symbol_kind::S_CONFIG_DIR_DEBUG_LOG: // "CONFIG_DIR_DEBUG_LOG" + case symbol_kind::S_CONFIG_DIR_DEBUG_LVL: // "CONFIG_DIR_DEBUG_LVL" + case symbol_kind::S_CONFIG_SEC_CACHE_TRANSFORMATIONS: // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + case symbol_kind::S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + case symbol_kind::S_CONFIG_SEC_HASH_ENGINE: // "CONFIG_SEC_HASH_ENGINE" + case symbol_kind::S_CONFIG_SEC_HASH_KEY: // "CONFIG_SEC_HASH_KEY" + case symbol_kind::S_CONFIG_SEC_HASH_PARAM: // "CONFIG_SEC_HASH_PARAM" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_RX: // "CONFIG_SEC_HASH_METHOD_RX" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_PM: // "CONFIG_SEC_HASH_METHOD_PM" + case symbol_kind::S_CONFIG_SEC_CHROOT_DIR: // "CONFIG_SEC_CHROOT_DIR" + case symbol_kind::S_CONFIG_DIR_GEO_DB: // "CONFIG_DIR_GEO_DB" + case symbol_kind::S_CONFIG_DIR_GSB_DB: // "CONFIG_DIR_GSB_DB" + case symbol_kind::S_CONFIG_SEC_GUARDIAN_LOG: // "CONFIG_SEC_GUARDIAN_LOG" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT: // "CONFIG_DIR_PCRE_MATCH_LIMIT" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + case symbol_kind::S_CONFIG_SEC_CONN_R_STATE_LIMIT: // "CONFIG_SEC_CONN_R_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_CONN_W_STATE_LIMIT: // "CONFIG_SEC_CONN_W_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_SENSOR_ID: // "CONFIG_SEC_SENSOR_ID" + case symbol_kind::S_CONFIG_DIR_ARGS_LIMIT: // "CONFIG_DIR_ARGS_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT: // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY: // "CONFIG_DIR_REQ_BODY" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT: // "CONFIG_DIR_REQ_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY: // "CONFIG_DIR_RES_BODY" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT: // "CONFIG_DIR_RES_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT_ACTION: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_INHERITANCE: // "CONFIG_SEC_RULE_INHERITANCE" + case symbol_kind::S_CONFIG_SEC_RULE_PERF_TIME: // "CONFIG_SEC_RULE_PERF_TIME" + case symbol_kind::S_CONFIG_DIR_RULE_ENG: // "CONFIG_DIR_RULE_ENG" + case symbol_kind::S_CONFIG_DIR_SEC_ACTION: // "CONFIG_DIR_SEC_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_DEFAULT_ACTION: // "CONFIG_DIR_SEC_DEFAULT_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_MARKER: // "CONFIG_DIR_SEC_MARKER" + case symbol_kind::S_CONFIG_DIR_UNICODE_MAP_FILE: // "CONFIG_DIR_UNICODE_MAP_FILE" + case symbol_kind::S_CONFIG_DIR_UNICODE_CODE_PAGE: // "CONFIG_DIR_UNICODE_CODE_PAGE" + case symbol_kind::S_CONFIG_SEC_COLLECTION_TIMEOUT: // "CONFIG_SEC_COLLECTION_TIMEOUT" + case symbol_kind::S_CONFIG_SEC_HTTP_BLKEY: // "CONFIG_SEC_HTTP_BLKEY" + case symbol_kind::S_CONFIG_SEC_INTERCEPT_ON_ERROR: // "CONFIG_SEC_INTERCEPT_ON_ERROR" + case symbol_kind::S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_ID: // "CONFIG_SEC_RULE_REMOVE_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_MSG: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_TAG: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + case symbol_kind::S_CONFIG_UPDLOAD_KEEP_FILES: // "CONFIG_UPDLOAD_KEEP_FILES" + case symbol_kind::S_CONFIG_UPDLOAD_SAVE_TMP_FILES: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + case symbol_kind::S_CONFIG_UPLOAD_DIR: // "CONFIG_UPLOAD_DIR" + case symbol_kind::S_CONFIG_UPLOAD_FILE_LIMIT: // "CONFIG_UPLOAD_FILE_LIMIT" + case symbol_kind::S_CONFIG_UPLOAD_FILE_MODE: // "CONFIG_UPLOAD_FILE_MODE" + case symbol_kind::S_CONFIG_VALUE_ABORT: // "CONFIG_VALUE_ABORT" + case symbol_kind::S_CONFIG_VALUE_DETC: // "CONFIG_VALUE_DETC" + case symbol_kind::S_CONFIG_VALUE_HTTPS: // "CONFIG_VALUE_HTTPS" + case symbol_kind::S_CONFIG_VALUE_OFF: // "CONFIG_VALUE_OFF" + case symbol_kind::S_CONFIG_VALUE_ON: // "CONFIG_VALUE_ON" + case symbol_kind::S_CONFIG_VALUE_PARALLEL: // "CONFIG_VALUE_PARALLEL" + case symbol_kind::S_CONFIG_VALUE_PROCESS_PARTIAL: // "CONFIG_VALUE_PROCESS_PARTIAL" + case symbol_kind::S_CONFIG_VALUE_REJECT: // "CONFIG_VALUE_REJECT" + case symbol_kind::S_CONFIG_VALUE_RELEVANT_ONLY: // "CONFIG_VALUE_RELEVANT_ONLY" + case symbol_kind::S_CONFIG_VALUE_SERIAL: // "CONFIG_VALUE_SERIAL" + case symbol_kind::S_CONFIG_VALUE_WARN: // "CONFIG_VALUE_WARN" + case symbol_kind::S_CONFIG_XML_EXTERNAL_ENTITY: // "CONFIG_XML_EXTERNAL_ENTITY" + case symbol_kind::S_CONGIG_DIR_RESPONSE_BODY_MP: // "CONGIG_DIR_RESPONSE_BODY_MP" + case symbol_kind::S_CONGIG_DIR_SEC_ARG_SEP: // "CONGIG_DIR_SEC_ARG_SEP" + case symbol_kind::S_CONGIG_DIR_SEC_COOKIE_FORMAT: // "CONGIG_DIR_SEC_COOKIE_FORMAT" + case symbol_kind::S_CONFIG_SEC_COOKIEV0_SEPARATOR: // "CONFIG_SEC_COOKIEV0_SEPARATOR" + case symbol_kind::S_CONGIG_DIR_SEC_DATA_DIR: // "CONGIG_DIR_SEC_DATA_DIR" + case symbol_kind::S_CONGIG_DIR_SEC_STATUS_ENGINE: // "CONGIG_DIR_SEC_STATUS_ENGINE" + case symbol_kind::S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + case symbol_kind::S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + case symbol_kind::S_CONGIG_DIR_SEC_TMP_DIR: // "CONGIG_DIR_SEC_TMP_DIR" + case symbol_kind::S_DIRECTIVE: // "DIRECTIVE" + case symbol_kind::S_DIRECTIVE_SECRULESCRIPT: // "DIRECTIVE_SECRULESCRIPT" + case symbol_kind::S_FREE_TEXT_QUOTE_MACRO_EXPANSION: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + case symbol_kind::S_QUOTATION_MARK: // "QUOTATION_MARK" + case symbol_kind::S_RUN_TIME_VAR_BLD: // "RUN_TIME_VAR_BLD" + case symbol_kind::S_RUN_TIME_VAR_DUR: // "RUN_TIME_VAR_DUR" + case symbol_kind::S_RUN_TIME_VAR_HSV: // "RUN_TIME_VAR_HSV" + case symbol_kind::S_RUN_TIME_VAR_REMOTE_USER: // "RUN_TIME_VAR_REMOTE_USER" + case symbol_kind::S_RUN_TIME_VAR_TIME: // "RUN_TIME_VAR_TIME" + case symbol_kind::S_RUN_TIME_VAR_TIME_DAY: // "RUN_TIME_VAR_TIME_DAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_EPOCH: // "RUN_TIME_VAR_TIME_EPOCH" + case symbol_kind::S_RUN_TIME_VAR_TIME_HOUR: // "RUN_TIME_VAR_TIME_HOUR" + case symbol_kind::S_RUN_TIME_VAR_TIME_MIN: // "RUN_TIME_VAR_TIME_MIN" + case symbol_kind::S_RUN_TIME_VAR_TIME_MON: // "RUN_TIME_VAR_TIME_MON" + case symbol_kind::S_RUN_TIME_VAR_TIME_SEC: // "RUN_TIME_VAR_TIME_SEC" + case symbol_kind::S_RUN_TIME_VAR_TIME_WDAY: // "RUN_TIME_VAR_TIME_WDAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_YEAR: // "RUN_TIME_VAR_TIME_YEAR" + case symbol_kind::S_VARIABLE: // "VARIABLE" + case symbol_kind::S_DICT_ELEMENT: // "Dictionary element" + case symbol_kind::S_DICT_ELEMENT_REGEXP: // "Dictionary element, selected by regexp" value.move< std::string > (YY_MOVE (that.value)); break; - case 347: // op - case 348: // op_before_init + case symbol_kind::S_op: // op + case symbol_kind::S_op_before_init: // op_before_init value.move< std::unique_ptr > (YY_MOVE (that.value)); break; - case 356: // run_time_string + case symbol_kind::S_run_time_string: // run_time_string value.move< std::unique_ptr > (YY_MOVE (that.value)); break; - case 353: // var + case symbol_kind::S_var: // var value.move< std::unique_ptr > (YY_MOVE (that.value)); break; - case 354: // act - case 355: // setvar_action + case symbol_kind::S_act: // act + case symbol_kind::S_setvar_action: // setvar_action value.move< std::unique_ptr > (YY_MOVE (that.value)); break; - case 350: // variables - case 351: // variables_pre_process - case 352: // variables_may_be_quoted + case symbol_kind::S_variables: // variables + case symbol_kind::S_variables_pre_process: // variables_pre_process + case symbol_kind::S_variables_may_be_quoted: // variables_may_be_quoted value.move< std::unique_ptr > > > (YY_MOVE (that.value)); break; - case 345: // actions - case 346: // actions_may_quoted + case symbol_kind::S_actions: // actions + case symbol_kind::S_actions_may_quoted: // actions_may_quoted value.move< std::unique_ptr > > > (YY_MOVE (that.value)); break; @@ -724,241 +686,487 @@ namespace yy { } // that is emptied. - that.type = empty_symbol; + that.kind_ = symbol_kind::S_YYEMPTY; } #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.kind ()) + { + case symbol_kind::S_ACTION_ACCURACY: // "Accuracy" + case symbol_kind::S_ACTION_ALLOW: // "Allow" + case symbol_kind::S_ACTION_APPEND: // "Append" + case symbol_kind::S_ACTION_AUDIT_LOG: // "AuditLog" + case symbol_kind::S_ACTION_BLOCK: // "Block" + case symbol_kind::S_ACTION_CAPTURE: // "Capture" + case symbol_kind::S_ACTION_CHAIN: // "Chain" + case symbol_kind::S_ACTION_CTL_AUDIT_ENGINE: // "ACTION_CTL_AUDIT_ENGINE" + case symbol_kind::S_ACTION_CTL_AUDIT_LOG_PARTS: // "ACTION_CTL_AUDIT_LOG_PARTS" + case symbol_kind::S_ACTION_CTL_BDY_JSON: // "ACTION_CTL_BDY_JSON" + case symbol_kind::S_ACTION_CTL_BDY_XML: // "ACTION_CTL_BDY_XML" + case symbol_kind::S_ACTION_CTL_BDY_URLENCODED: // "ACTION_CTL_BDY_URLENCODED" + case symbol_kind::S_ACTION_CTL_FORCE_REQ_BODY_VAR: // "ACTION_CTL_FORCE_REQ_BODY_VAR" + case symbol_kind::S_ACTION_CTL_REQUEST_BODY_ACCESS: // "ACTION_CTL_REQUEST_BODY_ACCESS" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_ID: // "ACTION_CTL_RULE_REMOVE_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_TAG: // "ACTION_CTL_RULE_REMOVE_BY_TAG" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + case symbol_kind::S_ACTION_DENY: // "Deny" + case symbol_kind::S_ACTION_DEPRECATE_VAR: // "DeprecateVar" + case symbol_kind::S_ACTION_DROP: // "Drop" + case symbol_kind::S_ACTION_EXEC: // "Exec" + case symbol_kind::S_ACTION_EXPIRE_VAR: // "ExpireVar" + case symbol_kind::S_ACTION_ID: // "Id" + case symbol_kind::S_ACTION_INITCOL: // "InitCol" + case symbol_kind::S_ACTION_LOG: // "Log" + case symbol_kind::S_ACTION_LOG_DATA: // "LogData" + case symbol_kind::S_ACTION_MATURITY: // "Maturity" + case symbol_kind::S_ACTION_MSG: // "Msg" + case symbol_kind::S_ACTION_MULTI_MATCH: // "MultiMatch" + case symbol_kind::S_ACTION_NO_AUDIT_LOG: // "NoAuditLog" + case symbol_kind::S_ACTION_NO_LOG: // "NoLog" + case symbol_kind::S_ACTION_PASS: // "Pass" + case symbol_kind::S_ACTION_PAUSE: // "Pause" + case symbol_kind::S_ACTION_PHASE: // "Phase" + case symbol_kind::S_ACTION_PREPEND: // "Prepend" + case symbol_kind::S_ACTION_PROXY: // "Proxy" + case symbol_kind::S_ACTION_REDIRECT: // "Redirect" + case symbol_kind::S_ACTION_REV: // "Rev" + case symbol_kind::S_ACTION_SANITISE_ARG: // "SanitiseArg" + case symbol_kind::S_ACTION_SANITISE_MATCHED: // "SanitiseMatched" + case symbol_kind::S_ACTION_SANITISE_MATCHED_BYTES: // "SanitiseMatchedBytes" + case symbol_kind::S_ACTION_SANITISE_REQUEST_HEADER: // "SanitiseRequestHeader" + case symbol_kind::S_ACTION_SANITISE_RESPONSE_HEADER: // "SanitiseResponseHeader" + case symbol_kind::S_ACTION_SETENV: // "SetEnv" + case symbol_kind::S_ACTION_SETRSC: // "SetRsc" + case symbol_kind::S_ACTION_SETSID: // "SetSid" + case symbol_kind::S_ACTION_SETUID: // "SetUID" + case symbol_kind::S_ACTION_SEVERITY: // "Severity" + case symbol_kind::S_ACTION_SKIP: // "Skip" + case symbol_kind::S_ACTION_SKIP_AFTER: // "SkipAfter" + case symbol_kind::S_ACTION_STATUS: // "Status" + case symbol_kind::S_ACTION_TAG: // "Tag" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_ENCODE: // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE: // "ACTION_TRANSFORMATION_BASE_64_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + case symbol_kind::S_ACTION_TRANSFORMATION_CMD_LINE: // "ACTION_TRANSFORMATION_CMD_LINE" + case symbol_kind::S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_CSS_DECODE: // "ACTION_TRANSFORMATION_CSS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_ENCODE: // "ACTION_TRANSFORMATION_HEX_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_DECODE: // "ACTION_TRANSFORMATION_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_JS_DECODE: // "ACTION_TRANSFORMATION_JS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_LENGTH: // "ACTION_TRANSFORMATION_LENGTH" + case symbol_kind::S_ACTION_TRANSFORMATION_LOWERCASE: // "ACTION_TRANSFORMATION_LOWERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_MD5: // "ACTION_TRANSFORMATION_MD5" + case symbol_kind::S_ACTION_TRANSFORMATION_NONE: // "ACTION_TRANSFORMATION_NONE" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH: // "ACTION_TRANSFORMATION_NORMALISE_PATH" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_NULLS: // "ACTION_TRANSFORMATION_REMOVE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_COMMENTS: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_NULLS: // "ACTION_TRANSFORMATION_REPLACE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_SHA1: // "ACTION_TRANSFORMATION_SHA1" + case symbol_kind::S_ACTION_TRANSFORMATION_SQL_HEX_DECODE: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM: // "ACTION_TRANSFORMATION_TRIM" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_LEFT: // "ACTION_TRANSFORMATION_TRIM_LEFT" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_RIGHT: // "ACTION_TRANSFORMATION_TRIM_RIGHT" + case symbol_kind::S_ACTION_TRANSFORMATION_UPPERCASE: // "ACTION_TRANSFORMATION_UPPERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_ENCODE: // "ACTION_TRANSFORMATION_URL_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE: // "ACTION_TRANSFORMATION_URL_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE_UNI: // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + case symbol_kind::S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + case symbol_kind::S_ACTION_VER: // "Ver" + case symbol_kind::S_ACTION_XMLNS: // "xmlns" + case symbol_kind::S_CONFIG_COMPONENT_SIG: // "CONFIG_COMPONENT_SIG" + case symbol_kind::S_CONFIG_CONN_ENGINE: // "CONFIG_CONN_ENGINE" + case symbol_kind::S_CONFIG_SEC_ARGUMENT_SEPARATOR: // "CONFIG_SEC_ARGUMENT_SEPARATOR" + case symbol_kind::S_CONFIG_SEC_WEB_APP_ID: // "CONFIG_SEC_WEB_APP_ID" + case symbol_kind::S_CONFIG_SEC_SERVER_SIG: // "CONFIG_SEC_SERVER_SIG" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR: // "CONFIG_DIR_AUDIT_DIR" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR_MOD: // "CONFIG_DIR_AUDIT_DIR_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_ENG: // "CONFIG_DIR_AUDIT_ENG" + case symbol_kind::S_CONFIG_DIR_AUDIT_FLE_MOD: // "CONFIG_DIR_AUDIT_FLE_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG: // "CONFIG_DIR_AUDIT_LOG" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG2: // "CONFIG_DIR_AUDIT_LOG2" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG_P: // "CONFIG_DIR_AUDIT_LOG_P" + case symbol_kind::S_CONFIG_DIR_AUDIT_STS: // "CONFIG_DIR_AUDIT_STS" + case symbol_kind::S_CONFIG_DIR_AUDIT_TPE: // "CONFIG_DIR_AUDIT_TPE" + case symbol_kind::S_CONFIG_DIR_DEBUG_LOG: // "CONFIG_DIR_DEBUG_LOG" + case symbol_kind::S_CONFIG_DIR_DEBUG_LVL: // "CONFIG_DIR_DEBUG_LVL" + case symbol_kind::S_CONFIG_SEC_CACHE_TRANSFORMATIONS: // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + case symbol_kind::S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + case symbol_kind::S_CONFIG_SEC_HASH_ENGINE: // "CONFIG_SEC_HASH_ENGINE" + case symbol_kind::S_CONFIG_SEC_HASH_KEY: // "CONFIG_SEC_HASH_KEY" + case symbol_kind::S_CONFIG_SEC_HASH_PARAM: // "CONFIG_SEC_HASH_PARAM" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_RX: // "CONFIG_SEC_HASH_METHOD_RX" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_PM: // "CONFIG_SEC_HASH_METHOD_PM" + case symbol_kind::S_CONFIG_SEC_CHROOT_DIR: // "CONFIG_SEC_CHROOT_DIR" + case symbol_kind::S_CONFIG_DIR_GEO_DB: // "CONFIG_DIR_GEO_DB" + case symbol_kind::S_CONFIG_DIR_GSB_DB: // "CONFIG_DIR_GSB_DB" + case symbol_kind::S_CONFIG_SEC_GUARDIAN_LOG: // "CONFIG_SEC_GUARDIAN_LOG" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT: // "CONFIG_DIR_PCRE_MATCH_LIMIT" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + case symbol_kind::S_CONFIG_SEC_CONN_R_STATE_LIMIT: // "CONFIG_SEC_CONN_R_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_CONN_W_STATE_LIMIT: // "CONFIG_SEC_CONN_W_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_SENSOR_ID: // "CONFIG_SEC_SENSOR_ID" + case symbol_kind::S_CONFIG_DIR_ARGS_LIMIT: // "CONFIG_DIR_ARGS_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT: // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY: // "CONFIG_DIR_REQ_BODY" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT: // "CONFIG_DIR_REQ_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY: // "CONFIG_DIR_RES_BODY" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT: // "CONFIG_DIR_RES_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT_ACTION: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_INHERITANCE: // "CONFIG_SEC_RULE_INHERITANCE" + case symbol_kind::S_CONFIG_SEC_RULE_PERF_TIME: // "CONFIG_SEC_RULE_PERF_TIME" + case symbol_kind::S_CONFIG_DIR_RULE_ENG: // "CONFIG_DIR_RULE_ENG" + case symbol_kind::S_CONFIG_DIR_SEC_ACTION: // "CONFIG_DIR_SEC_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_DEFAULT_ACTION: // "CONFIG_DIR_SEC_DEFAULT_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_MARKER: // "CONFIG_DIR_SEC_MARKER" + case symbol_kind::S_CONFIG_DIR_UNICODE_MAP_FILE: // "CONFIG_DIR_UNICODE_MAP_FILE" + case symbol_kind::S_CONFIG_DIR_UNICODE_CODE_PAGE: // "CONFIG_DIR_UNICODE_CODE_PAGE" + case symbol_kind::S_CONFIG_SEC_COLLECTION_TIMEOUT: // "CONFIG_SEC_COLLECTION_TIMEOUT" + case symbol_kind::S_CONFIG_SEC_HTTP_BLKEY: // "CONFIG_SEC_HTTP_BLKEY" + case symbol_kind::S_CONFIG_SEC_INTERCEPT_ON_ERROR: // "CONFIG_SEC_INTERCEPT_ON_ERROR" + case symbol_kind::S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_ID: // "CONFIG_SEC_RULE_REMOVE_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_MSG: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_TAG: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + case symbol_kind::S_CONFIG_UPDLOAD_KEEP_FILES: // "CONFIG_UPDLOAD_KEEP_FILES" + case symbol_kind::S_CONFIG_UPDLOAD_SAVE_TMP_FILES: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + case symbol_kind::S_CONFIG_UPLOAD_DIR: // "CONFIG_UPLOAD_DIR" + case symbol_kind::S_CONFIG_UPLOAD_FILE_LIMIT: // "CONFIG_UPLOAD_FILE_LIMIT" + case symbol_kind::S_CONFIG_UPLOAD_FILE_MODE: // "CONFIG_UPLOAD_FILE_MODE" + case symbol_kind::S_CONFIG_VALUE_ABORT: // "CONFIG_VALUE_ABORT" + case symbol_kind::S_CONFIG_VALUE_DETC: // "CONFIG_VALUE_DETC" + case symbol_kind::S_CONFIG_VALUE_HTTPS: // "CONFIG_VALUE_HTTPS" + case symbol_kind::S_CONFIG_VALUE_OFF: // "CONFIG_VALUE_OFF" + case symbol_kind::S_CONFIG_VALUE_ON: // "CONFIG_VALUE_ON" + case symbol_kind::S_CONFIG_VALUE_PARALLEL: // "CONFIG_VALUE_PARALLEL" + case symbol_kind::S_CONFIG_VALUE_PROCESS_PARTIAL: // "CONFIG_VALUE_PROCESS_PARTIAL" + case symbol_kind::S_CONFIG_VALUE_REJECT: // "CONFIG_VALUE_REJECT" + case symbol_kind::S_CONFIG_VALUE_RELEVANT_ONLY: // "CONFIG_VALUE_RELEVANT_ONLY" + case symbol_kind::S_CONFIG_VALUE_SERIAL: // "CONFIG_VALUE_SERIAL" + case symbol_kind::S_CONFIG_VALUE_WARN: // "CONFIG_VALUE_WARN" + case symbol_kind::S_CONFIG_XML_EXTERNAL_ENTITY: // "CONFIG_XML_EXTERNAL_ENTITY" + case symbol_kind::S_CONGIG_DIR_RESPONSE_BODY_MP: // "CONGIG_DIR_RESPONSE_BODY_MP" + case symbol_kind::S_CONGIG_DIR_SEC_ARG_SEP: // "CONGIG_DIR_SEC_ARG_SEP" + case symbol_kind::S_CONGIG_DIR_SEC_COOKIE_FORMAT: // "CONGIG_DIR_SEC_COOKIE_FORMAT" + case symbol_kind::S_CONFIG_SEC_COOKIEV0_SEPARATOR: // "CONFIG_SEC_COOKIEV0_SEPARATOR" + case symbol_kind::S_CONGIG_DIR_SEC_DATA_DIR: // "CONGIG_DIR_SEC_DATA_DIR" + case symbol_kind::S_CONGIG_DIR_SEC_STATUS_ENGINE: // "CONGIG_DIR_SEC_STATUS_ENGINE" + case symbol_kind::S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + case symbol_kind::S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + case symbol_kind::S_CONGIG_DIR_SEC_TMP_DIR: // "CONGIG_DIR_SEC_TMP_DIR" + case symbol_kind::S_DIRECTIVE: // "DIRECTIVE" + case symbol_kind::S_DIRECTIVE_SECRULESCRIPT: // "DIRECTIVE_SECRULESCRIPT" + case symbol_kind::S_FREE_TEXT_QUOTE_MACRO_EXPANSION: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + case symbol_kind::S_QUOTATION_MARK: // "QUOTATION_MARK" + case symbol_kind::S_RUN_TIME_VAR_BLD: // "RUN_TIME_VAR_BLD" + case symbol_kind::S_RUN_TIME_VAR_DUR: // "RUN_TIME_VAR_DUR" + case symbol_kind::S_RUN_TIME_VAR_HSV: // "RUN_TIME_VAR_HSV" + case symbol_kind::S_RUN_TIME_VAR_REMOTE_USER: // "RUN_TIME_VAR_REMOTE_USER" + case symbol_kind::S_RUN_TIME_VAR_TIME: // "RUN_TIME_VAR_TIME" + case symbol_kind::S_RUN_TIME_VAR_TIME_DAY: // "RUN_TIME_VAR_TIME_DAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_EPOCH: // "RUN_TIME_VAR_TIME_EPOCH" + case symbol_kind::S_RUN_TIME_VAR_TIME_HOUR: // "RUN_TIME_VAR_TIME_HOUR" + case symbol_kind::S_RUN_TIME_VAR_TIME_MIN: // "RUN_TIME_VAR_TIME_MIN" + case symbol_kind::S_RUN_TIME_VAR_TIME_MON: // "RUN_TIME_VAR_TIME_MON" + case symbol_kind::S_RUN_TIME_VAR_TIME_SEC: // "RUN_TIME_VAR_TIME_SEC" + case symbol_kind::S_RUN_TIME_VAR_TIME_WDAY: // "RUN_TIME_VAR_TIME_WDAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_YEAR: // "RUN_TIME_VAR_TIME_YEAR" + case symbol_kind::S_VARIABLE: // "VARIABLE" + case symbol_kind::S_DICT_ELEMENT: // "Dictionary element" + case symbol_kind::S_DICT_ELEMENT_REGEXP: // "Dictionary element, selected by regexp" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_op: // op + case symbol_kind::S_op_before_init: // op_before_init + value.copy< std::unique_ptr > (that.value); + break; + + case symbol_kind::S_run_time_string: // run_time_string + value.copy< std::unique_ptr > (that.value); + break; + + case symbol_kind::S_var: // var + value.copy< std::unique_ptr > (that.value); + break; + + case symbol_kind::S_act: // act + case symbol_kind::S_setvar_action: // setvar_action + value.copy< std::unique_ptr > (that.value); + break; + + case symbol_kind::S_variables: // variables + case symbol_kind::S_variables_pre_process: // variables_pre_process + case symbol_kind::S_variables_may_be_quoted: // variables_may_be_quoted + value.copy< std::unique_ptr > > > (that.value); + break; + + case symbol_kind::S_actions: // actions + case symbol_kind::S_actions_may_quoted: // 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 ()) + switch (that.kind ()) { - 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_REQ_BODY" - case 269: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" - case 270: // "CONFIG_DIR_REQ_BODY_LIMIT" - case 271: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" - case 272: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" - case 273: // "CONFIG_DIR_RES_BODY" - case 274: // "CONFIG_DIR_RES_BODY_LIMIT" - case 275: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" - case 276: // "CONFIG_SEC_RULE_INHERITANCE" - case 277: // "CONFIG_SEC_RULE_PERF_TIME" - case 278: // "CONFIG_DIR_RULE_ENG" - case 279: // "CONFIG_DIR_SEC_ACTION" - case 280: // "CONFIG_DIR_SEC_DEFAULT_ACTION" - case 281: // "CONFIG_DIR_SEC_MARKER" - case 282: // "CONFIG_DIR_UNICODE_MAP_FILE" - case 283: // "CONFIG_DIR_UNICODE_CODE_PAGE" - case 284: // "CONFIG_SEC_COLLECTION_TIMEOUT" - case 285: // "CONFIG_SEC_HTTP_BLKEY" - case 286: // "CONFIG_SEC_INTERCEPT_ON_ERROR" - case 287: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" - case 288: // "CONFIG_SEC_RULE_REMOVE_BY_ID" - case 289: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" - case 290: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" - case 291: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" - case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" - case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" - case 294: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" - case 295: // "CONFIG_UPDLOAD_KEEP_FILES" - case 296: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" - case 297: // "CONFIG_UPLOAD_DIR" - case 298: // "CONFIG_UPLOAD_FILE_LIMIT" - case 299: // "CONFIG_UPLOAD_FILE_MODE" - case 300: // "CONFIG_VALUE_ABORT" - case 301: // "CONFIG_VALUE_DETC" - case 302: // "CONFIG_VALUE_HTTPS" - case 303: // "CONFIG_VALUE_OFF" - case 304: // "CONFIG_VALUE_ON" - case 305: // "CONFIG_VALUE_PARALLEL" - case 306: // "CONFIG_VALUE_PROCESS_PARTIAL" - case 307: // "CONFIG_VALUE_REJECT" - case 308: // "CONFIG_VALUE_RELEVANT_ONLY" - case 309: // "CONFIG_VALUE_SERIAL" - case 310: // "CONFIG_VALUE_WARN" - case 311: // "CONFIG_XML_EXTERNAL_ENTITY" - case 312: // "CONGIG_DIR_RESPONSE_BODY_MP" - case 313: // "CONGIG_DIR_SEC_ARG_SEP" - case 314: // "CONGIG_DIR_SEC_COOKIE_FORMAT" - case 315: // "CONFIG_SEC_COOKIEV0_SEPARATOR" - case 316: // "CONGIG_DIR_SEC_DATA_DIR" - case 317: // "CONGIG_DIR_SEC_STATUS_ENGINE" - case 318: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" - case 319: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" - case 320: // "CONGIG_DIR_SEC_TMP_DIR" - case 321: // "DIRECTIVE" - case 322: // "DIRECTIVE_SECRULESCRIPT" - case 323: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" - case 324: // "QUOTATION_MARK" - case 325: // "RUN_TIME_VAR_BLD" - case 326: // "RUN_TIME_VAR_DUR" - case 327: // "RUN_TIME_VAR_HSV" - case 328: // "RUN_TIME_VAR_REMOTE_USER" - case 329: // "RUN_TIME_VAR_TIME" - case 330: // "RUN_TIME_VAR_TIME_DAY" - case 331: // "RUN_TIME_VAR_TIME_EPOCH" - case 332: // "RUN_TIME_VAR_TIME_HOUR" - case 333: // "RUN_TIME_VAR_TIME_MIN" - case 334: // "RUN_TIME_VAR_TIME_MON" - case 335: // "RUN_TIME_VAR_TIME_SEC" - case 336: // "RUN_TIME_VAR_TIME_WDAY" - case 337: // "RUN_TIME_VAR_TIME_YEAR" - case 338: // "VARIABLE" - case 339: // "Dictionary element" - case 340: // "Dictionary element, selected by regexp" + case symbol_kind::S_ACTION_ACCURACY: // "Accuracy" + case symbol_kind::S_ACTION_ALLOW: // "Allow" + case symbol_kind::S_ACTION_APPEND: // "Append" + case symbol_kind::S_ACTION_AUDIT_LOG: // "AuditLog" + case symbol_kind::S_ACTION_BLOCK: // "Block" + case symbol_kind::S_ACTION_CAPTURE: // "Capture" + case symbol_kind::S_ACTION_CHAIN: // "Chain" + case symbol_kind::S_ACTION_CTL_AUDIT_ENGINE: // "ACTION_CTL_AUDIT_ENGINE" + case symbol_kind::S_ACTION_CTL_AUDIT_LOG_PARTS: // "ACTION_CTL_AUDIT_LOG_PARTS" + case symbol_kind::S_ACTION_CTL_BDY_JSON: // "ACTION_CTL_BDY_JSON" + case symbol_kind::S_ACTION_CTL_BDY_XML: // "ACTION_CTL_BDY_XML" + case symbol_kind::S_ACTION_CTL_BDY_URLENCODED: // "ACTION_CTL_BDY_URLENCODED" + case symbol_kind::S_ACTION_CTL_FORCE_REQ_BODY_VAR: // "ACTION_CTL_FORCE_REQ_BODY_VAR" + case symbol_kind::S_ACTION_CTL_REQUEST_BODY_ACCESS: // "ACTION_CTL_REQUEST_BODY_ACCESS" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_ID: // "ACTION_CTL_RULE_REMOVE_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_TAG: // "ACTION_CTL_RULE_REMOVE_BY_TAG" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + case symbol_kind::S_ACTION_DENY: // "Deny" + case symbol_kind::S_ACTION_DEPRECATE_VAR: // "DeprecateVar" + case symbol_kind::S_ACTION_DROP: // "Drop" + case symbol_kind::S_ACTION_EXEC: // "Exec" + case symbol_kind::S_ACTION_EXPIRE_VAR: // "ExpireVar" + case symbol_kind::S_ACTION_ID: // "Id" + case symbol_kind::S_ACTION_INITCOL: // "InitCol" + case symbol_kind::S_ACTION_LOG: // "Log" + case symbol_kind::S_ACTION_LOG_DATA: // "LogData" + case symbol_kind::S_ACTION_MATURITY: // "Maturity" + case symbol_kind::S_ACTION_MSG: // "Msg" + case symbol_kind::S_ACTION_MULTI_MATCH: // "MultiMatch" + case symbol_kind::S_ACTION_NO_AUDIT_LOG: // "NoAuditLog" + case symbol_kind::S_ACTION_NO_LOG: // "NoLog" + case symbol_kind::S_ACTION_PASS: // "Pass" + case symbol_kind::S_ACTION_PAUSE: // "Pause" + case symbol_kind::S_ACTION_PHASE: // "Phase" + case symbol_kind::S_ACTION_PREPEND: // "Prepend" + case symbol_kind::S_ACTION_PROXY: // "Proxy" + case symbol_kind::S_ACTION_REDIRECT: // "Redirect" + case symbol_kind::S_ACTION_REV: // "Rev" + case symbol_kind::S_ACTION_SANITISE_ARG: // "SanitiseArg" + case symbol_kind::S_ACTION_SANITISE_MATCHED: // "SanitiseMatched" + case symbol_kind::S_ACTION_SANITISE_MATCHED_BYTES: // "SanitiseMatchedBytes" + case symbol_kind::S_ACTION_SANITISE_REQUEST_HEADER: // "SanitiseRequestHeader" + case symbol_kind::S_ACTION_SANITISE_RESPONSE_HEADER: // "SanitiseResponseHeader" + case symbol_kind::S_ACTION_SETENV: // "SetEnv" + case symbol_kind::S_ACTION_SETRSC: // "SetRsc" + case symbol_kind::S_ACTION_SETSID: // "SetSid" + case symbol_kind::S_ACTION_SETUID: // "SetUID" + case symbol_kind::S_ACTION_SEVERITY: // "Severity" + case symbol_kind::S_ACTION_SKIP: // "Skip" + case symbol_kind::S_ACTION_SKIP_AFTER: // "SkipAfter" + case symbol_kind::S_ACTION_STATUS: // "Status" + case symbol_kind::S_ACTION_TAG: // "Tag" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_ENCODE: // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE: // "ACTION_TRANSFORMATION_BASE_64_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + case symbol_kind::S_ACTION_TRANSFORMATION_CMD_LINE: // "ACTION_TRANSFORMATION_CMD_LINE" + case symbol_kind::S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_CSS_DECODE: // "ACTION_TRANSFORMATION_CSS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_ENCODE: // "ACTION_TRANSFORMATION_HEX_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_DECODE: // "ACTION_TRANSFORMATION_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_JS_DECODE: // "ACTION_TRANSFORMATION_JS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_LENGTH: // "ACTION_TRANSFORMATION_LENGTH" + case symbol_kind::S_ACTION_TRANSFORMATION_LOWERCASE: // "ACTION_TRANSFORMATION_LOWERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_MD5: // "ACTION_TRANSFORMATION_MD5" + case symbol_kind::S_ACTION_TRANSFORMATION_NONE: // "ACTION_TRANSFORMATION_NONE" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH: // "ACTION_TRANSFORMATION_NORMALISE_PATH" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_NULLS: // "ACTION_TRANSFORMATION_REMOVE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_COMMENTS: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_NULLS: // "ACTION_TRANSFORMATION_REPLACE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_SHA1: // "ACTION_TRANSFORMATION_SHA1" + case symbol_kind::S_ACTION_TRANSFORMATION_SQL_HEX_DECODE: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM: // "ACTION_TRANSFORMATION_TRIM" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_LEFT: // "ACTION_TRANSFORMATION_TRIM_LEFT" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_RIGHT: // "ACTION_TRANSFORMATION_TRIM_RIGHT" + case symbol_kind::S_ACTION_TRANSFORMATION_UPPERCASE: // "ACTION_TRANSFORMATION_UPPERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_ENCODE: // "ACTION_TRANSFORMATION_URL_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE: // "ACTION_TRANSFORMATION_URL_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE_UNI: // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + case symbol_kind::S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + case symbol_kind::S_ACTION_VER: // "Ver" + case symbol_kind::S_ACTION_XMLNS: // "xmlns" + case symbol_kind::S_CONFIG_COMPONENT_SIG: // "CONFIG_COMPONENT_SIG" + case symbol_kind::S_CONFIG_CONN_ENGINE: // "CONFIG_CONN_ENGINE" + case symbol_kind::S_CONFIG_SEC_ARGUMENT_SEPARATOR: // "CONFIG_SEC_ARGUMENT_SEPARATOR" + case symbol_kind::S_CONFIG_SEC_WEB_APP_ID: // "CONFIG_SEC_WEB_APP_ID" + case symbol_kind::S_CONFIG_SEC_SERVER_SIG: // "CONFIG_SEC_SERVER_SIG" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR: // "CONFIG_DIR_AUDIT_DIR" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR_MOD: // "CONFIG_DIR_AUDIT_DIR_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_ENG: // "CONFIG_DIR_AUDIT_ENG" + case symbol_kind::S_CONFIG_DIR_AUDIT_FLE_MOD: // "CONFIG_DIR_AUDIT_FLE_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG: // "CONFIG_DIR_AUDIT_LOG" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG2: // "CONFIG_DIR_AUDIT_LOG2" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG_P: // "CONFIG_DIR_AUDIT_LOG_P" + case symbol_kind::S_CONFIG_DIR_AUDIT_STS: // "CONFIG_DIR_AUDIT_STS" + case symbol_kind::S_CONFIG_DIR_AUDIT_TPE: // "CONFIG_DIR_AUDIT_TPE" + case symbol_kind::S_CONFIG_DIR_DEBUG_LOG: // "CONFIG_DIR_DEBUG_LOG" + case symbol_kind::S_CONFIG_DIR_DEBUG_LVL: // "CONFIG_DIR_DEBUG_LVL" + case symbol_kind::S_CONFIG_SEC_CACHE_TRANSFORMATIONS: // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + case symbol_kind::S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + case symbol_kind::S_CONFIG_SEC_HASH_ENGINE: // "CONFIG_SEC_HASH_ENGINE" + case symbol_kind::S_CONFIG_SEC_HASH_KEY: // "CONFIG_SEC_HASH_KEY" + case symbol_kind::S_CONFIG_SEC_HASH_PARAM: // "CONFIG_SEC_HASH_PARAM" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_RX: // "CONFIG_SEC_HASH_METHOD_RX" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_PM: // "CONFIG_SEC_HASH_METHOD_PM" + case symbol_kind::S_CONFIG_SEC_CHROOT_DIR: // "CONFIG_SEC_CHROOT_DIR" + case symbol_kind::S_CONFIG_DIR_GEO_DB: // "CONFIG_DIR_GEO_DB" + case symbol_kind::S_CONFIG_DIR_GSB_DB: // "CONFIG_DIR_GSB_DB" + case symbol_kind::S_CONFIG_SEC_GUARDIAN_LOG: // "CONFIG_SEC_GUARDIAN_LOG" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT: // "CONFIG_DIR_PCRE_MATCH_LIMIT" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + case symbol_kind::S_CONFIG_SEC_CONN_R_STATE_LIMIT: // "CONFIG_SEC_CONN_R_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_CONN_W_STATE_LIMIT: // "CONFIG_SEC_CONN_W_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_SENSOR_ID: // "CONFIG_SEC_SENSOR_ID" + case symbol_kind::S_CONFIG_DIR_ARGS_LIMIT: // "CONFIG_DIR_ARGS_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT: // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY: // "CONFIG_DIR_REQ_BODY" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT: // "CONFIG_DIR_REQ_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY: // "CONFIG_DIR_RES_BODY" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT: // "CONFIG_DIR_RES_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT_ACTION: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_INHERITANCE: // "CONFIG_SEC_RULE_INHERITANCE" + case symbol_kind::S_CONFIG_SEC_RULE_PERF_TIME: // "CONFIG_SEC_RULE_PERF_TIME" + case symbol_kind::S_CONFIG_DIR_RULE_ENG: // "CONFIG_DIR_RULE_ENG" + case symbol_kind::S_CONFIG_DIR_SEC_ACTION: // "CONFIG_DIR_SEC_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_DEFAULT_ACTION: // "CONFIG_DIR_SEC_DEFAULT_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_MARKER: // "CONFIG_DIR_SEC_MARKER" + case symbol_kind::S_CONFIG_DIR_UNICODE_MAP_FILE: // "CONFIG_DIR_UNICODE_MAP_FILE" + case symbol_kind::S_CONFIG_DIR_UNICODE_CODE_PAGE: // "CONFIG_DIR_UNICODE_CODE_PAGE" + case symbol_kind::S_CONFIG_SEC_COLLECTION_TIMEOUT: // "CONFIG_SEC_COLLECTION_TIMEOUT" + case symbol_kind::S_CONFIG_SEC_HTTP_BLKEY: // "CONFIG_SEC_HTTP_BLKEY" + case symbol_kind::S_CONFIG_SEC_INTERCEPT_ON_ERROR: // "CONFIG_SEC_INTERCEPT_ON_ERROR" + case symbol_kind::S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_ID: // "CONFIG_SEC_RULE_REMOVE_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_MSG: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_TAG: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + case symbol_kind::S_CONFIG_UPDLOAD_KEEP_FILES: // "CONFIG_UPDLOAD_KEEP_FILES" + case symbol_kind::S_CONFIG_UPDLOAD_SAVE_TMP_FILES: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + case symbol_kind::S_CONFIG_UPLOAD_DIR: // "CONFIG_UPLOAD_DIR" + case symbol_kind::S_CONFIG_UPLOAD_FILE_LIMIT: // "CONFIG_UPLOAD_FILE_LIMIT" + case symbol_kind::S_CONFIG_UPLOAD_FILE_MODE: // "CONFIG_UPLOAD_FILE_MODE" + case symbol_kind::S_CONFIG_VALUE_ABORT: // "CONFIG_VALUE_ABORT" + case symbol_kind::S_CONFIG_VALUE_DETC: // "CONFIG_VALUE_DETC" + case symbol_kind::S_CONFIG_VALUE_HTTPS: // "CONFIG_VALUE_HTTPS" + case symbol_kind::S_CONFIG_VALUE_OFF: // "CONFIG_VALUE_OFF" + case symbol_kind::S_CONFIG_VALUE_ON: // "CONFIG_VALUE_ON" + case symbol_kind::S_CONFIG_VALUE_PARALLEL: // "CONFIG_VALUE_PARALLEL" + case symbol_kind::S_CONFIG_VALUE_PROCESS_PARTIAL: // "CONFIG_VALUE_PROCESS_PARTIAL" + case symbol_kind::S_CONFIG_VALUE_REJECT: // "CONFIG_VALUE_REJECT" + case symbol_kind::S_CONFIG_VALUE_RELEVANT_ONLY: // "CONFIG_VALUE_RELEVANT_ONLY" + case symbol_kind::S_CONFIG_VALUE_SERIAL: // "CONFIG_VALUE_SERIAL" + case symbol_kind::S_CONFIG_VALUE_WARN: // "CONFIG_VALUE_WARN" + case symbol_kind::S_CONFIG_XML_EXTERNAL_ENTITY: // "CONFIG_XML_EXTERNAL_ENTITY" + case symbol_kind::S_CONGIG_DIR_RESPONSE_BODY_MP: // "CONGIG_DIR_RESPONSE_BODY_MP" + case symbol_kind::S_CONGIG_DIR_SEC_ARG_SEP: // "CONGIG_DIR_SEC_ARG_SEP" + case symbol_kind::S_CONGIG_DIR_SEC_COOKIE_FORMAT: // "CONGIG_DIR_SEC_COOKIE_FORMAT" + case symbol_kind::S_CONFIG_SEC_COOKIEV0_SEPARATOR: // "CONFIG_SEC_COOKIEV0_SEPARATOR" + case symbol_kind::S_CONGIG_DIR_SEC_DATA_DIR: // "CONGIG_DIR_SEC_DATA_DIR" + case symbol_kind::S_CONGIG_DIR_SEC_STATUS_ENGINE: // "CONGIG_DIR_SEC_STATUS_ENGINE" + case symbol_kind::S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + case symbol_kind::S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + case symbol_kind::S_CONGIG_DIR_SEC_TMP_DIR: // "CONGIG_DIR_SEC_TMP_DIR" + case symbol_kind::S_DIRECTIVE: // "DIRECTIVE" + case symbol_kind::S_DIRECTIVE_SECRULESCRIPT: // "DIRECTIVE_SECRULESCRIPT" + case symbol_kind::S_FREE_TEXT_QUOTE_MACRO_EXPANSION: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + case symbol_kind::S_QUOTATION_MARK: // "QUOTATION_MARK" + case symbol_kind::S_RUN_TIME_VAR_BLD: // "RUN_TIME_VAR_BLD" + case symbol_kind::S_RUN_TIME_VAR_DUR: // "RUN_TIME_VAR_DUR" + case symbol_kind::S_RUN_TIME_VAR_HSV: // "RUN_TIME_VAR_HSV" + case symbol_kind::S_RUN_TIME_VAR_REMOTE_USER: // "RUN_TIME_VAR_REMOTE_USER" + case symbol_kind::S_RUN_TIME_VAR_TIME: // "RUN_TIME_VAR_TIME" + case symbol_kind::S_RUN_TIME_VAR_TIME_DAY: // "RUN_TIME_VAR_TIME_DAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_EPOCH: // "RUN_TIME_VAR_TIME_EPOCH" + case symbol_kind::S_RUN_TIME_VAR_TIME_HOUR: // "RUN_TIME_VAR_TIME_HOUR" + case symbol_kind::S_RUN_TIME_VAR_TIME_MIN: // "RUN_TIME_VAR_TIME_MIN" + case symbol_kind::S_RUN_TIME_VAR_TIME_MON: // "RUN_TIME_VAR_TIME_MON" + case symbol_kind::S_RUN_TIME_VAR_TIME_SEC: // "RUN_TIME_VAR_TIME_SEC" + case symbol_kind::S_RUN_TIME_VAR_TIME_WDAY: // "RUN_TIME_VAR_TIME_WDAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_YEAR: // "RUN_TIME_VAR_TIME_YEAR" + case symbol_kind::S_VARIABLE: // "VARIABLE" + case symbol_kind::S_DICT_ELEMENT: // "Dictionary element" + case symbol_kind::S_DICT_ELEMENT_REGEXP: // "Dictionary element, selected by regexp" value.move< std::string > (that.value); break; - case 347: // op - case 348: // op_before_init + case symbol_kind::S_op: // op + case symbol_kind::S_op_before_init: // op_before_init value.move< std::unique_ptr > (that.value); break; - case 356: // run_time_string + case symbol_kind::S_run_time_string: // run_time_string value.move< std::unique_ptr > (that.value); break; - case 353: // var + case symbol_kind::S_var: // var value.move< std::unique_ptr > (that.value); break; - case 354: // act - case 355: // setvar_action + case symbol_kind::S_act: // act + case symbol_kind::S_setvar_action: // setvar_action value.move< std::unique_ptr > (that.value); break; - case 350: // variables - case 351: // variables_pre_process - case 352: // variables_may_be_quoted + case symbol_kind::S_variables: // variables + case symbol_kind::S_variables_pre_process: // variables_pre_process + case symbol_kind::S_variables_may_be_quoted: // variables_may_be_quoted value.move< std::unique_ptr > > > (that.value); break; - case 345: // actions - case 346: // actions_may_quoted + case symbol_kind::S_actions: // actions + case symbol_kind::S_actions_may_quoted: // actions_may_quoted value.move< std::unique_ptr > > > (that.value); break; @@ -984,23 +1192,21 @@ namespace yy { #if YYDEBUG template void - seclang_parser::yy_print_ (std::ostream& yyo, - const basic_symbol& yysym) const + 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". + YY_USE (yyoutput); if (yysym.empty ()) - std::abort (); -#endif - yyo << (yytype < yyntokens_ ? "token" : "nterm") - << ' ' << yytname_[yytype] << " (" - << yysym.location << ": "; - YYUSE (yytype); - yyo << ')'; + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } } #endif @@ -1059,11 +1265,11 @@ namespace yy { seclang_parser::state_type seclang_parser::yy_lr_goto_state_ (state_type yystate, int yysym) { - int yyr = yypgoto_[yysym - yyntokens_] + yystate; + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) return yytable_[yyr]; else - return yydefgoto_[yysym - yyntokens_]; + return yydefgoto_[yysym - YYNTOKENS]; } bool @@ -1087,7 +1293,6 @@ namespace yy { int seclang_parser::parse () { - // State. int yyn; /// Length of the RHS of the rule being reduced. int yylen = 0; @@ -1113,13 +1318,14 @@ namespace yy { // User initialization code. -#line 317 "seclang-parser.yy" // lalr1.cc:788 +#line 320 "seclang-parser.yy" { // Initialize the initial location. yyla.location.begin.filename = yyla.location.end.filename = new std::string(driver.file); } -#line 1123 "seclang-parser.cc" // lalr1.cc:788 +#line 1328 "seclang-parser.cc" + /* Initialize the stack. The initial state will be set in yynewstate, since the latter expects the semantical and the @@ -1132,7 +1338,8 @@ namespace yy { | yynewstate -- push a new symbol on the stack. | `-----------------------------------------------*/ yynewstate: - YYCDEBUG << "Entering state " << yystack_[0].state << '\n'; + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); // Accept? if (yystack_[0].state == yyfinal_) @@ -1146,14 +1353,14 @@ namespace yy { `-----------*/ yybackup: // Try to take a decision without lookahead. - yyn = yypact_[yystack_[0].state]; + 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: "; + YYCDEBUG << "Reading a token\n"; #if YY_EXCEPTIONS try #endif // YY_EXCEPTIONS @@ -1172,11 +1379,23 @@ namespace yy { } YY_SYMBOL_PRINT ("Next token is", yyla); + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + /* 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; + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + goto yydefault; + } // Reduce or error. yyn = yytable_[yyn]; @@ -1193,7 +1412,7 @@ namespace yy { --yyerrstatus_; // Shift the lookahead token. - yypush_ ("Shifting", yyn, YY_MOVE (yyla)); + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); goto yynewstate; @@ -1201,7 +1420,7 @@ namespace yy { | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: - yyn = yydefact_[yystack_[0].state]; + yyn = yydefact_[+yystack_[0].state]; if (yyn == 0) goto yyerrlab; goto yyreduce; @@ -1220,231 +1439,233 @@ namespace yy { 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_REQ_BODY" - case 269: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" - case 270: // "CONFIG_DIR_REQ_BODY_LIMIT" - case 271: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" - case 272: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" - case 273: // "CONFIG_DIR_RES_BODY" - case 274: // "CONFIG_DIR_RES_BODY_LIMIT" - case 275: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" - case 276: // "CONFIG_SEC_RULE_INHERITANCE" - case 277: // "CONFIG_SEC_RULE_PERF_TIME" - case 278: // "CONFIG_DIR_RULE_ENG" - case 279: // "CONFIG_DIR_SEC_ACTION" - case 280: // "CONFIG_DIR_SEC_DEFAULT_ACTION" - case 281: // "CONFIG_DIR_SEC_MARKER" - case 282: // "CONFIG_DIR_UNICODE_MAP_FILE" - case 283: // "CONFIG_DIR_UNICODE_CODE_PAGE" - case 284: // "CONFIG_SEC_COLLECTION_TIMEOUT" - case 285: // "CONFIG_SEC_HTTP_BLKEY" - case 286: // "CONFIG_SEC_INTERCEPT_ON_ERROR" - case 287: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" - case 288: // "CONFIG_SEC_RULE_REMOVE_BY_ID" - case 289: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" - case 290: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" - case 291: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" - case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" - case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" - case 294: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" - case 295: // "CONFIG_UPDLOAD_KEEP_FILES" - case 296: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" - case 297: // "CONFIG_UPLOAD_DIR" - case 298: // "CONFIG_UPLOAD_FILE_LIMIT" - case 299: // "CONFIG_UPLOAD_FILE_MODE" - case 300: // "CONFIG_VALUE_ABORT" - case 301: // "CONFIG_VALUE_DETC" - case 302: // "CONFIG_VALUE_HTTPS" - case 303: // "CONFIG_VALUE_OFF" - case 304: // "CONFIG_VALUE_ON" - case 305: // "CONFIG_VALUE_PARALLEL" - case 306: // "CONFIG_VALUE_PROCESS_PARTIAL" - case 307: // "CONFIG_VALUE_REJECT" - case 308: // "CONFIG_VALUE_RELEVANT_ONLY" - case 309: // "CONFIG_VALUE_SERIAL" - case 310: // "CONFIG_VALUE_WARN" - case 311: // "CONFIG_XML_EXTERNAL_ENTITY" - case 312: // "CONGIG_DIR_RESPONSE_BODY_MP" - case 313: // "CONGIG_DIR_SEC_ARG_SEP" - case 314: // "CONGIG_DIR_SEC_COOKIE_FORMAT" - case 315: // "CONFIG_SEC_COOKIEV0_SEPARATOR" - case 316: // "CONGIG_DIR_SEC_DATA_DIR" - case 317: // "CONGIG_DIR_SEC_STATUS_ENGINE" - case 318: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" - case 319: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" - case 320: // "CONGIG_DIR_SEC_TMP_DIR" - case 321: // "DIRECTIVE" - case 322: // "DIRECTIVE_SECRULESCRIPT" - case 323: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" - case 324: // "QUOTATION_MARK" - case 325: // "RUN_TIME_VAR_BLD" - case 326: // "RUN_TIME_VAR_DUR" - case 327: // "RUN_TIME_VAR_HSV" - case 328: // "RUN_TIME_VAR_REMOTE_USER" - case 329: // "RUN_TIME_VAR_TIME" - case 330: // "RUN_TIME_VAR_TIME_DAY" - case 331: // "RUN_TIME_VAR_TIME_EPOCH" - case 332: // "RUN_TIME_VAR_TIME_HOUR" - case 333: // "RUN_TIME_VAR_TIME_MIN" - case 334: // "RUN_TIME_VAR_TIME_MON" - case 335: // "RUN_TIME_VAR_TIME_SEC" - case 336: // "RUN_TIME_VAR_TIME_WDAY" - case 337: // "RUN_TIME_VAR_TIME_YEAR" - case 338: // "VARIABLE" - case 339: // "Dictionary element" - case 340: // "Dictionary element, selected by regexp" + case symbol_kind::S_ACTION_ACCURACY: // "Accuracy" + case symbol_kind::S_ACTION_ALLOW: // "Allow" + case symbol_kind::S_ACTION_APPEND: // "Append" + case symbol_kind::S_ACTION_AUDIT_LOG: // "AuditLog" + case symbol_kind::S_ACTION_BLOCK: // "Block" + case symbol_kind::S_ACTION_CAPTURE: // "Capture" + case symbol_kind::S_ACTION_CHAIN: // "Chain" + case symbol_kind::S_ACTION_CTL_AUDIT_ENGINE: // "ACTION_CTL_AUDIT_ENGINE" + case symbol_kind::S_ACTION_CTL_AUDIT_LOG_PARTS: // "ACTION_CTL_AUDIT_LOG_PARTS" + case symbol_kind::S_ACTION_CTL_BDY_JSON: // "ACTION_CTL_BDY_JSON" + case symbol_kind::S_ACTION_CTL_BDY_XML: // "ACTION_CTL_BDY_XML" + case symbol_kind::S_ACTION_CTL_BDY_URLENCODED: // "ACTION_CTL_BDY_URLENCODED" + case symbol_kind::S_ACTION_CTL_FORCE_REQ_BODY_VAR: // "ACTION_CTL_FORCE_REQ_BODY_VAR" + case symbol_kind::S_ACTION_CTL_REQUEST_BODY_ACCESS: // "ACTION_CTL_REQUEST_BODY_ACCESS" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_ID: // "ACTION_CTL_RULE_REMOVE_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_TAG: // "ACTION_CTL_RULE_REMOVE_BY_TAG" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + case symbol_kind::S_ACTION_DENY: // "Deny" + case symbol_kind::S_ACTION_DEPRECATE_VAR: // "DeprecateVar" + case symbol_kind::S_ACTION_DROP: // "Drop" + case symbol_kind::S_ACTION_EXEC: // "Exec" + case symbol_kind::S_ACTION_EXPIRE_VAR: // "ExpireVar" + case symbol_kind::S_ACTION_ID: // "Id" + case symbol_kind::S_ACTION_INITCOL: // "InitCol" + case symbol_kind::S_ACTION_LOG: // "Log" + case symbol_kind::S_ACTION_LOG_DATA: // "LogData" + case symbol_kind::S_ACTION_MATURITY: // "Maturity" + case symbol_kind::S_ACTION_MSG: // "Msg" + case symbol_kind::S_ACTION_MULTI_MATCH: // "MultiMatch" + case symbol_kind::S_ACTION_NO_AUDIT_LOG: // "NoAuditLog" + case symbol_kind::S_ACTION_NO_LOG: // "NoLog" + case symbol_kind::S_ACTION_PASS: // "Pass" + case symbol_kind::S_ACTION_PAUSE: // "Pause" + case symbol_kind::S_ACTION_PHASE: // "Phase" + case symbol_kind::S_ACTION_PREPEND: // "Prepend" + case symbol_kind::S_ACTION_PROXY: // "Proxy" + case symbol_kind::S_ACTION_REDIRECT: // "Redirect" + case symbol_kind::S_ACTION_REV: // "Rev" + case symbol_kind::S_ACTION_SANITISE_ARG: // "SanitiseArg" + case symbol_kind::S_ACTION_SANITISE_MATCHED: // "SanitiseMatched" + case symbol_kind::S_ACTION_SANITISE_MATCHED_BYTES: // "SanitiseMatchedBytes" + case symbol_kind::S_ACTION_SANITISE_REQUEST_HEADER: // "SanitiseRequestHeader" + case symbol_kind::S_ACTION_SANITISE_RESPONSE_HEADER: // "SanitiseResponseHeader" + case symbol_kind::S_ACTION_SETENV: // "SetEnv" + case symbol_kind::S_ACTION_SETRSC: // "SetRsc" + case symbol_kind::S_ACTION_SETSID: // "SetSid" + case symbol_kind::S_ACTION_SETUID: // "SetUID" + case symbol_kind::S_ACTION_SEVERITY: // "Severity" + case symbol_kind::S_ACTION_SKIP: // "Skip" + case symbol_kind::S_ACTION_SKIP_AFTER: // "SkipAfter" + case symbol_kind::S_ACTION_STATUS: // "Status" + case symbol_kind::S_ACTION_TAG: // "Tag" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_ENCODE: // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE: // "ACTION_TRANSFORMATION_BASE_64_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + case symbol_kind::S_ACTION_TRANSFORMATION_CMD_LINE: // "ACTION_TRANSFORMATION_CMD_LINE" + case symbol_kind::S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_CSS_DECODE: // "ACTION_TRANSFORMATION_CSS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_ENCODE: // "ACTION_TRANSFORMATION_HEX_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_DECODE: // "ACTION_TRANSFORMATION_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_JS_DECODE: // "ACTION_TRANSFORMATION_JS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_LENGTH: // "ACTION_TRANSFORMATION_LENGTH" + case symbol_kind::S_ACTION_TRANSFORMATION_LOWERCASE: // "ACTION_TRANSFORMATION_LOWERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_MD5: // "ACTION_TRANSFORMATION_MD5" + case symbol_kind::S_ACTION_TRANSFORMATION_NONE: // "ACTION_TRANSFORMATION_NONE" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH: // "ACTION_TRANSFORMATION_NORMALISE_PATH" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_NULLS: // "ACTION_TRANSFORMATION_REMOVE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_COMMENTS: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_NULLS: // "ACTION_TRANSFORMATION_REPLACE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_SHA1: // "ACTION_TRANSFORMATION_SHA1" + case symbol_kind::S_ACTION_TRANSFORMATION_SQL_HEX_DECODE: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM: // "ACTION_TRANSFORMATION_TRIM" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_LEFT: // "ACTION_TRANSFORMATION_TRIM_LEFT" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_RIGHT: // "ACTION_TRANSFORMATION_TRIM_RIGHT" + case symbol_kind::S_ACTION_TRANSFORMATION_UPPERCASE: // "ACTION_TRANSFORMATION_UPPERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_ENCODE: // "ACTION_TRANSFORMATION_URL_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE: // "ACTION_TRANSFORMATION_URL_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE_UNI: // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + case symbol_kind::S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + case symbol_kind::S_ACTION_VER: // "Ver" + case symbol_kind::S_ACTION_XMLNS: // "xmlns" + case symbol_kind::S_CONFIG_COMPONENT_SIG: // "CONFIG_COMPONENT_SIG" + case symbol_kind::S_CONFIG_CONN_ENGINE: // "CONFIG_CONN_ENGINE" + case symbol_kind::S_CONFIG_SEC_ARGUMENT_SEPARATOR: // "CONFIG_SEC_ARGUMENT_SEPARATOR" + case symbol_kind::S_CONFIG_SEC_WEB_APP_ID: // "CONFIG_SEC_WEB_APP_ID" + case symbol_kind::S_CONFIG_SEC_SERVER_SIG: // "CONFIG_SEC_SERVER_SIG" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR: // "CONFIG_DIR_AUDIT_DIR" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR_MOD: // "CONFIG_DIR_AUDIT_DIR_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_ENG: // "CONFIG_DIR_AUDIT_ENG" + case symbol_kind::S_CONFIG_DIR_AUDIT_FLE_MOD: // "CONFIG_DIR_AUDIT_FLE_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG: // "CONFIG_DIR_AUDIT_LOG" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG2: // "CONFIG_DIR_AUDIT_LOG2" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG_P: // "CONFIG_DIR_AUDIT_LOG_P" + case symbol_kind::S_CONFIG_DIR_AUDIT_STS: // "CONFIG_DIR_AUDIT_STS" + case symbol_kind::S_CONFIG_DIR_AUDIT_TPE: // "CONFIG_DIR_AUDIT_TPE" + case symbol_kind::S_CONFIG_DIR_DEBUG_LOG: // "CONFIG_DIR_DEBUG_LOG" + case symbol_kind::S_CONFIG_DIR_DEBUG_LVL: // "CONFIG_DIR_DEBUG_LVL" + case symbol_kind::S_CONFIG_SEC_CACHE_TRANSFORMATIONS: // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + case symbol_kind::S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + case symbol_kind::S_CONFIG_SEC_HASH_ENGINE: // "CONFIG_SEC_HASH_ENGINE" + case symbol_kind::S_CONFIG_SEC_HASH_KEY: // "CONFIG_SEC_HASH_KEY" + case symbol_kind::S_CONFIG_SEC_HASH_PARAM: // "CONFIG_SEC_HASH_PARAM" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_RX: // "CONFIG_SEC_HASH_METHOD_RX" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_PM: // "CONFIG_SEC_HASH_METHOD_PM" + case symbol_kind::S_CONFIG_SEC_CHROOT_DIR: // "CONFIG_SEC_CHROOT_DIR" + case symbol_kind::S_CONFIG_DIR_GEO_DB: // "CONFIG_DIR_GEO_DB" + case symbol_kind::S_CONFIG_DIR_GSB_DB: // "CONFIG_DIR_GSB_DB" + case symbol_kind::S_CONFIG_SEC_GUARDIAN_LOG: // "CONFIG_SEC_GUARDIAN_LOG" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT: // "CONFIG_DIR_PCRE_MATCH_LIMIT" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + case symbol_kind::S_CONFIG_SEC_CONN_R_STATE_LIMIT: // "CONFIG_SEC_CONN_R_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_CONN_W_STATE_LIMIT: // "CONFIG_SEC_CONN_W_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_SENSOR_ID: // "CONFIG_SEC_SENSOR_ID" + case symbol_kind::S_CONFIG_DIR_ARGS_LIMIT: // "CONFIG_DIR_ARGS_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT: // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY: // "CONFIG_DIR_REQ_BODY" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT: // "CONFIG_DIR_REQ_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY: // "CONFIG_DIR_RES_BODY" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT: // "CONFIG_DIR_RES_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT_ACTION: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_INHERITANCE: // "CONFIG_SEC_RULE_INHERITANCE" + case symbol_kind::S_CONFIG_SEC_RULE_PERF_TIME: // "CONFIG_SEC_RULE_PERF_TIME" + case symbol_kind::S_CONFIG_DIR_RULE_ENG: // "CONFIG_DIR_RULE_ENG" + case symbol_kind::S_CONFIG_DIR_SEC_ACTION: // "CONFIG_DIR_SEC_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_DEFAULT_ACTION: // "CONFIG_DIR_SEC_DEFAULT_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_MARKER: // "CONFIG_DIR_SEC_MARKER" + case symbol_kind::S_CONFIG_DIR_UNICODE_MAP_FILE: // "CONFIG_DIR_UNICODE_MAP_FILE" + case symbol_kind::S_CONFIG_DIR_UNICODE_CODE_PAGE: // "CONFIG_DIR_UNICODE_CODE_PAGE" + case symbol_kind::S_CONFIG_SEC_COLLECTION_TIMEOUT: // "CONFIG_SEC_COLLECTION_TIMEOUT" + case symbol_kind::S_CONFIG_SEC_HTTP_BLKEY: // "CONFIG_SEC_HTTP_BLKEY" + case symbol_kind::S_CONFIG_SEC_INTERCEPT_ON_ERROR: // "CONFIG_SEC_INTERCEPT_ON_ERROR" + case symbol_kind::S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_ID: // "CONFIG_SEC_RULE_REMOVE_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_MSG: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_TAG: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + case symbol_kind::S_CONFIG_UPDLOAD_KEEP_FILES: // "CONFIG_UPDLOAD_KEEP_FILES" + case symbol_kind::S_CONFIG_UPDLOAD_SAVE_TMP_FILES: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + case symbol_kind::S_CONFIG_UPLOAD_DIR: // "CONFIG_UPLOAD_DIR" + case symbol_kind::S_CONFIG_UPLOAD_FILE_LIMIT: // "CONFIG_UPLOAD_FILE_LIMIT" + case symbol_kind::S_CONFIG_UPLOAD_FILE_MODE: // "CONFIG_UPLOAD_FILE_MODE" + case symbol_kind::S_CONFIG_VALUE_ABORT: // "CONFIG_VALUE_ABORT" + case symbol_kind::S_CONFIG_VALUE_DETC: // "CONFIG_VALUE_DETC" + case symbol_kind::S_CONFIG_VALUE_HTTPS: // "CONFIG_VALUE_HTTPS" + case symbol_kind::S_CONFIG_VALUE_OFF: // "CONFIG_VALUE_OFF" + case symbol_kind::S_CONFIG_VALUE_ON: // "CONFIG_VALUE_ON" + case symbol_kind::S_CONFIG_VALUE_PARALLEL: // "CONFIG_VALUE_PARALLEL" + case symbol_kind::S_CONFIG_VALUE_PROCESS_PARTIAL: // "CONFIG_VALUE_PROCESS_PARTIAL" + case symbol_kind::S_CONFIG_VALUE_REJECT: // "CONFIG_VALUE_REJECT" + case symbol_kind::S_CONFIG_VALUE_RELEVANT_ONLY: // "CONFIG_VALUE_RELEVANT_ONLY" + case symbol_kind::S_CONFIG_VALUE_SERIAL: // "CONFIG_VALUE_SERIAL" + case symbol_kind::S_CONFIG_VALUE_WARN: // "CONFIG_VALUE_WARN" + case symbol_kind::S_CONFIG_XML_EXTERNAL_ENTITY: // "CONFIG_XML_EXTERNAL_ENTITY" + case symbol_kind::S_CONGIG_DIR_RESPONSE_BODY_MP: // "CONGIG_DIR_RESPONSE_BODY_MP" + case symbol_kind::S_CONGIG_DIR_SEC_ARG_SEP: // "CONGIG_DIR_SEC_ARG_SEP" + case symbol_kind::S_CONGIG_DIR_SEC_COOKIE_FORMAT: // "CONGIG_DIR_SEC_COOKIE_FORMAT" + case symbol_kind::S_CONFIG_SEC_COOKIEV0_SEPARATOR: // "CONFIG_SEC_COOKIEV0_SEPARATOR" + case symbol_kind::S_CONGIG_DIR_SEC_DATA_DIR: // "CONGIG_DIR_SEC_DATA_DIR" + case symbol_kind::S_CONGIG_DIR_SEC_STATUS_ENGINE: // "CONGIG_DIR_SEC_STATUS_ENGINE" + case symbol_kind::S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + case symbol_kind::S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + case symbol_kind::S_CONGIG_DIR_SEC_TMP_DIR: // "CONGIG_DIR_SEC_TMP_DIR" + case symbol_kind::S_DIRECTIVE: // "DIRECTIVE" + case symbol_kind::S_DIRECTIVE_SECRULESCRIPT: // "DIRECTIVE_SECRULESCRIPT" + case symbol_kind::S_FREE_TEXT_QUOTE_MACRO_EXPANSION: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + case symbol_kind::S_QUOTATION_MARK: // "QUOTATION_MARK" + case symbol_kind::S_RUN_TIME_VAR_BLD: // "RUN_TIME_VAR_BLD" + case symbol_kind::S_RUN_TIME_VAR_DUR: // "RUN_TIME_VAR_DUR" + case symbol_kind::S_RUN_TIME_VAR_HSV: // "RUN_TIME_VAR_HSV" + case symbol_kind::S_RUN_TIME_VAR_REMOTE_USER: // "RUN_TIME_VAR_REMOTE_USER" + case symbol_kind::S_RUN_TIME_VAR_TIME: // "RUN_TIME_VAR_TIME" + case symbol_kind::S_RUN_TIME_VAR_TIME_DAY: // "RUN_TIME_VAR_TIME_DAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_EPOCH: // "RUN_TIME_VAR_TIME_EPOCH" + case symbol_kind::S_RUN_TIME_VAR_TIME_HOUR: // "RUN_TIME_VAR_TIME_HOUR" + case symbol_kind::S_RUN_TIME_VAR_TIME_MIN: // "RUN_TIME_VAR_TIME_MIN" + case symbol_kind::S_RUN_TIME_VAR_TIME_MON: // "RUN_TIME_VAR_TIME_MON" + case symbol_kind::S_RUN_TIME_VAR_TIME_SEC: // "RUN_TIME_VAR_TIME_SEC" + case symbol_kind::S_RUN_TIME_VAR_TIME_WDAY: // "RUN_TIME_VAR_TIME_WDAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_YEAR: // "RUN_TIME_VAR_TIME_YEAR" + case symbol_kind::S_VARIABLE: // "VARIABLE" + case symbol_kind::S_DICT_ELEMENT: // "Dictionary element" + case symbol_kind::S_DICT_ELEMENT_REGEXP: // "Dictionary element, selected by regexp" yylhs.value.emplace< std::string > (); break; - case 347: // op - case 348: // op_before_init + case symbol_kind::S_op: // op + case symbol_kind::S_op_before_init: // op_before_init yylhs.value.emplace< std::unique_ptr > (); break; - case 356: // run_time_string + case symbol_kind::S_run_time_string: // run_time_string yylhs.value.emplace< std::unique_ptr > (); break; - case 353: // var + case symbol_kind::S_var: // var yylhs.value.emplace< std::unique_ptr > (); break; - case 354: // act - case 355: // setvar_action + case symbol_kind::S_act: // act + case symbol_kind::S_setvar_action: // setvar_action yylhs.value.emplace< std::unique_ptr > (); break; - case 350: // variables - case 351: // variables_pre_process - case 352: // variables_may_be_quoted + case symbol_kind::S_variables: // variables + case symbol_kind::S_variables_pre_process: // variables_pre_process + case symbol_kind::S_variables_may_be_quoted: // variables_may_be_quoted yylhs.value.emplace< std::unique_ptr > > > (); break; - case 345: // actions - case 346: // actions_may_quoted + case symbol_kind::S_actions: // actions + case symbol_kind::S_actions_may_quoted: // actions_may_quoted yylhs.value.emplace< std::unique_ptr > > > (); break; @@ -1468,243 +1689,243 @@ namespace yy { { switch (yyn) { - case 2: -#line 708 "seclang-parser.yy" // lalr1.cc:919 - { + case 2: // input: "end of file" +#line 715 "seclang-parser.yy" + { return 0; } -#line 1477 "seclang-parser.cc" // lalr1.cc:919 +#line 1698 "seclang-parser.cc" break; - case 6: -#line 721 "seclang-parser.yy" // lalr1.cc:919 - { + case 6: // audit_log: "CONFIG_DIR_AUDIT_DIR_MOD" +#line 728 "seclang-parser.yy" + { driver.m_auditLog->setStorageDirMode(strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8)); } -#line 1485 "seclang-parser.cc" // lalr1.cc:919 +#line 1706 "seclang-parser.cc" break; - case 7: -#line 727 "seclang-parser.yy" // lalr1.cc:919 - { + case 7: // audit_log: "CONFIG_DIR_AUDIT_DIR" +#line 734 "seclang-parser.yy" + { driver.m_auditLog->setStorageDir(yystack_[0].value.as < std::string > ()); } -#line 1493 "seclang-parser.cc" // lalr1.cc:919 +#line 1714 "seclang-parser.cc" break; - case 8: -#line 733 "seclang-parser.yy" // lalr1.cc:919 - { + case 8: // audit_log: "CONFIG_DIR_AUDIT_ENG" "CONFIG_VALUE_RELEVANT_ONLY" +#line 740 "seclang-parser.yy" + { driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::RelevantOnlyAuditLogStatus); } -#line 1501 "seclang-parser.cc" // lalr1.cc:919 +#line 1722 "seclang-parser.cc" break; - case 9: -#line 737 "seclang-parser.yy" // lalr1.cc:919 - { + case 9: // audit_log: "CONFIG_DIR_AUDIT_ENG" "CONFIG_VALUE_OFF" +#line 744 "seclang-parser.yy" + { driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::OffAuditLogStatus); } -#line 1509 "seclang-parser.cc" // lalr1.cc:919 +#line 1730 "seclang-parser.cc" break; - case 10: -#line 741 "seclang-parser.yy" // lalr1.cc:919 - { + case 10: // audit_log: "CONFIG_DIR_AUDIT_ENG" "CONFIG_VALUE_ON" +#line 748 "seclang-parser.yy" + { driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::OnAuditLogStatus); } -#line 1517 "seclang-parser.cc" // lalr1.cc:919 +#line 1738 "seclang-parser.cc" break; - case 11: -#line 747 "seclang-parser.yy" // lalr1.cc:919 - { + case 11: // audit_log: "CONFIG_DIR_AUDIT_FLE_MOD" +#line 754 "seclang-parser.yy" + { driver.m_auditLog->setFileMode(strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8)); } -#line 1525 "seclang-parser.cc" // lalr1.cc:919 +#line 1746 "seclang-parser.cc" break; - case 12: -#line 753 "seclang-parser.yy" // lalr1.cc:919 - { + case 12: // audit_log: "CONFIG_DIR_AUDIT_LOG2" +#line 760 "seclang-parser.yy" + { driver.m_auditLog->setFilePath2(yystack_[0].value.as < std::string > ()); } -#line 1533 "seclang-parser.cc" // lalr1.cc:919 +#line 1754 "seclang-parser.cc" break; - case 13: -#line 759 "seclang-parser.yy" // lalr1.cc:919 - { + case 13: // audit_log: "CONFIG_DIR_AUDIT_LOG_P" +#line 766 "seclang-parser.yy" + { driver.m_auditLog->setParts(yystack_[0].value.as < std::string > ()); } -#line 1541 "seclang-parser.cc" // lalr1.cc:919 +#line 1762 "seclang-parser.cc" break; - case 14: -#line 765 "seclang-parser.yy" // lalr1.cc:919 - { + case 14: // audit_log: "CONFIG_DIR_AUDIT_LOG" +#line 772 "seclang-parser.yy" + { driver.m_auditLog->setFilePath1(yystack_[0].value.as < std::string > ()); } -#line 1549 "seclang-parser.cc" // lalr1.cc:919 +#line 1770 "seclang-parser.cc" break; - case 15: -#line 770 "seclang-parser.yy" // lalr1.cc:919 - { + case 15: // audit_log: CONFIG_DIR_AUDIT_LOG_FMT JSON +#line 777 "seclang-parser.yy" + { driver.m_auditLog->setFormat(modsecurity::audit_log::AuditLog::JSONAuditLogFormat); } -#line 1557 "seclang-parser.cc" // lalr1.cc:919 +#line 1778 "seclang-parser.cc" break; - case 16: -#line 775 "seclang-parser.yy" // lalr1.cc:919 - { + case 16: // audit_log: CONFIG_DIR_AUDIT_LOG_FMT NATIVE +#line 782 "seclang-parser.yy" + { driver.m_auditLog->setFormat(modsecurity::audit_log::AuditLog::NativeAuditLogFormat); } -#line 1565 "seclang-parser.cc" // lalr1.cc:919 +#line 1786 "seclang-parser.cc" break; - case 17: -#line 781 "seclang-parser.yy" // lalr1.cc:919 - { + case 17: // audit_log: "CONFIG_DIR_AUDIT_STS" +#line 788 "seclang-parser.yy" + { std::string relevant_status(yystack_[0].value.as < std::string > ()); driver.m_auditLog->setRelevantStatus(relevant_status); } -#line 1574 "seclang-parser.cc" // lalr1.cc:919 +#line 1795 "seclang-parser.cc" break; - case 18: -#line 788 "seclang-parser.yy" // lalr1.cc:919 - { + case 18: // audit_log: "CONFIG_DIR_AUDIT_TPE" "CONFIG_VALUE_SERIAL" +#line 795 "seclang-parser.yy" + { driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::SerialAuditLogType); } -#line 1582 "seclang-parser.cc" // lalr1.cc:919 +#line 1803 "seclang-parser.cc" break; - case 19: -#line 792 "seclang-parser.yy" // lalr1.cc:919 - { + case 19: // audit_log: "CONFIG_DIR_AUDIT_TPE" "CONFIG_VALUE_PARALLEL" +#line 799 "seclang-parser.yy" + { driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::ParallelAuditLogType); } -#line 1590 "seclang-parser.cc" // lalr1.cc:919 +#line 1811 "seclang-parser.cc" break; - case 20: -#line 796 "seclang-parser.yy" // lalr1.cc:919 - { + case 20: // audit_log: "CONFIG_DIR_AUDIT_TPE" "CONFIG_VALUE_HTTPS" +#line 803 "seclang-parser.yy" + { driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::HttpsAuditLogType); } -#line 1598 "seclang-parser.cc" // lalr1.cc:919 +#line 1819 "seclang-parser.cc" break; - case 21: -#line 802 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_uploadKeepFiles = modsecurity::RulesProperties::TrueConfigBoolean; + case 21: // audit_log: "CONFIG_UPDLOAD_KEEP_FILES" "CONFIG_VALUE_ON" +#line 809 "seclang-parser.yy" + { + driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::TrueConfigBoolean; } -#line 1606 "seclang-parser.cc" // lalr1.cc:919 +#line 1827 "seclang-parser.cc" break; - case 22: -#line 806 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_uploadKeepFiles = modsecurity::RulesProperties::FalseConfigBoolean; + case 22: // audit_log: "CONFIG_UPDLOAD_KEEP_FILES" "CONFIG_VALUE_OFF" +#line 813 "seclang-parser.yy" + { + driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::FalseConfigBoolean; } -#line 1614 "seclang-parser.cc" // lalr1.cc:919 +#line 1835 "seclang-parser.cc" break; - case 23: -#line 810 "seclang-parser.yy" // lalr1.cc:919 - { + case 23: // audit_log: "CONFIG_UPDLOAD_KEEP_FILES" "CONFIG_VALUE_RELEVANT_ONLY" +#line 817 "seclang-parser.yy" + { driver.error(yystack_[2].location, "SecUploadKeepFiles RelevantOnly is not currently supported. Accepted values are On or Off"); YYERROR; } -#line 1623 "seclang-parser.cc" // lalr1.cc:919 +#line 1844 "seclang-parser.cc" break; - case 24: -#line 815 "seclang-parser.yy" // lalr1.cc:919 - { + case 24: // audit_log: "CONFIG_UPLOAD_FILE_LIMIT" +#line 822 "seclang-parser.yy" + { driver.m_uploadFileLimit.m_set = true; driver.m_uploadFileLimit.m_value = strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 10); } -#line 1632 "seclang-parser.cc" // lalr1.cc:919 +#line 1853 "seclang-parser.cc" break; - case 25: -#line 820 "seclang-parser.yy" // lalr1.cc:919 - { + case 25: // audit_log: "CONFIG_UPLOAD_FILE_MODE" +#line 827 "seclang-parser.yy" + { driver.m_uploadFileMode.m_set = true; driver.m_uploadFileMode.m_value = strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8); } -#line 1641 "seclang-parser.cc" // lalr1.cc:919 +#line 1862 "seclang-parser.cc" break; - case 26: -#line 825 "seclang-parser.yy" // lalr1.cc:919 - { + case 26: // audit_log: "CONFIG_UPLOAD_DIR" +#line 832 "seclang-parser.yy" + { driver.m_uploadDirectory.m_set = true; driver.m_uploadDirectory.m_value = yystack_[0].value.as < std::string > (); } -#line 1650 "seclang-parser.cc" // lalr1.cc:919 +#line 1871 "seclang-parser.cc" break; - case 27: -#line 830 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_tmpSaveUploadedFiles = modsecurity::RulesProperties::TrueConfigBoolean; + case 27: // audit_log: "CONFIG_UPDLOAD_SAVE_TMP_FILES" "CONFIG_VALUE_ON" +#line 837 "seclang-parser.yy" + { + driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::TrueConfigBoolean; } -#line 1658 "seclang-parser.cc" // lalr1.cc:919 +#line 1879 "seclang-parser.cc" break; - case 28: -#line 834 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_tmpSaveUploadedFiles = modsecurity::RulesProperties::FalseConfigBoolean; + case 28: // audit_log: "CONFIG_UPDLOAD_SAVE_TMP_FILES" "CONFIG_VALUE_OFF" +#line 841 "seclang-parser.yy" + { + driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::FalseConfigBoolean; } -#line 1666 "seclang-parser.cc" // lalr1.cc:919 +#line 1887 "seclang-parser.cc" break; - case 29: -#line 841 "seclang-parser.yy" // lalr1.cc:919 - { + case 29: // actions: "QUOTATION_MARK" actions_may_quoted "QUOTATION_MARK" +#line 848 "seclang-parser.yy" + { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[1].value.as < std::unique_ptr > > > ()); } -#line 1674 "seclang-parser.cc" // lalr1.cc:919 +#line 1895 "seclang-parser.cc" break; - case 30: -#line 845 "seclang-parser.yy" // lalr1.cc:919 - { + case 30: // actions: actions_may_quoted +#line 852 "seclang-parser.yy" + { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[0].value.as < std::unique_ptr > > > ()); } -#line 1682 "seclang-parser.cc" // lalr1.cc:919 +#line 1903 "seclang-parser.cc" break; - case 31: -#line 852 "seclang-parser.yy" // lalr1.cc:919 - { + case 31: // actions_may_quoted: actions_may_quoted "," act +#line 859 "seclang-parser.yy" + { ACTION_INIT(yystack_[0].value.as < std::unique_ptr > (), yystack_[3].location) yystack_[2].value.as < std::unique_ptr > > > ()->push_back(std::move(yystack_[0].value.as < std::unique_ptr > ())); yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[2].value.as < std::unique_ptr > > > ()); } -#line 1692 "seclang-parser.cc" // lalr1.cc:919 +#line 1913 "seclang-parser.cc" break; - case 32: -#line 858 "seclang-parser.yy" // lalr1.cc:919 - { + case 32: // actions_may_quoted: act +#line 865 "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 1703 "seclang-parser.cc" // lalr1.cc:919 +#line 1924 "seclang-parser.cc" break; - case 33: -#line 868 "seclang-parser.yy" // lalr1.cc:919 - { + case 33: // op: op_before_init +#line 875 "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) { @@ -1712,12 +1933,12 @@ namespace yy { YYERROR; } } -#line 1716 "seclang-parser.cc" // lalr1.cc:919 +#line 1937 "seclang-parser.cc" break; - case 34: -#line 877 "seclang-parser.yy" // lalr1.cc:919 - { + case 34: // op: "NOT" op_before_init +#line 884 "seclang-parser.yy" + { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); yylhs.value.as < std::unique_ptr > ()->m_negation = true; std::string error; @@ -1726,12 +1947,12 @@ namespace yy { YYERROR; } } -#line 1730 "seclang-parser.cc" // lalr1.cc:919 +#line 1951 "seclang-parser.cc" break; - case 35: -#line 887 "seclang-parser.yy" // lalr1.cc:919 - { + case 35: // op: run_time_string +#line 894 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ()))); std::string error; if (yylhs.value.as < std::unique_ptr > ()->init(*yystack_[0].location.end.filename, &error) == false) { @@ -1739,12 +1960,12 @@ namespace yy { YYERROR; } } -#line 1743 "seclang-parser.cc" // lalr1.cc:919 +#line 1964 "seclang-parser.cc" break; - case 36: -#line 896 "seclang-parser.yy" // lalr1.cc:919 - { + case 36: // op: "NOT" run_time_string +#line 903 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ()))); yylhs.value.as < std::unique_ptr > ()->m_negation = true; std::string error; @@ -1753,295 +1974,303 @@ namespace yy { YYERROR; } } -#line 1757 "seclang-parser.cc" // lalr1.cc:919 +#line 1978 "seclang-parser.cc" break; - case 37: -#line 909 "seclang-parser.yy" // lalr1.cc:919 - { + case 37: // op_before_init: "OPERATOR_UNCONDITIONAL_MATCH" +#line 916 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::UnconditionalMatch()); } -#line 1765 "seclang-parser.cc" // lalr1.cc:919 +#line 1986 "seclang-parser.cc" break; - case 38: -#line 913 "seclang-parser.yy" // lalr1.cc:919 - { + case 38: // op_before_init: "OPERATOR_DETECT_SQLI" +#line 920 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::DetectSQLi()); } -#line 1773 "seclang-parser.cc" // lalr1.cc:919 +#line 1994 "seclang-parser.cc" break; - case 39: -#line 917 "seclang-parser.yy" // lalr1.cc:919 - { + case 39: // op_before_init: "OPERATOR_DETECT_XSS" +#line 924 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::DetectXSS()); } -#line 1781 "seclang-parser.cc" // lalr1.cc:919 +#line 2002 "seclang-parser.cc" break; - case 40: -#line 921 "seclang-parser.yy" // lalr1.cc:919 - { + case 40: // op_before_init: "OPERATOR_VALIDATE_URL_ENCODING" +#line 928 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateUrlEncoding()); } -#line 1789 "seclang-parser.cc" // lalr1.cc:919 +#line 2010 "seclang-parser.cc" break; - case 41: -#line 925 "seclang-parser.yy" // lalr1.cc:919 - { + case 41: // op_before_init: "OPERATOR_VALIDATE_UTF8_ENCODING" +#line 932 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateUtf8Encoding()); } -#line 1797 "seclang-parser.cc" // lalr1.cc:919 +#line 2018 "seclang-parser.cc" break; - case 42: -#line 929 "seclang-parser.yy" // lalr1.cc:919 - { + case 42: // op_before_init: "OPERATOR_INSPECT_FILE" run_time_string +#line 936 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::InspectFile(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1805 "seclang-parser.cc" // lalr1.cc:919 +#line 2026 "seclang-parser.cc" break; - case 43: -#line 933 "seclang-parser.yy" // lalr1.cc:919 - { + case 43: // op_before_init: "OPERATOR_FUZZY_HASH" run_time_string +#line 940 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::FuzzyHash(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1813 "seclang-parser.cc" // lalr1.cc:919 +#line 2034 "seclang-parser.cc" break; - case 44: -#line 937 "seclang-parser.yy" // lalr1.cc:919 - { + case 44: // op_before_init: "OPERATOR_VALIDATE_BYTE_RANGE" run_time_string +#line 944 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateByteRange(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1821 "seclang-parser.cc" // lalr1.cc:919 +#line 2042 "seclang-parser.cc" break; - case 45: -#line 941 "seclang-parser.yy" // lalr1.cc:919 - { + case 45: // op_before_init: "OPERATOR_VALIDATE_DTD" run_time_string +#line 948 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateDTD(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1829 "seclang-parser.cc" // lalr1.cc:919 +#line 2050 "seclang-parser.cc" break; - case 46: -#line 945 "seclang-parser.yy" // lalr1.cc:919 - { + case 46: // op_before_init: "OPERATOR_VALIDATE_HASH" run_time_string +#line 952 "seclang-parser.yy" + { /* $$ = new operators::ValidateHash($1); */ OPERATOR_NOT_SUPPORTED("ValidateHash", yystack_[2].location); } -#line 1838 "seclang-parser.cc" // lalr1.cc:919 +#line 2059 "seclang-parser.cc" break; - case 47: -#line 950 "seclang-parser.yy" // lalr1.cc:919 - { + case 47: // op_before_init: "OPERATOR_VALIDATE_SCHEMA" run_time_string +#line 957 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateSchema(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1846 "seclang-parser.cc" // lalr1.cc:919 +#line 2067 "seclang-parser.cc" break; - case 48: -#line 954 "seclang-parser.yy" // lalr1.cc:919 - { + case 48: // op_before_init: "OPERATOR_VERIFY_CC" run_time_string +#line 961 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifyCC(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1854 "seclang-parser.cc" // lalr1.cc:919 +#line 2075 "seclang-parser.cc" break; - case 49: -#line 958 "seclang-parser.yy" // lalr1.cc:919 - { + case 49: // op_before_init: "OPERATOR_VERIFY_CPF" run_time_string +#line 965 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifyCPF(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1862 "seclang-parser.cc" // lalr1.cc:919 +#line 2083 "seclang-parser.cc" break; - case 50: -#line 962 "seclang-parser.yy" // lalr1.cc:919 - { + case 50: // op_before_init: "OPERATOR_VERIFY_SSN" run_time_string +#line 969 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifySSN(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1870 "seclang-parser.cc" // lalr1.cc:919 +#line 2091 "seclang-parser.cc" break; - case 51: -#line 966 "seclang-parser.yy" // lalr1.cc:919 - { + case 51: // op_before_init: "OPERATOR_VERIFY_SVNR" run_time_string +#line 973 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifySVNR(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1878 "seclang-parser.cc" // lalr1.cc:919 +#line 2099 "seclang-parser.cc" break; - case 52: -#line 970 "seclang-parser.yy" // lalr1.cc:919 - { + case 52: // op_before_init: "OPERATOR_GSB_LOOKUP" run_time_string +#line 977 "seclang-parser.yy" + { /* $$ = new operators::GsbLookup($1); */ OPERATOR_NOT_SUPPORTED("GsbLookup", yystack_[2].location); } -#line 1887 "seclang-parser.cc" // lalr1.cc:919 +#line 2108 "seclang-parser.cc" break; - case 53: -#line 975 "seclang-parser.yy" // lalr1.cc:919 - { + case 53: // op_before_init: "OPERATOR_RSUB" run_time_string +#line 982 "seclang-parser.yy" + { /* $$ = new operators::Rsub($1); */ OPERATOR_NOT_SUPPORTED("Rsub", yystack_[2].location); } -#line 1896 "seclang-parser.cc" // lalr1.cc:919 +#line 2117 "seclang-parser.cc" break; - case 54: -#line 980 "seclang-parser.yy" // lalr1.cc:919 - { + case 54: // op_before_init: "OPERATOR_WITHIN" run_time_string +#line 987 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Within(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1904 "seclang-parser.cc" // lalr1.cc:919 +#line 2125 "seclang-parser.cc" break; - case 55: -#line 984 "seclang-parser.yy" // lalr1.cc:919 - { + case 55: // op_before_init: "OPERATOR_CONTAINS_WORD" run_time_string +#line 991 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ContainsWord(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1912 "seclang-parser.cc" // lalr1.cc:919 +#line 2133 "seclang-parser.cc" break; - case 56: -#line 988 "seclang-parser.yy" // lalr1.cc:919 - { + case 56: // op_before_init: "OPERATOR_CONTAINS" run_time_string +#line 995 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Contains(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1920 "seclang-parser.cc" // lalr1.cc:919 +#line 2141 "seclang-parser.cc" break; - case 57: -#line 992 "seclang-parser.yy" // lalr1.cc:919 - { + case 57: // op_before_init: "OPERATOR_ENDS_WITH" run_time_string +#line 999 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::EndsWith(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1928 "seclang-parser.cc" // lalr1.cc:919 +#line 2149 "seclang-parser.cc" break; - case 58: -#line 996 "seclang-parser.yy" // lalr1.cc:919 - { + case 58: // op_before_init: "OPERATOR_EQ" run_time_string +#line 1003 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Eq(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1936 "seclang-parser.cc" // lalr1.cc:919 +#line 2157 "seclang-parser.cc" break; - case 59: -#line 1000 "seclang-parser.yy" // lalr1.cc:919 - { + case 59: // op_before_init: "OPERATOR_GE" run_time_string +#line 1007 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Ge(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1944 "seclang-parser.cc" // lalr1.cc:919 +#line 2165 "seclang-parser.cc" break; - case 60: -#line 1004 "seclang-parser.yy" // lalr1.cc:919 - { + case 60: // op_before_init: "OPERATOR_GT" run_time_string +#line 1011 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Gt(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1952 "seclang-parser.cc" // lalr1.cc:919 +#line 2173 "seclang-parser.cc" break; - case 61: -#line 1008 "seclang-parser.yy" // lalr1.cc:919 - { + case 61: // op_before_init: "OPERATOR_IP_MATCH_FROM_FILE" run_time_string +#line 1015 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::IpMatchF(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1960 "seclang-parser.cc" // lalr1.cc:919 +#line 2181 "seclang-parser.cc" break; - case 62: -#line 1012 "seclang-parser.yy" // lalr1.cc:919 - { + case 62: // op_before_init: "OPERATOR_IP_MATCH" run_time_string +#line 1019 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::IpMatch(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1968 "seclang-parser.cc" // lalr1.cc:919 +#line 2189 "seclang-parser.cc" break; - case 63: -#line 1016 "seclang-parser.yy" // lalr1.cc:919 - { + case 63: // op_before_init: "OPERATOR_LE" run_time_string +#line 1023 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Le(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1976 "seclang-parser.cc" // lalr1.cc:919 +#line 2197 "seclang-parser.cc" break; - case 64: -#line 1020 "seclang-parser.yy" // lalr1.cc:919 - { + case 64: // op_before_init: "OPERATOR_LT" run_time_string +#line 1027 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Lt(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1984 "seclang-parser.cc" // lalr1.cc:919 +#line 2205 "seclang-parser.cc" break; - case 65: -#line 1024 "seclang-parser.yy" // lalr1.cc:919 - { + case 65: // op_before_init: "OPERATOR_PM_FROM_FILE" run_time_string +#line 1031 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::PmFromFile(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 1992 "seclang-parser.cc" // lalr1.cc:919 +#line 2213 "seclang-parser.cc" break; - case 66: -#line 1028 "seclang-parser.yy" // lalr1.cc:919 - { + case 66: // op_before_init: "OPERATOR_PM" run_time_string +#line 1035 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Pm(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 2000 "seclang-parser.cc" // lalr1.cc:919 +#line 2221 "seclang-parser.cc" break; - case 67: -#line 1032 "seclang-parser.yy" // lalr1.cc:919 - { + case 67: // op_before_init: "OPERATOR_RBL" run_time_string +#line 1039 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rbl(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 2008 "seclang-parser.cc" // lalr1.cc:919 +#line 2229 "seclang-parser.cc" break; - case 68: -#line 1036 "seclang-parser.yy" // lalr1.cc:919 - { + case 68: // op_before_init: "OPERATOR_RX" run_time_string +#line 1043 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 2016 "seclang-parser.cc" // lalr1.cc:919 +#line 2237 "seclang-parser.cc" break; - case 69: -#line 1040 "seclang-parser.yy" // lalr1.cc:919 - { + case 69: // op_before_init: "OPERATOR_RX_GLOBAL" run_time_string +#line 1047 "seclang-parser.yy" + { + OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::RxGlobal(std::move(yystack_[0].value.as < std::unique_ptr > ()))); + } +#line 2245 "seclang-parser.cc" + break; + + case 70: // op_before_init: "OPERATOR_STR_EQ" run_time_string +#line 1051 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::StrEq(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 2024 "seclang-parser.cc" // lalr1.cc:919 +#line 2253 "seclang-parser.cc" break; - case 70: -#line 1044 "seclang-parser.yy" // lalr1.cc:919 - { + case 71: // op_before_init: "OPERATOR_STR_MATCH" run_time_string +#line 1055 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::StrMatch(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 2032 "seclang-parser.cc" // lalr1.cc:919 +#line 2261 "seclang-parser.cc" break; - case 71: -#line 1048 "seclang-parser.yy" // lalr1.cc:919 - { + case 72: // op_before_init: "OPERATOR_BEGINS_WITH" run_time_string +#line 1059 "seclang-parser.yy" + { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::BeginsWith(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 2040 "seclang-parser.cc" // lalr1.cc:919 +#line 2269 "seclang-parser.cc" break; - case 72: -#line 1052 "seclang-parser.yy" // lalr1.cc:919 - { + case 73: // op_before_init: "OPERATOR_GEOLOOKUP" +#line 1063 "seclang-parser.yy" + { #if defined(WITH_GEOIP) or defined(WITH_MAXMIND) OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::GeoLookup()); #else @@ -2051,15 +2280,20 @@ namespace yy { YYERROR; #endif // WITH_GEOIP } -#line 2055 "seclang-parser.cc" // lalr1.cc:919 +#line 2284 "seclang-parser.cc" break; - case 74: -#line 1067 "seclang-parser.yy" // lalr1.cc:919 - { + case 75: // expression: "DIRECTIVE" variables op actions +#line 1078 "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()) { - a->push_back(i.release()); + 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()) { @@ -2067,95 +2301,103 @@ namespace yy { } Operator *op = yystack_[1].value.as < std::unique_ptr > ().release(); - Rule *rule = new Rule( + std::unique_ptr rule(new RuleWithOperator( /* op */ op, /* variables */ v, /* actions */ a, - /* file name */ *yystack_[3].location.end.filename, + /* 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(rule) == false) { - delete rule; + if (driver.addSecRule(std::move(rule)) == false) { YYERROR; } } -#line 2084 "seclang-parser.cc" // lalr1.cc:919 +#line 2318 "seclang-parser.cc" break; - case 75: -#line 1092 "seclang-parser.yy" // lalr1.cc:919 - { + case 76: // expression: "DIRECTIVE" variables op +#line 1108 "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()); } - Rule *rule = new Rule( + std::unique_ptr rule(new RuleWithOperator( /* op */ yystack_[0].value.as < std::unique_ptr > ().release(), /* variables */ v, /* actions */ NULL, - /* file name */ *yystack_[2].location.end.filename, + /* 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(rule) == false) { - delete rule; + )); + if (driver.addSecRule(std::move(rule)) == false) { YYERROR; } } -#line 2107 "seclang-parser.cc" // lalr1.cc:919 +#line 2341 "seclang-parser.cc" break; - case 76: -#line 1111 "seclang-parser.yy" // lalr1.cc:919 - { + case 77: // expression: "CONFIG_DIR_SEC_ACTION" actions +#line 1127 "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()) { - a->push_back(i.release()); + if (dynamic_cast(i.get())) { + t->push_back(dynamic_cast(i.release())); + } else { + a->push_back(i.release()); + } } - Rule *rule = new Rule( - /* op */ NULL, - /* variables */ NULL, + std::unique_ptr rule(new RuleUnconditional( /* actions */ a, - /* file name */ *yystack_[1].location.end.filename, + /* transformations */ t, + /* file name */ std::unique_ptr(new std::string(*yystack_[1].location.end.filename)), /* line number */ yystack_[1].location.end.line - ); - driver.addSecAction(rule); + )); + driver.addSecAction(std::move(rule)); } -#line 2126 "seclang-parser.cc" // lalr1.cc:919 +#line 2364 "seclang-parser.cc" break; - case 77: -#line 1126 "seclang-parser.yy" // lalr1.cc:919 - { + case 78: // expression: "DIRECTIVE_SECRULESCRIPT" actions +#line 1146 "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()) { - a->push_back(i.release()); + if (dynamic_cast(i.get())) { + t->push_back(dynamic_cast(i.release())); + } else { + a->push_back(i.release()); + } } - RuleScript *r = new RuleScript( + std::unique_ptr r(new RuleScript( /* path to script */ yystack_[1].value.as < std::string > (), /* actions */ a, - /* file name */ *yystack_[1].location.end.filename, + /* 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); - delete r; YYERROR; } - if (driver.addSecRuleScript(r) == false) { - delete r; + if (driver.addSecRuleScript(std::move(r)) == false) { YYERROR; } } -#line 2154 "seclang-parser.cc" // lalr1.cc:919 +#line 2396 "seclang-parser.cc" break; - case 78: -#line 1150 "seclang-parser.yy" // lalr1.cc:919 - { + case 79: // expression: "CONFIG_DIR_SEC_DEFAULT_ACTION" actions +#line 1174 "seclang-parser.yy" + { bool hasDisruptive = false; std::vector *actions = new std::vector(); for (auto &i : *yystack_[0].value.as < std::unique_ptr > > > ().get()) { @@ -2175,14 +2417,14 @@ namespace yy { delete phase; } else if (a->action_kind == actions::Action::RunTimeOnlyIfMatchKind || a->action_kind == actions::Action::RunTimeBeforeMatchAttemptKind) { - actions::transformations::None *none = dynamic_cast(a); + 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 + "' is not suitable to be part of the SecDefaultActions"); + driver.error(yystack_[2].location, "The action '" + *a->m_name.get() + "' is not suitable to be part of the SecDefaultActions"); YYERROR; } } @@ -2205,81 +2447,85 @@ namespace yy { } for (actions::Action *a : checkedActions) { - driver.m_defaultActions[definedPhase].push_back(a); + driver.m_defaultActions[definedPhase].push_back( + std::unique_ptr(a)); } delete actions; } -#line 2214 "seclang-parser.cc" // lalr1.cc:919 +#line 2457 "seclang-parser.cc" break; - case 79: -#line 1206 "seclang-parser.yy" // lalr1.cc:919 - { - driver.addSecMarker(modsecurity::utils::string::removeBracketsIfNeeded(yystack_[0].value.as < std::string > ())); + case 80: // expression: "CONFIG_DIR_SEC_MARKER" +#line 1231 "seclang-parser.yy" + { + driver.addSecMarker(modsecurity::utils::string::removeBracketsIfNeeded(yystack_[0].value.as < std::string > ()), + /* file name */ std::unique_ptr(new std::string(*yystack_[0].location.end.filename)), + /* line number */ yystack_[0].location.end.line + ); } -#line 2222 "seclang-parser.cc" // lalr1.cc:919 +#line 2468 "seclang-parser.cc" break; - case 80: -#line 1210 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_secRuleEngine = modsecurity::Rules::DisabledRuleEngine; + case 81: // expression: "CONFIG_DIR_RULE_ENG" "CONFIG_VALUE_OFF" +#line 1238 "seclang-parser.yy" + { + driver.m_secRuleEngine = modsecurity::RulesSet::DisabledRuleEngine; } -#line 2230 "seclang-parser.cc" // lalr1.cc:919 +#line 2476 "seclang-parser.cc" break; - case 81: -#line 1214 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_secRuleEngine = modsecurity::Rules::EnabledRuleEngine; + case 82: // expression: "CONFIG_DIR_RULE_ENG" "CONFIG_VALUE_ON" +#line 1242 "seclang-parser.yy" + { + driver.m_secRuleEngine = modsecurity::RulesSet::EnabledRuleEngine; } -#line 2238 "seclang-parser.cc" // lalr1.cc:919 +#line 2484 "seclang-parser.cc" break; - case 82: -#line 1218 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_secRuleEngine = modsecurity::Rules::DetectionOnlyRuleEngine; + case 83: // expression: "CONFIG_DIR_RULE_ENG" "CONFIG_VALUE_DETC" +#line 1246 "seclang-parser.yy" + { + driver.m_secRuleEngine = modsecurity::RulesSet::DetectionOnlyRuleEngine; } -#line 2246 "seclang-parser.cc" // lalr1.cc:919 +#line 2492 "seclang-parser.cc" break; - case 83: -#line 1222 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_secRequestBodyAccess = modsecurity::RulesProperties::TrueConfigBoolean; + case 84: // expression: "CONFIG_DIR_REQ_BODY" "CONFIG_VALUE_ON" +#line 1250 "seclang-parser.yy" + { + driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean; } -#line 2254 "seclang-parser.cc" // lalr1.cc:919 +#line 2500 "seclang-parser.cc" break; - case 84: -#line 1226 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_secRequestBodyAccess = modsecurity::RulesProperties::FalseConfigBoolean; + case 85: // expression: "CONFIG_DIR_REQ_BODY" "CONFIG_VALUE_OFF" +#line 1254 "seclang-parser.yy" + { + driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean; } -#line 2262 "seclang-parser.cc" // lalr1.cc:919 +#line 2508 "seclang-parser.cc" break; - case 85: -#line 1230 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_secResponseBodyAccess = modsecurity::RulesProperties::TrueConfigBoolean; + case 86: // expression: "CONFIG_DIR_RES_BODY" "CONFIG_VALUE_ON" +#line 1258 "seclang-parser.yy" + { + driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean; } -#line 2270 "seclang-parser.cc" // lalr1.cc:919 +#line 2516 "seclang-parser.cc" break; - case 86: -#line 1234 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_secResponseBodyAccess = modsecurity::RulesProperties::FalseConfigBoolean; + case 87: // expression: "CONFIG_DIR_RES_BODY" "CONFIG_VALUE_OFF" +#line 1262 "seclang-parser.yy" + { + driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean; } -#line 2278 "seclang-parser.cc" // lalr1.cc:919 +#line 2524 "seclang-parser.cc" break; - case 87: -#line 1238 "seclang-parser.yy" // lalr1.cc:919 - { + case 88: // expression: "CONFIG_SEC_ARGUMENT_SEPARATOR" +#line 1266 "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; @@ -2287,260 +2533,260 @@ namespace yy { driver.m_secArgumentSeparator.m_value = yystack_[0].value.as < std::string > (); driver.m_secArgumentSeparator.m_set = true; } -#line 2291 "seclang-parser.cc" // lalr1.cc:919 +#line 2537 "seclang-parser.cc" break; - case 88: -#line 1247 "seclang-parser.yy" // lalr1.cc:919 - { + case 89: // expression: "CONFIG_COMPONENT_SIG" +#line 1275 "seclang-parser.yy" + { driver.m_components.push_back(yystack_[0].value.as < std::string > ()); } -#line 2299 "seclang-parser.cc" // lalr1.cc:919 +#line 2545 "seclang-parser.cc" break; - case 89: -#line 1251 "seclang-parser.yy" // lalr1.cc:919 - { + case 90: // expression: "CONFIG_CONN_ENGINE" "CONFIG_VALUE_ON" +#line 1279 "seclang-parser.yy" + { driver.error(yystack_[2].location, "SecConnEngine is not yet supported."); YYERROR; } -#line 2308 "seclang-parser.cc" // lalr1.cc:919 +#line 2554 "seclang-parser.cc" break; - case 90: -#line 1256 "seclang-parser.yy" // lalr1.cc:919 - { + case 91: // expression: "CONFIG_CONN_ENGINE" "CONFIG_VALUE_OFF" +#line 1284 "seclang-parser.yy" + { } -#line 2315 "seclang-parser.cc" // lalr1.cc:919 +#line 2561 "seclang-parser.cc" break; - case 91: -#line 1259 "seclang-parser.yy" // lalr1.cc:919 - { + case 92: // expression: "CONFIG_SEC_WEB_APP_ID" +#line 1287 "seclang-parser.yy" + { driver.m_secWebAppId.m_value = yystack_[0].value.as < std::string > (); driver.m_secWebAppId.m_set = true; } -#line 2324 "seclang-parser.cc" // lalr1.cc:919 +#line 2570 "seclang-parser.cc" break; - case 92: -#line 1264 "seclang-parser.yy" // lalr1.cc:919 - { + case 93: // expression: "CONFIG_SEC_SERVER_SIG" +#line 1292 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecServerSignature is not supported."); YYERROR; } -#line 2333 "seclang-parser.cc" // lalr1.cc:919 +#line 2579 "seclang-parser.cc" break; - case 93: -#line 1269 "seclang-parser.yy" // lalr1.cc:919 - { + case 94: // expression: "CONFIG_SEC_CACHE_TRANSFORMATIONS" +#line 1297 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecCacheTransformations is not supported."); YYERROR; } -#line 2342 "seclang-parser.cc" // lalr1.cc:919 +#line 2588 "seclang-parser.cc" break; - case 94: -#line 1274 "seclang-parser.yy" // lalr1.cc:919 - { + case 95: // expression: "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" "CONFIG_VALUE_ON" +#line 1302 "seclang-parser.yy" + { driver.error(yystack_[2].location, "SecDisableBackendCompression is not supported."); YYERROR; } -#line 2351 "seclang-parser.cc" // lalr1.cc:919 +#line 2597 "seclang-parser.cc" break; - case 95: -#line 1279 "seclang-parser.yy" // lalr1.cc:919 - { + case 96: // expression: "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" "CONFIG_VALUE_OFF" +#line 1307 "seclang-parser.yy" + { } -#line 2358 "seclang-parser.cc" // lalr1.cc:919 +#line 2604 "seclang-parser.cc" break; - case 96: -#line 1282 "seclang-parser.yy" // lalr1.cc:919 - { + case 97: // expression: "CONFIG_CONTENT_INJECTION" "CONFIG_VALUE_ON" +#line 1310 "seclang-parser.yy" + { driver.error(yystack_[2].location, "SecContentInjection is not yet supported."); YYERROR; } -#line 2367 "seclang-parser.cc" // lalr1.cc:919 +#line 2613 "seclang-parser.cc" break; - case 97: -#line 1287 "seclang-parser.yy" // lalr1.cc:919 - { + case 98: // expression: "CONFIG_CONTENT_INJECTION" "CONFIG_VALUE_OFF" +#line 1315 "seclang-parser.yy" + { } -#line 2374 "seclang-parser.cc" // lalr1.cc:919 +#line 2620 "seclang-parser.cc" break; - case 98: -#line 1290 "seclang-parser.yy" // lalr1.cc:919 - { + case 99: // expression: "CONFIG_SEC_CHROOT_DIR" +#line 1318 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecChrootDir is not supported."); YYERROR; } -#line 2383 "seclang-parser.cc" // lalr1.cc:919 +#line 2629 "seclang-parser.cc" break; - case 99: -#line 1295 "seclang-parser.yy" // lalr1.cc:919 - { + case 100: // expression: "CONFIG_SEC_HASH_ENGINE" "CONFIG_VALUE_ON" +#line 1323 "seclang-parser.yy" + { driver.error(yystack_[2].location, "SecHashEngine is not yet supported."); YYERROR; } -#line 2392 "seclang-parser.cc" // lalr1.cc:919 +#line 2638 "seclang-parser.cc" break; - case 100: -#line 1300 "seclang-parser.yy" // lalr1.cc:919 - { + case 101: // expression: "CONFIG_SEC_HASH_ENGINE" "CONFIG_VALUE_OFF" +#line 1328 "seclang-parser.yy" + { } -#line 2399 "seclang-parser.cc" // lalr1.cc:919 +#line 2645 "seclang-parser.cc" break; - case 101: -#line 1303 "seclang-parser.yy" // lalr1.cc:919 - { + case 102: // expression: "CONFIG_SEC_HASH_KEY" +#line 1331 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecHashKey is not yet supported."); YYERROR; } -#line 2408 "seclang-parser.cc" // lalr1.cc:919 +#line 2654 "seclang-parser.cc" break; - case 102: -#line 1308 "seclang-parser.yy" // lalr1.cc:919 - { + case 103: // expression: "CONFIG_SEC_HASH_PARAM" +#line 1336 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecHashParam is not yet supported."); YYERROR; } -#line 2417 "seclang-parser.cc" // lalr1.cc:919 +#line 2663 "seclang-parser.cc" break; - case 103: -#line 1313 "seclang-parser.yy" // lalr1.cc:919 - { + case 104: // expression: "CONFIG_SEC_HASH_METHOD_RX" +#line 1341 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecHashMethodRx is not yet supported."); YYERROR; } -#line 2426 "seclang-parser.cc" // lalr1.cc:919 +#line 2672 "seclang-parser.cc" break; - case 104: -#line 1318 "seclang-parser.yy" // lalr1.cc:919 - { + case 105: // expression: "CONFIG_SEC_HASH_METHOD_PM" +#line 1346 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecHashMethodPm is not yet supported."); YYERROR; } -#line 2435 "seclang-parser.cc" // lalr1.cc:919 +#line 2681 "seclang-parser.cc" break; - case 105: -#line 1323 "seclang-parser.yy" // lalr1.cc:919 - { + case 106: // expression: "CONFIG_DIR_GSB_DB" +#line 1351 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecGsbLookupDb is not supported."); YYERROR; } -#line 2444 "seclang-parser.cc" // lalr1.cc:919 +#line 2690 "seclang-parser.cc" break; - case 106: -#line 1328 "seclang-parser.yy" // lalr1.cc:919 - { + case 107: // expression: "CONFIG_SEC_GUARDIAN_LOG" +#line 1356 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecGuardianLog is not supported."); YYERROR; } -#line 2453 "seclang-parser.cc" // lalr1.cc:919 +#line 2699 "seclang-parser.cc" break; - case 107: -#line 1333 "seclang-parser.yy" // lalr1.cc:919 - { + case 108: // expression: "CONFIG_SEC_INTERCEPT_ON_ERROR" "CONFIG_VALUE_ON" +#line 1361 "seclang-parser.yy" + { driver.error(yystack_[2].location, "SecInterceptOnError is not yet supported."); YYERROR; } -#line 2462 "seclang-parser.cc" // lalr1.cc:919 +#line 2708 "seclang-parser.cc" break; - case 108: -#line 1338 "seclang-parser.yy" // lalr1.cc:919 - { + case 109: // expression: "CONFIG_SEC_INTERCEPT_ON_ERROR" "CONFIG_VALUE_OFF" +#line 1366 "seclang-parser.yy" + { } -#line 2469 "seclang-parser.cc" // lalr1.cc:919 +#line 2715 "seclang-parser.cc" break; - case 109: -#line 1341 "seclang-parser.yy" // lalr1.cc:919 - { + case 110: // expression: "CONFIG_SEC_CONN_R_STATE_LIMIT" +#line 1369 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecConnReadStateLimit is not yet supported."); YYERROR; } -#line 2478 "seclang-parser.cc" // lalr1.cc:919 +#line 2724 "seclang-parser.cc" break; - case 110: -#line 1346 "seclang-parser.yy" // lalr1.cc:919 - { + case 111: // expression: "CONFIG_SEC_CONN_W_STATE_LIMIT" +#line 1374 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecConnWriteStateLimit is not yet supported."); YYERROR; } -#line 2487 "seclang-parser.cc" // lalr1.cc:919 +#line 2733 "seclang-parser.cc" break; - case 111: -#line 1351 "seclang-parser.yy" // lalr1.cc:919 - { + case 112: // expression: "CONFIG_SEC_SENSOR_ID" +#line 1379 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecSensorId is not yet supported."); YYERROR; } -#line 2496 "seclang-parser.cc" // lalr1.cc:919 +#line 2742 "seclang-parser.cc" break; - case 112: -#line 1356 "seclang-parser.yy" // lalr1.cc:919 - { + case 113: // expression: "CONFIG_SEC_RULE_INHERITANCE" "CONFIG_VALUE_ON" +#line 1384 "seclang-parser.yy" + { driver.error(yystack_[2].location, "SecRuleInheritance is not yet supported."); YYERROR; } -#line 2505 "seclang-parser.cc" // lalr1.cc:919 +#line 2751 "seclang-parser.cc" break; - case 113: -#line 1361 "seclang-parser.yy" // lalr1.cc:919 - { + case 114: // expression: "CONFIG_SEC_RULE_INHERITANCE" "CONFIG_VALUE_OFF" +#line 1389 "seclang-parser.yy" + { } -#line 2512 "seclang-parser.cc" // lalr1.cc:919 +#line 2758 "seclang-parser.cc" break; - case 114: -#line 1364 "seclang-parser.yy" // lalr1.cc:919 - { + case 115: // expression: "CONFIG_SEC_RULE_PERF_TIME" +#line 1392 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecRulePerfTime is not yet supported."); YYERROR; } -#line 2521 "seclang-parser.cc" // lalr1.cc:919 +#line 2767 "seclang-parser.cc" break; - case 115: -#line 1369 "seclang-parser.yy" // lalr1.cc:919 - { + case 116: // expression: "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" +#line 1397 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecStreamInBodyInspection is not supported."); YYERROR; } -#line 2530 "seclang-parser.cc" // lalr1.cc:919 +#line 2776 "seclang-parser.cc" break; - case 116: -#line 1374 "seclang-parser.yy" // lalr1.cc:919 - { + case 117: // expression: "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" +#line 1402 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecStreamOutBodyInspection is not supported."); YYERROR; } -#line 2539 "seclang-parser.cc" // lalr1.cc:919 +#line 2785 "seclang-parser.cc" break; - case 117: -#line 1379 "seclang-parser.yy" // lalr1.cc:919 - { + case 118: // expression: "CONFIG_SEC_RULE_REMOVE_BY_ID" +#line 1407 "seclang-parser.yy" + { std::string error; if (driver.m_exceptions.load(yystack_[0].value.as < std::string > (), &error) == false) { std::stringstream ss; @@ -2552,12 +2798,12 @@ namespace yy { YYERROR; } } -#line 2556 "seclang-parser.cc" // lalr1.cc:919 +#line 2802 "seclang-parser.cc" break; - case 118: -#line 1392 "seclang-parser.yy" // lalr1.cc:919 - { + case 119: // expression: "CONFIG_SEC_RULE_REMOVE_BY_TAG" +#line 1420 "seclang-parser.yy" + { std::string error; if (driver.m_exceptions.loadRemoveRuleByTag(yystack_[0].value.as < std::string > (), &error) == false) { std::stringstream ss; @@ -2569,12 +2815,12 @@ namespace yy { YYERROR; } } -#line 2573 "seclang-parser.cc" // lalr1.cc:919 +#line 2819 "seclang-parser.cc" break; - case 119: -#line 1405 "seclang-parser.yy" // lalr1.cc:919 - { + case 120: // expression: "CONFIG_SEC_RULE_REMOVE_BY_MSG" +#line 1433 "seclang-parser.yy" + { std::string error; if (driver.m_exceptions.loadRemoveRuleByMsg(yystack_[0].value.as < std::string > (), &error) == false) { std::stringstream ss; @@ -2586,12 +2832,12 @@ namespace yy { YYERROR; } } -#line 2590 "seclang-parser.cc" // lalr1.cc:919 +#line 2836 "seclang-parser.cc" break; - case 120: -#line 1418 "seclang-parser.yy" // lalr1.cc:919 - { + case 121: // expression: "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" variables_pre_process +#line 1446 "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; @@ -2603,12 +2849,12 @@ namespace yy { YYERROR; } } -#line 2607 "seclang-parser.cc" // lalr1.cc:919 +#line 2853 "seclang-parser.cc" break; - case 121: -#line 1431 "seclang-parser.yy" // lalr1.cc:919 - { + case 122: // expression: "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" variables_pre_process +#line 1459 "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; @@ -2620,12 +2866,12 @@ namespace yy { YYERROR; } } -#line 2624 "seclang-parser.cc" // lalr1.cc:919 +#line 2870 "seclang-parser.cc" break; - case 122: -#line 1444 "seclang-parser.yy" // lalr1.cc:919 - { + case 123: // expression: "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" variables_pre_process +#line 1472 "seclang-parser.yy" + { std::string error; double ruleId; try { @@ -2650,12 +2896,12 @@ namespace yy { YYERROR; } } -#line 2654 "seclang-parser.cc" // lalr1.cc:919 +#line 2900 "seclang-parser.cc" break; - case 123: -#line 1470 "seclang-parser.yy" // lalr1.cc:919 - { + case 124: // expression: "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" actions +#line 1498 "seclang-parser.yy" + { std::string error; double ruleId; try { @@ -2681,12 +2927,12 @@ namespace yy { YYERROR; } } -#line 2685 "seclang-parser.cc" // lalr1.cc:919 +#line 2931 "seclang-parser.cc" break; - case 124: -#line 1498 "seclang-parser.yy" // lalr1.cc:919 - { + case 125: // expression: "CONFIG_DIR_DEBUG_LVL" +#line 1526 "seclang-parser.yy" + { if (driver.m_debugLog != NULL) { driver.m_debugLog->setDebugLogLevel(atoi(yystack_[0].value.as < std::string > ().c_str())); } else { @@ -2697,12 +2943,12 @@ namespace yy { YYERROR; } } -#line 2701 "seclang-parser.cc" // lalr1.cc:919 +#line 2947 "seclang-parser.cc" break; - case 125: -#line 1510 "seclang-parser.yy" // lalr1.cc:919 - { + case 126: // expression: "CONFIG_DIR_DEBUG_LOG" +#line 1538 "seclang-parser.yy" + { if (driver.m_debugLog != NULL) { std::string error; driver.m_debugLog->setDebugLogFile(yystack_[0].value.as < std::string > (), &error); @@ -2720,12 +2966,12 @@ namespace yy { YYERROR; } } -#line 2724 "seclang-parser.cc" // lalr1.cc:919 +#line 2970 "seclang-parser.cc" break; - case 126: -#line 1530 "seclang-parser.yy" // lalr1.cc:919 - { + case 127: // expression: "CONFIG_DIR_GEO_DB" +#line 1558 "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 > (), @@ -2751,30 +2997,48 @@ namespace yy { YYERROR; #endif // WITH_GEOIP } -#line 2755 "seclang-parser.cc" // lalr1.cc:919 +#line 3001 "seclang-parser.cc" break; - case 127: -#line 1558 "seclang-parser.yy" // lalr1.cc:919 - { + case 128: // expression: "CONFIG_DIR_ARGS_LIMIT" +#line 1585 "seclang-parser.yy" + { + driver.m_argumentsLimit.m_set = true; + driver.m_argumentsLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); + } +#line 3010 "seclang-parser.cc" + break; + + case 129: // expression: "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" +#line 1590 "seclang-parser.yy" + { + driver.m_requestBodyJsonDepthLimit.m_set = true; + driver.m_requestBodyJsonDepthLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); + } +#line 3019 "seclang-parser.cc" + break; + + case 130: // expression: "CONFIG_DIR_REQ_BODY_LIMIT" +#line 1596 "seclang-parser.yy" + { driver.m_requestBodyLimit.m_set = true; driver.m_requestBodyLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); } -#line 2764 "seclang-parser.cc" // lalr1.cc:919 +#line 3028 "seclang-parser.cc" break; - case 128: -#line 1563 "seclang-parser.yy" // lalr1.cc:919 - { + case 131: // expression: "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" +#line 1601 "seclang-parser.yy" + { driver.m_requestBodyNoFilesLimit.m_set = true; driver.m_requestBodyNoFilesLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); } -#line 2773 "seclang-parser.cc" // lalr1.cc:919 +#line 3037 "seclang-parser.cc" break; - case 129: -#line 1568 "seclang-parser.yy" // lalr1.cc:919 - { + case 132: // expression: "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" +#line 1606 "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 "; @@ -2782,69 +3046,69 @@ namespace yy { driver.error(yystack_[1].location, ss.str()); YYERROR; } -#line 2786 "seclang-parser.cc" // lalr1.cc:919 +#line 3050 "seclang-parser.cc" break; - case 130: -#line 1577 "seclang-parser.yy" // lalr1.cc:919 - { + case 133: // expression: "CONFIG_DIR_RES_BODY_LIMIT" +#line 1615 "seclang-parser.yy" + { driver.m_responseBodyLimit.m_set = true; driver.m_responseBodyLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); } -#line 2795 "seclang-parser.cc" // lalr1.cc:919 +#line 3059 "seclang-parser.cc" break; - case 131: -#line 1582 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_requestBodyLimitAction = modsecurity::Rules::BodyLimitAction::ProcessPartialBodyLimitAction; + case 134: // expression: "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" "CONFIG_VALUE_PROCESS_PARTIAL" +#line 1620 "seclang-parser.yy" + { + driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction; } -#line 2803 "seclang-parser.cc" // lalr1.cc:919 +#line 3067 "seclang-parser.cc" break; - case 132: -#line 1586 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_requestBodyLimitAction = modsecurity::Rules::BodyLimitAction::RejectBodyLimitAction; + case 135: // expression: "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" "CONFIG_VALUE_REJECT" +#line 1624 "seclang-parser.yy" + { + driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction; } -#line 2811 "seclang-parser.cc" // lalr1.cc:919 +#line 3075 "seclang-parser.cc" break; - case 133: -#line 1590 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_responseBodyLimitAction = modsecurity::Rules::BodyLimitAction::ProcessPartialBodyLimitAction; + case 136: // expression: "CONFIG_DIR_RES_BODY_LIMIT_ACTION" "CONFIG_VALUE_PROCESS_PARTIAL" +#line 1628 "seclang-parser.yy" + { + driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction; } -#line 2819 "seclang-parser.cc" // lalr1.cc:919 +#line 3083 "seclang-parser.cc" break; - case 134: -#line 1594 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_responseBodyLimitAction = modsecurity::Rules::BodyLimitAction::RejectBodyLimitAction; + case 137: // expression: "CONFIG_DIR_RES_BODY_LIMIT_ACTION" "CONFIG_VALUE_REJECT" +#line 1632 "seclang-parser.yy" + { + driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction; } -#line 2827 "seclang-parser.cc" // lalr1.cc:919 +#line 3091 "seclang-parser.cc" break; - case 135: -#line 1598 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_remoteRulesActionOnFailed = Rules::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction; + case 138: // expression: "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" "CONFIG_VALUE_ABORT" +#line 1636 "seclang-parser.yy" + { + driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction; } -#line 2835 "seclang-parser.cc" // lalr1.cc:919 +#line 3099 "seclang-parser.cc" break; - case 136: -#line 1602 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_remoteRulesActionOnFailed = Rules::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction; + case 139: // expression: "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" "CONFIG_VALUE_WARN" +#line 1640 "seclang-parser.yy" + { + driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction; } -#line 2843 "seclang-parser.cc" // lalr1.cc:919 +#line 3107 "seclang-parser.cc" break; - case 139: -#line 1616 "seclang-parser.yy" // lalr1.cc:919 - { + case 142: // expression: "CONGIG_DIR_RESPONSE_BODY_MP" +#line 1654 "seclang-parser.yy" + { std::istringstream buf(yystack_[0].value.as < std::string > ()); std::istream_iterator beg(buf), end; std::set tokens(beg, end); @@ -2855,38 +3119,38 @@ namespace yy { driver.m_responseBodyTypeToBeInspected.m_value.insert(*it); } } -#line 2859 "seclang-parser.cc" // lalr1.cc:919 +#line 3123 "seclang-parser.cc" break; - case 140: -#line 1628 "seclang-parser.yy" // lalr1.cc:919 - { + case 143: // expression: "CONGIG_DIR_RESPONSE_BODY_MP_CLEAR" +#line 1666 "seclang-parser.yy" + { driver.m_responseBodyTypeToBeInspected.m_set = true; driver.m_responseBodyTypeToBeInspected.m_clear = true; driver.m_responseBodyTypeToBeInspected.m_value.clear(); } -#line 2869 "seclang-parser.cc" // lalr1.cc:919 +#line 3133 "seclang-parser.cc" break; - case 141: -#line 1634 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_secXMLExternalEntity = modsecurity::RulesProperties::FalseConfigBoolean; + case 144: // expression: "CONFIG_XML_EXTERNAL_ENTITY" "CONFIG_VALUE_OFF" +#line 1672 "seclang-parser.yy" + { + driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::FalseConfigBoolean; } -#line 2877 "seclang-parser.cc" // lalr1.cc:919 +#line 3141 "seclang-parser.cc" break; - case 142: -#line 1638 "seclang-parser.yy" // lalr1.cc:919 - { - driver.m_secXMLExternalEntity = modsecurity::RulesProperties::TrueConfigBoolean; + case 145: // expression: "CONFIG_XML_EXTERNAL_ENTITY" "CONFIG_VALUE_ON" +#line 1676 "seclang-parser.yy" + { + driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::TrueConfigBoolean; } -#line 2885 "seclang-parser.cc" // lalr1.cc:919 +#line 3149 "seclang-parser.cc" break; - case 143: -#line 1642 "seclang-parser.yy" // lalr1.cc:919 - { + case 146: // expression: "CONGIG_DIR_SEC_TMP_DIR" +#line 1680 "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."; @@ -2896,32 +3160,32 @@ namespace yy { YYERROR; */ } -#line 2900 "seclang-parser.cc" // lalr1.cc:919 +#line 3164 "seclang-parser.cc" break; - case 146: -#line 1663 "seclang-parser.yy" // lalr1.cc:919 - { + case 149: // expression: "CONGIG_DIR_SEC_COOKIE_FORMAT" +#line 1701 "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 2911 "seclang-parser.cc" // lalr1.cc:919 +#line 3175 "seclang-parser.cc" break; - case 147: -#line 1670 "seclang-parser.yy" // lalr1.cc:919 - { + case 150: // expression: "CONFIG_SEC_COOKIEV0_SEPARATOR" +#line 1708 "seclang-parser.yy" + { driver.error(yystack_[1].location, "SecCookieV0Separator is not yet supported."); YYERROR; } -#line 2920 "seclang-parser.cc" // lalr1.cc:919 +#line 3184 "seclang-parser.cc" break; - case 149: -#line 1680 "seclang-parser.yy" // lalr1.cc:919 - { + case 152: // expression: "CONFIG_DIR_UNICODE_MAP_FILE" +#line 1718 "seclang-parser.yy" + { std::string error; std::vector param; double num = 0; @@ -2974,32 +3238,32 @@ namespace yy { } } -#line 2978 "seclang-parser.cc" // lalr1.cc:919 +#line 3242 "seclang-parser.cc" break; - case 150: -#line 1734 "seclang-parser.yy" // lalr1.cc:919 - { + case 153: // expression: "CONFIG_SEC_COLLECTION_TIMEOUT" +#line 1772 "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 2989 "seclang-parser.cc" // lalr1.cc:919 +#line 3253 "seclang-parser.cc" break; - case 151: -#line 1741 "seclang-parser.yy" // lalr1.cc:919 - { + case 154: // expression: "CONFIG_SEC_HTTP_BLKEY" +#line 1779 "seclang-parser.yy" + { driver.m_httpblKey.m_set = true; driver.m_httpblKey.m_value = yystack_[0].value.as < std::string > (); } -#line 2998 "seclang-parser.cc" // lalr1.cc:919 +#line 3262 "seclang-parser.cc" break; - case 152: -#line 1749 "seclang-parser.yy" // lalr1.cc:919 - { + case 155: // variables: variables_pre_process +#line 1787 "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>()); @@ -3032,2363 +3296,2387 @@ namespace yy { } yylhs.value.as < std::unique_ptr > > > () = std::move(newNewList); } -#line 3036 "seclang-parser.cc" // lalr1.cc:919 +#line 3300 "seclang-parser.cc" break; - case 153: -#line 1786 "seclang-parser.yy" // lalr1.cc:919 - { + case 156: // variables_pre_process: variables_may_be_quoted +#line 1824 "seclang-parser.yy" + { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[0].value.as < std::unique_ptr > > > ()); } -#line 3044 "seclang-parser.cc" // lalr1.cc:919 +#line 3308 "seclang-parser.cc" break; - case 154: -#line 1790 "seclang-parser.yy" // lalr1.cc:919 - { + case 157: // variables_pre_process: "QUOTATION_MARK" variables_may_be_quoted "QUOTATION_MARK" +#line 1828 "seclang-parser.yy" + { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[1].value.as < std::unique_ptr > > > ()); } -#line 3052 "seclang-parser.cc" // lalr1.cc:919 +#line 3316 "seclang-parser.cc" break; - case 155: -#line 1797 "seclang-parser.yy" // lalr1.cc:919 - { + case 158: // variables_may_be_quoted: variables_may_be_quoted PIPE var +#line 1835 "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 3061 "seclang-parser.cc" // lalr1.cc:919 +#line 3325 "seclang-parser.cc" break; - case 156: -#line 1802 "seclang-parser.yy" // lalr1.cc:919 - { + case 159: // variables_may_be_quoted: variables_may_be_quoted PIPE VAR_EXCLUSION var +#line 1840 "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 3071 "seclang-parser.cc" // lalr1.cc:919 +#line 3335 "seclang-parser.cc" break; - case 157: -#line 1808 "seclang-parser.yy" // lalr1.cc:919 - { + case 160: // variables_may_be_quoted: variables_may_be_quoted PIPE VAR_COUNT var +#line 1846 "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 3081 "seclang-parser.cc" // lalr1.cc:919 +#line 3345 "seclang-parser.cc" break; - case 158: -#line 1814 "seclang-parser.yy" // lalr1.cc:919 - { + case 161: // variables_may_be_quoted: var +#line 1852 "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 3091 "seclang-parser.cc" // lalr1.cc:919 +#line 3355 "seclang-parser.cc" break; - case 159: -#line 1820 "seclang-parser.yy" // lalr1.cc:919 - { + case 162: // variables_may_be_quoted: VAR_EXCLUSION var +#line 1858 "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 3102 "seclang-parser.cc" // lalr1.cc:919 +#line 3366 "seclang-parser.cc" break; - case 160: -#line 1827 "seclang-parser.yy" // lalr1.cc:919 - { + case 163: // variables_may_be_quoted: VAR_COUNT var +#line 1865 "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 3113 "seclang-parser.cc" // lalr1.cc:919 +#line 3377 "seclang-parser.cc" break; - case 161: -#line 1837 "seclang-parser.yy" // lalr1.cc:919 - { + case 164: // var: VARIABLE_ARGS "Dictionary element" +#line 1875 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3121 "seclang-parser.cc" // lalr1.cc:919 +#line 3385 "seclang-parser.cc" break; - case 162: -#line 1841 "seclang-parser.yy" // lalr1.cc:919 - { + case 165: // var: VARIABLE_ARGS "Dictionary element, selected by regexp" +#line 1879 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3129 "seclang-parser.cc" // lalr1.cc:919 +#line 3393 "seclang-parser.cc" break; - case 163: -#line 1845 "seclang-parser.yy" // lalr1.cc:919 - { + case 166: // var: VARIABLE_ARGS +#line 1883 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_NoDictElement()); } -#line 3137 "seclang-parser.cc" // lalr1.cc:919 +#line 3401 "seclang-parser.cc" break; - case 164: -#line 1849 "seclang-parser.yy" // lalr1.cc:919 - { + case 167: // var: VARIABLE_ARGS_POST "Dictionary element" +#line 1887 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3145 "seclang-parser.cc" // lalr1.cc:919 +#line 3409 "seclang-parser.cc" break; - case 165: -#line 1853 "seclang-parser.yy" // lalr1.cc:919 - { + case 168: // var: VARIABLE_ARGS_POST "Dictionary element, selected by regexp" +#line 1891 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3153 "seclang-parser.cc" // lalr1.cc:919 +#line 3417 "seclang-parser.cc" break; - case 166: -#line 1857 "seclang-parser.yy" // lalr1.cc:919 - { + case 169: // var: VARIABLE_ARGS_POST +#line 1895 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_NoDictElement()); } -#line 3161 "seclang-parser.cc" // lalr1.cc:919 +#line 3425 "seclang-parser.cc" break; - case 167: -#line 1861 "seclang-parser.yy" // lalr1.cc:919 - { + case 170: // var: VARIABLE_ARGS_GET "Dictionary element" +#line 1899 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3169 "seclang-parser.cc" // lalr1.cc:919 +#line 3433 "seclang-parser.cc" break; - case 168: -#line 1865 "seclang-parser.yy" // lalr1.cc:919 - { + case 171: // var: VARIABLE_ARGS_GET "Dictionary element, selected by regexp" +#line 1903 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3177 "seclang-parser.cc" // lalr1.cc:919 +#line 3441 "seclang-parser.cc" break; - case 169: -#line 1869 "seclang-parser.yy" // lalr1.cc:919 - { + case 172: // var: VARIABLE_ARGS_GET +#line 1907 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_NoDictElement()); } -#line 3185 "seclang-parser.cc" // lalr1.cc:919 +#line 3449 "seclang-parser.cc" break; - case 170: -#line 1873 "seclang-parser.yy" // lalr1.cc:919 - { + case 173: // var: VARIABLE_FILES_SIZES "Dictionary element" +#line 1911 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3193 "seclang-parser.cc" // lalr1.cc:919 +#line 3457 "seclang-parser.cc" break; - case 171: -#line 1877 "seclang-parser.yy" // lalr1.cc:919 - { + case 174: // var: VARIABLE_FILES_SIZES "Dictionary element, selected by regexp" +#line 1915 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3201 "seclang-parser.cc" // lalr1.cc:919 +#line 3465 "seclang-parser.cc" break; - case 172: -#line 1881 "seclang-parser.yy" // lalr1.cc:919 - { + case 175: // var: VARIABLE_FILES_SIZES +#line 1919 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_NoDictElement()); } -#line 3209 "seclang-parser.cc" // lalr1.cc:919 +#line 3473 "seclang-parser.cc" break; - case 173: -#line 1885 "seclang-parser.yy" // lalr1.cc:919 - { + case 176: // var: VARIABLE_FILES_NAMES "Dictionary element" +#line 1923 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3217 "seclang-parser.cc" // lalr1.cc:919 +#line 3481 "seclang-parser.cc" break; - case 174: -#line 1889 "seclang-parser.yy" // lalr1.cc:919 - { + case 177: // var: VARIABLE_FILES_NAMES "Dictionary element, selected by regexp" +#line 1927 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3225 "seclang-parser.cc" // lalr1.cc:919 +#line 3489 "seclang-parser.cc" break; - case 175: -#line 1893 "seclang-parser.yy" // lalr1.cc:919 - { + case 178: // var: VARIABLE_FILES_NAMES +#line 1931 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_NoDictElement()); } -#line 3233 "seclang-parser.cc" // lalr1.cc:919 +#line 3497 "seclang-parser.cc" break; - case 176: -#line 1897 "seclang-parser.yy" // lalr1.cc:919 - { + case 179: // var: VARIABLE_FILES_TMP_CONTENT "Dictionary element" +#line 1935 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3241 "seclang-parser.cc" // lalr1.cc:919 +#line 3505 "seclang-parser.cc" break; - case 177: -#line 1901 "seclang-parser.yy" // lalr1.cc:919 - { + case 180: // var: VARIABLE_FILES_TMP_CONTENT "Dictionary element, selected by regexp" +#line 1939 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3249 "seclang-parser.cc" // lalr1.cc:919 +#line 3513 "seclang-parser.cc" break; - case 178: -#line 1905 "seclang-parser.yy" // lalr1.cc:919 - { + case 181: // var: VARIABLE_FILES_TMP_CONTENT +#line 1943 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_NoDictElement()); } -#line 3257 "seclang-parser.cc" // lalr1.cc:919 +#line 3521 "seclang-parser.cc" break; - case 179: -#line 1909 "seclang-parser.yy" // lalr1.cc:919 - { + case 182: // var: VARIABLE_MULTIPART_FILENAME "Dictionary element" +#line 1947 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3265 "seclang-parser.cc" // lalr1.cc:919 +#line 3529 "seclang-parser.cc" break; - case 180: -#line 1913 "seclang-parser.yy" // lalr1.cc:919 - { + case 183: // var: VARIABLE_MULTIPART_FILENAME "Dictionary element, selected by regexp" +#line 1951 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3273 "seclang-parser.cc" // lalr1.cc:919 +#line 3537 "seclang-parser.cc" break; - case 181: -#line 1917 "seclang-parser.yy" // lalr1.cc:919 - { + case 184: // var: VARIABLE_MULTIPART_FILENAME +#line 1955 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_NoDictElement()); } -#line 3281 "seclang-parser.cc" // lalr1.cc:919 +#line 3545 "seclang-parser.cc" break; - case 182: -#line 1921 "seclang-parser.yy" // lalr1.cc:919 - { + case 185: // var: VARIABLE_MULTIPART_NAME "Dictionary element" +#line 1959 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3289 "seclang-parser.cc" // lalr1.cc:919 +#line 3553 "seclang-parser.cc" break; - case 183: -#line 1925 "seclang-parser.yy" // lalr1.cc:919 - { + case 186: // var: VARIABLE_MULTIPART_NAME "Dictionary element, selected by regexp" +#line 1963 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3297 "seclang-parser.cc" // lalr1.cc:919 +#line 3561 "seclang-parser.cc" break; - case 184: -#line 1929 "seclang-parser.yy" // lalr1.cc:919 - { + case 187: // var: VARIABLE_MULTIPART_NAME +#line 1967 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_NoDictElement()); } -#line 3305 "seclang-parser.cc" // lalr1.cc:919 +#line 3569 "seclang-parser.cc" break; - case 185: -#line 1933 "seclang-parser.yy" // lalr1.cc:919 - { + case 188: // var: VARIABLE_MATCHED_VARS_NAMES "Dictionary element" +#line 1971 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3313 "seclang-parser.cc" // lalr1.cc:919 +#line 3577 "seclang-parser.cc" break; - case 186: -#line 1937 "seclang-parser.yy" // lalr1.cc:919 - { + case 189: // var: VARIABLE_MATCHED_VARS_NAMES "Dictionary element, selected by regexp" +#line 1975 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3321 "seclang-parser.cc" // lalr1.cc:919 +#line 3585 "seclang-parser.cc" break; - case 187: -#line 1941 "seclang-parser.yy" // lalr1.cc:919 - { + case 190: // var: VARIABLE_MATCHED_VARS_NAMES +#line 1979 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_NoDictElement()); } -#line 3329 "seclang-parser.cc" // lalr1.cc:919 +#line 3593 "seclang-parser.cc" break; - case 188: -#line 1945 "seclang-parser.yy" // lalr1.cc:919 - { + case 191: // var: VARIABLE_MATCHED_VARS "Dictionary element" +#line 1983 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3337 "seclang-parser.cc" // lalr1.cc:919 +#line 3601 "seclang-parser.cc" break; - case 189: -#line 1949 "seclang-parser.yy" // lalr1.cc:919 - { + case 192: // var: VARIABLE_MATCHED_VARS "Dictionary element, selected by regexp" +#line 1987 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3345 "seclang-parser.cc" // lalr1.cc:919 +#line 3609 "seclang-parser.cc" break; - case 190: -#line 1953 "seclang-parser.yy" // lalr1.cc:919 - { + case 193: // var: VARIABLE_MATCHED_VARS +#line 1991 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_NoDictElement()); } -#line 3353 "seclang-parser.cc" // lalr1.cc:919 +#line 3617 "seclang-parser.cc" break; - case 191: -#line 1957 "seclang-parser.yy" // lalr1.cc:919 - { + case 194: // var: VARIABLE_FILES "Dictionary element" +#line 1995 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3361 "seclang-parser.cc" // lalr1.cc:919 +#line 3625 "seclang-parser.cc" break; - case 192: -#line 1961 "seclang-parser.yy" // lalr1.cc:919 - { + case 195: // var: VARIABLE_FILES "Dictionary element, selected by regexp" +#line 1999 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3369 "seclang-parser.cc" // lalr1.cc:919 +#line 3633 "seclang-parser.cc" break; - case 193: -#line 1965 "seclang-parser.yy" // lalr1.cc:919 - { + case 196: // var: VARIABLE_FILES +#line 2003 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_NoDictElement()); } -#line 3377 "seclang-parser.cc" // lalr1.cc:919 +#line 3641 "seclang-parser.cc" break; - case 194: -#line 1969 "seclang-parser.yy" // lalr1.cc:919 - { + case 197: // var: VARIABLE_REQUEST_COOKIES "Dictionary element" +#line 2007 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3385 "seclang-parser.cc" // lalr1.cc:919 +#line 3649 "seclang-parser.cc" break; - case 195: -#line 1973 "seclang-parser.yy" // lalr1.cc:919 - { + case 198: // var: VARIABLE_REQUEST_COOKIES "Dictionary element, selected by regexp" +#line 2011 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3393 "seclang-parser.cc" // lalr1.cc:919 +#line 3657 "seclang-parser.cc" break; - case 196: -#line 1977 "seclang-parser.yy" // lalr1.cc:919 - { + case 199: // var: VARIABLE_REQUEST_COOKIES +#line 2015 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_NoDictElement()); } -#line 3401 "seclang-parser.cc" // lalr1.cc:919 +#line 3665 "seclang-parser.cc" break; - case 197: -#line 1981 "seclang-parser.yy" // lalr1.cc:919 - { + case 200: // var: VARIABLE_REQUEST_HEADERS "Dictionary element" +#line 2019 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3409 "seclang-parser.cc" // lalr1.cc:919 +#line 3673 "seclang-parser.cc" break; - case 198: -#line 1985 "seclang-parser.yy" // lalr1.cc:919 - { + case 201: // var: VARIABLE_REQUEST_HEADERS "Dictionary element, selected by regexp" +#line 2023 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3417 "seclang-parser.cc" // lalr1.cc:919 +#line 3681 "seclang-parser.cc" break; - case 199: -#line 1989 "seclang-parser.yy" // lalr1.cc:919 - { + case 202: // var: VARIABLE_REQUEST_HEADERS +#line 2027 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_NoDictElement()); } -#line 3425 "seclang-parser.cc" // lalr1.cc:919 +#line 3689 "seclang-parser.cc" break; - case 200: -#line 1993 "seclang-parser.yy" // lalr1.cc:919 - { + case 203: // var: VARIABLE_RESPONSE_HEADERS "Dictionary element" +#line 2031 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeaders_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3433 "seclang-parser.cc" // lalr1.cc:919 +#line 3697 "seclang-parser.cc" break; - case 201: -#line 1997 "seclang-parser.yy" // lalr1.cc:919 - { + case 204: // var: VARIABLE_RESPONSE_HEADERS "Dictionary element, selected by regexp" +#line 2035 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeaders_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3441 "seclang-parser.cc" // lalr1.cc:919 +#line 3705 "seclang-parser.cc" break; - case 202: -#line 2001 "seclang-parser.yy" // lalr1.cc:919 - { + case 205: // var: VARIABLE_RESPONSE_HEADERS +#line 2039 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeaders_NoDictElement()); } -#line 3449 "seclang-parser.cc" // lalr1.cc:919 +#line 3713 "seclang-parser.cc" break; - case 203: -#line 2005 "seclang-parser.yy" // lalr1.cc:919 - { + case 206: // var: VARIABLE_GEO "Dictionary element" +#line 2043 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Geo_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3457 "seclang-parser.cc" // lalr1.cc:919 +#line 3721 "seclang-parser.cc" break; - case 204: -#line 2009 "seclang-parser.yy" // lalr1.cc:919 - { + case 207: // var: VARIABLE_GEO "Dictionary element, selected by regexp" +#line 2047 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Geo_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3465 "seclang-parser.cc" // lalr1.cc:919 +#line 3729 "seclang-parser.cc" break; - case 205: -#line 2013 "seclang-parser.yy" // lalr1.cc:919 - { + case 208: // var: VARIABLE_GEO +#line 2051 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Geo_NoDictElement()); } -#line 3473 "seclang-parser.cc" // lalr1.cc:919 +#line 3737 "seclang-parser.cc" break; - case 206: -#line 2017 "seclang-parser.yy" // lalr1.cc:919 - { + case 209: // var: VARIABLE_REQUEST_COOKIES_NAMES "Dictionary element" +#line 2055 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookiesNames_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3481 "seclang-parser.cc" // lalr1.cc:919 +#line 3745 "seclang-parser.cc" break; - case 207: -#line 2021 "seclang-parser.yy" // lalr1.cc:919 - { + case 210: // var: VARIABLE_REQUEST_COOKIES_NAMES "Dictionary element, selected by regexp" +#line 2059 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookiesNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3489 "seclang-parser.cc" // lalr1.cc:919 +#line 3753 "seclang-parser.cc" break; - case 208: -#line 2025 "seclang-parser.yy" // lalr1.cc:919 - { + case 211: // var: VARIABLE_REQUEST_COOKIES_NAMES +#line 2063 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookiesNames_NoDictElement()); } -#line 3497 "seclang-parser.cc" // lalr1.cc:919 +#line 3761 "seclang-parser.cc" break; - case 209: -#line 2029 "seclang-parser.yy" // lalr1.cc:919 - { + case 212: // var: VARIABLE_MULTIPART_PART_HEADERS "Dictionary element" +#line 2067 "seclang-parser.yy" + { + VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartPartHeaders_DictElement(yystack_[0].value.as < std::string > ())); + } +#line 3769 "seclang-parser.cc" + break; + + case 213: // var: VARIABLE_MULTIPART_PART_HEADERS "Dictionary element, selected by regexp" +#line 2071 "seclang-parser.yy" + { + VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartPartHeaders_DictElementRegexp(yystack_[0].value.as < std::string > ())); + } +#line 3777 "seclang-parser.cc" + break; + + case 214: // var: VARIABLE_MULTIPART_PART_HEADERS +#line 2075 "seclang-parser.yy" + { + VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartPartHeaders_NoDictElement()); + } +#line 3785 "seclang-parser.cc" + break; + + case 215: // var: VARIABLE_RULE "Dictionary element" +#line 2079 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Rule_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3505 "seclang-parser.cc" // lalr1.cc:919 +#line 3793 "seclang-parser.cc" break; - case 210: -#line 2033 "seclang-parser.yy" // lalr1.cc:919 - { + case 216: // var: VARIABLE_RULE "Dictionary element, selected by regexp" +#line 2083 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Rule_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3513 "seclang-parser.cc" // lalr1.cc:919 +#line 3801 "seclang-parser.cc" break; - case 211: -#line 2037 "seclang-parser.yy" // lalr1.cc:919 - { + case 217: // var: VARIABLE_RULE +#line 2087 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Rule_NoDictElement()); } -#line 3521 "seclang-parser.cc" // lalr1.cc:919 +#line 3809 "seclang-parser.cc" break; - case 212: -#line 2041 "seclang-parser.yy" // lalr1.cc:919 - { + case 218: // var: "RUN_TIME_VAR_ENV" "Dictionary element" +#line 2091 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Env("ENV:" + yystack_[0].value.as < std::string > ())); } -#line 3529 "seclang-parser.cc" // lalr1.cc:919 +#line 3817 "seclang-parser.cc" break; - case 213: -#line 2045 "seclang-parser.yy" // lalr1.cc:919 - { + case 219: // var: "RUN_TIME_VAR_ENV" "Dictionary element, selected by regexp" +#line 2095 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Env("ENV:" + yystack_[0].value.as < std::string > ())); } -#line 3537 "seclang-parser.cc" // lalr1.cc:919 +#line 3825 "seclang-parser.cc" break; - case 214: -#line 2049 "seclang-parser.yy" // lalr1.cc:919 - { + case 220: // var: "RUN_TIME_VAR_ENV" +#line 2099 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Env("ENV")); } -#line 3545 "seclang-parser.cc" // lalr1.cc:919 +#line 3833 "seclang-parser.cc" break; - case 215: -#line 2053 "seclang-parser.yy" // lalr1.cc:919 - { + case 221: // var: "RUN_TIME_VAR_XML" "Dictionary element" +#line 2103 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::XML("XML:" + yystack_[0].value.as < std::string > ())); } -#line 3553 "seclang-parser.cc" // lalr1.cc:919 +#line 3841 "seclang-parser.cc" break; - case 216: -#line 2057 "seclang-parser.yy" // lalr1.cc:919 - { + case 222: // var: "RUN_TIME_VAR_XML" "Dictionary element, selected by regexp" +#line 2107 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::XML("XML:" + yystack_[0].value.as < std::string > ())); } -#line 3561 "seclang-parser.cc" // lalr1.cc:919 +#line 3849 "seclang-parser.cc" break; - case 217: -#line 2061 "seclang-parser.yy" // lalr1.cc:919 - { + case 223: // var: "RUN_TIME_VAR_XML" +#line 2111 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::XML_NoDictElement()); } -#line 3569 "seclang-parser.cc" // lalr1.cc:919 +#line 3857 "seclang-parser.cc" break; - case 218: -#line 2065 "seclang-parser.yy" // lalr1.cc:919 - { + case 224: // var: "FILES_TMPNAMES" "Dictionary element" +#line 2115 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpNames_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3577 "seclang-parser.cc" // lalr1.cc:919 +#line 3865 "seclang-parser.cc" break; - case 219: -#line 2069 "seclang-parser.yy" // lalr1.cc:919 - { + case 225: // var: "FILES_TMPNAMES" "Dictionary element, selected by regexp" +#line 2119 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3585 "seclang-parser.cc" // lalr1.cc:919 +#line 3873 "seclang-parser.cc" break; - case 220: -#line 2073 "seclang-parser.yy" // lalr1.cc:919 - { + case 226: // var: "FILES_TMPNAMES" +#line 2123 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpNames_NoDictElement()); } -#line 3593 "seclang-parser.cc" // lalr1.cc:919 +#line 3881 "seclang-parser.cc" break; - case 221: -#line 2077 "seclang-parser.yy" // lalr1.cc:919 - { + case 227: // var: "RESOURCE" run_time_string +#line 2127 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 3601 "seclang-parser.cc" // lalr1.cc:919 +#line 3889 "seclang-parser.cc" break; - case 222: -#line 2081 "seclang-parser.yy" // lalr1.cc:919 - { + case 228: // var: "RESOURCE" "Dictionary element" +#line 2131 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3609 "seclang-parser.cc" // lalr1.cc:919 +#line 3897 "seclang-parser.cc" break; - case 223: -#line 2085 "seclang-parser.yy" // lalr1.cc:919 - { + case 229: // var: "RESOURCE" "Dictionary element, selected by regexp" +#line 2135 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3617 "seclang-parser.cc" // lalr1.cc:919 +#line 3905 "seclang-parser.cc" break; - case 224: -#line 2089 "seclang-parser.yy" // lalr1.cc:919 - { + case 230: // var: "RESOURCE" +#line 2139 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_NoDictElement()); } -#line 3625 "seclang-parser.cc" // lalr1.cc:919 +#line 3913 "seclang-parser.cc" break; - case 225: -#line 2093 "seclang-parser.yy" // lalr1.cc:919 - { + case 231: // var: "VARIABLE_IP" run_time_string +#line 2143 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 3633 "seclang-parser.cc" // lalr1.cc:919 +#line 3921 "seclang-parser.cc" break; - case 226: -#line 2097 "seclang-parser.yy" // lalr1.cc:919 - { + case 232: // var: "VARIABLE_IP" "Dictionary element" +#line 2147 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3641 "seclang-parser.cc" // lalr1.cc:919 +#line 3929 "seclang-parser.cc" break; - case 227: -#line 2101 "seclang-parser.yy" // lalr1.cc:919 - { + case 233: // var: "VARIABLE_IP" "Dictionary element, selected by regexp" +#line 2151 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3649 "seclang-parser.cc" // lalr1.cc:919 +#line 3937 "seclang-parser.cc" break; - case 228: -#line 2105 "seclang-parser.yy" // lalr1.cc:919 - { + case 234: // var: "VARIABLE_IP" +#line 2155 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_NoDictElement()); } -#line 3657 "seclang-parser.cc" // lalr1.cc:919 +#line 3945 "seclang-parser.cc" break; - case 229: -#line 2109 "seclang-parser.yy" // lalr1.cc:919 - { + case 235: // var: "VARIABLE_GLOBAL" run_time_string +#line 2159 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 3665 "seclang-parser.cc" // lalr1.cc:919 +#line 3953 "seclang-parser.cc" break; - case 230: -#line 2113 "seclang-parser.yy" // lalr1.cc:919 - { + case 236: // var: "VARIABLE_GLOBAL" "Dictionary element" +#line 2163 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3673 "seclang-parser.cc" // lalr1.cc:919 +#line 3961 "seclang-parser.cc" break; - case 231: -#line 2117 "seclang-parser.yy" // lalr1.cc:919 - { + case 237: // var: "VARIABLE_GLOBAL" "Dictionary element, selected by regexp" +#line 2167 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3681 "seclang-parser.cc" // lalr1.cc:919 +#line 3969 "seclang-parser.cc" break; - case 232: -#line 2121 "seclang-parser.yy" // lalr1.cc:919 - { + case 238: // var: "VARIABLE_GLOBAL" +#line 2171 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_NoDictElement()); } -#line 3689 "seclang-parser.cc" // lalr1.cc:919 +#line 3977 "seclang-parser.cc" break; - case 233: -#line 2125 "seclang-parser.yy" // lalr1.cc:919 - { + case 239: // var: "VARIABLE_USER" run_time_string +#line 2175 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 3697 "seclang-parser.cc" // lalr1.cc:919 +#line 3985 "seclang-parser.cc" break; - case 234: -#line 2129 "seclang-parser.yy" // lalr1.cc:919 - { + case 240: // var: "VARIABLE_USER" "Dictionary element" +#line 2179 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3705 "seclang-parser.cc" // lalr1.cc:919 +#line 3993 "seclang-parser.cc" break; - case 235: -#line 2133 "seclang-parser.yy" // lalr1.cc:919 - { + case 241: // var: "VARIABLE_USER" "Dictionary element, selected by regexp" +#line 2183 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3713 "seclang-parser.cc" // lalr1.cc:919 +#line 4001 "seclang-parser.cc" break; - case 236: -#line 2137 "seclang-parser.yy" // lalr1.cc:919 - { + case 242: // var: "VARIABLE_USER" +#line 2187 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_NoDictElement()); } -#line 3721 "seclang-parser.cc" // lalr1.cc:919 +#line 4009 "seclang-parser.cc" break; - case 237: -#line 2141 "seclang-parser.yy" // lalr1.cc:919 - { + case 243: // var: "VARIABLE_TX" run_time_string +#line 2191 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 3729 "seclang-parser.cc" // lalr1.cc:919 +#line 4017 "seclang-parser.cc" break; - case 238: -#line 2145 "seclang-parser.yy" // lalr1.cc:919 - { + case 244: // var: "VARIABLE_TX" "Dictionary element" +#line 2195 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3737 "seclang-parser.cc" // lalr1.cc:919 +#line 4025 "seclang-parser.cc" break; - case 239: -#line 2149 "seclang-parser.yy" // lalr1.cc:919 - { + case 245: // var: "VARIABLE_TX" "Dictionary element, selected by regexp" +#line 2199 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3745 "seclang-parser.cc" // lalr1.cc:919 +#line 4033 "seclang-parser.cc" break; - case 240: -#line 2153 "seclang-parser.yy" // lalr1.cc:919 - { + case 246: // var: "VARIABLE_TX" +#line 2203 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_NoDictElement()); } -#line 3753 "seclang-parser.cc" // lalr1.cc:919 +#line 4041 "seclang-parser.cc" break; - case 241: -#line 2157 "seclang-parser.yy" // lalr1.cc:919 - { + case 247: // var: "VARIABLE_SESSION" run_time_string +#line 2207 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 3761 "seclang-parser.cc" // lalr1.cc:919 +#line 4049 "seclang-parser.cc" break; - case 242: -#line 2161 "seclang-parser.yy" // lalr1.cc:919 - { + case 248: // var: "VARIABLE_SESSION" "Dictionary element" +#line 2211 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3769 "seclang-parser.cc" // lalr1.cc:919 +#line 4057 "seclang-parser.cc" break; - case 243: -#line 2165 "seclang-parser.yy" // lalr1.cc:919 - { + case 249: // var: "VARIABLE_SESSION" "Dictionary element, selected by regexp" +#line 2215 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3777 "seclang-parser.cc" // lalr1.cc:919 +#line 4065 "seclang-parser.cc" break; - case 244: -#line 2169 "seclang-parser.yy" // lalr1.cc:919 - { + case 250: // var: "VARIABLE_SESSION" +#line 2219 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_NoDictElement()); } -#line 3785 "seclang-parser.cc" // lalr1.cc:919 +#line 4073 "seclang-parser.cc" break; - case 245: -#line 2173 "seclang-parser.yy" // lalr1.cc:919 - { + case 251: // var: "Variable ARGS_NAMES" "Dictionary element" +#line 2223 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsNames_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3793 "seclang-parser.cc" // lalr1.cc:919 +#line 4081 "seclang-parser.cc" break; - case 246: -#line 2177 "seclang-parser.yy" // lalr1.cc:919 - { + case 252: // var: "Variable ARGS_NAMES" "Dictionary element, selected by regexp" +#line 2227 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3801 "seclang-parser.cc" // lalr1.cc:919 +#line 4089 "seclang-parser.cc" break; - case 247: -#line 2181 "seclang-parser.yy" // lalr1.cc:919 - { + case 253: // var: "Variable ARGS_NAMES" +#line 2231 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsNames_NoDictElement()); } -#line 3809 "seclang-parser.cc" // lalr1.cc:919 +#line 4097 "seclang-parser.cc" break; - case 248: -#line 2185 "seclang-parser.yy" // lalr1.cc:919 - { + case 254: // var: VARIABLE_ARGS_GET_NAMES "Dictionary element" +#line 2235 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGetNames_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3817 "seclang-parser.cc" // lalr1.cc:919 +#line 4105 "seclang-parser.cc" break; - case 249: -#line 2189 "seclang-parser.yy" // lalr1.cc:919 - { + case 255: // var: VARIABLE_ARGS_GET_NAMES "Dictionary element, selected by regexp" +#line 2239 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGetNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3825 "seclang-parser.cc" // lalr1.cc:919 +#line 4113 "seclang-parser.cc" break; - case 250: -#line 2193 "seclang-parser.yy" // lalr1.cc:919 - { + case 256: // var: VARIABLE_ARGS_GET_NAMES +#line 2243 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGetNames_NoDictElement()); } -#line 3833 "seclang-parser.cc" // lalr1.cc:919 +#line 4121 "seclang-parser.cc" break; - case 251: -#line 2198 "seclang-parser.yy" // lalr1.cc:919 - { + case 257: // var: VARIABLE_ARGS_POST_NAMES "Dictionary element" +#line 2248 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPostNames_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3841 "seclang-parser.cc" // lalr1.cc:919 +#line 4129 "seclang-parser.cc" break; - case 252: -#line 2202 "seclang-parser.yy" // lalr1.cc:919 - { + case 258: // var: VARIABLE_ARGS_POST_NAMES "Dictionary element, selected by regexp" +#line 2252 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPostNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3849 "seclang-parser.cc" // lalr1.cc:919 +#line 4137 "seclang-parser.cc" break; - case 253: -#line 2206 "seclang-parser.yy" // lalr1.cc:919 - { + case 259: // var: VARIABLE_ARGS_POST_NAMES +#line 2256 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPostNames_NoDictElement()); } -#line 3857 "seclang-parser.cc" // lalr1.cc:919 +#line 4145 "seclang-parser.cc" break; - case 254: -#line 2211 "seclang-parser.yy" // lalr1.cc:919 - { + case 260: // var: VARIABLE_REQUEST_HEADERS_NAMES "Dictionary element" +#line 2261 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeadersNames_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3865 "seclang-parser.cc" // lalr1.cc:919 +#line 4153 "seclang-parser.cc" break; - case 255: -#line 2215 "seclang-parser.yy" // lalr1.cc:919 - { + case 261: // var: VARIABLE_REQUEST_HEADERS_NAMES "Dictionary element, selected by regexp" +#line 2265 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeadersNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3873 "seclang-parser.cc" // lalr1.cc:919 +#line 4161 "seclang-parser.cc" break; - case 256: -#line 2219 "seclang-parser.yy" // lalr1.cc:919 - { + case 262: // var: VARIABLE_REQUEST_HEADERS_NAMES +#line 2269 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeadersNames_NoDictElement()); } -#line 3881 "seclang-parser.cc" // lalr1.cc:919 +#line 4169 "seclang-parser.cc" break; - case 257: -#line 2224 "seclang-parser.yy" // lalr1.cc:919 - { + case 263: // var: VARIABLE_RESPONSE_CONTENT_TYPE +#line 2274 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseContentType()); } -#line 3889 "seclang-parser.cc" // lalr1.cc:919 +#line 4177 "seclang-parser.cc" break; - case 258: -#line 2229 "seclang-parser.yy" // lalr1.cc:919 - { + case 264: // var: VARIABLE_RESPONSE_HEADERS_NAMES "Dictionary element" +#line 2279 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeadersNames_DictElement(yystack_[0].value.as < std::string > ())); } -#line 3897 "seclang-parser.cc" // lalr1.cc:919 +#line 4185 "seclang-parser.cc" break; - case 259: -#line 2233 "seclang-parser.yy" // lalr1.cc:919 - { + case 265: // var: VARIABLE_RESPONSE_HEADERS_NAMES "Dictionary element, selected by regexp" +#line 2283 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeadersNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } -#line 3905 "seclang-parser.cc" // lalr1.cc:919 +#line 4193 "seclang-parser.cc" break; - case 260: -#line 2237 "seclang-parser.yy" // lalr1.cc:919 - { + case 266: // var: VARIABLE_RESPONSE_HEADERS_NAMES +#line 2287 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeadersNames_NoDictElement()); } -#line 3913 "seclang-parser.cc" // lalr1.cc:919 +#line 4201 "seclang-parser.cc" break; - case 261: -#line 2241 "seclang-parser.yy" // lalr1.cc:919 - { + case 267: // var: VARIABLE_ARGS_COMBINED_SIZE +#line 2291 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsCombinedSize()); } -#line 3921 "seclang-parser.cc" // lalr1.cc:919 +#line 4209 "seclang-parser.cc" break; - case 262: -#line 2245 "seclang-parser.yy" // lalr1.cc:919 - { + case 268: // var: "AUTH_TYPE" +#line 2295 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::AuthType()); } -#line 3929 "seclang-parser.cc" // lalr1.cc:919 +#line 4217 "seclang-parser.cc" break; - case 263: -#line 2249 "seclang-parser.yy" // lalr1.cc:919 - { + case 269: // var: "FILES_COMBINED_SIZE" +#line 2299 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesCombinedSize()); } -#line 3937 "seclang-parser.cc" // lalr1.cc:919 +#line 4225 "seclang-parser.cc" break; - case 264: -#line 2253 "seclang-parser.yy" // lalr1.cc:919 - { + case 270: // var: "FULL_REQUEST" +#line 2303 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FullRequest()); } -#line 3945 "seclang-parser.cc" // lalr1.cc:919 +#line 4233 "seclang-parser.cc" break; - case 265: -#line 2257 "seclang-parser.yy" // lalr1.cc:919 - { + case 271: // var: "FULL_REQUEST_LENGTH" +#line 2307 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FullRequestLength()); } -#line 3953 "seclang-parser.cc" // lalr1.cc:919 +#line 4241 "seclang-parser.cc" break; - case 266: -#line 2261 "seclang-parser.yy" // lalr1.cc:919 - { + case 272: // var: "INBOUND_DATA_ERROR" +#line 2311 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::InboundDataError()); } -#line 3961 "seclang-parser.cc" // lalr1.cc:919 +#line 4249 "seclang-parser.cc" break; - case 267: -#line 2265 "seclang-parser.yy" // lalr1.cc:919 - { + case 273: // var: "MATCHED_VAR" +#line 2315 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVar()); } -#line 3969 "seclang-parser.cc" // lalr1.cc:919 +#line 4257 "seclang-parser.cc" break; - case 268: -#line 2269 "seclang-parser.yy" // lalr1.cc:919 - { + case 274: // var: "MATCHED_VAR_NAME" +#line 2319 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarName()); } -#line 3977 "seclang-parser.cc" // lalr1.cc:919 +#line 4265 "seclang-parser.cc" break; - case 269: -#line 2273 "seclang-parser.yy" // lalr1.cc:919 - { + case 275: // var: VARIABLE_MULTIPART_BOUNDARY_QUOTED +#line 2323 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartBoundaryQuoted()); } -#line 3985 "seclang-parser.cc" // lalr1.cc:919 +#line 4273 "seclang-parser.cc" break; - case 270: -#line 2277 "seclang-parser.yy" // lalr1.cc:919 - { + case 276: // var: VARIABLE_MULTIPART_BOUNDARY_WHITESPACE +#line 2327 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartBoundaryWhiteSpace()); } -#line 3993 "seclang-parser.cc" // lalr1.cc:919 +#line 4281 "seclang-parser.cc" break; - case 271: -#line 2281 "seclang-parser.yy" // lalr1.cc:919 - { + case 277: // var: "MULTIPART_CRLF_LF_LINES" +#line 2331 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartCrlfLFLines()); } -#line 4001 "seclang-parser.cc" // lalr1.cc:919 +#line 4289 "seclang-parser.cc" break; - case 272: -#line 2285 "seclang-parser.yy" // lalr1.cc:919 - { + case 278: // var: "MULTIPART_DATA_AFTER" +#line 2335 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartDateAfter()); } -#line 4009 "seclang-parser.cc" // lalr1.cc:919 +#line 4297 "seclang-parser.cc" break; - case 273: -#line 2289 "seclang-parser.yy" // lalr1.cc:919 - { + case 279: // var: VARIABLE_MULTIPART_DATA_BEFORE +#line 2339 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartDateBefore()); } -#line 4017 "seclang-parser.cc" // lalr1.cc:919 +#line 4305 "seclang-parser.cc" break; - case 274: -#line 2293 "seclang-parser.yy" // lalr1.cc:919 - { + case 280: // var: "MULTIPART_FILE_LIMIT_EXCEEDED" +#line 2343 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartFileLimitExceeded()); } -#line 4025 "seclang-parser.cc" // lalr1.cc:919 +#line 4313 "seclang-parser.cc" break; - case 275: -#line 2297 "seclang-parser.yy" // lalr1.cc:919 - { + case 281: // var: "MULTIPART_HEADER_FOLDING" +#line 2347 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartHeaderFolding()); } -#line 4033 "seclang-parser.cc" // lalr1.cc:919 +#line 4321 "seclang-parser.cc" break; - case 276: -#line 2301 "seclang-parser.yy" // lalr1.cc:919 - { + case 282: // var: "MULTIPART_INVALID_HEADER_FOLDING" +#line 2351 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartInvalidHeaderFolding()); } -#line 4041 "seclang-parser.cc" // lalr1.cc:919 +#line 4329 "seclang-parser.cc" break; - case 277: -#line 2305 "seclang-parser.yy" // lalr1.cc:919 - { + case 283: // var: VARIABLE_MULTIPART_INVALID_PART +#line 2355 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartInvalidPart()); } -#line 4049 "seclang-parser.cc" // lalr1.cc:919 +#line 4337 "seclang-parser.cc" break; - case 278: -#line 2309 "seclang-parser.yy" // lalr1.cc:919 - { + case 284: // var: "MULTIPART_INVALID_QUOTING" +#line 2359 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartInvalidQuoting()); } -#line 4057 "seclang-parser.cc" // lalr1.cc:919 +#line 4345 "seclang-parser.cc" break; - case 279: -#line 2313 "seclang-parser.yy" // lalr1.cc:919 - { + case 285: // var: VARIABLE_MULTIPART_LF_LINE +#line 2363 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartLFLine()); } -#line 4065 "seclang-parser.cc" // lalr1.cc:919 +#line 4353 "seclang-parser.cc" break; - case 280: -#line 2317 "seclang-parser.yy" // lalr1.cc:919 - { + case 286: // var: VARIABLE_MULTIPART_MISSING_SEMICOLON +#line 2367 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartMissingSemicolon()); } -#line 4073 "seclang-parser.cc" // lalr1.cc:919 +#line 4361 "seclang-parser.cc" break; - case 281: -#line 2321 "seclang-parser.yy" // lalr1.cc:919 - { + case 287: // var: VARIABLE_MULTIPART_SEMICOLON_MISSING +#line 2371 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartMissingSemicolon()); } -#line 4081 "seclang-parser.cc" // lalr1.cc:919 +#line 4369 "seclang-parser.cc" break; - case 282: -#line 2325 "seclang-parser.yy" // lalr1.cc:919 - { + case 288: // var: "MULTIPART_STRICT_ERROR" +#line 2375 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartStrictError()); } -#line 4089 "seclang-parser.cc" // lalr1.cc:919 +#line 4377 "seclang-parser.cc" break; - case 283: -#line 2329 "seclang-parser.yy" // lalr1.cc:919 - { + case 289: // var: "MULTIPART_UNMATCHED_BOUNDARY" +#line 2379 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartUnmatchedBoundary()); } -#line 4097 "seclang-parser.cc" // lalr1.cc:919 +#line 4385 "seclang-parser.cc" break; - case 284: -#line 2333 "seclang-parser.yy" // lalr1.cc:919 - { + case 290: // var: "OUTBOUND_DATA_ERROR" +#line 2383 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::OutboundDataError()); } -#line 4105 "seclang-parser.cc" // lalr1.cc:919 +#line 4393 "seclang-parser.cc" break; - case 285: -#line 2337 "seclang-parser.yy" // lalr1.cc:919 - { + case 291: // var: "PATH_INFO" +#line 2387 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::PathInfo()); } -#line 4113 "seclang-parser.cc" // lalr1.cc:919 +#line 4401 "seclang-parser.cc" break; - case 286: -#line 2341 "seclang-parser.yy" // lalr1.cc:919 - { + case 292: // var: "QUERY_STRING" +#line 2391 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::QueryString()); } -#line 4121 "seclang-parser.cc" // lalr1.cc:919 +#line 4409 "seclang-parser.cc" break; - case 287: -#line 2345 "seclang-parser.yy" // lalr1.cc:919 - { + case 293: // var: "REMOTE_ADDR" +#line 2395 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RemoteAddr()); } -#line 4129 "seclang-parser.cc" // lalr1.cc:919 +#line 4417 "seclang-parser.cc" break; - case 288: -#line 2349 "seclang-parser.yy" // lalr1.cc:919 - { + case 294: // var: "REMOTE_HOST" +#line 2399 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RemoteHost()); } -#line 4137 "seclang-parser.cc" // lalr1.cc:919 +#line 4425 "seclang-parser.cc" break; - case 289: -#line 2353 "seclang-parser.yy" // lalr1.cc:919 - { + case 295: // var: "REMOTE_PORT" +#line 2403 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RemotePort()); } -#line 4145 "seclang-parser.cc" // lalr1.cc:919 +#line 4433 "seclang-parser.cc" break; - case 290: -#line 2357 "seclang-parser.yy" // lalr1.cc:919 - { + case 296: // var: "REQBODY_ERROR" +#line 2407 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyError()); } -#line 4153 "seclang-parser.cc" // lalr1.cc:919 +#line 4441 "seclang-parser.cc" break; - case 291: -#line 2361 "seclang-parser.yy" // lalr1.cc:919 - { + case 297: // var: "REQBODY_ERROR_MSG" +#line 2411 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyErrorMsg()); } -#line 4161 "seclang-parser.cc" // lalr1.cc:919 +#line 4449 "seclang-parser.cc" break; - case 292: -#line 2365 "seclang-parser.yy" // lalr1.cc:919 - { + case 298: // var: "REQBODY_PROCESSOR" +#line 2415 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyProcessor()); } -#line 4169 "seclang-parser.cc" // lalr1.cc:919 +#line 4457 "seclang-parser.cc" break; - case 293: -#line 2369 "seclang-parser.yy" // lalr1.cc:919 - { + case 299: // var: "REQBODY_PROCESSOR_ERROR" +#line 2419 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyProcessorError()); } -#line 4177 "seclang-parser.cc" // lalr1.cc:919 +#line 4465 "seclang-parser.cc" break; - case 294: -#line 2373 "seclang-parser.yy" // lalr1.cc:919 - { + case 300: // var: "REQBODY_PROCESSOR_ERROR_MSG" +#line 2423 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyProcessorErrorMsg()); } -#line 4185 "seclang-parser.cc" // lalr1.cc:919 +#line 4473 "seclang-parser.cc" break; - case 295: -#line 2377 "seclang-parser.yy" // lalr1.cc:919 - { + case 301: // var: "REQUEST_BASENAME" +#line 2427 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestBasename()); } -#line 4193 "seclang-parser.cc" // lalr1.cc:919 +#line 4481 "seclang-parser.cc" break; - case 296: -#line 2381 "seclang-parser.yy" // lalr1.cc:919 - { + case 302: // var: "REQUEST_BODY" +#line 2431 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestBody()); } -#line 4201 "seclang-parser.cc" // lalr1.cc:919 +#line 4489 "seclang-parser.cc" break; - case 297: -#line 2385 "seclang-parser.yy" // lalr1.cc:919 - { + case 303: // var: "REQUEST_BODY_LENGTH" +#line 2435 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestBodyLength()); } -#line 4209 "seclang-parser.cc" // lalr1.cc:919 +#line 4497 "seclang-parser.cc" break; - case 298: -#line 2389 "seclang-parser.yy" // lalr1.cc:919 - { + case 304: // var: "REQUEST_FILENAME" +#line 2439 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestFilename()); } -#line 4217 "seclang-parser.cc" // lalr1.cc:919 +#line 4505 "seclang-parser.cc" break; - case 299: -#line 2393 "seclang-parser.yy" // lalr1.cc:919 - { + case 305: // var: "REQUEST_LINE" +#line 2443 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestLine()); } -#line 4225 "seclang-parser.cc" // lalr1.cc:919 +#line 4513 "seclang-parser.cc" break; - case 300: -#line 2397 "seclang-parser.yy" // lalr1.cc:919 - { + case 306: // var: "REQUEST_METHOD" +#line 2447 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestMethod()); } -#line 4233 "seclang-parser.cc" // lalr1.cc:919 +#line 4521 "seclang-parser.cc" break; - case 301: -#line 2401 "seclang-parser.yy" // lalr1.cc:919 - { + case 307: // var: "REQUEST_PROTOCOL" +#line 2451 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestProtocol()); } -#line 4241 "seclang-parser.cc" // lalr1.cc:919 +#line 4529 "seclang-parser.cc" break; - case 302: -#line 2405 "seclang-parser.yy" // lalr1.cc:919 - { + case 308: // var: "REQUEST_URI" +#line 2455 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestURI()); } -#line 4249 "seclang-parser.cc" // lalr1.cc:919 +#line 4537 "seclang-parser.cc" break; - case 303: -#line 2409 "seclang-parser.yy" // lalr1.cc:919 - { + case 309: // var: "REQUEST_URI_RAW" +#line 2459 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestURIRaw()); } -#line 4257 "seclang-parser.cc" // lalr1.cc:919 +#line 4545 "seclang-parser.cc" break; - case 304: -#line 2413 "seclang-parser.yy" // lalr1.cc:919 - { + case 310: // var: "RESPONSE_BODY" +#line 2463 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseBody()); } -#line 4265 "seclang-parser.cc" // lalr1.cc:919 +#line 4553 "seclang-parser.cc" break; - case 305: -#line 2417 "seclang-parser.yy" // lalr1.cc:919 - { + case 311: // var: "RESPONSE_CONTENT_LENGTH" +#line 2467 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseContentLength()); } -#line 4273 "seclang-parser.cc" // lalr1.cc:919 +#line 4561 "seclang-parser.cc" break; - case 306: -#line 2421 "seclang-parser.yy" // lalr1.cc:919 - { + case 312: // var: "RESPONSE_PROTOCOL" +#line 2471 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseProtocol()); } -#line 4281 "seclang-parser.cc" // lalr1.cc:919 +#line 4569 "seclang-parser.cc" break; - case 307: -#line 2425 "seclang-parser.yy" // lalr1.cc:919 - { + case 313: // var: "RESPONSE_STATUS" +#line 2475 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseStatus()); } -#line 4289 "seclang-parser.cc" // lalr1.cc:919 +#line 4577 "seclang-parser.cc" break; - case 308: -#line 2429 "seclang-parser.yy" // lalr1.cc:919 - { + case 314: // var: "SERVER_ADDR" +#line 2479 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ServerAddr()); } -#line 4297 "seclang-parser.cc" // lalr1.cc:919 +#line 4585 "seclang-parser.cc" break; - case 309: -#line 2433 "seclang-parser.yy" // lalr1.cc:919 - { + case 315: // var: "SERVER_NAME" +#line 2483 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ServerName()); } -#line 4305 "seclang-parser.cc" // lalr1.cc:919 +#line 4593 "seclang-parser.cc" break; - case 310: -#line 2437 "seclang-parser.yy" // lalr1.cc:919 - { + case 316: // var: "SERVER_PORT" +#line 2487 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ServerPort()); } -#line 4313 "seclang-parser.cc" // lalr1.cc:919 +#line 4601 "seclang-parser.cc" break; - case 311: -#line 2441 "seclang-parser.yy" // lalr1.cc:919 - { + case 317: // var: "SESSIONID" +#line 2491 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::SessionID()); } -#line 4321 "seclang-parser.cc" // lalr1.cc:919 +#line 4609 "seclang-parser.cc" break; - case 312: -#line 2445 "seclang-parser.yy" // lalr1.cc:919 - { + case 318: // var: "UNIQUE_ID" +#line 2495 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::UniqueID()); } -#line 4329 "seclang-parser.cc" // lalr1.cc:919 +#line 4617 "seclang-parser.cc" break; - case 313: -#line 2449 "seclang-parser.yy" // lalr1.cc:919 - { + case 319: // var: "URLENCODED_ERROR" +#line 2499 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::UrlEncodedError()); } -#line 4337 "seclang-parser.cc" // lalr1.cc:919 +#line 4625 "seclang-parser.cc" break; - case 314: -#line 2453 "seclang-parser.yy" // lalr1.cc:919 - { + case 320: // var: "USERID" +#line 2503 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::UserID()); } -#line 4345 "seclang-parser.cc" // lalr1.cc:919 +#line 4633 "seclang-parser.cc" break; - case 315: -#line 2457 "seclang-parser.yy" // lalr1.cc:919 - { + case 321: // var: "VARIABLE_STATUS" +#line 2507 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Status()); } -#line 4353 "seclang-parser.cc" // lalr1.cc:919 +#line 4641 "seclang-parser.cc" break; - case 316: -#line 2461 "seclang-parser.yy" // lalr1.cc:919 - { + case 322: // var: "VARIABLE_STATUS_LINE" +#line 2511 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Status()); } -#line 4361 "seclang-parser.cc" // lalr1.cc:919 +#line 4649 "seclang-parser.cc" break; - case 317: -#line 2465 "seclang-parser.yy" // lalr1.cc:919 - { + case 323: // var: "WEBAPPID" +#line 2515 "seclang-parser.yy" + { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::WebAppId()); } -#line 4369 "seclang-parser.cc" // lalr1.cc:919 +#line 4657 "seclang-parser.cc" break; - case 318: -#line 2469 "seclang-parser.yy" // lalr1.cc:919 - { + case 324: // var: "RUN_TIME_VAR_DUR" +#line 2519 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new Duration(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4380 "seclang-parser.cc" // lalr1.cc:919 +#line 4668 "seclang-parser.cc" break; - case 319: -#line 2477 "seclang-parser.yy" // lalr1.cc:919 - { + case 325: // var: "RUN_TIME_VAR_BLD" +#line 2527 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new ModsecBuild(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4391 "seclang-parser.cc" // lalr1.cc:919 +#line 4679 "seclang-parser.cc" break; - case 320: -#line 2484 "seclang-parser.yy" // lalr1.cc:919 - { + case 326: // var: "RUN_TIME_VAR_HSV" +#line 2534 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new HighestSeverity(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4402 "seclang-parser.cc" // lalr1.cc:919 +#line 4690 "seclang-parser.cc" break; - case 321: -#line 2491 "seclang-parser.yy" // lalr1.cc:919 - { + case 327: // var: "RUN_TIME_VAR_REMOTE_USER" +#line 2541 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new RemoteUser(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4413 "seclang-parser.cc" // lalr1.cc:919 +#line 4701 "seclang-parser.cc" break; - case 322: -#line 2498 "seclang-parser.yy" // lalr1.cc:919 - { + case 328: // var: "RUN_TIME_VAR_TIME" +#line 2548 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new Time(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4424 "seclang-parser.cc" // lalr1.cc:919 +#line 4712 "seclang-parser.cc" break; - case 323: -#line 2505 "seclang-parser.yy" // lalr1.cc:919 - { + case 329: // var: "RUN_TIME_VAR_TIME_DAY" +#line 2555 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new TimeDay(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4435 "seclang-parser.cc" // lalr1.cc:919 +#line 4723 "seclang-parser.cc" break; - case 324: -#line 2512 "seclang-parser.yy" // lalr1.cc:919 - { + case 330: // var: "RUN_TIME_VAR_TIME_EPOCH" +#line 2562 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new TimeEpoch(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4446 "seclang-parser.cc" // lalr1.cc:919 +#line 4734 "seclang-parser.cc" break; - case 325: -#line 2519 "seclang-parser.yy" // lalr1.cc:919 - { + case 331: // var: "RUN_TIME_VAR_TIME_HOUR" +#line 2569 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new TimeHour(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4457 "seclang-parser.cc" // lalr1.cc:919 +#line 4745 "seclang-parser.cc" break; - case 326: -#line 2526 "seclang-parser.yy" // lalr1.cc:919 - { + case 332: // var: "RUN_TIME_VAR_TIME_MIN" +#line 2576 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new TimeMin(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4468 "seclang-parser.cc" // lalr1.cc:919 +#line 4756 "seclang-parser.cc" break; - case 327: -#line 2533 "seclang-parser.yy" // lalr1.cc:919 - { + case 333: // var: "RUN_TIME_VAR_TIME_MON" +#line 2583 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new TimeMon(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4479 "seclang-parser.cc" // lalr1.cc:919 +#line 4767 "seclang-parser.cc" break; - case 328: -#line 2540 "seclang-parser.yy" // lalr1.cc:919 - { + case 334: // var: "RUN_TIME_VAR_TIME_SEC" +#line 2590 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new TimeSec(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4490 "seclang-parser.cc" // lalr1.cc:919 +#line 4778 "seclang-parser.cc" break; - case 329: -#line 2547 "seclang-parser.yy" // lalr1.cc:919 - { + case 335: // var: "RUN_TIME_VAR_TIME_WDAY" +#line 2597 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new TimeWDay(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4501 "seclang-parser.cc" // lalr1.cc:919 +#line 4789 "seclang-parser.cc" break; - case 330: -#line 2554 "seclang-parser.yy" // lalr1.cc:919 - { + case 336: // var: "RUN_TIME_VAR_TIME_YEAR" +#line 2604 "seclang-parser.yy" + { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); std::unique_ptr c(new TimeYear(name)); yylhs.value.as < std::unique_ptr > () = std::move(c); } -#line 4512 "seclang-parser.cc" // lalr1.cc:919 +#line 4800 "seclang-parser.cc" break; - case 331: -#line 2564 "seclang-parser.yy" // lalr1.cc:919 - { + case 337: // act: "Accuracy" +#line 2614 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Accuracy(yystack_[0].value.as < std::string > ())); } -#line 4520 "seclang-parser.cc" // lalr1.cc:919 +#line 4808 "seclang-parser.cc" break; - case 332: -#line 2568 "seclang-parser.yy" // lalr1.cc:919 - { + case 338: // act: "Allow" +#line 2618 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Allow(yystack_[0].value.as < std::string > ())); } -#line 4528 "seclang-parser.cc" // lalr1.cc:919 +#line 4816 "seclang-parser.cc" break; - case 333: -#line 2572 "seclang-parser.yy" // lalr1.cc:919 - { + case 339: // act: "Append" +#line 2622 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("Append", yystack_[1].location); } -#line 4536 "seclang-parser.cc" // lalr1.cc:919 +#line 4824 "seclang-parser.cc" break; - case 334: -#line 2576 "seclang-parser.yy" // lalr1.cc:919 - { + case 340: // act: "AuditLog" +#line 2626 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::AuditLog(yystack_[0].value.as < std::string > ())); } -#line 4544 "seclang-parser.cc" // lalr1.cc:919 +#line 4832 "seclang-parser.cc" break; - case 335: -#line 2580 "seclang-parser.yy" // lalr1.cc:919 - { + case 341: // act: "Block" +#line 2630 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Block(yystack_[0].value.as < std::string > ())); } -#line 4552 "seclang-parser.cc" // lalr1.cc:919 +#line 4840 "seclang-parser.cc" break; - case 336: -#line 2584 "seclang-parser.yy" // lalr1.cc:919 - { + case 342: // act: "Capture" +#line 2634 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Capture(yystack_[0].value.as < std::string > ())); } -#line 4560 "seclang-parser.cc" // lalr1.cc:919 +#line 4848 "seclang-parser.cc" break; - case 337: -#line 2588 "seclang-parser.yy" // lalr1.cc:919 - { + case 343: // act: "Chain" +#line 2638 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Chain(yystack_[0].value.as < std::string > ())); } -#line 4568 "seclang-parser.cc" // lalr1.cc:919 +#line 4856 "seclang-parser.cc" break; - case 338: -#line 2592 "seclang-parser.yy" // lalr1.cc:919 - { - //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); - ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); + case 344: // act: "ACTION_CTL_AUDIT_ENGINE" "CONFIG_VALUE_ON" +#line 2642 "seclang-parser.yy" + { + ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::AuditEngine("ctl:auditengine=on")); + driver.m_auditLog->setCtlAuditEngineActive(); } -#line 4577 "seclang-parser.cc" // lalr1.cc:919 +#line 4865 "seclang-parser.cc" break; - case 339: -#line 2597 "seclang-parser.yy" // lalr1.cc:919 - { - //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); - ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); + case 345: // act: "ACTION_CTL_AUDIT_ENGINE" "CONFIG_VALUE_OFF" +#line 2647 "seclang-parser.yy" + { + ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::AuditEngine("ctl:auditengine=off")); } -#line 4586 "seclang-parser.cc" // lalr1.cc:919 +#line 4873 "seclang-parser.cc" break; - case 340: -#line 2602 "seclang-parser.yy" // lalr1.cc:919 - { - //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); - ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); + case 346: // act: "ACTION_CTL_AUDIT_ENGINE" "CONFIG_VALUE_RELEVANT_ONLY" +#line 2651 "seclang-parser.yy" + { + ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::AuditEngine("ctl:auditengine=relevantonly")); + driver.m_auditLog->setCtlAuditEngineActive(); } -#line 4595 "seclang-parser.cc" // lalr1.cc:919 +#line 4882 "seclang-parser.cc" break; - case 341: -#line 2607 "seclang-parser.yy" // lalr1.cc:919 - { + case 347: // act: "ACTION_CTL_AUDIT_LOG_PARTS" +#line 2656 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::AuditLogParts(yystack_[0].value.as < std::string > ())); } -#line 4603 "seclang-parser.cc" // lalr1.cc:919 +#line 4890 "seclang-parser.cc" break; - case 342: -#line 2611 "seclang-parser.yy" // lalr1.cc:919 - { + case 348: // act: "ACTION_CTL_BDY_JSON" +#line 2660 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyProcessorJSON(yystack_[0].value.as < std::string > ())); } -#line 4611 "seclang-parser.cc" // lalr1.cc:919 +#line 4898 "seclang-parser.cc" break; - case 343: -#line 2615 "seclang-parser.yy" // lalr1.cc:919 - { + case 349: // act: "ACTION_CTL_BDY_XML" +#line 2664 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyProcessorXML(yystack_[0].value.as < std::string > ())); } -#line 4619 "seclang-parser.cc" // lalr1.cc:919 +#line 4906 "seclang-parser.cc" break; - case 344: -#line 2619 "seclang-parser.yy" // lalr1.cc:919 - { + case 350: // act: "ACTION_CTL_BDY_URLENCODED" +#line 2668 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyProcessorURLENCODED(yystack_[0].value.as < std::string > ())); } -#line 4627 "seclang-parser.cc" // lalr1.cc:919 +#line 4914 "seclang-parser.cc" break; - case 345: -#line 2623 "seclang-parser.yy" // lalr1.cc:919 - { + case 351: // act: "ACTION_CTL_FORCE_REQ_BODY_VAR" "CONFIG_VALUE_ON" +#line 2672 "seclang-parser.yy" + { //ACTION_NOT_SUPPORTED("CtlForceReequestBody", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); } -#line 4636 "seclang-parser.cc" // lalr1.cc:919 +#line 4923 "seclang-parser.cc" break; - case 346: -#line 2628 "seclang-parser.yy" // lalr1.cc:919 - { + case 352: // act: "ACTION_CTL_FORCE_REQ_BODY_VAR" "CONFIG_VALUE_OFF" +#line 2677 "seclang-parser.yy" + { //ACTION_NOT_SUPPORTED("CtlForceReequestBody", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); } -#line 4645 "seclang-parser.cc" // lalr1.cc:919 +#line 4932 "seclang-parser.cc" break; - case 347: -#line 2633 "seclang-parser.yy" // lalr1.cc:919 - { + case 353: // act: "ACTION_CTL_REQUEST_BODY_ACCESS" "CONFIG_VALUE_ON" +#line 2682 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyAccess(yystack_[1].value.as < std::string > () + "true")); } -#line 4653 "seclang-parser.cc" // lalr1.cc:919 +#line 4940 "seclang-parser.cc" break; - case 348: -#line 2637 "seclang-parser.yy" // lalr1.cc:919 - { + case 354: // act: "ACTION_CTL_REQUEST_BODY_ACCESS" "CONFIG_VALUE_OFF" +#line 2686 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyAccess(yystack_[1].value.as < std::string > () + "false")); } -#line 4661 "seclang-parser.cc" // lalr1.cc:919 +#line 4948 "seclang-parser.cc" break; - case 349: -#line 2641 "seclang-parser.yy" // lalr1.cc:919 - { + case 355: // act: "ACTION_CTL_RULE_ENGINE" "CONFIG_VALUE_ON" +#line 2690 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleEngine("ctl:RuleEngine=on")); } -#line 4669 "seclang-parser.cc" // lalr1.cc:919 +#line 4956 "seclang-parser.cc" break; - case 350: -#line 2645 "seclang-parser.yy" // lalr1.cc:919 - { + case 356: // act: "ACTION_CTL_RULE_ENGINE" "CONFIG_VALUE_OFF" +#line 2694 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleEngine("ctl:RuleEngine=off")); } -#line 4677 "seclang-parser.cc" // lalr1.cc:919 +#line 4964 "seclang-parser.cc" break; - case 351: -#line 2649 "seclang-parser.yy" // lalr1.cc:919 - { + case 357: // act: "ACTION_CTL_RULE_ENGINE" "CONFIG_VALUE_DETC" +#line 2698 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleEngine("ctl:RuleEngine=detectiononly")); } -#line 4685 "seclang-parser.cc" // lalr1.cc:919 +#line 4972 "seclang-parser.cc" break; - case 352: -#line 2653 "seclang-parser.yy" // lalr1.cc:919 - { + case 358: // act: "ACTION_CTL_RULE_REMOVE_BY_ID" +#line 2702 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveById(yystack_[0].value.as < std::string > ())); } -#line 4693 "seclang-parser.cc" // lalr1.cc:919 +#line 4980 "seclang-parser.cc" break; - case 353: -#line 2657 "seclang-parser.yy" // lalr1.cc:919 - { + case 359: // act: "ACTION_CTL_RULE_REMOVE_BY_TAG" +#line 2706 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveByTag(yystack_[0].value.as < std::string > ())); } -#line 4701 "seclang-parser.cc" // lalr1.cc:919 +#line 4988 "seclang-parser.cc" break; - case 354: -#line 2661 "seclang-parser.yy" // lalr1.cc:919 - { + case 360: // act: "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" +#line 2710 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveTargetById(yystack_[0].value.as < std::string > ())); } -#line 4709 "seclang-parser.cc" // lalr1.cc:919 +#line 4996 "seclang-parser.cc" break; - case 355: -#line 2665 "seclang-parser.yy" // lalr1.cc:919 - { + case 361: // act: "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" +#line 2714 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveTargetByTag(yystack_[0].value.as < std::string > ())); } -#line 4717 "seclang-parser.cc" // lalr1.cc:919 +#line 5004 "seclang-parser.cc" break; - case 356: -#line 2669 "seclang-parser.yy" // lalr1.cc:919 - { + case 362: // act: "Deny" +#line 2718 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Deny(yystack_[0].value.as < std::string > ())); } -#line 4725 "seclang-parser.cc" // lalr1.cc:919 +#line 5012 "seclang-parser.cc" break; - case 357: -#line 2673 "seclang-parser.yy" // lalr1.cc:919 - { + case 363: // act: "DeprecateVar" +#line 2722 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("DeprecateVar", yystack_[1].location); } -#line 4733 "seclang-parser.cc" // lalr1.cc:919 +#line 5020 "seclang-parser.cc" break; - case 358: -#line 2677 "seclang-parser.yy" // lalr1.cc:919 - { + case 364: // act: "Drop" +#line 2726 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Drop(yystack_[0].value.as < std::string > ())); } -#line 4741 "seclang-parser.cc" // lalr1.cc:919 +#line 5028 "seclang-parser.cc" break; - case 359: -#line 2681 "seclang-parser.yy" // lalr1.cc:919 - { + case 365: // act: "Exec" +#line 2730 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Exec(yystack_[0].value.as < std::string > ())); } -#line 4749 "seclang-parser.cc" // lalr1.cc:919 +#line 5036 "seclang-parser.cc" break; - case 360: -#line 2685 "seclang-parser.yy" // lalr1.cc:919 - { + case 366: // act: "ExpireVar" +#line 2734 "seclang-parser.yy" + { //ACTION_NOT_SUPPORTED("ExpireVar", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[0].value.as < std::string > ())); } -#line 4758 "seclang-parser.cc" // lalr1.cc:919 +#line 5045 "seclang-parser.cc" break; - case 361: -#line 2690 "seclang-parser.yy" // lalr1.cc:919 - { + case 367: // act: "Id" +#line 2739 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::RuleId(yystack_[0].value.as < std::string > ())); } -#line 4766 "seclang-parser.cc" // lalr1.cc:919 +#line 5053 "seclang-parser.cc" break; - case 362: -#line 2694 "seclang-parser.yy" // lalr1.cc:919 - { + case 368: // act: "InitCol" run_time_string +#line 2743 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::InitCol(yystack_[1].value.as < std::string > (), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 4774 "seclang-parser.cc" // lalr1.cc:919 +#line 5061 "seclang-parser.cc" break; - case 363: -#line 2698 "seclang-parser.yy" // lalr1.cc:919 - { + case 369: // act: "LogData" run_time_string +#line 2747 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::LogData(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 4782 "seclang-parser.cc" // lalr1.cc:919 +#line 5069 "seclang-parser.cc" break; - case 364: -#line 2702 "seclang-parser.yy" // lalr1.cc:919 - { + case 370: // act: "Log" +#line 2751 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Log(yystack_[0].value.as < std::string > ())); } -#line 4790 "seclang-parser.cc" // lalr1.cc:919 +#line 5077 "seclang-parser.cc" break; - case 365: -#line 2706 "seclang-parser.yy" // lalr1.cc:919 - { + case 371: // act: "Maturity" +#line 2755 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Maturity(yystack_[0].value.as < std::string > ())); } -#line 4798 "seclang-parser.cc" // lalr1.cc:919 +#line 5085 "seclang-parser.cc" break; - case 366: -#line 2710 "seclang-parser.yy" // lalr1.cc:919 - { + case 372: // act: "Msg" run_time_string +#line 2759 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Msg(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 4806 "seclang-parser.cc" // lalr1.cc:919 +#line 5093 "seclang-parser.cc" break; - case 367: -#line 2714 "seclang-parser.yy" // lalr1.cc:919 - { + case 373: // act: "MultiMatch" +#line 2763 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::MultiMatch(yystack_[0].value.as < std::string > ())); } -#line 4814 "seclang-parser.cc" // lalr1.cc:919 +#line 5101 "seclang-parser.cc" break; - case 368: -#line 2718 "seclang-parser.yy" // lalr1.cc:919 - { + case 374: // act: "NoAuditLog" +#line 2767 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::NoAuditLog(yystack_[0].value.as < std::string > ())); } -#line 4822 "seclang-parser.cc" // lalr1.cc:919 +#line 5109 "seclang-parser.cc" break; - case 369: -#line 2722 "seclang-parser.yy" // lalr1.cc:919 - { + case 375: // act: "NoLog" +#line 2771 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::NoLog(yystack_[0].value.as < std::string > ())); } -#line 4830 "seclang-parser.cc" // lalr1.cc:919 +#line 5117 "seclang-parser.cc" break; - case 370: -#line 2726 "seclang-parser.yy" // lalr1.cc:919 - { + case 376: // act: "Pass" +#line 2775 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Pass(yystack_[0].value.as < std::string > ())); } -#line 4838 "seclang-parser.cc" // lalr1.cc:919 +#line 5125 "seclang-parser.cc" break; - case 371: -#line 2730 "seclang-parser.yy" // lalr1.cc:919 - { + case 377: // act: "Pause" +#line 2779 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("Pause", yystack_[1].location); } -#line 4846 "seclang-parser.cc" // lalr1.cc:919 +#line 5133 "seclang-parser.cc" break; - case 372: -#line 2734 "seclang-parser.yy" // lalr1.cc:919 - { + case 378: // act: "Phase" +#line 2783 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Phase(yystack_[0].value.as < std::string > ())); } -#line 4854 "seclang-parser.cc" // lalr1.cc:919 +#line 5141 "seclang-parser.cc" break; - case 373: -#line 2738 "seclang-parser.yy" // lalr1.cc:919 - { + case 379: // act: "Prepend" +#line 2787 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("Prepend", yystack_[1].location); } -#line 4862 "seclang-parser.cc" // lalr1.cc:919 +#line 5149 "seclang-parser.cc" break; - case 374: -#line 2742 "seclang-parser.yy" // lalr1.cc:919 - { + case 380: // act: "Proxy" +#line 2791 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("Proxy", yystack_[1].location); } -#line 4870 "seclang-parser.cc" // lalr1.cc:919 +#line 5157 "seclang-parser.cc" break; - case 375: -#line 2746 "seclang-parser.yy" // lalr1.cc:919 - { + case 381: // act: "Redirect" run_time_string +#line 2795 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Redirect(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 4878 "seclang-parser.cc" // lalr1.cc:919 +#line 5165 "seclang-parser.cc" break; - case 376: -#line 2750 "seclang-parser.yy" // lalr1.cc:919 - { + case 382: // act: "Rev" +#line 2799 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Rev(yystack_[0].value.as < std::string > ())); } -#line 4886 "seclang-parser.cc" // lalr1.cc:919 +#line 5173 "seclang-parser.cc" break; - case 377: -#line 2754 "seclang-parser.yy" // lalr1.cc:919 - { + case 383: // act: "SanitiseArg" +#line 2803 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("SanitiseArg", yystack_[1].location); } -#line 4894 "seclang-parser.cc" // lalr1.cc:919 +#line 5181 "seclang-parser.cc" break; - case 378: -#line 2758 "seclang-parser.yy" // lalr1.cc:919 - { + case 384: // act: "SanitiseMatched" +#line 2807 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("SanitiseMatched", yystack_[1].location); } -#line 4902 "seclang-parser.cc" // lalr1.cc:919 +#line 5189 "seclang-parser.cc" break; - case 379: -#line 2762 "seclang-parser.yy" // lalr1.cc:919 - { + case 385: // act: "SanitiseMatchedBytes" +#line 2811 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("SanitiseMatchedBytes", yystack_[1].location); } -#line 4910 "seclang-parser.cc" // lalr1.cc:919 +#line 5197 "seclang-parser.cc" break; - case 380: -#line 2766 "seclang-parser.yy" // lalr1.cc:919 - { + case 386: // act: "SanitiseRequestHeader" +#line 2815 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("SanitiseRequestHeader", yystack_[1].location); } -#line 4918 "seclang-parser.cc" // lalr1.cc:919 +#line 5205 "seclang-parser.cc" break; - case 381: -#line 2770 "seclang-parser.yy" // lalr1.cc:919 - { + case 387: // act: "SanitiseResponseHeader" +#line 2819 "seclang-parser.yy" + { ACTION_NOT_SUPPORTED("SanitiseResponseHeader", yystack_[1].location); } -#line 4926 "seclang-parser.cc" // lalr1.cc:919 +#line 5213 "seclang-parser.cc" break; - case 382: -#line 2774 "seclang-parser.yy" // lalr1.cc:919 - { + case 388: // act: "SetEnv" run_time_string +#line 2823 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetENV(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 4934 "seclang-parser.cc" // lalr1.cc:919 +#line 5221 "seclang-parser.cc" break; - case 383: -#line 2778 "seclang-parser.yy" // lalr1.cc:919 - { + case 389: // act: "SetRsc" run_time_string +#line 2827 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetRSC(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 4942 "seclang-parser.cc" // lalr1.cc:919 +#line 5229 "seclang-parser.cc" break; - case 384: -#line 2782 "seclang-parser.yy" // lalr1.cc:919 - { + case 390: // act: "SetSid" run_time_string +#line 2831 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetSID(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 4950 "seclang-parser.cc" // lalr1.cc:919 +#line 5237 "seclang-parser.cc" break; - case 385: -#line 2786 "seclang-parser.yy" // lalr1.cc:919 - { + case 391: // act: "SetUID" run_time_string +#line 2835 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetUID(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 4958 "seclang-parser.cc" // lalr1.cc:919 +#line 5245 "seclang-parser.cc" break; - case 386: -#line 2790 "seclang-parser.yy" // lalr1.cc:919 - { + case 392: // act: "SetVar" setvar_action +#line 2839 "seclang-parser.yy" + { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); } -#line 4966 "seclang-parser.cc" // lalr1.cc:919 +#line 5253 "seclang-parser.cc" break; - case 387: -#line 2794 "seclang-parser.yy" // lalr1.cc:919 - { + case 393: // act: "Severity" +#line 2843 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Severity(yystack_[0].value.as < std::string > ())); } -#line 4974 "seclang-parser.cc" // lalr1.cc:919 +#line 5261 "seclang-parser.cc" break; - case 388: -#line 2798 "seclang-parser.yy" // lalr1.cc:919 - { + case 394: // act: "Skip" +#line 2847 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Skip(yystack_[0].value.as < std::string > ())); } -#line 4982 "seclang-parser.cc" // lalr1.cc:919 +#line 5269 "seclang-parser.cc" break; - case 389: -#line 2802 "seclang-parser.yy" // lalr1.cc:919 - { + case 395: // act: "SkipAfter" +#line 2851 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SkipAfter(yystack_[0].value.as < std::string > ())); } -#line 4990 "seclang-parser.cc" // lalr1.cc:919 +#line 5277 "seclang-parser.cc" break; - case 390: -#line 2806 "seclang-parser.yy" // lalr1.cc:919 - { + case 396: // act: "Status" +#line 2855 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::data::Status(yystack_[0].value.as < std::string > ())); } -#line 4998 "seclang-parser.cc" // lalr1.cc:919 +#line 5285 "seclang-parser.cc" break; - case 391: -#line 2810 "seclang-parser.yy" // lalr1.cc:919 - { + case 397: // act: "Tag" run_time_string +#line 2859 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Tag(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5006 "seclang-parser.cc" // lalr1.cc:919 +#line 5293 "seclang-parser.cc" break; - case 392: -#line 2814 "seclang-parser.yy" // lalr1.cc:919 - { + case 398: // act: "Ver" +#line 2863 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Ver(yystack_[0].value.as < std::string > ())); } -#line 5014 "seclang-parser.cc" // lalr1.cc:919 +#line 5301 "seclang-parser.cc" break; - case 393: -#line 2818 "seclang-parser.yy" // lalr1.cc:919 - { + case 399: // act: "xmlns" +#line 2867 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::XmlNS(yystack_[0].value.as < std::string > ())); } -#line 5022 "seclang-parser.cc" // lalr1.cc:919 +#line 5309 "seclang-parser.cc" break; - case 394: -#line 2822 "seclang-parser.yy" // lalr1.cc:919 - { + case 400: // act: "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" +#line 2871 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ParityZero7bit(yystack_[0].value.as < std::string > ())); } -#line 5030 "seclang-parser.cc" // lalr1.cc:919 +#line 5317 "seclang-parser.cc" break; - case 395: -#line 2826 "seclang-parser.yy" // lalr1.cc:919 - { + case 401: // act: "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" +#line 2875 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ParityOdd7bit(yystack_[0].value.as < std::string > ())); } -#line 5038 "seclang-parser.cc" // lalr1.cc:919 +#line 5325 "seclang-parser.cc" break; - case 396: -#line 2830 "seclang-parser.yy" // lalr1.cc:919 - { + case 402: // act: "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" +#line 2879 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ParityEven7bit(yystack_[0].value.as < std::string > ())); } -#line 5046 "seclang-parser.cc" // lalr1.cc:919 +#line 5333 "seclang-parser.cc" break; - case 397: -#line 2834 "seclang-parser.yy" // lalr1.cc:919 - { + case 403: // act: "ACTION_TRANSFORMATION_SQL_HEX_DECODE" +#line 2883 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::SqlHexDecode(yystack_[0].value.as < std::string > ())); } -#line 5054 "seclang-parser.cc" // lalr1.cc:919 +#line 5341 "seclang-parser.cc" break; - case 398: -#line 2838 "seclang-parser.yy" // lalr1.cc:919 - { + case 404: // act: "ACTION_TRANSFORMATION_BASE_64_ENCODE" +#line 2887 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Base64Encode(yystack_[0].value.as < std::string > ())); } -#line 5062 "seclang-parser.cc" // lalr1.cc:919 +#line 5349 "seclang-parser.cc" break; - case 399: -#line 2842 "seclang-parser.yy" // lalr1.cc:919 - { + case 405: // act: "ACTION_TRANSFORMATION_BASE_64_DECODE" +#line 2891 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Base64Decode(yystack_[0].value.as < std::string > ())); } -#line 5070 "seclang-parser.cc" // lalr1.cc:919 +#line 5357 "seclang-parser.cc" break; - case 400: -#line 2846 "seclang-parser.yy" // lalr1.cc:919 - { + case 406: // act: "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" +#line 2895 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Base64DecodeExt(yystack_[0].value.as < std::string > ())); } -#line 5078 "seclang-parser.cc" // lalr1.cc:919 +#line 5365 "seclang-parser.cc" break; - case 401: -#line 2850 "seclang-parser.yy" // lalr1.cc:919 - { + case 407: // act: "ACTION_TRANSFORMATION_CMD_LINE" +#line 2899 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::CmdLine(yystack_[0].value.as < std::string > ())); } -#line 5086 "seclang-parser.cc" // lalr1.cc:919 +#line 5373 "seclang-parser.cc" break; - case 402: -#line 2854 "seclang-parser.yy" // lalr1.cc:919 - { + case 408: // act: "ACTION_TRANSFORMATION_SHA1" +#line 2903 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Sha1(yystack_[0].value.as < std::string > ())); } -#line 5094 "seclang-parser.cc" // lalr1.cc:919 +#line 5381 "seclang-parser.cc" break; - case 403: -#line 2858 "seclang-parser.yy" // lalr1.cc:919 - { + case 409: // act: "ACTION_TRANSFORMATION_MD5" +#line 2907 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Md5(yystack_[0].value.as < std::string > ())); } -#line 5102 "seclang-parser.cc" // lalr1.cc:919 +#line 5389 "seclang-parser.cc" break; - case 404: -#line 2862 "seclang-parser.yy" // lalr1.cc:919 - { + case 410: // act: "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" +#line 2911 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::EscapeSeqDecode(yystack_[0].value.as < std::string > ())); } -#line 5110 "seclang-parser.cc" // lalr1.cc:919 +#line 5397 "seclang-parser.cc" break; - case 405: -#line 2866 "seclang-parser.yy" // lalr1.cc:919 - { + case 411: // act: "ACTION_TRANSFORMATION_HEX_ENCODE" +#line 2915 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::HexEncode(yystack_[0].value.as < std::string > ())); } -#line 5118 "seclang-parser.cc" // lalr1.cc:919 +#line 5405 "seclang-parser.cc" break; - case 406: -#line 2870 "seclang-parser.yy" // lalr1.cc:919 - { + case 412: // act: "ACTION_TRANSFORMATION_HEX_DECODE" +#line 2919 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::HexDecode(yystack_[0].value.as < std::string > ())); } -#line 5126 "seclang-parser.cc" // lalr1.cc:919 +#line 5413 "seclang-parser.cc" break; - case 407: -#line 2874 "seclang-parser.yy" // lalr1.cc:919 - { + case 413: // act: "ACTION_TRANSFORMATION_LOWERCASE" +#line 2923 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::LowerCase(yystack_[0].value.as < std::string > ())); } -#line 5134 "seclang-parser.cc" // lalr1.cc:919 +#line 5421 "seclang-parser.cc" break; - case 408: -#line 2878 "seclang-parser.yy" // lalr1.cc:919 - { + case 414: // act: "ACTION_TRANSFORMATION_UPPERCASE" +#line 2927 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UpperCase(yystack_[0].value.as < std::string > ())); } -#line 5142 "seclang-parser.cc" // lalr1.cc:919 +#line 5429 "seclang-parser.cc" break; - case 409: -#line 2882 "seclang-parser.yy" // lalr1.cc:919 - { + case 415: // act: "ACTION_TRANSFORMATION_URL_DECODE_UNI" +#line 2931 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UrlDecodeUni(yystack_[0].value.as < std::string > ())); } -#line 5150 "seclang-parser.cc" // lalr1.cc:919 +#line 5437 "seclang-parser.cc" break; - case 410: -#line 2886 "seclang-parser.yy" // lalr1.cc:919 - { + case 416: // act: "ACTION_TRANSFORMATION_URL_DECODE" +#line 2935 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UrlDecode(yystack_[0].value.as < std::string > ())); } -#line 5158 "seclang-parser.cc" // lalr1.cc:919 +#line 5445 "seclang-parser.cc" break; - case 411: -#line 2890 "seclang-parser.yy" // lalr1.cc:919 - { + case 417: // act: "ACTION_TRANSFORMATION_URL_ENCODE" +#line 2939 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UrlEncode(yystack_[0].value.as < std::string > ())); } -#line 5166 "seclang-parser.cc" // lalr1.cc:919 +#line 5453 "seclang-parser.cc" break; - case 412: -#line 2894 "seclang-parser.yy" // lalr1.cc:919 - { + case 418: // act: "ACTION_TRANSFORMATION_NONE" +#line 2943 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::None(yystack_[0].value.as < std::string > ())); } -#line 5174 "seclang-parser.cc" // lalr1.cc:919 +#line 5461 "seclang-parser.cc" break; - case 413: -#line 2898 "seclang-parser.yy" // lalr1.cc:919 - { + case 419: // act: "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" +#line 2947 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::CompressWhitespace(yystack_[0].value.as < std::string > ())); } -#line 5182 "seclang-parser.cc" // lalr1.cc:919 +#line 5469 "seclang-parser.cc" break; - case 414: -#line 2902 "seclang-parser.yy" // lalr1.cc:919 - { + case 420: // act: "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" +#line 2951 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveWhitespace(yystack_[0].value.as < std::string > ())); } -#line 5190 "seclang-parser.cc" // lalr1.cc:919 +#line 5477 "seclang-parser.cc" break; - case 415: -#line 2906 "seclang-parser.yy" // lalr1.cc:919 - { + case 421: // act: "ACTION_TRANSFORMATION_REPLACE_NULLS" +#line 2955 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ReplaceNulls(yystack_[0].value.as < std::string > ())); } -#line 5198 "seclang-parser.cc" // lalr1.cc:919 +#line 5485 "seclang-parser.cc" break; - case 416: -#line 2910 "seclang-parser.yy" // lalr1.cc:919 - { + case 422: // act: "ACTION_TRANSFORMATION_REMOVE_NULLS" +#line 2959 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveNulls(yystack_[0].value.as < std::string > ())); } -#line 5206 "seclang-parser.cc" // lalr1.cc:919 +#line 5493 "seclang-parser.cc" break; - case 417: -#line 2914 "seclang-parser.yy" // lalr1.cc:919 - { + case 423: // act: "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" +#line 2963 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::HtmlEntityDecode(yystack_[0].value.as < std::string > ())); } -#line 5214 "seclang-parser.cc" // lalr1.cc:919 +#line 5501 "seclang-parser.cc" break; - case 418: -#line 2918 "seclang-parser.yy" // lalr1.cc:919 - { + case 424: // act: "ACTION_TRANSFORMATION_JS_DECODE" +#line 2967 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::JsDecode(yystack_[0].value.as < std::string > ())); } -#line 5222 "seclang-parser.cc" // lalr1.cc:919 +#line 5509 "seclang-parser.cc" break; - case 419: -#line 2922 "seclang-parser.yy" // lalr1.cc:919 - { + case 425: // act: "ACTION_TRANSFORMATION_CSS_DECODE" +#line 2971 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::CssDecode(yystack_[0].value.as < std::string > ())); } -#line 5230 "seclang-parser.cc" // lalr1.cc:919 +#line 5517 "seclang-parser.cc" break; - case 420: -#line 2926 "seclang-parser.yy" // lalr1.cc:919 - { + case 426: // act: "ACTION_TRANSFORMATION_TRIM" +#line 2975 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Trim(yystack_[0].value.as < std::string > ())); } -#line 5238 "seclang-parser.cc" // lalr1.cc:919 +#line 5525 "seclang-parser.cc" break; - case 421: -#line 2930 "seclang-parser.yy" // lalr1.cc:919 - { + case 427: // act: "ACTION_TRANSFORMATION_TRIM_LEFT" +#line 2979 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::TrimLeft(yystack_[0].value.as < std::string > ())); } -#line 5246 "seclang-parser.cc" // lalr1.cc:919 +#line 5533 "seclang-parser.cc" break; - case 422: -#line 2934 "seclang-parser.yy" // lalr1.cc:919 - { + case 428: // act: "ACTION_TRANSFORMATION_TRIM_RIGHT" +#line 2983 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::TrimRight(yystack_[0].value.as < std::string > ())); } -#line 5254 "seclang-parser.cc" // lalr1.cc:919 +#line 5541 "seclang-parser.cc" break; - case 423: -#line 2938 "seclang-parser.yy" // lalr1.cc:919 - { + case 429: // act: "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" +#line 2987 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::NormalisePathWin(yystack_[0].value.as < std::string > ())); } -#line 5262 "seclang-parser.cc" // lalr1.cc:919 +#line 5549 "seclang-parser.cc" break; - case 424: -#line 2942 "seclang-parser.yy" // lalr1.cc:919 - { + case 430: // act: "ACTION_TRANSFORMATION_NORMALISE_PATH" +#line 2991 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::NormalisePath(yystack_[0].value.as < std::string > ())); } -#line 5270 "seclang-parser.cc" // lalr1.cc:919 +#line 5557 "seclang-parser.cc" break; - case 425: -#line 2946 "seclang-parser.yy" // lalr1.cc:919 - { + case 431: // act: "ACTION_TRANSFORMATION_LENGTH" +#line 2995 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Length(yystack_[0].value.as < std::string > ())); } -#line 5278 "seclang-parser.cc" // lalr1.cc:919 +#line 5565 "seclang-parser.cc" break; - case 426: -#line 2950 "seclang-parser.yy" // lalr1.cc:919 - { + case 432: // act: "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" +#line 2999 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Utf8ToUnicode(yystack_[0].value.as < std::string > ())); } -#line 5286 "seclang-parser.cc" // lalr1.cc:919 +#line 5573 "seclang-parser.cc" break; - case 427: -#line 2954 "seclang-parser.yy" // lalr1.cc:919 - { + case 433: // act: "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" +#line 3003 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveCommentsChar(yystack_[0].value.as < std::string > ())); } -#line 5294 "seclang-parser.cc" // lalr1.cc:919 +#line 5581 "seclang-parser.cc" break; - case 428: -#line 2958 "seclang-parser.yy" // lalr1.cc:919 - { + case 434: // act: "ACTION_TRANSFORMATION_REMOVE_COMMENTS" +#line 3007 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveComments(yystack_[0].value.as < std::string > ())); } -#line 5302 "seclang-parser.cc" // lalr1.cc:919 +#line 5589 "seclang-parser.cc" break; - case 429: -#line 2962 "seclang-parser.yy" // lalr1.cc:919 - { + case 435: // act: "ACTION_TRANSFORMATION_REPLACE_COMMENTS" +#line 3011 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ReplaceComments(yystack_[0].value.as < std::string > ())); } -#line 5310 "seclang-parser.cc" // lalr1.cc:919 +#line 5597 "seclang-parser.cc" break; - case 430: -#line 2969 "seclang-parser.yy" // lalr1.cc:919 - { + case 436: // setvar_action: "NOT" var +#line 3018 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::unsetOperation, std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5318 "seclang-parser.cc" // lalr1.cc:919 +#line 5605 "seclang-parser.cc" break; - case 431: -#line 2973 "seclang-parser.yy" // lalr1.cc:919 - { + case 437: // setvar_action: var +#line 3022 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::setToOneOperation, std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5326 "seclang-parser.cc" // lalr1.cc:919 +#line 5613 "seclang-parser.cc" break; - case 432: -#line 2977 "seclang-parser.yy" // lalr1.cc:919 - { + case 438: // setvar_action: var SETVAR_OPERATION_EQUALS run_time_string +#line 3026 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::setOperation, std::move(yystack_[2].value.as < std::unique_ptr > ()), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5334 "seclang-parser.cc" // lalr1.cc:919 +#line 5621 "seclang-parser.cc" break; - case 433: -#line 2981 "seclang-parser.yy" // lalr1.cc:919 - { + case 439: // setvar_action: var SETVAR_OPERATION_EQUALS_PLUS run_time_string +#line 3030 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::sumAndSetOperation, std::move(yystack_[2].value.as < std::unique_ptr > ()), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5342 "seclang-parser.cc" // lalr1.cc:919 +#line 5629 "seclang-parser.cc" break; - case 434: -#line 2985 "seclang-parser.yy" // lalr1.cc:919 - { + case 440: // setvar_action: var SETVAR_OPERATION_EQUALS_MINUS run_time_string +#line 3034 "seclang-parser.yy" + { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::substractAndSetOperation, std::move(yystack_[2].value.as < std::unique_ptr > ()), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5350 "seclang-parser.cc" // lalr1.cc:919 +#line 5637 "seclang-parser.cc" break; - case 435: -#line 2992 "seclang-parser.yy" // lalr1.cc:919 - { + case 441: // run_time_string: run_time_string "FREE_TEXT_QUOTE_MACRO_EXPANSION" +#line 3041 "seclang-parser.yy" + { yystack_[1].value.as < std::unique_ptr > ()->appendText(yystack_[0].value.as < std::string > ()); yylhs.value.as < std::unique_ptr > () = std::move(yystack_[1].value.as < std::unique_ptr > ()); } -#line 5359 "seclang-parser.cc" // lalr1.cc:919 +#line 5646 "seclang-parser.cc" break; - case 436: -#line 2997 "seclang-parser.yy" // lalr1.cc:919 - { + case 442: // run_time_string: run_time_string var +#line 3046 "seclang-parser.yy" + { yystack_[1].value.as < std::unique_ptr > ()->appendVar(std::move(yystack_[0].value.as < std::unique_ptr > ())); yylhs.value.as < std::unique_ptr > () = std::move(yystack_[1].value.as < std::unique_ptr > ()); } -#line 5368 "seclang-parser.cc" // lalr1.cc:919 +#line 5655 "seclang-parser.cc" break; - case 437: -#line 3002 "seclang-parser.yy" // lalr1.cc:919 - { + case 443: // run_time_string: "FREE_TEXT_QUOTE_MACRO_EXPANSION" +#line 3051 "seclang-parser.yy" + { std::unique_ptr r(new RunTimeString()); r->appendText(yystack_[0].value.as < std::string > ()); yylhs.value.as < std::unique_ptr > () = std::move(r); } -#line 5378 "seclang-parser.cc" // lalr1.cc:919 +#line 5665 "seclang-parser.cc" break; - case 438: -#line 3008 "seclang-parser.yy" // lalr1.cc:919 - { + case 444: // run_time_string: var +#line 3057 "seclang-parser.yy" + { std::unique_ptr r(new RunTimeString()); r->appendVar(std::move(yystack_[0].value.as < std::unique_ptr > ())); yylhs.value.as < std::unique_ptr > () = std::move(r); } -#line 5388 "seclang-parser.cc" // lalr1.cc:919 +#line 5675 "seclang-parser.cc" break; -#line 5392 "seclang-parser.cc" // lalr1.cc:919 +#line 5679 "seclang-parser.cc" + default: break; } @@ -5404,7 +5692,6 @@ namespace yy { YY_SYMBOL_PRINT ("-> $$ =", yylhs); yypop_ (yylen); yylen = 0; - YY_STACK_PRINT (); // Shift the result of the reduction. yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); @@ -5420,7 +5707,9 @@ namespace yy { if (!yyerrstatus_) { ++yynerrs_; - error (yyla.location, yysyntax_error_ (yystack_[0].state, yyla)); + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); } @@ -5431,7 +5720,7 @@ namespace yy { error, discard it. */ // Return failure if at end of input. - if (yyla.type_get () == yyeof_) + if (yyla.kind () == symbol_kind::S_YYEOF) YYABORT; else if (!yyla.empty ()) { @@ -5457,6 +5746,7 @@ namespace yy { this YYERROR. */ yypop_ (yylen); yylen = 0; + YY_STACK_PRINT (); goto yyerrlab1; @@ -5465,37 +5755,39 @@ namespace yy { `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } { stack_symbol_type error_token; - for (;;) - { - yyn = yypact_[yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += yyterror_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } yyerror_range[2].location = yyla.location; YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); // Shift the error token. - error_token.state = yyn; + error_token.state = state_type (yyn); yypush_ ("Shifting", YY_MOVE (error_token)); } goto yynewstate; @@ -5527,6 +5819,7 @@ namespace yy { /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ yypop_ (yylen); + YY_STACK_PRINT (); while (1 < yystack_.size ()) { yy_destroy_ ("Cleanup: popping", yystack_[0]); @@ -5560,18 +5853,100 @@ namespace yy { error (yyexc.location, yyexc.what ()); } - // Generate an error message. + /* 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::yysyntax_error_ (state_type yystate, const symbol_type& yyla) const + seclang_parser::yytnamerr_ (const char *yystr) { - // Number of reported tokens (one for the "unexpected", one per - // "expected"). - size_t yycount = 0; - // Its maximum. - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - // Arguments of yyformat. - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + 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; + } + + std::string + seclang_parser::symbol_name (symbol_kind_type yysymbol) + { + return yytnamerr_ (yytname_[yysymbol]); + } + + + + // seclang_parser::context. + seclang_parser::context::context (const seclang_parser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} + + int + seclang_parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { + // Actual number of expected tokens + int yycount = 0; + + int yyn = yypact_[+yyparser_.yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + // Stay within bounds of both yycheck and yytname. + int yychecklim = yylast_ - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + for (int yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror + && !yy_table_value_is_error_ (yytable_[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (symbol_kind_type, yyx); + } + } + + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = symbol_kind::S_YYEMPTY; + return yycount; + } + + + + int + seclang_parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action @@ -5590,41 +5965,32 @@ namespace yy { - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state - merging (from LALR or IELR) and default reductions corrupt the - expected token list. However, the list is correct for - canonical LR with one exception: it will still contain any - token that will not be accepted due to an error action in a - later state. + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. */ - if (!yyla.empty ()) + + if (!yyctx.lookahead ().empty ()) { - int yytoken = yyla.type_get (); - yyarg[yycount++] = yytname_[yytoken]; - int yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - // Stay within bounds of both yycheck and yytname. - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - for (int yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ - && !yy_table_value_is_error_ (yytable_[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - break; - } - else - yyarg[yycount++] = yytname_[yyx]; - } - } + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; } + return 0; + } + + // Generate an error message. + std::string + seclang_parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); char const* yyformat = YY_NULLPTR; switch (yycount) @@ -5645,11 +6011,11 @@ namespace yy { std::string yyres; // Argument number. - size_t yyi = 0; + std::ptrdiff_t yyi = 0; for (char const* yyp = yyformat; *yyp; ++yyp) if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) { - yyres += yytnamerr_ (yyarg[yyi++]); + yyres += symbol_name (yyarg[yyi++]); ++yyp; } else @@ -5658,208 +6024,244 @@ namespace yy { } - const short seclang_parser::yypact_ninf_ = -404; + const short seclang_parser::yypact_ninf_ = -402; const signed char seclang_parser::yytable_ninf_ = -1; const short seclang_parser::yypact_[] = { - 2743, -404, -252, -404, 6, -404, -152, -404, -404, -404, - -404, -404, -272, -404, -404, -404, -404, -404, -287, -404, - -404, -404, -150, -145, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -143, -404, -404, - -144, -404, -139, -404, -134, -129, -404, -258, -89, -89, - -404, -404, -404, -404, -127, -297, -404, -404, -404, 1475, - 1475, 1475, -89, -266, -125, -404, -404, -404, -123, -404, - -404, -404, -404, -404, -404, -404, -404, -404, 1475, -89, - 2885, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, 2313, -254, -404, -404, -404, -404, -404, - -404, -404, -264, -404, -404, -404, -404, -121, -119, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, 2444, - -404, 2444, -404, 2444, -404, -404, -404, -404, -404, -404, - -404, -404, 2444, -404, -404, -404, -404, -404, -404, 2444, - 2444, 2444, 2444, -404, -404, -404, -404, 2444, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, 3069, -404, 4, -404, - -404, -404, -404, -404, -404, 2641, 2641, -153, -151, -149, - -147, -142, -140, -137, -135, -133, -131, -128, -126, -124, - -122, -120, -118, -404, -116, -114, -112, -110, -404, -404, - -108, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -106, -404, -404, -404, - -404, -404, 455, -404, -404, -404, -103, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, 544, - 633, 964, 1053, 1142, -101, -99, 1566, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, 8, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, 1985, -404, -404, -404, -404, 2641, -76, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, 2533, 2533, 2533, 2533, 2533, 2533, 2533, - 2533, 2533, 5, 3069, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, - -404, -404, 2533, -404, -404, -404, -404, 2533, -404, -404, - 2533, -404, -404, 2533, -404, -404, 2533, -404, -404, 2533, - -404, -404, -404, -404, 10, 1657, 2116, 2444, 2444, 2444, - -404, -404, 2444, 2444, 2444, -404, 2444, 2444, 2444, 2444, - 2444, 2444, 2444, 2444, 2444, 2444, 2444, 2444, 2444, 2444, - 2444, -404, 2444, 2444, 2444, 2444, -404, -404, 2444, 2444, - 2444, 2444, 2444, -89, -404, 2533, -404, 2444, 2444, 2444, - -404, -404, -404, -404, -404, 2641, 2641, -404, -404, 2533, - 2533, 2533, 2533, 2533, 2533, 2533, 2533, 2533, 2533, 2533, - 2533, 2533, 2533, 2533, 2533, 2533, 2533, 2533, 2533, 2533, - 2533, 2533, 2533, 2533, 2533, 2533, 2533, 2533, 2533, 2533, - -404, 2533, 2533, 2533, -404, -404 + 2776, -402, -277, -402, -100, -402, -157, -402, -402, -402, + -402, -402, -292, -402, -402, -402, -402, -402, -274, -402, + -402, -402, -155, -153, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -149, + -402, -402, -150, -402, -145, -402, -146, -135, -402, -284, + -90, -90, -402, -402, -402, -402, -133, -301, -402, -402, + -402, 1492, 1492, 1492, -90, -271, -131, -402, -402, -402, + -129, -402, -402, -402, -402, -402, -402, -402, -402, -402, + 1492, -90, 2920, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, 2340, -259, -402, -402, -402, + -402, -402, -402, -402, -265, -402, -402, -402, -402, -127, + -125, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, 2473, -402, 2473, -402, 2473, -402, -402, -402, -402, + -402, -402, -402, -402, 2473, -402, -402, -402, -402, -402, + -402, 2473, 2473, 2473, 2473, -402, -402, -402, -402, 2473, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, 3107, -402, + 2, -402, -402, -402, -402, -402, -402, 2672, 2672, -159, + -156, -154, -152, -148, -142, -140, -138, -134, -132, -130, + -128, -126, -124, -122, -120, -118, -402, -116, -114, -112, + -110, -402, -402, -108, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -104, + -402, -402, -402, -402, -402, 460, -402, -402, -402, -102, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, 550, 640, 975, 1065, 1155, -99, -97, 1584, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, 16, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, 2008, -402, -402, -402, + -402, 2672, -50, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, 2563, 2563, 2563, 2563, + 2563, 2563, 2563, 2563, 2563, 3, 3107, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, 2563, -402, -402, + -402, -402, 2563, -402, -402, 2563, -402, -402, 2563, -402, + -402, 2563, -402, -402, 2563, -402, -402, -402, -402, 8, + 1676, 2141, 2473, 2473, 2473, -402, -402, 2473, 2473, 2473, + -402, 2473, 2473, 2473, 2473, 2473, 2473, 2473, 2473, 2473, + 2473, 2473, 2473, 2473, 2473, 2473, 2473, -402, 2473, 2473, + 2473, 2473, -402, -402, 2473, 2473, 2473, 2473, 2473, -90, + -402, 2563, -402, 2473, 2473, 2473, -402, -402, -402, -402, + -402, 2672, 2672, -402, -402, 2563, 2563, 2563, 2563, 2563, + 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, + 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, + 2563, 2563, 2563, 2563, 2563, 2563, 2563, -402, 2563, 2563, + 2563, -402, -402 }; - const unsigned short + const short seclang_parser::yydefact_[] = { - 0, 2, 0, 140, 0, 88, 0, 87, 91, 92, - 7, 6, 0, 11, 14, 12, 13, 17, 0, 125, - 124, 93, 0, 0, 101, 102, 103, 104, 98, 126, - 105, 106, 138, 137, 109, 110, 111, 0, 129, 127, - 0, 128, 0, 130, 0, 0, 114, 0, 0, 0, - 79, 149, 150, 151, 0, 0, 117, 119, 118, 0, - 0, 0, 0, 0, 0, 26, 24, 25, 0, 139, - 145, 146, 147, 144, 148, 115, 116, 143, 0, 0, - 0, 4, 73, 5, 97, 96, 15, 16, 90, 89, - 9, 10, 8, 20, 19, 18, 95, 94, 100, 99, - 84, 83, 131, 132, 86, 85, 133, 134, 113, 112, - 82, 80, 81, 0, 0, 331, 332, 333, 334, 335, - 336, 337, 0, 341, 342, 343, 344, 0, 0, 352, - 353, 354, 355, 356, 357, 358, 359, 360, 361, 0, - 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, - 373, 374, 0, 376, 377, 378, 379, 380, 381, 0, - 0, 0, 0, 387, 388, 389, 390, 0, 398, 399, - 400, 401, 413, 419, 404, 405, 406, 417, 418, 425, - 407, 403, 412, 424, 423, 396, 395, 394, 428, 427, - 416, 414, 429, 415, 402, 397, 420, 421, 422, 408, - 411, 410, 409, 426, 392, 393, 0, 76, 30, 32, - 78, 108, 107, 135, 136, 0, 0, 163, 166, 169, - 172, 175, 178, 181, 184, 187, 190, 193, 196, 199, - 202, 205, 208, 261, 250, 211, 247, 253, 262, 263, - 220, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 291, 290, 294, - 293, 292, 295, 297, 296, 298, 256, 299, 300, 301, - 303, 302, 224, 304, 305, 257, 260, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 317, 315, 316, 228, - 232, 240, 244, 236, 214, 217, 0, 319, 318, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 120, 153, 158, 121, 122, 123, 22, 21, 23, 28, - 27, 141, 142, 0, 152, 77, 1, 3, 0, 431, - 386, 351, 350, 349, 339, 338, 340, 346, 345, 348, - 347, 437, 438, 362, 363, 366, 375, 382, 383, 384, - 385, 391, 0, 0, 160, 159, 161, 162, 164, 165, - 167, 168, 170, 171, 173, 174, 176, 177, 179, 180, - 182, 183, 185, 186, 188, 189, 191, 192, 194, 195, - 197, 198, 200, 201, 203, 204, 206, 207, 248, 249, - 209, 210, 245, 246, 251, 252, 218, 219, 254, 255, - 222, 223, 221, 258, 259, 226, 227, 225, 230, 231, - 229, 238, 239, 237, 242, 243, 241, 234, 235, 233, - 212, 213, 215, 216, 0, 0, 0, 0, 0, 0, - 38, 39, 0, 0, 0, 72, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 37, 0, 0, 0, 0, 40, 41, 0, 0, - 0, 0, 0, 75, 33, 35, 430, 0, 0, 0, - 435, 436, 29, 31, 154, 0, 0, 155, 34, 36, - 71, 56, 55, 57, 58, 43, 59, 52, 60, 42, - 61, 62, 63, 64, 65, 66, 67, 53, 68, 69, - 70, 44, 45, 46, 47, 48, 49, 50, 51, 54, - 74, 432, 433, 434, 157, 156 + 0, 2, 0, 143, 0, 89, 0, 88, 92, 93, + 7, 6, 0, 11, 14, 12, 13, 17, 0, 126, + 125, 94, 0, 0, 102, 103, 104, 105, 99, 127, + 106, 107, 141, 140, 110, 111, 112, 128, 129, 0, + 132, 130, 0, 131, 0, 133, 0, 0, 115, 0, + 0, 0, 80, 152, 153, 154, 0, 0, 118, 120, + 119, 0, 0, 0, 0, 0, 0, 26, 24, 25, + 0, 142, 148, 149, 150, 147, 151, 116, 117, 146, + 0, 0, 0, 4, 74, 5, 98, 97, 15, 16, + 91, 90, 9, 10, 8, 20, 19, 18, 96, 95, + 101, 100, 85, 84, 134, 135, 87, 86, 136, 137, + 114, 113, 83, 81, 82, 0, 0, 337, 338, 339, + 340, 341, 342, 343, 0, 347, 348, 349, 350, 0, + 0, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 0, 370, 0, 371, 0, 373, 374, 375, 376, + 377, 378, 379, 380, 0, 382, 383, 384, 385, 386, + 387, 0, 0, 0, 0, 393, 394, 395, 396, 0, + 404, 405, 406, 407, 419, 425, 410, 411, 412, 423, + 424, 431, 413, 409, 418, 430, 429, 402, 401, 400, + 434, 433, 422, 420, 435, 421, 408, 403, 426, 427, + 428, 414, 417, 416, 415, 432, 398, 399, 0, 77, + 30, 32, 79, 109, 108, 138, 139, 0, 0, 166, + 169, 172, 175, 178, 181, 184, 187, 190, 193, 196, + 199, 202, 205, 208, 211, 214, 267, 256, 217, 253, + 259, 268, 269, 226, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 297, 296, 300, 299, 298, 301, 303, 302, 304, 262, + 305, 306, 307, 309, 308, 230, 310, 311, 263, 266, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 323, + 321, 322, 234, 238, 246, 250, 242, 220, 223, 0, + 325, 324, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 121, 156, 161, 122, 123, 124, 22, + 21, 23, 28, 27, 144, 145, 0, 155, 78, 1, + 3, 0, 437, 392, 357, 356, 355, 345, 344, 346, + 352, 351, 354, 353, 443, 444, 368, 369, 372, 381, + 388, 389, 390, 391, 397, 0, 0, 163, 162, 164, + 165, 167, 168, 170, 171, 173, 174, 176, 177, 179, + 180, 182, 183, 185, 186, 188, 189, 191, 192, 194, + 195, 197, 198, 200, 201, 203, 204, 206, 207, 209, + 210, 212, 213, 254, 255, 215, 216, 251, 252, 257, + 258, 224, 225, 260, 261, 228, 229, 227, 264, 265, + 232, 233, 231, 236, 237, 235, 244, 245, 243, 248, + 249, 247, 240, 241, 239, 218, 219, 221, 222, 0, + 0, 0, 0, 0, 0, 38, 39, 0, 0, 0, + 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, + 0, 0, 40, 41, 0, 0, 0, 0, 0, 76, + 33, 35, 436, 0, 0, 0, 441, 442, 29, 31, + 157, 0, 0, 158, 34, 36, 72, 56, 55, 57, + 58, 43, 59, 52, 60, 42, 61, 62, 63, 64, + 65, 66, 67, 53, 68, 69, 70, 71, 44, 45, + 46, 47, 48, 49, 50, 51, 54, 75, 438, 439, + 440, 160, 159 }; const short seclang_parser::yypgoto_[] = { - -404, -404, -68, -404, -45, -185, -404, -403, -404, -404, - -55, -265, -59, -315, -404, -132 + -402, -402, -74, -402, -47, -170, -402, -401, -402, -402, + -51, -254, -61, -316, -402, -136 }; const short seclang_parser::yydefgoto_[] = { - -1, 80, 81, 82, 207, 208, 473, 474, 83, 333, - 320, 321, 352, 209, 340, 353 + 0, 82, 83, 84, 209, 210, 479, 480, 85, 336, + 323, 324, 355, 211, 343, 356 }; - const unsigned short + const short seclang_parser::yytable_[] = { - 322, 322, 322, 213, 210, 323, 324, 363, 363, 354, - 113, 355, 337, 214, 435, 93, 435, 325, 94, 322, - 356, 362, 95, 334, 477, 478, 479, 357, 358, 359, - 360, 90, 91, 488, 335, 361, 92, 326, 327, 344, - 345, 434, 328, 110, 346, 111, 112, 341, 483, 342, - 343, 84, 85, 0, 339, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 0, 86, 87, - 412, 88, 89, 96, 97, 0, 364, 365, 98, 99, - 100, 101, 102, 103, 104, 105, 0, 417, 420, 423, - 426, 429, 106, 107, 108, 109, 211, 212, 329, 330, - 331, 332, 347, 348, 349, 350, 366, 367, 368, 369, - 370, 371, 372, 373, 0, 0, 0, 374, 375, 376, - 377, 475, 378, 379, 380, 381, 382, 383, 384, 385, - 0, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 206, 413, 414, 430, 431, - 432, 433, 0, 0, 0, 0, 0, 322, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 476, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 481, 481, 481, 481, 481, 481, - 481, 481, 481, 0, 489, 490, 491, 492, 0, 0, - 493, 494, 495, 0, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 482, - 511, 512, 513, 514, 484, 0, 515, 516, 517, 518, - 519, 0, 0, 0, 0, 521, 522, 523, 0, 0, - 0, 0, 0, 481, 0, 0, 0, 0, 481, 0, - 0, 481, 0, 0, 481, 0, 0, 481, 0, 0, - 481, 0, 0, 0, 0, 0, 487, 0, 0, 0, + 325, 325, 325, 215, 212, 366, 366, 357, 340, 358, + 115, 326, 327, 216, 440, 92, 93, 328, 359, 325, + 94, 112, 440, 113, 114, 360, 361, 362, 363, 337, + 86, 87, 95, 364, 338, 96, 329, 330, 365, 97, + 494, 331, 347, 348, 88, 89, 344, 349, 345, 346, + 489, 483, 484, 485, 342, 439, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 0, 417, + 90, 91, 98, 99, 100, 101, 367, 368, 102, 103, + 104, 105, 106, 107, 108, 109, 422, 425, 428, 431, + 434, 0, 110, 111, 213, 214, 332, 333, 334, 335, + 350, 351, 352, 353, 369, 370, 0, 371, 372, 373, + 374, 375, 376, 0, 0, 377, 378, 0, 0, 0, + 481, 379, 380, 381, 382, 383, 384, 0, 0, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 0, 208, 413, + 414, 418, 419, 0, 435, 436, 437, 438, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 481, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 524, 525, 520, 0, - 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, - 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, - 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, - 481, 0, 481, 481, 481, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 217, 218, 219, 220, 221, 222, 223, + 482, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 0, 495, 496, 497, 498, 0, + 0, 499, 500, 501, 0, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 488, 518, 519, 520, 521, 490, 0, 522, 523, + 524, 525, 526, 0, 0, 0, 0, 528, 529, 530, + 0, 0, 0, 0, 0, 0, 487, 0, 0, 0, + 0, 487, 0, 0, 487, 0, 0, 487, 0, 0, + 487, 0, 0, 487, 0, 0, 0, 0, 0, 493, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 487, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 531, 532, 527, 0, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 0, 487, 487, 487, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 354, 0, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 415, 416, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 354, 0, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 420, 421, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 354, 0, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 0, 423, 424, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, @@ -5868,40 +6270,7 @@ namespace yy { 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 351, 0, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 0, 410, 411, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 351, 0, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 0, 415, 416, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 351, 0, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 0, 418, 419, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 217, 218, 219, 220, 221, 222, 223, + 304, 305, 306, 307, 308, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, @@ -5910,7 +6279,50 @@ namespace yy { 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 217, 218, 219, 220, 221, 222, 223, 224, + 304, 305, 306, 307, 308, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 354, 0, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 0, 426, 427, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 354, 0, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 0, 429, 430, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 354, 0, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 0, 432, 433, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, @@ -5919,128 +6331,7 @@ namespace yy { 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 351, 0, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 0, 421, 422, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 351, 0, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 0, 424, 425, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 351, 0, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 0, 427, 428, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 485, 486, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 0, 0, 0, 0, 436, 437, - 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, - 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 0, 458, 459, 460, 461, 462, 463, 464, 465, 466, - 467, 468, 469, 470, 471, 472, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 0, 0, 0, 0, 0, - 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, - 457, 0, 458, 459, 460, 461, 462, 463, 464, 465, - 466, 467, 468, 469, 470, 471, 472, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 351, 0, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 0, 0, 0, 0, 338, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 351, - 0, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 217, 218, 219, 220, 221, 222, + 305, 306, 307, 308, 491, 492, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, @@ -6049,18 +6340,78 @@ namespace yy { 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 0, 0, 0, 0, 0, 0, 307, 308, + 303, 304, 305, 306, 307, 308, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 319, 320, 321, 322, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 0, 0, + 0, 0, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 0, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 0, 0, 0, 0, 0, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 0, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 354, 0, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 0, 0, 0, 0, 341, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 354, 0, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, @@ -6069,416 +6420,95 @@ namespace yy { 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 0, 0, 0, 1, 0, 0, 0, 2, 3, 0, + 306, 307, 308, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 0, 0, 0, 0, 0, 0, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 0, 0, 0, 0, 1, 0, 0, 0, + 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 351, 0, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 0, 0, 0, 0, 0, 0, 0, 0, + 354, 0, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 480, 0, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4, 336, 0, 0, 0, 2, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 486, 0, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, + 339, 0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 4, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 4, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 113, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 0, 0, - 0, 0, 0, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205 + 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 115, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 0, 0, 0, + 0, 0, 0, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207 }; const short seclang_parser::yycheck_[] = { - 59, 60, 61, 300, 49, 60, 61, 3, 3, 141, - 99, 143, 80, 310, 6, 302, 6, 62, 305, 78, - 152, 206, 309, 78, 100, 101, 102, 159, 160, 161, - 162, 303, 304, 436, 79, 167, 308, 303, 304, 303, - 304, 306, 308, 301, 308, 303, 304, 301, 363, 303, - 304, 303, 304, -1, 113, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, -1, 142, 143, - 282, 303, 304, 303, 304, -1, 215, 216, 303, 304, - 303, 304, 306, 307, 303, 304, -1, 299, 300, 301, - 302, 303, 306, 307, 303, 304, 303, 304, 303, 304, - 303, 304, 303, 304, 303, 304, 339, 340, 339, 340, - 339, 340, 339, 340, -1, -1, -1, 339, 340, 339, - 340, 333, 339, 340, 339, 340, 339, 340, 339, 340, - -1, 339, 340, 339, 340, 339, 340, 339, 340, 339, - 340, 339, 340, 339, 340, 339, 340, 339, 340, 339, - 340, 339, 340, 339, 340, 324, 339, 340, 339, 340, - 339, 340, -1, -1, -1, -1, -1, 306, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 338, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 353, 354, 355, 356, 357, 358, - 359, 360, 361, -1, 436, 437, 438, 439, -1, -1, - 442, 443, 444, -1, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 324, - 462, 463, 464, 465, 324, -1, 468, 469, 470, 471, - 472, -1, -1, -1, -1, 477, 478, 479, -1, -1, - -1, -1, -1, 412, -1, -1, -1, -1, 417, -1, - -1, 420, -1, -1, 423, -1, -1, 426, -1, -1, - 429, -1, -1, -1, -1, -1, 435, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 475, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 485, 486, 473, -1, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, - 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, - 519, -1, 521, 522, 523, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 323, -1, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, -1, 339, 340, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 323, -1, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, -1, 339, 340, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 323, -1, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, -1, 339, 340, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 323, -1, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, -1, 339, 340, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 323, -1, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, -1, 339, 340, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 323, -1, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - -1, 339, 340, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, -1, -1, -1, -1, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - -1, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, -1, -1, -1, -1, -1, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, -1, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 323, -1, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, -1, -1, -1, -1, 103, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 323, - -1, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, -1, -1, -1, -1, -1, -1, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - -1, -1, -1, 0, -1, -1, -1, 4, 5, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 323, -1, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 323, -1, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 141, 0, -1, -1, -1, 4, - 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 141, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 99, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, -1, -1, - -1, -1, -1, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235 - }; - - const unsigned short - seclang_parser::yystos_[] = - { - 0, 0, 4, 5, 141, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 342, 343, 344, 349, 303, 304, 142, 143, 303, 304, - 303, 304, 308, 302, 305, 309, 303, 304, 303, 304, - 303, 304, 306, 307, 303, 304, 306, 307, 303, 304, - 301, 303, 304, 99, 144, 145, 146, 147, 148, 149, + 61, 62, 63, 304, 51, 3, 3, 143, 82, 145, + 100, 62, 63, 314, 6, 307, 308, 64, 154, 80, + 312, 305, 6, 307, 308, 161, 162, 163, 164, 80, + 307, 308, 306, 169, 81, 309, 307, 308, 208, 313, + 441, 312, 307, 308, 144, 145, 305, 312, 307, 308, + 366, 101, 102, 103, 115, 309, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, @@ -6487,61 +6517,399 @@ namespace yy { 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 324, 345, 346, 354, - 345, 303, 304, 300, 310, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 324, 325, 326, 327, + 230, 231, 232, 233, 234, 235, 236, 237, -1, 285, + 307, 308, 307, 308, 307, 308, 217, 218, 307, 308, + 310, 311, 307, 308, 310, 311, 302, 303, 304, 305, + 306, -1, 307, 308, 307, 308, 307, 308, 307, 308, + 307, 308, 307, 308, 343, 344, -1, 343, 344, 343, + 344, 343, 344, -1, -1, 343, 344, -1, -1, -1, + 336, 343, 344, 343, 344, 343, 344, -1, -1, 343, + 344, 343, 344, 343, 344, 343, 344, 343, 344, 343, + 344, 343, 344, 343, 344, 343, 344, 343, 344, 343, + 344, 343, 344, 343, 344, 343, 344, -1, 328, 343, + 344, 343, 344, -1, 343, 344, 343, 344, 309, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 341, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 356, 357, 358, 359, 360, + 361, 362, 363, 364, -1, 441, 442, 443, 444, -1, + -1, 447, 448, 449, -1, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 328, 468, 469, 470, 471, 328, -1, 474, 475, + 476, 477, 478, -1, -1, -1, -1, 483, 484, 485, + -1, -1, -1, -1, -1, -1, 417, -1, -1, -1, + -1, 422, -1, -1, 425, -1, -1, 428, -1, -1, + 431, -1, -1, 434, -1, -1, -1, -1, -1, 440, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 481, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 491, 492, 479, -1, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, -1, 528, 529, 530, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 327, -1, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, -1, 343, 344, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 327, -1, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, -1, 343, 344, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 327, -1, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, -1, 343, 344, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 327, -1, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, -1, 343, 344, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 327, -1, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, -1, 343, 344, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 327, -1, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, -1, 343, 344, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 351, 352, 353, 351, 351, 345, 303, 304, 308, 303, - 304, 303, 304, 350, 351, 345, 0, 343, 103, 353, - 355, 301, 303, 304, 303, 304, 308, 303, 304, 303, - 304, 323, 353, 356, 356, 356, 356, 356, 356, 356, - 356, 356, 346, 3, 353, 353, 339, 340, 339, 340, - 339, 340, 339, 340, 339, 340, 339, 340, 339, 340, - 339, 340, 339, 340, 339, 340, 339, 340, 339, 340, - 339, 340, 339, 340, 339, 340, 339, 340, 339, 340, - 339, 340, 339, 340, 339, 340, 339, 340, 339, 340, - 339, 340, 356, 339, 340, 339, 340, 356, 339, 340, - 356, 339, 340, 356, 339, 340, 356, 339, 340, 356, - 339, 340, 339, 340, 352, 6, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 347, 348, 356, 353, 100, 101, 102, - 323, 353, 324, 354, 324, 8, 9, 353, 348, 356, - 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, - 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, - 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, - 345, 356, 356, 356, 353, 353 + 338, 339, 340, 341, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, -1, -1, + -1, -1, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, -1, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, -1, -1, -1, -1, -1, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, -1, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 327, -1, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + -1, -1, -1, -1, 104, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 327, -1, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, -1, -1, -1, -1, -1, -1, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, -1, -1, -1, -1, 0, -1, -1, -1, + 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 327, -1, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 327, -1, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 143, + 0, -1, -1, -1, 4, 5, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 143, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 100, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, -1, -1, -1, + -1, -1, -1, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237 }; - const unsigned short + const short + seclang_parser::yystos_[] = + { + 0, 0, 4, 5, 143, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 346, 347, 348, 353, 307, 308, 144, 145, + 307, 308, 307, 308, 312, 306, 309, 313, 307, 308, + 307, 308, 307, 308, 310, 311, 307, 308, 310, 311, + 307, 308, 305, 307, 308, 100, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 328, 349, + 350, 358, 349, 307, 308, 304, 314, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 355, 356, 357, 355, 355, 349, 307, + 308, 312, 307, 308, 307, 308, 354, 355, 349, 0, + 347, 104, 357, 359, 305, 307, 308, 307, 308, 312, + 307, 308, 307, 308, 327, 357, 360, 360, 360, 360, + 360, 360, 360, 360, 360, 350, 3, 357, 357, 343, + 344, 343, 344, 343, 344, 343, 344, 343, 344, 343, + 344, 343, 344, 343, 344, 343, 344, 343, 344, 343, + 344, 343, 344, 343, 344, 343, 344, 343, 344, 343, + 344, 343, 344, 343, 344, 343, 344, 343, 344, 343, + 344, 343, 344, 343, 344, 343, 344, 360, 343, 344, + 343, 344, 360, 343, 344, 360, 343, 344, 360, 343, + 344, 360, 343, 344, 360, 343, 344, 343, 344, 356, + 6, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 351, + 352, 360, 357, 101, 102, 103, 327, 357, 328, 358, + 328, 8, 9, 357, 352, 360, 360, 360, 360, 360, + 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, + 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, + 360, 360, 360, 360, 360, 360, 360, 349, 360, 360, + 360, 357, 357 + }; + + const short seclang_parser::yyr1_[] = { - 0, 341, 342, 342, 342, 343, 344, 344, 344, 344, - 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - 344, 344, 344, 344, 344, 344, 344, 344, 344, 345, - 345, 346, 346, 347, 347, 347, 347, 348, 348, 348, + 0, 345, 346, 346, 346, 347, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, - 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, - 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, - 348, 348, 348, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 350, 351, 351, 352, 352, 352, 352, 352, - 352, 353, 353, 353, 353, 353, 353, 353, 353, 353, + 348, 348, 348, 348, 348, 348, 348, 348, 348, 349, + 349, 350, 350, 351, 351, 351, 351, 352, 352, 352, + 352, 352, 352, 352, 352, 352, 352, 352, 352, 352, + 352, 352, 352, 352, 352, 352, 352, 352, 352, 352, + 352, 352, 352, 352, 352, 352, 352, 352, 352, 352, + 352, 352, 352, 352, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, @@ -6549,29 +6917,39 @@ namespace yy { 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - 353, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 355, 355, 355, 355, 355, 356, 356, 356, 356 + 353, 353, 353, 353, 353, 354, 355, 355, 356, 356, + 356, 356, 356, 356, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 358, 358, 358, 358, 358, 359, 359, 359, 359, + 359, 360, 360, 360, 360 }; - const unsigned char + const signed char seclang_parser::yyr2_[] = { 0, 2, 1, 2, 1, 1, 1, 1, 2, 2, @@ -6581,25 +6959,26 @@ namespace yy { 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 1, 1, 4, 3, 2, 2, 2, 1, - 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, - 2, 1, 1, 1, 2, 2, 2, 2, 1, 2, - 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, - 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, - 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 3, 4, 4, 1, 2, - 2, 2, 2, 1, 2, 2, 1, 2, 2, 1, + 2, 2, 2, 1, 1, 4, 3, 2, 2, 2, + 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, + 2, 2, 1, 1, 1, 2, 2, 2, 2, 1, + 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, + 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, + 4, 1, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, + 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, - 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, - 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, + 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, + 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -6607,27 +6986,27 @@ namespace yy { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 3, 3, 3, 2, 2, 1, 1 + 1, 1, 1, 1, 1, 1, 2, 1, 3, 3, + 3, 2, 2, 1, 1 }; - +#if YYDEBUG || 1 // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - // First, the terminals, then, starting at \a yyntokens_, nonterminals. + // First, the terminals, then, starting at \a YYNTOKENS, nonterminals. const char* const seclang_parser::yytname_[] = { - "\"end of file\"", "error", "$undefined", "\",\"", + "\"end of file\"", "error", "\"invalid token\"", "\",\"", "\"CONFIG_CONTENT_INJECTION\"", "\"CONGIG_DIR_RESPONSE_BODY_MP_CLEAR\"", "PIPE", "NEW_LINE", "VAR_COUNT", "VAR_EXCLUSION", "VARIABLE_ARGS", "VARIABLE_ARGS_POST", "VARIABLE_ARGS_GET", "VARIABLE_FILES_SIZES", @@ -6636,11 +7015,12 @@ namespace yy { "VARIABLE_MATCHED_VARS_NAMES", "VARIABLE_MATCHED_VARS", "VARIABLE_FILES", "VARIABLE_REQUEST_COOKIES", "VARIABLE_REQUEST_HEADERS", "VARIABLE_RESPONSE_HEADERS", "VARIABLE_GEO", - "VARIABLE_REQUEST_COOKIES_NAMES", "VARIABLE_ARGS_COMBINED_SIZE", - "VARIABLE_ARGS_GET_NAMES", "VARIABLE_RULE", "\"Variable ARGS_NAMES\"", - "VARIABLE_ARGS_POST_NAMES", "\"AUTH_TYPE\"", "\"FILES_COMBINED_SIZE\"", - "\"FILES_TMPNAMES\"", "\"FULL_REQUEST\"", "\"FULL_REQUEST_LENGTH\"", - "\"INBOUND_DATA_ERROR\"", "\"MATCHED_VAR\"", "\"MATCHED_VAR_NAME\"", + "VARIABLE_REQUEST_COOKIES_NAMES", "VARIABLE_MULTIPART_PART_HEADERS", + "VARIABLE_ARGS_COMBINED_SIZE", "VARIABLE_ARGS_GET_NAMES", + "VARIABLE_RULE", "\"Variable ARGS_NAMES\"", "VARIABLE_ARGS_POST_NAMES", + "\"AUTH_TYPE\"", "\"FILES_COMBINED_SIZE\"", "\"FILES_TMPNAMES\"", + "\"FULL_REQUEST\"", "\"FULL_REQUEST_LENGTH\"", "\"INBOUND_DATA_ERROR\"", + "\"MATCHED_VAR\"", "\"MATCHED_VAR_NAME\"", "VARIABLE_MULTIPART_BOUNDARY_QUOTED", "VARIABLE_MULTIPART_BOUNDARY_WHITESPACE", "\"MULTIPART_CRLF_LF_LINES\"", "\"MULTIPART_DATA_AFTER\"", "VARIABLE_MULTIPART_DATA_BEFORE", @@ -6677,10 +7057,11 @@ namespace yy { "\"OPERATOR_LE\"", "\"OPERATOR_LT\"", "\"OPERATOR_PM_FROM_FILE\"", "\"OPERATOR_PM\"", "\"OPERATOR_RBL\"", "\"OPERATOR_RSUB\"", "\"Operator RX (content only)\"", "\"OPERATOR_RX\"", - "\"OPERATOR_STR_EQ\"", "\"OPERATOR_STR_MATCH\"", - "\"OPERATOR_UNCONDITIONAL_MATCH\"", "\"OPERATOR_VALIDATE_BYTE_RANGE\"", - "\"OPERATOR_VALIDATE_DTD\"", "\"OPERATOR_VALIDATE_HASH\"", - "\"OPERATOR_VALIDATE_SCHEMA\"", "\"OPERATOR_VALIDATE_URL_ENCODING\"", + "\"OPERATOR_RX_GLOBAL\"", "\"OPERATOR_STR_EQ\"", + "\"OPERATOR_STR_MATCH\"", "\"OPERATOR_UNCONDITIONAL_MATCH\"", + "\"OPERATOR_VALIDATE_BYTE_RANGE\"", "\"OPERATOR_VALIDATE_DTD\"", + "\"OPERATOR_VALIDATE_HASH\"", "\"OPERATOR_VALIDATE_SCHEMA\"", + "\"OPERATOR_VALIDATE_URL_ENCODING\"", "\"OPERATOR_VALIDATE_UTF8_ENCODING\"", "\"OPERATOR_VERIFY_CC\"", "\"OPERATOR_VERIFY_CPF\"", "\"OPERATOR_VERIFY_SSN\"", "\"OPERATOR_VERIFY_SVNR\"", "\"OPERATOR_WITHIN\"", @@ -6753,7 +7134,8 @@ namespace yy { "\"CONFIG_DIR_PCRE_MATCH_LIMIT\"", "\"CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION\"", "\"CONFIG_SEC_CONN_R_STATE_LIMIT\"", "\"CONFIG_SEC_CONN_W_STATE_LIMIT\"", - "\"CONFIG_SEC_SENSOR_ID\"", "\"CONFIG_DIR_REQ_BODY\"", + "\"CONFIG_SEC_SENSOR_ID\"", "\"CONFIG_DIR_ARGS_LIMIT\"", + "\"CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT\"", "\"CONFIG_DIR_REQ_BODY\"", "\"CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT\"", "\"CONFIG_DIR_REQ_BODY_LIMIT\"", "\"CONFIG_DIR_REQ_BODY_LIMIT_ACTION\"", "\"CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT\"", "\"CONFIG_DIR_RES_BODY\"", @@ -6800,75 +7182,76 @@ namespace yy { "variables_may_be_quoted", "var", "act", "setvar_action", "run_time_string", YY_NULLPTR }; +#endif + #if YYDEBUG - const unsigned short + const short seclang_parser::yyrline_[] = { - 0, 707, 707, 711, 712, 715, 720, 726, 732, 736, - 740, 746, 752, 758, 764, 769, 774, 780, 787, 791, - 795, 801, 805, 809, 814, 819, 824, 829, 833, 840, - 844, 851, 857, 867, 876, 886, 895, 908, 912, 916, - 920, 924, 928, 932, 936, 940, 944, 949, 953, 957, - 961, 965, 969, 974, 979, 983, 987, 991, 995, 999, - 1003, 1007, 1011, 1015, 1019, 1023, 1027, 1031, 1035, 1039, - 1043, 1047, 1051, 1065, 1066, 1091, 1110, 1125, 1149, 1205, - 1209, 1213, 1217, 1221, 1225, 1229, 1233, 1237, 1246, 1250, - 1255, 1258, 1263, 1268, 1273, 1278, 1281, 1286, 1289, 1294, - 1299, 1302, 1307, 1312, 1317, 1322, 1327, 1332, 1337, 1340, - 1345, 1350, 1355, 1360, 1363, 1368, 1373, 1378, 1391, 1404, - 1417, 1430, 1443, 1469, 1497, 1509, 1529, 1557, 1562, 1567, - 1576, 1581, 1585, 1589, 1593, 1597, 1601, 1605, 1610, 1615, - 1627, 1633, 1637, 1641, 1652, 1661, 1662, 1669, 1674, 1679, - 1733, 1740, 1748, 1785, 1789, 1796, 1801, 1807, 1813, 1819, - 1826, 1836, 1840, 1844, 1848, 1852, 1856, 1860, 1864, 1868, - 1872, 1876, 1880, 1884, 1888, 1892, 1896, 1900, 1904, 1908, - 1912, 1916, 1920, 1924, 1928, 1932, 1936, 1940, 1944, 1948, - 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, - 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, - 2032, 2036, 2040, 2044, 2048, 2052, 2056, 2060, 2064, 2068, - 2072, 2076, 2080, 2084, 2088, 2092, 2096, 2100, 2104, 2108, - 2112, 2116, 2120, 2124, 2128, 2132, 2136, 2140, 2144, 2148, - 2152, 2156, 2160, 2164, 2168, 2172, 2176, 2180, 2184, 2188, - 2192, 2197, 2201, 2205, 2210, 2214, 2218, 2223, 2228, 2232, - 2236, 2240, 2244, 2248, 2252, 2256, 2260, 2264, 2268, 2272, - 2276, 2280, 2284, 2288, 2292, 2296, 2300, 2304, 2308, 2312, - 2316, 2320, 2324, 2328, 2332, 2336, 2340, 2344, 2348, 2352, - 2356, 2360, 2364, 2368, 2372, 2376, 2380, 2384, 2388, 2392, - 2396, 2400, 2404, 2408, 2412, 2416, 2420, 2424, 2428, 2432, - 2436, 2440, 2444, 2448, 2452, 2456, 2460, 2464, 2468, 2476, - 2483, 2490, 2497, 2504, 2511, 2518, 2525, 2532, 2539, 2546, - 2553, 2563, 2567, 2571, 2575, 2579, 2583, 2587, 2591, 2596, - 2601, 2606, 2610, 2614, 2618, 2622, 2627, 2632, 2636, 2640, - 2644, 2648, 2652, 2656, 2660, 2664, 2668, 2672, 2676, 2680, - 2684, 2689, 2693, 2697, 2701, 2705, 2709, 2713, 2717, 2721, - 2725, 2729, 2733, 2737, 2741, 2745, 2749, 2753, 2757, 2761, - 2765, 2769, 2773, 2777, 2781, 2785, 2789, 2793, 2797, 2801, - 2805, 2809, 2813, 2817, 2821, 2825, 2829, 2833, 2837, 2841, - 2845, 2849, 2853, 2857, 2861, 2865, 2869, 2873, 2877, 2881, - 2885, 2889, 2893, 2897, 2901, 2905, 2909, 2913, 2917, 2921, - 2925, 2929, 2933, 2937, 2941, 2945, 2949, 2953, 2957, 2961, - 2968, 2972, 2976, 2980, 2984, 2991, 2996, 3001, 3007 + 0, 714, 714, 718, 719, 722, 727, 733, 739, 743, + 747, 753, 759, 765, 771, 776, 781, 787, 794, 798, + 802, 808, 812, 816, 821, 826, 831, 836, 840, 847, + 851, 858, 864, 874, 883, 893, 902, 915, 919, 923, + 927, 931, 935, 939, 943, 947, 951, 956, 960, 964, + 968, 972, 976, 981, 986, 990, 994, 998, 1002, 1006, + 1010, 1014, 1018, 1022, 1026, 1030, 1034, 1038, 1042, 1046, + 1050, 1054, 1058, 1062, 1076, 1077, 1107, 1126, 1145, 1173, + 1230, 1237, 1241, 1245, 1249, 1253, 1257, 1261, 1265, 1274, + 1278, 1283, 1286, 1291, 1296, 1301, 1306, 1309, 1314, 1317, + 1322, 1327, 1330, 1335, 1340, 1345, 1350, 1355, 1360, 1365, + 1368, 1373, 1378, 1383, 1388, 1391, 1396, 1401, 1406, 1419, + 1432, 1445, 1458, 1471, 1497, 1525, 1537, 1557, 1584, 1589, + 1595, 1600, 1605, 1614, 1619, 1623, 1627, 1631, 1635, 1639, + 1643, 1648, 1653, 1665, 1671, 1675, 1679, 1690, 1699, 1700, + 1707, 1712, 1717, 1771, 1778, 1786, 1823, 1827, 1834, 1839, + 1845, 1851, 1857, 1864, 1874, 1878, 1882, 1886, 1890, 1894, + 1898, 1902, 1906, 1910, 1914, 1918, 1922, 1926, 1930, 1934, + 1938, 1942, 1946, 1950, 1954, 1958, 1962, 1966, 1970, 1974, + 1978, 1982, 1986, 1990, 1994, 1998, 2002, 2006, 2010, 2014, + 2018, 2022, 2026, 2030, 2034, 2038, 2042, 2046, 2050, 2054, + 2058, 2062, 2066, 2070, 2074, 2078, 2082, 2086, 2090, 2094, + 2098, 2102, 2106, 2110, 2114, 2118, 2122, 2126, 2130, 2134, + 2138, 2142, 2146, 2150, 2154, 2158, 2162, 2166, 2170, 2174, + 2178, 2182, 2186, 2190, 2194, 2198, 2202, 2206, 2210, 2214, + 2218, 2222, 2226, 2230, 2234, 2238, 2242, 2247, 2251, 2255, + 2260, 2264, 2268, 2273, 2278, 2282, 2286, 2290, 2294, 2298, + 2302, 2306, 2310, 2314, 2318, 2322, 2326, 2330, 2334, 2338, + 2342, 2346, 2350, 2354, 2358, 2362, 2366, 2370, 2374, 2378, + 2382, 2386, 2390, 2394, 2398, 2402, 2406, 2410, 2414, 2418, + 2422, 2426, 2430, 2434, 2438, 2442, 2446, 2450, 2454, 2458, + 2462, 2466, 2470, 2474, 2478, 2482, 2486, 2490, 2494, 2498, + 2502, 2506, 2510, 2514, 2518, 2526, 2533, 2540, 2547, 2554, + 2561, 2568, 2575, 2582, 2589, 2596, 2603, 2613, 2617, 2621, + 2625, 2629, 2633, 2637, 2641, 2646, 2650, 2655, 2659, 2663, + 2667, 2671, 2676, 2681, 2685, 2689, 2693, 2697, 2701, 2705, + 2709, 2713, 2717, 2721, 2725, 2729, 2733, 2738, 2742, 2746, + 2750, 2754, 2758, 2762, 2766, 2770, 2774, 2778, 2782, 2786, + 2790, 2794, 2798, 2802, 2806, 2810, 2814, 2818, 2822, 2826, + 2830, 2834, 2838, 2842, 2846, 2850, 2854, 2858, 2862, 2866, + 2870, 2874, 2878, 2882, 2886, 2890, 2894, 2898, 2902, 2906, + 2910, 2914, 2918, 2922, 2926, 2930, 2934, 2938, 2942, 2946, + 2950, 2954, 2958, 2962, 2966, 2970, 2974, 2978, 2982, 2986, + 2990, 2994, 2998, 3002, 3006, 3010, 3017, 3021, 3025, 3029, + 3033, 3040, 3045, 3050, 3056 }; - // Print the state stack on the debug stream. void - seclang_parser::yystack_print_ () + seclang_parser::yy_stack_print_ () const { *yycdebug_ << "Stack now"; for (stack_type::const_iterator i = yystack_.begin (), i_end = yystack_.end (); i != i_end; ++i) - *yycdebug_ << ' ' << i->state; + *yycdebug_ << ' ' << int (i->state); *yycdebug_ << '\n'; } - // Report on the debug stream that the rule \a yyrule is going to be reduced. void - seclang_parser::yy_reduce_print_ (int yyrule) + seclang_parser::yy_reduce_print_ (int yyrule) const { - unsigned yylno = yyrline_[yyrule]; + int yylno = yyrline_[yyrule]; int yynrhs = yyr2_[yyrule]; // Print the symbols being reduced, and their result. *yycdebug_ << "Reducing stack by rule " << yyrule - 1 @@ -6881,10 +7264,10 @@ namespace yy { #endif // YYDEBUG - } // yy -#line 6887 "seclang-parser.cc" // lalr1.cc:1242 -#line 3014 "seclang-parser.yy" // lalr1.cc:1243 +#line 7269 "seclang-parser.cc" + +#line 3063 "seclang-parser.yy" void yy::seclang_parser::error (const location_type& l, const std::string& m) { diff --git a/src/deps/src/ModSecurity/src/parser/seclang-parser.hh b/src/deps/src/ModSecurity/src/parser/seclang-parser.hh index 30dbf76e3..55ad6046f 100644 --- a/src/deps/src/ModSecurity/src/parser/seclang-parser.hh +++ b/src/deps/src/ModSecurity/src/parser/seclang-parser.hh @@ -1,8 +1,8 @@ -// A Bison parser, made by GNU Bison 3.3.2. +// A Bison parser, made by GNU Bison 3.7.6. // Skeleton interface for Bison LALR(1) parsers in C++ -// Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc. +// Copyright (C) 2002-2015, 2018-2021 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 @@ -15,7 +15,7 @@ // 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 . +// 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 @@ -38,13 +38,14 @@ // C++ LALR(1) parser skeleton written by Akim Demaille. -// Undocumented macros, especially those whose name start with YY_, -// are private implementation details. Do not rely on them. +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. #ifndef YY_YY_SECLANG_PARSER_HH_INCLUDED # define YY_YY_SECLANG_PARSER_HH_INCLUDED -// // "%code requires" blocks. -#line 10 "seclang-parser.yy" // lalr1.cc:401 +// "%code requires" blocks. +#line 10 "seclang-parser.yy" #include #include @@ -55,6 +56,7 @@ class Driver; } } +#include "modsecurity/rule_unconditional.h" #include "src/rule_script.h" #include "src/actions/accuracy.h" @@ -62,6 +64,7 @@ class Driver; #include "src/actions/block.h" #include "src/actions/capture.h" #include "src/actions/chain.h" +#include "src/actions/ctl/audit_engine.h" #include "src/actions/ctl/audit_log_parts.h" #include "src/actions/ctl/request_body_access.h" #include "src/actions/ctl/rule_engine.h" @@ -99,12 +102,12 @@ class Driver; #include "src/actions/skip_after.h" #include "src/actions/skip.h" #include "src/actions/tag.h" -#include "src/actions/transformations/none.h" -#include "src/actions/transformations/transformation.h" -#include "src/actions/transformations/url_decode_uni.h" #include "src/actions/ver.h" #include "src/actions/xmlns.h" +#include "src/actions/transformations/none.h" +#include "src/actions/transformations/transformation.h" +#include "src/actions/transformations/url_decode_uni.h" #include "src/actions/transformations/hex_encode.h" #include "src/actions/transformations/parity_even_7bit.h" #include "src/actions/transformations/utf8_to_unicode.h" @@ -169,6 +172,7 @@ class Driver; #include "src/operators/rbl.h" #include "src/operators/rsub.h" #include "src/operators/rx.h" +#include "src/operators/rx_global.h" #include "src/operators/str_eq.h" #include "src/operators/str_match.h" #include "src/operators/unconditional_match.h" @@ -187,7 +191,7 @@ class Driver; #include "modsecurity/audit_log.h" #include "modsecurity/modsecurity.h" -#include "modsecurity/rules_properties.h" +#include "modsecurity/rules_set_properties.h" #include "modsecurity/rule.h" #include "src/operators/operator.h" #include "src/utils/geo_lookup.h" @@ -252,6 +256,7 @@ class Driver; #include "src/variables/request_body_length.h" #include "src/variables/request_cookies.h" #include "src/variables/request_cookies_names.h" +#include "src/variables/multipart_part_headers.h" #include "src/variables/request_file_name.h" #include "src/variables/request_headers.h" #include "src/variables/request_headers_names.h" @@ -295,7 +300,6 @@ class Driver; #include "src/variables/session.h" #include "src/variables/status.h" - using namespace modsecurity; using namespace modsecurity::variables; using namespace modsecurity::Utils; @@ -348,7 +352,7 @@ using namespace modsecurity::operators; a = std::move(c); -#line 352 "seclang-parser.hh" // lalr1.cc:401 +#line 356 "seclang-parser.hh" # include # include // std::abort @@ -395,44 +399,42 @@ using namespace modsecurity::operators; #endif # include "location.hh" #include -#ifndef YYASSERT +#ifndef YY_ASSERT # include -# define YYASSERT assert +# define YY_ASSERT assert #endif -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else -# define YY_ATTRIBUTE(Spec) /* empty */ +# define YY_ATTRIBUTE_PURE # endif #endif -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - #ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value @@ -445,6 +447,27 @@ using namespace modsecurity::operators; # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus @@ -462,9 +485,9 @@ using namespace modsecurity::operators; # define YYDEBUG 1 #endif - namespace yy { -#line 468 "seclang-parser.hh" // lalr1.cc:401 +#line 490 "seclang-parser.hh" + @@ -495,14 +518,21 @@ namespace yy { semantic_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { - YYASSERT (sizeof (T) <= size); + YY_ASSERT (sizeof (T) <= size); new (yyas_ ()) T (YY_MOVE (t)); } +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + semantic_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + /// Destruction, allowed only if empty. ~semantic_type () YY_NOEXCEPT { - YYASSERT (!yytypeid_); + YY_ASSERT (!yytypeid_); } # if 201103L <= YY_CPLUSPLUS @@ -511,8 +541,8 @@ namespace yy { T& emplace (U&&... u) { - YYASSERT (!yytypeid_); - YYASSERT (sizeof (T) <= size); + YY_ASSERT (!yytypeid_); + YY_ASSERT (sizeof (T) <= size); yytypeid_ = & typeid (T); return *new (yyas_ ()) T (std::forward (u)...); } @@ -522,8 +552,8 @@ namespace yy { T& emplace () { - YYASSERT (!yytypeid_); - YYASSERT (sizeof (T) <= size); + YY_ASSERT (!yytypeid_); + YY_ASSERT (sizeof (T) <= size); yytypeid_ = & typeid (T); return *new (yyas_ ()) T (); } @@ -533,8 +563,8 @@ namespace yy { T& emplace (const T& t) { - YYASSERT (!yytypeid_); - YYASSERT (sizeof (T) <= size); + YY_ASSERT (!yytypeid_); + YY_ASSERT (sizeof (T) <= size); yytypeid_ = & typeid (T); return *new (yyas_ ()) T (std::move((T&)t)); } @@ -563,9 +593,9 @@ namespace yy { T& as () YY_NOEXCEPT { - YYASSERT (yytypeid_); - YYASSERT (*yytypeid_ == typeid (T)); - YYASSERT (sizeof (T) <= size); + YY_ASSERT (yytypeid_); + YY_ASSERT (*yytypeid_ == typeid (T)); + YY_ASSERT (sizeof (T) <= size); return *yyas_ (); } @@ -574,9 +604,9 @@ namespace yy { const T& as () const YY_NOEXCEPT { - YYASSERT (yytypeid_); - YYASSERT (*yytypeid_ == typeid (T)); - YYASSERT (sizeof (T) <= size); + YY_ASSERT (yytypeid_); + YY_ASSERT (*yytypeid_ == typeid (T)); + YY_ASSERT (sizeof (T) <= size); return *yyas_ (); } @@ -592,8 +622,8 @@ namespace yy { void swap (self_type& that) YY_NOEXCEPT { - YYASSERT (yytypeid_); - YYASSERT (*yytypeid_ == *that.yytypeid_); + YY_ASSERT (yytypeid_); + YY_ASSERT (*yytypeid_ == *that.yytypeid_); std::swap (as (), that.as ()); } @@ -642,9 +672,12 @@ namespace yy { } private: - /// Prohibit blind copies. - self_type& operator= (const self_type&); +#if YY_CPLUSPLUS < 201103L + /// Non copyable. semantic_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif /// Accessor to raw memory as \a T. template @@ -790,6 +823,8 @@ namespace yy { // "CONFIG_SEC_CONN_R_STATE_LIMIT" // "CONFIG_SEC_CONN_W_STATE_LIMIT" // "CONFIG_SEC_SENSOR_ID" + // "CONFIG_DIR_ARGS_LIMIT" + // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" // "CONFIG_DIR_REQ_BODY" // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" // "CONFIG_DIR_REQ_BODY_LIMIT" @@ -929,369 +964,749 @@ namespace yy { location_type location; }; - /// Tokens. + /// Token kinds. struct token { - enum yytokentype + enum token_kind_type { - TOK_END = 0, - TOK_COMMA = 258, - TOK_CONFIG_CONTENT_INJECTION = 259, - TOK_CONGIG_DIR_RESPONSE_BODY_MP_CLEAR = 260, - TOK_PIPE = 261, - TOK_NEW_LINE = 262, - TOK_VAR_COUNT = 263, - TOK_VAR_EXCLUSION = 264, - TOK_VARIABLE_ARGS = 265, - TOK_VARIABLE_ARGS_POST = 266, - TOK_VARIABLE_ARGS_GET = 267, - TOK_VARIABLE_FILES_SIZES = 268, - TOK_VARIABLE_FILES_NAMES = 269, - TOK_VARIABLE_FILES_TMP_CONTENT = 270, - TOK_VARIABLE_MULTIPART_FILENAME = 271, - TOK_VARIABLE_MULTIPART_NAME = 272, - TOK_VARIABLE_MATCHED_VARS_NAMES = 273, - TOK_VARIABLE_MATCHED_VARS = 274, - TOK_VARIABLE_FILES = 275, - TOK_VARIABLE_REQUEST_COOKIES = 276, - TOK_VARIABLE_REQUEST_HEADERS = 277, - TOK_VARIABLE_RESPONSE_HEADERS = 278, - TOK_VARIABLE_GEO = 279, - TOK_VARIABLE_REQUEST_COOKIES_NAMES = 280, - TOK_VARIABLE_ARGS_COMBINED_SIZE = 281, - TOK_VARIABLE_ARGS_GET_NAMES = 282, - TOK_VARIABLE_RULE = 283, - TOK_VARIABLE_ARGS_NAMES = 284, - TOK_VARIABLE_ARGS_POST_NAMES = 285, - TOK_VARIABLE_AUTH_TYPE = 286, - TOK_VARIABLE_FILES_COMBINED_SIZE = 287, - TOK_VARIABLE_FILES_TMP_NAMES = 288, - TOK_VARIABLE_FULL_REQUEST = 289, - TOK_VARIABLE_FULL_REQUEST_LENGTH = 290, - TOK_VARIABLE_INBOUND_DATA_ERROR = 291, - TOK_VARIABLE_MATCHED_VAR = 292, - TOK_VARIABLE_MATCHED_VAR_NAME = 293, - TOK_VARIABLE_MULTIPART_BOUNDARY_QUOTED = 294, - TOK_VARIABLE_MULTIPART_BOUNDARY_WHITESPACE = 295, - TOK_VARIABLE_MULTIPART_CRLF_LF_LINES = 296, - TOK_VARIABLE_MULTIPART_DATA_AFTER = 297, - TOK_VARIABLE_MULTIPART_DATA_BEFORE = 298, - TOK_VARIABLE_MULTIPART_FILE_LIMIT_EXCEEDED = 299, - TOK_VARIABLE_MULTIPART_HEADER_FOLDING = 300, - TOK_VARIABLE_MULTIPART_INVALID_HEADER_FOLDING = 301, - TOK_VARIABLE_MULTIPART_INVALID_PART = 302, - TOK_VARIABLE_MULTIPART_INVALID_QUOTING = 303, - TOK_VARIABLE_MULTIPART_LF_LINE = 304, - TOK_VARIABLE_MULTIPART_MISSING_SEMICOLON = 305, - TOK_VARIABLE_MULTIPART_SEMICOLON_MISSING = 306, - TOK_VARIABLE_MULTIPART_STRICT_ERROR = 307, - TOK_VARIABLE_MULTIPART_UNMATCHED_BOUNDARY = 308, - TOK_VARIABLE_OUTBOUND_DATA_ERROR = 309, - TOK_VARIABLE_PATH_INFO = 310, - TOK_VARIABLE_QUERY_STRING = 311, - TOK_VARIABLE_REMOTE_ADDR = 312, - TOK_VARIABLE_REMOTE_HOST = 313, - TOK_VARIABLE_REMOTE_PORT = 314, - TOK_VARIABLE_REQBODY_ERROR_MSG = 315, - TOK_VARIABLE_REQBODY_ERROR = 316, - TOK_VARIABLE_REQBODY_PROCESSOR_ERROR_MSG = 317, - TOK_VARIABLE_REQBODY_PROCESSOR_ERROR = 318, - TOK_VARIABLE_REQBODY_PROCESSOR = 319, - TOK_VARIABLE_REQUEST_BASENAME = 320, - TOK_VARIABLE_REQUEST_BODY_LENGTH = 321, - TOK_VARIABLE_REQUEST_BODY = 322, - TOK_VARIABLE_REQUEST_FILE_NAME = 323, - TOK_VARIABLE_REQUEST_HEADERS_NAMES = 324, - TOK_VARIABLE_REQUEST_LINE = 325, - TOK_VARIABLE_REQUEST_METHOD = 326, - TOK_VARIABLE_REQUEST_PROTOCOL = 327, - TOK_VARIABLE_REQUEST_URI_RAW = 328, - TOK_VARIABLE_REQUEST_URI = 329, - TOK_VARIABLE_RESOURCE = 330, - TOK_VARIABLE_RESPONSE_BODY = 331, - TOK_VARIABLE_RESPONSE_CONTENT_LENGTH = 332, - TOK_VARIABLE_RESPONSE_CONTENT_TYPE = 333, - TOK_VARIABLE_RESPONSE_HEADERS_NAMES = 334, - TOK_VARIABLE_RESPONSE_PROTOCOL = 335, - TOK_VARIABLE_RESPONSE_STATUS = 336, - TOK_VARIABLE_SERVER_ADDR = 337, - TOK_VARIABLE_SERVER_NAME = 338, - TOK_VARIABLE_SERVER_PORT = 339, - TOK_VARIABLE_SESSION_ID = 340, - TOK_VARIABLE_UNIQUE_ID = 341, - TOK_VARIABLE_URL_ENCODED_ERROR = 342, - TOK_VARIABLE_USER_ID = 343, - TOK_VARIABLE_WEB_APP_ID = 344, - TOK_VARIABLE_STATUS = 345, - TOK_VARIABLE_STATUS_LINE = 346, - TOK_VARIABLE_IP = 347, - TOK_VARIABLE_GLOBAL = 348, - TOK_VARIABLE_TX = 349, - TOK_VARIABLE_SESSION = 350, - TOK_VARIABLE_USER = 351, - TOK_RUN_TIME_VAR_ENV = 352, - TOK_RUN_TIME_VAR_XML = 353, - TOK_ACTION_SETVAR = 354, - TOK_SETVAR_OPERATION_EQUALS = 355, - TOK_SETVAR_OPERATION_EQUALS_PLUS = 356, - TOK_SETVAR_OPERATION_EQUALS_MINUS = 357, - TOK_NOT = 358, - TOK_OPERATOR_BEGINS_WITH = 359, - TOK_OPERATOR_CONTAINS = 360, - TOK_OPERATOR_CONTAINS_WORD = 361, - TOK_OPERATOR_DETECT_SQLI = 362, - TOK_OPERATOR_DETECT_XSS = 363, - TOK_OPERATOR_ENDS_WITH = 364, - TOK_OPERATOR_EQ = 365, - TOK_OPERATOR_FUZZY_HASH = 366, - TOK_OPERATOR_GEOLOOKUP = 367, - TOK_OPERATOR_GE = 368, - TOK_OPERATOR_GSB_LOOKUP = 369, - TOK_OPERATOR_GT = 370, - TOK_OPERATOR_INSPECT_FILE = 371, - TOK_OPERATOR_IP_MATCH_FROM_FILE = 372, - TOK_OPERATOR_IP_MATCH = 373, - TOK_OPERATOR_LE = 374, - TOK_OPERATOR_LT = 375, - TOK_OPERATOR_PM_FROM_FILE = 376, - TOK_OPERATOR_PM = 377, - TOK_OPERATOR_RBL = 378, - TOK_OPERATOR_RSUB = 379, - TOK_OPERATOR_RX_CONTENT_ONLY = 380, - TOK_OPERATOR_RX = 381, - TOK_OPERATOR_STR_EQ = 382, - TOK_OPERATOR_STR_MATCH = 383, - TOK_OPERATOR_UNCONDITIONAL_MATCH = 384, - TOK_OPERATOR_VALIDATE_BYTE_RANGE = 385, - TOK_OPERATOR_VALIDATE_DTD = 386, - TOK_OPERATOR_VALIDATE_HASH = 387, - TOK_OPERATOR_VALIDATE_SCHEMA = 388, - TOK_OPERATOR_VALIDATE_URL_ENCODING = 389, - TOK_OPERATOR_VALIDATE_UTF8_ENCODING = 390, - TOK_OPERATOR_VERIFY_CC = 391, - TOK_OPERATOR_VERIFY_CPF = 392, - TOK_OPERATOR_VERIFY_SSN = 393, - TOK_OPERATOR_VERIFY_SVNR = 394, - TOK_OPERATOR_WITHIN = 395, - TOK_CONFIG_DIR_AUDIT_LOG_FMT = 396, - TOK_JSON = 397, - TOK_NATIVE = 398, - TOK_ACTION_CTL_RULE_ENGINE = 399, - TOK_ACTION_ACCURACY = 400, - TOK_ACTION_ALLOW = 401, - TOK_ACTION_APPEND = 402, - TOK_ACTION_AUDIT_LOG = 403, - TOK_ACTION_BLOCK = 404, - TOK_ACTION_CAPTURE = 405, - TOK_ACTION_CHAIN = 406, - TOK_ACTION_CTL_AUDIT_ENGINE = 407, - TOK_ACTION_CTL_AUDIT_LOG_PARTS = 408, - TOK_ACTION_CTL_BDY_JSON = 409, - TOK_ACTION_CTL_BDY_XML = 410, - TOK_ACTION_CTL_BDY_URLENCODED = 411, - TOK_ACTION_CTL_FORCE_REQ_BODY_VAR = 412, - TOK_ACTION_CTL_REQUEST_BODY_ACCESS = 413, - TOK_ACTION_CTL_RULE_REMOVE_BY_ID = 414, - TOK_ACTION_CTL_RULE_REMOVE_BY_TAG = 415, - TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID = 416, - TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG = 417, - TOK_ACTION_DENY = 418, - TOK_ACTION_DEPRECATE_VAR = 419, - TOK_ACTION_DROP = 420, - TOK_ACTION_EXEC = 421, - TOK_ACTION_EXPIRE_VAR = 422, - TOK_ACTION_ID = 423, - TOK_ACTION_INITCOL = 424, - TOK_ACTION_LOG = 425, - TOK_ACTION_LOG_DATA = 426, - TOK_ACTION_MATURITY = 427, - TOK_ACTION_MSG = 428, - TOK_ACTION_MULTI_MATCH = 429, - TOK_ACTION_NO_AUDIT_LOG = 430, - TOK_ACTION_NO_LOG = 431, - TOK_ACTION_PASS = 432, - TOK_ACTION_PAUSE = 433, - TOK_ACTION_PHASE = 434, - TOK_ACTION_PREPEND = 435, - TOK_ACTION_PROXY = 436, - TOK_ACTION_REDIRECT = 437, - TOK_ACTION_REV = 438, - TOK_ACTION_SANITISE_ARG = 439, - TOK_ACTION_SANITISE_MATCHED = 440, - TOK_ACTION_SANITISE_MATCHED_BYTES = 441, - TOK_ACTION_SANITISE_REQUEST_HEADER = 442, - TOK_ACTION_SANITISE_RESPONSE_HEADER = 443, - TOK_ACTION_SETENV = 444, - TOK_ACTION_SETRSC = 445, - TOK_ACTION_SETSID = 446, - TOK_ACTION_SETUID = 447, - TOK_ACTION_SEVERITY = 448, - TOK_ACTION_SKIP = 449, - TOK_ACTION_SKIP_AFTER = 450, - TOK_ACTION_STATUS = 451, - TOK_ACTION_TAG = 452, - TOK_ACTION_TRANSFORMATION_BASE_64_ENCODE = 453, - TOK_ACTION_TRANSFORMATION_BASE_64_DECODE = 454, - TOK_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT = 455, - TOK_ACTION_TRANSFORMATION_CMD_LINE = 456, - TOK_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE = 457, - TOK_ACTION_TRANSFORMATION_CSS_DECODE = 458, - TOK_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE = 459, - TOK_ACTION_TRANSFORMATION_HEX_ENCODE = 460, - TOK_ACTION_TRANSFORMATION_HEX_DECODE = 461, - TOK_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE = 462, - TOK_ACTION_TRANSFORMATION_JS_DECODE = 463, - TOK_ACTION_TRANSFORMATION_LENGTH = 464, - TOK_ACTION_TRANSFORMATION_LOWERCASE = 465, - TOK_ACTION_TRANSFORMATION_MD5 = 466, - TOK_ACTION_TRANSFORMATION_NONE = 467, - TOK_ACTION_TRANSFORMATION_NORMALISE_PATH = 468, - TOK_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN = 469, - TOK_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT = 470, - TOK_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT = 471, - TOK_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT = 472, - TOK_ACTION_TRANSFORMATION_REMOVE_COMMENTS = 473, - TOK_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR = 474, - TOK_ACTION_TRANSFORMATION_REMOVE_NULLS = 475, - TOK_ACTION_TRANSFORMATION_REMOVE_WHITESPACE = 476, - TOK_ACTION_TRANSFORMATION_REPLACE_COMMENTS = 477, - TOK_ACTION_TRANSFORMATION_REPLACE_NULLS = 478, - TOK_ACTION_TRANSFORMATION_SHA1 = 479, - TOK_ACTION_TRANSFORMATION_SQL_HEX_DECODE = 480, - TOK_ACTION_TRANSFORMATION_TRIM = 481, - TOK_ACTION_TRANSFORMATION_TRIM_LEFT = 482, - TOK_ACTION_TRANSFORMATION_TRIM_RIGHT = 483, - TOK_ACTION_TRANSFORMATION_UPPERCASE = 484, - TOK_ACTION_TRANSFORMATION_URL_ENCODE = 485, - TOK_ACTION_TRANSFORMATION_URL_DECODE = 486, - TOK_ACTION_TRANSFORMATION_URL_DECODE_UNI = 487, - TOK_ACTION_TRANSFORMATION_UTF8_TO_UNICODE = 488, - TOK_ACTION_VER = 489, - TOK_ACTION_XMLNS = 490, - TOK_CONFIG_COMPONENT_SIG = 491, - TOK_CONFIG_CONN_ENGINE = 492, - TOK_CONFIG_SEC_ARGUMENT_SEPARATOR = 493, - TOK_CONFIG_SEC_WEB_APP_ID = 494, - TOK_CONFIG_SEC_SERVER_SIG = 495, - TOK_CONFIG_DIR_AUDIT_DIR = 496, - TOK_CONFIG_DIR_AUDIT_DIR_MOD = 497, - TOK_CONFIG_DIR_AUDIT_ENG = 498, - TOK_CONFIG_DIR_AUDIT_FLE_MOD = 499, - TOK_CONFIG_DIR_AUDIT_LOG = 500, - TOK_CONFIG_DIR_AUDIT_LOG2 = 501, - TOK_CONFIG_DIR_AUDIT_LOG_P = 502, - TOK_CONFIG_DIR_AUDIT_STS = 503, - TOK_CONFIG_DIR_AUDIT_TPE = 504, - TOK_CONFIG_DIR_DEBUG_LOG = 505, - TOK_CONFIG_DIR_DEBUG_LVL = 506, - TOK_CONFIG_SEC_CACHE_TRANSFORMATIONS = 507, - TOK_CONFIG_SEC_DISABLE_BACKEND_COMPRESS = 508, - TOK_CONFIG_SEC_HASH_ENGINE = 509, - TOK_CONFIG_SEC_HASH_KEY = 510, - TOK_CONFIG_SEC_HASH_PARAM = 511, - TOK_CONFIG_SEC_HASH_METHOD_RX = 512, - TOK_CONFIG_SEC_HASH_METHOD_PM = 513, - TOK_CONFIG_SEC_CHROOT_DIR = 514, - TOK_CONFIG_DIR_GEO_DB = 515, - TOK_CONFIG_DIR_GSB_DB = 516, - TOK_CONFIG_SEC_GUARDIAN_LOG = 517, - TOK_CONFIG_DIR_PCRE_MATCH_LIMIT = 518, - TOK_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION = 519, - TOK_CONFIG_SEC_CONN_R_STATE_LIMIT = 520, - TOK_CONFIG_SEC_CONN_W_STATE_LIMIT = 521, - TOK_CONFIG_SEC_SENSOR_ID = 522, - TOK_CONFIG_DIR_REQ_BODY = 523, - TOK_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT = 524, - TOK_CONFIG_DIR_REQ_BODY_LIMIT = 525, - TOK_CONFIG_DIR_REQ_BODY_LIMIT_ACTION = 526, - TOK_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT = 527, - TOK_CONFIG_DIR_RES_BODY = 528, - TOK_CONFIG_DIR_RES_BODY_LIMIT = 529, - TOK_CONFIG_DIR_RES_BODY_LIMIT_ACTION = 530, - TOK_CONFIG_SEC_RULE_INHERITANCE = 531, - TOK_CONFIG_SEC_RULE_PERF_TIME = 532, - TOK_CONFIG_DIR_RULE_ENG = 533, - TOK_CONFIG_DIR_SEC_ACTION = 534, - TOK_CONFIG_DIR_SEC_DEFAULT_ACTION = 535, - TOK_CONFIG_DIR_SEC_MARKER = 536, - TOK_CONFIG_DIR_UNICODE_MAP_FILE = 537, - TOK_CONFIG_DIR_UNICODE_CODE_PAGE = 538, - TOK_CONFIG_SEC_COLLECTION_TIMEOUT = 539, - TOK_CONFIG_SEC_HTTP_BLKEY = 540, - TOK_CONFIG_SEC_INTERCEPT_ON_ERROR = 541, - TOK_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION = 542, - TOK_CONFIG_SEC_RULE_REMOVE_BY_ID = 543, - TOK_CONFIG_SEC_RULE_REMOVE_BY_MSG = 544, - TOK_CONFIG_SEC_RULE_REMOVE_BY_TAG = 545, - TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG = 546, - TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG = 547, - TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID = 548, - TOK_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID = 549, - TOK_CONFIG_UPDLOAD_KEEP_FILES = 550, - TOK_CONFIG_UPDLOAD_SAVE_TMP_FILES = 551, - TOK_CONFIG_UPLOAD_DIR = 552, - TOK_CONFIG_UPLOAD_FILE_LIMIT = 553, - TOK_CONFIG_UPLOAD_FILE_MODE = 554, - TOK_CONFIG_VALUE_ABORT = 555, - TOK_CONFIG_VALUE_DETC = 556, - TOK_CONFIG_VALUE_HTTPS = 557, - TOK_CONFIG_VALUE_OFF = 558, - TOK_CONFIG_VALUE_ON = 559, - TOK_CONFIG_VALUE_PARALLEL = 560, - TOK_CONFIG_VALUE_PROCESS_PARTIAL = 561, - TOK_CONFIG_VALUE_REJECT = 562, - TOK_CONFIG_VALUE_RELEVANT_ONLY = 563, - TOK_CONFIG_VALUE_SERIAL = 564, - TOK_CONFIG_VALUE_WARN = 565, - TOK_CONFIG_XML_EXTERNAL_ENTITY = 566, - TOK_CONGIG_DIR_RESPONSE_BODY_MP = 567, - TOK_CONGIG_DIR_SEC_ARG_SEP = 568, - TOK_CONGIG_DIR_SEC_COOKIE_FORMAT = 569, - TOK_CONFIG_SEC_COOKIEV0_SEPARATOR = 570, - TOK_CONGIG_DIR_SEC_DATA_DIR = 571, - TOK_CONGIG_DIR_SEC_STATUS_ENGINE = 572, - TOK_CONFIG_SEC_STREAM_IN_BODY_INSPECTION = 573, - TOK_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION = 574, - TOK_CONGIG_DIR_SEC_TMP_DIR = 575, - TOK_DIRECTIVE = 576, - TOK_DIRECTIVE_SECRULESCRIPT = 577, - TOK_FREE_TEXT_QUOTE_MACRO_EXPANSION = 578, - TOK_QUOTATION_MARK = 579, - TOK_RUN_TIME_VAR_BLD = 580, - TOK_RUN_TIME_VAR_DUR = 581, - TOK_RUN_TIME_VAR_HSV = 582, - TOK_RUN_TIME_VAR_REMOTE_USER = 583, - TOK_RUN_TIME_VAR_TIME = 584, - TOK_RUN_TIME_VAR_TIME_DAY = 585, - TOK_RUN_TIME_VAR_TIME_EPOCH = 586, - TOK_RUN_TIME_VAR_TIME_HOUR = 587, - TOK_RUN_TIME_VAR_TIME_MIN = 588, - TOK_RUN_TIME_VAR_TIME_MON = 589, - TOK_RUN_TIME_VAR_TIME_SEC = 590, - TOK_RUN_TIME_VAR_TIME_WDAY = 591, - TOK_RUN_TIME_VAR_TIME_YEAR = 592, - TOK_VARIABLE = 593, - TOK_DICT_ELEMENT = 594, - TOK_DICT_ELEMENT_REGEXP = 595 + TOK_YYEMPTY = -2, + TOK_END = 0, // "end of file" + TOK_YYerror = 256, // error + TOK_YYUNDEF = 257, // "invalid token" + TOK_COMMA = 258, // "," + TOK_CONFIG_CONTENT_INJECTION = 259, // "CONFIG_CONTENT_INJECTION" + TOK_CONGIG_DIR_RESPONSE_BODY_MP_CLEAR = 260, // "CONGIG_DIR_RESPONSE_BODY_MP_CLEAR" + TOK_PIPE = 261, // PIPE + TOK_NEW_LINE = 262, // NEW_LINE + TOK_VAR_COUNT = 263, // VAR_COUNT + TOK_VAR_EXCLUSION = 264, // VAR_EXCLUSION + TOK_VARIABLE_ARGS = 265, // VARIABLE_ARGS + TOK_VARIABLE_ARGS_POST = 266, // VARIABLE_ARGS_POST + TOK_VARIABLE_ARGS_GET = 267, // VARIABLE_ARGS_GET + TOK_VARIABLE_FILES_SIZES = 268, // VARIABLE_FILES_SIZES + TOK_VARIABLE_FILES_NAMES = 269, // VARIABLE_FILES_NAMES + TOK_VARIABLE_FILES_TMP_CONTENT = 270, // VARIABLE_FILES_TMP_CONTENT + TOK_VARIABLE_MULTIPART_FILENAME = 271, // VARIABLE_MULTIPART_FILENAME + TOK_VARIABLE_MULTIPART_NAME = 272, // VARIABLE_MULTIPART_NAME + TOK_VARIABLE_MATCHED_VARS_NAMES = 273, // VARIABLE_MATCHED_VARS_NAMES + TOK_VARIABLE_MATCHED_VARS = 274, // VARIABLE_MATCHED_VARS + TOK_VARIABLE_FILES = 275, // VARIABLE_FILES + TOK_VARIABLE_REQUEST_COOKIES = 276, // VARIABLE_REQUEST_COOKIES + TOK_VARIABLE_REQUEST_HEADERS = 277, // VARIABLE_REQUEST_HEADERS + TOK_VARIABLE_RESPONSE_HEADERS = 278, // VARIABLE_RESPONSE_HEADERS + TOK_VARIABLE_GEO = 279, // VARIABLE_GEO + TOK_VARIABLE_REQUEST_COOKIES_NAMES = 280, // VARIABLE_REQUEST_COOKIES_NAMES + TOK_VARIABLE_MULTIPART_PART_HEADERS = 281, // VARIABLE_MULTIPART_PART_HEADERS + TOK_VARIABLE_ARGS_COMBINED_SIZE = 282, // VARIABLE_ARGS_COMBINED_SIZE + TOK_VARIABLE_ARGS_GET_NAMES = 283, // VARIABLE_ARGS_GET_NAMES + TOK_VARIABLE_RULE = 284, // VARIABLE_RULE + TOK_VARIABLE_ARGS_NAMES = 285, // "Variable ARGS_NAMES" + TOK_VARIABLE_ARGS_POST_NAMES = 286, // VARIABLE_ARGS_POST_NAMES + TOK_VARIABLE_AUTH_TYPE = 287, // "AUTH_TYPE" + TOK_VARIABLE_FILES_COMBINED_SIZE = 288, // "FILES_COMBINED_SIZE" + TOK_VARIABLE_FILES_TMP_NAMES = 289, // "FILES_TMPNAMES" + TOK_VARIABLE_FULL_REQUEST = 290, // "FULL_REQUEST" + TOK_VARIABLE_FULL_REQUEST_LENGTH = 291, // "FULL_REQUEST_LENGTH" + TOK_VARIABLE_INBOUND_DATA_ERROR = 292, // "INBOUND_DATA_ERROR" + TOK_VARIABLE_MATCHED_VAR = 293, // "MATCHED_VAR" + TOK_VARIABLE_MATCHED_VAR_NAME = 294, // "MATCHED_VAR_NAME" + TOK_VARIABLE_MULTIPART_BOUNDARY_QUOTED = 295, // VARIABLE_MULTIPART_BOUNDARY_QUOTED + TOK_VARIABLE_MULTIPART_BOUNDARY_WHITESPACE = 296, // VARIABLE_MULTIPART_BOUNDARY_WHITESPACE + TOK_VARIABLE_MULTIPART_CRLF_LF_LINES = 297, // "MULTIPART_CRLF_LF_LINES" + TOK_VARIABLE_MULTIPART_DATA_AFTER = 298, // "MULTIPART_DATA_AFTER" + TOK_VARIABLE_MULTIPART_DATA_BEFORE = 299, // VARIABLE_MULTIPART_DATA_BEFORE + TOK_VARIABLE_MULTIPART_FILE_LIMIT_EXCEEDED = 300, // "MULTIPART_FILE_LIMIT_EXCEEDED" + TOK_VARIABLE_MULTIPART_HEADER_FOLDING = 301, // "MULTIPART_HEADER_FOLDING" + TOK_VARIABLE_MULTIPART_INVALID_HEADER_FOLDING = 302, // "MULTIPART_INVALID_HEADER_FOLDING" + TOK_VARIABLE_MULTIPART_INVALID_PART = 303, // VARIABLE_MULTIPART_INVALID_PART + TOK_VARIABLE_MULTIPART_INVALID_QUOTING = 304, // "MULTIPART_INVALID_QUOTING" + TOK_VARIABLE_MULTIPART_LF_LINE = 305, // VARIABLE_MULTIPART_LF_LINE + TOK_VARIABLE_MULTIPART_MISSING_SEMICOLON = 306, // VARIABLE_MULTIPART_MISSING_SEMICOLON + TOK_VARIABLE_MULTIPART_SEMICOLON_MISSING = 307, // VARIABLE_MULTIPART_SEMICOLON_MISSING + TOK_VARIABLE_MULTIPART_STRICT_ERROR = 308, // "MULTIPART_STRICT_ERROR" + TOK_VARIABLE_MULTIPART_UNMATCHED_BOUNDARY = 309, // "MULTIPART_UNMATCHED_BOUNDARY" + TOK_VARIABLE_OUTBOUND_DATA_ERROR = 310, // "OUTBOUND_DATA_ERROR" + TOK_VARIABLE_PATH_INFO = 311, // "PATH_INFO" + TOK_VARIABLE_QUERY_STRING = 312, // "QUERY_STRING" + TOK_VARIABLE_REMOTE_ADDR = 313, // "REMOTE_ADDR" + TOK_VARIABLE_REMOTE_HOST = 314, // "REMOTE_HOST" + TOK_VARIABLE_REMOTE_PORT = 315, // "REMOTE_PORT" + TOK_VARIABLE_REQBODY_ERROR_MSG = 316, // "REQBODY_ERROR_MSG" + TOK_VARIABLE_REQBODY_ERROR = 317, // "REQBODY_ERROR" + TOK_VARIABLE_REQBODY_PROCESSOR_ERROR_MSG = 318, // "REQBODY_PROCESSOR_ERROR_MSG" + TOK_VARIABLE_REQBODY_PROCESSOR_ERROR = 319, // "REQBODY_PROCESSOR_ERROR" + TOK_VARIABLE_REQBODY_PROCESSOR = 320, // "REQBODY_PROCESSOR" + TOK_VARIABLE_REQUEST_BASENAME = 321, // "REQUEST_BASENAME" + TOK_VARIABLE_REQUEST_BODY_LENGTH = 322, // "REQUEST_BODY_LENGTH" + TOK_VARIABLE_REQUEST_BODY = 323, // "REQUEST_BODY" + TOK_VARIABLE_REQUEST_FILE_NAME = 324, // "REQUEST_FILENAME" + TOK_VARIABLE_REQUEST_HEADERS_NAMES = 325, // VARIABLE_REQUEST_HEADERS_NAMES + TOK_VARIABLE_REQUEST_LINE = 326, // "REQUEST_LINE" + TOK_VARIABLE_REQUEST_METHOD = 327, // "REQUEST_METHOD" + TOK_VARIABLE_REQUEST_PROTOCOL = 328, // "REQUEST_PROTOCOL" + TOK_VARIABLE_REQUEST_URI_RAW = 329, // "REQUEST_URI_RAW" + TOK_VARIABLE_REQUEST_URI = 330, // "REQUEST_URI" + TOK_VARIABLE_RESOURCE = 331, // "RESOURCE" + TOK_VARIABLE_RESPONSE_BODY = 332, // "RESPONSE_BODY" + TOK_VARIABLE_RESPONSE_CONTENT_LENGTH = 333, // "RESPONSE_CONTENT_LENGTH" + TOK_VARIABLE_RESPONSE_CONTENT_TYPE = 334, // VARIABLE_RESPONSE_CONTENT_TYPE + TOK_VARIABLE_RESPONSE_HEADERS_NAMES = 335, // VARIABLE_RESPONSE_HEADERS_NAMES + TOK_VARIABLE_RESPONSE_PROTOCOL = 336, // "RESPONSE_PROTOCOL" + TOK_VARIABLE_RESPONSE_STATUS = 337, // "RESPONSE_STATUS" + TOK_VARIABLE_SERVER_ADDR = 338, // "SERVER_ADDR" + TOK_VARIABLE_SERVER_NAME = 339, // "SERVER_NAME" + TOK_VARIABLE_SERVER_PORT = 340, // "SERVER_PORT" + TOK_VARIABLE_SESSION_ID = 341, // "SESSIONID" + TOK_VARIABLE_UNIQUE_ID = 342, // "UNIQUE_ID" + TOK_VARIABLE_URL_ENCODED_ERROR = 343, // "URLENCODED_ERROR" + TOK_VARIABLE_USER_ID = 344, // "USERID" + TOK_VARIABLE_WEB_APP_ID = 345, // "WEBAPPID" + TOK_VARIABLE_STATUS = 346, // "VARIABLE_STATUS" + TOK_VARIABLE_STATUS_LINE = 347, // "VARIABLE_STATUS_LINE" + TOK_VARIABLE_IP = 348, // "VARIABLE_IP" + TOK_VARIABLE_GLOBAL = 349, // "VARIABLE_GLOBAL" + TOK_VARIABLE_TX = 350, // "VARIABLE_TX" + TOK_VARIABLE_SESSION = 351, // "VARIABLE_SESSION" + TOK_VARIABLE_USER = 352, // "VARIABLE_USER" + TOK_RUN_TIME_VAR_ENV = 353, // "RUN_TIME_VAR_ENV" + TOK_RUN_TIME_VAR_XML = 354, // "RUN_TIME_VAR_XML" + TOK_ACTION_SETVAR = 355, // "SetVar" + TOK_SETVAR_OPERATION_EQUALS = 356, // SETVAR_OPERATION_EQUALS + TOK_SETVAR_OPERATION_EQUALS_PLUS = 357, // SETVAR_OPERATION_EQUALS_PLUS + TOK_SETVAR_OPERATION_EQUALS_MINUS = 358, // SETVAR_OPERATION_EQUALS_MINUS + TOK_NOT = 359, // "NOT" + TOK_OPERATOR_BEGINS_WITH = 360, // "OPERATOR_BEGINS_WITH" + TOK_OPERATOR_CONTAINS = 361, // "OPERATOR_CONTAINS" + TOK_OPERATOR_CONTAINS_WORD = 362, // "OPERATOR_CONTAINS_WORD" + TOK_OPERATOR_DETECT_SQLI = 363, // "OPERATOR_DETECT_SQLI" + TOK_OPERATOR_DETECT_XSS = 364, // "OPERATOR_DETECT_XSS" + TOK_OPERATOR_ENDS_WITH = 365, // "OPERATOR_ENDS_WITH" + TOK_OPERATOR_EQ = 366, // "OPERATOR_EQ" + TOK_OPERATOR_FUZZY_HASH = 367, // "OPERATOR_FUZZY_HASH" + TOK_OPERATOR_GEOLOOKUP = 368, // "OPERATOR_GEOLOOKUP" + TOK_OPERATOR_GE = 369, // "OPERATOR_GE" + TOK_OPERATOR_GSB_LOOKUP = 370, // "OPERATOR_GSB_LOOKUP" + TOK_OPERATOR_GT = 371, // "OPERATOR_GT" + TOK_OPERATOR_INSPECT_FILE = 372, // "OPERATOR_INSPECT_FILE" + TOK_OPERATOR_IP_MATCH_FROM_FILE = 373, // "OPERATOR_IP_MATCH_FROM_FILE" + TOK_OPERATOR_IP_MATCH = 374, // "OPERATOR_IP_MATCH" + TOK_OPERATOR_LE = 375, // "OPERATOR_LE" + TOK_OPERATOR_LT = 376, // "OPERATOR_LT" + TOK_OPERATOR_PM_FROM_FILE = 377, // "OPERATOR_PM_FROM_FILE" + TOK_OPERATOR_PM = 378, // "OPERATOR_PM" + TOK_OPERATOR_RBL = 379, // "OPERATOR_RBL" + TOK_OPERATOR_RSUB = 380, // "OPERATOR_RSUB" + TOK_OPERATOR_RX_CONTENT_ONLY = 381, // "Operator RX (content only)" + TOK_OPERATOR_RX = 382, // "OPERATOR_RX" + TOK_OPERATOR_RX_GLOBAL = 383, // "OPERATOR_RX_GLOBAL" + TOK_OPERATOR_STR_EQ = 384, // "OPERATOR_STR_EQ" + TOK_OPERATOR_STR_MATCH = 385, // "OPERATOR_STR_MATCH" + TOK_OPERATOR_UNCONDITIONAL_MATCH = 386, // "OPERATOR_UNCONDITIONAL_MATCH" + TOK_OPERATOR_VALIDATE_BYTE_RANGE = 387, // "OPERATOR_VALIDATE_BYTE_RANGE" + TOK_OPERATOR_VALIDATE_DTD = 388, // "OPERATOR_VALIDATE_DTD" + TOK_OPERATOR_VALIDATE_HASH = 389, // "OPERATOR_VALIDATE_HASH" + TOK_OPERATOR_VALIDATE_SCHEMA = 390, // "OPERATOR_VALIDATE_SCHEMA" + TOK_OPERATOR_VALIDATE_URL_ENCODING = 391, // "OPERATOR_VALIDATE_URL_ENCODING" + TOK_OPERATOR_VALIDATE_UTF8_ENCODING = 392, // "OPERATOR_VALIDATE_UTF8_ENCODING" + TOK_OPERATOR_VERIFY_CC = 393, // "OPERATOR_VERIFY_CC" + TOK_OPERATOR_VERIFY_CPF = 394, // "OPERATOR_VERIFY_CPF" + TOK_OPERATOR_VERIFY_SSN = 395, // "OPERATOR_VERIFY_SSN" + TOK_OPERATOR_VERIFY_SVNR = 396, // "OPERATOR_VERIFY_SVNR" + TOK_OPERATOR_WITHIN = 397, // "OPERATOR_WITHIN" + TOK_CONFIG_DIR_AUDIT_LOG_FMT = 398, // CONFIG_DIR_AUDIT_LOG_FMT + TOK_JSON = 399, // JSON + TOK_NATIVE = 400, // NATIVE + TOK_ACTION_CTL_RULE_ENGINE = 401, // "ACTION_CTL_RULE_ENGINE" + TOK_ACTION_ACCURACY = 402, // "Accuracy" + TOK_ACTION_ALLOW = 403, // "Allow" + TOK_ACTION_APPEND = 404, // "Append" + TOK_ACTION_AUDIT_LOG = 405, // "AuditLog" + TOK_ACTION_BLOCK = 406, // "Block" + TOK_ACTION_CAPTURE = 407, // "Capture" + TOK_ACTION_CHAIN = 408, // "Chain" + TOK_ACTION_CTL_AUDIT_ENGINE = 409, // "ACTION_CTL_AUDIT_ENGINE" + TOK_ACTION_CTL_AUDIT_LOG_PARTS = 410, // "ACTION_CTL_AUDIT_LOG_PARTS" + TOK_ACTION_CTL_BDY_JSON = 411, // "ACTION_CTL_BDY_JSON" + TOK_ACTION_CTL_BDY_XML = 412, // "ACTION_CTL_BDY_XML" + TOK_ACTION_CTL_BDY_URLENCODED = 413, // "ACTION_CTL_BDY_URLENCODED" + TOK_ACTION_CTL_FORCE_REQ_BODY_VAR = 414, // "ACTION_CTL_FORCE_REQ_BODY_VAR" + TOK_ACTION_CTL_REQUEST_BODY_ACCESS = 415, // "ACTION_CTL_REQUEST_BODY_ACCESS" + TOK_ACTION_CTL_RULE_REMOVE_BY_ID = 416, // "ACTION_CTL_RULE_REMOVE_BY_ID" + TOK_ACTION_CTL_RULE_REMOVE_BY_TAG = 417, // "ACTION_CTL_RULE_REMOVE_BY_TAG" + TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID = 418, // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG = 419, // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + TOK_ACTION_DENY = 420, // "Deny" + TOK_ACTION_DEPRECATE_VAR = 421, // "DeprecateVar" + TOK_ACTION_DROP = 422, // "Drop" + TOK_ACTION_EXEC = 423, // "Exec" + TOK_ACTION_EXPIRE_VAR = 424, // "ExpireVar" + TOK_ACTION_ID = 425, // "Id" + TOK_ACTION_INITCOL = 426, // "InitCol" + TOK_ACTION_LOG = 427, // "Log" + TOK_ACTION_LOG_DATA = 428, // "LogData" + TOK_ACTION_MATURITY = 429, // "Maturity" + TOK_ACTION_MSG = 430, // "Msg" + TOK_ACTION_MULTI_MATCH = 431, // "MultiMatch" + TOK_ACTION_NO_AUDIT_LOG = 432, // "NoAuditLog" + TOK_ACTION_NO_LOG = 433, // "NoLog" + TOK_ACTION_PASS = 434, // "Pass" + TOK_ACTION_PAUSE = 435, // "Pause" + TOK_ACTION_PHASE = 436, // "Phase" + TOK_ACTION_PREPEND = 437, // "Prepend" + TOK_ACTION_PROXY = 438, // "Proxy" + TOK_ACTION_REDIRECT = 439, // "Redirect" + TOK_ACTION_REV = 440, // "Rev" + TOK_ACTION_SANITISE_ARG = 441, // "SanitiseArg" + TOK_ACTION_SANITISE_MATCHED = 442, // "SanitiseMatched" + TOK_ACTION_SANITISE_MATCHED_BYTES = 443, // "SanitiseMatchedBytes" + TOK_ACTION_SANITISE_REQUEST_HEADER = 444, // "SanitiseRequestHeader" + TOK_ACTION_SANITISE_RESPONSE_HEADER = 445, // "SanitiseResponseHeader" + TOK_ACTION_SETENV = 446, // "SetEnv" + TOK_ACTION_SETRSC = 447, // "SetRsc" + TOK_ACTION_SETSID = 448, // "SetSid" + TOK_ACTION_SETUID = 449, // "SetUID" + TOK_ACTION_SEVERITY = 450, // "Severity" + TOK_ACTION_SKIP = 451, // "Skip" + TOK_ACTION_SKIP_AFTER = 452, // "SkipAfter" + TOK_ACTION_STATUS = 453, // "Status" + TOK_ACTION_TAG = 454, // "Tag" + TOK_ACTION_TRANSFORMATION_BASE_64_ENCODE = 455, // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + TOK_ACTION_TRANSFORMATION_BASE_64_DECODE = 456, // "ACTION_TRANSFORMATION_BASE_64_DECODE" + TOK_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT = 457, // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + TOK_ACTION_TRANSFORMATION_CMD_LINE = 458, // "ACTION_TRANSFORMATION_CMD_LINE" + TOK_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE = 459, // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + TOK_ACTION_TRANSFORMATION_CSS_DECODE = 460, // "ACTION_TRANSFORMATION_CSS_DECODE" + TOK_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE = 461, // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + TOK_ACTION_TRANSFORMATION_HEX_ENCODE = 462, // "ACTION_TRANSFORMATION_HEX_ENCODE" + TOK_ACTION_TRANSFORMATION_HEX_DECODE = 463, // "ACTION_TRANSFORMATION_HEX_DECODE" + TOK_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE = 464, // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + TOK_ACTION_TRANSFORMATION_JS_DECODE = 465, // "ACTION_TRANSFORMATION_JS_DECODE" + TOK_ACTION_TRANSFORMATION_LENGTH = 466, // "ACTION_TRANSFORMATION_LENGTH" + TOK_ACTION_TRANSFORMATION_LOWERCASE = 467, // "ACTION_TRANSFORMATION_LOWERCASE" + TOK_ACTION_TRANSFORMATION_MD5 = 468, // "ACTION_TRANSFORMATION_MD5" + TOK_ACTION_TRANSFORMATION_NONE = 469, // "ACTION_TRANSFORMATION_NONE" + TOK_ACTION_TRANSFORMATION_NORMALISE_PATH = 470, // "ACTION_TRANSFORMATION_NORMALISE_PATH" + TOK_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN = 471, // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + TOK_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT = 472, // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + TOK_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT = 473, // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + TOK_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT = 474, // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + TOK_ACTION_TRANSFORMATION_REMOVE_COMMENTS = 475, // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + TOK_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR = 476, // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + TOK_ACTION_TRANSFORMATION_REMOVE_NULLS = 477, // "ACTION_TRANSFORMATION_REMOVE_NULLS" + TOK_ACTION_TRANSFORMATION_REMOVE_WHITESPACE = 478, // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + TOK_ACTION_TRANSFORMATION_REPLACE_COMMENTS = 479, // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + TOK_ACTION_TRANSFORMATION_REPLACE_NULLS = 480, // "ACTION_TRANSFORMATION_REPLACE_NULLS" + TOK_ACTION_TRANSFORMATION_SHA1 = 481, // "ACTION_TRANSFORMATION_SHA1" + TOK_ACTION_TRANSFORMATION_SQL_HEX_DECODE = 482, // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + TOK_ACTION_TRANSFORMATION_TRIM = 483, // "ACTION_TRANSFORMATION_TRIM" + TOK_ACTION_TRANSFORMATION_TRIM_LEFT = 484, // "ACTION_TRANSFORMATION_TRIM_LEFT" + TOK_ACTION_TRANSFORMATION_TRIM_RIGHT = 485, // "ACTION_TRANSFORMATION_TRIM_RIGHT" + TOK_ACTION_TRANSFORMATION_UPPERCASE = 486, // "ACTION_TRANSFORMATION_UPPERCASE" + TOK_ACTION_TRANSFORMATION_URL_ENCODE = 487, // "ACTION_TRANSFORMATION_URL_ENCODE" + TOK_ACTION_TRANSFORMATION_URL_DECODE = 488, // "ACTION_TRANSFORMATION_URL_DECODE" + TOK_ACTION_TRANSFORMATION_URL_DECODE_UNI = 489, // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + TOK_ACTION_TRANSFORMATION_UTF8_TO_UNICODE = 490, // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + TOK_ACTION_VER = 491, // "Ver" + TOK_ACTION_XMLNS = 492, // "xmlns" + TOK_CONFIG_COMPONENT_SIG = 493, // "CONFIG_COMPONENT_SIG" + TOK_CONFIG_CONN_ENGINE = 494, // "CONFIG_CONN_ENGINE" + TOK_CONFIG_SEC_ARGUMENT_SEPARATOR = 495, // "CONFIG_SEC_ARGUMENT_SEPARATOR" + TOK_CONFIG_SEC_WEB_APP_ID = 496, // "CONFIG_SEC_WEB_APP_ID" + TOK_CONFIG_SEC_SERVER_SIG = 497, // "CONFIG_SEC_SERVER_SIG" + TOK_CONFIG_DIR_AUDIT_DIR = 498, // "CONFIG_DIR_AUDIT_DIR" + TOK_CONFIG_DIR_AUDIT_DIR_MOD = 499, // "CONFIG_DIR_AUDIT_DIR_MOD" + TOK_CONFIG_DIR_AUDIT_ENG = 500, // "CONFIG_DIR_AUDIT_ENG" + TOK_CONFIG_DIR_AUDIT_FLE_MOD = 501, // "CONFIG_DIR_AUDIT_FLE_MOD" + TOK_CONFIG_DIR_AUDIT_LOG = 502, // "CONFIG_DIR_AUDIT_LOG" + TOK_CONFIG_DIR_AUDIT_LOG2 = 503, // "CONFIG_DIR_AUDIT_LOG2" + TOK_CONFIG_DIR_AUDIT_LOG_P = 504, // "CONFIG_DIR_AUDIT_LOG_P" + TOK_CONFIG_DIR_AUDIT_STS = 505, // "CONFIG_DIR_AUDIT_STS" + TOK_CONFIG_DIR_AUDIT_TPE = 506, // "CONFIG_DIR_AUDIT_TPE" + TOK_CONFIG_DIR_DEBUG_LOG = 507, // "CONFIG_DIR_DEBUG_LOG" + TOK_CONFIG_DIR_DEBUG_LVL = 508, // "CONFIG_DIR_DEBUG_LVL" + TOK_CONFIG_SEC_CACHE_TRANSFORMATIONS = 509, // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + TOK_CONFIG_SEC_DISABLE_BACKEND_COMPRESS = 510, // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + TOK_CONFIG_SEC_HASH_ENGINE = 511, // "CONFIG_SEC_HASH_ENGINE" + TOK_CONFIG_SEC_HASH_KEY = 512, // "CONFIG_SEC_HASH_KEY" + TOK_CONFIG_SEC_HASH_PARAM = 513, // "CONFIG_SEC_HASH_PARAM" + TOK_CONFIG_SEC_HASH_METHOD_RX = 514, // "CONFIG_SEC_HASH_METHOD_RX" + TOK_CONFIG_SEC_HASH_METHOD_PM = 515, // "CONFIG_SEC_HASH_METHOD_PM" + TOK_CONFIG_SEC_CHROOT_DIR = 516, // "CONFIG_SEC_CHROOT_DIR" + TOK_CONFIG_DIR_GEO_DB = 517, // "CONFIG_DIR_GEO_DB" + TOK_CONFIG_DIR_GSB_DB = 518, // "CONFIG_DIR_GSB_DB" + TOK_CONFIG_SEC_GUARDIAN_LOG = 519, // "CONFIG_SEC_GUARDIAN_LOG" + TOK_CONFIG_DIR_PCRE_MATCH_LIMIT = 520, // "CONFIG_DIR_PCRE_MATCH_LIMIT" + TOK_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION = 521, // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + TOK_CONFIG_SEC_CONN_R_STATE_LIMIT = 522, // "CONFIG_SEC_CONN_R_STATE_LIMIT" + TOK_CONFIG_SEC_CONN_W_STATE_LIMIT = 523, // "CONFIG_SEC_CONN_W_STATE_LIMIT" + TOK_CONFIG_SEC_SENSOR_ID = 524, // "CONFIG_SEC_SENSOR_ID" + TOK_CONFIG_DIR_ARGS_LIMIT = 525, // "CONFIG_DIR_ARGS_LIMIT" + TOK_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT = 526, // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + TOK_CONFIG_DIR_REQ_BODY = 527, // "CONFIG_DIR_REQ_BODY" + TOK_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT = 528, // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + TOK_CONFIG_DIR_REQ_BODY_LIMIT = 529, // "CONFIG_DIR_REQ_BODY_LIMIT" + TOK_CONFIG_DIR_REQ_BODY_LIMIT_ACTION = 530, // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + TOK_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT = 531, // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + TOK_CONFIG_DIR_RES_BODY = 532, // "CONFIG_DIR_RES_BODY" + TOK_CONFIG_DIR_RES_BODY_LIMIT = 533, // "CONFIG_DIR_RES_BODY_LIMIT" + TOK_CONFIG_DIR_RES_BODY_LIMIT_ACTION = 534, // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + TOK_CONFIG_SEC_RULE_INHERITANCE = 535, // "CONFIG_SEC_RULE_INHERITANCE" + TOK_CONFIG_SEC_RULE_PERF_TIME = 536, // "CONFIG_SEC_RULE_PERF_TIME" + TOK_CONFIG_DIR_RULE_ENG = 537, // "CONFIG_DIR_RULE_ENG" + TOK_CONFIG_DIR_SEC_ACTION = 538, // "CONFIG_DIR_SEC_ACTION" + TOK_CONFIG_DIR_SEC_DEFAULT_ACTION = 539, // "CONFIG_DIR_SEC_DEFAULT_ACTION" + TOK_CONFIG_DIR_SEC_MARKER = 540, // "CONFIG_DIR_SEC_MARKER" + TOK_CONFIG_DIR_UNICODE_MAP_FILE = 541, // "CONFIG_DIR_UNICODE_MAP_FILE" + TOK_CONFIG_DIR_UNICODE_CODE_PAGE = 542, // "CONFIG_DIR_UNICODE_CODE_PAGE" + TOK_CONFIG_SEC_COLLECTION_TIMEOUT = 543, // "CONFIG_SEC_COLLECTION_TIMEOUT" + TOK_CONFIG_SEC_HTTP_BLKEY = 544, // "CONFIG_SEC_HTTP_BLKEY" + TOK_CONFIG_SEC_INTERCEPT_ON_ERROR = 545, // "CONFIG_SEC_INTERCEPT_ON_ERROR" + TOK_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION = 546, // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + TOK_CONFIG_SEC_RULE_REMOVE_BY_ID = 547, // "CONFIG_SEC_RULE_REMOVE_BY_ID" + TOK_CONFIG_SEC_RULE_REMOVE_BY_MSG = 548, // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + TOK_CONFIG_SEC_RULE_REMOVE_BY_TAG = 549, // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG = 550, // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG = 551, // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID = 552, // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + TOK_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID = 553, // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + TOK_CONFIG_UPDLOAD_KEEP_FILES = 554, // "CONFIG_UPDLOAD_KEEP_FILES" + TOK_CONFIG_UPDLOAD_SAVE_TMP_FILES = 555, // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + TOK_CONFIG_UPLOAD_DIR = 556, // "CONFIG_UPLOAD_DIR" + TOK_CONFIG_UPLOAD_FILE_LIMIT = 557, // "CONFIG_UPLOAD_FILE_LIMIT" + TOK_CONFIG_UPLOAD_FILE_MODE = 558, // "CONFIG_UPLOAD_FILE_MODE" + TOK_CONFIG_VALUE_ABORT = 559, // "CONFIG_VALUE_ABORT" + TOK_CONFIG_VALUE_DETC = 560, // "CONFIG_VALUE_DETC" + TOK_CONFIG_VALUE_HTTPS = 561, // "CONFIG_VALUE_HTTPS" + TOK_CONFIG_VALUE_OFF = 562, // "CONFIG_VALUE_OFF" + TOK_CONFIG_VALUE_ON = 563, // "CONFIG_VALUE_ON" + TOK_CONFIG_VALUE_PARALLEL = 564, // "CONFIG_VALUE_PARALLEL" + TOK_CONFIG_VALUE_PROCESS_PARTIAL = 565, // "CONFIG_VALUE_PROCESS_PARTIAL" + TOK_CONFIG_VALUE_REJECT = 566, // "CONFIG_VALUE_REJECT" + TOK_CONFIG_VALUE_RELEVANT_ONLY = 567, // "CONFIG_VALUE_RELEVANT_ONLY" + TOK_CONFIG_VALUE_SERIAL = 568, // "CONFIG_VALUE_SERIAL" + TOK_CONFIG_VALUE_WARN = 569, // "CONFIG_VALUE_WARN" + TOK_CONFIG_XML_EXTERNAL_ENTITY = 570, // "CONFIG_XML_EXTERNAL_ENTITY" + TOK_CONGIG_DIR_RESPONSE_BODY_MP = 571, // "CONGIG_DIR_RESPONSE_BODY_MP" + TOK_CONGIG_DIR_SEC_ARG_SEP = 572, // "CONGIG_DIR_SEC_ARG_SEP" + TOK_CONGIG_DIR_SEC_COOKIE_FORMAT = 573, // "CONGIG_DIR_SEC_COOKIE_FORMAT" + TOK_CONFIG_SEC_COOKIEV0_SEPARATOR = 574, // "CONFIG_SEC_COOKIEV0_SEPARATOR" + TOK_CONGIG_DIR_SEC_DATA_DIR = 575, // "CONGIG_DIR_SEC_DATA_DIR" + TOK_CONGIG_DIR_SEC_STATUS_ENGINE = 576, // "CONGIG_DIR_SEC_STATUS_ENGINE" + TOK_CONFIG_SEC_STREAM_IN_BODY_INSPECTION = 577, // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + TOK_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION = 578, // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + TOK_CONGIG_DIR_SEC_TMP_DIR = 579, // "CONGIG_DIR_SEC_TMP_DIR" + TOK_DIRECTIVE = 580, // "DIRECTIVE" + TOK_DIRECTIVE_SECRULESCRIPT = 581, // "DIRECTIVE_SECRULESCRIPT" + TOK_FREE_TEXT_QUOTE_MACRO_EXPANSION = 582, // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + TOK_QUOTATION_MARK = 583, // "QUOTATION_MARK" + TOK_RUN_TIME_VAR_BLD = 584, // "RUN_TIME_VAR_BLD" + TOK_RUN_TIME_VAR_DUR = 585, // "RUN_TIME_VAR_DUR" + TOK_RUN_TIME_VAR_HSV = 586, // "RUN_TIME_VAR_HSV" + TOK_RUN_TIME_VAR_REMOTE_USER = 587, // "RUN_TIME_VAR_REMOTE_USER" + TOK_RUN_TIME_VAR_TIME = 588, // "RUN_TIME_VAR_TIME" + TOK_RUN_TIME_VAR_TIME_DAY = 589, // "RUN_TIME_VAR_TIME_DAY" + TOK_RUN_TIME_VAR_TIME_EPOCH = 590, // "RUN_TIME_VAR_TIME_EPOCH" + TOK_RUN_TIME_VAR_TIME_HOUR = 591, // "RUN_TIME_VAR_TIME_HOUR" + TOK_RUN_TIME_VAR_TIME_MIN = 592, // "RUN_TIME_VAR_TIME_MIN" + TOK_RUN_TIME_VAR_TIME_MON = 593, // "RUN_TIME_VAR_TIME_MON" + TOK_RUN_TIME_VAR_TIME_SEC = 594, // "RUN_TIME_VAR_TIME_SEC" + TOK_RUN_TIME_VAR_TIME_WDAY = 595, // "RUN_TIME_VAR_TIME_WDAY" + TOK_RUN_TIME_VAR_TIME_YEAR = 596, // "RUN_TIME_VAR_TIME_YEAR" + TOK_VARIABLE = 597, // "VARIABLE" + TOK_DICT_ELEMENT = 598, // "Dictionary element" + TOK_DICT_ELEMENT_REGEXP = 599 // "Dictionary element, selected by regexp" + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; + }; + + /// Token kind, as returned by yylex. + typedef token::yytokentype token_kind_type; + + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type token_type; + + /// Symbol kinds. + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 345, ///< Number of tokens. + S_YYEMPTY = -2, + S_YYEOF = 0, // "end of file" + S_YYerror = 1, // error + S_YYUNDEF = 2, // "invalid token" + S_COMMA = 3, // "," + S_CONFIG_CONTENT_INJECTION = 4, // "CONFIG_CONTENT_INJECTION" + S_CONGIG_DIR_RESPONSE_BODY_MP_CLEAR = 5, // "CONGIG_DIR_RESPONSE_BODY_MP_CLEAR" + S_PIPE = 6, // PIPE + S_NEW_LINE = 7, // NEW_LINE + S_VAR_COUNT = 8, // VAR_COUNT + S_VAR_EXCLUSION = 9, // VAR_EXCLUSION + S_VARIABLE_ARGS = 10, // VARIABLE_ARGS + S_VARIABLE_ARGS_POST = 11, // VARIABLE_ARGS_POST + S_VARIABLE_ARGS_GET = 12, // VARIABLE_ARGS_GET + S_VARIABLE_FILES_SIZES = 13, // VARIABLE_FILES_SIZES + S_VARIABLE_FILES_NAMES = 14, // VARIABLE_FILES_NAMES + S_VARIABLE_FILES_TMP_CONTENT = 15, // VARIABLE_FILES_TMP_CONTENT + S_VARIABLE_MULTIPART_FILENAME = 16, // VARIABLE_MULTIPART_FILENAME + S_VARIABLE_MULTIPART_NAME = 17, // VARIABLE_MULTIPART_NAME + S_VARIABLE_MATCHED_VARS_NAMES = 18, // VARIABLE_MATCHED_VARS_NAMES + S_VARIABLE_MATCHED_VARS = 19, // VARIABLE_MATCHED_VARS + S_VARIABLE_FILES = 20, // VARIABLE_FILES + S_VARIABLE_REQUEST_COOKIES = 21, // VARIABLE_REQUEST_COOKIES + S_VARIABLE_REQUEST_HEADERS = 22, // VARIABLE_REQUEST_HEADERS + S_VARIABLE_RESPONSE_HEADERS = 23, // VARIABLE_RESPONSE_HEADERS + S_VARIABLE_GEO = 24, // VARIABLE_GEO + S_VARIABLE_REQUEST_COOKIES_NAMES = 25, // VARIABLE_REQUEST_COOKIES_NAMES + S_VARIABLE_MULTIPART_PART_HEADERS = 26, // VARIABLE_MULTIPART_PART_HEADERS + S_VARIABLE_ARGS_COMBINED_SIZE = 27, // VARIABLE_ARGS_COMBINED_SIZE + S_VARIABLE_ARGS_GET_NAMES = 28, // VARIABLE_ARGS_GET_NAMES + S_VARIABLE_RULE = 29, // VARIABLE_RULE + S_VARIABLE_ARGS_NAMES = 30, // "Variable ARGS_NAMES" + S_VARIABLE_ARGS_POST_NAMES = 31, // VARIABLE_ARGS_POST_NAMES + S_VARIABLE_AUTH_TYPE = 32, // "AUTH_TYPE" + S_VARIABLE_FILES_COMBINED_SIZE = 33, // "FILES_COMBINED_SIZE" + S_VARIABLE_FILES_TMP_NAMES = 34, // "FILES_TMPNAMES" + S_VARIABLE_FULL_REQUEST = 35, // "FULL_REQUEST" + S_VARIABLE_FULL_REQUEST_LENGTH = 36, // "FULL_REQUEST_LENGTH" + S_VARIABLE_INBOUND_DATA_ERROR = 37, // "INBOUND_DATA_ERROR" + S_VARIABLE_MATCHED_VAR = 38, // "MATCHED_VAR" + S_VARIABLE_MATCHED_VAR_NAME = 39, // "MATCHED_VAR_NAME" + S_VARIABLE_MULTIPART_BOUNDARY_QUOTED = 40, // VARIABLE_MULTIPART_BOUNDARY_QUOTED + S_VARIABLE_MULTIPART_BOUNDARY_WHITESPACE = 41, // VARIABLE_MULTIPART_BOUNDARY_WHITESPACE + S_VARIABLE_MULTIPART_CRLF_LF_LINES = 42, // "MULTIPART_CRLF_LF_LINES" + S_VARIABLE_MULTIPART_DATA_AFTER = 43, // "MULTIPART_DATA_AFTER" + S_VARIABLE_MULTIPART_DATA_BEFORE = 44, // VARIABLE_MULTIPART_DATA_BEFORE + S_VARIABLE_MULTIPART_FILE_LIMIT_EXCEEDED = 45, // "MULTIPART_FILE_LIMIT_EXCEEDED" + S_VARIABLE_MULTIPART_HEADER_FOLDING = 46, // "MULTIPART_HEADER_FOLDING" + S_VARIABLE_MULTIPART_INVALID_HEADER_FOLDING = 47, // "MULTIPART_INVALID_HEADER_FOLDING" + S_VARIABLE_MULTIPART_INVALID_PART = 48, // VARIABLE_MULTIPART_INVALID_PART + S_VARIABLE_MULTIPART_INVALID_QUOTING = 49, // "MULTIPART_INVALID_QUOTING" + S_VARIABLE_MULTIPART_LF_LINE = 50, // VARIABLE_MULTIPART_LF_LINE + S_VARIABLE_MULTIPART_MISSING_SEMICOLON = 51, // VARIABLE_MULTIPART_MISSING_SEMICOLON + S_VARIABLE_MULTIPART_SEMICOLON_MISSING = 52, // VARIABLE_MULTIPART_SEMICOLON_MISSING + S_VARIABLE_MULTIPART_STRICT_ERROR = 53, // "MULTIPART_STRICT_ERROR" + S_VARIABLE_MULTIPART_UNMATCHED_BOUNDARY = 54, // "MULTIPART_UNMATCHED_BOUNDARY" + S_VARIABLE_OUTBOUND_DATA_ERROR = 55, // "OUTBOUND_DATA_ERROR" + S_VARIABLE_PATH_INFO = 56, // "PATH_INFO" + S_VARIABLE_QUERY_STRING = 57, // "QUERY_STRING" + S_VARIABLE_REMOTE_ADDR = 58, // "REMOTE_ADDR" + S_VARIABLE_REMOTE_HOST = 59, // "REMOTE_HOST" + S_VARIABLE_REMOTE_PORT = 60, // "REMOTE_PORT" + S_VARIABLE_REQBODY_ERROR_MSG = 61, // "REQBODY_ERROR_MSG" + S_VARIABLE_REQBODY_ERROR = 62, // "REQBODY_ERROR" + S_VARIABLE_REQBODY_PROCESSOR_ERROR_MSG = 63, // "REQBODY_PROCESSOR_ERROR_MSG" + S_VARIABLE_REQBODY_PROCESSOR_ERROR = 64, // "REQBODY_PROCESSOR_ERROR" + S_VARIABLE_REQBODY_PROCESSOR = 65, // "REQBODY_PROCESSOR" + S_VARIABLE_REQUEST_BASENAME = 66, // "REQUEST_BASENAME" + S_VARIABLE_REQUEST_BODY_LENGTH = 67, // "REQUEST_BODY_LENGTH" + S_VARIABLE_REQUEST_BODY = 68, // "REQUEST_BODY" + S_VARIABLE_REQUEST_FILE_NAME = 69, // "REQUEST_FILENAME" + S_VARIABLE_REQUEST_HEADERS_NAMES = 70, // VARIABLE_REQUEST_HEADERS_NAMES + S_VARIABLE_REQUEST_LINE = 71, // "REQUEST_LINE" + S_VARIABLE_REQUEST_METHOD = 72, // "REQUEST_METHOD" + S_VARIABLE_REQUEST_PROTOCOL = 73, // "REQUEST_PROTOCOL" + S_VARIABLE_REQUEST_URI_RAW = 74, // "REQUEST_URI_RAW" + S_VARIABLE_REQUEST_URI = 75, // "REQUEST_URI" + S_VARIABLE_RESOURCE = 76, // "RESOURCE" + S_VARIABLE_RESPONSE_BODY = 77, // "RESPONSE_BODY" + S_VARIABLE_RESPONSE_CONTENT_LENGTH = 78, // "RESPONSE_CONTENT_LENGTH" + S_VARIABLE_RESPONSE_CONTENT_TYPE = 79, // VARIABLE_RESPONSE_CONTENT_TYPE + S_VARIABLE_RESPONSE_HEADERS_NAMES = 80, // VARIABLE_RESPONSE_HEADERS_NAMES + S_VARIABLE_RESPONSE_PROTOCOL = 81, // "RESPONSE_PROTOCOL" + S_VARIABLE_RESPONSE_STATUS = 82, // "RESPONSE_STATUS" + S_VARIABLE_SERVER_ADDR = 83, // "SERVER_ADDR" + S_VARIABLE_SERVER_NAME = 84, // "SERVER_NAME" + S_VARIABLE_SERVER_PORT = 85, // "SERVER_PORT" + S_VARIABLE_SESSION_ID = 86, // "SESSIONID" + S_VARIABLE_UNIQUE_ID = 87, // "UNIQUE_ID" + S_VARIABLE_URL_ENCODED_ERROR = 88, // "URLENCODED_ERROR" + S_VARIABLE_USER_ID = 89, // "USERID" + S_VARIABLE_WEB_APP_ID = 90, // "WEBAPPID" + S_VARIABLE_STATUS = 91, // "VARIABLE_STATUS" + S_VARIABLE_STATUS_LINE = 92, // "VARIABLE_STATUS_LINE" + S_VARIABLE_IP = 93, // "VARIABLE_IP" + S_VARIABLE_GLOBAL = 94, // "VARIABLE_GLOBAL" + S_VARIABLE_TX = 95, // "VARIABLE_TX" + S_VARIABLE_SESSION = 96, // "VARIABLE_SESSION" + S_VARIABLE_USER = 97, // "VARIABLE_USER" + S_RUN_TIME_VAR_ENV = 98, // "RUN_TIME_VAR_ENV" + S_RUN_TIME_VAR_XML = 99, // "RUN_TIME_VAR_XML" + S_ACTION_SETVAR = 100, // "SetVar" + S_SETVAR_OPERATION_EQUALS = 101, // SETVAR_OPERATION_EQUALS + S_SETVAR_OPERATION_EQUALS_PLUS = 102, // SETVAR_OPERATION_EQUALS_PLUS + S_SETVAR_OPERATION_EQUALS_MINUS = 103, // SETVAR_OPERATION_EQUALS_MINUS + S_NOT = 104, // "NOT" + S_OPERATOR_BEGINS_WITH = 105, // "OPERATOR_BEGINS_WITH" + S_OPERATOR_CONTAINS = 106, // "OPERATOR_CONTAINS" + S_OPERATOR_CONTAINS_WORD = 107, // "OPERATOR_CONTAINS_WORD" + S_OPERATOR_DETECT_SQLI = 108, // "OPERATOR_DETECT_SQLI" + S_OPERATOR_DETECT_XSS = 109, // "OPERATOR_DETECT_XSS" + S_OPERATOR_ENDS_WITH = 110, // "OPERATOR_ENDS_WITH" + S_OPERATOR_EQ = 111, // "OPERATOR_EQ" + S_OPERATOR_FUZZY_HASH = 112, // "OPERATOR_FUZZY_HASH" + S_OPERATOR_GEOLOOKUP = 113, // "OPERATOR_GEOLOOKUP" + S_OPERATOR_GE = 114, // "OPERATOR_GE" + S_OPERATOR_GSB_LOOKUP = 115, // "OPERATOR_GSB_LOOKUP" + S_OPERATOR_GT = 116, // "OPERATOR_GT" + S_OPERATOR_INSPECT_FILE = 117, // "OPERATOR_INSPECT_FILE" + S_OPERATOR_IP_MATCH_FROM_FILE = 118, // "OPERATOR_IP_MATCH_FROM_FILE" + S_OPERATOR_IP_MATCH = 119, // "OPERATOR_IP_MATCH" + S_OPERATOR_LE = 120, // "OPERATOR_LE" + S_OPERATOR_LT = 121, // "OPERATOR_LT" + S_OPERATOR_PM_FROM_FILE = 122, // "OPERATOR_PM_FROM_FILE" + S_OPERATOR_PM = 123, // "OPERATOR_PM" + S_OPERATOR_RBL = 124, // "OPERATOR_RBL" + S_OPERATOR_RSUB = 125, // "OPERATOR_RSUB" + S_OPERATOR_RX_CONTENT_ONLY = 126, // "Operator RX (content only)" + S_OPERATOR_RX = 127, // "OPERATOR_RX" + S_OPERATOR_RX_GLOBAL = 128, // "OPERATOR_RX_GLOBAL" + S_OPERATOR_STR_EQ = 129, // "OPERATOR_STR_EQ" + S_OPERATOR_STR_MATCH = 130, // "OPERATOR_STR_MATCH" + S_OPERATOR_UNCONDITIONAL_MATCH = 131, // "OPERATOR_UNCONDITIONAL_MATCH" + S_OPERATOR_VALIDATE_BYTE_RANGE = 132, // "OPERATOR_VALIDATE_BYTE_RANGE" + S_OPERATOR_VALIDATE_DTD = 133, // "OPERATOR_VALIDATE_DTD" + S_OPERATOR_VALIDATE_HASH = 134, // "OPERATOR_VALIDATE_HASH" + S_OPERATOR_VALIDATE_SCHEMA = 135, // "OPERATOR_VALIDATE_SCHEMA" + S_OPERATOR_VALIDATE_URL_ENCODING = 136, // "OPERATOR_VALIDATE_URL_ENCODING" + S_OPERATOR_VALIDATE_UTF8_ENCODING = 137, // "OPERATOR_VALIDATE_UTF8_ENCODING" + S_OPERATOR_VERIFY_CC = 138, // "OPERATOR_VERIFY_CC" + S_OPERATOR_VERIFY_CPF = 139, // "OPERATOR_VERIFY_CPF" + S_OPERATOR_VERIFY_SSN = 140, // "OPERATOR_VERIFY_SSN" + S_OPERATOR_VERIFY_SVNR = 141, // "OPERATOR_VERIFY_SVNR" + S_OPERATOR_WITHIN = 142, // "OPERATOR_WITHIN" + S_CONFIG_DIR_AUDIT_LOG_FMT = 143, // CONFIG_DIR_AUDIT_LOG_FMT + S_JSON = 144, // JSON + S_NATIVE = 145, // NATIVE + S_ACTION_CTL_RULE_ENGINE = 146, // "ACTION_CTL_RULE_ENGINE" + S_ACTION_ACCURACY = 147, // "Accuracy" + S_ACTION_ALLOW = 148, // "Allow" + S_ACTION_APPEND = 149, // "Append" + S_ACTION_AUDIT_LOG = 150, // "AuditLog" + S_ACTION_BLOCK = 151, // "Block" + S_ACTION_CAPTURE = 152, // "Capture" + S_ACTION_CHAIN = 153, // "Chain" + S_ACTION_CTL_AUDIT_ENGINE = 154, // "ACTION_CTL_AUDIT_ENGINE" + S_ACTION_CTL_AUDIT_LOG_PARTS = 155, // "ACTION_CTL_AUDIT_LOG_PARTS" + S_ACTION_CTL_BDY_JSON = 156, // "ACTION_CTL_BDY_JSON" + S_ACTION_CTL_BDY_XML = 157, // "ACTION_CTL_BDY_XML" + S_ACTION_CTL_BDY_URLENCODED = 158, // "ACTION_CTL_BDY_URLENCODED" + S_ACTION_CTL_FORCE_REQ_BODY_VAR = 159, // "ACTION_CTL_FORCE_REQ_BODY_VAR" + S_ACTION_CTL_REQUEST_BODY_ACCESS = 160, // "ACTION_CTL_REQUEST_BODY_ACCESS" + S_ACTION_CTL_RULE_REMOVE_BY_ID = 161, // "ACTION_CTL_RULE_REMOVE_BY_ID" + S_ACTION_CTL_RULE_REMOVE_BY_TAG = 162, // "ACTION_CTL_RULE_REMOVE_BY_TAG" + S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID = 163, // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG = 164, // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + S_ACTION_DENY = 165, // "Deny" + S_ACTION_DEPRECATE_VAR = 166, // "DeprecateVar" + S_ACTION_DROP = 167, // "Drop" + S_ACTION_EXEC = 168, // "Exec" + S_ACTION_EXPIRE_VAR = 169, // "ExpireVar" + S_ACTION_ID = 170, // "Id" + S_ACTION_INITCOL = 171, // "InitCol" + S_ACTION_LOG = 172, // "Log" + S_ACTION_LOG_DATA = 173, // "LogData" + S_ACTION_MATURITY = 174, // "Maturity" + S_ACTION_MSG = 175, // "Msg" + S_ACTION_MULTI_MATCH = 176, // "MultiMatch" + S_ACTION_NO_AUDIT_LOG = 177, // "NoAuditLog" + S_ACTION_NO_LOG = 178, // "NoLog" + S_ACTION_PASS = 179, // "Pass" + S_ACTION_PAUSE = 180, // "Pause" + S_ACTION_PHASE = 181, // "Phase" + S_ACTION_PREPEND = 182, // "Prepend" + S_ACTION_PROXY = 183, // "Proxy" + S_ACTION_REDIRECT = 184, // "Redirect" + S_ACTION_REV = 185, // "Rev" + S_ACTION_SANITISE_ARG = 186, // "SanitiseArg" + S_ACTION_SANITISE_MATCHED = 187, // "SanitiseMatched" + S_ACTION_SANITISE_MATCHED_BYTES = 188, // "SanitiseMatchedBytes" + S_ACTION_SANITISE_REQUEST_HEADER = 189, // "SanitiseRequestHeader" + S_ACTION_SANITISE_RESPONSE_HEADER = 190, // "SanitiseResponseHeader" + S_ACTION_SETENV = 191, // "SetEnv" + S_ACTION_SETRSC = 192, // "SetRsc" + S_ACTION_SETSID = 193, // "SetSid" + S_ACTION_SETUID = 194, // "SetUID" + S_ACTION_SEVERITY = 195, // "Severity" + S_ACTION_SKIP = 196, // "Skip" + S_ACTION_SKIP_AFTER = 197, // "SkipAfter" + S_ACTION_STATUS = 198, // "Status" + S_ACTION_TAG = 199, // "Tag" + S_ACTION_TRANSFORMATION_BASE_64_ENCODE = 200, // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + S_ACTION_TRANSFORMATION_BASE_64_DECODE = 201, // "ACTION_TRANSFORMATION_BASE_64_DECODE" + S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT = 202, // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + S_ACTION_TRANSFORMATION_CMD_LINE = 203, // "ACTION_TRANSFORMATION_CMD_LINE" + S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE = 204, // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + S_ACTION_TRANSFORMATION_CSS_DECODE = 205, // "ACTION_TRANSFORMATION_CSS_DECODE" + S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE = 206, // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + S_ACTION_TRANSFORMATION_HEX_ENCODE = 207, // "ACTION_TRANSFORMATION_HEX_ENCODE" + S_ACTION_TRANSFORMATION_HEX_DECODE = 208, // "ACTION_TRANSFORMATION_HEX_DECODE" + S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE = 209, // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + S_ACTION_TRANSFORMATION_JS_DECODE = 210, // "ACTION_TRANSFORMATION_JS_DECODE" + S_ACTION_TRANSFORMATION_LENGTH = 211, // "ACTION_TRANSFORMATION_LENGTH" + S_ACTION_TRANSFORMATION_LOWERCASE = 212, // "ACTION_TRANSFORMATION_LOWERCASE" + S_ACTION_TRANSFORMATION_MD5 = 213, // "ACTION_TRANSFORMATION_MD5" + S_ACTION_TRANSFORMATION_NONE = 214, // "ACTION_TRANSFORMATION_NONE" + S_ACTION_TRANSFORMATION_NORMALISE_PATH = 215, // "ACTION_TRANSFORMATION_NORMALISE_PATH" + S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN = 216, // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT = 217, // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT = 218, // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT = 219, // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + S_ACTION_TRANSFORMATION_REMOVE_COMMENTS = 220, // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR = 221, // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + S_ACTION_TRANSFORMATION_REMOVE_NULLS = 222, // "ACTION_TRANSFORMATION_REMOVE_NULLS" + S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE = 223, // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + S_ACTION_TRANSFORMATION_REPLACE_COMMENTS = 224, // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + S_ACTION_TRANSFORMATION_REPLACE_NULLS = 225, // "ACTION_TRANSFORMATION_REPLACE_NULLS" + S_ACTION_TRANSFORMATION_SHA1 = 226, // "ACTION_TRANSFORMATION_SHA1" + S_ACTION_TRANSFORMATION_SQL_HEX_DECODE = 227, // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + S_ACTION_TRANSFORMATION_TRIM = 228, // "ACTION_TRANSFORMATION_TRIM" + S_ACTION_TRANSFORMATION_TRIM_LEFT = 229, // "ACTION_TRANSFORMATION_TRIM_LEFT" + S_ACTION_TRANSFORMATION_TRIM_RIGHT = 230, // "ACTION_TRANSFORMATION_TRIM_RIGHT" + S_ACTION_TRANSFORMATION_UPPERCASE = 231, // "ACTION_TRANSFORMATION_UPPERCASE" + S_ACTION_TRANSFORMATION_URL_ENCODE = 232, // "ACTION_TRANSFORMATION_URL_ENCODE" + S_ACTION_TRANSFORMATION_URL_DECODE = 233, // "ACTION_TRANSFORMATION_URL_DECODE" + S_ACTION_TRANSFORMATION_URL_DECODE_UNI = 234, // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE = 235, // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + S_ACTION_VER = 236, // "Ver" + S_ACTION_XMLNS = 237, // "xmlns" + S_CONFIG_COMPONENT_SIG = 238, // "CONFIG_COMPONENT_SIG" + S_CONFIG_CONN_ENGINE = 239, // "CONFIG_CONN_ENGINE" + S_CONFIG_SEC_ARGUMENT_SEPARATOR = 240, // "CONFIG_SEC_ARGUMENT_SEPARATOR" + S_CONFIG_SEC_WEB_APP_ID = 241, // "CONFIG_SEC_WEB_APP_ID" + S_CONFIG_SEC_SERVER_SIG = 242, // "CONFIG_SEC_SERVER_SIG" + S_CONFIG_DIR_AUDIT_DIR = 243, // "CONFIG_DIR_AUDIT_DIR" + S_CONFIG_DIR_AUDIT_DIR_MOD = 244, // "CONFIG_DIR_AUDIT_DIR_MOD" + S_CONFIG_DIR_AUDIT_ENG = 245, // "CONFIG_DIR_AUDIT_ENG" + S_CONFIG_DIR_AUDIT_FLE_MOD = 246, // "CONFIG_DIR_AUDIT_FLE_MOD" + S_CONFIG_DIR_AUDIT_LOG = 247, // "CONFIG_DIR_AUDIT_LOG" + S_CONFIG_DIR_AUDIT_LOG2 = 248, // "CONFIG_DIR_AUDIT_LOG2" + S_CONFIG_DIR_AUDIT_LOG_P = 249, // "CONFIG_DIR_AUDIT_LOG_P" + S_CONFIG_DIR_AUDIT_STS = 250, // "CONFIG_DIR_AUDIT_STS" + S_CONFIG_DIR_AUDIT_TPE = 251, // "CONFIG_DIR_AUDIT_TPE" + S_CONFIG_DIR_DEBUG_LOG = 252, // "CONFIG_DIR_DEBUG_LOG" + S_CONFIG_DIR_DEBUG_LVL = 253, // "CONFIG_DIR_DEBUG_LVL" + S_CONFIG_SEC_CACHE_TRANSFORMATIONS = 254, // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS = 255, // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + S_CONFIG_SEC_HASH_ENGINE = 256, // "CONFIG_SEC_HASH_ENGINE" + S_CONFIG_SEC_HASH_KEY = 257, // "CONFIG_SEC_HASH_KEY" + S_CONFIG_SEC_HASH_PARAM = 258, // "CONFIG_SEC_HASH_PARAM" + S_CONFIG_SEC_HASH_METHOD_RX = 259, // "CONFIG_SEC_HASH_METHOD_RX" + S_CONFIG_SEC_HASH_METHOD_PM = 260, // "CONFIG_SEC_HASH_METHOD_PM" + S_CONFIG_SEC_CHROOT_DIR = 261, // "CONFIG_SEC_CHROOT_DIR" + S_CONFIG_DIR_GEO_DB = 262, // "CONFIG_DIR_GEO_DB" + S_CONFIG_DIR_GSB_DB = 263, // "CONFIG_DIR_GSB_DB" + S_CONFIG_SEC_GUARDIAN_LOG = 264, // "CONFIG_SEC_GUARDIAN_LOG" + S_CONFIG_DIR_PCRE_MATCH_LIMIT = 265, // "CONFIG_DIR_PCRE_MATCH_LIMIT" + S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION = 266, // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + S_CONFIG_SEC_CONN_R_STATE_LIMIT = 267, // "CONFIG_SEC_CONN_R_STATE_LIMIT" + S_CONFIG_SEC_CONN_W_STATE_LIMIT = 268, // "CONFIG_SEC_CONN_W_STATE_LIMIT" + S_CONFIG_SEC_SENSOR_ID = 269, // "CONFIG_SEC_SENSOR_ID" + S_CONFIG_DIR_ARGS_LIMIT = 270, // "CONFIG_DIR_ARGS_LIMIT" + S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT = 271, // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + S_CONFIG_DIR_REQ_BODY = 272, // "CONFIG_DIR_REQ_BODY" + S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT = 273, // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + S_CONFIG_DIR_REQ_BODY_LIMIT = 274, // "CONFIG_DIR_REQ_BODY_LIMIT" + S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION = 275, // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT = 276, // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + S_CONFIG_DIR_RES_BODY = 277, // "CONFIG_DIR_RES_BODY" + S_CONFIG_DIR_RES_BODY_LIMIT = 278, // "CONFIG_DIR_RES_BODY_LIMIT" + S_CONFIG_DIR_RES_BODY_LIMIT_ACTION = 279, // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + S_CONFIG_SEC_RULE_INHERITANCE = 280, // "CONFIG_SEC_RULE_INHERITANCE" + S_CONFIG_SEC_RULE_PERF_TIME = 281, // "CONFIG_SEC_RULE_PERF_TIME" + S_CONFIG_DIR_RULE_ENG = 282, // "CONFIG_DIR_RULE_ENG" + S_CONFIG_DIR_SEC_ACTION = 283, // "CONFIG_DIR_SEC_ACTION" + S_CONFIG_DIR_SEC_DEFAULT_ACTION = 284, // "CONFIG_DIR_SEC_DEFAULT_ACTION" + S_CONFIG_DIR_SEC_MARKER = 285, // "CONFIG_DIR_SEC_MARKER" + S_CONFIG_DIR_UNICODE_MAP_FILE = 286, // "CONFIG_DIR_UNICODE_MAP_FILE" + S_CONFIG_DIR_UNICODE_CODE_PAGE = 287, // "CONFIG_DIR_UNICODE_CODE_PAGE" + S_CONFIG_SEC_COLLECTION_TIMEOUT = 288, // "CONFIG_SEC_COLLECTION_TIMEOUT" + S_CONFIG_SEC_HTTP_BLKEY = 289, // "CONFIG_SEC_HTTP_BLKEY" + S_CONFIG_SEC_INTERCEPT_ON_ERROR = 290, // "CONFIG_SEC_INTERCEPT_ON_ERROR" + S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION = 291, // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + S_CONFIG_SEC_RULE_REMOVE_BY_ID = 292, // "CONFIG_SEC_RULE_REMOVE_BY_ID" + S_CONFIG_SEC_RULE_REMOVE_BY_MSG = 293, // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + S_CONFIG_SEC_RULE_REMOVE_BY_TAG = 294, // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG = 295, // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG = 296, // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID = 297, // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID = 298, // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + S_CONFIG_UPDLOAD_KEEP_FILES = 299, // "CONFIG_UPDLOAD_KEEP_FILES" + S_CONFIG_UPDLOAD_SAVE_TMP_FILES = 300, // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + S_CONFIG_UPLOAD_DIR = 301, // "CONFIG_UPLOAD_DIR" + S_CONFIG_UPLOAD_FILE_LIMIT = 302, // "CONFIG_UPLOAD_FILE_LIMIT" + S_CONFIG_UPLOAD_FILE_MODE = 303, // "CONFIG_UPLOAD_FILE_MODE" + S_CONFIG_VALUE_ABORT = 304, // "CONFIG_VALUE_ABORT" + S_CONFIG_VALUE_DETC = 305, // "CONFIG_VALUE_DETC" + S_CONFIG_VALUE_HTTPS = 306, // "CONFIG_VALUE_HTTPS" + S_CONFIG_VALUE_OFF = 307, // "CONFIG_VALUE_OFF" + S_CONFIG_VALUE_ON = 308, // "CONFIG_VALUE_ON" + S_CONFIG_VALUE_PARALLEL = 309, // "CONFIG_VALUE_PARALLEL" + S_CONFIG_VALUE_PROCESS_PARTIAL = 310, // "CONFIG_VALUE_PROCESS_PARTIAL" + S_CONFIG_VALUE_REJECT = 311, // "CONFIG_VALUE_REJECT" + S_CONFIG_VALUE_RELEVANT_ONLY = 312, // "CONFIG_VALUE_RELEVANT_ONLY" + S_CONFIG_VALUE_SERIAL = 313, // "CONFIG_VALUE_SERIAL" + S_CONFIG_VALUE_WARN = 314, // "CONFIG_VALUE_WARN" + S_CONFIG_XML_EXTERNAL_ENTITY = 315, // "CONFIG_XML_EXTERNAL_ENTITY" + S_CONGIG_DIR_RESPONSE_BODY_MP = 316, // "CONGIG_DIR_RESPONSE_BODY_MP" + S_CONGIG_DIR_SEC_ARG_SEP = 317, // "CONGIG_DIR_SEC_ARG_SEP" + S_CONGIG_DIR_SEC_COOKIE_FORMAT = 318, // "CONGIG_DIR_SEC_COOKIE_FORMAT" + S_CONFIG_SEC_COOKIEV0_SEPARATOR = 319, // "CONFIG_SEC_COOKIEV0_SEPARATOR" + S_CONGIG_DIR_SEC_DATA_DIR = 320, // "CONGIG_DIR_SEC_DATA_DIR" + S_CONGIG_DIR_SEC_STATUS_ENGINE = 321, // "CONGIG_DIR_SEC_STATUS_ENGINE" + S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION = 322, // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION = 323, // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + S_CONGIG_DIR_SEC_TMP_DIR = 324, // "CONGIG_DIR_SEC_TMP_DIR" + S_DIRECTIVE = 325, // "DIRECTIVE" + S_DIRECTIVE_SECRULESCRIPT = 326, // "DIRECTIVE_SECRULESCRIPT" + S_FREE_TEXT_QUOTE_MACRO_EXPANSION = 327, // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + S_QUOTATION_MARK = 328, // "QUOTATION_MARK" + S_RUN_TIME_VAR_BLD = 329, // "RUN_TIME_VAR_BLD" + S_RUN_TIME_VAR_DUR = 330, // "RUN_TIME_VAR_DUR" + S_RUN_TIME_VAR_HSV = 331, // "RUN_TIME_VAR_HSV" + S_RUN_TIME_VAR_REMOTE_USER = 332, // "RUN_TIME_VAR_REMOTE_USER" + S_RUN_TIME_VAR_TIME = 333, // "RUN_TIME_VAR_TIME" + S_RUN_TIME_VAR_TIME_DAY = 334, // "RUN_TIME_VAR_TIME_DAY" + S_RUN_TIME_VAR_TIME_EPOCH = 335, // "RUN_TIME_VAR_TIME_EPOCH" + S_RUN_TIME_VAR_TIME_HOUR = 336, // "RUN_TIME_VAR_TIME_HOUR" + S_RUN_TIME_VAR_TIME_MIN = 337, // "RUN_TIME_VAR_TIME_MIN" + S_RUN_TIME_VAR_TIME_MON = 338, // "RUN_TIME_VAR_TIME_MON" + S_RUN_TIME_VAR_TIME_SEC = 339, // "RUN_TIME_VAR_TIME_SEC" + S_RUN_TIME_VAR_TIME_WDAY = 340, // "RUN_TIME_VAR_TIME_WDAY" + S_RUN_TIME_VAR_TIME_YEAR = 341, // "RUN_TIME_VAR_TIME_YEAR" + S_VARIABLE = 342, // "VARIABLE" + S_DICT_ELEMENT = 343, // "Dictionary element" + S_DICT_ELEMENT_REGEXP = 344, // "Dictionary element, selected by regexp" + S_YYACCEPT = 345, // $accept + S_input = 346, // input + S_line = 347, // line + S_audit_log = 348, // audit_log + S_actions = 349, // actions + S_actions_may_quoted = 350, // actions_may_quoted + S_op = 351, // op + S_op_before_init = 352, // op_before_init + S_expression = 353, // expression + S_variables = 354, // variables + S_variables_pre_process = 355, // variables_pre_process + S_variables_may_be_quoted = 356, // variables_may_be_quoted + S_var = 357, // var + S_act = 358, // act + S_setvar_action = 359, // setvar_action + S_run_time_string = 360 // run_time_string }; }; - /// (External) token type, as returned by yylex. - typedef token::yytokentype token_type; + /// (Internal) symbol kind. + typedef symbol_kind::symbol_kind_type symbol_kind_type; - /// Symbol type: an internal symbol number. - typedef int symbol_number_type; - - /// The symbol type number to denote an empty symbol. - enum { empty_symbol = -2 }; - - /// Internal symbol number for tokens (subsumed by symbol_number_type). - typedef unsigned short token_number_type; + /// The number of tokens. + static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; /// A complete symbol. /// - /// Expects its Base type to provide access to the symbol type - /// via type_get (). + /// Expects its Base type to provide access to the symbol kind + /// via kind (). /// /// Provide access to semantic value and location. template @@ -1308,13 +1723,254 @@ namespace yy { #if 201103L <= YY_CPLUSPLUS /// Move constructor. - basic_symbol (basic_symbol&& that); + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_ACTION_ACCURACY: // "Accuracy" + case symbol_kind::S_ACTION_ALLOW: // "Allow" + case symbol_kind::S_ACTION_APPEND: // "Append" + case symbol_kind::S_ACTION_AUDIT_LOG: // "AuditLog" + case symbol_kind::S_ACTION_BLOCK: // "Block" + case symbol_kind::S_ACTION_CAPTURE: // "Capture" + case symbol_kind::S_ACTION_CHAIN: // "Chain" + case symbol_kind::S_ACTION_CTL_AUDIT_ENGINE: // "ACTION_CTL_AUDIT_ENGINE" + case symbol_kind::S_ACTION_CTL_AUDIT_LOG_PARTS: // "ACTION_CTL_AUDIT_LOG_PARTS" + case symbol_kind::S_ACTION_CTL_BDY_JSON: // "ACTION_CTL_BDY_JSON" + case symbol_kind::S_ACTION_CTL_BDY_XML: // "ACTION_CTL_BDY_XML" + case symbol_kind::S_ACTION_CTL_BDY_URLENCODED: // "ACTION_CTL_BDY_URLENCODED" + case symbol_kind::S_ACTION_CTL_FORCE_REQ_BODY_VAR: // "ACTION_CTL_FORCE_REQ_BODY_VAR" + case symbol_kind::S_ACTION_CTL_REQUEST_BODY_ACCESS: // "ACTION_CTL_REQUEST_BODY_ACCESS" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_ID: // "ACTION_CTL_RULE_REMOVE_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_TAG: // "ACTION_CTL_RULE_REMOVE_BY_TAG" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + case symbol_kind::S_ACTION_DENY: // "Deny" + case symbol_kind::S_ACTION_DEPRECATE_VAR: // "DeprecateVar" + case symbol_kind::S_ACTION_DROP: // "Drop" + case symbol_kind::S_ACTION_EXEC: // "Exec" + case symbol_kind::S_ACTION_EXPIRE_VAR: // "ExpireVar" + case symbol_kind::S_ACTION_ID: // "Id" + case symbol_kind::S_ACTION_INITCOL: // "InitCol" + case symbol_kind::S_ACTION_LOG: // "Log" + case symbol_kind::S_ACTION_LOG_DATA: // "LogData" + case symbol_kind::S_ACTION_MATURITY: // "Maturity" + case symbol_kind::S_ACTION_MSG: // "Msg" + case symbol_kind::S_ACTION_MULTI_MATCH: // "MultiMatch" + case symbol_kind::S_ACTION_NO_AUDIT_LOG: // "NoAuditLog" + case symbol_kind::S_ACTION_NO_LOG: // "NoLog" + case symbol_kind::S_ACTION_PASS: // "Pass" + case symbol_kind::S_ACTION_PAUSE: // "Pause" + case symbol_kind::S_ACTION_PHASE: // "Phase" + case symbol_kind::S_ACTION_PREPEND: // "Prepend" + case symbol_kind::S_ACTION_PROXY: // "Proxy" + case symbol_kind::S_ACTION_REDIRECT: // "Redirect" + case symbol_kind::S_ACTION_REV: // "Rev" + case symbol_kind::S_ACTION_SANITISE_ARG: // "SanitiseArg" + case symbol_kind::S_ACTION_SANITISE_MATCHED: // "SanitiseMatched" + case symbol_kind::S_ACTION_SANITISE_MATCHED_BYTES: // "SanitiseMatchedBytes" + case symbol_kind::S_ACTION_SANITISE_REQUEST_HEADER: // "SanitiseRequestHeader" + case symbol_kind::S_ACTION_SANITISE_RESPONSE_HEADER: // "SanitiseResponseHeader" + case symbol_kind::S_ACTION_SETENV: // "SetEnv" + case symbol_kind::S_ACTION_SETRSC: // "SetRsc" + case symbol_kind::S_ACTION_SETSID: // "SetSid" + case symbol_kind::S_ACTION_SETUID: // "SetUID" + case symbol_kind::S_ACTION_SEVERITY: // "Severity" + case symbol_kind::S_ACTION_SKIP: // "Skip" + case symbol_kind::S_ACTION_SKIP_AFTER: // "SkipAfter" + case symbol_kind::S_ACTION_STATUS: // "Status" + case symbol_kind::S_ACTION_TAG: // "Tag" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_ENCODE: // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE: // "ACTION_TRANSFORMATION_BASE_64_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + case symbol_kind::S_ACTION_TRANSFORMATION_CMD_LINE: // "ACTION_TRANSFORMATION_CMD_LINE" + case symbol_kind::S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_CSS_DECODE: // "ACTION_TRANSFORMATION_CSS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_ENCODE: // "ACTION_TRANSFORMATION_HEX_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_DECODE: // "ACTION_TRANSFORMATION_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_JS_DECODE: // "ACTION_TRANSFORMATION_JS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_LENGTH: // "ACTION_TRANSFORMATION_LENGTH" + case symbol_kind::S_ACTION_TRANSFORMATION_LOWERCASE: // "ACTION_TRANSFORMATION_LOWERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_MD5: // "ACTION_TRANSFORMATION_MD5" + case symbol_kind::S_ACTION_TRANSFORMATION_NONE: // "ACTION_TRANSFORMATION_NONE" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH: // "ACTION_TRANSFORMATION_NORMALISE_PATH" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_NULLS: // "ACTION_TRANSFORMATION_REMOVE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_COMMENTS: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_NULLS: // "ACTION_TRANSFORMATION_REPLACE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_SHA1: // "ACTION_TRANSFORMATION_SHA1" + case symbol_kind::S_ACTION_TRANSFORMATION_SQL_HEX_DECODE: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM: // "ACTION_TRANSFORMATION_TRIM" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_LEFT: // "ACTION_TRANSFORMATION_TRIM_LEFT" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_RIGHT: // "ACTION_TRANSFORMATION_TRIM_RIGHT" + case symbol_kind::S_ACTION_TRANSFORMATION_UPPERCASE: // "ACTION_TRANSFORMATION_UPPERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_ENCODE: // "ACTION_TRANSFORMATION_URL_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE: // "ACTION_TRANSFORMATION_URL_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE_UNI: // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + case symbol_kind::S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + case symbol_kind::S_ACTION_VER: // "Ver" + case symbol_kind::S_ACTION_XMLNS: // "xmlns" + case symbol_kind::S_CONFIG_COMPONENT_SIG: // "CONFIG_COMPONENT_SIG" + case symbol_kind::S_CONFIG_CONN_ENGINE: // "CONFIG_CONN_ENGINE" + case symbol_kind::S_CONFIG_SEC_ARGUMENT_SEPARATOR: // "CONFIG_SEC_ARGUMENT_SEPARATOR" + case symbol_kind::S_CONFIG_SEC_WEB_APP_ID: // "CONFIG_SEC_WEB_APP_ID" + case symbol_kind::S_CONFIG_SEC_SERVER_SIG: // "CONFIG_SEC_SERVER_SIG" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR: // "CONFIG_DIR_AUDIT_DIR" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR_MOD: // "CONFIG_DIR_AUDIT_DIR_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_ENG: // "CONFIG_DIR_AUDIT_ENG" + case symbol_kind::S_CONFIG_DIR_AUDIT_FLE_MOD: // "CONFIG_DIR_AUDIT_FLE_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG: // "CONFIG_DIR_AUDIT_LOG" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG2: // "CONFIG_DIR_AUDIT_LOG2" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG_P: // "CONFIG_DIR_AUDIT_LOG_P" + case symbol_kind::S_CONFIG_DIR_AUDIT_STS: // "CONFIG_DIR_AUDIT_STS" + case symbol_kind::S_CONFIG_DIR_AUDIT_TPE: // "CONFIG_DIR_AUDIT_TPE" + case symbol_kind::S_CONFIG_DIR_DEBUG_LOG: // "CONFIG_DIR_DEBUG_LOG" + case symbol_kind::S_CONFIG_DIR_DEBUG_LVL: // "CONFIG_DIR_DEBUG_LVL" + case symbol_kind::S_CONFIG_SEC_CACHE_TRANSFORMATIONS: // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + case symbol_kind::S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + case symbol_kind::S_CONFIG_SEC_HASH_ENGINE: // "CONFIG_SEC_HASH_ENGINE" + case symbol_kind::S_CONFIG_SEC_HASH_KEY: // "CONFIG_SEC_HASH_KEY" + case symbol_kind::S_CONFIG_SEC_HASH_PARAM: // "CONFIG_SEC_HASH_PARAM" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_RX: // "CONFIG_SEC_HASH_METHOD_RX" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_PM: // "CONFIG_SEC_HASH_METHOD_PM" + case symbol_kind::S_CONFIG_SEC_CHROOT_DIR: // "CONFIG_SEC_CHROOT_DIR" + case symbol_kind::S_CONFIG_DIR_GEO_DB: // "CONFIG_DIR_GEO_DB" + case symbol_kind::S_CONFIG_DIR_GSB_DB: // "CONFIG_DIR_GSB_DB" + case symbol_kind::S_CONFIG_SEC_GUARDIAN_LOG: // "CONFIG_SEC_GUARDIAN_LOG" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT: // "CONFIG_DIR_PCRE_MATCH_LIMIT" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + case symbol_kind::S_CONFIG_SEC_CONN_R_STATE_LIMIT: // "CONFIG_SEC_CONN_R_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_CONN_W_STATE_LIMIT: // "CONFIG_SEC_CONN_W_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_SENSOR_ID: // "CONFIG_SEC_SENSOR_ID" + case symbol_kind::S_CONFIG_DIR_ARGS_LIMIT: // "CONFIG_DIR_ARGS_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT: // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY: // "CONFIG_DIR_REQ_BODY" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT: // "CONFIG_DIR_REQ_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY: // "CONFIG_DIR_RES_BODY" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT: // "CONFIG_DIR_RES_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT_ACTION: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_INHERITANCE: // "CONFIG_SEC_RULE_INHERITANCE" + case symbol_kind::S_CONFIG_SEC_RULE_PERF_TIME: // "CONFIG_SEC_RULE_PERF_TIME" + case symbol_kind::S_CONFIG_DIR_RULE_ENG: // "CONFIG_DIR_RULE_ENG" + case symbol_kind::S_CONFIG_DIR_SEC_ACTION: // "CONFIG_DIR_SEC_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_DEFAULT_ACTION: // "CONFIG_DIR_SEC_DEFAULT_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_MARKER: // "CONFIG_DIR_SEC_MARKER" + case symbol_kind::S_CONFIG_DIR_UNICODE_MAP_FILE: // "CONFIG_DIR_UNICODE_MAP_FILE" + case symbol_kind::S_CONFIG_DIR_UNICODE_CODE_PAGE: // "CONFIG_DIR_UNICODE_CODE_PAGE" + case symbol_kind::S_CONFIG_SEC_COLLECTION_TIMEOUT: // "CONFIG_SEC_COLLECTION_TIMEOUT" + case symbol_kind::S_CONFIG_SEC_HTTP_BLKEY: // "CONFIG_SEC_HTTP_BLKEY" + case symbol_kind::S_CONFIG_SEC_INTERCEPT_ON_ERROR: // "CONFIG_SEC_INTERCEPT_ON_ERROR" + case symbol_kind::S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_ID: // "CONFIG_SEC_RULE_REMOVE_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_MSG: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_TAG: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + case symbol_kind::S_CONFIG_UPDLOAD_KEEP_FILES: // "CONFIG_UPDLOAD_KEEP_FILES" + case symbol_kind::S_CONFIG_UPDLOAD_SAVE_TMP_FILES: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + case symbol_kind::S_CONFIG_UPLOAD_DIR: // "CONFIG_UPLOAD_DIR" + case symbol_kind::S_CONFIG_UPLOAD_FILE_LIMIT: // "CONFIG_UPLOAD_FILE_LIMIT" + case symbol_kind::S_CONFIG_UPLOAD_FILE_MODE: // "CONFIG_UPLOAD_FILE_MODE" + case symbol_kind::S_CONFIG_VALUE_ABORT: // "CONFIG_VALUE_ABORT" + case symbol_kind::S_CONFIG_VALUE_DETC: // "CONFIG_VALUE_DETC" + case symbol_kind::S_CONFIG_VALUE_HTTPS: // "CONFIG_VALUE_HTTPS" + case symbol_kind::S_CONFIG_VALUE_OFF: // "CONFIG_VALUE_OFF" + case symbol_kind::S_CONFIG_VALUE_ON: // "CONFIG_VALUE_ON" + case symbol_kind::S_CONFIG_VALUE_PARALLEL: // "CONFIG_VALUE_PARALLEL" + case symbol_kind::S_CONFIG_VALUE_PROCESS_PARTIAL: // "CONFIG_VALUE_PROCESS_PARTIAL" + case symbol_kind::S_CONFIG_VALUE_REJECT: // "CONFIG_VALUE_REJECT" + case symbol_kind::S_CONFIG_VALUE_RELEVANT_ONLY: // "CONFIG_VALUE_RELEVANT_ONLY" + case symbol_kind::S_CONFIG_VALUE_SERIAL: // "CONFIG_VALUE_SERIAL" + case symbol_kind::S_CONFIG_VALUE_WARN: // "CONFIG_VALUE_WARN" + case symbol_kind::S_CONFIG_XML_EXTERNAL_ENTITY: // "CONFIG_XML_EXTERNAL_ENTITY" + case symbol_kind::S_CONGIG_DIR_RESPONSE_BODY_MP: // "CONGIG_DIR_RESPONSE_BODY_MP" + case symbol_kind::S_CONGIG_DIR_SEC_ARG_SEP: // "CONGIG_DIR_SEC_ARG_SEP" + case symbol_kind::S_CONGIG_DIR_SEC_COOKIE_FORMAT: // "CONGIG_DIR_SEC_COOKIE_FORMAT" + case symbol_kind::S_CONFIG_SEC_COOKIEV0_SEPARATOR: // "CONFIG_SEC_COOKIEV0_SEPARATOR" + case symbol_kind::S_CONGIG_DIR_SEC_DATA_DIR: // "CONGIG_DIR_SEC_DATA_DIR" + case symbol_kind::S_CONGIG_DIR_SEC_STATUS_ENGINE: // "CONGIG_DIR_SEC_STATUS_ENGINE" + case symbol_kind::S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + case symbol_kind::S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + case symbol_kind::S_CONGIG_DIR_SEC_TMP_DIR: // "CONGIG_DIR_SEC_TMP_DIR" + case symbol_kind::S_DIRECTIVE: // "DIRECTIVE" + case symbol_kind::S_DIRECTIVE_SECRULESCRIPT: // "DIRECTIVE_SECRULESCRIPT" + case symbol_kind::S_FREE_TEXT_QUOTE_MACRO_EXPANSION: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + case symbol_kind::S_QUOTATION_MARK: // "QUOTATION_MARK" + case symbol_kind::S_RUN_TIME_VAR_BLD: // "RUN_TIME_VAR_BLD" + case symbol_kind::S_RUN_TIME_VAR_DUR: // "RUN_TIME_VAR_DUR" + case symbol_kind::S_RUN_TIME_VAR_HSV: // "RUN_TIME_VAR_HSV" + case symbol_kind::S_RUN_TIME_VAR_REMOTE_USER: // "RUN_TIME_VAR_REMOTE_USER" + case symbol_kind::S_RUN_TIME_VAR_TIME: // "RUN_TIME_VAR_TIME" + case symbol_kind::S_RUN_TIME_VAR_TIME_DAY: // "RUN_TIME_VAR_TIME_DAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_EPOCH: // "RUN_TIME_VAR_TIME_EPOCH" + case symbol_kind::S_RUN_TIME_VAR_TIME_HOUR: // "RUN_TIME_VAR_TIME_HOUR" + case symbol_kind::S_RUN_TIME_VAR_TIME_MIN: // "RUN_TIME_VAR_TIME_MIN" + case symbol_kind::S_RUN_TIME_VAR_TIME_MON: // "RUN_TIME_VAR_TIME_MON" + case symbol_kind::S_RUN_TIME_VAR_TIME_SEC: // "RUN_TIME_VAR_TIME_SEC" + case symbol_kind::S_RUN_TIME_VAR_TIME_WDAY: // "RUN_TIME_VAR_TIME_WDAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_YEAR: // "RUN_TIME_VAR_TIME_YEAR" + case symbol_kind::S_VARIABLE: // "VARIABLE" + case symbol_kind::S_DICT_ELEMENT: // "Dictionary element" + case symbol_kind::S_DICT_ELEMENT_REGEXP: // "Dictionary element, selected by regexp" + value.move< std::string > (std::move (that.value)); + break; + + case symbol_kind::S_op: // op + case symbol_kind::S_op_before_init: // op_before_init + value.move< std::unique_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_run_time_string: // run_time_string + value.move< std::unique_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_var: // var + value.move< std::unique_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_act: // act + case symbol_kind::S_setvar_action: // setvar_action + value.move< std::unique_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_variables: // variables + case symbol_kind::S_variables_pre_process: // variables_pre_process + case symbol_kind::S_variables_may_be_quoted: // variables_may_be_quoted + value.move< std::unique_ptr > > > (std::move (that.value)); + break; + + case symbol_kind::S_actions: // actions + case symbol_kind::S_actions_may_quoted: // actions_may_quoted + value.move< std::unique_ptr > > > (std::move (that.value)); + break; + + default: + break; + } + + } #endif /// Copy constructor. basic_symbol (const basic_symbol& that); - /// Constructor for valueless symbols, and symbols from each type. + /// Constructors for typed symbols. #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, location_type&& l) : Base (t) @@ -1326,6 +1982,7 @@ namespace yy { , location (l) {} #endif + #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) : Base (t) @@ -1339,6 +1996,7 @@ namespace yy { , location (l) {} #endif + #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, std::unique_ptr&& v, location_type&& l) : Base (t) @@ -1352,6 +2010,7 @@ namespace yy { , location (l) {} #endif + #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, std::unique_ptr&& v, location_type&& l) : Base (t) @@ -1365,6 +2024,7 @@ namespace yy { , location (l) {} #endif + #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, std::unique_ptr&& v, location_type&& l) : Base (t) @@ -1378,6 +2038,7 @@ namespace yy { , location (l) {} #endif + #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, std::unique_ptr&& v, location_type&& l) : Base (t) @@ -1391,6 +2052,7 @@ namespace yy { , location (l) {} #endif + #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, std::unique_ptr > > && v, location_type&& l) : Base (t) @@ -1404,6 +2066,7 @@ namespace yy { , location (l) {} #endif + #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, std::unique_ptr > > && v, location_type&& l) : Base (t) @@ -1425,246 +2088,248 @@ namespace yy { } /// Destroy contents, and record that is empty. - void clear () + void clear () YY_NOEXCEPT { // User destructor. - symbol_number_type yytype = this->type_get (); + symbol_kind_type yykind = this->kind (); basic_symbol& yysym = *this; (void) yysym; - switch (yytype) + switch (yykind) { default: break; } - // Type destructor. -switch (yytype) + // Value type destructor. +switch (yykind) { - 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_REQ_BODY" - case 269: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" - case 270: // "CONFIG_DIR_REQ_BODY_LIMIT" - case 271: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" - case 272: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" - case 273: // "CONFIG_DIR_RES_BODY" - case 274: // "CONFIG_DIR_RES_BODY_LIMIT" - case 275: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" - case 276: // "CONFIG_SEC_RULE_INHERITANCE" - case 277: // "CONFIG_SEC_RULE_PERF_TIME" - case 278: // "CONFIG_DIR_RULE_ENG" - case 279: // "CONFIG_DIR_SEC_ACTION" - case 280: // "CONFIG_DIR_SEC_DEFAULT_ACTION" - case 281: // "CONFIG_DIR_SEC_MARKER" - case 282: // "CONFIG_DIR_UNICODE_MAP_FILE" - case 283: // "CONFIG_DIR_UNICODE_CODE_PAGE" - case 284: // "CONFIG_SEC_COLLECTION_TIMEOUT" - case 285: // "CONFIG_SEC_HTTP_BLKEY" - case 286: // "CONFIG_SEC_INTERCEPT_ON_ERROR" - case 287: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" - case 288: // "CONFIG_SEC_RULE_REMOVE_BY_ID" - case 289: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" - case 290: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" - case 291: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" - case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" - case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" - case 294: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" - case 295: // "CONFIG_UPDLOAD_KEEP_FILES" - case 296: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" - case 297: // "CONFIG_UPLOAD_DIR" - case 298: // "CONFIG_UPLOAD_FILE_LIMIT" - case 299: // "CONFIG_UPLOAD_FILE_MODE" - case 300: // "CONFIG_VALUE_ABORT" - case 301: // "CONFIG_VALUE_DETC" - case 302: // "CONFIG_VALUE_HTTPS" - case 303: // "CONFIG_VALUE_OFF" - case 304: // "CONFIG_VALUE_ON" - case 305: // "CONFIG_VALUE_PARALLEL" - case 306: // "CONFIG_VALUE_PROCESS_PARTIAL" - case 307: // "CONFIG_VALUE_REJECT" - case 308: // "CONFIG_VALUE_RELEVANT_ONLY" - case 309: // "CONFIG_VALUE_SERIAL" - case 310: // "CONFIG_VALUE_WARN" - case 311: // "CONFIG_XML_EXTERNAL_ENTITY" - case 312: // "CONGIG_DIR_RESPONSE_BODY_MP" - case 313: // "CONGIG_DIR_SEC_ARG_SEP" - case 314: // "CONGIG_DIR_SEC_COOKIE_FORMAT" - case 315: // "CONFIG_SEC_COOKIEV0_SEPARATOR" - case 316: // "CONGIG_DIR_SEC_DATA_DIR" - case 317: // "CONGIG_DIR_SEC_STATUS_ENGINE" - case 318: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" - case 319: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" - case 320: // "CONGIG_DIR_SEC_TMP_DIR" - case 321: // "DIRECTIVE" - case 322: // "DIRECTIVE_SECRULESCRIPT" - case 323: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" - case 324: // "QUOTATION_MARK" - case 325: // "RUN_TIME_VAR_BLD" - case 326: // "RUN_TIME_VAR_DUR" - case 327: // "RUN_TIME_VAR_HSV" - case 328: // "RUN_TIME_VAR_REMOTE_USER" - case 329: // "RUN_TIME_VAR_TIME" - case 330: // "RUN_TIME_VAR_TIME_DAY" - case 331: // "RUN_TIME_VAR_TIME_EPOCH" - case 332: // "RUN_TIME_VAR_TIME_HOUR" - case 333: // "RUN_TIME_VAR_TIME_MIN" - case 334: // "RUN_TIME_VAR_TIME_MON" - case 335: // "RUN_TIME_VAR_TIME_SEC" - case 336: // "RUN_TIME_VAR_TIME_WDAY" - case 337: // "RUN_TIME_VAR_TIME_YEAR" - case 338: // "VARIABLE" - case 339: // "Dictionary element" - case 340: // "Dictionary element, selected by regexp" + case symbol_kind::S_ACTION_ACCURACY: // "Accuracy" + case symbol_kind::S_ACTION_ALLOW: // "Allow" + case symbol_kind::S_ACTION_APPEND: // "Append" + case symbol_kind::S_ACTION_AUDIT_LOG: // "AuditLog" + case symbol_kind::S_ACTION_BLOCK: // "Block" + case symbol_kind::S_ACTION_CAPTURE: // "Capture" + case symbol_kind::S_ACTION_CHAIN: // "Chain" + case symbol_kind::S_ACTION_CTL_AUDIT_ENGINE: // "ACTION_CTL_AUDIT_ENGINE" + case symbol_kind::S_ACTION_CTL_AUDIT_LOG_PARTS: // "ACTION_CTL_AUDIT_LOG_PARTS" + case symbol_kind::S_ACTION_CTL_BDY_JSON: // "ACTION_CTL_BDY_JSON" + case symbol_kind::S_ACTION_CTL_BDY_XML: // "ACTION_CTL_BDY_XML" + case symbol_kind::S_ACTION_CTL_BDY_URLENCODED: // "ACTION_CTL_BDY_URLENCODED" + case symbol_kind::S_ACTION_CTL_FORCE_REQ_BODY_VAR: // "ACTION_CTL_FORCE_REQ_BODY_VAR" + case symbol_kind::S_ACTION_CTL_REQUEST_BODY_ACCESS: // "ACTION_CTL_REQUEST_BODY_ACCESS" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_ID: // "ACTION_CTL_RULE_REMOVE_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_TAG: // "ACTION_CTL_RULE_REMOVE_BY_TAG" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + case symbol_kind::S_ACTION_DENY: // "Deny" + case symbol_kind::S_ACTION_DEPRECATE_VAR: // "DeprecateVar" + case symbol_kind::S_ACTION_DROP: // "Drop" + case symbol_kind::S_ACTION_EXEC: // "Exec" + case symbol_kind::S_ACTION_EXPIRE_VAR: // "ExpireVar" + case symbol_kind::S_ACTION_ID: // "Id" + case symbol_kind::S_ACTION_INITCOL: // "InitCol" + case symbol_kind::S_ACTION_LOG: // "Log" + case symbol_kind::S_ACTION_LOG_DATA: // "LogData" + case symbol_kind::S_ACTION_MATURITY: // "Maturity" + case symbol_kind::S_ACTION_MSG: // "Msg" + case symbol_kind::S_ACTION_MULTI_MATCH: // "MultiMatch" + case symbol_kind::S_ACTION_NO_AUDIT_LOG: // "NoAuditLog" + case symbol_kind::S_ACTION_NO_LOG: // "NoLog" + case symbol_kind::S_ACTION_PASS: // "Pass" + case symbol_kind::S_ACTION_PAUSE: // "Pause" + case symbol_kind::S_ACTION_PHASE: // "Phase" + case symbol_kind::S_ACTION_PREPEND: // "Prepend" + case symbol_kind::S_ACTION_PROXY: // "Proxy" + case symbol_kind::S_ACTION_REDIRECT: // "Redirect" + case symbol_kind::S_ACTION_REV: // "Rev" + case symbol_kind::S_ACTION_SANITISE_ARG: // "SanitiseArg" + case symbol_kind::S_ACTION_SANITISE_MATCHED: // "SanitiseMatched" + case symbol_kind::S_ACTION_SANITISE_MATCHED_BYTES: // "SanitiseMatchedBytes" + case symbol_kind::S_ACTION_SANITISE_REQUEST_HEADER: // "SanitiseRequestHeader" + case symbol_kind::S_ACTION_SANITISE_RESPONSE_HEADER: // "SanitiseResponseHeader" + case symbol_kind::S_ACTION_SETENV: // "SetEnv" + case symbol_kind::S_ACTION_SETRSC: // "SetRsc" + case symbol_kind::S_ACTION_SETSID: // "SetSid" + case symbol_kind::S_ACTION_SETUID: // "SetUID" + case symbol_kind::S_ACTION_SEVERITY: // "Severity" + case symbol_kind::S_ACTION_SKIP: // "Skip" + case symbol_kind::S_ACTION_SKIP_AFTER: // "SkipAfter" + case symbol_kind::S_ACTION_STATUS: // "Status" + case symbol_kind::S_ACTION_TAG: // "Tag" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_ENCODE: // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE: // "ACTION_TRANSFORMATION_BASE_64_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + case symbol_kind::S_ACTION_TRANSFORMATION_CMD_LINE: // "ACTION_TRANSFORMATION_CMD_LINE" + case symbol_kind::S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_CSS_DECODE: // "ACTION_TRANSFORMATION_CSS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_ENCODE: // "ACTION_TRANSFORMATION_HEX_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_DECODE: // "ACTION_TRANSFORMATION_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_JS_DECODE: // "ACTION_TRANSFORMATION_JS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_LENGTH: // "ACTION_TRANSFORMATION_LENGTH" + case symbol_kind::S_ACTION_TRANSFORMATION_LOWERCASE: // "ACTION_TRANSFORMATION_LOWERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_MD5: // "ACTION_TRANSFORMATION_MD5" + case symbol_kind::S_ACTION_TRANSFORMATION_NONE: // "ACTION_TRANSFORMATION_NONE" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH: // "ACTION_TRANSFORMATION_NORMALISE_PATH" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_NULLS: // "ACTION_TRANSFORMATION_REMOVE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_COMMENTS: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_NULLS: // "ACTION_TRANSFORMATION_REPLACE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_SHA1: // "ACTION_TRANSFORMATION_SHA1" + case symbol_kind::S_ACTION_TRANSFORMATION_SQL_HEX_DECODE: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM: // "ACTION_TRANSFORMATION_TRIM" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_LEFT: // "ACTION_TRANSFORMATION_TRIM_LEFT" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_RIGHT: // "ACTION_TRANSFORMATION_TRIM_RIGHT" + case symbol_kind::S_ACTION_TRANSFORMATION_UPPERCASE: // "ACTION_TRANSFORMATION_UPPERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_ENCODE: // "ACTION_TRANSFORMATION_URL_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE: // "ACTION_TRANSFORMATION_URL_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE_UNI: // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + case symbol_kind::S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + case symbol_kind::S_ACTION_VER: // "Ver" + case symbol_kind::S_ACTION_XMLNS: // "xmlns" + case symbol_kind::S_CONFIG_COMPONENT_SIG: // "CONFIG_COMPONENT_SIG" + case symbol_kind::S_CONFIG_CONN_ENGINE: // "CONFIG_CONN_ENGINE" + case symbol_kind::S_CONFIG_SEC_ARGUMENT_SEPARATOR: // "CONFIG_SEC_ARGUMENT_SEPARATOR" + case symbol_kind::S_CONFIG_SEC_WEB_APP_ID: // "CONFIG_SEC_WEB_APP_ID" + case symbol_kind::S_CONFIG_SEC_SERVER_SIG: // "CONFIG_SEC_SERVER_SIG" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR: // "CONFIG_DIR_AUDIT_DIR" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR_MOD: // "CONFIG_DIR_AUDIT_DIR_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_ENG: // "CONFIG_DIR_AUDIT_ENG" + case symbol_kind::S_CONFIG_DIR_AUDIT_FLE_MOD: // "CONFIG_DIR_AUDIT_FLE_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG: // "CONFIG_DIR_AUDIT_LOG" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG2: // "CONFIG_DIR_AUDIT_LOG2" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG_P: // "CONFIG_DIR_AUDIT_LOG_P" + case symbol_kind::S_CONFIG_DIR_AUDIT_STS: // "CONFIG_DIR_AUDIT_STS" + case symbol_kind::S_CONFIG_DIR_AUDIT_TPE: // "CONFIG_DIR_AUDIT_TPE" + case symbol_kind::S_CONFIG_DIR_DEBUG_LOG: // "CONFIG_DIR_DEBUG_LOG" + case symbol_kind::S_CONFIG_DIR_DEBUG_LVL: // "CONFIG_DIR_DEBUG_LVL" + case symbol_kind::S_CONFIG_SEC_CACHE_TRANSFORMATIONS: // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + case symbol_kind::S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + case symbol_kind::S_CONFIG_SEC_HASH_ENGINE: // "CONFIG_SEC_HASH_ENGINE" + case symbol_kind::S_CONFIG_SEC_HASH_KEY: // "CONFIG_SEC_HASH_KEY" + case symbol_kind::S_CONFIG_SEC_HASH_PARAM: // "CONFIG_SEC_HASH_PARAM" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_RX: // "CONFIG_SEC_HASH_METHOD_RX" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_PM: // "CONFIG_SEC_HASH_METHOD_PM" + case symbol_kind::S_CONFIG_SEC_CHROOT_DIR: // "CONFIG_SEC_CHROOT_DIR" + case symbol_kind::S_CONFIG_DIR_GEO_DB: // "CONFIG_DIR_GEO_DB" + case symbol_kind::S_CONFIG_DIR_GSB_DB: // "CONFIG_DIR_GSB_DB" + case symbol_kind::S_CONFIG_SEC_GUARDIAN_LOG: // "CONFIG_SEC_GUARDIAN_LOG" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT: // "CONFIG_DIR_PCRE_MATCH_LIMIT" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + case symbol_kind::S_CONFIG_SEC_CONN_R_STATE_LIMIT: // "CONFIG_SEC_CONN_R_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_CONN_W_STATE_LIMIT: // "CONFIG_SEC_CONN_W_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_SENSOR_ID: // "CONFIG_SEC_SENSOR_ID" + case symbol_kind::S_CONFIG_DIR_ARGS_LIMIT: // "CONFIG_DIR_ARGS_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT: // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY: // "CONFIG_DIR_REQ_BODY" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT: // "CONFIG_DIR_REQ_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY: // "CONFIG_DIR_RES_BODY" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT: // "CONFIG_DIR_RES_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT_ACTION: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_INHERITANCE: // "CONFIG_SEC_RULE_INHERITANCE" + case symbol_kind::S_CONFIG_SEC_RULE_PERF_TIME: // "CONFIG_SEC_RULE_PERF_TIME" + case symbol_kind::S_CONFIG_DIR_RULE_ENG: // "CONFIG_DIR_RULE_ENG" + case symbol_kind::S_CONFIG_DIR_SEC_ACTION: // "CONFIG_DIR_SEC_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_DEFAULT_ACTION: // "CONFIG_DIR_SEC_DEFAULT_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_MARKER: // "CONFIG_DIR_SEC_MARKER" + case symbol_kind::S_CONFIG_DIR_UNICODE_MAP_FILE: // "CONFIG_DIR_UNICODE_MAP_FILE" + case symbol_kind::S_CONFIG_DIR_UNICODE_CODE_PAGE: // "CONFIG_DIR_UNICODE_CODE_PAGE" + case symbol_kind::S_CONFIG_SEC_COLLECTION_TIMEOUT: // "CONFIG_SEC_COLLECTION_TIMEOUT" + case symbol_kind::S_CONFIG_SEC_HTTP_BLKEY: // "CONFIG_SEC_HTTP_BLKEY" + case symbol_kind::S_CONFIG_SEC_INTERCEPT_ON_ERROR: // "CONFIG_SEC_INTERCEPT_ON_ERROR" + case symbol_kind::S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_ID: // "CONFIG_SEC_RULE_REMOVE_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_MSG: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_TAG: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + case symbol_kind::S_CONFIG_UPDLOAD_KEEP_FILES: // "CONFIG_UPDLOAD_KEEP_FILES" + case symbol_kind::S_CONFIG_UPDLOAD_SAVE_TMP_FILES: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + case symbol_kind::S_CONFIG_UPLOAD_DIR: // "CONFIG_UPLOAD_DIR" + case symbol_kind::S_CONFIG_UPLOAD_FILE_LIMIT: // "CONFIG_UPLOAD_FILE_LIMIT" + case symbol_kind::S_CONFIG_UPLOAD_FILE_MODE: // "CONFIG_UPLOAD_FILE_MODE" + case symbol_kind::S_CONFIG_VALUE_ABORT: // "CONFIG_VALUE_ABORT" + case symbol_kind::S_CONFIG_VALUE_DETC: // "CONFIG_VALUE_DETC" + case symbol_kind::S_CONFIG_VALUE_HTTPS: // "CONFIG_VALUE_HTTPS" + case symbol_kind::S_CONFIG_VALUE_OFF: // "CONFIG_VALUE_OFF" + case symbol_kind::S_CONFIG_VALUE_ON: // "CONFIG_VALUE_ON" + case symbol_kind::S_CONFIG_VALUE_PARALLEL: // "CONFIG_VALUE_PARALLEL" + case symbol_kind::S_CONFIG_VALUE_PROCESS_PARTIAL: // "CONFIG_VALUE_PROCESS_PARTIAL" + case symbol_kind::S_CONFIG_VALUE_REJECT: // "CONFIG_VALUE_REJECT" + case symbol_kind::S_CONFIG_VALUE_RELEVANT_ONLY: // "CONFIG_VALUE_RELEVANT_ONLY" + case symbol_kind::S_CONFIG_VALUE_SERIAL: // "CONFIG_VALUE_SERIAL" + case symbol_kind::S_CONFIG_VALUE_WARN: // "CONFIG_VALUE_WARN" + case symbol_kind::S_CONFIG_XML_EXTERNAL_ENTITY: // "CONFIG_XML_EXTERNAL_ENTITY" + case symbol_kind::S_CONGIG_DIR_RESPONSE_BODY_MP: // "CONGIG_DIR_RESPONSE_BODY_MP" + case symbol_kind::S_CONGIG_DIR_SEC_ARG_SEP: // "CONGIG_DIR_SEC_ARG_SEP" + case symbol_kind::S_CONGIG_DIR_SEC_COOKIE_FORMAT: // "CONGIG_DIR_SEC_COOKIE_FORMAT" + case symbol_kind::S_CONFIG_SEC_COOKIEV0_SEPARATOR: // "CONFIG_SEC_COOKIEV0_SEPARATOR" + case symbol_kind::S_CONGIG_DIR_SEC_DATA_DIR: // "CONGIG_DIR_SEC_DATA_DIR" + case symbol_kind::S_CONGIG_DIR_SEC_STATUS_ENGINE: // "CONGIG_DIR_SEC_STATUS_ENGINE" + case symbol_kind::S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + case symbol_kind::S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + case symbol_kind::S_CONGIG_DIR_SEC_TMP_DIR: // "CONGIG_DIR_SEC_TMP_DIR" + case symbol_kind::S_DIRECTIVE: // "DIRECTIVE" + case symbol_kind::S_DIRECTIVE_SECRULESCRIPT: // "DIRECTIVE_SECRULESCRIPT" + case symbol_kind::S_FREE_TEXT_QUOTE_MACRO_EXPANSION: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + case symbol_kind::S_QUOTATION_MARK: // "QUOTATION_MARK" + case symbol_kind::S_RUN_TIME_VAR_BLD: // "RUN_TIME_VAR_BLD" + case symbol_kind::S_RUN_TIME_VAR_DUR: // "RUN_TIME_VAR_DUR" + case symbol_kind::S_RUN_TIME_VAR_HSV: // "RUN_TIME_VAR_HSV" + case symbol_kind::S_RUN_TIME_VAR_REMOTE_USER: // "RUN_TIME_VAR_REMOTE_USER" + case symbol_kind::S_RUN_TIME_VAR_TIME: // "RUN_TIME_VAR_TIME" + case symbol_kind::S_RUN_TIME_VAR_TIME_DAY: // "RUN_TIME_VAR_TIME_DAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_EPOCH: // "RUN_TIME_VAR_TIME_EPOCH" + case symbol_kind::S_RUN_TIME_VAR_TIME_HOUR: // "RUN_TIME_VAR_TIME_HOUR" + case symbol_kind::S_RUN_TIME_VAR_TIME_MIN: // "RUN_TIME_VAR_TIME_MIN" + case symbol_kind::S_RUN_TIME_VAR_TIME_MON: // "RUN_TIME_VAR_TIME_MON" + case symbol_kind::S_RUN_TIME_VAR_TIME_SEC: // "RUN_TIME_VAR_TIME_SEC" + case symbol_kind::S_RUN_TIME_VAR_TIME_WDAY: // "RUN_TIME_VAR_TIME_WDAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_YEAR: // "RUN_TIME_VAR_TIME_YEAR" + case symbol_kind::S_VARIABLE: // "VARIABLE" + case symbol_kind::S_DICT_ELEMENT: // "Dictionary element" + case symbol_kind::S_DICT_ELEMENT_REGEXP: // "Dictionary element, selected by regexp" value.template destroy< std::string > (); break; - case 347: // op - case 348: // op_before_init + case symbol_kind::S_op: // op + case symbol_kind::S_op_before_init: // op_before_init value.template destroy< std::unique_ptr > (); break; - case 356: // run_time_string + case symbol_kind::S_run_time_string: // run_time_string value.template destroy< std::unique_ptr > (); break; - case 353: // var + case symbol_kind::S_var: // var value.template destroy< std::unique_ptr > (); break; - case 354: // act - case 355: // setvar_action + case symbol_kind::S_act: // act + case symbol_kind::S_setvar_action: // setvar_action value.template destroy< std::unique_ptr > (); break; - case 350: // variables - case 351: // variables_pre_process - case 352: // variables_may_be_quoted + case symbol_kind::S_variables: // variables + case symbol_kind::S_variables_pre_process: // variables_pre_process + case symbol_kind::S_variables_may_be_quoted: // variables_may_be_quoted value.template destroy< std::unique_ptr > > > (); break; - case 345: // actions - case 346: // actions_may_quoted + case symbol_kind::S_actions: // actions + case symbol_kind::S_actions_may_quoted: // actions_may_quoted value.template destroy< std::unique_ptr > > > (); break; @@ -1675,6 +2340,15 @@ switch (yytype) Base::clear (); } + /// The user-facing name of this symbol. + std::string name () const YY_NOEXCEPT + { + return seclang_parser::symbol_name (this->kind ()); + } + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + /// Whether empty. bool empty () const YY_NOEXCEPT; @@ -1695,49 +2369,51 @@ switch (yytype) }; /// Type access provider for token (enum) based symbols. - struct by_type + struct by_kind { /// Default constructor. - by_type (); + by_kind (); #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_type (by_type&& that); + by_kind (by_kind&& that); #endif /// Copy constructor. - by_type (const by_type& that); + by_kind (const by_kind& that); - /// The symbol type as needed by the constructor. - typedef token_type kind_type; + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; /// Constructor from (external) token numbers. - by_type (kind_type t); + by_kind (kind_type t); /// Record that this symbol is empty. - void clear (); + void clear () YY_NOEXCEPT; - /// Steal the symbol type from \a that. - void move (by_type& that); + /// Steal the symbol kind from \a that. + void move (by_kind& that); /// The (internal) type number (corresponding to \a type). /// \a empty when empty. - symbol_number_type type_get () const YY_NOEXCEPT; + symbol_kind_type kind () const YY_NOEXCEPT; - /// The token. - token_type token () const YY_NOEXCEPT; + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; - /// The symbol type. - /// \a empty_symbol when empty. - /// An int, not token_number_type, to be able to store empty_symbol. - int type; + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; }; + /// Backward compatibility for a private implementation detail (Bison 3.6). + typedef by_kind by_type; + /// "External" symbols: returned by the scanner. - struct symbol_type : basic_symbol + struct symbol_type : basic_symbol { /// Superclass. - typedef basic_symbol super_type; + typedef basic_symbol super_type; /// Empty symbol. symbol_type () {} @@ -1746,35 +2422,37 @@ switch (yytype) #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) : super_type(token_type (tok), std::move (l)) - { - YYASSERT (tok == token::TOK_END || tok == token::TOK_COMMA || tok == token::TOK_CONFIG_CONTENT_INJECTION || tok == token::TOK_CONGIG_DIR_RESPONSE_BODY_MP_CLEAR || tok == token::TOK_PIPE || tok == token::TOK_NEW_LINE || tok == token::TOK_VAR_COUNT || tok == token::TOK_VAR_EXCLUSION || tok == token::TOK_VARIABLE_ARGS || tok == token::TOK_VARIABLE_ARGS_POST || tok == token::TOK_VARIABLE_ARGS_GET || tok == token::TOK_VARIABLE_FILES_SIZES || tok == token::TOK_VARIABLE_FILES_NAMES || tok == token::TOK_VARIABLE_FILES_TMP_CONTENT || tok == token::TOK_VARIABLE_MULTIPART_FILENAME || tok == token::TOK_VARIABLE_MULTIPART_NAME || tok == token::TOK_VARIABLE_MATCHED_VARS_NAMES || tok == token::TOK_VARIABLE_MATCHED_VARS || tok == token::TOK_VARIABLE_FILES || tok == token::TOK_VARIABLE_REQUEST_COOKIES || tok == token::TOK_VARIABLE_REQUEST_HEADERS || tok == token::TOK_VARIABLE_RESPONSE_HEADERS || tok == token::TOK_VARIABLE_GEO || tok == token::TOK_VARIABLE_REQUEST_COOKIES_NAMES || tok == token::TOK_VARIABLE_ARGS_COMBINED_SIZE || tok == token::TOK_VARIABLE_ARGS_GET_NAMES || tok == token::TOK_VARIABLE_RULE || tok == token::TOK_VARIABLE_ARGS_NAMES || tok == token::TOK_VARIABLE_ARGS_POST_NAMES || tok == token::TOK_VARIABLE_AUTH_TYPE || tok == token::TOK_VARIABLE_FILES_COMBINED_SIZE || tok == token::TOK_VARIABLE_FILES_TMP_NAMES || tok == token::TOK_VARIABLE_FULL_REQUEST || tok == token::TOK_VARIABLE_FULL_REQUEST_LENGTH || tok == token::TOK_VARIABLE_INBOUND_DATA_ERROR || tok == token::TOK_VARIABLE_MATCHED_VAR || tok == token::TOK_VARIABLE_MATCHED_VAR_NAME || tok == token::TOK_VARIABLE_MULTIPART_BOUNDARY_QUOTED || tok == token::TOK_VARIABLE_MULTIPART_BOUNDARY_WHITESPACE || tok == token::TOK_VARIABLE_MULTIPART_CRLF_LF_LINES || tok == token::TOK_VARIABLE_MULTIPART_DATA_AFTER || tok == token::TOK_VARIABLE_MULTIPART_DATA_BEFORE || tok == token::TOK_VARIABLE_MULTIPART_FILE_LIMIT_EXCEEDED || tok == token::TOK_VARIABLE_MULTIPART_HEADER_FOLDING || tok == token::TOK_VARIABLE_MULTIPART_INVALID_HEADER_FOLDING || tok == token::TOK_VARIABLE_MULTIPART_INVALID_PART || tok == token::TOK_VARIABLE_MULTIPART_INVALID_QUOTING || tok == token::TOK_VARIABLE_MULTIPART_LF_LINE || tok == token::TOK_VARIABLE_MULTIPART_MISSING_SEMICOLON || tok == token::TOK_VARIABLE_MULTIPART_SEMICOLON_MISSING || tok == token::TOK_VARIABLE_MULTIPART_STRICT_ERROR || tok == token::TOK_VARIABLE_MULTIPART_UNMATCHED_BOUNDARY || tok == token::TOK_VARIABLE_OUTBOUND_DATA_ERROR || tok == token::TOK_VARIABLE_PATH_INFO || tok == token::TOK_VARIABLE_QUERY_STRING || tok == token::TOK_VARIABLE_REMOTE_ADDR || tok == token::TOK_VARIABLE_REMOTE_HOST || tok == token::TOK_VARIABLE_REMOTE_PORT || tok == token::TOK_VARIABLE_REQBODY_ERROR_MSG || tok == token::TOK_VARIABLE_REQBODY_ERROR || tok == token::TOK_VARIABLE_REQBODY_PROCESSOR_ERROR_MSG || tok == token::TOK_VARIABLE_REQBODY_PROCESSOR_ERROR || tok == token::TOK_VARIABLE_REQBODY_PROCESSOR || tok == token::TOK_VARIABLE_REQUEST_BASENAME || tok == token::TOK_VARIABLE_REQUEST_BODY_LENGTH || tok == token::TOK_VARIABLE_REQUEST_BODY || tok == token::TOK_VARIABLE_REQUEST_FILE_NAME || tok == token::TOK_VARIABLE_REQUEST_HEADERS_NAMES || tok == token::TOK_VARIABLE_REQUEST_LINE || tok == token::TOK_VARIABLE_REQUEST_METHOD || tok == token::TOK_VARIABLE_REQUEST_PROTOCOL || tok == token::TOK_VARIABLE_REQUEST_URI_RAW || tok == token::TOK_VARIABLE_REQUEST_URI || tok == token::TOK_VARIABLE_RESOURCE || tok == token::TOK_VARIABLE_RESPONSE_BODY || tok == token::TOK_VARIABLE_RESPONSE_CONTENT_LENGTH || tok == token::TOK_VARIABLE_RESPONSE_CONTENT_TYPE || tok == token::TOK_VARIABLE_RESPONSE_HEADERS_NAMES || tok == token::TOK_VARIABLE_RESPONSE_PROTOCOL || tok == token::TOK_VARIABLE_RESPONSE_STATUS || tok == token::TOK_VARIABLE_SERVER_ADDR || tok == token::TOK_VARIABLE_SERVER_NAME || tok == token::TOK_VARIABLE_SERVER_PORT || tok == token::TOK_VARIABLE_SESSION_ID || tok == token::TOK_VARIABLE_UNIQUE_ID || tok == token::TOK_VARIABLE_URL_ENCODED_ERROR || tok == token::TOK_VARIABLE_USER_ID || tok == token::TOK_VARIABLE_WEB_APP_ID || tok == token::TOK_VARIABLE_STATUS || tok == token::TOK_VARIABLE_STATUS_LINE || tok == token::TOK_VARIABLE_IP || tok == token::TOK_VARIABLE_GLOBAL || tok == token::TOK_VARIABLE_TX || tok == token::TOK_VARIABLE_SESSION || tok == token::TOK_VARIABLE_USER || tok == token::TOK_RUN_TIME_VAR_ENV || tok == token::TOK_RUN_TIME_VAR_XML || tok == token::TOK_ACTION_SETVAR || tok == token::TOK_SETVAR_OPERATION_EQUALS || tok == token::TOK_SETVAR_OPERATION_EQUALS_PLUS || tok == token::TOK_SETVAR_OPERATION_EQUALS_MINUS || tok == token::TOK_NOT || tok == token::TOK_OPERATOR_BEGINS_WITH || tok == token::TOK_OPERATOR_CONTAINS || tok == token::TOK_OPERATOR_CONTAINS_WORD || tok == token::TOK_OPERATOR_DETECT_SQLI || tok == token::TOK_OPERATOR_DETECT_XSS || tok == token::TOK_OPERATOR_ENDS_WITH || tok == token::TOK_OPERATOR_EQ || tok == token::TOK_OPERATOR_FUZZY_HASH || tok == token::TOK_OPERATOR_GEOLOOKUP || tok == token::TOK_OPERATOR_GE || tok == token::TOK_OPERATOR_GSB_LOOKUP || tok == token::TOK_OPERATOR_GT || tok == token::TOK_OPERATOR_INSPECT_FILE || tok == token::TOK_OPERATOR_IP_MATCH_FROM_FILE || tok == token::TOK_OPERATOR_IP_MATCH || tok == token::TOK_OPERATOR_LE || tok == token::TOK_OPERATOR_LT || tok == token::TOK_OPERATOR_PM_FROM_FILE || tok == token::TOK_OPERATOR_PM || tok == token::TOK_OPERATOR_RBL || tok == token::TOK_OPERATOR_RSUB || tok == token::TOK_OPERATOR_RX_CONTENT_ONLY || tok == token::TOK_OPERATOR_RX || tok == token::TOK_OPERATOR_STR_EQ || tok == token::TOK_OPERATOR_STR_MATCH || tok == token::TOK_OPERATOR_UNCONDITIONAL_MATCH || tok == token::TOK_OPERATOR_VALIDATE_BYTE_RANGE || tok == token::TOK_OPERATOR_VALIDATE_DTD || tok == token::TOK_OPERATOR_VALIDATE_HASH || tok == token::TOK_OPERATOR_VALIDATE_SCHEMA || tok == token::TOK_OPERATOR_VALIDATE_URL_ENCODING || tok == token::TOK_OPERATOR_VALIDATE_UTF8_ENCODING || tok == token::TOK_OPERATOR_VERIFY_CC || tok == token::TOK_OPERATOR_VERIFY_CPF || tok == token::TOK_OPERATOR_VERIFY_SSN || tok == token::TOK_OPERATOR_VERIFY_SVNR || tok == token::TOK_OPERATOR_WITHIN || tok == token::TOK_CONFIG_DIR_AUDIT_LOG_FMT || tok == token::TOK_JSON || tok == token::TOK_NATIVE || tok == token::TOK_ACTION_CTL_RULE_ENGINE); - } #else symbol_type (int tok, const location_type& l) : super_type(token_type (tok), l) - { - YYASSERT (tok == token::TOK_END || tok == token::TOK_COMMA || tok == token::TOK_CONFIG_CONTENT_INJECTION || tok == token::TOK_CONGIG_DIR_RESPONSE_BODY_MP_CLEAR || tok == token::TOK_PIPE || tok == token::TOK_NEW_LINE || tok == token::TOK_VAR_COUNT || tok == token::TOK_VAR_EXCLUSION || tok == token::TOK_VARIABLE_ARGS || tok == token::TOK_VARIABLE_ARGS_POST || tok == token::TOK_VARIABLE_ARGS_GET || tok == token::TOK_VARIABLE_FILES_SIZES || tok == token::TOK_VARIABLE_FILES_NAMES || tok == token::TOK_VARIABLE_FILES_TMP_CONTENT || tok == token::TOK_VARIABLE_MULTIPART_FILENAME || tok == token::TOK_VARIABLE_MULTIPART_NAME || tok == token::TOK_VARIABLE_MATCHED_VARS_NAMES || tok == token::TOK_VARIABLE_MATCHED_VARS || tok == token::TOK_VARIABLE_FILES || tok == token::TOK_VARIABLE_REQUEST_COOKIES || tok == token::TOK_VARIABLE_REQUEST_HEADERS || tok == token::TOK_VARIABLE_RESPONSE_HEADERS || tok == token::TOK_VARIABLE_GEO || tok == token::TOK_VARIABLE_REQUEST_COOKIES_NAMES || tok == token::TOK_VARIABLE_ARGS_COMBINED_SIZE || tok == token::TOK_VARIABLE_ARGS_GET_NAMES || tok == token::TOK_VARIABLE_RULE || tok == token::TOK_VARIABLE_ARGS_NAMES || tok == token::TOK_VARIABLE_ARGS_POST_NAMES || tok == token::TOK_VARIABLE_AUTH_TYPE || tok == token::TOK_VARIABLE_FILES_COMBINED_SIZE || tok == token::TOK_VARIABLE_FILES_TMP_NAMES || tok == token::TOK_VARIABLE_FULL_REQUEST || tok == token::TOK_VARIABLE_FULL_REQUEST_LENGTH || tok == token::TOK_VARIABLE_INBOUND_DATA_ERROR || tok == token::TOK_VARIABLE_MATCHED_VAR || tok == token::TOK_VARIABLE_MATCHED_VAR_NAME || tok == token::TOK_VARIABLE_MULTIPART_BOUNDARY_QUOTED || tok == token::TOK_VARIABLE_MULTIPART_BOUNDARY_WHITESPACE || tok == token::TOK_VARIABLE_MULTIPART_CRLF_LF_LINES || tok == token::TOK_VARIABLE_MULTIPART_DATA_AFTER || tok == token::TOK_VARIABLE_MULTIPART_DATA_BEFORE || tok == token::TOK_VARIABLE_MULTIPART_FILE_LIMIT_EXCEEDED || tok == token::TOK_VARIABLE_MULTIPART_HEADER_FOLDING || tok == token::TOK_VARIABLE_MULTIPART_INVALID_HEADER_FOLDING || tok == token::TOK_VARIABLE_MULTIPART_INVALID_PART || tok == token::TOK_VARIABLE_MULTIPART_INVALID_QUOTING || tok == token::TOK_VARIABLE_MULTIPART_LF_LINE || tok == token::TOK_VARIABLE_MULTIPART_MISSING_SEMICOLON || tok == token::TOK_VARIABLE_MULTIPART_SEMICOLON_MISSING || tok == token::TOK_VARIABLE_MULTIPART_STRICT_ERROR || tok == token::TOK_VARIABLE_MULTIPART_UNMATCHED_BOUNDARY || tok == token::TOK_VARIABLE_OUTBOUND_DATA_ERROR || tok == token::TOK_VARIABLE_PATH_INFO || tok == token::TOK_VARIABLE_QUERY_STRING || tok == token::TOK_VARIABLE_REMOTE_ADDR || tok == token::TOK_VARIABLE_REMOTE_HOST || tok == token::TOK_VARIABLE_REMOTE_PORT || tok == token::TOK_VARIABLE_REQBODY_ERROR_MSG || tok == token::TOK_VARIABLE_REQBODY_ERROR || tok == token::TOK_VARIABLE_REQBODY_PROCESSOR_ERROR_MSG || tok == token::TOK_VARIABLE_REQBODY_PROCESSOR_ERROR || tok == token::TOK_VARIABLE_REQBODY_PROCESSOR || tok == token::TOK_VARIABLE_REQUEST_BASENAME || tok == token::TOK_VARIABLE_REQUEST_BODY_LENGTH || tok == token::TOK_VARIABLE_REQUEST_BODY || tok == token::TOK_VARIABLE_REQUEST_FILE_NAME || tok == token::TOK_VARIABLE_REQUEST_HEADERS_NAMES || tok == token::TOK_VARIABLE_REQUEST_LINE || tok == token::TOK_VARIABLE_REQUEST_METHOD || tok == token::TOK_VARIABLE_REQUEST_PROTOCOL || tok == token::TOK_VARIABLE_REQUEST_URI_RAW || tok == token::TOK_VARIABLE_REQUEST_URI || tok == token::TOK_VARIABLE_RESOURCE || tok == token::TOK_VARIABLE_RESPONSE_BODY || tok == token::TOK_VARIABLE_RESPONSE_CONTENT_LENGTH || tok == token::TOK_VARIABLE_RESPONSE_CONTENT_TYPE || tok == token::TOK_VARIABLE_RESPONSE_HEADERS_NAMES || tok == token::TOK_VARIABLE_RESPONSE_PROTOCOL || tok == token::TOK_VARIABLE_RESPONSE_STATUS || tok == token::TOK_VARIABLE_SERVER_ADDR || tok == token::TOK_VARIABLE_SERVER_NAME || tok == token::TOK_VARIABLE_SERVER_PORT || tok == token::TOK_VARIABLE_SESSION_ID || tok == token::TOK_VARIABLE_UNIQUE_ID || tok == token::TOK_VARIABLE_URL_ENCODED_ERROR || tok == token::TOK_VARIABLE_USER_ID || tok == token::TOK_VARIABLE_WEB_APP_ID || tok == token::TOK_VARIABLE_STATUS || tok == token::TOK_VARIABLE_STATUS_LINE || tok == token::TOK_VARIABLE_IP || tok == token::TOK_VARIABLE_GLOBAL || tok == token::TOK_VARIABLE_TX || tok == token::TOK_VARIABLE_SESSION || tok == token::TOK_VARIABLE_USER || tok == token::TOK_RUN_TIME_VAR_ENV || tok == token::TOK_RUN_TIME_VAR_XML || tok == token::TOK_ACTION_SETVAR || tok == token::TOK_SETVAR_OPERATION_EQUALS || tok == token::TOK_SETVAR_OPERATION_EQUALS_PLUS || tok == token::TOK_SETVAR_OPERATION_EQUALS_MINUS || tok == token::TOK_NOT || tok == token::TOK_OPERATOR_BEGINS_WITH || tok == token::TOK_OPERATOR_CONTAINS || tok == token::TOK_OPERATOR_CONTAINS_WORD || tok == token::TOK_OPERATOR_DETECT_SQLI || tok == token::TOK_OPERATOR_DETECT_XSS || tok == token::TOK_OPERATOR_ENDS_WITH || tok == token::TOK_OPERATOR_EQ || tok == token::TOK_OPERATOR_FUZZY_HASH || tok == token::TOK_OPERATOR_GEOLOOKUP || tok == token::TOK_OPERATOR_GE || tok == token::TOK_OPERATOR_GSB_LOOKUP || tok == token::TOK_OPERATOR_GT || tok == token::TOK_OPERATOR_INSPECT_FILE || tok == token::TOK_OPERATOR_IP_MATCH_FROM_FILE || tok == token::TOK_OPERATOR_IP_MATCH || tok == token::TOK_OPERATOR_LE || tok == token::TOK_OPERATOR_LT || tok == token::TOK_OPERATOR_PM_FROM_FILE || tok == token::TOK_OPERATOR_PM || tok == token::TOK_OPERATOR_RBL || tok == token::TOK_OPERATOR_RSUB || tok == token::TOK_OPERATOR_RX_CONTENT_ONLY || tok == token::TOK_OPERATOR_RX || tok == token::TOK_OPERATOR_STR_EQ || tok == token::TOK_OPERATOR_STR_MATCH || tok == token::TOK_OPERATOR_UNCONDITIONAL_MATCH || tok == token::TOK_OPERATOR_VALIDATE_BYTE_RANGE || tok == token::TOK_OPERATOR_VALIDATE_DTD || tok == token::TOK_OPERATOR_VALIDATE_HASH || tok == token::TOK_OPERATOR_VALIDATE_SCHEMA || tok == token::TOK_OPERATOR_VALIDATE_URL_ENCODING || tok == token::TOK_OPERATOR_VALIDATE_UTF8_ENCODING || tok == token::TOK_OPERATOR_VERIFY_CC || tok == token::TOK_OPERATOR_VERIFY_CPF || tok == token::TOK_OPERATOR_VERIFY_SSN || tok == token::TOK_OPERATOR_VERIFY_SVNR || tok == token::TOK_OPERATOR_WITHIN || tok == token::TOK_CONFIG_DIR_AUDIT_LOG_FMT || tok == token::TOK_JSON || tok == token::TOK_NATIVE || tok == token::TOK_ACTION_CTL_RULE_ENGINE); - } #endif + { + YY_ASSERT (tok == token::TOK_END + || (token::TOK_YYerror <= tok && tok <= token::TOK_ACTION_CTL_RULE_ENGINE)); + } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) : super_type(token_type (tok), std::move (v), std::move (l)) - { - YYASSERT (tok == token::TOK_ACTION_ACCURACY || tok == token::TOK_ACTION_ALLOW || tok == token::TOK_ACTION_APPEND || tok == token::TOK_ACTION_AUDIT_LOG || tok == token::TOK_ACTION_BLOCK || tok == token::TOK_ACTION_CAPTURE || tok == token::TOK_ACTION_CHAIN || tok == token::TOK_ACTION_CTL_AUDIT_ENGINE || tok == token::TOK_ACTION_CTL_AUDIT_LOG_PARTS || tok == token::TOK_ACTION_CTL_BDY_JSON || tok == token::TOK_ACTION_CTL_BDY_XML || tok == token::TOK_ACTION_CTL_BDY_URLENCODED || tok == token::TOK_ACTION_CTL_FORCE_REQ_BODY_VAR || tok == token::TOK_ACTION_CTL_REQUEST_BODY_ACCESS || tok == token::TOK_ACTION_CTL_RULE_REMOVE_BY_ID || tok == token::TOK_ACTION_CTL_RULE_REMOVE_BY_TAG || tok == token::TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID || tok == token::TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG || tok == token::TOK_ACTION_DENY || tok == token::TOK_ACTION_DEPRECATE_VAR || tok == token::TOK_ACTION_DROP || tok == token::TOK_ACTION_EXEC || tok == token::TOK_ACTION_EXPIRE_VAR || tok == token::TOK_ACTION_ID || tok == token::TOK_ACTION_INITCOL || tok == token::TOK_ACTION_LOG || tok == token::TOK_ACTION_LOG_DATA || tok == token::TOK_ACTION_MATURITY || tok == token::TOK_ACTION_MSG || tok == token::TOK_ACTION_MULTI_MATCH || tok == token::TOK_ACTION_NO_AUDIT_LOG || tok == token::TOK_ACTION_NO_LOG || tok == token::TOK_ACTION_PASS || tok == token::TOK_ACTION_PAUSE || tok == token::TOK_ACTION_PHASE || tok == token::TOK_ACTION_PREPEND || tok == token::TOK_ACTION_PROXY || tok == token::TOK_ACTION_REDIRECT || tok == token::TOK_ACTION_REV || tok == token::TOK_ACTION_SANITISE_ARG || tok == token::TOK_ACTION_SANITISE_MATCHED || tok == token::TOK_ACTION_SANITISE_MATCHED_BYTES || tok == token::TOK_ACTION_SANITISE_REQUEST_HEADER || tok == token::TOK_ACTION_SANITISE_RESPONSE_HEADER || tok == token::TOK_ACTION_SETENV || tok == token::TOK_ACTION_SETRSC || tok == token::TOK_ACTION_SETSID || tok == token::TOK_ACTION_SETUID || tok == token::TOK_ACTION_SEVERITY || tok == token::TOK_ACTION_SKIP || tok == token::TOK_ACTION_SKIP_AFTER || tok == token::TOK_ACTION_STATUS || tok == token::TOK_ACTION_TAG || tok == token::TOK_ACTION_TRANSFORMATION_BASE_64_ENCODE || tok == token::TOK_ACTION_TRANSFORMATION_BASE_64_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT || tok == token::TOK_ACTION_TRANSFORMATION_CMD_LINE || tok == token::TOK_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE || tok == token::TOK_ACTION_TRANSFORMATION_CSS_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_HEX_ENCODE || tok == token::TOK_ACTION_TRANSFORMATION_HEX_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_JS_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_LENGTH || tok == token::TOK_ACTION_TRANSFORMATION_LOWERCASE || tok == token::TOK_ACTION_TRANSFORMATION_MD5 || tok == token::TOK_ACTION_TRANSFORMATION_NONE || tok == token::TOK_ACTION_TRANSFORMATION_NORMALISE_PATH || tok == token::TOK_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN || tok == token::TOK_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT || tok == token::TOK_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT || tok == token::TOK_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT || tok == token::TOK_ACTION_TRANSFORMATION_REMOVE_COMMENTS || tok == token::TOK_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR || tok == token::TOK_ACTION_TRANSFORMATION_REMOVE_NULLS || tok == token::TOK_ACTION_TRANSFORMATION_REMOVE_WHITESPACE || tok == token::TOK_ACTION_TRANSFORMATION_REPLACE_COMMENTS || tok == token::TOK_ACTION_TRANSFORMATION_REPLACE_NULLS || tok == token::TOK_ACTION_TRANSFORMATION_SHA1 || tok == token::TOK_ACTION_TRANSFORMATION_SQL_HEX_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_TRIM || tok == token::TOK_ACTION_TRANSFORMATION_TRIM_LEFT || tok == token::TOK_ACTION_TRANSFORMATION_TRIM_RIGHT || tok == token::TOK_ACTION_TRANSFORMATION_UPPERCASE || tok == token::TOK_ACTION_TRANSFORMATION_URL_ENCODE || tok == token::TOK_ACTION_TRANSFORMATION_URL_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_URL_DECODE_UNI || tok == token::TOK_ACTION_TRANSFORMATION_UTF8_TO_UNICODE || tok == token::TOK_ACTION_VER || tok == token::TOK_ACTION_XMLNS || tok == token::TOK_CONFIG_COMPONENT_SIG || tok == token::TOK_CONFIG_CONN_ENGINE || tok == token::TOK_CONFIG_SEC_ARGUMENT_SEPARATOR || tok == token::TOK_CONFIG_SEC_WEB_APP_ID || tok == token::TOK_CONFIG_SEC_SERVER_SIG || tok == token::TOK_CONFIG_DIR_AUDIT_DIR || tok == token::TOK_CONFIG_DIR_AUDIT_DIR_MOD || tok == token::TOK_CONFIG_DIR_AUDIT_ENG || tok == token::TOK_CONFIG_DIR_AUDIT_FLE_MOD || tok == token::TOK_CONFIG_DIR_AUDIT_LOG || tok == token::TOK_CONFIG_DIR_AUDIT_LOG2 || tok == token::TOK_CONFIG_DIR_AUDIT_LOG_P || tok == token::TOK_CONFIG_DIR_AUDIT_STS || tok == token::TOK_CONFIG_DIR_AUDIT_TPE || tok == token::TOK_CONFIG_DIR_DEBUG_LOG || tok == token::TOK_CONFIG_DIR_DEBUG_LVL || tok == token::TOK_CONFIG_SEC_CACHE_TRANSFORMATIONS || tok == token::TOK_CONFIG_SEC_DISABLE_BACKEND_COMPRESS || tok == token::TOK_CONFIG_SEC_HASH_ENGINE || tok == token::TOK_CONFIG_SEC_HASH_KEY || tok == token::TOK_CONFIG_SEC_HASH_PARAM || tok == token::TOK_CONFIG_SEC_HASH_METHOD_RX || tok == token::TOK_CONFIG_SEC_HASH_METHOD_PM || tok == token::TOK_CONFIG_SEC_CHROOT_DIR || tok == token::TOK_CONFIG_DIR_GEO_DB || tok == token::TOK_CONFIG_DIR_GSB_DB || tok == token::TOK_CONFIG_SEC_GUARDIAN_LOG || tok == token::TOK_CONFIG_DIR_PCRE_MATCH_LIMIT || tok == token::TOK_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION || tok == token::TOK_CONFIG_SEC_CONN_R_STATE_LIMIT || tok == token::TOK_CONFIG_SEC_CONN_W_STATE_LIMIT || tok == token::TOK_CONFIG_SEC_SENSOR_ID || tok == token::TOK_CONFIG_DIR_REQ_BODY || tok == token::TOK_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT || tok == token::TOK_CONFIG_DIR_REQ_BODY_LIMIT || tok == token::TOK_CONFIG_DIR_REQ_BODY_LIMIT_ACTION || tok == token::TOK_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT || tok == token::TOK_CONFIG_DIR_RES_BODY || tok == token::TOK_CONFIG_DIR_RES_BODY_LIMIT || tok == token::TOK_CONFIG_DIR_RES_BODY_LIMIT_ACTION || tok == token::TOK_CONFIG_SEC_RULE_INHERITANCE || tok == token::TOK_CONFIG_SEC_RULE_PERF_TIME || tok == token::TOK_CONFIG_DIR_RULE_ENG || tok == token::TOK_CONFIG_DIR_SEC_ACTION || tok == token::TOK_CONFIG_DIR_SEC_DEFAULT_ACTION || tok == token::TOK_CONFIG_DIR_SEC_MARKER || tok == token::TOK_CONFIG_DIR_UNICODE_MAP_FILE || tok == token::TOK_CONFIG_DIR_UNICODE_CODE_PAGE || tok == token::TOK_CONFIG_SEC_COLLECTION_TIMEOUT || tok == token::TOK_CONFIG_SEC_HTTP_BLKEY || tok == token::TOK_CONFIG_SEC_INTERCEPT_ON_ERROR || tok == token::TOK_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION || tok == token::TOK_CONFIG_SEC_RULE_REMOVE_BY_ID || tok == token::TOK_CONFIG_SEC_RULE_REMOVE_BY_MSG || tok == token::TOK_CONFIG_SEC_RULE_REMOVE_BY_TAG || tok == token::TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG || tok == token::TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG || tok == token::TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID || tok == token::TOK_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID || tok == token::TOK_CONFIG_UPDLOAD_KEEP_FILES || tok == token::TOK_CONFIG_UPDLOAD_SAVE_TMP_FILES || tok == token::TOK_CONFIG_UPLOAD_DIR || tok == token::TOK_CONFIG_UPLOAD_FILE_LIMIT || tok == token::TOK_CONFIG_UPLOAD_FILE_MODE || tok == token::TOK_CONFIG_VALUE_ABORT || tok == token::TOK_CONFIG_VALUE_DETC || tok == token::TOK_CONFIG_VALUE_HTTPS || tok == token::TOK_CONFIG_VALUE_OFF || tok == token::TOK_CONFIG_VALUE_ON || tok == token::TOK_CONFIG_VALUE_PARALLEL || tok == token::TOK_CONFIG_VALUE_PROCESS_PARTIAL || tok == token::TOK_CONFIG_VALUE_REJECT || tok == token::TOK_CONFIG_VALUE_RELEVANT_ONLY || tok == token::TOK_CONFIG_VALUE_SERIAL || tok == token::TOK_CONFIG_VALUE_WARN || tok == token::TOK_CONFIG_XML_EXTERNAL_ENTITY || tok == token::TOK_CONGIG_DIR_RESPONSE_BODY_MP || tok == token::TOK_CONGIG_DIR_SEC_ARG_SEP || tok == token::TOK_CONGIG_DIR_SEC_COOKIE_FORMAT || tok == token::TOK_CONFIG_SEC_COOKIEV0_SEPARATOR || tok == token::TOK_CONGIG_DIR_SEC_DATA_DIR || tok == token::TOK_CONGIG_DIR_SEC_STATUS_ENGINE || tok == token::TOK_CONFIG_SEC_STREAM_IN_BODY_INSPECTION || tok == token::TOK_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION || tok == token::TOK_CONGIG_DIR_SEC_TMP_DIR || tok == token::TOK_DIRECTIVE || tok == token::TOK_DIRECTIVE_SECRULESCRIPT || tok == token::TOK_FREE_TEXT_QUOTE_MACRO_EXPANSION || tok == token::TOK_QUOTATION_MARK || tok == token::TOK_RUN_TIME_VAR_BLD || tok == token::TOK_RUN_TIME_VAR_DUR || tok == token::TOK_RUN_TIME_VAR_HSV || tok == token::TOK_RUN_TIME_VAR_REMOTE_USER || tok == token::TOK_RUN_TIME_VAR_TIME || tok == token::TOK_RUN_TIME_VAR_TIME_DAY || tok == token::TOK_RUN_TIME_VAR_TIME_EPOCH || tok == token::TOK_RUN_TIME_VAR_TIME_HOUR || tok == token::TOK_RUN_TIME_VAR_TIME_MIN || tok == token::TOK_RUN_TIME_VAR_TIME_MON || tok == token::TOK_RUN_TIME_VAR_TIME_SEC || tok == token::TOK_RUN_TIME_VAR_TIME_WDAY || tok == token::TOK_RUN_TIME_VAR_TIME_YEAR || tok == token::TOK_VARIABLE || tok == token::TOK_DICT_ELEMENT || tok == token::TOK_DICT_ELEMENT_REGEXP); - } #else symbol_type (int tok, const std::string& v, const location_type& l) : super_type(token_type (tok), v, l) - { - YYASSERT (tok == token::TOK_ACTION_ACCURACY || tok == token::TOK_ACTION_ALLOW || tok == token::TOK_ACTION_APPEND || tok == token::TOK_ACTION_AUDIT_LOG || tok == token::TOK_ACTION_BLOCK || tok == token::TOK_ACTION_CAPTURE || tok == token::TOK_ACTION_CHAIN || tok == token::TOK_ACTION_CTL_AUDIT_ENGINE || tok == token::TOK_ACTION_CTL_AUDIT_LOG_PARTS || tok == token::TOK_ACTION_CTL_BDY_JSON || tok == token::TOK_ACTION_CTL_BDY_XML || tok == token::TOK_ACTION_CTL_BDY_URLENCODED || tok == token::TOK_ACTION_CTL_FORCE_REQ_BODY_VAR || tok == token::TOK_ACTION_CTL_REQUEST_BODY_ACCESS || tok == token::TOK_ACTION_CTL_RULE_REMOVE_BY_ID || tok == token::TOK_ACTION_CTL_RULE_REMOVE_BY_TAG || tok == token::TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID || tok == token::TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG || tok == token::TOK_ACTION_DENY || tok == token::TOK_ACTION_DEPRECATE_VAR || tok == token::TOK_ACTION_DROP || tok == token::TOK_ACTION_EXEC || tok == token::TOK_ACTION_EXPIRE_VAR || tok == token::TOK_ACTION_ID || tok == token::TOK_ACTION_INITCOL || tok == token::TOK_ACTION_LOG || tok == token::TOK_ACTION_LOG_DATA || tok == token::TOK_ACTION_MATURITY || tok == token::TOK_ACTION_MSG || tok == token::TOK_ACTION_MULTI_MATCH || tok == token::TOK_ACTION_NO_AUDIT_LOG || tok == token::TOK_ACTION_NO_LOG || tok == token::TOK_ACTION_PASS || tok == token::TOK_ACTION_PAUSE || tok == token::TOK_ACTION_PHASE || tok == token::TOK_ACTION_PREPEND || tok == token::TOK_ACTION_PROXY || tok == token::TOK_ACTION_REDIRECT || tok == token::TOK_ACTION_REV || tok == token::TOK_ACTION_SANITISE_ARG || tok == token::TOK_ACTION_SANITISE_MATCHED || tok == token::TOK_ACTION_SANITISE_MATCHED_BYTES || tok == token::TOK_ACTION_SANITISE_REQUEST_HEADER || tok == token::TOK_ACTION_SANITISE_RESPONSE_HEADER || tok == token::TOK_ACTION_SETENV || tok == token::TOK_ACTION_SETRSC || tok == token::TOK_ACTION_SETSID || tok == token::TOK_ACTION_SETUID || tok == token::TOK_ACTION_SEVERITY || tok == token::TOK_ACTION_SKIP || tok == token::TOK_ACTION_SKIP_AFTER || tok == token::TOK_ACTION_STATUS || tok == token::TOK_ACTION_TAG || tok == token::TOK_ACTION_TRANSFORMATION_BASE_64_ENCODE || tok == token::TOK_ACTION_TRANSFORMATION_BASE_64_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT || tok == token::TOK_ACTION_TRANSFORMATION_CMD_LINE || tok == token::TOK_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE || tok == token::TOK_ACTION_TRANSFORMATION_CSS_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_HEX_ENCODE || tok == token::TOK_ACTION_TRANSFORMATION_HEX_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_JS_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_LENGTH || tok == token::TOK_ACTION_TRANSFORMATION_LOWERCASE || tok == token::TOK_ACTION_TRANSFORMATION_MD5 || tok == token::TOK_ACTION_TRANSFORMATION_NONE || tok == token::TOK_ACTION_TRANSFORMATION_NORMALISE_PATH || tok == token::TOK_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN || tok == token::TOK_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT || tok == token::TOK_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT || tok == token::TOK_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT || tok == token::TOK_ACTION_TRANSFORMATION_REMOVE_COMMENTS || tok == token::TOK_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR || tok == token::TOK_ACTION_TRANSFORMATION_REMOVE_NULLS || tok == token::TOK_ACTION_TRANSFORMATION_REMOVE_WHITESPACE || tok == token::TOK_ACTION_TRANSFORMATION_REPLACE_COMMENTS || tok == token::TOK_ACTION_TRANSFORMATION_REPLACE_NULLS || tok == token::TOK_ACTION_TRANSFORMATION_SHA1 || tok == token::TOK_ACTION_TRANSFORMATION_SQL_HEX_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_TRIM || tok == token::TOK_ACTION_TRANSFORMATION_TRIM_LEFT || tok == token::TOK_ACTION_TRANSFORMATION_TRIM_RIGHT || tok == token::TOK_ACTION_TRANSFORMATION_UPPERCASE || tok == token::TOK_ACTION_TRANSFORMATION_URL_ENCODE || tok == token::TOK_ACTION_TRANSFORMATION_URL_DECODE || tok == token::TOK_ACTION_TRANSFORMATION_URL_DECODE_UNI || tok == token::TOK_ACTION_TRANSFORMATION_UTF8_TO_UNICODE || tok == token::TOK_ACTION_VER || tok == token::TOK_ACTION_XMLNS || tok == token::TOK_CONFIG_COMPONENT_SIG || tok == token::TOK_CONFIG_CONN_ENGINE || tok == token::TOK_CONFIG_SEC_ARGUMENT_SEPARATOR || tok == token::TOK_CONFIG_SEC_WEB_APP_ID || tok == token::TOK_CONFIG_SEC_SERVER_SIG || tok == token::TOK_CONFIG_DIR_AUDIT_DIR || tok == token::TOK_CONFIG_DIR_AUDIT_DIR_MOD || tok == token::TOK_CONFIG_DIR_AUDIT_ENG || tok == token::TOK_CONFIG_DIR_AUDIT_FLE_MOD || tok == token::TOK_CONFIG_DIR_AUDIT_LOG || tok == token::TOK_CONFIG_DIR_AUDIT_LOG2 || tok == token::TOK_CONFIG_DIR_AUDIT_LOG_P || tok == token::TOK_CONFIG_DIR_AUDIT_STS || tok == token::TOK_CONFIG_DIR_AUDIT_TPE || tok == token::TOK_CONFIG_DIR_DEBUG_LOG || tok == token::TOK_CONFIG_DIR_DEBUG_LVL || tok == token::TOK_CONFIG_SEC_CACHE_TRANSFORMATIONS || tok == token::TOK_CONFIG_SEC_DISABLE_BACKEND_COMPRESS || tok == token::TOK_CONFIG_SEC_HASH_ENGINE || tok == token::TOK_CONFIG_SEC_HASH_KEY || tok == token::TOK_CONFIG_SEC_HASH_PARAM || tok == token::TOK_CONFIG_SEC_HASH_METHOD_RX || tok == token::TOK_CONFIG_SEC_HASH_METHOD_PM || tok == token::TOK_CONFIG_SEC_CHROOT_DIR || tok == token::TOK_CONFIG_DIR_GEO_DB || tok == token::TOK_CONFIG_DIR_GSB_DB || tok == token::TOK_CONFIG_SEC_GUARDIAN_LOG || tok == token::TOK_CONFIG_DIR_PCRE_MATCH_LIMIT || tok == token::TOK_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION || tok == token::TOK_CONFIG_SEC_CONN_R_STATE_LIMIT || tok == token::TOK_CONFIG_SEC_CONN_W_STATE_LIMIT || tok == token::TOK_CONFIG_SEC_SENSOR_ID || tok == token::TOK_CONFIG_DIR_REQ_BODY || tok == token::TOK_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT || tok == token::TOK_CONFIG_DIR_REQ_BODY_LIMIT || tok == token::TOK_CONFIG_DIR_REQ_BODY_LIMIT_ACTION || tok == token::TOK_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT || tok == token::TOK_CONFIG_DIR_RES_BODY || tok == token::TOK_CONFIG_DIR_RES_BODY_LIMIT || tok == token::TOK_CONFIG_DIR_RES_BODY_LIMIT_ACTION || tok == token::TOK_CONFIG_SEC_RULE_INHERITANCE || tok == token::TOK_CONFIG_SEC_RULE_PERF_TIME || tok == token::TOK_CONFIG_DIR_RULE_ENG || tok == token::TOK_CONFIG_DIR_SEC_ACTION || tok == token::TOK_CONFIG_DIR_SEC_DEFAULT_ACTION || tok == token::TOK_CONFIG_DIR_SEC_MARKER || tok == token::TOK_CONFIG_DIR_UNICODE_MAP_FILE || tok == token::TOK_CONFIG_DIR_UNICODE_CODE_PAGE || tok == token::TOK_CONFIG_SEC_COLLECTION_TIMEOUT || tok == token::TOK_CONFIG_SEC_HTTP_BLKEY || tok == token::TOK_CONFIG_SEC_INTERCEPT_ON_ERROR || tok == token::TOK_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION || tok == token::TOK_CONFIG_SEC_RULE_REMOVE_BY_ID || tok == token::TOK_CONFIG_SEC_RULE_REMOVE_BY_MSG || tok == token::TOK_CONFIG_SEC_RULE_REMOVE_BY_TAG || tok == token::TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG || tok == token::TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG || tok == token::TOK_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID || tok == token::TOK_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID || tok == token::TOK_CONFIG_UPDLOAD_KEEP_FILES || tok == token::TOK_CONFIG_UPDLOAD_SAVE_TMP_FILES || tok == token::TOK_CONFIG_UPLOAD_DIR || tok == token::TOK_CONFIG_UPLOAD_FILE_LIMIT || tok == token::TOK_CONFIG_UPLOAD_FILE_MODE || tok == token::TOK_CONFIG_VALUE_ABORT || tok == token::TOK_CONFIG_VALUE_DETC || tok == token::TOK_CONFIG_VALUE_HTTPS || tok == token::TOK_CONFIG_VALUE_OFF || tok == token::TOK_CONFIG_VALUE_ON || tok == token::TOK_CONFIG_VALUE_PARALLEL || tok == token::TOK_CONFIG_VALUE_PROCESS_PARTIAL || tok == token::TOK_CONFIG_VALUE_REJECT || tok == token::TOK_CONFIG_VALUE_RELEVANT_ONLY || tok == token::TOK_CONFIG_VALUE_SERIAL || tok == token::TOK_CONFIG_VALUE_WARN || tok == token::TOK_CONFIG_XML_EXTERNAL_ENTITY || tok == token::TOK_CONGIG_DIR_RESPONSE_BODY_MP || tok == token::TOK_CONGIG_DIR_SEC_ARG_SEP || tok == token::TOK_CONGIG_DIR_SEC_COOKIE_FORMAT || tok == token::TOK_CONFIG_SEC_COOKIEV0_SEPARATOR || tok == token::TOK_CONGIG_DIR_SEC_DATA_DIR || tok == token::TOK_CONGIG_DIR_SEC_STATUS_ENGINE || tok == token::TOK_CONFIG_SEC_STREAM_IN_BODY_INSPECTION || tok == token::TOK_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION || tok == token::TOK_CONGIG_DIR_SEC_TMP_DIR || tok == token::TOK_DIRECTIVE || tok == token::TOK_DIRECTIVE_SECRULESCRIPT || tok == token::TOK_FREE_TEXT_QUOTE_MACRO_EXPANSION || tok == token::TOK_QUOTATION_MARK || tok == token::TOK_RUN_TIME_VAR_BLD || tok == token::TOK_RUN_TIME_VAR_DUR || tok == token::TOK_RUN_TIME_VAR_HSV || tok == token::TOK_RUN_TIME_VAR_REMOTE_USER || tok == token::TOK_RUN_TIME_VAR_TIME || tok == token::TOK_RUN_TIME_VAR_TIME_DAY || tok == token::TOK_RUN_TIME_VAR_TIME_EPOCH || tok == token::TOK_RUN_TIME_VAR_TIME_HOUR || tok == token::TOK_RUN_TIME_VAR_TIME_MIN || tok == token::TOK_RUN_TIME_VAR_TIME_MON || tok == token::TOK_RUN_TIME_VAR_TIME_SEC || tok == token::TOK_RUN_TIME_VAR_TIME_WDAY || tok == token::TOK_RUN_TIME_VAR_TIME_YEAR || tok == token::TOK_VARIABLE || tok == token::TOK_DICT_ELEMENT || tok == token::TOK_DICT_ELEMENT_REGEXP); - } #endif + { + YY_ASSERT ((token::TOK_ACTION_ACCURACY <= tok && tok <= token::TOK_DICT_ELEMENT_REGEXP)); + } }; /// Build a parser object. seclang_parser (modsecurity::Parser::Driver& driver_yyarg); virtual ~seclang_parser (); +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + seclang_parser (const seclang_parser&) = delete; + /// Non copyable. + seclang_parser& operator= (const seclang_parser&) = delete; +#endif + /// Parse. An alias for parse (). /// \returns 0 iff parsing succeeded. int operator() (); @@ -1805,6 +2483,10 @@ switch (yytype) /// Report a syntax error. void error (const syntax_error& err); + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static std::string symbol_name (symbol_kind_type yysymbol); + // Implementation of make_symbol for each symbol type. #if 201103L <= YY_CPLUSPLUS static @@ -1821,6 +2503,36 @@ switch (yytype) return symbol_type (token::TOK_END, l); } #endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_YYerror (location_type l) + { + return symbol_type (token::TOK_YYerror, std::move (l)); + } +#else + static + symbol_type + make_YYerror (const location_type& l) + { + return symbol_type (token::TOK_YYerror, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_YYUNDEF (location_type l) + { + return symbol_type (token::TOK_YYUNDEF, std::move (l)); + } +#else + static + symbol_type + make_YYUNDEF (const location_type& l) + { + return symbol_type (token::TOK_YYUNDEF, l); + } +#endif #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -2166,6 +2878,21 @@ switch (yytype) return symbol_type (token::TOK_VARIABLE_REQUEST_COOKIES_NAMES, l); } #endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_VARIABLE_MULTIPART_PART_HEADERS (location_type l) + { + return symbol_type (token::TOK_VARIABLE_MULTIPART_PART_HEADERS, std::move (l)); + } +#else + static + symbol_type + make_VARIABLE_MULTIPART_PART_HEADERS (const location_type& l) + { + return symbol_type (token::TOK_VARIABLE_MULTIPART_PART_HEADERS, l); + } +#endif #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -3681,6 +4408,21 @@ switch (yytype) return symbol_type (token::TOK_OPERATOR_RX, l); } #endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_OPERATOR_RX_GLOBAL (location_type l) + { + return symbol_type (token::TOK_OPERATOR_RX_GLOBAL, std::move (l)); + } +#else + static + symbol_type + make_OPERATOR_RX_GLOBAL (const location_type& l) + { + return symbol_type (token::TOK_OPERATOR_RX_GLOBAL, l); + } +#endif #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -5796,6 +6538,36 @@ switch (yytype) return symbol_type (token::TOK_CONFIG_SEC_SENSOR_ID, v, l); } #endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONFIG_DIR_ARGS_LIMIT (std::string v, location_type l) + { + return symbol_type (token::TOK_CONFIG_DIR_ARGS_LIMIT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_CONFIG_DIR_ARGS_LIMIT (const std::string& v, const location_type& l) + { + return symbol_type (token::TOK_CONFIG_DIR_ARGS_LIMIT, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT (std::string v, location_type l) + { + return symbol_type (token::TOK_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT (const std::string& v, const location_type& l) + { + return symbol_type (token::TOK_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT, v, l); + } +#endif #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -6893,24 +7665,47 @@ switch (yytype) #endif - private: - /// This class is not copyable. - seclang_parser (const seclang_parser&); - seclang_parser& operator= (const seclang_parser&); + class context + { + public: + context (const seclang_parser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } - /// State numbers. - typedef int state_type; + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; + + private: + const seclang_parser& yyparser_; + const symbol_type& yyla_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + seclang_parser (const seclang_parser&); + /// Non copyable. + seclang_parser& operator= (const seclang_parser&); +#endif + + + /// Stored state numbers (used for stacks). + typedef short state_type; + + /// The arguments of the error message. + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; /// Generate an error message. - /// \param yystate the state where the error occurred. - /// \param yyla the lookahead token. - virtual std::string yysyntax_error_ (state_type yystate, - const symbol_type& yyla) const; - + /// \param yyctx the context in which the error occurred. + virtual std::string yysyntax_error_ (const context& yyctx) const; /// Compute post-reduction state. /// \param yystate the current state /// \param yysym the nonterminal to push on the stack - state_type yy_lr_goto_state_ (state_type yystate, int yysym); + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check @@ -6923,63 +7718,66 @@ switch (yytype) static const short yypact_ninf_; static const signed char yytable_ninf_; - /// Convert a scanner token number \a t to a symbol number. - static token_number_type yytranslate_ (token_type t); - - // Tables. - // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - // STATE-NUM. - static const short yypact_[]; - - // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - // Performed when YYTABLE does not specify something else to do. Zero - // means the default is an error. - static const unsigned short yydefact_[]; - - // YYPGOTO[NTERM-NUM]. - static const short yypgoto_[]; - - // YYDEFGOTO[NTERM-NUM]. - static const short yydefgoto_[]; - - // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - // positive, shift that token. If negative, reduce the rule whose - // number is the opposite. If YYTABLE_NINF, syntax error. - static const unsigned short yytable_[]; - - static const short yycheck_[]; - - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. - static const unsigned short yystos_[]; - - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. - static const unsigned short yyr1_[]; - - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. - static const unsigned char yyr2_[]; - + /// Convert a scanner token kind \a t to a symbol kind. + /// In theory \a t should be a token_kind_type, but character literals + /// are valid, yet not members of the token_type enum. + static symbol_kind_type yytranslate_ (int t); /// Convert the symbol name \a n to a form suitable for a diagnostic. - static std::string yytnamerr_ (const char *n); - + static std::string yytnamerr_ (const char *yystr); /// For a symbol, its name in clear. static const char* const yytname_[]; + + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const short yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const short yytable_[]; + + static const short yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const short yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const short yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + #if YYDEBUG - // YYRLINE[YYN] -- Source line where rule number YYN was defined. - static const unsigned short yyrline_[]; + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const short yyrline_[]; /// Report on the debug stream that the rule \a r is going to be reduced. - virtual void yy_reduce_print_ (int r); + virtual void yy_reduce_print_ (int r) const; /// Print the state stack on the debug stream. - virtual void yystack_print_ (); + virtual void yy_stack_print_ () const; /// Debugging level. int yydebug_; /// Debug stream. std::ostream* yycdebug_; - /// \brief Display a symbol type, value and location. + /// \brief Display a symbol kind, value and location. /// \param yyo The output stream. /// \param yysym The symbol. template @@ -7000,7 +7798,7 @@ switch (yytype) /// Default constructor. by_state () YY_NOEXCEPT; - /// The symbol type as needed by the constructor. + /// The symbol kind as needed by the constructor. typedef state_type kind_type; /// Constructor. @@ -7012,15 +7810,16 @@ switch (yytype) /// Record that this symbol is empty. void clear () YY_NOEXCEPT; - /// Steal the symbol type from \a that. + /// Steal the symbol kind from \a that. void move (by_state& that); - /// The (internal) type number (corresponding to \a state). - /// \a empty_symbol when empty. - symbol_number_type type_get () const YY_NOEXCEPT; + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; /// The state number used to denote an empty symbol. - enum { empty_state = -1 }; + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; /// The state. /// \a empty when empty. @@ -7042,6 +7841,10 @@ switch (yytype) /// Assignment, needed by push_back by some old implementations. /// Moves the contents of that. stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); #endif }; @@ -7051,48 +7854,38 @@ switch (yytype) { public: // Hide our reversed order. - typedef typename S::reverse_iterator iterator; - typedef typename S::const_reverse_iterator const_iterator; + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; stack (size_type n = 200) : seq_ (n) {} +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + /// Random access. /// /// Index 0 returns the topmost element. - T& - operator[] (size_type i) + const T& + operator[] (index_type i) const { - return seq_[size () - 1 - i]; + return seq_[size_type (size () - 1 - i)]; } /// Random access. /// /// Index 0 returns the topmost element. T& - operator[] (int i) + operator[] (index_type i) { - return operator[] (size_type (i)); - } - - /// Random access. - /// - /// Index 0 returns the topmost element. - const T& - operator[] (size_type i) const - { - return seq_[size () - 1 - i]; - } - - /// Random access. - /// - /// Index 0 returns the topmost element. - const T& - operator[] (int i) const - { - return operator[] (size_type (i)); + return seq_[size_type (size () - 1 - i)]; } /// Steal the contents of \a t. @@ -7107,7 +7900,7 @@ switch (yytype) /// Pop elements from the stack. void - pop (int n = 1) YY_NOEXCEPT + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT { for (; 0 < n; --n) seq_.pop_back (); @@ -7121,49 +7914,53 @@ switch (yytype) } /// Number of elements on the stack. - size_type + index_type size () const YY_NOEXCEPT { - return seq_.size (); + return index_type (seq_.size ()); } /// Iterator on top of the stack (going downwards). const_iterator begin () const YY_NOEXCEPT { - return seq_.rbegin (); + return seq_.begin (); } /// Bottom of the stack. const_iterator end () const YY_NOEXCEPT { - return seq_.rend (); + return seq_.end (); } /// Present a slice of the top of a stack. class slice { public: - slice (const stack& stack, int range) + slice (const stack& stack, index_type range) : stack_ (stack) , range_ (range) {} const T& - operator[] (int i) const + operator[] (index_type i) const { return stack_[range_ - i]; } private: const stack& stack_; - int range_; + index_type range_; }; private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. stack (const stack&); + /// Non copyable. stack& operator= (const stack&); +#endif /// The wrapped container. S seq_; }; @@ -7196,28 +7993,25 @@ switch (yytype) /// Constants. enum { - yyeof_ = 0, - yylast_ = 3304, ///< Last index in yytable_. + yylast_ = 3344, ///< Last index in yytable_. yynnts_ = 16, ///< Number of nonterminal symbols. - yyfinal_ = 336, ///< Termination state number. - yyterror_ = 1, - yyerrcode_ = 256, - yyntokens_ = 341 ///< Number of tokens. + yyfinal_ = 339 ///< Termination state number. }; // User arguments. modsecurity::Parser::Driver& driver; + }; inline - seclang_parser::token_number_type - seclang_parser::yytranslate_ (token_type t) + seclang_parser::symbol_kind_type + seclang_parser::yytranslate_ (int t) { // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // TOKEN-NUM as returned by yylex. static - const token_number_type + const short translate_table[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -7279,497 +8073,255 @@ switch (yytype) 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340 + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344 }; - const unsigned user_token_number_max_ = 595; - const token_number_type undef_token_ = 2; + // Last valid token kind. + const int code_max = 599; - if (static_cast (t) <= yyeof_) - return yyeof_; - else if (static_cast (t) <= user_token_number_max_) - return translate_table[t]; + if (t <= 0) + return symbol_kind::S_YYEOF; + else if (t <= code_max) + return YY_CAST (symbol_kind_type, translate_table[t]); else - return undef_token_; + return symbol_kind::S_YYUNDEF; } // basic_symbol. -#if 201103L <= YY_CPLUSPLUS - template - seclang_parser::basic_symbol::basic_symbol (basic_symbol&& that) - : Base (std::move (that)) - , value () - , location (std::move (that.location)) - { - switch (this->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_REQ_BODY" - case 269: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" - case 270: // "CONFIG_DIR_REQ_BODY_LIMIT" - case 271: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" - case 272: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" - case 273: // "CONFIG_DIR_RES_BODY" - case 274: // "CONFIG_DIR_RES_BODY_LIMIT" - case 275: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" - case 276: // "CONFIG_SEC_RULE_INHERITANCE" - case 277: // "CONFIG_SEC_RULE_PERF_TIME" - case 278: // "CONFIG_DIR_RULE_ENG" - case 279: // "CONFIG_DIR_SEC_ACTION" - case 280: // "CONFIG_DIR_SEC_DEFAULT_ACTION" - case 281: // "CONFIG_DIR_SEC_MARKER" - case 282: // "CONFIG_DIR_UNICODE_MAP_FILE" - case 283: // "CONFIG_DIR_UNICODE_CODE_PAGE" - case 284: // "CONFIG_SEC_COLLECTION_TIMEOUT" - case 285: // "CONFIG_SEC_HTTP_BLKEY" - case 286: // "CONFIG_SEC_INTERCEPT_ON_ERROR" - case 287: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" - case 288: // "CONFIG_SEC_RULE_REMOVE_BY_ID" - case 289: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" - case 290: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" - case 291: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" - case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" - case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" - case 294: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" - case 295: // "CONFIG_UPDLOAD_KEEP_FILES" - case 296: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" - case 297: // "CONFIG_UPLOAD_DIR" - case 298: // "CONFIG_UPLOAD_FILE_LIMIT" - case 299: // "CONFIG_UPLOAD_FILE_MODE" - case 300: // "CONFIG_VALUE_ABORT" - case 301: // "CONFIG_VALUE_DETC" - case 302: // "CONFIG_VALUE_HTTPS" - case 303: // "CONFIG_VALUE_OFF" - case 304: // "CONFIG_VALUE_ON" - case 305: // "CONFIG_VALUE_PARALLEL" - case 306: // "CONFIG_VALUE_PROCESS_PARTIAL" - case 307: // "CONFIG_VALUE_REJECT" - case 308: // "CONFIG_VALUE_RELEVANT_ONLY" - case 309: // "CONFIG_VALUE_SERIAL" - case 310: // "CONFIG_VALUE_WARN" - case 311: // "CONFIG_XML_EXTERNAL_ENTITY" - case 312: // "CONGIG_DIR_RESPONSE_BODY_MP" - case 313: // "CONGIG_DIR_SEC_ARG_SEP" - case 314: // "CONGIG_DIR_SEC_COOKIE_FORMAT" - case 315: // "CONFIG_SEC_COOKIEV0_SEPARATOR" - case 316: // "CONGIG_DIR_SEC_DATA_DIR" - case 317: // "CONGIG_DIR_SEC_STATUS_ENGINE" - case 318: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" - case 319: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" - case 320: // "CONGIG_DIR_SEC_TMP_DIR" - case 321: // "DIRECTIVE" - case 322: // "DIRECTIVE_SECRULESCRIPT" - case 323: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" - case 324: // "QUOTATION_MARK" - case 325: // "RUN_TIME_VAR_BLD" - case 326: // "RUN_TIME_VAR_DUR" - case 327: // "RUN_TIME_VAR_HSV" - case 328: // "RUN_TIME_VAR_REMOTE_USER" - case 329: // "RUN_TIME_VAR_TIME" - case 330: // "RUN_TIME_VAR_TIME_DAY" - case 331: // "RUN_TIME_VAR_TIME_EPOCH" - case 332: // "RUN_TIME_VAR_TIME_HOUR" - case 333: // "RUN_TIME_VAR_TIME_MIN" - case 334: // "RUN_TIME_VAR_TIME_MON" - case 335: // "RUN_TIME_VAR_TIME_SEC" - case 336: // "RUN_TIME_VAR_TIME_WDAY" - case 337: // "RUN_TIME_VAR_TIME_YEAR" - case 338: // "VARIABLE" - case 339: // "Dictionary element" - case 340: // "Dictionary element, selected by regexp" - value.move< std::string > (std::move (that.value)); - break; - - case 347: // op - case 348: // op_before_init - value.move< std::unique_ptr > (std::move (that.value)); - break; - - case 356: // run_time_string - value.move< std::unique_ptr > (std::move (that.value)); - break; - - case 353: // var - value.move< std::unique_ptr > (std::move (that.value)); - break; - - case 354: // act - case 355: // setvar_action - value.move< std::unique_ptr > (std::move (that.value)); - break; - - case 350: // variables - case 351: // variables_pre_process - case 352: // variables_may_be_quoted - value.move< std::unique_ptr > > > (std::move (that.value)); - break; - - case 345: // actions - case 346: // actions_may_quoted - value.move< std::unique_ptr > > > (std::move (that.value)); - break; - - default: - break; - } - - } -#endif - template seclang_parser::basic_symbol::basic_symbol (const basic_symbol& that) : Base (that) , value () , location (that.location) { - switch (this->type_get ()) + switch (this->kind ()) { - 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_REQ_BODY" - case 269: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" - case 270: // "CONFIG_DIR_REQ_BODY_LIMIT" - case 271: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" - case 272: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" - case 273: // "CONFIG_DIR_RES_BODY" - case 274: // "CONFIG_DIR_RES_BODY_LIMIT" - case 275: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" - case 276: // "CONFIG_SEC_RULE_INHERITANCE" - case 277: // "CONFIG_SEC_RULE_PERF_TIME" - case 278: // "CONFIG_DIR_RULE_ENG" - case 279: // "CONFIG_DIR_SEC_ACTION" - case 280: // "CONFIG_DIR_SEC_DEFAULT_ACTION" - case 281: // "CONFIG_DIR_SEC_MARKER" - case 282: // "CONFIG_DIR_UNICODE_MAP_FILE" - case 283: // "CONFIG_DIR_UNICODE_CODE_PAGE" - case 284: // "CONFIG_SEC_COLLECTION_TIMEOUT" - case 285: // "CONFIG_SEC_HTTP_BLKEY" - case 286: // "CONFIG_SEC_INTERCEPT_ON_ERROR" - case 287: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" - case 288: // "CONFIG_SEC_RULE_REMOVE_BY_ID" - case 289: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" - case 290: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" - case 291: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" - case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" - case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" - case 294: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" - case 295: // "CONFIG_UPDLOAD_KEEP_FILES" - case 296: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" - case 297: // "CONFIG_UPLOAD_DIR" - case 298: // "CONFIG_UPLOAD_FILE_LIMIT" - case 299: // "CONFIG_UPLOAD_FILE_MODE" - case 300: // "CONFIG_VALUE_ABORT" - case 301: // "CONFIG_VALUE_DETC" - case 302: // "CONFIG_VALUE_HTTPS" - case 303: // "CONFIG_VALUE_OFF" - case 304: // "CONFIG_VALUE_ON" - case 305: // "CONFIG_VALUE_PARALLEL" - case 306: // "CONFIG_VALUE_PROCESS_PARTIAL" - case 307: // "CONFIG_VALUE_REJECT" - case 308: // "CONFIG_VALUE_RELEVANT_ONLY" - case 309: // "CONFIG_VALUE_SERIAL" - case 310: // "CONFIG_VALUE_WARN" - case 311: // "CONFIG_XML_EXTERNAL_ENTITY" - case 312: // "CONGIG_DIR_RESPONSE_BODY_MP" - case 313: // "CONGIG_DIR_SEC_ARG_SEP" - case 314: // "CONGIG_DIR_SEC_COOKIE_FORMAT" - case 315: // "CONFIG_SEC_COOKIEV0_SEPARATOR" - case 316: // "CONGIG_DIR_SEC_DATA_DIR" - case 317: // "CONGIG_DIR_SEC_STATUS_ENGINE" - case 318: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" - case 319: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" - case 320: // "CONGIG_DIR_SEC_TMP_DIR" - case 321: // "DIRECTIVE" - case 322: // "DIRECTIVE_SECRULESCRIPT" - case 323: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" - case 324: // "QUOTATION_MARK" - case 325: // "RUN_TIME_VAR_BLD" - case 326: // "RUN_TIME_VAR_DUR" - case 327: // "RUN_TIME_VAR_HSV" - case 328: // "RUN_TIME_VAR_REMOTE_USER" - case 329: // "RUN_TIME_VAR_TIME" - case 330: // "RUN_TIME_VAR_TIME_DAY" - case 331: // "RUN_TIME_VAR_TIME_EPOCH" - case 332: // "RUN_TIME_VAR_TIME_HOUR" - case 333: // "RUN_TIME_VAR_TIME_MIN" - case 334: // "RUN_TIME_VAR_TIME_MON" - case 335: // "RUN_TIME_VAR_TIME_SEC" - case 336: // "RUN_TIME_VAR_TIME_WDAY" - case 337: // "RUN_TIME_VAR_TIME_YEAR" - case 338: // "VARIABLE" - case 339: // "Dictionary element" - case 340: // "Dictionary element, selected by regexp" + case symbol_kind::S_ACTION_ACCURACY: // "Accuracy" + case symbol_kind::S_ACTION_ALLOW: // "Allow" + case symbol_kind::S_ACTION_APPEND: // "Append" + case symbol_kind::S_ACTION_AUDIT_LOG: // "AuditLog" + case symbol_kind::S_ACTION_BLOCK: // "Block" + case symbol_kind::S_ACTION_CAPTURE: // "Capture" + case symbol_kind::S_ACTION_CHAIN: // "Chain" + case symbol_kind::S_ACTION_CTL_AUDIT_ENGINE: // "ACTION_CTL_AUDIT_ENGINE" + case symbol_kind::S_ACTION_CTL_AUDIT_LOG_PARTS: // "ACTION_CTL_AUDIT_LOG_PARTS" + case symbol_kind::S_ACTION_CTL_BDY_JSON: // "ACTION_CTL_BDY_JSON" + case symbol_kind::S_ACTION_CTL_BDY_XML: // "ACTION_CTL_BDY_XML" + case symbol_kind::S_ACTION_CTL_BDY_URLENCODED: // "ACTION_CTL_BDY_URLENCODED" + case symbol_kind::S_ACTION_CTL_FORCE_REQ_BODY_VAR: // "ACTION_CTL_FORCE_REQ_BODY_VAR" + case symbol_kind::S_ACTION_CTL_REQUEST_BODY_ACCESS: // "ACTION_CTL_REQUEST_BODY_ACCESS" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_ID: // "ACTION_CTL_RULE_REMOVE_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_TAG: // "ACTION_CTL_RULE_REMOVE_BY_TAG" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + case symbol_kind::S_ACTION_DENY: // "Deny" + case symbol_kind::S_ACTION_DEPRECATE_VAR: // "DeprecateVar" + case symbol_kind::S_ACTION_DROP: // "Drop" + case symbol_kind::S_ACTION_EXEC: // "Exec" + case symbol_kind::S_ACTION_EXPIRE_VAR: // "ExpireVar" + case symbol_kind::S_ACTION_ID: // "Id" + case symbol_kind::S_ACTION_INITCOL: // "InitCol" + case symbol_kind::S_ACTION_LOG: // "Log" + case symbol_kind::S_ACTION_LOG_DATA: // "LogData" + case symbol_kind::S_ACTION_MATURITY: // "Maturity" + case symbol_kind::S_ACTION_MSG: // "Msg" + case symbol_kind::S_ACTION_MULTI_MATCH: // "MultiMatch" + case symbol_kind::S_ACTION_NO_AUDIT_LOG: // "NoAuditLog" + case symbol_kind::S_ACTION_NO_LOG: // "NoLog" + case symbol_kind::S_ACTION_PASS: // "Pass" + case symbol_kind::S_ACTION_PAUSE: // "Pause" + case symbol_kind::S_ACTION_PHASE: // "Phase" + case symbol_kind::S_ACTION_PREPEND: // "Prepend" + case symbol_kind::S_ACTION_PROXY: // "Proxy" + case symbol_kind::S_ACTION_REDIRECT: // "Redirect" + case symbol_kind::S_ACTION_REV: // "Rev" + case symbol_kind::S_ACTION_SANITISE_ARG: // "SanitiseArg" + case symbol_kind::S_ACTION_SANITISE_MATCHED: // "SanitiseMatched" + case symbol_kind::S_ACTION_SANITISE_MATCHED_BYTES: // "SanitiseMatchedBytes" + case symbol_kind::S_ACTION_SANITISE_REQUEST_HEADER: // "SanitiseRequestHeader" + case symbol_kind::S_ACTION_SANITISE_RESPONSE_HEADER: // "SanitiseResponseHeader" + case symbol_kind::S_ACTION_SETENV: // "SetEnv" + case symbol_kind::S_ACTION_SETRSC: // "SetRsc" + case symbol_kind::S_ACTION_SETSID: // "SetSid" + case symbol_kind::S_ACTION_SETUID: // "SetUID" + case symbol_kind::S_ACTION_SEVERITY: // "Severity" + case symbol_kind::S_ACTION_SKIP: // "Skip" + case symbol_kind::S_ACTION_SKIP_AFTER: // "SkipAfter" + case symbol_kind::S_ACTION_STATUS: // "Status" + case symbol_kind::S_ACTION_TAG: // "Tag" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_ENCODE: // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE: // "ACTION_TRANSFORMATION_BASE_64_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + case symbol_kind::S_ACTION_TRANSFORMATION_CMD_LINE: // "ACTION_TRANSFORMATION_CMD_LINE" + case symbol_kind::S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_CSS_DECODE: // "ACTION_TRANSFORMATION_CSS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_ENCODE: // "ACTION_TRANSFORMATION_HEX_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_DECODE: // "ACTION_TRANSFORMATION_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_JS_DECODE: // "ACTION_TRANSFORMATION_JS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_LENGTH: // "ACTION_TRANSFORMATION_LENGTH" + case symbol_kind::S_ACTION_TRANSFORMATION_LOWERCASE: // "ACTION_TRANSFORMATION_LOWERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_MD5: // "ACTION_TRANSFORMATION_MD5" + case symbol_kind::S_ACTION_TRANSFORMATION_NONE: // "ACTION_TRANSFORMATION_NONE" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH: // "ACTION_TRANSFORMATION_NORMALISE_PATH" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_NULLS: // "ACTION_TRANSFORMATION_REMOVE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_COMMENTS: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_NULLS: // "ACTION_TRANSFORMATION_REPLACE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_SHA1: // "ACTION_TRANSFORMATION_SHA1" + case symbol_kind::S_ACTION_TRANSFORMATION_SQL_HEX_DECODE: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM: // "ACTION_TRANSFORMATION_TRIM" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_LEFT: // "ACTION_TRANSFORMATION_TRIM_LEFT" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_RIGHT: // "ACTION_TRANSFORMATION_TRIM_RIGHT" + case symbol_kind::S_ACTION_TRANSFORMATION_UPPERCASE: // "ACTION_TRANSFORMATION_UPPERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_ENCODE: // "ACTION_TRANSFORMATION_URL_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE: // "ACTION_TRANSFORMATION_URL_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE_UNI: // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + case symbol_kind::S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + case symbol_kind::S_ACTION_VER: // "Ver" + case symbol_kind::S_ACTION_XMLNS: // "xmlns" + case symbol_kind::S_CONFIG_COMPONENT_SIG: // "CONFIG_COMPONENT_SIG" + case symbol_kind::S_CONFIG_CONN_ENGINE: // "CONFIG_CONN_ENGINE" + case symbol_kind::S_CONFIG_SEC_ARGUMENT_SEPARATOR: // "CONFIG_SEC_ARGUMENT_SEPARATOR" + case symbol_kind::S_CONFIG_SEC_WEB_APP_ID: // "CONFIG_SEC_WEB_APP_ID" + case symbol_kind::S_CONFIG_SEC_SERVER_SIG: // "CONFIG_SEC_SERVER_SIG" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR: // "CONFIG_DIR_AUDIT_DIR" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR_MOD: // "CONFIG_DIR_AUDIT_DIR_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_ENG: // "CONFIG_DIR_AUDIT_ENG" + case symbol_kind::S_CONFIG_DIR_AUDIT_FLE_MOD: // "CONFIG_DIR_AUDIT_FLE_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG: // "CONFIG_DIR_AUDIT_LOG" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG2: // "CONFIG_DIR_AUDIT_LOG2" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG_P: // "CONFIG_DIR_AUDIT_LOG_P" + case symbol_kind::S_CONFIG_DIR_AUDIT_STS: // "CONFIG_DIR_AUDIT_STS" + case symbol_kind::S_CONFIG_DIR_AUDIT_TPE: // "CONFIG_DIR_AUDIT_TPE" + case symbol_kind::S_CONFIG_DIR_DEBUG_LOG: // "CONFIG_DIR_DEBUG_LOG" + case symbol_kind::S_CONFIG_DIR_DEBUG_LVL: // "CONFIG_DIR_DEBUG_LVL" + case symbol_kind::S_CONFIG_SEC_CACHE_TRANSFORMATIONS: // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + case symbol_kind::S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + case symbol_kind::S_CONFIG_SEC_HASH_ENGINE: // "CONFIG_SEC_HASH_ENGINE" + case symbol_kind::S_CONFIG_SEC_HASH_KEY: // "CONFIG_SEC_HASH_KEY" + case symbol_kind::S_CONFIG_SEC_HASH_PARAM: // "CONFIG_SEC_HASH_PARAM" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_RX: // "CONFIG_SEC_HASH_METHOD_RX" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_PM: // "CONFIG_SEC_HASH_METHOD_PM" + case symbol_kind::S_CONFIG_SEC_CHROOT_DIR: // "CONFIG_SEC_CHROOT_DIR" + case symbol_kind::S_CONFIG_DIR_GEO_DB: // "CONFIG_DIR_GEO_DB" + case symbol_kind::S_CONFIG_DIR_GSB_DB: // "CONFIG_DIR_GSB_DB" + case symbol_kind::S_CONFIG_SEC_GUARDIAN_LOG: // "CONFIG_SEC_GUARDIAN_LOG" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT: // "CONFIG_DIR_PCRE_MATCH_LIMIT" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + case symbol_kind::S_CONFIG_SEC_CONN_R_STATE_LIMIT: // "CONFIG_SEC_CONN_R_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_CONN_W_STATE_LIMIT: // "CONFIG_SEC_CONN_W_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_SENSOR_ID: // "CONFIG_SEC_SENSOR_ID" + case symbol_kind::S_CONFIG_DIR_ARGS_LIMIT: // "CONFIG_DIR_ARGS_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT: // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY: // "CONFIG_DIR_REQ_BODY" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT: // "CONFIG_DIR_REQ_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY: // "CONFIG_DIR_RES_BODY" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT: // "CONFIG_DIR_RES_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT_ACTION: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_INHERITANCE: // "CONFIG_SEC_RULE_INHERITANCE" + case symbol_kind::S_CONFIG_SEC_RULE_PERF_TIME: // "CONFIG_SEC_RULE_PERF_TIME" + case symbol_kind::S_CONFIG_DIR_RULE_ENG: // "CONFIG_DIR_RULE_ENG" + case symbol_kind::S_CONFIG_DIR_SEC_ACTION: // "CONFIG_DIR_SEC_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_DEFAULT_ACTION: // "CONFIG_DIR_SEC_DEFAULT_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_MARKER: // "CONFIG_DIR_SEC_MARKER" + case symbol_kind::S_CONFIG_DIR_UNICODE_MAP_FILE: // "CONFIG_DIR_UNICODE_MAP_FILE" + case symbol_kind::S_CONFIG_DIR_UNICODE_CODE_PAGE: // "CONFIG_DIR_UNICODE_CODE_PAGE" + case symbol_kind::S_CONFIG_SEC_COLLECTION_TIMEOUT: // "CONFIG_SEC_COLLECTION_TIMEOUT" + case symbol_kind::S_CONFIG_SEC_HTTP_BLKEY: // "CONFIG_SEC_HTTP_BLKEY" + case symbol_kind::S_CONFIG_SEC_INTERCEPT_ON_ERROR: // "CONFIG_SEC_INTERCEPT_ON_ERROR" + case symbol_kind::S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_ID: // "CONFIG_SEC_RULE_REMOVE_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_MSG: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_TAG: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + case symbol_kind::S_CONFIG_UPDLOAD_KEEP_FILES: // "CONFIG_UPDLOAD_KEEP_FILES" + case symbol_kind::S_CONFIG_UPDLOAD_SAVE_TMP_FILES: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + case symbol_kind::S_CONFIG_UPLOAD_DIR: // "CONFIG_UPLOAD_DIR" + case symbol_kind::S_CONFIG_UPLOAD_FILE_LIMIT: // "CONFIG_UPLOAD_FILE_LIMIT" + case symbol_kind::S_CONFIG_UPLOAD_FILE_MODE: // "CONFIG_UPLOAD_FILE_MODE" + case symbol_kind::S_CONFIG_VALUE_ABORT: // "CONFIG_VALUE_ABORT" + case symbol_kind::S_CONFIG_VALUE_DETC: // "CONFIG_VALUE_DETC" + case symbol_kind::S_CONFIG_VALUE_HTTPS: // "CONFIG_VALUE_HTTPS" + case symbol_kind::S_CONFIG_VALUE_OFF: // "CONFIG_VALUE_OFF" + case symbol_kind::S_CONFIG_VALUE_ON: // "CONFIG_VALUE_ON" + case symbol_kind::S_CONFIG_VALUE_PARALLEL: // "CONFIG_VALUE_PARALLEL" + case symbol_kind::S_CONFIG_VALUE_PROCESS_PARTIAL: // "CONFIG_VALUE_PROCESS_PARTIAL" + case symbol_kind::S_CONFIG_VALUE_REJECT: // "CONFIG_VALUE_REJECT" + case symbol_kind::S_CONFIG_VALUE_RELEVANT_ONLY: // "CONFIG_VALUE_RELEVANT_ONLY" + case symbol_kind::S_CONFIG_VALUE_SERIAL: // "CONFIG_VALUE_SERIAL" + case symbol_kind::S_CONFIG_VALUE_WARN: // "CONFIG_VALUE_WARN" + case symbol_kind::S_CONFIG_XML_EXTERNAL_ENTITY: // "CONFIG_XML_EXTERNAL_ENTITY" + case symbol_kind::S_CONGIG_DIR_RESPONSE_BODY_MP: // "CONGIG_DIR_RESPONSE_BODY_MP" + case symbol_kind::S_CONGIG_DIR_SEC_ARG_SEP: // "CONGIG_DIR_SEC_ARG_SEP" + case symbol_kind::S_CONGIG_DIR_SEC_COOKIE_FORMAT: // "CONGIG_DIR_SEC_COOKIE_FORMAT" + case symbol_kind::S_CONFIG_SEC_COOKIEV0_SEPARATOR: // "CONFIG_SEC_COOKIEV0_SEPARATOR" + case symbol_kind::S_CONGIG_DIR_SEC_DATA_DIR: // "CONGIG_DIR_SEC_DATA_DIR" + case symbol_kind::S_CONGIG_DIR_SEC_STATUS_ENGINE: // "CONGIG_DIR_SEC_STATUS_ENGINE" + case symbol_kind::S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + case symbol_kind::S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + case symbol_kind::S_CONGIG_DIR_SEC_TMP_DIR: // "CONGIG_DIR_SEC_TMP_DIR" + case symbol_kind::S_DIRECTIVE: // "DIRECTIVE" + case symbol_kind::S_DIRECTIVE_SECRULESCRIPT: // "DIRECTIVE_SECRULESCRIPT" + case symbol_kind::S_FREE_TEXT_QUOTE_MACRO_EXPANSION: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + case symbol_kind::S_QUOTATION_MARK: // "QUOTATION_MARK" + case symbol_kind::S_RUN_TIME_VAR_BLD: // "RUN_TIME_VAR_BLD" + case symbol_kind::S_RUN_TIME_VAR_DUR: // "RUN_TIME_VAR_DUR" + case symbol_kind::S_RUN_TIME_VAR_HSV: // "RUN_TIME_VAR_HSV" + case symbol_kind::S_RUN_TIME_VAR_REMOTE_USER: // "RUN_TIME_VAR_REMOTE_USER" + case symbol_kind::S_RUN_TIME_VAR_TIME: // "RUN_TIME_VAR_TIME" + case symbol_kind::S_RUN_TIME_VAR_TIME_DAY: // "RUN_TIME_VAR_TIME_DAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_EPOCH: // "RUN_TIME_VAR_TIME_EPOCH" + case symbol_kind::S_RUN_TIME_VAR_TIME_HOUR: // "RUN_TIME_VAR_TIME_HOUR" + case symbol_kind::S_RUN_TIME_VAR_TIME_MIN: // "RUN_TIME_VAR_TIME_MIN" + case symbol_kind::S_RUN_TIME_VAR_TIME_MON: // "RUN_TIME_VAR_TIME_MON" + case symbol_kind::S_RUN_TIME_VAR_TIME_SEC: // "RUN_TIME_VAR_TIME_SEC" + case symbol_kind::S_RUN_TIME_VAR_TIME_WDAY: // "RUN_TIME_VAR_TIME_WDAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_YEAR: // "RUN_TIME_VAR_TIME_YEAR" + case symbol_kind::S_VARIABLE: // "VARIABLE" + case symbol_kind::S_DICT_ELEMENT: // "Dictionary element" + case symbol_kind::S_DICT_ELEMENT_REGEXP: // "Dictionary element, selected by regexp" value.copy< std::string > (YY_MOVE (that.value)); break; - case 347: // op - case 348: // op_before_init + case symbol_kind::S_op: // op + case symbol_kind::S_op_before_init: // op_before_init value.copy< std::unique_ptr > (YY_MOVE (that.value)); break; - case 356: // run_time_string + case symbol_kind::S_run_time_string: // run_time_string value.copy< std::unique_ptr > (YY_MOVE (that.value)); break; - case 353: // var + case symbol_kind::S_var: // var value.copy< std::unique_ptr > (YY_MOVE (that.value)); break; - case 354: // act - case 355: // setvar_action + case symbol_kind::S_act: // act + case symbol_kind::S_setvar_action: // setvar_action value.copy< std::unique_ptr > (YY_MOVE (that.value)); break; - case 350: // variables - case 351: // variables_pre_process - case 352: // variables_may_be_quoted + case symbol_kind::S_variables: // variables + case symbol_kind::S_variables_pre_process: // variables_pre_process + case symbol_kind::S_variables_may_be_quoted: // variables_may_be_quoted value.copy< std::unique_ptr > > > (YY_MOVE (that.value)); break; - case 345: // actions - case 346: // actions_may_quoted + case symbol_kind::S_actions: // actions + case symbol_kind::S_actions_may_quoted: // actions_may_quoted value.copy< std::unique_ptr > > > (YY_MOVE (that.value)); break; @@ -7781,11 +8333,18 @@ switch (yytype) + template + seclang_parser::symbol_kind_type + seclang_parser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + template bool seclang_parser::basic_symbol::empty () const YY_NOEXCEPT { - return Base::type_get () == empty_symbol; + return this->kind () == symbol_kind::S_YYEMPTY; } template @@ -7793,233 +8352,235 @@ switch (yytype) seclang_parser::basic_symbol::move (basic_symbol& s) { super_type::move (s); - switch (this->type_get ()) + switch (this->kind ()) { - 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_REQ_BODY" - case 269: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" - case 270: // "CONFIG_DIR_REQ_BODY_LIMIT" - case 271: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" - case 272: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" - case 273: // "CONFIG_DIR_RES_BODY" - case 274: // "CONFIG_DIR_RES_BODY_LIMIT" - case 275: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" - case 276: // "CONFIG_SEC_RULE_INHERITANCE" - case 277: // "CONFIG_SEC_RULE_PERF_TIME" - case 278: // "CONFIG_DIR_RULE_ENG" - case 279: // "CONFIG_DIR_SEC_ACTION" - case 280: // "CONFIG_DIR_SEC_DEFAULT_ACTION" - case 281: // "CONFIG_DIR_SEC_MARKER" - case 282: // "CONFIG_DIR_UNICODE_MAP_FILE" - case 283: // "CONFIG_DIR_UNICODE_CODE_PAGE" - case 284: // "CONFIG_SEC_COLLECTION_TIMEOUT" - case 285: // "CONFIG_SEC_HTTP_BLKEY" - case 286: // "CONFIG_SEC_INTERCEPT_ON_ERROR" - case 287: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" - case 288: // "CONFIG_SEC_RULE_REMOVE_BY_ID" - case 289: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" - case 290: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" - case 291: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" - case 292: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" - case 293: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" - case 294: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" - case 295: // "CONFIG_UPDLOAD_KEEP_FILES" - case 296: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" - case 297: // "CONFIG_UPLOAD_DIR" - case 298: // "CONFIG_UPLOAD_FILE_LIMIT" - case 299: // "CONFIG_UPLOAD_FILE_MODE" - case 300: // "CONFIG_VALUE_ABORT" - case 301: // "CONFIG_VALUE_DETC" - case 302: // "CONFIG_VALUE_HTTPS" - case 303: // "CONFIG_VALUE_OFF" - case 304: // "CONFIG_VALUE_ON" - case 305: // "CONFIG_VALUE_PARALLEL" - case 306: // "CONFIG_VALUE_PROCESS_PARTIAL" - case 307: // "CONFIG_VALUE_REJECT" - case 308: // "CONFIG_VALUE_RELEVANT_ONLY" - case 309: // "CONFIG_VALUE_SERIAL" - case 310: // "CONFIG_VALUE_WARN" - case 311: // "CONFIG_XML_EXTERNAL_ENTITY" - case 312: // "CONGIG_DIR_RESPONSE_BODY_MP" - case 313: // "CONGIG_DIR_SEC_ARG_SEP" - case 314: // "CONGIG_DIR_SEC_COOKIE_FORMAT" - case 315: // "CONFIG_SEC_COOKIEV0_SEPARATOR" - case 316: // "CONGIG_DIR_SEC_DATA_DIR" - case 317: // "CONGIG_DIR_SEC_STATUS_ENGINE" - case 318: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" - case 319: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" - case 320: // "CONGIG_DIR_SEC_TMP_DIR" - case 321: // "DIRECTIVE" - case 322: // "DIRECTIVE_SECRULESCRIPT" - case 323: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" - case 324: // "QUOTATION_MARK" - case 325: // "RUN_TIME_VAR_BLD" - case 326: // "RUN_TIME_VAR_DUR" - case 327: // "RUN_TIME_VAR_HSV" - case 328: // "RUN_TIME_VAR_REMOTE_USER" - case 329: // "RUN_TIME_VAR_TIME" - case 330: // "RUN_TIME_VAR_TIME_DAY" - case 331: // "RUN_TIME_VAR_TIME_EPOCH" - case 332: // "RUN_TIME_VAR_TIME_HOUR" - case 333: // "RUN_TIME_VAR_TIME_MIN" - case 334: // "RUN_TIME_VAR_TIME_MON" - case 335: // "RUN_TIME_VAR_TIME_SEC" - case 336: // "RUN_TIME_VAR_TIME_WDAY" - case 337: // "RUN_TIME_VAR_TIME_YEAR" - case 338: // "VARIABLE" - case 339: // "Dictionary element" - case 340: // "Dictionary element, selected by regexp" + case symbol_kind::S_ACTION_ACCURACY: // "Accuracy" + case symbol_kind::S_ACTION_ALLOW: // "Allow" + case symbol_kind::S_ACTION_APPEND: // "Append" + case symbol_kind::S_ACTION_AUDIT_LOG: // "AuditLog" + case symbol_kind::S_ACTION_BLOCK: // "Block" + case symbol_kind::S_ACTION_CAPTURE: // "Capture" + case symbol_kind::S_ACTION_CHAIN: // "Chain" + case symbol_kind::S_ACTION_CTL_AUDIT_ENGINE: // "ACTION_CTL_AUDIT_ENGINE" + case symbol_kind::S_ACTION_CTL_AUDIT_LOG_PARTS: // "ACTION_CTL_AUDIT_LOG_PARTS" + case symbol_kind::S_ACTION_CTL_BDY_JSON: // "ACTION_CTL_BDY_JSON" + case symbol_kind::S_ACTION_CTL_BDY_XML: // "ACTION_CTL_BDY_XML" + case symbol_kind::S_ACTION_CTL_BDY_URLENCODED: // "ACTION_CTL_BDY_URLENCODED" + case symbol_kind::S_ACTION_CTL_FORCE_REQ_BODY_VAR: // "ACTION_CTL_FORCE_REQ_BODY_VAR" + case symbol_kind::S_ACTION_CTL_REQUEST_BODY_ACCESS: // "ACTION_CTL_REQUEST_BODY_ACCESS" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_ID: // "ACTION_CTL_RULE_REMOVE_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_BY_TAG: // "ACTION_CTL_RULE_REMOVE_BY_TAG" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID" + case symbol_kind::S_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG" + case symbol_kind::S_ACTION_DENY: // "Deny" + case symbol_kind::S_ACTION_DEPRECATE_VAR: // "DeprecateVar" + case symbol_kind::S_ACTION_DROP: // "Drop" + case symbol_kind::S_ACTION_EXEC: // "Exec" + case symbol_kind::S_ACTION_EXPIRE_VAR: // "ExpireVar" + case symbol_kind::S_ACTION_ID: // "Id" + case symbol_kind::S_ACTION_INITCOL: // "InitCol" + case symbol_kind::S_ACTION_LOG: // "Log" + case symbol_kind::S_ACTION_LOG_DATA: // "LogData" + case symbol_kind::S_ACTION_MATURITY: // "Maturity" + case symbol_kind::S_ACTION_MSG: // "Msg" + case symbol_kind::S_ACTION_MULTI_MATCH: // "MultiMatch" + case symbol_kind::S_ACTION_NO_AUDIT_LOG: // "NoAuditLog" + case symbol_kind::S_ACTION_NO_LOG: // "NoLog" + case symbol_kind::S_ACTION_PASS: // "Pass" + case symbol_kind::S_ACTION_PAUSE: // "Pause" + case symbol_kind::S_ACTION_PHASE: // "Phase" + case symbol_kind::S_ACTION_PREPEND: // "Prepend" + case symbol_kind::S_ACTION_PROXY: // "Proxy" + case symbol_kind::S_ACTION_REDIRECT: // "Redirect" + case symbol_kind::S_ACTION_REV: // "Rev" + case symbol_kind::S_ACTION_SANITISE_ARG: // "SanitiseArg" + case symbol_kind::S_ACTION_SANITISE_MATCHED: // "SanitiseMatched" + case symbol_kind::S_ACTION_SANITISE_MATCHED_BYTES: // "SanitiseMatchedBytes" + case symbol_kind::S_ACTION_SANITISE_REQUEST_HEADER: // "SanitiseRequestHeader" + case symbol_kind::S_ACTION_SANITISE_RESPONSE_HEADER: // "SanitiseResponseHeader" + case symbol_kind::S_ACTION_SETENV: // "SetEnv" + case symbol_kind::S_ACTION_SETRSC: // "SetRsc" + case symbol_kind::S_ACTION_SETSID: // "SetSid" + case symbol_kind::S_ACTION_SETUID: // "SetUID" + case symbol_kind::S_ACTION_SEVERITY: // "Severity" + case symbol_kind::S_ACTION_SKIP: // "Skip" + case symbol_kind::S_ACTION_SKIP_AFTER: // "SkipAfter" + case symbol_kind::S_ACTION_STATUS: // "Status" + case symbol_kind::S_ACTION_TAG: // "Tag" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_ENCODE: // "ACTION_TRANSFORMATION_BASE_64_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE: // "ACTION_TRANSFORMATION_BASE_64_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT: // "ACTION_TRANSFORMATION_BASE_64_DECODE_EXT" + case symbol_kind::S_ACTION_TRANSFORMATION_CMD_LINE: // "ACTION_TRANSFORMATION_CMD_LINE" + case symbol_kind::S_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE: // "ACTION_TRANSFORMATION_COMPRESS_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_CSS_DECODE: // "ACTION_TRANSFORMATION_CSS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE: // "ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_ENCODE: // "ACTION_TRANSFORMATION_HEX_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HEX_DECODE: // "ACTION_TRANSFORMATION_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE: // "ACTION_TRANSFORMATION_HTML_ENTITY_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_JS_DECODE: // "ACTION_TRANSFORMATION_JS_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_LENGTH: // "ACTION_TRANSFORMATION_LENGTH" + case symbol_kind::S_ACTION_TRANSFORMATION_LOWERCASE: // "ACTION_TRANSFORMATION_LOWERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_MD5: // "ACTION_TRANSFORMATION_MD5" + case symbol_kind::S_ACTION_TRANSFORMATION_NONE: // "ACTION_TRANSFORMATION_NONE" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH: // "ACTION_TRANSFORMATION_NORMALISE_PATH" + case symbol_kind::S_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN: // "ACTION_TRANSFORMATION_NORMALISE_PATH_WIN" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT: // "ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ODD_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT: // "ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR: // "ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_NULLS: // "ACTION_TRANSFORMATION_REMOVE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_REMOVE_WHITESPACE: // "ACTION_TRANSFORMATION_REMOVE_WHITESPACE" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_COMMENTS: // "ACTION_TRANSFORMATION_REPLACE_COMMENTS" + case symbol_kind::S_ACTION_TRANSFORMATION_REPLACE_NULLS: // "ACTION_TRANSFORMATION_REPLACE_NULLS" + case symbol_kind::S_ACTION_TRANSFORMATION_SHA1: // "ACTION_TRANSFORMATION_SHA1" + case symbol_kind::S_ACTION_TRANSFORMATION_SQL_HEX_DECODE: // "ACTION_TRANSFORMATION_SQL_HEX_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM: // "ACTION_TRANSFORMATION_TRIM" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_LEFT: // "ACTION_TRANSFORMATION_TRIM_LEFT" + case symbol_kind::S_ACTION_TRANSFORMATION_TRIM_RIGHT: // "ACTION_TRANSFORMATION_TRIM_RIGHT" + case symbol_kind::S_ACTION_TRANSFORMATION_UPPERCASE: // "ACTION_TRANSFORMATION_UPPERCASE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_ENCODE: // "ACTION_TRANSFORMATION_URL_ENCODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE: // "ACTION_TRANSFORMATION_URL_DECODE" + case symbol_kind::S_ACTION_TRANSFORMATION_URL_DECODE_UNI: // "ACTION_TRANSFORMATION_URL_DECODE_UNI" + case symbol_kind::S_ACTION_TRANSFORMATION_UTF8_TO_UNICODE: // "ACTION_TRANSFORMATION_UTF8_TO_UNICODE" + case symbol_kind::S_ACTION_VER: // "Ver" + case symbol_kind::S_ACTION_XMLNS: // "xmlns" + case symbol_kind::S_CONFIG_COMPONENT_SIG: // "CONFIG_COMPONENT_SIG" + case symbol_kind::S_CONFIG_CONN_ENGINE: // "CONFIG_CONN_ENGINE" + case symbol_kind::S_CONFIG_SEC_ARGUMENT_SEPARATOR: // "CONFIG_SEC_ARGUMENT_SEPARATOR" + case symbol_kind::S_CONFIG_SEC_WEB_APP_ID: // "CONFIG_SEC_WEB_APP_ID" + case symbol_kind::S_CONFIG_SEC_SERVER_SIG: // "CONFIG_SEC_SERVER_SIG" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR: // "CONFIG_DIR_AUDIT_DIR" + case symbol_kind::S_CONFIG_DIR_AUDIT_DIR_MOD: // "CONFIG_DIR_AUDIT_DIR_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_ENG: // "CONFIG_DIR_AUDIT_ENG" + case symbol_kind::S_CONFIG_DIR_AUDIT_FLE_MOD: // "CONFIG_DIR_AUDIT_FLE_MOD" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG: // "CONFIG_DIR_AUDIT_LOG" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG2: // "CONFIG_DIR_AUDIT_LOG2" + case symbol_kind::S_CONFIG_DIR_AUDIT_LOG_P: // "CONFIG_DIR_AUDIT_LOG_P" + case symbol_kind::S_CONFIG_DIR_AUDIT_STS: // "CONFIG_DIR_AUDIT_STS" + case symbol_kind::S_CONFIG_DIR_AUDIT_TPE: // "CONFIG_DIR_AUDIT_TPE" + case symbol_kind::S_CONFIG_DIR_DEBUG_LOG: // "CONFIG_DIR_DEBUG_LOG" + case symbol_kind::S_CONFIG_DIR_DEBUG_LVL: // "CONFIG_DIR_DEBUG_LVL" + case symbol_kind::S_CONFIG_SEC_CACHE_TRANSFORMATIONS: // "CONFIG_SEC_CACHE_TRANSFORMATIONS" + case symbol_kind::S_CONFIG_SEC_DISABLE_BACKEND_COMPRESS: // "CONFIG_SEC_DISABLE_BACKEND_COMPRESS" + case symbol_kind::S_CONFIG_SEC_HASH_ENGINE: // "CONFIG_SEC_HASH_ENGINE" + case symbol_kind::S_CONFIG_SEC_HASH_KEY: // "CONFIG_SEC_HASH_KEY" + case symbol_kind::S_CONFIG_SEC_HASH_PARAM: // "CONFIG_SEC_HASH_PARAM" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_RX: // "CONFIG_SEC_HASH_METHOD_RX" + case symbol_kind::S_CONFIG_SEC_HASH_METHOD_PM: // "CONFIG_SEC_HASH_METHOD_PM" + case symbol_kind::S_CONFIG_SEC_CHROOT_DIR: // "CONFIG_SEC_CHROOT_DIR" + case symbol_kind::S_CONFIG_DIR_GEO_DB: // "CONFIG_DIR_GEO_DB" + case symbol_kind::S_CONFIG_DIR_GSB_DB: // "CONFIG_DIR_GSB_DB" + case symbol_kind::S_CONFIG_SEC_GUARDIAN_LOG: // "CONFIG_SEC_GUARDIAN_LOG" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT: // "CONFIG_DIR_PCRE_MATCH_LIMIT" + case symbol_kind::S_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION: // "CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION" + case symbol_kind::S_CONFIG_SEC_CONN_R_STATE_LIMIT: // "CONFIG_SEC_CONN_R_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_CONN_W_STATE_LIMIT: // "CONFIG_SEC_CONN_W_STATE_LIMIT" + case symbol_kind::S_CONFIG_SEC_SENSOR_ID: // "CONFIG_SEC_SENSOR_ID" + case symbol_kind::S_CONFIG_DIR_ARGS_LIMIT: // "CONFIG_DIR_ARGS_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT: // "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY: // "CONFIG_DIR_REQ_BODY" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT: // "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT: // "CONFIG_DIR_REQ_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_LIMIT_ACTION: // "CONFIG_DIR_REQ_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT: // "CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY: // "CONFIG_DIR_RES_BODY" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT: // "CONFIG_DIR_RES_BODY_LIMIT" + case symbol_kind::S_CONFIG_DIR_RES_BODY_LIMIT_ACTION: // "CONFIG_DIR_RES_BODY_LIMIT_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_INHERITANCE: // "CONFIG_SEC_RULE_INHERITANCE" + case symbol_kind::S_CONFIG_SEC_RULE_PERF_TIME: // "CONFIG_SEC_RULE_PERF_TIME" + case symbol_kind::S_CONFIG_DIR_RULE_ENG: // "CONFIG_DIR_RULE_ENG" + case symbol_kind::S_CONFIG_DIR_SEC_ACTION: // "CONFIG_DIR_SEC_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_DEFAULT_ACTION: // "CONFIG_DIR_SEC_DEFAULT_ACTION" + case symbol_kind::S_CONFIG_DIR_SEC_MARKER: // "CONFIG_DIR_SEC_MARKER" + case symbol_kind::S_CONFIG_DIR_UNICODE_MAP_FILE: // "CONFIG_DIR_UNICODE_MAP_FILE" + case symbol_kind::S_CONFIG_DIR_UNICODE_CODE_PAGE: // "CONFIG_DIR_UNICODE_CODE_PAGE" + case symbol_kind::S_CONFIG_SEC_COLLECTION_TIMEOUT: // "CONFIG_SEC_COLLECTION_TIMEOUT" + case symbol_kind::S_CONFIG_SEC_HTTP_BLKEY: // "CONFIG_SEC_HTTP_BLKEY" + case symbol_kind::S_CONFIG_SEC_INTERCEPT_ON_ERROR: // "CONFIG_SEC_INTERCEPT_ON_ERROR" + case symbol_kind::S_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION: // "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_ID: // "CONFIG_SEC_RULE_REMOVE_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_MSG: // "CONFIG_SEC_RULE_REMOVE_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_REMOVE_BY_TAG: // "CONFIG_SEC_RULE_REMOVE_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID: // "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID" + case symbol_kind::S_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID: // "CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID" + case symbol_kind::S_CONFIG_UPDLOAD_KEEP_FILES: // "CONFIG_UPDLOAD_KEEP_FILES" + case symbol_kind::S_CONFIG_UPDLOAD_SAVE_TMP_FILES: // "CONFIG_UPDLOAD_SAVE_TMP_FILES" + case symbol_kind::S_CONFIG_UPLOAD_DIR: // "CONFIG_UPLOAD_DIR" + case symbol_kind::S_CONFIG_UPLOAD_FILE_LIMIT: // "CONFIG_UPLOAD_FILE_LIMIT" + case symbol_kind::S_CONFIG_UPLOAD_FILE_MODE: // "CONFIG_UPLOAD_FILE_MODE" + case symbol_kind::S_CONFIG_VALUE_ABORT: // "CONFIG_VALUE_ABORT" + case symbol_kind::S_CONFIG_VALUE_DETC: // "CONFIG_VALUE_DETC" + case symbol_kind::S_CONFIG_VALUE_HTTPS: // "CONFIG_VALUE_HTTPS" + case symbol_kind::S_CONFIG_VALUE_OFF: // "CONFIG_VALUE_OFF" + case symbol_kind::S_CONFIG_VALUE_ON: // "CONFIG_VALUE_ON" + case symbol_kind::S_CONFIG_VALUE_PARALLEL: // "CONFIG_VALUE_PARALLEL" + case symbol_kind::S_CONFIG_VALUE_PROCESS_PARTIAL: // "CONFIG_VALUE_PROCESS_PARTIAL" + case symbol_kind::S_CONFIG_VALUE_REJECT: // "CONFIG_VALUE_REJECT" + case symbol_kind::S_CONFIG_VALUE_RELEVANT_ONLY: // "CONFIG_VALUE_RELEVANT_ONLY" + case symbol_kind::S_CONFIG_VALUE_SERIAL: // "CONFIG_VALUE_SERIAL" + case symbol_kind::S_CONFIG_VALUE_WARN: // "CONFIG_VALUE_WARN" + case symbol_kind::S_CONFIG_XML_EXTERNAL_ENTITY: // "CONFIG_XML_EXTERNAL_ENTITY" + case symbol_kind::S_CONGIG_DIR_RESPONSE_BODY_MP: // "CONGIG_DIR_RESPONSE_BODY_MP" + case symbol_kind::S_CONGIG_DIR_SEC_ARG_SEP: // "CONGIG_DIR_SEC_ARG_SEP" + case symbol_kind::S_CONGIG_DIR_SEC_COOKIE_FORMAT: // "CONGIG_DIR_SEC_COOKIE_FORMAT" + case symbol_kind::S_CONFIG_SEC_COOKIEV0_SEPARATOR: // "CONFIG_SEC_COOKIEV0_SEPARATOR" + case symbol_kind::S_CONGIG_DIR_SEC_DATA_DIR: // "CONGIG_DIR_SEC_DATA_DIR" + case symbol_kind::S_CONGIG_DIR_SEC_STATUS_ENGINE: // "CONGIG_DIR_SEC_STATUS_ENGINE" + case symbol_kind::S_CONFIG_SEC_STREAM_IN_BODY_INSPECTION: // "CONFIG_SEC_STREAM_IN_BODY_INSPECTION" + case symbol_kind::S_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION: // "CONFIG_SEC_STREAM_OUT_BODY_INSPECTION" + case symbol_kind::S_CONGIG_DIR_SEC_TMP_DIR: // "CONGIG_DIR_SEC_TMP_DIR" + case symbol_kind::S_DIRECTIVE: // "DIRECTIVE" + case symbol_kind::S_DIRECTIVE_SECRULESCRIPT: // "DIRECTIVE_SECRULESCRIPT" + case symbol_kind::S_FREE_TEXT_QUOTE_MACRO_EXPANSION: // "FREE_TEXT_QUOTE_MACRO_EXPANSION" + case symbol_kind::S_QUOTATION_MARK: // "QUOTATION_MARK" + case symbol_kind::S_RUN_TIME_VAR_BLD: // "RUN_TIME_VAR_BLD" + case symbol_kind::S_RUN_TIME_VAR_DUR: // "RUN_TIME_VAR_DUR" + case symbol_kind::S_RUN_TIME_VAR_HSV: // "RUN_TIME_VAR_HSV" + case symbol_kind::S_RUN_TIME_VAR_REMOTE_USER: // "RUN_TIME_VAR_REMOTE_USER" + case symbol_kind::S_RUN_TIME_VAR_TIME: // "RUN_TIME_VAR_TIME" + case symbol_kind::S_RUN_TIME_VAR_TIME_DAY: // "RUN_TIME_VAR_TIME_DAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_EPOCH: // "RUN_TIME_VAR_TIME_EPOCH" + case symbol_kind::S_RUN_TIME_VAR_TIME_HOUR: // "RUN_TIME_VAR_TIME_HOUR" + case symbol_kind::S_RUN_TIME_VAR_TIME_MIN: // "RUN_TIME_VAR_TIME_MIN" + case symbol_kind::S_RUN_TIME_VAR_TIME_MON: // "RUN_TIME_VAR_TIME_MON" + case symbol_kind::S_RUN_TIME_VAR_TIME_SEC: // "RUN_TIME_VAR_TIME_SEC" + case symbol_kind::S_RUN_TIME_VAR_TIME_WDAY: // "RUN_TIME_VAR_TIME_WDAY" + case symbol_kind::S_RUN_TIME_VAR_TIME_YEAR: // "RUN_TIME_VAR_TIME_YEAR" + case symbol_kind::S_VARIABLE: // "VARIABLE" + case symbol_kind::S_DICT_ELEMENT: // "Dictionary element" + case symbol_kind::S_DICT_ELEMENT_REGEXP: // "Dictionary element, selected by regexp" value.move< std::string > (YY_MOVE (s.value)); break; - case 347: // op - case 348: // op_before_init + case symbol_kind::S_op: // op + case symbol_kind::S_op_before_init: // op_before_init value.move< std::unique_ptr > (YY_MOVE (s.value)); break; - case 356: // run_time_string + case symbol_kind::S_run_time_string: // run_time_string value.move< std::unique_ptr > (YY_MOVE (s.value)); break; - case 353: // var + case symbol_kind::S_var: // var value.move< std::unique_ptr > (YY_MOVE (s.value)); break; - case 354: // act - case 355: // setvar_action + case symbol_kind::S_act: // act + case symbol_kind::S_setvar_action: // setvar_action value.move< std::unique_ptr > (YY_MOVE (s.value)); break; - case 350: // variables - case 351: // variables_pre_process - case 352: // variables_may_be_quoted + case symbol_kind::S_variables: // variables + case symbol_kind::S_variables_pre_process: // variables_pre_process + case symbol_kind::S_variables_may_be_quoted: // variables_may_be_quoted value.move< std::unique_ptr > > > (YY_MOVE (s.value)); break; - case 345: // actions - case 346: // actions_may_quoted + case symbol_kind::S_actions: // actions + case symbol_kind::S_actions_may_quoted: // actions_may_quoted value.move< std::unique_ptr > > > (YY_MOVE (s.value)); break; @@ -8030,105 +8591,62 @@ switch (yytype) location = YY_MOVE (s.location); } - // by_type. + // by_kind. inline - seclang_parser::by_type::by_type () - : type (empty_symbol) + seclang_parser::by_kind::by_kind () + : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - seclang_parser::by_type::by_type (by_type&& that) - : type (that.type) + seclang_parser::by_kind::by_kind (by_kind&& that) + : kind_ (that.kind_) { that.clear (); } #endif inline - seclang_parser::by_type::by_type (const by_type& that) - : type (that.type) + seclang_parser::by_kind::by_kind (const by_kind& that) + : kind_ (that.kind_) {} inline - seclang_parser::by_type::by_type (token_type t) - : type (yytranslate_ (t)) + seclang_parser::by_kind::by_kind (token_kind_type t) + : kind_ (yytranslate_ (t)) {} inline void - seclang_parser::by_type::clear () + seclang_parser::by_kind::clear () YY_NOEXCEPT { - type = empty_symbol; + kind_ = symbol_kind::S_YYEMPTY; } inline void - seclang_parser::by_type::move (by_type& that) + seclang_parser::by_kind::move (by_kind& that) { - type = that.type; + kind_ = that.kind_; that.clear (); } inline - int - seclang_parser::by_type::type_get () const YY_NOEXCEPT + seclang_parser::symbol_kind_type + seclang_parser::by_kind::kind () const YY_NOEXCEPT { - return type; + return kind_; } inline - seclang_parser::token_type - seclang_parser::by_type::token () const YY_NOEXCEPT + seclang_parser::symbol_kind_type + seclang_parser::by_kind::type_get () const YY_NOEXCEPT { - // YYTOKNUM[NUM] -- (External) token number corresponding to the - // (internal) symbol number NUM (which must be that of a token). */ - static - const unsigned short - yytoken_number_[] = - { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, - 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, - 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, - 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, - 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595 - }; - return token_type (yytoken_number_[type]); + return this->kind (); } - } // yy -#line 8132 "seclang-parser.hh" // lalr1.cc:401 +#line 8650 "seclang-parser.hh" diff --git a/src/deps/src/ModSecurity/src/parser/seclang-parser.yy b/src/deps/src/ModSecurity/src/parser/seclang-parser.yy index 32c56647f..332a30d16 100644 --- a/src/deps/src/ModSecurity/src/parser/seclang-parser.yy +++ b/src/deps/src/ModSecurity/src/parser/seclang-parser.yy @@ -17,6 +17,7 @@ class Driver; } } +#include "modsecurity/rule_unconditional.h" #include "src/rule_script.h" #include "src/actions/accuracy.h" @@ -24,6 +25,7 @@ class Driver; #include "src/actions/block.h" #include "src/actions/capture.h" #include "src/actions/chain.h" +#include "src/actions/ctl/audit_engine.h" #include "src/actions/ctl/audit_log_parts.h" #include "src/actions/ctl/request_body_access.h" #include "src/actions/ctl/rule_engine.h" @@ -61,12 +63,12 @@ class Driver; #include "src/actions/skip_after.h" #include "src/actions/skip.h" #include "src/actions/tag.h" -#include "src/actions/transformations/none.h" -#include "src/actions/transformations/transformation.h" -#include "src/actions/transformations/url_decode_uni.h" #include "src/actions/ver.h" #include "src/actions/xmlns.h" +#include "src/actions/transformations/none.h" +#include "src/actions/transformations/transformation.h" +#include "src/actions/transformations/url_decode_uni.h" #include "src/actions/transformations/hex_encode.h" #include "src/actions/transformations/parity_even_7bit.h" #include "src/actions/transformations/utf8_to_unicode.h" @@ -131,6 +133,7 @@ class Driver; #include "src/operators/rbl.h" #include "src/operators/rsub.h" #include "src/operators/rx.h" +#include "src/operators/rx_global.h" #include "src/operators/str_eq.h" #include "src/operators/str_match.h" #include "src/operators/unconditional_match.h" @@ -149,7 +152,7 @@ class Driver; #include "modsecurity/audit_log.h" #include "modsecurity/modsecurity.h" -#include "modsecurity/rules_properties.h" +#include "modsecurity/rules_set_properties.h" #include "modsecurity/rule.h" #include "src/operators/operator.h" #include "src/utils/geo_lookup.h" @@ -214,6 +217,7 @@ class Driver; #include "src/variables/request_body_length.h" #include "src/variables/request_cookies.h" #include "src/variables/request_cookies_names.h" +#include "src/variables/multipart_part_headers.h" #include "src/variables/request_file_name.h" #include "src/variables/request_headers.h" #include "src/variables/request_headers_names.h" @@ -257,7 +261,6 @@ class Driver; #include "src/variables/session.h" #include "src/variables/status.h" - using namespace modsecurity; using namespace modsecurity::variables; using namespace modsecurity::Utils; @@ -350,6 +353,7 @@ using namespace modsecurity::operators; VARIABLE_RESPONSE_HEADERS VARIABLE_GEO VARIABLE_REQUEST_COOKIES_NAMES + VARIABLE_MULTIPART_PART_HEADERS VARIABLE_ARGS_COMBINED_SIZE VARIABLE_ARGS_GET_NAMES VARIABLE_RULE @@ -455,6 +459,7 @@ using namespace modsecurity::operators; OPERATOR_RSUB "OPERATOR_RSUB" OPERATOR_RX_CONTENT_ONLY "Operator RX (content only)" OPERATOR_RX "OPERATOR_RX" + OPERATOR_RX_GLOBAL "OPERATOR_RX_GLOBAL" OPERATOR_STR_EQ "OPERATOR_STR_EQ" OPERATOR_STR_MATCH "OPERATOR_STR_MATCH" OPERATOR_UNCONDITIONAL_MATCH "OPERATOR_UNCONDITIONAL_MATCH" @@ -601,6 +606,8 @@ using namespace modsecurity::operators; CONFIG_SEC_CONN_R_STATE_LIMIT "CONFIG_SEC_CONN_R_STATE_LIMIT" CONFIG_SEC_CONN_W_STATE_LIMIT "CONFIG_SEC_CONN_W_STATE_LIMIT" CONFIG_SEC_SENSOR_ID "CONFIG_SEC_SENSOR_ID" + CONFIG_DIR_ARGS_LIMIT "CONFIG_DIR_ARGS_LIMIT" + CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT "CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT" CONFIG_DIR_REQ_BODY "CONFIG_DIR_REQ_BODY" CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT "CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT" CONFIG_DIR_REQ_BODY_LIMIT "CONFIG_DIR_REQ_BODY_LIMIT" @@ -800,11 +807,11 @@ audit_log: /* Upload */ | CONFIG_UPDLOAD_KEEP_FILES CONFIG_VALUE_ON { - driver.m_uploadKeepFiles = modsecurity::RulesProperties::TrueConfigBoolean; + driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::TrueConfigBoolean; } | CONFIG_UPDLOAD_KEEP_FILES CONFIG_VALUE_OFF { - driver.m_uploadKeepFiles = modsecurity::RulesProperties::FalseConfigBoolean; + driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::FalseConfigBoolean; } | CONFIG_UPDLOAD_KEEP_FILES CONFIG_VALUE_RELEVANT_ONLY { @@ -828,11 +835,11 @@ audit_log: } | CONFIG_UPDLOAD_SAVE_TMP_FILES CONFIG_VALUE_ON { - driver.m_tmpSaveUploadedFiles = modsecurity::RulesProperties::TrueConfigBoolean; + driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::TrueConfigBoolean; } | CONFIG_UPDLOAD_SAVE_TMP_FILES CONFIG_VALUE_OFF { - driver.m_tmpSaveUploadedFiles = modsecurity::RulesProperties::FalseConfigBoolean; + driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::FalseConfigBoolean; } ; @@ -1036,6 +1043,10 @@ op_before_init: { OPERATOR_CONTAINER($$, new operators::Rx(std::move($2))); } + | OPERATOR_RX_GLOBAL run_time_string + { + OPERATOR_CONTAINER($$, new operators::RxGlobal(std::move($2))); + } | OPERATOR_STR_EQ run_time_string { OPERATOR_CONTAINER($$, new operators::StrEq(std::move($2))); @@ -1066,8 +1077,13 @@ expression: | DIRECTIVE variables op actions { std::vector *a = new std::vector(); + std::vector *t = new std::vector(); for (auto &i : *$4.get()) { - a->push_back(i.release()); + 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 : *$2.get()) { @@ -1075,16 +1091,16 @@ expression: } Operator *op = $3.release(); - Rule *rule = new Rule( + std::unique_ptr rule(new RuleWithOperator( /* op */ op, /* variables */ v, /* actions */ a, - /* file name */ *@1.end.filename, + /* transformations */ t, + /* file name */ std::unique_ptr(new std::string(*@1.end.filename)), /* line number */ @1.end.line - ); + )); - if (driver.addSecRule(rule) == false) { - delete rule; + if (driver.addSecRule(std::move(rule)) == false) { YYERROR; } } @@ -1095,54 +1111,62 @@ expression: v->push_back(i.release()); } - Rule *rule = new Rule( + std::unique_ptr rule(new RuleWithOperator( /* op */ $3.release(), /* variables */ v, /* actions */ NULL, - /* file name */ *@1.end.filename, + /* transformations */ NULL, + /* file name */ std::unique_ptr(new std::string(*@1.end.filename)), /* line number */ @1.end.line - ); - if (driver.addSecRule(rule) == false) { - delete rule; + )); + if (driver.addSecRule(std::move(rule)) == false) { YYERROR; } } | CONFIG_DIR_SEC_ACTION actions { std::vector *a = new std::vector(); + std::vector *t = new std::vector(); for (auto &i : *$2.get()) { - a->push_back(i.release()); + if (dynamic_cast(i.get())) { + t->push_back(dynamic_cast(i.release())); + } else { + a->push_back(i.release()); + } } - Rule *rule = new Rule( - /* op */ NULL, - /* variables */ NULL, + std::unique_ptr rule(new RuleUnconditional( /* actions */ a, - /* file name */ *@1.end.filename, + /* transformations */ t, + /* file name */ std::unique_ptr(new std::string(*@1.end.filename)), /* line number */ @1.end.line - ); - driver.addSecAction(rule); + )); + driver.addSecAction(std::move(rule)); } | DIRECTIVE_SECRULESCRIPT actions { std::string err; std::vector *a = new std::vector(); + std::vector *t = new std::vector(); for (auto &i : *$2.get()) { - a->push_back(i.release()); + if (dynamic_cast(i.get())) { + t->push_back(dynamic_cast(i.release())); + } else { + a->push_back(i.release()); + } } - RuleScript *r = new RuleScript( + std::unique_ptr r(new RuleScript( /* path to script */ $1, /* actions */ a, - /* file name */ *@1.end.filename, + /* transformations */ t, + /* file name */ std::unique_ptr(new std::string(*@1.end.filename)), /* line number */ @1.end.line - ); + )); if (r->init(&err) == false) { driver.error(@0, "Failed to load script: " + err); - delete r; YYERROR; } - if (driver.addSecRuleScript(r) == false) { - delete r; + if (driver.addSecRuleScript(std::move(r)) == false) { YYERROR; } } @@ -1167,14 +1191,14 @@ expression: delete phase; } else if (a->action_kind == actions::Action::RunTimeOnlyIfMatchKind || a->action_kind == actions::Action::RunTimeBeforeMatchAttemptKind) { - actions::transformations::None *none = dynamic_cast(a); + actions::transformations::None *none = dynamic_cast(a); if (none != NULL) { driver.error(@0, "The transformation none is not suitable to be part of the SecDefaultActions"); YYERROR; } checkedActions.push_back(a); } else { - driver.error(@0, "The action '" + a->m_name + "' is not suitable to be part of the SecDefaultActions"); + driver.error(@0, "The action '" + *a->m_name.get() + "' is not suitable to be part of the SecDefaultActions"); YYERROR; } } @@ -1197,42 +1221,46 @@ expression: } for (actions::Action *a : checkedActions) { - driver.m_defaultActions[definedPhase].push_back(a); + driver.m_defaultActions[definedPhase].push_back( + std::unique_ptr(a)); } delete actions; } | CONFIG_DIR_SEC_MARKER { - driver.addSecMarker(modsecurity::utils::string::removeBracketsIfNeeded($1)); + driver.addSecMarker(modsecurity::utils::string::removeBracketsIfNeeded($1), + /* file name */ std::unique_ptr(new std::string(*@1.end.filename)), + /* line number */ @1.end.line + ); } | CONFIG_DIR_RULE_ENG CONFIG_VALUE_OFF { - driver.m_secRuleEngine = modsecurity::Rules::DisabledRuleEngine; + driver.m_secRuleEngine = modsecurity::RulesSet::DisabledRuleEngine; } | CONFIG_DIR_RULE_ENG CONFIG_VALUE_ON { - driver.m_secRuleEngine = modsecurity::Rules::EnabledRuleEngine; + driver.m_secRuleEngine = modsecurity::RulesSet::EnabledRuleEngine; } | CONFIG_DIR_RULE_ENG CONFIG_VALUE_DETC { - driver.m_secRuleEngine = modsecurity::Rules::DetectionOnlyRuleEngine; + driver.m_secRuleEngine = modsecurity::RulesSet::DetectionOnlyRuleEngine; } | CONFIG_DIR_REQ_BODY CONFIG_VALUE_ON { - driver.m_secRequestBodyAccess = modsecurity::RulesProperties::TrueConfigBoolean; + driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean; } | CONFIG_DIR_REQ_BODY CONFIG_VALUE_OFF { - driver.m_secRequestBodyAccess = modsecurity::RulesProperties::FalseConfigBoolean; + driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean; } | CONFIG_DIR_RES_BODY CONFIG_VALUE_ON { - driver.m_secResponseBodyAccess = modsecurity::RulesProperties::TrueConfigBoolean; + driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean; } | CONFIG_DIR_RES_BODY CONFIG_VALUE_OFF { - driver.m_secResponseBodyAccess = modsecurity::RulesProperties::FalseConfigBoolean; + driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean; } | CONFIG_SEC_ARGUMENT_SEPARATOR { @@ -1553,6 +1581,16 @@ expression: YYERROR; #endif // WITH_GEOIP } + | CONFIG_DIR_ARGS_LIMIT + { + driver.m_argumentsLimit.m_set = true; + driver.m_argumentsLimit.m_value = atoi($1.c_str()); + } + | CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT + { + driver.m_requestBodyJsonDepthLimit.m_set = true; + driver.m_requestBodyJsonDepthLimit.m_value = atoi($1.c_str()); + } /* Body limits */ | CONFIG_DIR_REQ_BODY_LIMIT { @@ -1580,27 +1618,27 @@ expression: } | CONFIG_DIR_REQ_BODY_LIMIT_ACTION CONFIG_VALUE_PROCESS_PARTIAL { - driver.m_requestBodyLimitAction = modsecurity::Rules::BodyLimitAction::ProcessPartialBodyLimitAction; + driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction; } | CONFIG_DIR_REQ_BODY_LIMIT_ACTION CONFIG_VALUE_REJECT { - driver.m_requestBodyLimitAction = modsecurity::Rules::BodyLimitAction::RejectBodyLimitAction; + driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction; } | CONFIG_DIR_RES_BODY_LIMIT_ACTION CONFIG_VALUE_PROCESS_PARTIAL { - driver.m_responseBodyLimitAction = modsecurity::Rules::BodyLimitAction::ProcessPartialBodyLimitAction; + driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction; } | CONFIG_DIR_RES_BODY_LIMIT_ACTION CONFIG_VALUE_REJECT { - driver.m_responseBodyLimitAction = modsecurity::Rules::BodyLimitAction::RejectBodyLimitAction; + driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction; } | CONFIG_SEC_REMOTE_RULES_FAIL_ACTION CONFIG_VALUE_ABORT { - driver.m_remoteRulesActionOnFailed = Rules::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction; + driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction; } | CONFIG_SEC_REMOTE_RULES_FAIL_ACTION CONFIG_VALUE_WARN { - driver.m_remoteRulesActionOnFailed = Rules::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction; + driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction; } | CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION /* Parser error disabled to avoid breaking default installations with modsecurity.conf-recommended @@ -1632,11 +1670,11 @@ expression: } | CONFIG_XML_EXTERNAL_ENTITY CONFIG_VALUE_OFF { - driver.m_secXMLExternalEntity = modsecurity::RulesProperties::FalseConfigBoolean; + driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::FalseConfigBoolean; } | CONFIG_XML_EXTERNAL_ENTITY CONFIG_VALUE_ON { - driver.m_secXMLExternalEntity = modsecurity::RulesProperties::TrueConfigBoolean; + driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::TrueConfigBoolean; } | CONGIG_DIR_SEC_TMP_DIR { @@ -2025,6 +2063,18 @@ var: { VARIABLE_CONTAINER($$, new variables::RequestCookiesNames_NoDictElement()); } + | VARIABLE_MULTIPART_PART_HEADERS DICT_ELEMENT + { + VARIABLE_CONTAINER($$, new variables::MultipartPartHeaders_DictElement($2)); + } + | VARIABLE_MULTIPART_PART_HEADERS DICT_ELEMENT_REGEXP + { + VARIABLE_CONTAINER($$, new variables::MultipartPartHeaders_DictElementRegexp($2)); + } + | VARIABLE_MULTIPART_PART_HEADERS + { + VARIABLE_CONTAINER($$, new variables::MultipartPartHeaders_NoDictElement()); + } | VARIABLE_RULE DICT_ELEMENT { VARIABLE_CONTAINER($$, new variables::Rule_DictElement($2)); @@ -2590,18 +2640,17 @@ act: } | ACTION_CTL_AUDIT_ENGINE CONFIG_VALUE_ON { - //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); - ACTION_CONTAINER($$, new actions::Action($1)); + ACTION_CONTAINER($$, new actions::ctl::AuditEngine("ctl:auditengine=on")); + driver.m_auditLog->setCtlAuditEngineActive(); } | ACTION_CTL_AUDIT_ENGINE CONFIG_VALUE_OFF { - //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); - ACTION_CONTAINER($$, new actions::Action($1)); + ACTION_CONTAINER($$, new actions::ctl::AuditEngine("ctl:auditengine=off")); } | ACTION_CTL_AUDIT_ENGINE CONFIG_VALUE_RELEVANT_ONLY { - //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); - ACTION_CONTAINER($$, new actions::Action($1)); + ACTION_CONTAINER($$, new actions::ctl::AuditEngine("ctl:auditengine=relevantonly")); + driver.m_auditLog->setCtlAuditEngineActive(); } | ACTION_CTL_AUDIT_LOG_PARTS { diff --git a/src/deps/src/ModSecurity/src/parser/seclang-scanner.cc b/src/deps/src/ModSecurity/src/parser/seclang-scanner.cc index 083452887..af23ab336 100644 --- a/src/deps/src/ModSecurity/src/parser/seclang-scanner.cc +++ b/src/deps/src/ModSecurity/src/parser/seclang-scanner.cc @@ -1,5 +1,5 @@ -#line 2 "seclang-scanner.cc" +#line 3 "seclang-scanner.cc" #define YY_INT_ALIGNED short int @@ -433,8 +433,8 @@ static void yynoreturn yy_fatal_error ( const char* msg ); /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ (yy_c_buf_p) = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ -#define YY_NUM_RULES 538 -#define YY_END_OF_BUFFER 539 +#define YY_NUM_RULES 544 +#define YY_END_OF_BUFFER 545 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -442,439 +442,444 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[3914] = +static const flex_int16_t yy_accept[3966] = { 0, - 0, 0, 0, 0, 270, 270, 278, 278, 0, 0, + 0, 0, 0, 0, 273, 273, 281, 281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 282, 282, 0, 0, 0, 0, + 0, 0, 0, 0, 285, 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 539, 531, 525, 263, 267, 268, - 266, 269, 531, 531, 531, 531, 531, 531, 531, 531, - 531, 531, 531, 531, 531, 286, 286, 538, 286, 286, + 0, 0, 0, 0, 545, 537, 531, 266, 270, 271, + 269, 272, 537, 537, 537, 537, 537, 537, 537, 537, + 537, 537, 537, 537, 537, 289, 289, 544, 289, 289, - 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, - 286, 286, 286, 286, 286, 286, 125, 270, 276, 278, - 280, 274, 273, 275, 272, 278, 271, 489, 489, 488, - 489, 489, 489, 120, 119, 118, 127, 127, 127, 134, - 126, 127, 129, 129, 129, 128, 134, 129, 132, 132, - 132, 131, 134, 130, 132, 530, 530, 530, 538, 491, - 490, 441, 444, 538, 444, 441, 441, 441, 430, 430, - 430, 433, 435, 430, 434, 430, 424, 430, 499, 499, - 499, 498, 503, 499, 501, 501, 501, 500, 503, 501, - 117, 117, 109, 117, 114, 108, 117, 117, 117, 117, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 126, 273, 279, 281, + 283, 277, 276, 278, 275, 281, 274, 495, 495, 494, + 495, 495, 495, 121, 120, 119, 128, 128, 128, 135, + 127, 128, 130, 130, 130, 129, 135, 130, 133, 133, + 133, 132, 135, 131, 133, 536, 536, 536, 544, 497, + 496, 446, 449, 544, 449, 446, 446, 446, 435, 435, + 435, 438, 440, 435, 439, 435, 429, 435, 505, 505, + 505, 504, 509, 505, 507, 507, 507, 506, 509, 507, + 118, 118, 110, 118, 115, 109, 118, 118, 118, 118, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 112, 117, 111, 538, 508, 538, - 504, 517, 538, 282, 283, 538, 495, 495, 494, 497, - 495, 493, 493, 492, 497, 493, 149, 532, 533, 534, - 136, 135, 136, 136, 136, 136, 136, 136, 140, 139, - 144, 145, 145, 144, 142, 141, 139, 147, 148, 148, - 146, 147, 525, 263, 0, 266, 266, 266, 0, 0, - 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, - 0, 0, 526, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 409, 0, 0, 0, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 113, 118, 112, 544, 514, 544, + 510, 523, 544, 285, 286, 544, 501, 501, 500, 503, + 501, 499, 499, 498, 503, 499, 150, 538, 539, 540, + 137, 136, 137, 137, 137, 137, 137, 137, 141, 140, + 145, 146, 146, 145, 143, 142, 140, 148, 149, 149, + 147, 148, 531, 266, 0, 269, 269, 269, 0, 0, + 0, 0, 0, 0, 0, 0, 218, 0, 0, 0, + 0, 0, 532, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 414, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 414, 0, - 0, 0, 0, 0, 121, 0, 124, 270, 276, 278, - 280, 277, 278, 279, 280, 281, 525, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 419, 0, + 0, 0, 0, 0, 122, 0, 125, 273, 279, 281, + 283, 280, 281, 282, 283, 284, 531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 127, 0, 127, 127, 127, - 0, 133, 121, 127, 127, 129, 0, 0, 129, 129, - 129, 0, 129, 121, 129, 132, 0, 0, 132, 132, - 132, 0, 132, 121, 132, 530, 530, 530, 0, 528, - 530, 441, 0, 441, 0, 441, 441, 0, 441, 441, - 430, 0, 0, 429, 430, 430, 430, 0, 430, 502, + 0, 0, 0, 0, 0, 128, 0, 128, 128, 128, + 0, 134, 122, 128, 128, 130, 0, 0, 130, 130, + 130, 0, 130, 122, 130, 133, 0, 0, 133, 133, + 133, 0, 133, 122, 133, 536, 536, 536, 0, 534, + 536, 446, 0, 446, 0, 446, 446, 0, 446, 446, + 435, 0, 0, 434, 435, 435, 435, 0, 435, 508, - 430, 430, 0, 429, 0, 430, 422, 423, 430, 430, - 499, 0, 0, 499, 499, 499, 0, 499, 121, 499, - 501, 0, 501, 501, 0, 501, 0, 0, 121, 501, - 501, 0, 109, 0, 108, 0, 110, 114, 115, 0, - 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 435, 435, 0, 434, 0, 435, 427, 428, 435, 435, + 505, 0, 0, 505, 505, 505, 0, 505, 122, 505, + 507, 0, 507, 507, 0, 507, 0, 0, 122, 507, + 507, 0, 110, 0, 109, 0, 111, 115, 116, 0, + 109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 106, 0, 0, 112, 0, 113, 111, - 111, 0, 508, 0, 517, 0, 508, 506, 516, 0, - 504, 517, 0, 0, 524, 0, 507, 0, 282, 283, + 0, 0, 0, 107, 0, 0, 113, 0, 114, 112, + 112, 0, 514, 0, 523, 0, 514, 512, 522, 0, + 510, 523, 0, 0, 530, 0, 513, 0, 285, 286, - 0, 283, 0, 0, 495, 0, 495, 0, 496, 495, - 493, 0, 0, 493, 0, 493, 532, 533, 534, 0, - 0, 0, 0, 0, 0, 137, 138, 144, 0, 0, - 144, 0, 144, 143, 147, 0, 0, 147, 0, 147, - 266, 0, 0, 0, 0, 0, 0, 0, 214, 0, - 0, 0, 0, 0, 0, 0, 526, 527, 0, 0, - 0, 392, 0, 0, 382, 0, 0, 0, 417, 0, + 0, 286, 0, 0, 501, 0, 501, 0, 502, 501, + 499, 0, 0, 499, 0, 499, 538, 539, 540, 0, + 0, 0, 0, 0, 0, 138, 139, 145, 0, 0, + 145, 0, 145, 144, 148, 0, 0, 148, 0, 148, + 269, 0, 0, 0, 0, 0, 0, 0, 217, 0, + 0, 0, 0, 0, 0, 0, 532, 533, 0, 0, + 0, 397, 0, 0, 385, 0, 0, 0, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 420, 0, 0, 0, 0, 390, 121, - 122, 123, 0, 0, 0, 0, 462, 0, 463, 0, + 0, 0, 0, 425, 0, 0, 0, 0, 395, 122, + 123, 124, 0, 0, 0, 0, 467, 0, 468, 0, - 464, 0, 0, 467, 468, 470, 0, 0, 472, 0, - 0, 0, 0, 0, 0, 463, 0, 0, 0, 127, - 0, 0, 121, 122, 0, 129, 0, 0, 121, 122, - 0, 132, 0, 0, 121, 122, 528, 529, 441, 0, - 441, 0, 436, 0, 436, 0, 441, 0, 430, 0, - 0, 430, 0, 429, 0, 430, 430, 430, 430, 430, - 0, 0, 0, 0, 430, 430, 430, 0, 499, 0, - 0, 121, 122, 0, 501, 0, 0, 121, 121, 122, - 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 469, 0, 0, 472, 473, 475, 0, 0, 477, 0, + 0, 0, 0, 0, 0, 468, 0, 0, 0, 128, + 0, 0, 122, 123, 0, 130, 0, 0, 122, 123, + 0, 133, 0, 0, 122, 123, 534, 535, 446, 0, + 446, 0, 441, 0, 441, 0, 446, 0, 435, 0, + 0, 435, 0, 434, 0, 435, 435, 435, 435, 435, + 0, 0, 0, 0, 435, 435, 435, 0, 505, 0, + 0, 122, 123, 0, 507, 0, 0, 122, 122, 123, + 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 106, 107, 506, 516, 512, 515, 0, 519, - 0, 0, 524, 0, 0, 507, 505, 514, 0, 0, - 284, 0, 0, 495, 0, 0, 0, 493, 0, 0, - 0, 0, 0, 0, 0, 144, 0, 0, 0, 147, - 0, 0, 266, 0, 0, 0, 0, 0, 168, 0, + 0, 0, 0, 107, 108, 512, 522, 518, 521, 0, + 525, 0, 0, 530, 0, 0, 513, 511, 520, 0, + 0, 287, 0, 0, 501, 0, 0, 0, 499, 0, + 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, + 148, 0, 0, 269, 0, 0, 0, 0, 0, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, - - 527, 358, 0, 0, 393, 0, 0, 383, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 386, 0, 0, 0, 405, 0, 0, 415, - 0, 0, 391, 122, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 469, 471, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 127, 0, 122, 129, 0, - 122, 132, 0, 122, 529, 441, 0, 0, 0, 0, - 441, 0, 0, 437, 442, 438, 437, 442, 438, 430, - 0, 430, 430, 430, 0, 430, 0, 0, 0, 0, - 430, 0, 429, 0, 430, 430, 425, 431, 426, 425, - - 431, 426, 0, 0, 430, 430, 499, 0, 122, 501, - 0, 122, 122, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 0, 7, 0, 0, 0, 8, 0, - 0, 0, 49, 0, 0, 0, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 63, 0, 0, 107, 512, 515, 511, 519, - 0, 522, 0, 0, 518, 0, 0, 505, 514, 510, - 513, 284, 0, 285, 495, 0, 493, 0, 0, 0, - - 0, 0, 144, 0, 147, 0, 266, 266, 211, 0, - 0, 213, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 359, 0, 0, 0, 374, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 387, 0, 0, 0, 0, - 0, 0, 421, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 439, 439, 439, 0, 0, 427, 427, - 0, 0, 0, 430, 430, 0, 427, 0, 430, 0, - 0, 0, 0, 0, 0, 0, 26, 0, 0, 2, - 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 12, 14, 0, 0, 16, - 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, + 224, 533, 361, 0, 0, 398, 0, 0, 386, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 511, 522, 0, - 523, 518, 0, 520, 0, 510, 513, 509, 285, 0, + 0, 0, 0, 391, 0, 0, 0, 410, 0, 0, + 420, 0, 0, 396, 123, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 474, 476, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 128, 0, 123, + 130, 0, 123, 133, 0, 123, 535, 446, 0, 0, + 0, 0, 446, 0, 0, 442, 447, 443, 442, 447, + 443, 435, 0, 435, 435, 435, 0, 435, 0, 0, + 0, 0, 435, 0, 434, 0, 435, 435, 430, 436, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 266, 266, 0, 0, 0, 169, 0, 0, 218, 0, + 431, 430, 436, 431, 0, 0, 435, 435, 505, 0, + 123, 507, 0, 123, 123, 0, 0, 0, 0, 0, + 0, 0, 0, 5, 0, 0, 7, 0, 0, 0, + 8, 0, 0, 0, 49, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, - 0, 375, 0, 0, 408, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 412, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 356, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 63, 0, 0, 108, 518, + 521, 517, 525, 0, 528, 0, 0, 524, 0, 0, + 511, 520, 516, 519, 287, 0, 288, 501, 0, 499, - 0, 0, 0, 473, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 443, 440, 443, 440, 432, 428, 432, - 428, 0, 427, 0, 0, 0, 430, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 41, - 41, 0, 8, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, + 0, 0, 0, 0, 0, 145, 0, 148, 0, 269, + 269, 214, 0, 0, 216, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 362, 0, + 0, 0, 377, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 392, 0, + 0, 0, 0, 0, 0, 426, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 493, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 444, 444, 444, + 0, 0, 432, 432, 0, 0, 0, 435, 435, 0, + 432, 0, 435, 0, 0, 0, 0, 0, 0, 0, + 26, 0, 0, 2, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, + 14, 0, 0, 16, 0, 0, 53, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 75, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 517, 528, 0, 529, 524, 0, 526, 0, + + 516, 519, 515, 288, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 269, 269, 0, 0, 0, + 170, 0, 0, 221, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, + 0, 0, 0, 0, 0, 0, 378, 0, 0, 413, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 417, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 359, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 479, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 448, + 445, 448, 445, 437, 433, 437, 433, 0, 432, 0, + 0, 0, 435, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 41, 41, 0, 8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 84, 0, 0, 0, 0, 74, 0, 92, 0, 0, + 0, 0, 0, 0, 0, 0, 529, 526, 0, 527, + + 515, 0, 0, 0, 269, 269, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 260, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 421, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 416, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 463, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 41, 0, 41, 41, 0, 0, 0, 0, + 0, 0, 0, 50, 0, 0, 15, 0, 0, 52, + 0, 54, 22, 55, 56, 58, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 64, 0, 0, 65, 527, 0, 0, 269, 269, + 0, 0, 0, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 84, 0, 0, 0, 0, 74, 0, - 92, 0, 0, 0, 0, 0, 0, 0, 0, 523, - 520, 0, 521, 509, 0, 0, 0, 266, 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 257, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 416, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 411, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 458, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, - 0, 0, 0, 0, 41, 0, 41, 41, 0, 0, - 0, 0, 0, 0, 0, 50, 0, 0, 15, 0, - 52, 0, 54, 22, 55, 56, 58, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 64, 0, 0, 65, 521, 0, 0, 266, - 266, 0, 0, 0, 216, 0, 0, 0, 0, 0, + 0, 0, 0, 363, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 415, 0, 0, + 0, 0, 424, 0, 0, 403, 0, 0, 406, 407, + 408, 0, 0, 0, 0, 360, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 360, 0, 0, 0, 395, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 410, 0, - 0, 0, 0, 419, 0, 0, 398, 0, 0, 401, - 402, 403, 0, 0, 0, 0, 357, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 466, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, - 40, 41, 40, 0, 41, 0, 0, 102, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, - 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 64, 0, 266, 266, 0, - 0, 0, 0, 535, 0, 0, 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 57, 0, 0, 23, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 64, 0, 269, 269, + 0, 0, 0, 0, 541, 0, 0, 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 361, 0, 0, 362, 294, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 418, 0, 0, 0, - 0, 353, 0, 0, 400, 406, 404, 354, 0, 0, - 0, 460, 0, 0, 461, 0, 0, 0, 0, 465, - 0, 474, 0, 0, 482, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 364, 0, 0, 365, 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 40, 0, 40, 0, 0, 0, 0, - 0, 0, 50, 0, 0, 0, 0, 0, 0, 51, + 0, 325, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, + 0, 0, 356, 0, 0, 405, 411, 409, 357, 0, + 0, 0, 465, 0, 0, 466, 0, 0, 0, 0, + 470, 0, 478, 480, 0, 0, 488, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 40, 0, 40, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, + 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, + 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, + 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 269, 269, 267, 0, 267, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 266, 266, 264, 0, 264, 216, 0, 0, 0, + 0, 0, 0, 0, 0, 244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 293, 366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 290, 363, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 404, 0, 0, 0, + 0, 0, 0, 483, 0, 492, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 489, 490, 0, 0, 0, + 0, 0, 0, 25, 0, 25, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 46, 48, 0, + 48, 10, 11, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 0, 269, 0, 267, 267, 267, 267, 267, 0, 542, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 193, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 235, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 294, 0, 0, 369, 367, + 0, 0, 0, 0, 0, 303, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 327, 328, 329, 402, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, + 0, 353, 354, 355, 418, 0, 0, 481, 0, 0, + 454, 451, 0, 0, 474, 0, 0, 0, 0, 0, + 0, 0, 491, 0, 0, 460, 0, 457, 0, 0, + 0, 0, 25, 0, 0, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 44, 44, 0, 0, + + 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 61, 0, 0, 0, 91, 0, 78, 77, + 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 94, 80, 83, 81, 0, 269, 269, + 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 232, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 370, 368, 0, + 0, 300, 0, 0, 375, 0, 399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 326, 0, 0, 0, 337, 0, 0, 0, 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 399, 0, 0, 0, 0, 0, 0, - 477, 0, 486, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 483, 484, 0, 0, 0, 0, 0, 0, - 25, 0, 25, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 46, 48, 0, 48, 10, 11, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 453, 482, 0, 0, 0, 485, 0, 0, 0, + 0, 0, 459, 0, 0, 0, 0, 24, 0, 0, + 24, 0, 0, 0, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 93, 0, 0, 0, 0, 0, 266, 0, 264, - 264, 264, 264, 264, 0, 536, 0, 0, 0, 0, + 0, 44, 44, 0, 44, 0, 44, 44, 0, 0, + 47, 0, 0, 47, 0, 0, 0, 0, 0, 0, + 0, 0, 106, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 232, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 291, 0, 0, 366, 364, 0, 0, 0, 0, + 0, 268, 268, 268, 268, 268, 215, 0, 0, 0, + 0, 0, 167, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, + 0, 0, 0, 175, 0, 0, 0, 0, 0, 0, - 0, 300, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 324, 325, 326, 397, + 243, 0, 0, 0, 192, 0, 0, 0, 0, 191, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, + 0, 0, 0, 0, 0, 154, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 376, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 342, 0, 0, 0, 0, 0, 350, 351, 352, 413, - 0, 0, 475, 0, 0, 449, 446, 0, 0, 469, - 0, 0, 0, 0, 0, 0, 0, 485, 0, 0, - 455, 0, 452, 0, 0, 0, 0, 25, 0, 0, - 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 44, 44, 0, 0, 48, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, - 91, 0, 78, 77, 0, 79, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 94, 80, 83, - 81, 0, 266, 266, 0, 0, 0, 0, 219, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 229, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 251, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 367, 365, 0, 0, 297, 0, 0, 372, 0, - 394, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 323, 0, 0, 0, 334, 0, - 0, 0, 338, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 448, 476, 0, 0, 0, 479, - 0, 0, 0, 0, 0, 454, 0, 0, 0, 0, - 24, 0, 0, 24, 0, 0, 0, 0, 0, 0, - 0, 0, 6, 0, 44, 44, 0, 44, 0, 44, - 44, 0, 0, 47, 0, 0, 47, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 265, 265, 265, 265, 265, 212, 0, - 0, 0, 0, 166, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 239, 0, 0, 0, - 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, - 0, 240, 0, 0, 0, 189, 0, 0, 0, 0, - 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 233, 0, 0, 0, 0, 0, 153, 153, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 373, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 343, 0, 0, 0, 0, - 0, 0, 459, 0, 0, 0, 480, 0, 0, 0, + 0, 0, 0, 0, 0, 331, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 346, 0, 0, 0, 0, + 0, 0, 464, 0, 0, 0, 486, 0, 0, 0, 0, 0, 0, 24, 25, 26, 0, 0, 0, 0, 0, 0, 103, 44, 43, 44, 44, 43, 0, 0, + 44, 43, 0, 0, 44, 43, 44, 44, 45, 47, 48, 0, 0, 0, 50, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, - 0, 0, 0, 217, 0, 161, 0, 163, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 237, 0, 0, - 0, 0, 0, 0, 0, 230, 0, 0, 0, 0, - 0, 0, 247, 0, 0, 262, 262, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, - 0, 0, 0, 0, 288, 0, 0, 388, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 318, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 339, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, - 0, 43, 0, 44, 44, 43, 0, 43, 0, 0, - 43, 0, 0, 45, 43, 45, 45, 43, 0, 44, - 43, 44, 0, 0, 0, 0, 50, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, - 60, 0, 60, 0, 0, 71, 70, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 87, 69, - 82, 0, 0, 170, 0, 0, 0, 0, 0, 0, - 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 175, 0, 0, 0, 0, 0, 244, 243, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 234, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 152, 0, 0, 0, 0, 289, - 292, 0, 389, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 317, 0, - 0, 0, 0, 0, 0, 0, 0, 376, 0, 378, - - 0, 341, 0, 0, 0, 349, 0, 0, 0, 0, - 0, 481, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 35, 0, 0, 42, 44, 42, 0, 44, 42, - 0, 0, 42, 44, 0, 42, 0, 42, 45, 45, - 42, 45, 26, 0, 18, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, - 0, 0, 96, 96, 0, 67, 0, 0, 0, 0, - 98, 0, 0, 0, 0, 0, 0, 0, 0, 238, - 0, 0, 0, 0, 0, 0, 0, 0, 258, 0, - 177, 177, 0, 245, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 208, - 0, 0, 0, 152, 0, 0, 293, 0, 0, 0, - 396, 0, 0, 299, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 332, 0, 377, 0, 335, 379, 0, 340, 0, 380, - 0, 355, 0, 465, 0, 0, 0, 0, 0, 0, - 0, 28, 0, 0, 0, 0, 0, 0, 42, 42, - 0, 42, 0, 44, 0, 42, 45, 43, 45, 45, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, - - 0, 0, 0, 0, 0, 0, 68, 66, 100, 0, - 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 226, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 253, 0, 0, 0, 235, 0, 0, 0, 231, - 231, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 368, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 314, 0, 0, 0, 0, 0, 327, - 331, 0, 0, 0, 0, 381, 0, 348, 0, 0, + 0, 0, 0, 220, 0, 0, 162, 0, 164, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 240, 0, + 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, + 0, 0, 0, 250, 0, 0, 265, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 43, 43, 45, 45, 43, 45, 0, - 0, 0, 0, 0, 0, 60, 0, 72, 0, 76, - 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, - 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 176, 0, 246, 0, 0, 0, 537, 0, 0, 0, - 0, 0, 0, 0, 0, 252, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, - 287, 0, 369, 0, 298, 370, 0, 0, 0, 0, - 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 478, 0, + 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, + 0, 0, 0, 0, 0, 291, 0, 0, 393, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 321, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 342, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 44, 0, 43, 0, 44, 44, 43, 0, 43, + 0, 0, 43, 0, 0, 45, 43, 45, 45, 43, + 0, 44, 43, 44, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 43, 0, 0, 0, 0, 0, 60, 0, 89, - 95, 95, 0, 86, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 154, 0, 0, 248, 179, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, - 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 210, 0, 295, 296, 371, 0, 0, 0, - 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 321, 0, 333, 0, 0, 0, 0, 0, 407, + 60, 0, 60, 0, 60, 0, 0, 71, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 87, 69, 82, 0, 0, 0, 171, 0, 0, 0, + 0, 0, 0, 174, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 176, 0, 0, 0, 0, 0, 247, + 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 237, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 153, 0, + 0, 0, 0, 292, 295, 0, 394, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 155, 0, 165, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 184, 0, 0, 0, 0, - 0, 0, 0, 193, 193, 0, 195, 195, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 209, 222, 0, - 0, 0, 304, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 447, - 0, 0, 0, 453, 0, 0, 29, 0, 0, 0, - 36, 0, 0, 19, 0, 0, 85, 99, 0, 0, - 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 182, 0, 0, 187, 0, 0, 0, + 0, 0, 320, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 379, 0, 381, 0, 344, 0, 0, 0, + 352, 0, 0, 0, 0, 0, 487, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 35, 0, 0, 42, + 44, 42, 0, 44, 42, 0, 0, 42, 44, 0, + 42, 0, 42, 45, 45, 42, 45, 26, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 191, 0, 0, 0, 305, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 384, 336, 0, 345, 0, - 450, 0, 0, 456, 0, 0, 0, 0, 37, 0, - 20, 0, 160, 225, 225, 0, 160, 156, 0, 0, - 0, 261, 0, 249, 0, 228, 0, 0, 0, 0, - 0, 0, 0, 186, 0, 0, 194, 196, 0, 0, - 0, 0, 151, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 312, 0, 0, 0, 319, 0, + 0, 60, 0, 0, 0, 0, 0, 96, 96, 0, + 67, 0, 0, 0, 0, 98, 0, 0, 0, 0, - 0, 385, 337, 0, 346, 451, 0, 457, 0, 34, - 0, 0, 21, 0, 0, 0, 157, 0, 0, 250, + 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, + 0, 0, 0, 0, 261, 0, 178, 178, 0, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 151, 0, 0, 206, 0, 0, 303, - 0, 0, 0, 0, 0, 0, 0, 330, 344, 347, - 0, 0, 0, 0, 159, 0, 0, 236, 0, 0, - 0, 227, 0, 0, 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 158, 150, 0, 0, 0, 0, 0, 181, + 0, 0, 0, 0, 0, 0, 211, 0, 0, 0, + 153, 0, 0, 296, 0, 0, 0, 401, 0, 0, + 302, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 335, 0, + 380, 0, 338, 382, 0, 343, 0, 383, 0, 358, + 0, 470, 0, 0, 0, 0, 0, 0, 0, 28, - 0, 0, 223, 223, 0, 204, 0, 202, 0, 0, - 0, 254, 0, 301, 0, 0, 0, 313, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, - 0, 0, 185, 0, 0, 0, 200, 0, 198, 0, - 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 38, 0, 171, 171, 0, 0, 0, 0, - 0, 0, 203, 201, 0, 0, 0, 0, 0, 315, - 316, 0, 329, 0, 0, 0, 0, 39, 0, 256, - 178, 0, 183, 0, 199, 197, 0, 0, 0, 320, - 0, 0, 0, 31, 172, 180, 224, 302, 306, 0, + 0, 0, 0, 0, 0, 0, 42, 42, 0, 42, + 0, 44, 0, 42, 45, 43, 45, 45, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, + 0, 0, 0, 0, 68, 66, 100, 0, 0, 0, + 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 229, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 256, 0, 0, 0, 238, 0, 0, 0, 234, + 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 371, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 30, 0, 0, 0, 0, 0, 311, 0, 0, - 0, 32, 0 + 0, 0, 0, 317, 0, 0, 0, 0, 0, 0, + 330, 334, 0, 0, 0, 0, 384, 0, 351, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 43, 43, 45, 45, 43, 45, + 0, 0, 0, 0, 0, 0, 60, 0, 72, 0, + 76, 0, 0, 0, 0, 0, 101, 0, 0, 0, + 0, 0, 165, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 177, 0, 249, 0, 0, 0, 543, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 208, 0, 290, 0, 372, 0, 301, 373, 0, + 0, 0, 0, 311, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 484, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, + 0, 60, 0, 89, 95, 95, 0, 86, 0, 181, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 155, 0, 0, 251, 180, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 195, 195, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 213, 0, + + 298, 299, 374, 0, 0, 0, 0, 310, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 324, 0, + 336, 0, 0, 0, 0, 0, 412, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, + 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 187, 0, 0, 0, 0, 0, 0, 0, + 0, 196, 196, 0, 198, 198, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 212, 225, 0, 0, 0, + 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 452, 0, + 0, 0, 458, 0, 0, 29, 0, 0, 0, 36, + 0, 0, 19, 0, 0, 85, 99, 0, 0, 163, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 185, 0, 0, 190, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 194, 0, 0, 0, 308, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 387, 339, 0, 348, + 0, 455, 0, 0, 461, 0, 0, 0, 0, 37, + 0, 20, 0, 161, 228, 228, 0, 161, 157, 0, + + 0, 0, 264, 0, 252, 0, 231, 0, 0, 0, + 0, 0, 0, 0, 0, 189, 0, 0, 197, 199, + 0, 0, 0, 0, 152, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 315, 0, 0, 389, + 0, 322, 0, 0, 388, 340, 0, 349, 456, 0, + 462, 0, 34, 0, 0, 21, 0, 0, 0, 158, + 0, 0, 253, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 152, 0, 0, + 209, 0, 0, 306, 0, 0, 0, 0, 0, 390, + 0, 0, 333, 347, 350, 0, 0, 0, 0, 160, + + 0, 0, 239, 0, 0, 0, 230, 0, 0, 263, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 312, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 159, 151, + 0, 0, 0, 0, 0, 0, 184, 0, 0, 226, + 226, 0, 207, 0, 205, 0, 0, 0, 257, 0, + 304, 0, 0, 0, 316, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 151, 0, 0, 0, 0, 0, + 188, 0, 0, 0, 203, 0, 201, 0, 258, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 38, 0, 172, 172, 0, 0, 0, 0, 0, 0, + 0, 206, 204, 0, 0, 0, 0, 0, 318, 319, + 0, 332, 0, 0, 0, 0, 39, 0, 259, 179, + 0, 0, 186, 0, 202, 200, 0, 0, 0, 323, + 0, 0, 0, 31, 173, 183, 0, 227, 305, 309, + 0, 33, 30, 0, 182, 0, 0, 0, 0, 314, + 0, 0, 0, 32, 0 } ; static const YY_CHAR yy_ec[256] = @@ -922,956 +927,966 @@ static const YY_CHAR yy_meta[88] = 15, 15, 15, 15, 17, 18, 1 } ; -static const flex_int16_t yy_base[4199] = +static const flex_int16_t yy_base[4251] = { 0, 0, 80, 161, 0, 4, 8, 14, 247, 21, 87, 101, 254, 25, 40, 53, 261, 265, 275, 284, 290, - 94, 304,12015,11962,11879,11877, 324, 347, 365, 383, + 94, 304,11801,11718,11649,11643, 324, 347, 365, 383, 413, 434, 314, 448, 335, 397, 505, 0, 457, 464, 591, 597, 603, 609, 419, 425, 271, 298, 102, 612, - 11863,11859,11858,11855,11806,11805,11802,11776, 614, 622, - 0, 0,11744,11743, 428, 611, 646, 668, 0, 0, - 57, 79, 620, 627,11769,14121, 673,14121,14121,14121, - 308,14121, 4, 25, 59, 52, 71, 72, 96, 279, - 315, 97, 220, 271, 8,14121, 443,14121, 655, 269, + 11644,11641,11597,11591,11590,11587,11561,11555, 614, 622, + 0, 0,11528,11525, 428, 611, 646, 668, 0, 0, + 57, 79, 620, 627,11529,14283, 673,14283,14283,14283, + 308,14283, 4, 25, 59, 52, 71, 72, 96, 279, + 315, 97, 220, 271, 8,14283, 443,14283, 655, 269, 312, 578, 673, 330, 429, 681, 327, 358, 368, 686, - 679, 699, 707, 421, 422, 38,11733, 133, 765, 771, - 783,14121,14121,14121,14121, 789,14121,14121, 631,14121, - 815, 76, 764,14121,14121,14121, 278, 798, 348, 417, - 11680, 801, 372, 829, 752,11679, 540, 814, 855, 895, - 883,11676, 546,11668, 904, 830, 901,14121, 913,14121, - 14121, 918,11662,11661,11658, 924, 957, 964, 934, 980, - 991,11587, 601, 1012,11504, 1024, 725, 1042, 770, 1054, - 831,11435, 625, 1063, 645, 978, 802, 867, 663, 1072, - 14121, 1081,14121,11483, 484, 475, 1047, 719, 764, 874, + 679, 699, 707, 421, 422, 38,11513, 133, 765, 771, + 783,14283,14283,14283,14283, 789,14283,14283, 631,14283, + 815, 76, 764,14283,14283,14283, 278, 798, 348, 417, + 11465, 801, 372, 829, 752,11462, 540, 814, 855, 895, + 883,11454, 546,11448, 904, 830, 901,14283, 913,14283, + 14283, 918,11447,11444,11436, 924, 957, 964, 934, 980, + 991,11430, 601, 1012,11429, 1024, 725, 1042, 770, 1054, + 831,11426, 625, 1063, 645, 978, 802, 867, 663, 1072, + 14283, 1081,14283,11391, 484, 475, 1047, 719, 764, 874, 717, 940, 752, 1056, 800, 953, 1064, 818, 1059, 917, - 821, 885, 405, 1139,14121,11482, 1143, 1147, 476, 309, - 1153, 1159, 410, 1011, 490, 493, 1096, 1114,11425, 911, - 1122, 1124, 1129,11381, 943, 1158,14121, 0, 0, 0, - 14121,14121, 990, 1017, 1053, 1062, 1105, 1118,14121, 120, - 1162,11375, 1113, 1168,14121,14121, 282, 1178,11374, 1116, - 11371, 1199, 1200,14121, 495, 0, 1187,11339, 1135, 1140, - 1144, 1149, 1180, 1172, 1168, 1184,14121, 1173, 1178, 1184, - 1199, 1182, 636,11393, 1229, 620, 1196, 1187, 1190, 1187, + 821, 885, 405, 1139,14283,11185, 1143, 1147, 476, 309, + 1153, 1159, 410, 1011, 490, 493, 1096, 1114,11125, 911, + 1122, 1124, 1129,11124, 943, 1158,14283, 0, 0, 0, + 14283,14283, 990, 1017, 1053, 1062, 1105, 1118,14283, 120, + 1162,11121, 1113, 1168,14283,14283, 282, 1178,11077, 1116, + 11071, 1199, 1200,14283, 495, 0, 1187,11064, 1135, 1140, + 1144, 1149, 1180, 1172, 1168, 1184,14283, 1173, 1178, 1184, + 1199, 1182, 636,11121, 1229, 620, 1196, 1187, 1190, 1187, 1198, 1200, 1198, 1199, 1213, 1221, 297, 1205, 1225, 1220, 1213, 1214, 1234, 1230, 1232, 1236, 1245, 1237, 735, 1243, - 1246, 1254, 1261, 1252, 641,11392,11307, 642, 1321, 1327, - 1333,14121, 1293,14121, 1304,14121, 1294, 1279, 1270, 1283, + 1246, 1254, 1261, 1252, 641,11042,10954, 642, 1321, 1327, + 1333,14283, 1293,14283, 1304,14283, 1294, 1279, 1270, 1283, 1297, 1268, 1304, 1311, 1298, 1302, 1317, 1302, 1314, 1328, - 1321, 1329, 1354, 1321, 1339, 920,11310, 670, 1395, 1405, - 1400,14121, 1409, 1410, 1406, 1416,11304,11303, 998, 1423, - 1431, 1417, 1429, 1435, 1440, 1439,11300,11292, 1391, 1454, - 1467, 1448, 1468, 1474, 1484, 1498, 1504,14121, 1510, 933, - 1514, 1525,11286, 1518,11335, 1541, 1561, 346, 1578, 1584, - 1585,11282,11274, 1609, 1527, 1624, 1642, 1500, 1648,14121, + 1321, 1329, 1354, 1321, 1339, 920,10981, 670, 1395, 1405, + 1400,14283, 1409, 1410, 1406, 1416,10978,10952, 998, 1423, + 1431, 1417, 1429, 1435, 1440, 1439,10946,10945, 1391, 1454, + 1467, 1448, 1468, 1474, 1484, 1498, 1504,14283, 1510, 933, + 1514, 1525,10942, 1518,10984, 1541, 1561, 346, 1578, 1584, + 1585,10928,10927, 1609, 1527, 1624, 1642, 1500, 1648,14283, - 1673, 1677, 1615, 1707, 842, 1708,14121,14121, 1733, 1739, - 1488,11268,11267, 1005, 1722, 1549, 1633, 1684, 1745, 1701, - 1568,11264, 1172, 1751, 1671, 1599, 1664, 1605, 1764, 1767, - 1734, 1780,14121,11229, 949, 816,14121, 1784,14121,11023, + 1673, 1677, 1615, 1707, 842, 1708,14283,14283, 1733, 1739, + 1488,10924,10799, 1005, 1722, 1549, 1633, 1684, 1745, 1701, + 1568,10795, 1172, 1751, 1671, 1599, 1664, 1605, 1764, 1767, + 1734, 1780,14283,10813, 949, 816,14283, 1784,14283,10763, 1463, 1335, 1402, 1444, 1474, 1477, 1503, 1529, 1581, 1753, - 1658, 1746,10992, 1734, 1739, 1728, 1761, 1758, 1774, 1771, - 14121, 1761, 1780, 1778, 1780, 1771, 1767, 1779, 1791, 1829, - 1792, 1782, 1806, 1533,11016, 1879,14121,11013,14121, 1883, - 1907, 1911, 1567, 701, 1917, 1075, 1691, 1560, 1847,10969, - 1923, 1930, 1861, 898, 1755, 1100, 1889, 1035, 1936, 1851, + 1658, 1746,10720, 1734, 1739, 1728, 1761, 1758, 1774, 1771, + 14283, 1761, 1780, 1778, 1780, 1771, 1767, 1779, 1798, 1829, + 1793, 1800, 1811, 1533,10727, 1880,14283,10723,14283, 1907, + 1911, 1915, 1567, 701, 1921, 1075, 1691, 1560, 1847,10651, + 1927, 1936, 1861, 898, 1755, 1100, 1886, 1035, 1940, 1854, - 1110, 1937, 1942,10963, 1860,10908, 1293, 1888,14121, 1941, - 1943,10905,10826, 1428, 1945, 1947, 0, 0, 0, 1829, - 1030, 1882, 1899, 1476, 1921,14121,14121, 1956,10820,10819, - 1955, 1948, 1968,14121, 1979,10816,10790, 1996, 1978, 2008, - 10780, 1919, 1940, 1946, 1936, 1954, 1955, 1975,14121, 1985, - 1984, 1984, 1986, 2035, 1983, 1982, 1967, 2026, 1980, 1992, - 2001, 1633, 1998, 1992, 1669, 2007, 2005, 2003,14121, 2018, - 2003, 2009, 2031, 2026, 2022, 2030, 2067, 2059, 2047, 2041, - 2046, 2057, 2073,14121, 2068, 2084, 2072, 2091, 2109, 2036, - 2123,14121, 2087, 2085, 2080, 2097,14121, 2078, 2093, 2107, + 1110, 1931, 1944,10611, 1943,10551, 1293, 1945,14283, 1947, + 1949,10550,10547, 1428, 1951, 1953, 0, 0, 0, 1825, + 1030, 1825, 1905, 1476, 1927,14283,14283, 1959,10490,10450, + 1960, 1963, 1970,14283, 2011,10444,10443, 1976, 1984, 2022, + 10436, 1931, 1948, 1952, 1957, 1969, 1970, 1980,14283, 1991, + 1991, 1990, 1993, 2049, 1991, 1991, 1993, 2041, 1987, 2000, + 2013, 1633, 2010, 2006, 1669, 2017, 2019, 2016,14283, 2029, + 2016, 2028, 2049, 2046, 2043, 2049, 2073, 2072, 2066, 2052, + 2058, 2063, 2086,14283, 2087, 2101, 2089, 2107, 1948, 2065, + 2069,14283, 2102, 2096, 2092, 2109,14283, 2088, 2102, 2116, - 14121, 2092, 2099,14121,14121, 2108, 2103, 2098,14121, 2103, - 2120, 2112, 2107, 2106, 2110, 2116, 2130, 2122, 2108, 2164, - 10755,10780, 2185, 2194,10772, 2168,10738,10765, 2198, 2205, - 10762, 2204,10609,10633, 2221, 2222, 2196, 2211, 2215, 2184, - 2251, 856, 2282,10636, 2230, 2231, 2288,10547, 2253,10501, - 10511, 2313, 2322, 2347, 2255, 2348, 2380, 2409, 2410, 2440, - 10546, 2281, 2265, 2384, 2444, 2470, 2474,10435, 2257,10367, - 10389, 2458, 2500, 2186, 2247,10360,10385, 2378, 2379, 2391, - 14121, 2195, 2232, 2246, 2259, 2274, 2269, 2294,10357, 2281, - 2295, 2309, 2332, 2370, 2390, 2497, 2393, 2430, 2427,10317, + 14283, 2101, 2108,14283,14283, 2117, 2112, 2104, 2120, 2110, + 2126, 2118, 2113, 2113, 2119, 2128, 2141, 2135, 2123, 2180, + 10337,10329, 2194, 2205,10261, 2188,10143,10153, 2209, 2216, + 10135, 2215, 9783, 9392, 2226, 2233, 2198, 2207, 2250, 2175, + 2273, 856, 2282, 9430, 2224, 1994, 2291, 9390, 2306, 9361, + 9388, 2369, 2242, 2378, 2206, 2387, 2399, 2422, 2431, 2456, + 9426, 2259, 2285, 2413, 2482, 2491, 2500, 9386, 2260, 9357, + 9384, 2351, 2365, 2197, 2276, 9355, 9382, 2452, 2329, 2467, + 14283, 2250, 2259, 2277, 2276, 2286, 2272, 2284, 9410, 2269, + 2278, 2303, 2336, 2358, 2356, 2511, 2375, 2405, 2396, 9409, - 2433, 2449, 2459,14121, 2459, 2463, 2464, 2468, 2471, 2494, - 10311, 2495, 2500, 2502, 2492, 2489, 2512, 2501, 2496, 2519, - 2498, 2523, 2521, 2511, 2528, 2525, 2543, 2516, 2543,10310, - 10307, 2526, 2245, 2392, 2421, 2486, 2485, 2597, 2598, 2605, - 2606,10257, 2610, 2618, 1372, 2622, 2626, 2628,10221, 2632, - 2636, 2638, 2537, 2596,10071,10009, 9991, 2637, 9945, 9649, - 2582, 2581, 2583, 2588, 9225, 2641, 9196, 9223, 9222, 2651, - 9193, 9220, 92, 2596, 2598, 2617, 2606, 2606,14121, 2607, - 2620, 2630, 2634, 2616, 2638, 2666, 2653, 2656, 2650, 2629, - 2644, 2649, 2667, 2671, 2670, 2678, 2680, 2680, 2695,14121, + 2398, 2399, 2407,14283, 2437, 2441, 2442, 2470, 2467, 2483, + 2490, 9408, 2487, 2510, 2492, 2482, 2491, 2512, 2521, 2497, + 2517, 2498, 2537, 2517, 2515, 2532, 2530, 2538, 2529, 2551, + 9407, 9406, 2534, 2254, 2303, 2339, 2607, 2344, 2613, 2614, + 2360, 2621, 9430, 2398, 2628, 1372, 2629, 2579, 2635, 9429, + 2636, 2606, 2642, 2539, 2597, 9346, 9373, 9372, 2638, 9343, + 9370, 2590, 2587, 2590, 2598, 9369, 2646, 9340, 9367, 9332, + 2656, 9303, 9330, 92, 2601, 2601, 2622, 2609, 2608,14283, + 2610, 2622, 2630, 2636, 2618, 2640, 2651, 2669, 2671, 2668, + 2633, 2650, 2651, 2672, 2676, 2659, 2685, 2679, 2672, 2690, - 2667, 2710, 9218, 2679,14121, 2682, 9217,14121, 2705, 2702, - 2691, 2706, 2710, 2708, 2703, 9216, 2698, 2705, 2711, 2723, - 2709, 2716, 2304, 2727, 2724, 2715, 9215, 2716, 2725, 2754, - 2728, 2742,14121, 2674, 2739, 2729, 2745, 2736, 2731, 2750, - 2754, 2752, 2768, 2752,14121, 2769, 2768, 2759, 2770, 2771, - 2774, 2779, 2774, 2772, 2779, 1723, 2813, 2831, 2809, 2840, - 2846, 2820, 2842, 2852, 2853, 2866, 947, 2862, 2854, 9252, - 2887, 42, 2857, 9212, 916, 9211,14121, 9249,14121, 2886, - 2850, 2910, 2953, 2954, 1309, 2974, 2864, 2920, 9248, 2973, - 3007, 3016, 3039, 2316, 3048, 3060, 2978, 2847, 3069,14121, + 14283, 2735, 2716, 9327, 2675,14283, 2689, 9326,14283, 2710, + 2710, 2696, 2714, 2720, 2717, 2713, 9314, 2705, 2711, 2717, + 2728, 2713, 2720, 2241, 2732, 2729, 2719, 9277, 2720, 2728, + 2777, 2730, 2743,14283, 2777, 2742, 2735, 2752, 2748, 2745, + 2760, 2761, 2761, 2777, 2762,14283, 2779, 2770, 2779, 2772, + 2779, 2780, 2782, 2786, 2781, 2779, 2787, 1723, 2822, 2851, + 2402, 2848, 2855, 2818, 2857, 2866, 2864, 2875, 947, 2825, + 2852, 9316, 2892, 42, 2865, 9276, 916, 9274,14283, 9312, + 14283, 2891, 2886, 2915, 2924, 2945, 1309, 2975, 2873, 2927, + 9309, 2968, 2993, 2989, 3033, 1837, 3037, 3058, 3046, 1847, - 9247,14121, 989, 2867, 3085, 3106, 2853, 2876, 3081, 2877, - 2937, 2995, 2930, 2843, 2855, 2869, 2868, 2885, 2878, 2926, - 3084,14121, 2964, 2968,14121, 9236, 2956, 3130, 3153, 2982, - 2989, 2980,14121, 2994, 3037, 3037,14121, 3047, 3059, 3071, - 3054, 3064, 9251, 3069, 3086, 3082, 3094, 3097, 3108, 3093, - 3134, 3115, 3119, 3136, 3138, 3133, 3150, 3130, 3142, 3152, - 3143, 3135, 9238, 3147, 3141, 3154, 3159, 3150, 3160, 3155, - 3160, 3167,14121, 9208, 3155, 2909, 3011, 3122, 3102, 3123, - 3219, 3203, 3231, 3232, 3238, 3239, 9207, 3240, 3245, 3246, - 3251, 3252, 3257, 3258, 2985, 3256, 3028, 3258, 3176, 3198, + 3057,14283, 9308,14283, 989, 1878, 3090, 3094, 2817, 2909, + 3014, 2831, 2908, 2966, 2884, 2852, 2911, 2945, 2949, 2965, + 2958, 2985, 3062,14283, 3048, 3051,14283, 9249, 3037, 3108, + 3133, 3055, 3058, 3070,14283, 3081, 3088, 3099,14283, 3102, + 3104, 3105, 3086, 3094, 3091, 9264, 3094, 3101, 3100, 3122, + 3123, 3132, 3118, 3147, 3123, 3130, 3146, 3138, 3133, 3150, + 3130, 3142, 3152, 3143, 3135, 9245, 3148, 3145, 3152, 3166, + 3157, 3161, 3155, 3161, 3168,14283, 9096, 3156, 2949, 3010, + 3075, 3028, 3076, 3232, 3217, 3233, 3239, 3240, 3245, 9063, + 3246, 3251, 3252, 3257, 3258, 3263, 3264, 2957, 3262, 3220, - 3216, 2934, 3260, 3259, 3264, 3262, 9148, 9129,14121, 3225, - 3228,14121, 3246, 3246, 3240, 3235, 3236, 3259, 3242, 3257, - 3261, 3263, 3249, 3260, 3248, 3275, 3250, 3255, 3297, 3303, - 3287, 3287, 3288, 3292, 3293, 3299, 3301, 3301, 3313, 3301, - 3311, 3309, 3320, 3311, 3312,14121, 3350, 3306, 3319, 3371, - 3315, 3325, 3336, 3346, 3357, 3360, 3351, 3347, 3361, 9148, - 3367, 3369, 3355, 3357, 3362,14121, 3359, 3363, 3360, 3404, - 3377, 3383,14121, 3383, 3377, 3379, 3397, 3412, 3413, 3395, - 3394, 3405, 3407, 3419, 3406, 3413,14121, 3413, 3430, 3418, - 3429, 3428, 3426, 3435, 3427, 3429, 3445, 3426, 9120, 9099, + 3264, 3224, 3210, 3234, 2907, 3269, 3265, 3275, 3268, 8881, + 8857,14283, 3232, 3231,14283, 3252, 3253, 3250, 3246, 3246, + 3268, 3250, 3265, 3269, 3272, 3258, 3268, 3257, 3310, 3266, + 3272, 3297, 3305, 3288, 3294, 3297, 3300, 3301, 3307, 3309, + 3311, 3321, 3307, 3319, 3318, 3329, 3320, 3321,14283, 3359, + 3316, 3328, 3376, 3323, 3331, 3336, 3354, 3365, 3369, 3361, + 3357, 3370, 8865, 3375, 3377, 3363, 3366, 3371,14283, 3368, + 3372, 3369, 3413, 3386, 3389,14283, 3391, 3381, 3381, 3388, + 3410, 3419, 3401, 3403, 3414, 3416, 3428, 3414, 3420,14283, + 3422, 3423, 3440, 3428, 3439, 3438, 3438, 3445, 3436, 3439, - 9070, 9089, 9060, 3501, 3479, 1508, 9087, 9058, 3510, 3480, - 3484, 3487, 1344, 3519, 3545, 3522, 3579, 3554, 3588, 3525, - 3602, 9082, 9050, 3442, 8967, 3479, 8956, 3479, 3472,14121, - 3470,14121, 3485, 3504, 3550, 3538, 3560, 8839, 3577, 3627, - 3569, 3565, 3577, 3584, 3589,14121,14121, 8737, 3586,14121, - 3597, 8752, 0, 3594, 3582, 3602, 3607, 3623, 3616, 3627, - 3651, 3631, 3619, 3644, 3638, 3635, 3648, 3652, 3652, 3642, - 3654, 3653, 3656,14121, 3658, 3654, 3659, 3654, 3658, 8743, - 3663, 3659, 3668, 3670, 8655, 18, 8549, 3573, 3616, 3617, - 3621, 3711, 3732, 3718, 3733, 3739, 3740, 3741, 3746, 3665, + 3451, 3431, 8836, 8860, 8778, 8788, 8753, 3505, 3499, 1508, + 8725, 8688, 3517, 3500, 3479, 3485, 1344, 3526, 3538, 3539, + 3592, 3571, 3604, 3541, 3613, 8706, 8656, 3469, 8610, 3499, + 8666, 3513, 3510,14283, 3512,14283, 3526, 3556, 3573, 3580, + 3567, 8638, 3588, 3660, 3580, 3576, 3588, 3587, 3593,14283, + 14283, 8550, 3590,14283, 3600, 3606, 8565, 0, 3599, 3587, + 3607, 3609, 3612, 3599, 3609, 3669, 3633, 3624, 3642, 3656, + 3654, 3668, 3672, 3672, 3662, 3673, 3672, 3675,14283, 3676, + 3669, 3674, 3669, 3673, 8512, 3678, 3674, 3683, 3685, 8453, + 18, 8431, 3561, 3567, 3577, 3585, 3654, 3720, 3719, 3747, - 8470, 8469, 8393, 3682, 3688, 3704, 8379, 8292, 8319, 8285, - 8291, 8283, 3705, 3715, 3720,14121, 3721, 3708,14121, 3714, - 3720, 3709, 3722, 3724, 3718, 3723, 3720, 3723, 3727, 3738, - 3719, 3740, 3741, 3732, 3733, 3728, 3740, 3733, 3745, 3751, - 3770, 3764, 3759, 3765, 3777, 3764, 3762, 3765, 3781, 3783, - 3785, 3774, 3790, 3787,14121, 3778, 3789, 3794, 3781, 3772, - 3783,14121, 3815, 3794, 3009, 3780, 3800, 3801, 8239, 3830, - 3822, 3823, 3819, 8215, 3814, 3820, 3838, 3823, 8214, 3829, - 8205, 3843, 3829, 3832, 3839, 3844, 3846, 3846, 8201, 3837, - 14121, 3844, 3833, 3837, 3849, 3840, 3852, 3866, 3870, 3872, + 3748, 3753, 3754, 3759, 3666, 8319, 8259, 8173, 3687, 3714, + 3718, 8200, 8158, 8147, 8094, 8062, 8031, 3717, 3727, 3732, + 14283, 3733, 3720,14283, 3726, 3732, 3721, 3734, 3736, 3730, + 3734, 3731, 3734, 3738, 3749, 3730, 3751, 3752, 3743, 3744, + 3739, 3750, 3743, 3757, 3777, 3784, 3776, 3771, 3777, 3789, + 3776, 3774, 3777, 3793, 3795, 3797, 3786, 3801, 3798,14283, + 3789, 3800, 3805, 3792, 3783, 3794,14283, 3835, 3806, 2941, + 3792, 3809, 3811, 7988, 3817, 3830, 3831, 3828, 7987, 3823, + 3830, 3848, 3833, 7986, 3839, 7834, 3855, 3841, 3843, 3850, + 3855, 3857, 3857, 7822, 3848,14283, 3855, 3845, 3849, 3860, - 3887, 3888, 3879,14121, 3873, 3890, 3894, 3871, 3883, 3878, - 3884, 3896, 3900, 3915, 2888, 1689, 8239, 3916, 3959, 1818, - 8200, 3950, 1837, 3960, 1749, 2990, 3980, 3918, 3902, 3938, - 14121, 3897, 3941, 3946, 3935, 3944, 3951, 3963, 3957, 0, - 4008, 3945,14121, 3957, 3969, 3955, 3975, 3976, 4018, 3995, - 3998, 8146, 3986, 8026, 8012, 7955, 7951, 7949, 3989, 4049, - 3999, 7945, 7729, 4011, 4003, 4017, 4007, 4020, 4012, 4023, - 4028, 4012, 4016,14121, 4051, 4035, 4035, 4060,14121, 4058, - 4053, 4048, 4062, 4054, 4049, 966, 7687, 2182, 0, 3935, - 3936, 4036, 4040, 4042, 3052, 4067, 4058, 7665, 7660, 4068, + 3850, 3862, 3866, 3879, 3885, 3898, 3900, 3891, 3903,14283, + 3886, 3903, 3907, 3884, 3896, 3891, 3897, 3909, 3913, 3927, + 2307, 1689, 7858, 3928, 3971, 1903, 7803, 3964, 2395, 3989, + 1749, 2447, 4015, 3931, 3914, 3955,14283, 3906, 3942, 3946, + 3939, 3948, 3956, 3973, 3967, 0, 4033, 3957,14283, 3969, + 3988, 3974, 4005, 3991, 4031, 4008, 4016, 4009, 7787, 4005, + 7769, 7762, 7749, 7745, 7703, 4005, 4072, 4006, 7602, 7599, + 4018, 4010, 4024, 4014, 4026, 4030, 4041, 4045, 4030, 4052, + 14283, 4072, 4055, 4057, 4079,14283, 4076, 4070, 4065, 4079, + 4071, 4066, 966, 7528, 2483, 0, 3948, 3952, 4060, 3997, - 4059, 4103, 4064, 4061, 4059, 4066, 4069, 4064, 4081, 4072, - 4083, 4075, 4101, 4087, 4094, 4104, 4104, 4092, 4115, 4106, - 4107, 4119, 4122, 4123, 4108, 4123, 4116, 4110, 4127, 4122, - 4159, 4127, 4138, 4123, 4145, 4139, 4158, 4147, 4166, 4153, - 4149, 4166, 4161, 4169, 4164, 4168, 4171, 4171, 4187, 4180, - 4178, 4176,14121, 7664, 7652, 7631, 4192, 4180, 4195, 4194, - 4182, 4217, 7606, 7498, 4199, 4210, 4223, 4233, 4211, 4204, - 4219, 4214, 4222, 4226, 4238, 4243, 4244, 4238, 4244, 4245, - 4245, 4231, 4241, 4255, 4236, 4257, 4248, 4249, 4251, 4272, - 4275, 4282, 4280, 4270, 4291,14121, 4272, 4281, 4284, 4275, + 4061, 3276, 4084, 4075, 7431, 7418, 4085, 4076, 4066, 4080, + 4077, 4074, 4080, 4083, 4077, 4094, 4085, 4097, 4089, 4121, + 4100, 4097, 4125, 4124, 4114, 4134, 4122, 4123, 4136, 4136, + 4140, 4125, 4140, 4133, 4128, 4145, 4136, 4176, 4140, 4151, + 4137, 4159, 4152, 4161, 4167, 4186, 4175, 4169, 4183, 4178, + 4186, 4181, 4185, 4188, 4188, 4203, 4196, 4193, 4190,14283, + 7341, 7128, 7122, 4206, 4193, 4208, 4208, 4196, 4237, 7115, + 7106, 4213, 4232, 4240, 4261, 4231, 4222, 4234, 4229, 4237, + 4238, 4252, 4256, 4259, 4252, 4258, 4259, 4259, 4244, 4254, + 4275, 4252, 4273, 4265, 4276, 4273, 4289, 4295, 4302, 4302, - 4309, 4326, 4328, 4273, 4293, 4299, 4304,14121, 4303, 4312, - 4307, 4325, 4311, 4318, 4369, 2441, 7409, 4375, 4333, 7414, - 7390, 4310, 4322, 4333, 4359, 4389, 4333, 4361,14121, 4347, - 14121, 4364,14121,14121,14121,14121, 7363, 4347, 4382, 4417, - 7343, 4374, 4384, 4387, 4386, 4389, 4390, 4384, 4386, 4396, - 4419, 4411, 4399, 4420, 4424, 4404, 4425, 4422, 4430, 4431, - 4432, 4421, 7308, 3511, 7319, 0, 4465, 4433, 4456, 7154, - 1989, 4425, 4427, 4470,14121, 4443, 4431, 4434, 4444, 4463, - 4437, 4440, 4462, 4456, 4457, 4468, 4460, 4465, 4475, 4472, - 4470, 4471, 4472, 4471, 4472, 4480, 4476, 4486, 4487, 4493, + 4297, 4287, 4305,14283, 4290, 4299, 4302, 4292, 4325, 4361, + 4371, 4291, 4309, 4314, 4316,14283, 4317, 4325, 4309, 4345, + 4335, 4342, 4389, 2971, 7086, 4390, 4362, 7114, 7110, 4343, + 4349, 4361, 4374, 4413, 4369, 4382,14283, 4373, 4374,14283, + 4390,14283,14283,14283,14283, 7085, 4374, 4395, 4440, 7064, + 4397, 4408, 4416, 4419, 4422, 4423, 4424, 4425, 4434, 4440, + 4432, 4420, 4441, 4445, 4425, 4445, 4442, 4452, 4453, 4454, + 4443, 7013, 4350, 7050, 0, 4404, 4454, 4477, 6983, 2002, + 4446, 4447, 4490,14283, 4462, 4454, 4466, 4476, 4487, 4462, + 4470, 4490, 4480, 4481, 4491, 4480, 4486, 4496, 4493, 4491, - 4483, 4494, 4482, 4501, 4499, 4486, 4499, 4502, 4507, 4519, - 4521, 4524, 4513, 4513, 4516, 4516, 4523, 4519, 4516, 4535, - 4536, 4526, 4523, 4543, 4560, 4541, 4528, 4545,14121, 4538, - 4540, 4530, 4545, 4548, 4553, 4571, 4555, 4559, 4562, 7065, - 4568, 4567, 4582, 4572, 4575, 4572, 4588, 4631, 4608, 7051, - 4588, 4593, 4581,14121, 4594, 4590,14121, 4598, 4584,14121, - 14121,14121, 4582, 4594, 4613, 4618,14121, 4607, 4619, 4612, - 4619, 4619, 4633, 4623, 4625, 4627, 4643, 4644, 4645, 4647, - 4637, 4653, 4657, 4662, 4646, 4649, 4658, 4667, 4684, 2191, - 7057, 4689, 4675,14121, 4673, 4689, 4690, 4692, 4693, 4685, + 4492, 4493, 4491, 4492, 4502, 4498, 4508, 4509, 4514, 4504, + 4514, 4501, 4524, 4531, 4518, 4524, 4532, 4534, 4544, 4545, + 4548, 4536, 4536, 4537, 4537, 4544, 4540, 4537, 4556, 4557, + 4546, 4543, 4565, 4583, 4563, 4549, 4566,14283, 4559, 4560, + 4549, 4576, 4572, 4575, 4594, 4580, 4583, 4585, 6732, 4591, + 4589, 4604, 4594, 4595, 4593, 4608, 4651, 4627, 6708, 4611, + 4615, 4602,14283, 4614, 4610,14283, 4620, 4609,14283,14283, + 14283, 4603, 4624, 4644, 4644,14283, 4632, 4649, 4641, 4644, + 4643, 4657, 4647, 4647, 4648, 4665, 4667, 4665, 4663, 4671, + 4660, 4678, 4701, 4687, 4667, 4679, 4684, 4690, 4708, 4726, - 7026, 4731, 7021, 3568, 7058, 4682, 0,14121, 7040, 4699, - 4689, 4751, 4696, 4716, 4724, 4724, 4717, 7035, 4736,14121, - 7002, 4717, 4777, 4746, 4748, 4736, 4741, 4741, 4746, 4760, - 4756, 4776,14121, 4784, 4777, 4785, 4784, 4786, 4788, 4787, - 4787, 4794, 4781, 4782, 4778, 3580, 4814, 6939, 6797, 6673, - 4782, 4790, 0, 4857, 4791, 4796,14121, 4802, 4803, 4816, - 4818, 4836, 4821, 4837, 4836, 4845, 4838, 4828, 4843, 4832, - 4836, 4832, 4848, 4843, 4844, 4855, 4850, 4833, 4840, 4843, - 4851, 4858, 4920, 4846, 4854, 4853, 4868, 4889, 4889, 4880, - 4886, 4884, 4899, 4895, 4886, 4901, 4898, 4936, 4904, 4905, + 6716, 4714, 4699,14283, 4698, 4714, 4715, 4717, 4716, 4709, + 6682, 4780, 6678, 4742, 6711, 4707, 0,14283, 6668, 4725, + 4715, 4782, 4716, 4731, 4735, 4735, 4763, 6490, 4745, 4782, + 14283, 6475, 4743, 4823, 4789, 4791, 4778, 4783, 4780, 4786, + 4787, 4783, 4800,14283, 4804, 4797, 4830, 4834, 4831, 4834, + 4833, 4833, 4840, 4827, 4828, 4823, 4827, 4860, 6311, 6300, + 6295, 4826, 4834, 0, 4815, 4832, 4837,14283, 4838, 4839, + 4840, 4841, 4856, 4841, 4857, 4868, 4881, 4877, 4871, 4886, + 4875, 4879, 4875, 4891, 4886, 4887, 4898, 4893, 4876, 4882, + 4886, 4894, 4901, 4937, 4887, 4893, 4893, 4896, 4909, 4909, - 4908, 4907, 4912, 4909,14121, 4906, 4902, 4941,14121, 4920, - 4918, 4924, 4938, 4931, 4938, 4952, 4953, 4946, 6648, 4952, - 14121, 4949, 4955, 4941, 4943, 4957, 4945, 4947, 4977, 4952, - 4959, 4965, 4963, 4968, 4956, 4957,14121, 5002, 4975, 4972, - 4976,14121, 4983, 4991,14121,14121,14121,14121, 5004, 6636, - 4989, 4988, 5000, 4995,14121, 5007, 5000, 5001, 5010, 5005, - 5012,14121, 5017, 5051,14121, 5022, 5015, 5016, 5022, 5016, - 5025, 5039, 5063, 5078, 5031, 5040, 5061, 5046, 5049, 5060, - 5070, 5057, 5065, 5134, 6680, 5095, 5103, 6445, 6437, 5104, - 5082, 5090,14121, 5097, 5112, 5098, 5107, 5099, 5105,14121, + 4900, 4918, 4919, 4934, 4931, 4923, 4942, 4939, 4977, 4945, + 4946, 4949, 4947, 4952, 4949,14283, 4947, 4943, 4976,14283, + 4962, 4962, 4964, 4959, 4966, 4967, 4976, 4979, 4982, 6199, + 4989,14283, 4985, 4992, 4979, 4984, 4998, 4988, 4989, 5008, + 4995, 5002, 5007, 5004, 5009, 4997, 4998,14283, 5044, 5013, + 5007, 5007,14283, 5013, 5020,14283,14283,14283,14283, 5025, + 6091, 5013, 5013, 5037, 5031,14283, 5046, 5042, 5043, 5053, + 5047, 5054,14283,14283, 5058, 5077,14283, 5063, 5057, 5058, + 5061, 5057, 5067, 5075, 5106, 5088, 5070, 5071, 5111, 5084, + 5084, 5091, 5101, 5096, 5104, 5177, 6132, 5139, 5140, 6108, - 5105, 5123, 5121, 5180, 6419, 5122, 5114,14121, 5110, 5131, - 5131, 5133, 5134, 5130, 5135, 5131, 5160, 5137, 5156, 5175, - 5167, 5169, 5183, 5190, 5187, 5175, 5188, 5178, 5194, 5195, - 5186, 2177, 6246, 5261, 6241, 5265,14121, 5187, 6276, 5182, - 5203, 5196, 5234, 5235, 5244, 5237, 5238, 5234, 5240, 5246, - 5231, 5243, 5238, 6186, 5116, 5247, 5254, 5254, 5236, 5237, - 5245, 5252,14121, 5254, 5262, 5260, 5250, 5323, 5265, 5250, - 5295, 5296, 5293, 5298, 5298, 5290, 5297, 5306, 5304, 5300, - 5296, 5297, 5291, 5341, 5293, 5302, 5308, 5310, 5315, 5317, - 5304, 5309, 5323, 5146,14121, 5312, 5318, 5309, 5322, 5343, + 6059, 5146, 5121, 5125,14283, 5128, 5136, 5124, 5133, 5127, + 5134,14283, 5142, 5140, 5160, 5159, 5223, 5994, 5165, 5158, + 14283, 5155, 5171, 5174, 5176, 5177, 5173, 5178, 5174, 5175, + 5173, 5193, 5201, 5215, 5210, 5225, 5233, 5230, 5218, 5231, + 5221, 5237, 5238, 5229, 2600, 5963, 5276, 5961, 5304,14283, + 5230, 5977, 5225, 5241, 5237, 5255, 5273, 5281, 5274, 5275, + 5272, 5278, 5284, 5269, 5282, 5277, 5787, 5213, 5286, 5293, + 5293, 5275, 5276, 5284, 5290,14283, 5292, 5300, 5297, 5288, + 5361, 5303, 5286, 5307, 5308, 5309, 5334, 5334, 5327, 5334, + 5343, 5341, 5338, 5334, 5335, 5329, 5379, 5331, 5340, 5346, - 5343, 5334, 5335, 5338, 5341, 5348, 5387, 5363, 5352, 5352, - 5355, 5356, 5359, 5361, 5367, 5364, 5380, 5382, 5390, 5408, - 5399, 5394, 5400, 5407, 5405, 5407, 5421, 5413, 5412, 5415, - 5430, 5418, 5434,14121, 6036, 5435, 5437, 5431, 5438, 6077, - 14121, 5962,14121, 5437, 5436, 5447, 5438, 5430, 5436, 5456, - 5455, 5444,14121,14121, 5447, 5460, 1035, 1169, 5455, 5458, - 5489, 5490, 5500, 5482, 5486, 5480, 5480, 5491, 5480, 5494, - 5489, 5502, 5491, 5282,14121, 5507, 5517, 5525,14121,14121, - 5501, 5490, 5489, 5495, 5503, 5508, 5499, 5511, 5500, 5526, - 5585, 5564, 5509, 5517, 5559, 5552, 5553, 5553, 5568, 0, + 5348, 5353, 5355, 5342, 5347, 5361, 5376,14283, 5350, 5356, + 5347, 5350, 5378, 5379, 5365, 5369, 5375, 5378, 5386, 5425, + 5401, 5390, 5390, 5394, 5395, 5399, 5402, 5406, 5403, 5421, + 5420, 5428, 5446, 5437, 5432, 5439, 5449, 5445, 5449, 5465, + 5453, 5453, 5458, 5472, 5458, 5476,14283, 5734, 5478, 5476, + 5470, 5478, 5785,14283, 5753,14283, 5477, 5475, 5486, 5478, + 5469, 5475, 5495, 5494, 5482,14283,14283, 5485, 5498, 1035, + 1169, 5493, 5496, 5163, 5528, 5538, 5521, 5524, 5518, 5518, + 5529, 5518, 5532, 5527, 5540, 5529, 5214,14283, 5545, 5555, + 5563,14283,14283, 5539, 5528, 5527, 5533, 5541, 5546, 5537, - 5569, 5580, 5561, 5580, 5570, 5586, 5596, 5582,14121, 5598, - 5599, 5600, 5601, 5603, 5591, 5597, 5608, 5612, 5608, 5603, - 5622,14121, 5606, 5623, 5634, 5635, 5632, 5905, 5724, 5670, - 1957, 5673, 5685, 5688, 5638,14121, 5646, 5638, 5645, 5656, - 5744, 5652, 5652, 5656, 5653, 5660, 5656, 5671, 5663, 5661, - 5661, 5390, 5709, 5679, 5684, 5670, 5673, 5678, 5681, 5681, - 5693, 5684, 5691, 5396, 0, 5717, 5714, 5712, 5726, 5715, - 5712, 5711, 5711, 5722, 5720, 0, 5734, 5735, 5741, 5724, - 0, 5802, 5729, 5746, 5734, 5753, 5762, 5575, 5767, 5777, - 5770,14121, 5783, 5771, 5160, 5564, 5773, 5772, 5769, 5789, + 5541, 5549, 5538, 5566, 5625, 5602, 5547, 5555, 5598, 5591, + 5591, 5592, 5607, 0, 5607, 5609, 5600, 5619, 5608, 5622, + 5636, 5622,14283, 5638, 5639, 5640, 5641, 5643, 5631, 5637, + 5647, 5651, 5646, 5642, 5661,14283, 5645, 5661, 5663, 5674, + 5671, 5684, 5579, 5709, 1883, 5712, 5725, 5728, 5678,14283, + 5686, 5678, 5685, 5696, 5784, 5692, 5691, 5695, 5692, 5699, + 5695, 5710, 5702, 5699, 5700, 5428, 5749, 5717, 5721, 5709, + 5710, 5717, 5716, 5720, 5733, 5724, 5731, 5434, 0, 5756, + 5753, 5751, 5765, 5754, 5751, 5750, 5749, 5757, 5758, 0, + 5773, 5774, 5780, 5763, 0, 5441, 5768, 5784, 5768, 5775, - 5795, 5778, 5794, 5784, 5782, 5800, 5793, 5798, 5790, 5799, - 5798, 5807, 5814, 5802, 5798, 5813,14121,14121,14121,14121, - 5806, 5820, 5832, 5813, 5828, 5835, 5837, 5837, 5835, 5825, - 5718, 5846, 5838, 5852, 5839, 5854,14121,14121,14121,14121, - 5851, 5839,14121, 5840, 5761,14121,14121, 5854, 5847,14121, - 5847, 5843, 5860, 5853, 5866, 5863, 5870,14121, 1446, 1625, - 14121, 2341,14121, 5863, 5867, 5884, 5693, 5661, 5705, 5539, - 5911,14121, 5875, 5888, 5889, 5880, 5896, 5890, 5886, 5888, - 5896, 250, 5958, 5533, 5499, 5498, 5927, 5461, 5928, 5902, - 5908, 5909, 5901, 5903, 5900, 5906,14121, 5918, 5907, 5915, + 5786, 5845, 5791, 5802, 5808,14283, 5821, 5809, 5602, 5838, + 5811, 5811, 5807, 5824, 5833, 5818, 5834, 5824, 5822, 5840, + 5833, 5838, 5830, 5839, 5838, 5847, 5852, 5854, 5842, 5838, + 5853,14283,14283,14283,14283, 5846, 5860, 5859, 5852, 5867, + 5874, 5876, 5877, 5875, 5865, 5574, 5886, 5879, 5893, 5880, + 5895,14283,14283,14283,14283, 5892, 5880,14283, 5881, 5613, + 14283,14283, 5895, 5888,14283, 5889, 5884, 5905, 5893, 5906, + 5903, 5910,14283, 1446, 1625,14283, 2350,14283, 5903, 5907, + 5914, 5543, 5537, 5745, 5536, 5948,14283, 5914, 5927, 5928, + 5919, 5936, 5930, 5926, 5928, 5937, 250, 5983, 5402, 5372, - 5971, 5934, 5932, 5946, 5957, 5938, 5943, 5968, 5966, 5963, - 5971, 5971, 5959, 5975, 5962, 5965, 0, 5969, 5972, 5980, - 14121, 5985,14121,14121, 5965,14121, 5975, 5976, 5979, 5276, - 5979, 5982, 5984, 5982, 5993, 5995, 5993,14121,14121, 5992, - 14121, 6011, 5233, 6053, 5179, 6065, 6002, 6028,14121, 6026, - 6018, 6071, 5940, 6024, 6030, 6043, 6042, 6029, 6025, 6032, - 6081, 6040, 6039, 6057, 6043, 6046, 6056, 6055, 6064, 0, - 6099, 6112, 6065, 6061, 6080, 6081, 6084, 6084, 6095, 6097, - 14121, 6130, 6088, 5228, 6092, 6101, 6104, 6095, 6107, 6105, - 6106, 6112, 6098, 6114, 0, 6106, 6112, 6107, 6121, 5176, + 5278, 5968, 5164, 5969, 5943, 5948, 5951, 5942, 5945, 5951, + 5957, 5947,14283, 5970, 5955, 5962, 6023, 5967, 5965, 5988, + 5984, 5980, 5988, 6007, 6004, 6014, 6022, 6021, 6009, 6022, + 6009, 6014, 0, 6018, 6019, 6027,14283, 6034,14283,14283, + 6014,14283, 6024, 6025, 6028, 5191, 6028, 6031, 6033, 6026, + 6034, 6036, 6034,14283,14283, 6029,14283, 6050, 5150, 6107, + 5112, 6111, 6034, 6063,14283, 6083, 6051, 6014, 6119, 6076, + 6081, 6088, 6092, 6078, 6074, 6081, 6129, 6088, 6084, 6100, + 6087, 6089, 6099, 6098, 6107, 0, 6169, 6170, 6110, 6100, + 6119, 6125, 6128, 6136, 6147, 6150,14283, 6183, 6141, 5055, - 6112, 6109, 6158, 6121, 6119, 6183, 6136, 6135, 6136, 6131, - 6151,14121,14121, 6152, 6145, 5118, 6143, 5106, 6175, 6150, - 14121, 6145, 6156, 6150, 6159, 6173, 6154, 5003, 6158, 6165, - 6166, 6162, 6168, 6181,14121, 6165, 6181, 6174, 4949, 6181, - 6177, 6188,14121, 6180, 6182, 6182, 6176, 6192, 6209, 6195, - 6197, 6202, 6204, 6220,14121,14121, 6220, 6226, 6225,14121, - 6223, 6227, 6228, 4979, 2425,14121, 6233, 6230, 4870, 4824, - 4692, 6254, 4732, 6255, 6256, 6219, 6233, 6228, 6225, 6232, - 6235, 6229,14121, 6231, 4720, 6313, 6287, 6272, 6319, 6325, - 6331, 4631, 4627, 4533, 6282, 4392, 6284, 6294, 6251, 4386, + 6147, 6156, 6158, 6148, 6159, 6156, 6157, 6162, 6148, 6164, + 0, 6156, 6162, 6157, 6171, 4814, 6162, 6159, 6206, 6171, + 6161, 6211, 6184, 6202, 6202, 6195, 6204,14283,14283, 6205, + 6197, 4757, 6194, 4756, 6227, 6201,14283, 6195, 6205, 6198, + 6207, 6219, 6199, 4738, 6203, 6210, 6206, 6213, 6210, 6216, + 6229,14283, 6213, 6227, 6219, 4726, 6232, 6228, 6248,14283, + 6247, 6248, 6246, 6240, 6246, 6263, 6248, 6251, 6254, 6255, + 6270,14283,14283, 6269, 6275, 6272,14283, 6270, 6274, 6275, + 4642, 2671,14283, 6281, 6278, 4392, 4400, 4326, 6302, 4235, + 6303, 6304, 6267, 6279, 6273, 6276, 6283, 6295, 6290,14283, - 6268, 6275, 6285, 6284, 6286, 6311, 6317, 6308,14121, 6320, - 6317, 6325, 6323, 6311, 6325, 6314, 6317, 6318, 6317, 6317, - 6321, 6326, 6327, 6334, 6330, 6341, 6344, 6340, 6355, 6357, - 6367, 6373, 4353, 6373, 4341, 6373, 6360, 6375, 6368, 6370, - 6379, 6370, 6370, 4309, 6418,14121, 4113, 6422,14121, 6374, - 6371, 6387, 0, 0, 6426, 6381, 6388, 6386, 6387, 6404, - 6403, 6403, 6416, 6449, 6403, 6416,14121, 6428, 6410, 6426, - 6433, 6419, 4041, 0, 0, 6415, 6429, 6428, 6438, 6439, - 6435,14121, 6436, 6499, 6434,14121, 6446, 6437, 6436, 6468, - 14121, 6453, 6462, 6475, 6506, 6478, 6484, 6472, 6483, 6473, + 6288, 4168, 6361, 6336, 6329, 6367, 6373, 6382, 4036, 3985, + 3935, 6338, 3944, 6341, 6342, 6305, 3943, 6315, 6337, 6345, + 6341, 6351,14283, 6363, 6368, 6359,14283, 6370, 6367, 6375, + 6373, 6364, 6377, 6364, 6367, 6368, 6367, 6369, 6373, 6377, + 6378, 6386, 6382, 6393, 6403, 6399, 6411, 6413, 6421, 6425, + 3922, 6425, 3814, 6423, 6410, 6425, 6418, 6420, 6429, 6420, + 6422, 3676, 6466,14283, 3607, 6474,14283, 6428, 6426, 6434, + 6443, 0, 0, 6491, 6433, 6440, 6435, 6446, 6455, 6454, + 6456, 6468, 6510, 6455, 6468,14283, 6477, 6463, 6479, 6485, + 6473, 3650, 0, 0, 6468, 6482, 6483, 6494, 6496, 6492, - 14121, 6475, 6485, 6520, 6481, 6490, 0, 6527, 1544, 6494, - 3982, 6489, 6504, 6506, 6492, 6492, 6505, 6511, 6518,14121, - 6511, 6526, 6514, 6523, 6529, 6526, 6528, 6532, 6523, 6522, - 6537, 6534, 6535, 6545, 3974, 3960, 6528, 6548, 6538, 6547, - 6553, 6544, 6560, 6562, 6565,14121, 6562, 6563, 6558, 6555, - 6561, 6566,14121, 6574, 6572, 6567,14121, 6573, 6573, 6583, - 6577, 6577, 6592, 6616, 6617,14121, 6586, 6601, 6598, 6601, - 6601, 6603,14121, 3960, 6625, 6660, 6676, 3779, 6639, 6640, - 6641, 6619, 6696, 6697, 6708, 652, 6717, 6729, 3816, 6638, - 6659, 6620, 6609, 6630,14121, 6649, 6651, 6641, 6649, 6652, + 14283, 6491, 6538, 6490,14283, 6506, 6501, 6496, 6519,14283, + 6505, 6515, 6527, 6558, 6530, 6533, 6522, 6534, 6524,14283, + 6525, 6535, 6570, 6542, 6538, 0, 6586, 1544, 6534, 3592, + 6533, 6555, 6561, 6551, 6551, 6561, 6566, 6571,14283, 6563, + 6578, 6567, 6578, 6584, 6581, 6583, 6588, 6578, 6572, 6587, + 6574, 6586, 6587, 6596, 3586, 3535, 6581, 6601, 6594, 6603, + 6609, 6593, 6612, 6618, 6625,14283, 6622, 6624, 6616, 6611, + 6615, 6620,14283, 6628, 6628, 6623,14283, 6629, 6629, 6640, + 6634, 6633, 6643, 6668, 6669,14283, 6638, 6652, 6651, 6654, + 6657, 6659,14283, 3566, 6692, 6722, 6726, 3504, 6690, 6701, - 6677, 6684, 6690, 6694, 6695, 6703, 6699, 6695, 6708, 6711, - 6712, 6702,14121, 6718, 6713, 6721, 6722, 6709, 6727, 6726, - 6712, 6714, 6737, 6733, 6749, 6738,14121, 6734, 6756, 6744, - 6759, 6756, 6762,14121, 6767,14121, 3699, 0, 6756, 6766, - 6759, 6753, 6769, 6757, 6771, 6762, 0, 0, 6769, 6775, - 6763, 6783, 6782, 6766, 6786,14121, 3546, 6783, 6775, 6790, - 6675, 6845,14121, 6785, 6783, 0, 6847, 6803, 6796, 6846, - 6829, 6800, 6826, 6823, 6804, 6867, 6828, 6831, 6813, 6829, - 6815, 6841, 6845, 6838, 0, 0, 6839, 6834, 6841, 1551, - 3476, 1922, 6846, 6835, 6883, 6844, 3451, 6885, 6859, 6860, + 6703, 6679, 6738, 6752, 6758, 652, 6770, 6789, 3510, 6685, + 6705, 6709, 6698, 6703,14283, 6721, 6726, 6720, 6734, 6738, + 6738, 6741, 6745, 6753, 6755, 6763, 6759, 6755, 6768, 6771, + 6773, 6763,14283, 6779, 6774, 6782, 6784, 6772, 6790, 6789, + 6775, 6779, 6800, 6795, 6805, 6798,14283, 6794, 6809, 6799, + 6814, 6815, 6821,14283, 6825, 6815,14283, 3514, 0, 6816, + 6826, 6820, 6814, 6831, 6819, 6833, 6824, 0, 0, 6834, + 6837, 6825, 6847, 6846, 6830, 6850,14283, 3497, 6850, 6843, + 6855, 6707, 6766,14283, 6850, 6844, 0, 6909, 6864, 6857, + 6899, 6892, 6850, 6879, 6877, 6860, 6915, 6886, 6893, 6875, - 6847, 6866, 6884, 6873, 6883, 3361, 3356, 6874, 6884, 6878, - 6885, 6887, 6910, 6895, 6896, 6880, 6896, 6890, 6885, 6892, - 6901, 6888, 6896, 6891,14121, 6896, 6896, 6906, 6903, 6920, - 6906, 6915, 6918, 6928, 6928, 6941, 6942, 6941, 6931, 6933, - 6947, 6938, 6972, 6950, 6938, 6938, 6934, 3326, 6959, 7016, - 6978, 749, 7020, 7031, 7046, 7050, 3281, 3232, 6983, 7012, - 7027, 7030, 2301, 7084, 942, 7090, 7099, 7069, 7110, 6981, - 7122, 7128, 6993, 3210, 3194, 6957,14121, 6972, 6966, 6977, - 7016, 7033, 7043, 7045, 7042, 3133, 7060, 7077,14121, 7087, - 14121, 7090,14121, 7096, 7088, 7101,14121, 7103, 7097, 7112, + 6894, 6875, 6903, 6908, 6902, 0, 0, 6903, 6899, 6906, + 1551, 3366, 3034, 6911, 6899, 6123, 6900, 3361, 6334, 6915, + 6919, 6905, 6908, 6930, 6923, 6934, 3348, 3240, 6927, 6940, + 6937, 6941, 6942, 6969, 3233, 6954, 6955, 6940, 6956, 6949, + 6944, 6952, 6963, 6951, 6958, 6953,14283, 6959, 6952, 6962, + 6962, 6978, 6963, 6968, 6966, 6975, 6979, 6993, 6994, 6994, + 6987, 6992, 7003, 6993, 7031, 7009, 6998, 6998, 6993, 3220, + 7017, 7077, 7039, 749, 7078, 7096, 7097, 7108, 3231, 3179, + 7057, 7088, 7093, 7104, 1915, 7134, 942, 7155, 7164, 7170, + 7176, 7042, 7185, 7196, 7061, 3206, 3205, 7031,14283, 7057, - 7108, 7111, 7111, 7102, 7115, 7105, 7112, 7117,14121,14121, - 14121, 7127, 7115,14121, 7120, 7125, 7138, 7122, 7120, 7144, - 14121, 7128, 3116, 7138, 7140, 7152, 7138, 7142, 7062, 7146, - 14121, 7153, 7154, 7157, 7200, 7206,14121,14121, 7158, 7168, - 0, 7179, 7181, 7173, 7179, 7174, 7190, 7180, 7223, 7198, - 0, 7248, 7180, 7183, 7185, 7238, 7200, 7189, 7217, 7212, - 3017, 7213, 7223, 7220, 2880, 2033, 2924, 7219, 7227,14121, - 7253, 7219,14121, 7227, 7229, 7219, 7227, 7234, 7243, 7249, - 7241, 7255, 7257, 7247, 7244, 7254, 7251, 7253,14121, 7253, - 7250, 7271, 7259, 7260, 7265, 7277, 7269, 7301, 7284, 7305, + 7043, 7075, 7077, 7089, 7093, 7094, 7092, 3113, 7141, 7146, + 14283, 7156,14283, 7159,14283, 7160, 7152, 7169,14283, 7171, + 7162, 7176, 7172, 7177, 7177, 7168, 7180, 7170, 7180, 7184, + 14283,14283,14283, 7194, 7182, 7192,14283, 7191, 7196, 7209, + 7192, 7193, 7218,14283, 7202, 3117, 7208, 7208, 7220, 7210, + 7211, 7056, 7214,14283, 7221, 7221, 7222, 7076, 7269,14283, + 14283, 7222, 7233, 0, 7244, 7248, 7238, 7235, 7246, 7241, + 7264, 7243, 7127, 7258, 0, 7297, 7242, 7248, 7254, 7142, + 7272, 7261, 7283, 7276, 3100, 7276, 7287, 7280, 3002, 3311, + 3029, 7282, 7288,14283, 7043, 7279,14283, 7286, 7287, 7277, - 7282,14121, 7277, 7281, 7289,14121, 7288, 2869, 7304, 7311, - 7299,14121, 7299, 7312, 7315, 7303, 7316, 2892, 7300, 7301, - 7322,14121, 7299, 7325, 1445, 7378, 2843, 7357, 7345, 7332, - 7390, 7396, 7408, 7419, 2822, 7375, 7382, 3344, 7431, 7376, - 7449, 7465,14121, 2810, 7367, 7362, 7377, 2728, 7383, 2640, - 7382, 2604, 7387, 7385, 7399, 7397,14121, 7418, 7405, 7413, - 7429, 7423, 7418, 7420, 7424,14121, 7425, 7430, 7450, 7432, - 14121, 7453, 7451, 7441, 7439, 7404, 7461, 7456, 7452,14121, - 7462, 7467, 7458, 7469, 7466, 7522, 7477, 7447,14121, 7477, - 0, 7513, 0, 7533, 7481, 7480, 2590, 7492, 7501, 7494, + 7289, 7295, 7305, 7310, 7300, 7320, 7312, 7306, 7305, 7318, + 7317, 7318,14283, 7325, 7319, 7317, 7339, 7325, 7325, 7330, + 7342, 7334, 7365, 7348, 7369, 7342,14283, 7337, 7339, 7349, + 14283, 7348, 2968, 7363, 7373, 7363,14283, 7363, 7376, 7379, + 7368, 7381, 2991, 7367, 7368, 7388,14283, 7365, 7390, 1445, + 7448, 2883, 7427, 7136, 7400, 7459, 7463, 7471, 7489, 2890, + 7440, 7460, 2039, 7507, 7413, 7519, 7525,14283, 2872, 7398, + 7393, 7416, 2765, 7421, 2682, 7432, 2660, 7445, 7441, 7456, + 7463,14283, 7473, 7457, 7474, 7491, 7484, 7480, 7488, 7492, + 14283, 7493, 7495, 7514, 7497,14283, 7518, 7500, 7518, 7510, - 7507, 7515, 7519, 7514, 7515, 7522, 7565, 7532, 7519, 7538, - 2578, 7532, 7535, 7525, 7514, 7530, 7536, 7541, 7542,14121, - 7554, 7560, 7563, 2437, 7556, 7551,14121, 7569, 7559, 7573, - 14121, 7566, 7577,14121, 7565, 7578, 7579, 7581, 7574, 7579, - 2471, 7585, 7585, 7585, 7582, 2416, 7587, 7579, 7591, 7581, - 14121, 7593,14121, 7587,14121,14121, 7588,14121, 2403, 7634, - 7591,14121, 7607,14121, 7604, 7626, 7631, 7621, 7617, 7634, - 7624,14121, 7621, 7639, 7639, 7625, 7635, 7627, 7702, 7676, - 3533, 7713, 7714, 7722, 7699, 7733, 7734, 3924, 7745, 7770, - 7623, 7645, 7646, 7699, 7709, 2428, 7718, 7719, 7731,14121, + 7506, 7438, 7527, 7522, 7517,14283, 7527, 7532, 7523, 7531, + 7528, 7587, 7537, 7488,14283, 7540, 0, 7497, 0, 7596, + 7549, 7549, 2612, 7561, 7571, 7562, 7570, 7573, 7581, 7585, + 7580, 7581, 7588, 7632, 7588, 7586, 7605, 2576, 7599, 7602, + 7592, 7501, 7597, 7603, 7625, 7626,14283, 7623, 7630, 7636, + 4759, 7622, 7617,14283, 7635, 7625, 7639,14283, 7632, 7643, + 14283, 7631, 7644, 7645, 7647, 7640, 7645, 2425, 7651, 7651, + 7650, 7656, 7650, 2424, 7656, 7647, 7659, 7649,14283, 7661, + 14283, 7672,14283,14283, 7673,14283, 2387, 7701, 7679,14283, + 7685,14283, 7678, 7693, 7698, 7688, 7684, 7701, 7691,14283, - 7715, 7720, 7732, 7734, 7730, 7734,14121,14121, 7743, 7745, - 7731, 7734, 7751, 7753,14121, 7674, 7744, 7763, 7769, 7758, - 7755, 7768, 7767, 7765, 7798, 7761, 7827, 7780, 2411, 7785, - 7838, 0, 7792, 7801, 7807, 7805, 7806, 7822, 7813, 7814, - 7824, 7855, 7558, 7823, 7824,14121, 7818, 7830, 7831, 0, - 7559, 7818, 7824, 7835, 7681, 7821, 7685, 7841, 7853, 7863, - 7844, 7884, 7852, 7855, 7855, 7850, 2352, 7856, 7871, 7873, - 7866, 7874, 2342,14121, 2298, 7866, 7878, 7880, 7871,14121, - 2234, 7867, 7888, 7890, 7898,14121, 7878,14121, 7878, 7891, - 7890, 7888, 7895, 7909, 7907, 7920, 2259, 7911, 7925, 7914, + 7688, 7706, 7706, 7692, 7702, 7694, 7769, 7760, 2880, 7780, + 7781, 7789, 7766, 7800, 7801, 2931, 7820, 7838, 7692, 7716, + 7762, 7780, 7770, 2418, 7782, 7778, 7791,14283, 7781, 7787, + 7799, 7802, 7802, 7805,14283,14283, 7818, 7821, 7806, 7806, + 7621, 7825, 7829,14283, 7741, 7821, 7831, 7837, 7825, 7821, + 7834, 7832, 7830, 7885, 7835, 7895, 7890, 2414, 7879, 7884, + 0, 7883, 7891, 7892, 7884, 7890, 7891, 7898, 7890, 7891, + 7900, 7917, 7748, 7908, 7909,14283, 7902, 7913, 7914, 0, + 7752, 7901, 7920, 7931, 7876, 7916, 7885, 7918, 7929, 7934, + 7914, 7416, 7921, 7924, 7930, 7925, 2315, 7931, 7946, 7948, - 7926, 7930, 7925, 7989, 7951, 7990, 7952, 8005, 8009, 7915, - 7940, 7937, 7933, 7945, 2247,14121, 7926,14121, 7954,14121, - 7963, 7971, 7978, 7985, 7990,14121, 7982, 7964, 7993, 8036, - 8047, 7979, 7996, 7981, 7981, 7982, 7992, 7997, 7993, 8044, - 8074, 8045,14121, 8043, 8102, 8067, 0, 8074, 8057, 8065, - 8059, 8068, 8076, 8073, 8078,14121, 8037, 8039, 8043, 8070, - 8065, 8047, 8070, 8071, 8095, 8130, 8144, 8145,14121, 8095, - 14121, 8116,14121, 8114,14121, 8146, 2182, 8111, 8119, 8110, - 8158, 8117, 8112, 8149, 8111, 8117, 8114, 8142, 8129, 8143, - 8153, 8149, 8150, 8159, 8142, 8167, 8162, 8162,14121, 8157, + 7941, 7949, 2192,14283, 2188, 7955, 7942, 7953, 7954, 7945, + 14283, 2176, 7941, 7970, 7971, 7978,14283, 7959,14283, 7959, + 7972, 7971, 7982, 7988, 7990, 7985, 7991, 2198, 7981, 7994, + 7990, 8002, 8006, 8001, 8055, 8029, 8066, 8027, 8067, 8078, + 7997, 8028, 8026, 8034, 8044, 2208,14283, 8033,14283, 8060, + 14283, 8057, 8050, 8053, 8060, 8064,14283, 8055, 8127, 8038, + 8067, 8124, 8135, 8053, 8072, 8058, 8058, 8059, 8068, 8074, + 8070, 8070, 8162, 8072,14283, 8129, 8188, 8143, 0, 8161, + 8145, 8152, 8162, 8147, 8156, 8164, 8161, 8166,14283, 8116, + 8214, 8216, 8158, 8153, 8230, 8171, 8184, 8198, 8234, 8235, - 8163, 8165, 8163, 8169, 8195, 8176, 8177, 8180, 2157, 8177, - 8181, 8241, 8182, 8198, 8202, 2173, 8179,14121, 8204,14121, - 14121,14121, 8208,14121, 8199, 8264, 8247, 8269, 8201, 8212, - 8215, 8214, 8220, 8254, 8251,14121, 8247, 8256,14121, 8292, - 8287, 8291, 8277, 8283, 8327, 8296, 8284, 8284, 8285, 0, - 8253, 8334, 8335, 8306, 8311, 8342, 8310, 8300, 8311, 2166, - 8272, 8370, 8379, 8296,14121,14121,14121, 8334, 8316, 8309, - 8312,14121, 8330, 8340, 8349, 8376, 8360, 8378, 2019, 8366, - 1998,14121, 8368,14121, 8382, 8383, 8375, 8374, 8378,14121, - 2050, 8385, 8379, 3139, 8387, 8381, 8423, 8382, 8389, 8405, + 8244,14283, 8194,14283, 8212,14283, 8210,14283, 8116, 2155, + 8208, 8216, 8207, 8225, 8215, 8210, 8239, 8207, 8225, 8216, + 8225, 8240, 8233, 8254, 8252, 8248, 8249, 8258, 8239, 8264, + 8259, 8259,14283, 8254, 8260, 8262, 8259, 8265, 8292, 8273, + 8275, 8278, 2165, 8275, 8280, 8339, 8294, 8296, 8302, 2063, + 8279,14283, 8303,14283,14283,14283, 8306,14283, 8294, 8360, + 8386, 8236, 8383, 8296, 8308, 8309, 8299, 8318, 8328, 8326, + 14283, 8323, 8329,14283, 8406, 8341, 8401, 8386, 8391, 8402, + 8436, 8405, 8393, 8393, 8394, 0, 8348, 8396, 8443, 8414, + 8415, 8447, 8416, 8407, 8416, 2064, 8350, 8480, 8467, 8401, - 0, 1830, 8393, 8418, 8434, 8436, 1759, 8437, 8425, 8362, - 8407, 8461, 8487,14121, 8424, 8427, 8431, 8363, 8442, 8440, - 8452, 8491, 8448, 8448, 8465,14121, 8468, 8515, 8488, 8474, - 8475, 8523, 8474, 1709, 8543, 0, 1652, 8551, 0, 8476, - 8477, 3353, 8500, 8511, 8505, 8564, 8574, 8583,14121, 8513, - 8573, 8568,14121, 8578, 1579, 8580, 8584, 8568, 8572, 8575, - 8576, 8575, 8589, 8574, 8574, 8575, 8588, 8591, 8592,14121, - 1374, 8591, 3280,14121, 3939, 8592, 8627, 8617, 8621, 8622, - 0, 0, 8640,14121, 8625, 8639,14121,14121, 8673, 8684, - 8611, 8653, 8560, 8641, 8712, 8561, 0, 8637, 8565, 8642, + 14283,14283,14283, 8461, 8430, 8448, 8450,14283, 8459, 8468, + 8476, 8481, 8462, 8480, 8481, 2002, 8469, 1997,14283, 8470, + 14283, 8484, 8485, 8477, 8476, 8480,14283, 1966, 8488, 8483, + 3532, 8491, 8485, 8527, 8497, 8505, 8534, 0, 1807, 8520, + 8522, 8537, 8539, 1759, 8539, 8527, 8354, 8565, 8585, 8611, + 14283, 8543, 8546, 8550, 8358, 8561, 8564, 8576, 8387, 8571, + 8567, 8569,14283, 8572, 8579, 8639, 8593, 8578, 8579, 8647, + 8574, 1709, 8471, 0, 1652, 8528, 0, 8584, 8585, 5041, + 8618, 8634, 8628, 8666, 8694, 8703,14283, 8621, 8635, 8630, + 14283, 8640, 1579, 8642, 8646, 8632, 8636, 8639, 8635, 8641, - 8644, 8654, 8639, 8721, 8645, 8654,14121, 8747, 8692, 8680, - 1313, 1065, 8688, 8736, 5695, 1008, 6990, 8678, 8696, 8695, - 8771, 8705, 8721, 8726,14121, 8742, 8741, 8747, 8732, 8733, - 8745, 8746, 8739, 8754, 8755, 8734, 8789, 8751,14121, 8753, - 14121, 989, 5386,14121, 5403, 8773, 914, 8767, 0, 8763, - 14121, 8771, 8818, 8833, 0, 0, 0,14121, 8771, 8566, - 8775, 8834, 8674, 0, 0, 8829, 0, 8804, 8792, 8797, - 8801, 8806, 8811, 8860, 8812, 8828,14121,14121, 8830, 8831, - 8817, 8837, 879, 8273, 876, 8833, 8824, 8826, 8827, 8838, - 8840, 8841, 8853, 8863,14121, 8860, 8868, 8857,14121, 8856, + 8662, 8699, 8684, 8684, 8685, 8699, 8702, 8703,14283, 1374, + 8702, 3983,14283, 4005, 8703, 8713, 8690, 8694, 8706, 0, + 0, 8724,14283, 8709, 8723,14283,14283, 8772, 8771, 8780, + 8749, 8455, 8737, 8808, 8456, 0, 8738, 8574, 8741, 8763, + 8773, 8759, 8765, 8799, 8786, 8795,14283, 8847, 8814, 8802, + 1313, 1065, 8811, 8812, 7572, 1008, 7574, 8803, 8821, 8821, + 8872, 8812, 8820, 8825,14283, 8826, 8841, 8852, 8850, 8851, + 8863, 8854, 8865, 8857, 8861, 8862, 8449, 8892, 8860,14283, + 8862,14283, 989, 4343,14283, 4654, 8881, 914, 8864, 0, + 8860,14283, 8868, 8943, 8947, 0, 0, 0,14283, 8868, - 8860,14121,14121, 8871, 8893,14121, 6303,14121, 8863,14121, - 8867, 8874,14121, 830, 8863, 0, 8913, 0, 8523, 0, - 743, 8873, 8889, 8886, 8892, 8887, 8890, 8899, 8941, 8576, - 8684, 8907, 8908, 8819, 8902, 8909,14121, 8914, 8916,14121, - 8920, 8917, 8907, 8913, 8918, 8915, 8921, 670,14121,14121, - 8928, 8920, 8935, 8939,14121, 8922, 602, 0, 8955, 447, - 8967,14121, 8929, 8935,14121, 8943, 8943, 8949, 8944, 8714, - 8961, 8998, 9002, 9008, 9018, 8957, 8957, 8977, 8970, 8986, - 14121, 436, 8988, 8984, 8988, 8994, 8988, 9001, 461, 367, - 8996, 9032,14121, 330, 9028, 366, 8997, 8994, 9001,14121, + 8839, 8876, 8944, 8917, 0, 0, 8954, 0, 8892, 8908, + 8915, 8930, 8935, 8935, 8936, 8957, 8936, 8952,14283,14283, + 8955, 8956, 8942, 8961, 879, 8986, 876, 8955, 8945, 8947, + 8947, 8948, 8950, 8950, 8962, 8972,14283, 8969, 8976, 8909, + 8961,14283, 8960, 8964,14283,14283, 8975, 8988,14283, 4752, + 14283, 8973,14283, 8983, 8992,14283, 830, 8979, 0, 9043, + 0, 9037, 0, 743, 8997, 9008, 9007, 9013, 9011, 9009, + 9012, 9018, 9058, 8529, 8770, 9024, 9025, 9057, 9020, 9028, + 14283, 9033, 9034,14283, 9038, 9035, 9025, 9032, 9032,14283, + 9029, 9040, 670,14283,14283, 9048, 9040, 9057, 9061,14283, - 8991, 8998, 0, 9041, 9002, 9043, 0, 9060, 0, 9069, - 9073,14121, 9007,14121, 9012, 9028, 9037,14121, 9032, 9037, - 9051, 9034, 9052, 9048, 0, 315, 9085, 9050, 9044, 9091, - 9044, 9093,14121, 9062, 262, 254, 9101, 0, 9113, 0, - 14121, 9069, 9070, 9068, 9070, 9082, 9073, 9086, 9082, 9077, - 9081, 9088, 0, 0, 143, 9131, 0, 9090, 9148, 9135, - 9158, 9117,14121,14121, 138, 109, 9125, 9126, 9122,14121, - 14121, 9110,14121, 9131, 9142, 9146, 9148, 0, 43,14121, - 9176, 9202, 9211, 9143,14121,14121, 9176, 9178, 9179,14121, - 6, 9170, 9182,14121,14121, 9227,14121,14121,14121, 9204, + 9049, 602, 0, 9079, 447, 9095,14283, 9054, 9064,14283, + 9067, 9072, 9069, 9078, 9073, 9119, 9089, 9123, 9127, 9138, + 9142, 9079, 9082, 9099, 9093, 9113,14283, 436, 9112, 9111, + 9115, 9122, 9114, 9127, 461, 367, 9122, 9158,14283, 330, + 9155, 366, 9125, 9121, 9127, 9124,14283, 9118, 9125, 0, + 9169, 9130, 9173, 0, 9196, 0, 9197, 9203,14283, 9135, + 14283, 9137, 9153, 9153,14283, 9145, 9147, 9175, 9160, 9181, + 9174, 0, 315, 9219, 9166, 9170, 9225, 9170, 9183, 9227, + 14283, 9196, 262, 254, 9231, 0, 9242, 0,14283, 9204, + 9205, 9195, 9201, 9209, 9203, 9215, 9212, 9206, 9209, 9215, - 14121,14121, 9200, 9211, 9223, 9220, 9213,14121, 9225, 9225, - 9227,14121,14121, 9289, 9307, 9325, 9343, 9361, 9379, 9397, - 9415, 9433, 9451, 9469, 9487, 9505, 9523, 9541, 9559, 9577, - 9595, 9613, 9631, 9649, 9667, 9685, 9703, 9721, 9739, 9757, - 9775, 9793, 9811, 9829, 9847, 9865, 9883, 9901, 9919, 9937, - 9955, 9973, 9991,10009,10027,10045,10063,10081,10099,10117, - 10135,10153,10171,10189,10207,10225,10243,10261,10279,10297, - 10315,10333,10350,10368,10386,10404,10422,10440,10457,10475, - 10493,10511,10529,10547,10565,10583,10601,10619,10637,10655, - 10673,10691,10709,10727,10745,10763,10781,10799,10817,10835, + 0, 0, 143, 9259, 0, 9216, 9270, 9260, 9220, 9282, + 9240,14283,14283, 138, 109, 9267, 9275, 9269,14283,14283, + 9257,14283, 9278, 9269, 9273, 9274, 0, 43,14283, 9298, + 9327, 9276, 9336, 9288,14283,14283, 9302, 9311, 9332,14283, + 6, 9323, 9333,14283,14283, 9355, 9381,14283,14283,14283, + 9330,14283,14283, 9326, 9390, 9327, 9357, 9354, 9347,14283, + 9359, 9387, 9389,14283,14283, 9451, 9469, 9487, 9505, 9523, + 9541, 9559, 9577, 9595, 9613, 9631, 9649, 9667, 9685, 9703, + 9721, 9739, 9757, 9775, 9793, 9811, 9829, 9847, 9865, 9883, + 9901, 9919, 9937, 9955, 9973, 9991,10009,10027,10045,10063, - 10853,10871,10888,10906,10924,10942,10960,10978,10996,11014, - 11031,11049,11067,11085,11103,11121,11139,11157,11175,11193, - 11211,11229,11247,11265,11283,11301,11319,11337,11355,11372, - 11390,11408,11426,11444,11462,11480,11497,11515,11533,11551, - 11569,11587,11605,11623,11641,11659,11677,11695,11713,11731, - 11749,11767,11785,11803,11820,11838,11856,11874,11892,11910, - 11928,11946,11964,11982,12000,12011,12025,12043,12051,12067, - 12084,12088,12104,12122,12132,12148,12166,12184,12202,12219, - 12235,12253,12271,12289,12307,12325,12342,12358,12376,12385, - 12401,12419,12437,12455,12472,12480,12495,12511,12528,12546, + 10081,10099,10117,10135,10153,10171,10189,10207,10225,10243, + 10261,10279,10297,10315,10333,10351,10369,10387,10405,10423, + 10441,10459,10477,10495,10512,10530,10548,10566,10584,10602, + 10619,10637,10655,10673,10691,10709,10727,10745,10763,10781, + 10799,10817,10835,10853,10871,10889,10907,10925,10943,10961, + 10979,10997,11015,11033,11050,11068,11086,11104,11122,11140, + 11158,11176,11193,11211,11229,11247,11265,11283,11301,11319, + 11337,11355,11373,11391,11409,11427,11445,11463,11481,11499, + 11517,11534,11552,11570,11588,11606,11624,11642,11659,11677, + 11695,11713,11731,11749,11767,11785,11803,11821,11839,11857, - 12564,12582,12600,12618,12636,12654,12672,12690,12708,12718, - 12726,12741,12756,12767,12775,12783,12799,12815,12831,12848, - 12866,12884,12902,12920,12938,12956,12974,12992,13010,13028, - 13046,13064,13082,13100,13118,13131,13139,13147,13155,13166, - 13182,13198,13206,13214,13230,13248,13266,13284,13302,13320, - 13338,13356,13374,13392,13410,13428,13444,13460,13478,13496, - 13506,13522,13538,13551,13569,13586,13603,13620,13631,13647, - 13664,13681,13693,13709,13727,13744,13762,13779,13797,13814, - 13830,13847,13857,13873,13890,13908,13925,13943,13961,13978, - 13995,14013,14025,14041,14058,14075,14086,14102 + 11875,11893,11911,11929,11947,11965,11982,12000,12018,12036, + 12054,12072,12090,12108,12126,12144,12162,12173,12187,12205, + 12213,12229,12246,12250,12266,12284,12294,12310,12328,12346, + 12364,12381,12397,12415,12433,12451,12469,12487,12504,12520, + 12538,12547,12563,12581,12599,12617,12634,12642,12657,12673, + 12690,12708,12726,12744,12762,12780,12798,12816,12834,12852, + 12870,12880,12888,12903,12918,12929,12937,12945,12961,12977, + 12993,13010,13028,13046,13064,13082,13100,13118,13136,13154, + 13172,13190,13208,13226,13244,13262,13280,13293,13301,13309, + 13317,13328,13344,13360,13368,13376,13392,13410,13428,13446, + 13464,13482,13500,13518,13536,13554,13572,13590,13606,13622, + 13640,13658,13668,13684,13700,13713,13731,13748,13765,13782, + 13793,13809,13826,13843,13855,13871,13889,13906,13924,13941, + 13959,13976,13992,14009,14019,14035,14052,14070,14087,14105, + 14123,14140,14157,14175,14187,14203,14220,14237,14248,14264 } ; -static const flex_int16_t yy_def[4199] = +static const flex_int16_t yy_def[4251] = { 0, - 3914, 3914, 3913, 3, 3915, 3915, 3, 3, 3916, 3916, - 3916, 3916, 3917, 3917, 3918, 3918, 3919, 3919, 3920, 3920, - 3921, 3921, 3915, 3915, 3915, 3915, 3922, 3922, 3923, 3923, - 3923, 3923, 3924, 3924, 3925, 3925, 3913, 37, 37, 37, - 3915, 3915, 3915, 3915, 3915, 3915, 3926, 3926, 3927, 3927, - 3928, 3928, 3929, 3929, 3930, 3930, 3931, 3931, 3932, 3932, - 3915, 3915, 3933, 3933, 3934, 3934, 3932, 3932, 3915, 3915, - 3935, 3935, 3936, 3936, 3913, 3913, 3913, 3913, 3913, 3913, - 3937, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3966, 3966, 3965, 3, 3967, 3967, 3, 3, 3968, 3968, + 3968, 3968, 3969, 3969, 3970, 3970, 3971, 3971, 3972, 3972, + 3973, 3973, 3967, 3967, 3967, 3967, 3974, 3974, 3975, 3975, + 3975, 3975, 3976, 3976, 3977, 3977, 3965, 37, 37, 37, + 3967, 3967, 3967, 3967, 3967, 3967, 3978, 3978, 3979, 3979, + 3980, 3980, 3981, 3981, 3982, 3982, 3983, 3983, 3984, 3984, + 3967, 3967, 3985, 3985, 3986, 3986, 3984, 3984, 3967, 3967, + 3987, 3987, 3988, 3988, 3965, 3965, 3965, 3965, 3965, 3965, + 3989, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 131, 3913, 3913, 3913, 3938, 3938, 3938, 3913, - 3913, 3938, 3939, 3939, 3939, 3913, 3940, 3939, 3941, 3941, - 3941, 3913, 3942, 3913, 3941, 3943, 3943, 3913, 3943, 3913, - 3913, 3944, 3913, 3913, 3913, 3944, 3945, 3944, 3946, 3946, - 3946, 3913, 3947, 3946, 3913, 3948, 3913, 3946, 3949, 3949, - 3949, 3913, 3950, 3949, 3951, 3951, 3951, 3913, 3913, 3951, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 131, 3965, 3965, 3965, 3990, 3990, 3990, 3965, + 3965, 3990, 3991, 3991, 3991, 3965, 3992, 3991, 3993, 3993, + 3993, 3965, 3994, 3965, 3993, 3995, 3995, 3965, 3995, 3965, + 3965, 3996, 3965, 3965, 3965, 3996, 3997, 3996, 3998, 3998, + 3998, 3965, 3999, 3998, 3965, 4000, 3965, 3998, 4001, 4001, + 4001, 3965, 4002, 4001, 4003, 4003, 4003, 3965, 3965, 4003, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3952, 3952, 3913, 3913, - 3952, 3953, 3953, 3913, 3954, 3953, 3913, 3955, 3956, 3957, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3958, 3913, 3959, 3958, 3913, 3913, 3913, 3960, 3913, 3961, - 3913, 3960, 3913, 3913, 3913, 3962, 3962, 3962, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4004, 4004, 3965, 3965, + 4004, 4005, 4005, 3965, 4006, 4005, 3965, 4007, 4008, 4009, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 4010, 3965, 4011, 4010, 3965, 3965, 3965, 4012, 3965, 4013, + 3965, 4012, 3965, 3965, 3965, 4014, 4014, 4014, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3963, 3913, 3963, 3963, 3963, - 3913, 3913, 3963, 3963, 3963, 3964, 3913, 3965, 3964, 3964, - 3964, 3913, 3964, 3964, 3964, 3966, 3913, 3967, 3966, 3966, - 3966, 3913, 3966, 3966, 3966, 3968, 3968, 3913, 3968, 3913, - 3968, 3969, 3913, 3969, 3913, 3970, 3971, 3972, 3971, 3969, - 3973, 3913, 3974, 3973, 3973, 3973, 3973, 3913, 3973, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4015, 3965, 4015, 4015, 4015, + 3965, 3965, 4015, 4015, 4015, 4016, 3965, 4017, 4016, 4016, + 4016, 3965, 4016, 4016, 4016, 4018, 3965, 4019, 4018, 4018, + 4018, 3965, 4018, 4018, 4018, 4020, 4020, 3965, 4020, 3965, + 4020, 4021, 3965, 4021, 3965, 4022, 4023, 4024, 4023, 4021, + 4025, 3965, 4026, 4025, 4025, 4025, 4025, 3965, 4025, 3965, - 3975, 3976, 3977, 3976, 3978, 3976, 3913, 3913, 3973, 3973, - 3979, 3913, 3980, 3979, 3979, 3979, 3913, 3979, 3979, 3979, - 3981, 3913, 3981, 3981, 3913, 3981, 3913, 3913, 3981, 3981, - 3981, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 4027, 4028, 4029, 4028, 4030, 4028, 3965, 3965, 4025, 4025, + 4031, 3965, 4032, 4031, 4031, 4031, 3965, 4031, 4031, 4031, + 4033, 3965, 4033, 4033, 3965, 4033, 3965, 3965, 4033, 4033, + 4033, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3982, 3913, 3982, 3913, 3913, 3982, - 3983, 3913, 3984, 3983, 3913, 3983, 3985, 3986, 3987, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3988, 3913, 3989, - 3988, 3913, 3988, 3913, 3990, 3913, 3991, 3990, 3913, 3990, - 3992, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 4034, 3965, 4034, 3965, 3965, 4034, + 4035, 3965, 4036, 4035, 3965, 4035, 4037, 4038, 4039, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4040, 3965, 4041, + 4040, 3965, 4040, 3965, 4042, 3965, 4043, 4042, 3965, 4042, + 4044, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3993, - 3913, 3913, 3993, 3993, 3994, 3995, 3913, 3913, 3995, 3995, - 3996, 3997, 3913, 3913, 3997, 3997, 3913, 3913, 3998, 3999, - 3998, 4000, 4001, 4002, 4002, 4002, 4001, 4003, 4004, 3913, - 3913, 4005, 4006, 4005, 4007, 4005, 4008, 4009, 4009, 4009, - 4010, 4010, 4010, 4011, 4009, 4004, 4004, 4012, 4013, 3913, - 3913, 4013, 4013, 3913, 4014, 3913, 3913, 4014, 3913, 4014, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4045, + 3965, 3965, 4045, 4045, 4046, 4047, 3965, 3965, 4047, 4047, + 4048, 4049, 3965, 3965, 4049, 4049, 3965, 3965, 4050, 4051, + 4050, 4052, 4053, 4054, 4054, 4054, 4053, 4055, 4056, 3965, + 3965, 4057, 4058, 4057, 4059, 4057, 4060, 4061, 4061, 4061, + 4062, 4062, 4062, 4063, 4061, 4056, 4056, 4064, 4065, 3965, + 3965, 4065, 4065, 3965, 4066, 3965, 3965, 4066, 3965, 4066, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4015, 3913, 3913, 4016, 4017, 3913, 3913, - 3913, 3913, 3913, 3913, 4018, 4019, 3913, 3913, 4020, 4021, - 3913, 3913, 4022, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 4067, 3965, 3965, 4068, 4069, 3965, + 3965, 3965, 3965, 3965, 3965, 4070, 4071, 3965, 3965, 4072, + 4073, 3965, 3965, 4074, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 4023, 3913, 4023, 4024, 3913, - 4024, 4025, 3913, 4025, 3913, 4026, 4027, 4027, 4027, 4028, - 4026, 4028, 4028, 3913, 4029, 3913, 3913, 4029, 3913, 4004, - 3913, 4030, 4030, 4030, 4031, 4032, 4031, 4031, 4033, 4034, - 4030, 4035, 4032, 4033, 4032, 4032, 4004, 4036, 4004, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4075, 3965, 4075, + 4076, 3965, 4076, 4077, 3965, 4077, 3965, 4078, 4079, 4079, + 4079, 4080, 4078, 4080, 4080, 3965, 4081, 3965, 3965, 4081, + 3965, 4056, 3965, 4082, 4082, 4082, 4083, 4084, 4083, 4083, + 4085, 4086, 4082, 4087, 4084, 4085, 4084, 4084, 4056, 4088, - 4036, 3913, 4036, 4036, 4037, 4004, 4038, 3913, 4038, 4039, - 3913, 4039, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 4040, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4041, 3913, 4042, 3913, 3913, 3913, + 4056, 3965, 4088, 3965, 4088, 4088, 4089, 4056, 4090, 3965, + 4090, 4091, 3965, 4091, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4092, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4093, 3965, 4094, - 3913, 3913, 4043, 3913, 4044, 3913, 4045, 4045, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4046, + 3965, 3965, 3965, 3965, 3965, 4095, 3965, 4096, 3965, 4097, + 4097, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 4047, 3913, 4048, 4049, 4050, 4051, 3913, 4030, 4052, - 4052, 4052, 4033, 4030, 4032, 4033, 4032, 4053, 4032, 4054, - 4055, 4056, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4057, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 4040, 4058, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 4059, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 4098, 3965, 4099, 3965, 4100, 4101, 4102, + 4103, 3965, 4082, 4104, 4104, 4104, 4085, 4082, 4084, 4085, + 4084, 4105, 4084, 4106, 4107, 4108, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 4109, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4092, 4110, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 4111, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 4060, 3913, 3913, 3913, 3913, 4061, 3913, 4062, 3913, - 4063, 4063, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 4112, 3965, 3965, 3965, + 3965, 4113, 3965, 4114, 3965, 4115, 4115, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4049, 4050, 4049, 4050, 4052, 4032, 4052, - 4033, 4052, 4033, 4064, 4033, 4033, 4032, 4054, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4057, - 4065, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4066, 3913, - 3913, 4058, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 4059, 3913, 4059, 4067, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4063, 4063, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4101, + 4102, 4101, 4102, 4104, 4084, 4104, 4085, 4104, 4085, 4116, + 4085, 4085, 4084, 4106, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4109, 4117, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 4118, 3965, 3965, 3965, 4110, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 4111, 3965, 4111, 4119, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 4115, 4115, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 4052, 4033, 4053, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4065, 4068, 4057, 4065, 3913, 3913, - 3913, 3913, 3913, 3913, 4069, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4059, 3913, 4067, 3913, 3913, 3913, 4063, - 4070, 3913, 3913, 4071, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4104, 4085, + 4105, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 4117, 4120, 4109, 4117, 3965, 3965, 3965, 3965, + 3965, 3965, 4121, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 4111, 3965, 4119, 3965, 3965, 3965, 4115, 4122, + 3965, 3965, 4123, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4033, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4085, - 4057, 4065, 3913, 4068, 4057, 3913, 4072, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 4059, 3913, 4063, 4073, 4074, - 3913, 3913, 4075, 4071, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 4109, 4117, 3965, 4120, 4109, 3965, 4124, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4111, 3965, 4115, 4125, + 4126, 3965, 3965, 4127, 4123, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4076, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4065, 3913, 4068, 4068, 3913, 4072, 4077, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4128, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4117, 3965, 4120, 4120, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 4078, 4073, 4073, 4074, 4074, 3913, 3913, 4075, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4079, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4080, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 4124, 4129, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 4130, 4125, 4125, 4126, 4126, 3965, + 3965, 4127, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 4131, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4132, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 4076, 4081, 4076, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4082, 3913, 4077, 4083, 4077, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4084, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 4128, 4133, 4128, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4134, 3965, 4129, 4135, + 4129, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4085, 4086, 4073, - 3913, 4073, 4074, 4074, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 4087, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4079, 4088, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 4089, 3913, 3913, 3913, 3913, - 4090, 4080, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 4136, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 4137, 4138, 4125, 3965, 4125, 4126, 4126, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4139, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4131, 4140, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4141, + 3965, 3965, 3965, 3965, 4142, 4132, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4076, 4081, 3913, - 4081, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 4082, 4091, 4092, 3913, 4077, 4083, 3913, 4083, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 4128, 4133, 3965, 4133, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4134, 4143, 4144, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 4084, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 4085, 4093, 4086, 4094, 3913, 3913, 3913, 3913, - 3913, 4095, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4096, - 4087, 4097, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4088, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4089, 3913, 3913, 3913, 3913, 4090, + 4129, 4135, 3965, 4135, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 4136, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4137, 4145, + 4138, 4146, 3965, 3965, 3965, 3965, 3965, 4147, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4148, 4139, 4149, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4140, - 3913, 3913, 3913, 3913, 3913, 4098, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 4081, 3913, 4076, 4081, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4099, 4091, 4100, 4082, 4101, 4102, - 4091, 4103, 3913, 3913, 4104, 3913, 4105, 4104, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 4141, 3965, 3965, 3965, 3965, 4142, 3965, 3965, 3965, 3965, + 3965, 4150, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4133, 3965, + 4128, 4133, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4106, 4107, 3913, 4108, 4109, 3913, 3913, - 3913, 3913, 4110, 4111, 4112, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4113, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 4114, 4115, 4116, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4117, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 4151, 4143, 4152, 4134, 4153, 4154, 4143, 4155, 3965, + 3965, 4156, 3965, 4157, 4156, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 4158, 4159, 3965, 4160, 4161, 3965, 3965, 3965, 3965, + 3965, 4162, 4163, 4164, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 4165, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 4166, 4167, 4168, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 4118, 3913, 3913, 4119, 4119, 4120, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4121, 4122, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4123, 4124, 4125, 4126, 3913, 4127, 4128, - 4124, 4129, 4130, 4131, 4132, 4123, 4125, 4132, 4133, 4134, - 4135, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 4169, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 4170, 3965, 3965, 4171, 4171, 4172, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 4173, 4174, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 4175, 4176, 4177, 4178, 3965, 4179, 4180, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 4136, 4137, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 4138, 4139, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 4140, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 4141, 4141, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 4142, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4143, 4144, 3913, 3913, 3913, 4145, - 3913, 4145, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 4176, 4181, 4182, 4183, 4184, 4175, 4177, 4184, 4185, 4186, + 4187, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4188, 4189, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4190, 4191, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4192, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4193, 4193, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4194, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 4146, 3913, 3913, 3913, 3913, 3913, 3913, 4125, - 4147, 4123, 4148, 4125, 4125, 4149, 3913, 3913, 4147, 4147, - 4150, 4150, 4151, 4152, 4133, 4152, 4152, 4153, 4153, 4123, - 4154, 4154, 4155, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 4195, 4196, 3965, 3965, 3965, + 4197, 3965, 4197, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 4198, 3965, 3965, 3965, 3965, 3965, + 3965, 4177, 4199, 4175, 4200, 4177, 4177, 4201, 3965, 3965, + 4199, 4199, 4202, 4202, 4203, 4204, 4185, 4204, 4204, 4205, + 4205, 4175, 4206, 4206, 4207, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 4138, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4156, 4157, 3913, 3913, 3913, 3913, - 4158, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 4159, 4142, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 4143, 3913, 3913, 3913, 3913, 4145, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4190, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4208, 4209, 3965, + 3965, 3965, 3965, 4210, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 4211, 4194, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 4195, 3965, 3965, 3965, 3965, 4197, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4123, 4125, 3913, 4147, 4123, 4151, - 4152, 4148, 4154, 4125, 3913, 4150, 4147, 4133, 4152, 4133, - 4160, 4152, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 4156, 4156, 4161, 4157, 3913, 3913, 4158, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4175, + 4177, 3965, 4199, 4175, 4203, 4204, 4200, 4206, 4177, 3965, + 4202, 4199, 4185, 4204, 4185, 4212, 4204, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 4159, 3913, 3913, 3913, 4162, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4145, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4125, 4147, - 4151, 4148, 4148, 4154, 4150, 4152, 4160, 4133, 4152, 4160, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4208, 4208, 4213, 4209, + 3965, 3965, 4210, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4211, 3965, 3965, + 3965, 4214, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 4197, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 4163, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4161, 3913, - 3913, 4164, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4162, - 4162, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 4177, 4199, 4203, 4200, + 4200, 4206, 4202, 4204, 4212, 4185, 4204, 4212, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 4215, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4213, 3965, 3965, + 4216, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4214, + 4214, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 4125, 4147, 4160, 4133, 4152, 4160, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 4164, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 4165, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 4166, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 4177, 4199, 4212, 4185, 4204, 4212, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4216, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4217, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4218, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 4160, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4165, - 4165, 4167, 4168, 3913, 3913, 3913, 3913, 3913, 3913, 4166, - 4166, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4212, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4217, 4217, 4219, 4220, 3965, + 3965, 3965, 3965, 3965, 3965, 4218, 4218, 3965, 3965, 3965, - 4169, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4167, 4167, 4170, 4168, 4168, 4171, 3913, - 3913, 4172, 3913, 3913, 3913, 4166, 4166, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 4169, 4173, 3913, 3913, 3913, 3913, 3913, 3913, 4174, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 4175, 3913, 4176, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4221, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 4219, 4219, 4222, 4220, 4220, 4223, 3965, 3965, 4224, + 3965, 3965, 3965, 4218, 4218, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 4170, 4171, 3913, 3913, 4172, 3913, 4172, 3913, 3913, 3913, - 4166, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4173, 3913, - 3913, 3913, 4174, 4174, 4177, 4178, 4179, 3913, 3913, 4180, - 3913, 3913, 3913, 4175, 4181, 4176, 4182, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4172, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4221, + 4225, 3965, 3965, 3965, 3965, 3965, 3965, 4226, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4227, 3965, 4228, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 4222, 4223, 3965, 3965, 4224, 3965, 4224, 3965, 3965, 3965, + 4218, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4225, + 3965, 3965, 3965, 4226, 4226, 4229, 4230, 4231, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4178, 3913, 4183, 4180, 4184, 4185, 4181, - 4182, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 4172, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 4183, 4184, 4185, 3913, - 4185, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4186, - 3913, 4187, 4188, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4185, 3913, 3913, 3913, 3913, 3913, + 4232, 3965, 3965, 3965, 4227, 4233, 4228, 4234, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4224, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4230, 3965, 4235, 4232, + 4236, 4237, 4233, 4234, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4224, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 4186, 4186, 3913, 4187, 4189, 4188, 4190, 4191, - 4192, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4193, 3913, 4194, 4185, 3913, 3913, - 3913, 3913, 3913, 3913, 4189, 4190, 4191, 4195, 4192, 4196, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 4193, 4197, 4194, 4194, 4198, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 4195, 4196, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 4197, 4198, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 4235, 4236, 4237, 3965, 4237, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 4238, 3965, 4239, 4240, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 4237, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 4238, + 4238, 3965, 4239, 4241, 4240, 4242, 4243, 4244, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 4245, 3965, 4246, 4237, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 4241, 4242, 4243, 4247, 4244, 4248, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 0, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 4245, 4249, 4246, 4246, 4250, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 4247, 4248, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 4249, 4250, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 0, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913 + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965 } ; -static const flex_int16_t yy_nxt[14209] = +static const flex_int16_t yy_nxt[14371] = { 0, - 3913, 77, 78, 79, 77, 118, 80, 81, 118, 118, - 283, 284, 118, 3913, 82, 119, 120, 121, 119, 122, - 123, 3913, 129, 98, 124, 129, 130, 98, 125, 1387, - 83, 135, 84, 85, 3901, 269, 136, 86, 87, 88, - 315, 316, 98, 89, 90, 91, 135, 92, 93, 3895, - 131, 136, 94, 1106, 138, 139, 95, 138, 83, 872, + 3965, 77, 78, 79, 77, 118, 80, 81, 118, 118, + 283, 284, 118, 3965, 82, 119, 120, 121, 119, 122, + 123, 3965, 129, 98, 124, 129, 130, 98, 125, 1394, + 83, 135, 84, 85, 3952, 269, 136, 86, 87, 88, + 315, 316, 98, 89, 90, 91, 135, 92, 93, 3945, + 131, 136, 94, 1110, 138, 139, 95, 138, 83, 874, 84, 85, 140, 269, 141, 86, 87, 88, 256, 270, - 126, 89, 90, 91, 1388, 92, 93, 132, 283, 284, + 126, 89, 90, 91, 1395, 92, 93, 132, 283, 284, 94, 77, 78, 79, 77, 257, 80, 81, 129, 98, 256, 129, 130, 271, 82, 157, 158, 270, 157, 127, 96, 272, 129, 98, 233, 129, 130, 257, 234, 142, - 83, 235, 84, 85, 273, 3886, 131, 86, 87, 88, - 274, 271, 1007, 89, 90, 91, 275, 92, 93, 272, - 133, 280, 94, 526, 318, 527, 95, 318, 83, 1008, - 84, 85, 273, 132, 3885, 86, 87, 88, 274, 3913, + 83, 235, 84, 85, 273, 3936, 131, 86, 87, 88, + 274, 271, 1010, 89, 90, 91, 275, 92, 93, 272, + 133, 280, 94, 526, 318, 527, 95, 318, 83, 1011, + 84, 85, 273, 132, 3935, 86, 87, 88, 274, 3965, 159, 89, 90, 91, 275, 92, 93, 132, 236, 280, 94, 96, 97, 98, 96, 97, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, @@ -1884,8 +1899,8 @@ static const flex_int16_t yy_nxt[14209] = 96, 106, 96, 107, 108, 109, 110, 111, 112, 113, 96, 114, 115, 96, 96, 96, 96, 117, 119, 120, 121, 119, 122, 123, 281, 129, 98, 124, 129, 130, - 3864, 125, 138, 139, 2284, 138, 144, 145, 3863, 144, - 140, 146, 141, 228, 147, 229, 144, 145, 2485, 144, + 3913, 125, 138, 139, 2299, 138, 144, 145, 3912, 144, + 140, 146, 141, 228, 147, 229, 144, 145, 2502, 144, 230, 146, 281, 133, 147, 150, 151, 347, 150, 347, 152, 150, 151, 153, 150, 526, 152, 527, 154, 153, @@ -1893,12 +1908,12 @@ static const flex_int16_t yy_nxt[14209] = 132, 489, 267, 569, 276, 180, 181, 142, 180, 289, 182, 148, 277, 183, 569, 163, 164, 231, 163, 282, 165, 148, 127, 96, 348, 166, 186, 187, 163, 188, - 155, 167, 276, 3854, 189, 278, 155, 289, 163, 164, + 155, 167, 276, 3902, 189, 278, 155, 289, 163, 164, 277, 163, 163, 165, 231, 290, 268, 347, 166, 347, 159, 163, 279, 645, 167, 490, 170, 171, 295, 170, - 184, 172, 3761, 278, 173, 163, 174, 301, 357, 175, - 168, 358, 176, 290, 170, 171, 3796, 170, 302, 172, - 279, 190, 173, 177, 174, 3825, 295, 175, 186, 187, + 184, 172, 3806, 278, 173, 163, 174, 301, 357, 175, + 168, 358, 176, 290, 170, 171, 3842, 170, 302, 172, + 279, 190, 173, 177, 174, 3872, 295, 175, 186, 187, 176, 188, 646, 168, 348, 301, 189, 474, 475, 163, 163, 177, 497, 498, 170, 171, 302, 170, 303, 172, @@ -1908,10 +1923,10 @@ static const flex_int16_t yy_nxt[14209] = 181, 176, 180, 190, 182, 313, 252, 183, 214, 215, 216, 217, 177, 191, 314, 214, 215, 216, 217, 178, 191, 191, 296, 351, 297, 226, 441, 487, 191, 441, - 487, 226, 488, 313, 254, 438, 439, 440, 438, 3824, - 178, 502, 314, 3817, 502, 503, 504, 283, 284, 286, + 487, 226, 488, 313, 254, 438, 439, 440, 438, 3871, + 178, 502, 314, 3864, 502, 503, 504, 283, 284, 286, - 296, 352, 297, 3796, 184, 191, 192, 193, 194, 192, + 296, 352, 297, 3842, 184, 191, 192, 193, 194, 192, 191, 195, 191, 191, 191, 191, 191, 191, 191, 196, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 197, 198, 199, 200, 201, @@ -1922,69 +1937,69 @@ static const flex_int16_t yy_nxt[14209] = 208, 209, 210, 191, 211, 191, 212, 191, 191, 191, 191, 191, 218, 219, 220, 221, 359, 222, 218, 219, - 220, 221, 369, 222, 218, 219, 220, 221, 3793, 222, + 220, 221, 369, 222, 218, 219, 220, 221, 3839, 222, 218, 219, 220, 221, 233, 222, 291, 252, 234, 242, 253, 235, 315, 316, 352, 252, 259, 242, 292, 260, 352, 261, 327, 259, 259, 327, 260, 557, 261, 252, 557, 259, 590, 318, 291, 590, 318, 223, 259, 422, 243, 242, 244, 223, 422, 259, 292, 395, 243, 223, - 244, 245, 246, 247, 248, 223, 2284, 254, 236, 245, + 244, 245, 246, 247, 248, 223, 2299, 254, 236, 245, 246, 247, 248, 242, 263, 264, 262, 263, 243, 619, 244, 414, 243, 262, 244, 400, 243, 265, 244, 245, 246, 247, 248, 245, 246, 247, 248, 245, 246, 247, - 248, 423, 287, 489, 243, 288, 244, 293, 2870, 400, + 248, 423, 287, 489, 243, 288, 244, 293, 2892, 400, 243, 298, 244, 306, 294, 245, 246, 247, 248, 428, - 304, 245, 246, 247, 248, 299, 620, 3787, 307, 265, + 304, 245, 246, 247, 248, 299, 620, 3833, 307, 265, 287, 300, 243, 288, 244, 293, 305, 308, 407, 298, - 408, 306, 294, 245, 246, 247, 248, 400, 304, 3762, + 408, 306, 294, 245, 246, 247, 248, 400, 304, 3807, 310, 584, 309, 299, 311, 312, 307, 490, 357, 300, - 446, 358, 584, 2284, 305, 308, 319, 320, 321, 319, + 446, 358, 584, 2299, 305, 308, 319, 320, 321, 319, 452, 322, 323, 320, 321, 323, 412, 324, 310, 413, 309, 398, 311, 312, 325, 321, 321, 325, 446, 326, 323, 320, 321, 323, 447, 324, 455, 342, 452, 349, - 343, 448, 349, 353, 354, 3029, 422, 347, 359, 347, + 343, 448, 349, 353, 354, 3054, 422, 347, 359, 347, 347, 422, 347, 449, 344, 345, 364, 365, 474, 475, 357, 320, 447, 358, 455, 342, 414, 320, 343, 448, - 360, 377, 378, 360, 377, 357, 3755, 412, 358, 321, + 360, 377, 378, 360, 377, 357, 3800, 412, 358, 321, 413, 449, 344, 345, 459, 320, 328, 329, 330, 331, 332, 333, 465, 334, 350, 472, 335, 355, 423, 662, 336, 367, 337, 338, 368, 339, 340, 341, 285, 367, - 363, 285, 459, 872, 328, 329, 330, 331, 332, 333, - 465, 334, 3617, 472, 335, 361, 379, 414, 336, 367, + 363, 285, 459, 874, 328, 329, 330, 331, 332, 333, + 465, 334, 3657, 472, 335, 361, 379, 414, 336, 367, 337, 338, 368, 339, 340, 341, 370, 367, 663, 370, - 741, 367, 377, 378, 368, 377, 374, 375, 450, 367, - 367, 369, 873, 368, 377, 380, 381, 377, 367, 383, + 742, 367, 377, 378, 368, 377, 374, 375, 450, 367, + 367, 369, 875, 368, 377, 380, 381, 377, 367, 383, 383, 451, 383, 427, 383, 383, 383, 473, 383, 347, - 383, 347, 383, 645, 637, 3685, 450, 637, 383, 369, - 392, 386, 3710, 393, 470, 394, 383, 471, 392, 451, - 441, 371, 383, 441, 742, 473, 2284, 379, 383, 388, - 373, 383, 392, 383, 868, 383, 383, 508, 383, 379, - 383, 388, 646, 453, 384, 471, 348, 1563, 383, 424, + 383, 347, 383, 645, 637, 3727, 450, 637, 383, 369, + 392, 386, 3753, 393, 470, 394, 383, 471, 392, 451, + 441, 371, 383, 441, 743, 473, 2299, 379, 383, 388, + 373, 383, 392, 383, 870, 383, 383, 508, 383, 379, + 383, 388, 646, 453, 384, 471, 348, 1572, 383, 424, 384, 396, 425, 454, 396, 383, 392, 422, 460, 393, - 395, 394, 383, 3706, 392, 509, 461, 392, 3040, 514, + 395, 394, 383, 3749, 392, 509, 461, 392, 3065, 514, 393, 453, 394, 383, 383, 392, 662, 625, 392, 383, 383, 454, 499, 389, 668, 499, 460, 500, 392, 392, - 390, 393, 1564, 394, 461, 391, 392, 509, 391, 401, - 392, 520, 870, 403, 426, 404, 397, 748, 405, 2260, - 392, 2261, 383, 388, 409, 410, 569, 395, 392, 383, + 390, 393, 1573, 394, 461, 391, 392, 509, 391, 401, + 392, 520, 872, 403, 426, 404, 397, 749, 405, 2275, + 392, 2276, 383, 388, 409, 410, 569, 395, 392, 383, 383, 393, 392, 394, 626, 415, 392, 569, 415, 520, - 412, 669, 521, 413, 3685, 419, 420, 501, 395, 412, - 392, 3678, 413, 659, 429, 430, 422, 497, 498, 442, + 412, 669, 521, 413, 3727, 419, 420, 501, 395, 412, + 392, 3720, 413, 659, 429, 430, 422, 497, 498, 442, 406, 422, 432, 433, 434, 432, 456, 522, 443, 466, - 521, 749, 444, 467, 462, 435, 523, 445, 399, 468, + 521, 750, 444, 467, 462, 435, 523, 445, 399, 468, - 506, 463, 744, 745, 457, 506, 458, 442, 469, 391, + 506, 463, 745, 746, 457, 506, 458, 442, 469, 391, 416, 464, 503, 504, 456, 522, 443, 466, 506, 418, 444, 467, 462, 506, 523, 445, 506, 468, 431, 463, 512, 506, 457, 513, 458, 512, 469, 436, 513, 464, 476, 477, 478, 476, 480, 477, 478, 481, 482, 483, 484, 482, 507, 485, 482, 483, 484, 491, 524, 485, 492, 493, 494, 492, 512, 495, 525, 513, 529, 531, - 507, 530, 538, 2262, 529, 2263, 529, 530, 510, 542, + 507, 530, 538, 2277, 529, 2278, 529, 530, 510, 542, 514, 674, 529, 543, 536, 514, 524, 537, 267, 536, 529, 267, 536, 544, 525, 436, 529, 534, 545, 436, @@ -1999,958 +2014,1035 @@ static const flex_int16_t yy_nxt[14209] = 568, 585, 570, 580, 581, 286, 571, 586, 587, 572, 573, 574, 588, 589, 323, 327, 575, 323, 327, 324, - 576, 579, 753, 582, 577, 325, 578, 583, 325, 585, - 326, 580, 581, 593, 594, 586, 587, 595, 598, 3677, - 588, 589, 319, 320, 321, 319, 887, 322, 323, 320, + 576, 579, 754, 582, 577, 325, 578, 583, 325, 585, + 326, 580, 581, 593, 594, 586, 587, 595, 598, 3719, + 588, 589, 319, 320, 321, 319, 889, 322, 323, 320, 321, 323, 604, 324, 325, 321, 321, 325, 599, 326, - 596, 593, 594, 597, 606, 595, 598, 605, 607, 754, - 265, 610, 600, 601, 602, 1323, 603, 611, 612, 614, - 604, 1113, 613, 615, 617, 608, 599, 682, 596, 618, - 609, 597, 606, 613, 986, 605, 607, 320, 3641, 610, + 596, 593, 594, 597, 606, 595, 598, 605, 607, 755, + 265, 610, 600, 601, 602, 1329, 603, 611, 612, 614, + 604, 1117, 613, 615, 617, 608, 599, 682, 596, 618, + 609, 597, 606, 613, 989, 605, 607, 320, 3682, 610, 600, 601, 602, 320, 603, 611, 612, 614, 616, 321, - 613, 615, 617, 608, 889, 682, 349, 618, 609, 349, + 613, 615, 617, 608, 891, 682, 349, 618, 609, 349, 631, 613, 600, 601, 347, 367, 347, 353, 354, 621, 623, 355, 624, 623, 619, 347, 616, 347, 347, 347, - 347, 347, 357, 363, 360, 358, 627, 360, 987, 357, - 600, 601, 358, 364, 365, 357, 629, 757, 358, 629, + 347, 347, 357, 363, 360, 358, 627, 360, 990, 357, + 600, 601, 358, 364, 365, 357, 629, 758, 358, 629, 625, 357, 630, 683, 358, 367, 357, 632, 368, 358, - 2465, 350, 2466, 367, 373, 370, 622, 633, 370, 2284, + 2482, 350, 2483, 367, 373, 370, 622, 633, 370, 2299, 367, 620, 355, 368, 441, 348, 348, 441, 367, 374, 375, 683, 359, 628, 367, 635, 631, 368, 635, 361, - 367, 367, 367, 368, 758, 363, 636, 626, 367, 684, + 367, 367, 367, 368, 759, 363, 636, 626, 367, 684, 367, 359, 584, 368, 412, 369, 359, 413, 367, 377, - 378, 3029, 377, 584, 634, 377, 378, 685, 377, 650, + 378, 3054, 377, 584, 634, 377, 378, 685, 377, 650, 371, 377, 380, 381, 377, 377, 638, 684, 377, 383, - 383, 686, 383, 632, 373, 872, 383, 383, 399, 383, - 369, 383, 383, 392, 733, 685, 648, 733, 394, 383, + 383, 686, 383, 632, 373, 874, 383, 383, 399, 383, + 369, 383, 383, 392, 734, 685, 648, 734, 394, 383, 369, 392, 383, 640, 414, 383, 383, 383, 687, 686, - 2791, 419, 420, 383, 379, 640, 651, 2965, 668, 688, - 379, 735, 383, 388, 735, 383, 379, 383, 487, 383, + 2812, 419, 420, 383, 379, 640, 651, 2989, 668, 688, + 379, 736, 383, 388, 736, 383, 379, 383, 487, 383, 379, 487, 422, 488, 390, 388, 687, 422, 643, 383, 388, 384, 383, 649, 382, 383, 383, 688, 383, 383, - 383, 392, 388, 1317, 393, 643, 394, 641, 383, 392, + 383, 392, 388, 1323, 393, 643, 394, 641, 383, 392, - 2792, 429, 430, 383, 383, 669, 383, 2966, 674, 431, + 2813, 429, 430, 383, 383, 669, 383, 2990, 674, 431, 383, 383, 383, 392, 676, 392, 399, 389, 393, 399, - 394, 399, 689, 392, 423, 396, 642, 640, 396, 2260, - 392, 2261, 660, 393, 647, 394, 3626, 392, 392, 418, - 390, 395, 670, 399, 409, 410, 383, 388, 392, 805, - 689, 648, 392, 394, 392, 675, 392, 393, 3913, 394, - 805, 677, 392, 383, 388, 395, 315, 316, 431, 383, + 394, 399, 689, 392, 423, 396, 642, 640, 396, 2275, + 392, 2276, 660, 393, 647, 394, 3666, 392, 392, 418, + 390, 395, 670, 399, 409, 410, 383, 388, 392, 806, + 689, 648, 392, 394, 392, 675, 392, 393, 3965, 394, + 806, 677, 392, 383, 388, 395, 315, 316, 431, 383, 383, 406, 285, 676, 391, 285, 392, 391, 391, 392, - 397, 391, 653, 392, 654, 808, 403, 655, 404, 671, - 412, 405, 487, 413, 658, 487, 808, 488, 649, 661, + 397, 391, 653, 392, 654, 809, 403, 655, 404, 671, + 412, 405, 487, 413, 658, 487, 809, 488, 649, 661, - 399, 392, 693, 673, 399, 392, 868, 412, 391, 391, - 413, 391, 391, 392, 392, 3913, 403, 664, 404, 404, + 399, 392, 693, 673, 399, 392, 870, 412, 391, 391, + 413, 391, 391, 392, 392, 3965, 403, 664, 404, 404, 677, 405, 405, 415, 658, 658, 415, 427, 412, 656, - 693, 413, 1098, 406, 666, 392, 391, 666, 422, 392, + 693, 413, 1102, 406, 666, 392, 391, 666, 422, 392, 418, 667, 393, 422, 394, 392, 672, 392, 393, 672, - 394, 412, 424, 392, 413, 425, 743, 414, 657, 743, - 422, 392, 391, 406, 665, 678, 1113, 392, 679, 680, - 2509, 422, 697, 422, 870, 698, 422, 699, 416, 620, + 394, 412, 424, 392, 413, 425, 744, 414, 657, 744, + 422, 392, 391, 406, 665, 678, 1117, 392, 679, 680, + 2527, 422, 697, 422, 872, 698, 422, 699, 416, 620, 694, 432, 433, 434, 432, 438, 439, 440, 438, 395, 431, 695, 391, 391, 435, 395, 690, 700, 691, 701, 697, 414, 692, 698, 702, 699, 704, 426, 694, 705, - 707, 706, 708, 710, 712, 703, 713, 715, 714, 695, - 423, 716, 709, 423, 690, 700, 691, 701, 730, 731, - 692, 711, 702, 886, 704, 887, 436, 705, 707, 706, - 708, 710, 712, 703, 713, 715, 714, 732, 736, 716, - 709, 736, 502, 737, 1113, 502, 730, 731, 3582, 711, - 717, 718, 739, 719, 506, 739, 720, 740, 721, 506, - 722, 723, 724, 761, 725, 732, 726, 727, 728, 729, - 476, 477, 478, 476, 480, 477, 478, 480, 717, 718, - 746, 719, 510, 746, 720, 747, 721, 755, 722, 723, - - 724, 761, 725, 889, 726, 727, 728, 729, 480, 477, - 478, 481, 482, 483, 484, 482, 507, 485, 492, 493, - 494, 492, 1321, 495, 482, 483, 484, 491, 2965, 485, - 762, 492, 493, 494, 492, 436, 495, 499, 502, 436, - 499, 502, 500, 750, 756, 506, 750, 763, 751, 512, - 506, 516, 513, 512, 759, 764, 513, 767, 762, 2131, - 2131, 529, 529, 436, 765, 530, 774, 486, 557, 529, - 529, 557, 775, 496, 529, 763, 533, 530, 2792, 486, - 776, 777, 529, 764, 529, 536, 496, 771, 537, 540, - 536, 1750, 501, 536, 774, 778, 529, 510, 779, 514, - - 775, 760, 536, 516, 768, 769, 540, 536, 776, 777, - 536, 766, 531, 780, 536, 781, 782, 537, 783, 536, - 784, 799, 536, 778, 533, 800, 779, 801, 802, 803, - 801, 804, 806, 807, 772, 538, 536, 590, 809, 3124, - 590, 780, 810, 781, 782, 266, 783, 811, 784, 799, - 812, 813, 770, 800, 3570, 3563, 802, 803, 814, 804, - 806, 807, 815, 816, 540, 785, 809, 786, 787, 817, - 810, 788, 789, 790, 818, 811, 3561, 791, 812, 813, - 792, 823, 793, 794, 795, 796, 814, 797, 798, 2792, - 815, 816, 824, 785, 825, 786, 787, 817, 819, 788, - - 789, 790, 818, 821, 822, 791, 826, 827, 792, 823, - 793, 794, 795, 796, 828, 797, 798, 820, 829, 830, - 824, 831, 825, 835, 834, 833, 819, 834, 836, 837, - 838, 821, 822, 839, 826, 827, 833, 840, 841, 832, - 842, 843, 828, 844, 845, 820, 829, 830, 846, 831, - 847, 835, 848, 849, 850, 851, 836, 837, 838, 852, - 853, 839, 854, 855, 351, 840, 841, 832, 842, 843, - 3546, 844, 845, 347, 357, 347, 846, 358, 847, 2129, - 848, 849, 850, 851, 2509, 3501, 623, 852, 853, 623, - 854, 855, 355, 1563, 347, 858, 347, 637, 858, 629, - - 637, 868, 629, 347, 357, 347, 861, 358, 1113, 861, - 367, 357, 865, 368, 358, 865, 383, 640, 367, 383, - 856, 383, 635, 864, 859, 635, 864, 367, 367, 640, - 368, 368, 866, 266, 877, 367, 367, 390, 1388, 3468, - 869, 348, 428, 383, 878, 914, 733, 645, 645, 733, - 348, 422, 383, 640, 359, 383, 422, 382, 2509, 392, - 862, 359, 393, 412, 394, 640, 413, 392, 866, 870, - 431, 641, 887, 914, 903, 886, 915, 369, 369, 383, - 916, 392, 662, 383, 388, 900, 874, 3405, 383, 383, - 388, 3390, 383, 399, 383, 901, 875, 917, 662, 643, - - 642, 640, 388, 910, 915, 643, 918, 871, 916, 880, - 383, 888, 2869, 907, 391, 879, 383, 391, 919, 392, - 1066, 904, 653, 399, 654, 917, 399, 655, 399, 2492, - 882, 1066, 920, 1113, 918, 922, 642, 640, 389, 884, - 889, 392, 923, 924, 647, 2262, 919, 2263, 391, 391, - 399, 391, 391, 392, 392, 3385, 653, 890, 654, 654, - 920, 655, 655, 922, 882, 882, 902, 876, 388, 656, - 923, 924, 1116, 383, 388, 392, 391, 925, 656, 678, - 590, 391, 679, 590, 391, 399, 392, 422, 399, 892, - 399, 893, 912, 976, 894, 913, 976, 895, 657, 3384, - - 422, 660, 926, 656, 891, 925, 885, 886, 392, 3378, - 391, 391, 399, 897, 391, 392, 392, 3343, 403, 403, - 404, 404, 735, 898, 405, 735, 658, 658, 927, 2465, - 926, 2466, 657, 657, 423, 428, 896, 392, 392, 2509, - 406, 391, 930, 2965, 897, 391, 392, 423, 391, 403, - 392, 404, 1703, 403, 898, 404, 927, 658, 405, 672, - 3285, 658, 672, 931, 412, 406, 659, 413, 392, 399, - 930, 666, 392, 3277, 666, 906, 392, 932, 906, 393, - 392, 394, 934, 393, 392, 394, 977, 736, 392, 977, - 736, 931, 737, 2966, 899, 391, 659, 1704, 392, 935, - - 905, 909, 392, 936, 909, 932, 412, 937, 928, 413, - 934, 938, 939, 940, 414, 929, 929, 929, 929, 929, - 929, 929, 929, 929, 941, 899, 395, 935, 3272, 391, - 395, 936, 942, 944, 945, 937, 950, 951, 952, 938, - 939, 940, 953, 954, 957, 955, 960, 946, 947, 956, - 948, 949, 941, 958, 963, 964, 414, 961, 965, 966, - 942, 944, 945, 969, 950, 951, 952, 962, 959, 975, - 953, 954, 957, 955, 960, 946, 947, 956, 948, 949, - 967, 958, 963, 964, 3246, 961, 965, 966, 970, 968, - 971, 969, 972, 508, 3232, 962, 959, 975, 978, 739, - - 506, 978, 739, 979, 740, 506, 980, 981, 967, 980, - 981, 743, 982, 999, 743, 2509, 970, 968, 971, 984, - 972, 510, 984, 746, 985, 1000, 746, 988, 747, 989, - 988, 1001, 989, 750, 990, 1002, 750, 992, 751, 993, - 992, 999, 993, 512, 994, 1009, 513, 529, 1010, 1011, - 530, 2509, 995, 1000, 1012, 529, 1013, 536, 1014, 1001, - 537, 1015, 536, 1002, 1016, 536, 1017, 1018, 801, 529, - 1019, 801, 1033, 1009, 1034, 834, 1010, 1011, 834, 536, - 1031, 1035, 1012, 1025, 1013, 1020, 1014, 1026, 1021, 1015, - 1028, 1027, 1016, 997, 1017, 1018, 1022, 1003, 1019, 1032, - - 1033, 1036, 1034, 1023, 1029, 1038, 1030, 1005, 1031, 1035, - 1024, 1025, 1040, 1020, 1043, 1026, 1021, 1037, 1028, 1027, - 1039, 1041, 1044, 1042, 1022, 1045, 1046, 1032, 1049, 1036, - 1050, 1023, 1029, 1038, 1030, 1052, 1053, 1046, 1024, 2509, - 1040, 1054, 1043, 1055, 1056, 1037, 1057, 1058, 1039, 1041, - 1044, 1042, 1060, 1045, 1061, 1062, 1049, 1063, 1050, 1064, - 1065, 1067, 1068, 1052, 1053, 1069, 1071, 1047, 1072, 1054, - 1073, 1055, 1056, 1075, 1057, 1058, 1076, 1077, 1078, 1079, - 1060, 1073, 1061, 1062, 1080, 1063, 1081, 1064, 1065, 1067, - 1068, 1082, 1074, 1069, 1071, 1083, 1072, 1084, 1085, 1086, - - 1087, 1075, 1088, 1090, 1076, 1077, 1078, 1079, 1091, 1092, - 1089, 1093, 1080, 1094, 1081, 1095, 1096, 1097, 1100, 1082, - 1074, 1893, 1099, 1083, 355, 1084, 1085, 1086, 1087, 1102, - 1088, 1090, 858, 3037, 367, 858, 1091, 1092, 1089, 1093, - 347, 1094, 347, 1095, 1096, 1097, 363, 861, 373, 1101, - 861, 1103, 357, 864, 865, 358, 864, 865, 367, 1108, - 390, 368, 1122, 390, 662, 626, 367, 383, 640, 622, - 383, 868, 383, 1105, 872, 1110, 632, 1104, 399, 868, - 640, 887, 418, 866, 662, 1123, 1124, 348, 383, 640, - 1126, 383, 392, 383, 383, 1107, 628, 394, 634, 3035, - - 392, 640, 359, 663, 866, 872, 651, 1127, 369, 669, - 976, 391, 1128, 976, 391, 383, 392, 1129, 1126, 653, - 3172, 1109, 641, 1120, 655, 1130, 3163, 882, 1131, 1111, - 2792, 834, 671, 675, 834, 1127, 2967, 887, 392, 870, - 1128, 431, 649, 871, 873, 1129, 1125, 870, 399, 889, - 1073, 642, 640, 1130, 391, 391, 1131, 391, 391, 392, - 392, 1073, 653, 653, 654, 1109, 656, 655, 655, 1132, - 882, 882, 642, 640, 399, 391, 1112, 399, 391, 399, - 392, 392, 392, 892, 392, 893, 428, 393, 894, 394, - 884, 895, 392, 677, 1200, 657, 912, 1132, 1136, 913, - - 1137, 399, 392, 1139, 422, 889, 392, 1113, 391, 883, - 883, 391, 977, 392, 1141, 977, 653, 399, 654, 1142, - 399, 655, 399, 3120, 882, 1453, 1136, 1143, 1137, 656, - 886, 1139, 1144, 1115, 395, 392, 1453, 1202, 657, 657, - 391, 754, 1141, 391, 399, 392, 1502, 1142, 892, 391, - 893, 423, 391, 894, 392, 1143, 895, 892, 886, 1117, - 1144, 391, 894, 1114, 391, 895, 392, 392, 1453, 1118, - 1145, 893, 896, 1146, 894, 392, 392, 895, 393, 1453, - 394, 1147, 909, 392, 758, 909, 391, 412, 391, 391, - 413, 392, 657, 1148, 1121, 896, 404, 392, 1145, 405, - - 889, 1146, 658, 1188, 896, 1149, 1188, 906, 1150, 1147, - 906, 1151, 392, 391, 1133, 393, 1119, 394, 1154, 1134, - 392, 1148, 3080, 978, 980, 395, 978, 980, 979, 1155, - 1156, 1135, 1157, 1149, 392, 1158, 1150, 414, 1159, 1151, - 1160, 665, 1133, 3573, 2509, 3574, 1154, 1134, 1140, 1140, - 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1155, 1156, 1135, - 1157, 1161, 395, 1158, 1162, 1163, 1159, 1164, 1160, 1165, - 391, 929, 929, 929, 929, 929, 929, 929, 929, 929, - 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1177, 1180, - 1175, 1181, 1162, 1163, 1176, 1164, 1178, 1165, 1182, 1179, - - 1183, 1184, 1185, 1187, 1189, 3043, 1204, 1189, 1166, 1167, - 1168, 1169, 1170, 1171, 1172, 1173, 1177, 1180, 1175, 1181, - 981, 1893, 1176, 981, 1178, 982, 1182, 1179, 1183, 1184, - 1185, 1187, 1190, 984, 1204, 1190, 984, 1191, 985, 1192, - 1193, 988, 1192, 1193, 988, 1194, 989, 1196, 1205, 989, - 1196, 990, 1197, 992, 1206, 1197, 992, 1198, 993, 1199, - 510, 993, 1199, 994, 516, 1201, 529, 1203, 1208, 1207, - 536, 1210, 1213, 1209, 529, 536, 1205, 1214, 536, 1215, - 1216, 1217, 1206, 1218, 3573, 1219, 3574, 533, 3035, 1220, - 540, 1221, 2862, 1222, 1223, 1224, 1225, 1230, 1233, 1234, - - 1213, 1226, 1227, 1228, 1229, 1214, 1231, 1215, 1216, 1217, - 1232, 1218, 756, 1219, 760, 768, 766, 1220, 772, 1221, - 770, 1222, 1223, 1224, 1225, 1230, 1233, 1234, 1235, 1226, - 1227, 1228, 1229, 1236, 1231, 1237, 1238, 1239, 1232, 1240, - 1241, 1242, 1245, 1248, 1246, 1243, 1250, 1244, 1247, 1251, - 1252, 1253, 1254, 1255, 3022, 1260, 1235, 1261, 2284, 3616, - 1249, 1236, 1264, 1237, 1238, 1239, 1265, 1240, 1241, 1242, - 1245, 1248, 1246, 1243, 1250, 1244, 1247, 1251, 1252, 1253, - 1254, 1255, 1256, 1260, 1266, 1261, 1257, 1262, 1249, 1267, - 1264, 1268, 1269, 1258, 1265, 1259, 1270, 1271, 1262, 1272, - - 3040, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 3617, - 1256, 1289, 1266, 2982, 1257, 1290, 1291, 1267, 2981, 1268, - 1269, 1258, 1292, 1259, 1270, 1271, 1293, 1272, 1263, 1274, - 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1289, - 1294, 1284, 1295, 1290, 1291, 1296, 1285, 1297, 1298, 1299, - 1292, 1300, 1286, 1301, 1293, 1302, 1287, 1303, 1288, 1304, - 1305, 1306, 1307, 1308, 1309, 1282, 1283, 1310, 1294, 1284, - 1295, 1311, 1312, 1296, 1285, 1297, 1298, 1299, 1313, 1300, - 1286, 1301, 351, 1302, 1287, 1303, 1288, 1304, 1305, 1306, - 1307, 1308, 1309, 1316, 1320, 1310, 868, 887, 428, 1311, - - 1312, 887, 383, 640, 887, 383, 1313, 383, 2972, 1329, - 355, 391, 1331, 1332, 391, 1314, 392, 1333, 866, 653, - 391, 654, 1746, 391, 1318, 392, 431, 882, 1324, 383, - 654, 1325, 2967, 655, 1328, 1334, 882, 1329, 392, 1113, - 1331, 1332, 662, 1322, 3183, 1333, 391, 391, 1335, 391, - 399, 392, 2931, 399, 892, 399, 1117, 641, 399, 894, - 399, 2492, 895, 1334, 1317, 1321, 656, 1388, 883, 889, - 1338, 1115, 889, 392, 1188, 891, 1335, 1188, 1326, 1886, - 391, 904, 399, 391, 1336, 392, 1315, 640, 892, 391, - 893, 1563, 391, 894, 392, 1319, 895, 892, 1338, 893, - - 1337, 886, 894, 399, 657, 895, 399, 392, 399, 1339, - 896, 1342, 1336, 1344, 1345, 1346, 392, 1189, 1190, 660, - 1189, 1190, 1390, 1191, 1887, 1390, 1347, 1348, 1337, 1350, - 399, 1351, 1353, 1354, 1355, 896, 1564, 1339, 1343, 1342, - 1356, 1344, 1345, 1346, 1327, 1140, 1140, 1140, 1140, 1140, - 1140, 1140, 1140, 1140, 1347, 1348, 1357, 1350, 406, 1351, - 1353, 1354, 1355, 1358, 1319, 1359, 1361, 1362, 1356, 1360, - 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1363, 1364, - 1365, 1366, 1367, 1370, 1357, 1368, 1369, 399, 1371, 1372, - 1373, 1358, 1374, 1359, 1361, 1362, 1375, 1376, 1377, 1378, - - 1380, 1381, 1382, 1383, 1384, 2914, 1363, 1364, 1365, 1366, - 1367, 1370, 1192, 1368, 1369, 1192, 1371, 1372, 1373, 1391, - 1374, 508, 1391, 1395, 1375, 1376, 1377, 1378, 1380, 1381, - 1382, 1383, 1384, 1193, 1392, 1396, 1193, 1392, 1194, 1393, - 1196, 1197, 1394, 1196, 1197, 1394, 1198, 1199, 1397, 510, - 1199, 1395, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, - 1408, 1409, 1410, 1396, 1411, 1412, 1413, 1415, 1416, 1417, - 1418, 1419, 1414, 1420, 1421, 1422, 1397, 1423, 1424, 1425, - 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, - 1410, 1426, 1411, 1412, 1413, 1415, 1416, 1417, 1418, 1419, - - 1414, 1420, 1421, 1422, 1427, 1423, 1424, 1425, 1428, 1429, - 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1438, 1439, 1426, - 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1452, 1454, - 2284, 1437, 1427, 1455, 1456, 2857, 1428, 1429, 1430, 1431, - 1432, 1433, 1434, 1435, 1436, 1438, 1439, 1448, 1440, 1441, - 1442, 1443, 1444, 1445, 1446, 1447, 1452, 1454, 1449, 1437, - 1458, 1455, 1456, 1450, 1451, 1459, 1460, 1461, 1463, 1464, - 1465, 1466, 1468, 1470, 1471, 1448, 1472, 1473, 1475, 1476, - 1477, 1479, 1480, 1474, 1481, 1482, 1449, 1483, 1458, 1484, - 1485, 1450, 1451, 1459, 1460, 1461, 1463, 1464, 1465, 1466, - - 1468, 1470, 1471, 1486, 1472, 1473, 1475, 1476, 1477, 1479, - 1480, 1474, 1481, 1482, 1487, 1483, 1488, 1484, 1485, 1489, - 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, - 1500, 1486, 868, 887, 1504, 662, 1390, 1391, 2284, 1390, - 1391, 1507, 1487, 3643, 1488, 3644, 3913, 1489, 1490, 1491, - 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, - 391, 399, 1504, 391, 399, 392, 399, 887, 892, 1507, - 893, 869, 888, 894, 2284, 1508, 895, 884, 399, 1509, - 3307, 391, 1510, 1505, 391, 1506, 392, 392, 399, 1503, - 1511, 893, 1512, 1513, 894, 1514, 1519, 895, 1520, 1521, - - 870, 889, 659, 1508, 1522, 1523, 1112, 1509, 391, 1516, - 1510, 1505, 1516, 1506, 1516, 896, 656, 2818, 1511, 1517, - 1512, 1513, 1516, 1514, 1519, 1524, 1520, 1521, 1529, 1525, - 1530, 2817, 1522, 1523, 1532, 889, 1119, 1392, 1538, 2794, - 1392, 1567, 1393, 1394, 1567, 886, 1394, 2756, 1539, 1542, - 1543, 1544, 1545, 1524, 1546, 1547, 1529, 1548, 1530, 1527, - 1549, 1550, 1532, 1551, 1518, 1528, 1538, 1360, 1360, 1360, - 1360, 1360, 1360, 1360, 1360, 1360, 1539, 1542, 1543, 1544, - 1545, 1552, 1546, 1547, 1553, 1548, 1554, 1527, 1549, 1550, - 1555, 1551, 1556, 1528, 1557, 1559, 1560, 1561, 1562, 1568, - - 1558, 1569, 1572, 1573, 1574, 1575, 1576, 1574, 1577, 1552, - 1578, 1579, 1553, 1580, 1554, 1581, 1582, 1583, 1555, 1584, - 1556, 1588, 1557, 1559, 1560, 1561, 1562, 1568, 1558, 1569, - 1572, 1573, 1589, 1575, 1576, 1585, 1577, 1590, 1578, 1579, - 1591, 1580, 1592, 1581, 1582, 1583, 1593, 1584, 1586, 1588, - 1594, 1595, 1596, 1587, 1601, 1602, 1597, 1603, 1604, 1605, - 1589, 1606, 1598, 1585, 1599, 1590, 1607, 1600, 1591, 2346, - 1592, 1614, 1615, 1616, 1593, 1617, 1586, 1618, 1594, 1595, - 1596, 1587, 1601, 1602, 1597, 1603, 1604, 1605, 1619, 1606, - 1598, 1620, 1599, 1608, 1607, 1600, 1621, 1609, 1622, 1614, - - 1615, 1616, 1623, 1617, 1610, 1618, 1611, 1612, 1624, 1613, - 1625, 1626, 1627, 1628, 1629, 1630, 1619, 1631, 1632, 1620, - 1633, 1608, 1634, 1638, 1621, 1609, 1622, 1639, 1640, 1641, - 1623, 1642, 1610, 1649, 1611, 1612, 1624, 1613, 1625, 1626, - 1627, 1628, 1629, 1630, 1650, 1631, 1632, 1643, 1633, 1654, - 1634, 1638, 1656, 1651, 1644, 1639, 1640, 1641, 1657, 1642, - 1654, 1649, 1645, 1658, 1659, 1660, 1652, 1646, 1653, 1661, - 1662, 1655, 1650, 1663, 1664, 1643, 1665, 1666, 1667, 1668, - 1656, 1651, 1644, 1669, 1670, 1673, 1657, 1674, 1675, 1676, - 1645, 1658, 1659, 1660, 1652, 1646, 1653, 1661, 1662, 1655, - - 1677, 1663, 1664, 1671, 1665, 1666, 1667, 1668, 1672, 1678, - 1679, 1669, 1670, 1673, 1680, 1674, 1675, 1676, 1681, 1682, - 1685, 1687, 1688, 1683, 1689, 1686, 887, 1691, 1677, 399, - 1692, 1671, 399, 1693, 399, 1690, 1672, 1678, 1679, 1684, - 1694, 1695, 1680, 1113, 1696, 1115, 1681, 1682, 1685, 1687, - 1688, 1683, 1689, 1686, 399, 1691, 399, 1697, 1692, 1698, - 1699, 1693, 1700, 1706, 1709, 2344, 2725, 1684, 1694, 1695, - 1516, 1710, 1696, 1516, 1711, 1516, 1516, 1716, 2723, 1516, - 1701, 1516, 1326, 1516, 896, 1697, 1701, 1698, 1699, 1516, - 1700, 1706, 1709, 883, 889, 1717, 1718, 2666, 1719, 1710, - - 1713, 1721, 1711, 2498, 1714, 1716, 1715, 1526, 1526, 1526, - 1526, 1526, 1526, 1526, 1526, 1526, 1722, 1725, 1726, 1727, - 1728, 1729, 1730, 1717, 1718, 1702, 1719, 1731, 1713, 1721, - 1732, 1518, 1714, 1733, 1715, 1723, 1723, 1723, 1723, 1723, - 1723, 1723, 1723, 1723, 1722, 1725, 1726, 1727, 1728, 1729, - 1730, 1734, 1735, 1736, 1737, 1731, 1738, 1739, 1732, 1740, - 1741, 1733, 1742, 1743, 1744, 1745, 1567, 1747, 1751, 1567, - 1752, 1574, 1654, 1755, 1574, 1756, 1753, 1757, 1758, 1734, - 1735, 1736, 1737, 1654, 1738, 1739, 1761, 1740, 1741, 1762, - 1742, 1743, 1744, 1745, 1763, 1747, 1751, 1759, 1752, 1764, - - 1765, 1755, 1766, 1756, 1760, 1757, 1758, 1767, 1768, 1769, - 1770, 1771, 1772, 1773, 1761, 1774, 1775, 1762, 1776, 1777, - 1778, 1779, 1763, 1780, 1781, 1759, 1782, 1764, 1765, 1783, - 1766, 1784, 1760, 1785, 1786, 1767, 1768, 1769, 1770, 1771, - 1772, 1773, 1787, 1774, 1775, 1788, 1776, 1777, 1778, 1779, - 1789, 1780, 1781, 1790, 1782, 1791, 1792, 1783, 1793, 1784, - 1794, 1785, 1786, 1795, 1796, 1797, 1798, 1799, 1800, 1801, - 1787, 1802, 1803, 1788, 1804, 1807, 1805, 1808, 1789, 1809, - 1810, 1790, 1811, 1791, 1792, 1812, 1793, 1805, 1794, 2496, - 1813, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1814, 1802, - - 1803, 1815, 1804, 1807, 1816, 1808, 1817, 1809, 1810, 1818, - 1811, 1819, 1821, 1812, 1822, 1823, 1824, 1806, 1813, 1825, - 1826, 1839, 1827, 1840, 1837, 1841, 1814, 1842, 1843, 1815, - 1844, 1845, 1816, 1828, 1817, 1837, 1846, 1818, 2078, 1819, - 1821, 1847, 1822, 1823, 1824, 2284, 1848, 1825, 1826, 1839, - 1827, 1840, 1849, 1841, 1850, 1842, 1843, 1851, 1844, 1845, - 1852, 1828, 1829, 1830, 1846, 1853, 1831, 1854, 1832, 1847, - 1855, 1856, 1833, 1834, 1848, 1857, 1835, 1858, 1859, 1860, - 1849, 1836, 1850, 1861, 1862, 1851, 1863, 1864, 1852, 1865, - 1829, 1830, 1869, 1853, 1831, 1854, 1832, 1870, 1855, 1856, - - 1833, 1834, 1866, 1857, 1835, 1858, 1859, 1860, 1871, 1836, - 1867, 1861, 1862, 1868, 1863, 1864, 1872, 1865, 1873, 1875, - 1869, 1876, 1877, 1878, 1879, 1870, 1880, 1882, 1883, 1888, - 1866, 1891, 1516, 1892, 2284, 1516, 1871, 1516, 1867, 1881, - 1894, 1868, 1884, 2475, 1872, 1516, 1873, 1875, 2473, 1876, - 1877, 1878, 1879, 1895, 1880, 1882, 1883, 1888, 1896, 1891, - 1897, 1892, 1893, 1898, 1905, 1899, 1901, 1881, 1894, 1712, - 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1902, 1906, - 1907, 1895, 1908, 1903, 1909, 1910, 1896, 1518, 1897, 1911, - 1912, 1898, 1905, 1899, 1901, 1723, 1723, 1723, 1723, 1723, - - 1723, 1723, 1723, 1723, 1913, 1914, 1902, 1906, 1907, 1915, - 1908, 1903, 1909, 1910, 1916, 1917, 1921, 1911, 1912, 1918, - 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1922, 1931, 1919, - 1837, 1937, 1913, 1914, 1938, 2063, 1923, 1915, 1940, 1941, - 1920, 1837, 1916, 1917, 1921, 1942, 1943, 1918, 1924, 1925, - 1926, 1927, 1928, 1929, 1930, 1922, 1931, 1919, 3913, 1937, - 1944, 3913, 1938, 3913, 1923, 1945, 1940, 1941, 1920, 1946, - 1947, 1948, 1949, 1942, 1943, 1950, 1951, 1952, 1953, 1955, - 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1944, 1964, - 1965, 1966, 1967, 1945, 1954, 1969, 2663, 1946, 1947, 1948, - - 1949, 1970, 1971, 1950, 1951, 1952, 1953, 1955, 1956, 1957, - 1958, 1959, 1960, 1961, 1962, 1963, 1972, 1964, 1965, 1966, - 1967, 1968, 1954, 1969, 1968, 1973, 1974, 1975, 1976, 1970, - 1971, 1977, 1978, 1979, 1980, 1981, 1982, 1984, 1985, 1986, - 1984, 1987, 1983, 1988, 1972, 1990, 1991, 1992, 1989, 1993, - 1994, 1997, 1998, 1973, 1974, 1975, 1976, 1995, 1999, 1977, - 1978, 1979, 1980, 1981, 1982, 2002, 1985, 1986, 1995, 1987, - 1983, 1988, 2003, 1990, 1991, 1992, 1989, 1993, 1994, 1997, - 1998, 2000, 2004, 2005, 2006, 2008, 1999, 2009, 2010, 2011, - 2012, 2013, 2014, 2002, 2015, 2001, 2018, 2019, 1996, 2020, - - 2003, 2021, 2022, 2023, 2024, 2660, 2639, 2016, 2030, 2000, - 2004, 2005, 2006, 2008, 2031, 2009, 2010, 2011, 2012, 2013, - 2014, 2017, 2015, 2032, 2018, 2019, 2033, 2020, 2034, 2021, - 2022, 2023, 2024, 2025, 2026, 2016, 2030, 2035, 2037, 2027, - 2038, 2039, 2031, 2040, 2041, 2042, 2043, 2028, 2044, 2017, - 2029, 2032, 2045, 2046, 2033, 2047, 2034, 2053, 2054, 2055, - 2629, 2025, 2026, 2056, 2057, 2035, 2037, 2027, 2038, 2039, - 2058, 2040, 2041, 2042, 2043, 2028, 2044, 2059, 2029, 2064, - 2045, 2046, 2048, 2047, 2049, 2053, 2054, 2055, 2050, 2062, - 2065, 2056, 2057, 2068, 2048, 2066, 2049, 2069, 2058, 2051, - - 2050, 2052, 2067, 2070, 2071, 2059, 1703, 2064, 2072, 2073, - 2048, 2051, 2049, 2060, 1703, 2077, 2050, 2152, 2065, 2079, - 2152, 2068, 2048, 2066, 2049, 2069, 2080, 2051, 2050, 2052, - 2067, 2070, 2071, 2081, 2063, 1516, 2072, 2073, 1516, 2051, - 1516, 2060, 2082, 2085, 2083, 1701, 2084, 2079, 1516, 2086, - 2087, 1704, 2088, 2089, 2080, 2090, 2101, 2102, 2103, 1887, - 2078, 2081, 2192, 2619, 2104, 2105, 2106, 2107, 2108, 2109, - 2082, 2085, 2083, 2192, 2084, 2617, 2412, 2086, 2087, 2110, - 2088, 2089, 2601, 2090, 2101, 2102, 2103, 2412, 2113, 2114, - 1702, 2091, 2104, 2105, 2106, 2107, 2108, 2109, 2092, 2092, - - 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2110, 2111, 2115, - 2093, 2116, 2094, 2095, 2096, 2112, 2113, 2114, 2097, 2117, - 2118, 2121, 2119, 2098, 2122, 2123, 2124, 2125, 2126, 2127, - 2135, 2137, 2099, 2120, 2586, 2346, 2111, 2115, 2093, 2116, - 2094, 2095, 2096, 2112, 2138, 2139, 2097, 2117, 2118, 2121, - 2119, 2098, 2122, 2123, 2124, 2125, 2126, 2127, 2135, 2137, - 2099, 2120, 2130, 2131, 2132, 2130, 2133, 2131, 2134, 2133, - 2140, 2141, 2138, 2139, 2142, 2143, 2144, 2145, 2146, 2147, - 2148, 2149, 2150, 2153, 2154, 2155, 2156, 2157, 2158, 2344, - 2159, 2160, 2161, 2283, 2162, 2163, 2284, 2166, 2140, 2141, - - 2167, 2534, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, - 2150, 2153, 2154, 2155, 2156, 2157, 2158, 1934, 2159, 2160, - 2161, 1936, 2162, 2163, 1968, 2166, 2168, 1968, 2167, 2165, - 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, - 2179, 2180, 1984, 2183, 2184, 1984, 2185, 2181, 2186, 2187, - 2188, 2189, 2190, 2191, 2168, 2193, 2194, 2195, 2169, 2170, - 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, - 2196, 2183, 2184, 2197, 2185, 2198, 2186, 2187, 2188, 2189, - 2190, 2191, 2199, 2193, 2194, 2195, 2200, 2201, 2202, 2203, - 3643, 2152, 3644, 2215, 2152, 2216, 2370, 3913, 2196, 2217, - - 3913, 2197, 3913, 2198, 2218, 2219, 2220, 3707, 2221, 3708, - 2199, 2222, 2223, 2224, 2200, 2201, 2202, 2203, 2204, 2205, - 2206, 2215, 2207, 2216, 2208, 2209, 2225, 2217, 2210, 2211, - 2212, 2226, 2218, 2219, 2220, 2213, 2221, 2214, 2227, 2222, - 2223, 2224, 2228, 2229, 2230, 2231, 2204, 2205, 2206, 2232, - 2207, 2233, 2208, 2209, 2225, 2234, 2210, 2211, 2212, 2226, - 2235, 2236, 2237, 2213, 2238, 2214, 2227, 2239, 2240, 2242, - 2228, 2229, 2230, 2231, 2243, 2244, 2245, 2232, 2248, 2233, - 2249, 2250, 2251, 2234, 2252, 2253, 2254, 2255, 2235, 2236, - 2237, 2256, 2238, 2257, 2258, 2239, 2240, 2242, 2259, 2264, - - 2267, 2270, 2243, 2244, 2245, 2265, 2248, 2266, 2249, 2250, - 2251, 2267, 2252, 2253, 2254, 2255, 2272, 2496, 2285, 2256, - 2273, 2257, 2258, 2274, 2275, 2276, 2259, 2264, 2288, 2277, - 2278, 2279, 2280, 2265, 2281, 2266, 2285, 2290, 2291, 2292, - 2293, 2294, 2295, 2296, 2272, 2268, 2271, 2297, 2273, 2298, - 2309, 2274, 2275, 2276, 2078, 2493, 2063, 2277, 2278, 2279, - 2280, 2492, 2281, 2286, 2310, 2290, 2291, 2292, 2293, 2294, - 2295, 2296, 2299, 2289, 2300, 2297, 2406, 2298, 2309, 2406, - 2413, 2078, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, - 2092, 2413, 2310, 2311, 2312, 2473, 2314, 2315, 2316, 2313, - - 2299, 2318, 2300, 2301, 2301, 2301, 2301, 2301, 2301, 2301, - 2301, 2301, 2319, 2320, 2321, 2302, 2322, 2303, 2304, 2305, - 2323, 2311, 2312, 2306, 2314, 2315, 2316, 2313, 2307, 2318, - 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2308, 2331, 2332, - 2319, 2320, 2321, 2302, 2322, 2303, 2304, 2305, 2323, 2333, - 2334, 2306, 2335, 2336, 2337, 2338, 2307, 2339, 2324, 2325, - 2326, 2327, 2328, 2329, 2330, 2308, 2331, 2332, 2340, 2341, - 2342, 2130, 2131, 2132, 2130, 2131, 2132, 2333, 2334, 2347, - 2335, 2336, 2337, 2338, 2348, 2339, 2133, 2131, 2134, 2133, - 2131, 2134, 2349, 2350, 2351, 2360, 2340, 2341, 2342, 2361, - - 2362, 3683, 2363, 2364, 2365, 2366, 2367, 2347, 2368, 2369, - 2372, 2374, 2348, 2372, 2375, 2376, 2471, 2063, 2377, 2378, - 2349, 2350, 2351, 2360, 2379, 2380, 1934, 2361, 2362, 1934, - 2363, 2364, 2365, 2366, 2367, 2381, 2368, 2369, 2382, 2374, - 2383, 1936, 2375, 2376, 1936, 2352, 2377, 2378, 2352, 2470, - 2373, 3684, 2379, 2380, 2385, 2386, 2387, 2388, 2389, 2390, - 2391, 2472, 2392, 2381, 2353, 2455, 2382, 2393, 2383, 2394, - 2396, 2397, 2398, 2399, 2401, 2446, 2402, 2354, 2373, 2355, - 2346, 2403, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2356, - 2392, 2357, 2358, 2359, 2404, 2393, 2405, 2394, 2396, 2397, - - 2398, 2399, 2401, 3913, 2402, 2354, 3913, 2355, 3913, 2403, - 2407, 2408, 2409, 2410, 2411, 2414, 2415, 2356, 2416, 2357, - 2358, 2359, 2404, 2417, 2405, 2418, 2419, 2421, 2422, 2423, - 2424, 2425, 2426, 2427, 2428, 2420, 2429, 2430, 2407, 2408, - 2409, 2410, 2411, 2414, 2415, 2433, 2416, 2434, 2431, 2435, - 2436, 2417, 2437, 2418, 2419, 2421, 2422, 2423, 2424, 2425, - 2426, 2427, 2428, 2432, 2429, 2430, 2438, 2439, 2440, 2441, - 2442, 2443, 2444, 2433, 2445, 2434, 2431, 2435, 2436, 2447, - 2437, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2456, 2457, - 2458, 2432, 2459, 2460, 2438, 2439, 2440, 2441, 2442, 2443, - - 2444, 2461, 2445, 2462, 2463, 2464, 2467, 2447, 2468, 2448, - 2449, 2450, 2451, 2452, 2453, 2454, 2456, 2457, 2458, 2469, - 2459, 2460, 2474, 2476, 2477, 2478, 2479, 2480, 2481, 2461, - 2482, 2462, 2463, 2464, 2467, 2483, 2468, 2484, 2494, 2497, - 2499, 2555, 2500, 2501, 2555, 2502, 2503, 2469, 2504, 2505, - 2506, 2476, 2477, 2478, 2479, 2480, 2481, 2507, 2482, 2487, - 2508, 2344, 2487, 2483, 2487, 2484, 2247, 2475, 2499, 2488, - 2500, 2501, 2489, 2502, 2503, 2510, 2504, 2505, 2506, 2511, - 2512, 2515, 2509, 2495, 2498, 2507, 2490, 2516, 2508, 2301, - 2301, 2301, 2301, 2301, 2301, 2301, 2301, 2301, 2517, 2513, - - 2518, 2519, 2520, 2510, 2514, 2521, 2522, 2511, 2512, 2515, - 2523, 2524, 2525, 2526, 2491, 2516, 2527, 2528, 2529, 2530, - 2531, 2532, 2533, 2535, 2536, 2537, 2517, 2513, 2518, 2519, - 2520, 2538, 2514, 2521, 2522, 2539, 2540, 2541, 2523, 2524, - 2525, 2526, 2542, 2543, 2527, 2528, 2529, 2530, 2531, 2532, - 2533, 2535, 2536, 2537, 2545, 2546, 2549, 2545, 2550, 2538, - 2551, 2552, 2556, 2539, 2540, 2541, 2548, 2546, 2557, 2548, - 2542, 2543, 2352, 2559, 2558, 2352, 2560, 2553, 2561, 2562, - 2563, 2246, 2564, 2565, 2549, 2564, 2550, 2566, 2551, 2552, - 2556, 2567, 2568, 2241, 2569, 2570, 2557, 2571, 2572, 2576, - - 3913, 2559, 2558, 3913, 2560, 3913, 2561, 2562, 2563, 2344, - 2577, 2565, 2578, 2372, 2579, 2566, 2372, 2580, 2574, 2567, - 2568, 2346, 2569, 2570, 2343, 2571, 2572, 2576, 2581, 2582, - 2583, 2584, 2585, 2587, 2584, 2588, 2345, 2589, 2577, 2590, - 2578, 2591, 2579, 2592, 2593, 2580, 2594, 2595, 2596, 2597, - 2598, 2599, 2600, 2602, 2603, 2605, 2581, 2582, 2583, 2604, - 2585, 2587, 2604, 2588, 2606, 2589, 2610, 2590, 2611, 2591, - 2612, 2592, 2593, 2613, 2594, 2595, 2596, 2597, 2598, 2599, - 2600, 2602, 2603, 2605, 2608, 2614, 2615, 2608, 2616, 2609, - 2618, 2620, 2606, 2622, 2610, 2623, 2611, 2624, 2612, 2625, - - 2626, 2613, 2620, 2627, 2151, 2628, 2630, 2631, 2632, 2633, - 2634, 2635, 2636, 2614, 2615, 2637, 2616, 2638, 2618, 2640, - 2641, 2622, 2642, 2623, 2643, 2624, 2644, 2625, 2626, 2645, - 2646, 2627, 2621, 2628, 2630, 2631, 2632, 2633, 2634, 2635, - 2636, 2647, 2648, 2637, 2649, 2638, 2650, 2640, 2641, 2651, - 2642, 2652, 2643, 2653, 2644, 2654, 2655, 2645, 2646, 2656, - 2657, 2658, 2659, 2661, 2662, 2664, 2267, 2471, 2666, 2647, - 2648, 2667, 2649, 2668, 2650, 2669, 2670, 2651, 2671, 2652, - 2672, 2653, 2136, 2654, 2655, 2673, 2284, 2656, 2657, 2658, - 2659, 2661, 2662, 2690, 2692, 2285, 2666, 1936, 2678, 2667, - - 2485, 2668, 1934, 2669, 2670, 2494, 2671, 3707, 2672, 3708, - 2475, 2665, 2475, 2673, 2487, 2679, 2693, 2487, 2694, 2487, - 2487, 2695, 2692, 2487, 2675, 2487, 2487, 2489, 2681, 2487, - 2682, 2487, 2487, 1893, 2696, 2487, 2686, 2487, 2498, 2489, - 2691, 2676, 2675, 2680, 2693, 2489, 2694, 2683, 2697, 2695, - 2498, 2698, 2699, 2687, 2700, 2701, 2702, 2703, 2704, 2676, - 2705, 1893, 2696, 2706, 2707, 2708, 2709, 2710, 2711, 2677, - 2712, 2713, 2714, 2715, 2716, 2684, 2697, 2717, 2718, 2698, - 2699, 2688, 2700, 2701, 2702, 2703, 2704, 2491, 2705, 2719, - 2720, 2706, 2707, 2708, 2709, 2710, 2711, 2721, 2712, 2713, - - 2714, 2715, 2716, 2722, 2724, 2717, 2718, 2726, 2727, 2728, - 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2719, 2720, 2545, - 2546, 2736, 2545, 2548, 2546, 2721, 2548, 2555, 2739, 2740, - 2555, 2722, 2724, 2741, 2742, 2726, 2727, 2728, 2729, 2730, - 2731, 2732, 2733, 2734, 2735, 2743, 2100, 2744, 2745, 2736, - 2564, 2746, 2749, 2564, 2750, 2747, 2739, 2740, 2751, 2752, - 2753, 2741, 2742, 2754, 2755, 2075, 2758, 2759, 2760, 2761, - 2762, 2763, 2074, 2743, 2344, 2744, 2745, 2768, 2346, 2746, - 2749, 2764, 2750, 2765, 2769, 2770, 2751, 2752, 2753, 2343, - 2771, 2754, 2755, 2345, 2758, 2759, 2760, 2761, 2762, 2763, - - 2767, 2772, 2773, 2767, 2774, 2768, 2775, 2776, 2777, 2764, - 2776, 2765, 2769, 2770, 2779, 2780, 2781, 2782, 2771, 2783, - 2784, 2604, 2787, 2788, 2604, 2789, 2785, 2778, 2608, 2772, - 2773, 2608, 2774, 2609, 2775, 2793, 2777, 2795, 2796, 2797, - 2798, 2799, 2779, 2780, 2781, 2782, 2800, 2783, 2784, 2801, - 2787, 2788, 2802, 2789, 2803, 2778, 2804, 2805, 2806, 2807, - 2808, 2809, 2810, 2793, 2811, 2795, 2796, 2797, 2798, 2799, - 2812, 2813, 2814, 2815, 2800, 2816, 2819, 2801, 2820, 2821, - 2802, 2822, 2803, 2823, 2804, 2805, 2806, 2807, 2808, 2809, - 2810, 2824, 2811, 2825, 2826, 2827, 2828, 2829, 2812, 2813, - - 2814, 2815, 2830, 2816, 2819, 2831, 2820, 2821, 2832, 2822, - 2833, 2823, 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2824, - 2841, 2825, 2826, 2827, 2828, 2829, 2842, 2471, 2843, 2844, - 2830, 2845, 2846, 2831, 2847, 2848, 2832, 2849, 2833, 2284, - 2834, 2835, 2836, 2837, 2838, 2839, 2840, 2492, 2841, 2494, - 2858, 2861, 2491, 2485, 2842, 2284, 2874, 2844, 2875, 2845, - 2846, 2851, 2847, 2848, 2851, 2849, 2851, 2859, 2679, 2485, - 2873, 2852, 2472, 2063, 2853, 2863, 2935, 2487, 2876, 2935, - 2487, 2681, 2487, 2877, 2874, 2878, 2875, 2856, 2854, 2879, - 2489, 1887, 2880, 2036, 2495, 2860, 2862, 2851, 2487, 2881, - - 2851, 2487, 2851, 2487, 2676, 2007, 2876, 2865, 2868, 2487, - 2853, 2877, 2487, 2878, 2487, 2078, 2855, 2879, 2851, 2686, - 2880, 2851, 2489, 2851, 2866, 2683, 2882, 2881, 2852, 1936, - 2487, 2853, 2491, 2487, 2883, 2487, 2687, 2884, 2885, 2886, - 2871, 2887, 2888, 2489, 2889, 2854, 2890, 2891, 2892, 2893, - 2894, 2895, 2867, 2869, 2882, 2896, 2897, 2687, 2898, 2899, - 2900, 2901, 2883, 2902, 2688, 2884, 2885, 2886, 2903, 2887, - 2888, 2904, 2889, 2855, 2890, 2891, 2892, 2893, 2894, 2895, - 2905, 2906, 2907, 2896, 2897, 2872, 2898, 2899, 2900, 2901, - 2908, 2902, 2909, 2910, 2911, 2912, 2903, 2913, 2915, 2904, - - 2916, 2917, 2918, 2919, 2920, 2921, 2922, 2924, 2905, 2906, - 2907, 2925, 2926, 2927, 2928, 2929, 2930, 2932, 2908, 2933, - 2909, 2910, 2911, 2912, 2934, 2913, 2915, 2937, 2916, 2917, - 2918, 2919, 2920, 2921, 2922, 2924, 2938, 2939, 2940, 2925, - 2926, 2927, 2928, 2929, 2930, 2932, 2936, 2933, 2767, 2936, - 2941, 2767, 2934, 1934, 2947, 2937, 2948, 2949, 2950, 2943, - 2953, 2954, 2955, 2956, 2938, 2939, 2940, 2944, 2776, 2957, - 2945, 2776, 2946, 2951, 2958, 2959, 2960, 2962, 2963, 2964, - 2968, 2942, 2947, 2969, 2948, 2949, 2950, 2943, 2953, 2954, - 2955, 2956, 2971, 2974, 2975, 2944, 2976, 2957, 2945, 2970, - - 2946, 2973, 2958, 2959, 2960, 2962, 2963, 2964, 2968, 2942, - 2970, 2969, 2973, 2977, 2978, 2979, 2980, 2983, 2985, 2986, - 2971, 2974, 2975, 2987, 2976, 2988, 2989, 2990, 2991, 2992, - 2993, 2984, 2994, 2995, 2996, 2997, 2998, 2989, 2999, 3000, - 3001, 2977, 2978, 2979, 2980, 2983, 2985, 2986, 3002, 3003, - 3004, 2987, 3005, 2988, 3006, 2990, 2991, 2992, 2993, 3007, - 2994, 2995, 2996, 2997, 2998, 3008, 2999, 3000, 3001, 3009, - 3010, 3011, 3012, 3013, 3014, 3015, 3002, 3003, 3004, 3016, - 3005, 3017, 3006, 2471, 3018, 3019, 3020, 3007, 3021, 3027, - 3023, 3044, 2872, 3008, 3027, 2284, 3683, 3009, 3010, 3011, - - 3012, 3013, 3014, 3015, 2494, 3045, 2859, 3016, 3024, 3017, - 1932, 2859, 3018, 3019, 3020, 3046, 3021, 2851, 3023, 3044, - 2851, 2851, 2851, 3036, 2851, 3047, 2851, 3025, 2271, 1904, - 2853, 3030, 2851, 3045, 3028, 2851, 3024, 2851, 2678, 3028, - 2859, 2678, 3025, 3046, 2854, 2853, 3617, 2851, 3031, 2289, - 2851, 2487, 2851, 3047, 2487, 2679, 2487, 3033, 2679, 2854, - 2853, 2675, 1900, 3086, 2489, 3048, 3086, 1890, 3037, 1518, - 2487, 3049, 3026, 2487, 2854, 2487, 3032, 1885, 2676, 3050, - 2682, 3051, 1705, 2680, 1874, 2851, 2862, 3026, 2851, 3052, - 2851, 2851, 3053, 3048, 2851, 3038, 2851, 2683, 2853, 3049, - - 2851, 3038, 3034, 2851, 2853, 2851, 2677, 3050, 1838, 3051, - 3041, 2487, 2866, 2853, 2487, 3054, 2487, 3052, 2866, 3055, - 3053, 2682, 1820, 2487, 3056, 2684, 2487, 2866, 2487, 2487, - 3057, 3058, 2487, 2686, 2487, 3059, 2489, 3060, 2683, 2686, - 3039, 3061, 2489, 3054, 3062, 3063, 3039, 3055, 3064, 3065, - 2687, 3066, 3056, 3067, 3068, 3042, 2687, 3069, 3057, 3058, - 3070, 3071, 3072, 3059, 3073, 3060, 2869, 3074, 3075, 3061, - 3076, 3077, 3062, 3063, 3078, 3079, 3064, 3065, 2688, 3066, - 3081, 3067, 3068, 3082, 2872, 3069, 3083, 3084, 3070, 3071, - 3072, 3085, 3073, 3087, 3088, 3074, 3075, 3089, 3076, 3077, - - 3090, 3092, 3078, 3079, 3092, 3095, 3096, 2936, 3081, 3098, - 2936, 3082, 3093, 3099, 3083, 3084, 3100, 3101, 3102, 3085, - 3103, 3087, 3088, 3106, 3107, 3089, 1748, 3107, 3090, 3112, - 3113, 3104, 3105, 3095, 3096, 3114, 3108, 3098, 3116, 3115, - 3109, 3099, 3115, 3117, 3100, 3101, 3102, 3110, 3103, 3913, - 3118, 3106, 3913, 3119, 3913, 3121, 3122, 3112, 3113, 3104, - 3105, 3123, 3125, 3114, 3108, 3126, 3116, 3128, 3109, 3127, - 3129, 3117, 3130, 3131, 3132, 3110, 3133, 3134, 3118, 3135, - 3127, 3119, 3136, 3121, 3122, 3137, 3138, 3139, 3140, 3123, - 3125, 3141, 3142, 3126, 3143, 3128, 3144, 3145, 3129, 3146, - - 3130, 3131, 3132, 3147, 3133, 3134, 3148, 3135, 3149, 3150, - 3136, 3151, 3152, 3137, 3138, 3139, 3140, 3153, 3155, 3141, - 3142, 3156, 3143, 3158, 3144, 3145, 3159, 3146, 3153, 3160, - 1388, 3147, 3156, 3161, 3148, 3162, 3149, 3150, 3164, 3151, - 3152, 3165, 3166, 3167, 3168, 3169, 3155, 3170, 3171, 3173, - 3174, 3158, 3175, 3177, 3159, 3178, 3034, 3160, 3154, 2284, - 2492, 3161, 3157, 3162, 1565, 1724, 3164, 3176, 3180, 3165, - 3166, 3167, 3168, 3169, 1720, 3170, 3171, 3173, 3174, 2851, - 3175, 3177, 2851, 3178, 2851, 2859, 2678, 3042, 3181, 3179, - 2284, 2851, 2853, 3027, 2851, 3176, 2851, 2851, 3191, 3192, - - 2851, 3038, 2851, 2679, 2853, 3216, 2854, 3182, 3216, 2487, - 2859, 3193, 2487, 3037, 2487, 3194, 3195, 1708, 2866, 2686, - 2851, 3196, 2489, 2851, 3031, 2851, 3191, 3192, 3197, 3198, - 3025, 3185, 2851, 2853, 3034, 2851, 2687, 2851, 3037, 3193, - 3199, 1707, 3186, 3194, 3195, 2853, 3039, 2854, 3227, 3196, - 2487, 3227, 3183, 2487, 3200, 2487, 3197, 3198, 3201, 2866, - 3188, 3202, 3203, 2489, 3184, 1705, 2851, 3204, 3199, 2851, - 3205, 2851, 3206, 3207, 3208, 3034, 3038, 3189, 3209, 2853, - 3210, 3211, 3200, 3212, 3213, 3214, 3201, 3042, 3215, 3202, - 3203, 3217, 3218, 2866, 3219, 3204, 3220, 3221, 3205, 3222, - - 3206, 3207, 3208, 3223, 3224, 3190, 3209, 3226, 3210, 3211, - 3228, 3212, 3213, 3214, 3092, 3251, 3215, 3092, 3251, 3217, - 3218, 3042, 3219, 3086, 3220, 3221, 3086, 3222, 3230, 3231, - 3233, 3223, 3224, 3234, 3913, 3226, 3235, 3913, 3228, 3913, - 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3236, - 3237, 3238, 3239, 3240, 3241, 1648, 3230, 3231, 3233, 3357, - 3251, 3234, 3357, 3251, 3235, 3243, 3107, 3244, 3245, 3107, - 3247, 3248, 3249, 3252, 3253, 3254, 3255, 3236, 3237, 3238, - 3239, 3240, 3241, 3242, 3242, 3242, 3242, 3242, 3242, 3242, - 3242, 3242, 3256, 3243, 3257, 3244, 3245, 3258, 3247, 3248, - - 3249, 3252, 3253, 3254, 3255, 3259, 3260, 3261, 3262, 3263, - 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3273, 3274, - 3256, 3275, 3257, 3276, 3278, 3258, 3279, 3280, 3281, 3282, - 3283, 3284, 3288, 3259, 3260, 3261, 3262, 3263, 3264, 3265, - 3266, 3267, 3268, 3269, 3270, 3271, 3273, 3274, 3289, 3275, - 3286, 3276, 3278, 3290, 3279, 3280, 3281, 3282, 3283, 3284, - 3288, 3286, 3291, 1647, 3292, 3293, 3294, 3295, 3296, 3297, - 3298, 3299, 3300, 3301, 3303, 3216, 3289, 3310, 3216, 3311, - 3330, 3290, 3366, 3312, 3302, 3366, 3368, 3027, 1637, 3368, - 3291, 3287, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, - - 3300, 3301, 3303, 2851, 2859, 3310, 2851, 3311, 2851, 1636, - 3305, 3312, 3302, 3025, 2851, 2851, 2853, 2851, 2851, 2851, - 2851, 1635, 1571, 2487, 3030, 3030, 2487, 2679, 2487, 3313, - 2854, 1570, 3028, 3304, 2851, 2487, 2489, 2851, 2487, 2851, - 2487, 3031, 3031, 1565, 3038, 3188, 2851, 2853, 2489, 2851, - 2687, 2851, 3314, 1541, 3315, 2862, 2865, 3313, 3026, 2853, - 3316, 2866, 3189, 3317, 3318, 3319, 3320, 3321, 3322, 3032, - 3183, 2487, 3323, 2866, 2487, 3324, 2487, 3325, 2872, 3326, - 3314, 3308, 3315, 3327, 2489, 3328, 3329, 3332, 3316, 3039, - 3306, 3317, 3318, 3319, 3320, 3321, 3322, 3333, 3189, 3334, - - 3323, 2867, 3335, 3324, 3336, 3325, 3337, 3326, 3338, 3339, - 3340, 3327, 3342, 3328, 3329, 3332, 3225, 3225, 3225, 3225, - 3225, 3225, 3225, 3225, 3225, 3333, 3309, 3334, 3227, 3344, - 3335, 3227, 3336, 3348, 3337, 3349, 3338, 3339, 3340, 3345, - 3342, 3350, 3345, 3351, 3352, 3341, 3341, 3341, 3341, 3341, - 3341, 3341, 3341, 3341, 3353, 3354, 3355, 3344, 3356, 3358, - 3359, 3348, 3360, 3349, 3361, 3362, 3363, 3364, 3365, 3350, - 3367, 3351, 3352, 3242, 3242, 3242, 3242, 3242, 3242, 3242, - 3242, 3242, 3353, 3354, 3355, 3346, 3356, 3358, 3359, 3369, - 3360, 3370, 3361, 3362, 3363, 3364, 3365, 3371, 3367, 3372, - - 3373, 3374, 3375, 3376, 3377, 3379, 3380, 3381, 3382, 3383, - 3386, 3373, 3387, 3346, 3388, 3389, 3391, 3369, 3392, 3370, - 3393, 3396, 3397, 3398, 3399, 3371, 3400, 3372, 3401, 3374, - 3375, 3376, 3377, 3379, 3380, 3381, 3382, 3383, 3386, 3394, - 3387, 3402, 3388, 3389, 3391, 3403, 3392, 3395, 3393, 3396, - 3397, 3398, 3399, 3404, 3400, 3406, 3401, 3407, 3408, 3409, - 3410, 3411, 3027, 3309, 3413, 3426, 2284, 3394, 3426, 3402, - 3414, 3415, 1540, 3403, 3416, 3395, 1537, 3417, 1536, 2859, - 3418, 3404, 1535, 3406, 3419, 3407, 3408, 3409, 3410, 3411, - 2851, 2487, 3413, 2851, 2487, 2851, 2487, 3420, 3414, 3415, - - 3025, 3412, 3416, 2853, 2489, 3417, 2851, 2860, 3418, 2851, - 2487, 2851, 3419, 2487, 3421, 2487, 3038, 2854, 3189, 2853, - 3188, 3422, 3423, 2489, 3424, 3420, 3425, 3427, 3429, 3430, - 3431, 3432, 3433, 2866, 3434, 3435, 3436, 3189, 3451, 1534, - 3452, 3451, 3421, 3452, 3453, 2855, 3309, 3453, 3456, 3422, - 3423, 3456, 3424, 1533, 3425, 3427, 3429, 3430, 3431, 3432, - 3433, 2867, 3434, 3435, 3436, 3309, 3428, 3428, 3428, 3428, - 3428, 3428, 3428, 3428, 3428, 3428, 3428, 3331, 3331, 3331, - 3331, 3331, 3331, 3331, 3331, 3331, 3331, 3331, 3437, 3438, - 3439, 3428, 3341, 3341, 3341, 3341, 3341, 3341, 3341, 3341, - - 3341, 3441, 3331, 3345, 3442, 3443, 3345, 3444, 3445, 3446, - 3447, 3448, 3449, 3454, 3455, 3457, 3437, 3438, 3439, 3458, - 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3441, - 3459, 3461, 3442, 3443, 3461, 3444, 3445, 3446, 3447, 3448, - 3449, 3454, 3455, 3457, 3464, 3462, 3368, 3458, 3462, 3368, - 3465, 3466, 3469, 3470, 3471, 3473, 3474, 1531, 3459, 3478, - 3479, 3480, 3467, 3463, 3463, 3463, 3463, 3463, 3463, 3463, - 3463, 3463, 3464, 3467, 3472, 3481, 3482, 3483, 3465, 3466, - 3469, 3470, 3471, 3473, 3474, 3472, 3475, 3478, 3479, 3480, - 3484, 3485, 3486, 3487, 3476, 3477, 3488, 3489, 3490, 3491, - - 3492, 3493, 3494, 3481, 3482, 3483, 3495, 3496, 3497, 3498, - 3497, 3499, 3500, 3502, 3475, 3503, 3504, 1113, 3484, 3485, - 3486, 3487, 3476, 3477, 3488, 3489, 3490, 3491, 3492, 3493, - 3494, 3505, 3506, 3507, 3495, 3496, 3508, 3498, 3509, 3499, - 3500, 3502, 2487, 3503, 3504, 2487, 3510, 2487, 3513, 3515, - 3516, 3513, 3188, 3517, 3451, 2489, 872, 3451, 1478, 3505, - 3506, 3507, 1469, 3518, 3508, 3426, 3509, 3519, 3426, 3189, - 3511, 1467, 1462, 3461, 3510, 3514, 3547, 3515, 3516, 3734, - 3497, 3517, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, - 3512, 3518, 3520, 3521, 3522, 3519, 1457, 3306, 3523, 3428, - - 3428, 3428, 3428, 3428, 3428, 3428, 3428, 3428, 3428, 3428, - 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3524, - 3520, 3521, 3522, 3525, 3428, 3526, 3523, 3527, 3528, 3617, - 3530, 3528, 3531, 3532, 3533, 3535, 3538, 3540, 3535, 3538, - 3536, 3539, 3541, 3456, 3543, 3544, 3456, 3524, 3542, 3545, - 3549, 3525, 1399, 3526, 3552, 3527, 3553, 3529, 3530, 3554, - 3531, 3532, 3533, 3589, 3595, 3540, 3589, 3595, 1398, 540, - 3541, 3462, 3543, 3544, 3462, 538, 533, 3545, 3549, 3555, - 3550, 3556, 3552, 3557, 3553, 3529, 3551, 3554, 3548, 3548, - 3548, 3548, 3548, 3548, 3548, 3548, 3548, 3463, 3463, 3463, - - 3463, 3463, 3463, 3463, 3463, 3463, 3558, 3555, 3550, 3556, - 3559, 3557, 3560, 3562, 3551, 3564, 3565, 3566, 3567, 3568, - 3569, 3571, 3572, 3575, 3576, 3590, 3590, 3590, 3590, 3590, - 3590, 3590, 3590, 3590, 3558, 531, 3578, 3579, 3559, 3580, - 3560, 3562, 3583, 3564, 3565, 3566, 3567, 3568, 3569, 3571, - 3572, 3575, 3576, 3577, 3577, 3577, 3577, 3577, 3577, 3577, - 3577, 3577, 3577, 3577, 3578, 3579, 3584, 3580, 3585, 3586, - 3583, 3587, 3588, 3592, 3593, 3594, 3596, 516, 3577, 3512, - 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3513, 3597, - 3598, 3513, 3599, 3600, 3584, 3599, 3585, 3586, 3601, 3587, - - 3588, 3592, 3593, 3594, 3596, 3591, 3591, 3591, 3591, 3591, - 3591, 3591, 3591, 3591, 3602, 3603, 3528, 3597, 3598, 3528, - 3605, 3600, 3606, 3607, 3608, 514, 3601, 3608, 3610, 3760, - 3613, 3614, 3618, 3604, 3604, 3604, 3604, 3604, 3604, 3604, - 3604, 3604, 3602, 3603, 3535, 3619, 3620, 3535, 3605, 3536, - 3606, 3607, 3538, 3609, 510, 3538, 3610, 3539, 3613, 3614, - 3618, 3660, 3663, 3622, 3660, 3663, 3599, 3660, 3546, 3599, - 3660, 3667, 3716, 3619, 3620, 3461, 1389, 3772, 3547, 3761, - 3772, 3609, 3621, 3621, 3621, 3621, 3621, 3621, 3621, 3621, - 3621, 3622, 3621, 3621, 3621, 3621, 3621, 3621, 3621, 3621, - - 3621, 3548, 3548, 3548, 3548, 3548, 3548, 3548, 3548, 3548, - 3623, 3624, 3625, 3627, 3628, 3629, 3630, 3631, 3632, 3633, - 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3642, 3645, 3591, - 3591, 3591, 3591, 3591, 3591, 3591, 3591, 3591, 3623, 3624, - 3625, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, - 3636, 3637, 3638, 3639, 3640, 3642, 3645, 3577, 3577, 3577, - 3577, 3577, 3577, 3577, 3577, 3577, 3577, 3577, 3646, 3647, - 3648, 3650, 3651, 3652, 3654, 3663, 3655, 3654, 3663, 3656, - 3719, 1385, 3577, 3659, 3661, 3773, 3665, 3655, 3773, 3668, - 3658, 3669, 3670, 3671, 3672, 3673, 3646, 3647, 3648, 3650, - - 3651, 3652, 3590, 3590, 3590, 3590, 3590, 3590, 3590, 3590, - 3590, 3659, 3661, 3595, 3665, 3804, 3595, 3668, 3804, 3669, - 3670, 3671, 3672, 3673, 3675, 3676, 3679, 3686, 3687, 3688, - 3662, 3662, 3662, 3662, 3662, 3662, 3662, 3662, 3662, 3604, - 3604, 3604, 3604, 3604, 3604, 3604, 3604, 3604, 3608, 3689, - 3702, 3608, 3675, 3676, 3679, 3686, 3687, 3688, 3657, 3690, - 3691, 3702, 1379, 3913, 1349, 3674, 3674, 3674, 3674, 3674, - 3674, 3674, 3674, 3674, 3680, 3546, 3692, 3689, 3681, 3693, - 3694, 3695, 3696, 3697, 3698, 3682, 3699, 3690, 3691, 3621, - 3621, 3621, 3621, 3621, 3621, 3621, 3621, 3621, 3700, 3701, - - 3704, 3705, 3680, 3709, 3692, 3703, 3681, 3693, 3694, 3695, - 3696, 3697, 3698, 3682, 3699, 3711, 3703, 3712, 3713, 3655, - 3715, 3655, 3655, 3718, 3913, 3683, 3700, 3701, 3704, 3705, - 3913, 3709, 3655, 3913, 3654, 3913, 3655, 3654, 3722, 3656, - 3723, 3724, 3725, 3711, 3726, 3712, 3713, 3655, 3715, 3727, - 1341, 3718, 3662, 3662, 3662, 3662, 3662, 3662, 3662, 3662, - 3662, 3728, 3729, 3730, 3731, 3732, 3722, 3733, 3723, 3724, - 3725, 3735, 3726, 3736, 3737, 3684, 3738, 3727, 3674, 3674, - 3674, 3674, 3674, 3674, 3674, 3674, 3674, 3739, 3740, 3728, - 3729, 3730, 3731, 3732, 3741, 3733, 3742, 3743, 3744, 3735, - - 3745, 3736, 3737, 3657, 3738, 3746, 3747, 3748, 3749, 3750, - 3751, 3752, 3753, 3756, 3913, 3739, 3740, 3913, 3657, 3913, - 3750, 3763, 3741, 3754, 3742, 3743, 3744, 3764, 3745, 3765, - 3766, 3767, 3768, 3746, 3747, 3748, 3749, 3769, 3751, 3752, - 3753, 3756, 3770, 3774, 3775, 3770, 3776, 3777, 3778, 3763, - 3779, 3754, 3780, 3781, 3782, 3764, 3783, 3765, 3766, 3767, - 3768, 3794, 3784, 3785, 3786, 3769, 3788, 3789, 3790, 3791, - 3792, 3774, 3775, 3794, 3776, 3777, 3778, 3797, 3779, 3798, - 3780, 3781, 3782, 1330, 3783, 3799, 3800, 3801, 3802, 3771, - 3784, 3785, 3786, 3805, 3788, 3789, 3790, 3791, 3792, 3772, - - 3812, 3813, 3772, 3773, 3807, 3797, 3773, 3798, 3809, 3810, - 3814, 3795, 3810, 3799, 3800, 3801, 3802, 3771, 3815, 3811, - 3816, 3805, 3811, 3761, 3818, 3819, 3820, 3821, 3812, 3813, - 3822, 3823, 3826, 3827, 3828, 3829, 3827, 3830, 3814, 3831, - 3832, 3833, 3804, 3834, 3913, 3804, 3815, 3913, 3816, 3913, - 3841, 431, 3818, 3819, 3820, 3821, 3794, 3842, 3822, 3823, - 3826, 3913, 3843, 3829, 3913, 3830, 3913, 3831, 3832, 3833, - 3810, 3834, 3844, 3810, 3811, 3838, 3845, 3811, 3841, 3840, - 3846, 3847, 3848, 3849, 3761, 3842, 3856, 3850, 3858, 3856, - 3843, 3857, 3859, 3860, 3861, 3859, 3862, 3861, 3851, 3867, - - 3844, 3852, 3913, 3868, 3845, 3913, 3795, 3913, 3846, 3847, - 3848, 3849, 3869, 3870, 3913, 3850, 3858, 3913, 3871, 3913, - 3872, 3860, 3873, 3874, 3862, 3875, 3851, 3867, 3876, 3852, - 3877, 3868, 3856, 3880, 418, 3856, 3882, 3857, 414, 3882, - 3869, 3870, 399, 395, 373, 369, 3871, 3884, 3872, 3859, - 3873, 3874, 3859, 3875, 363, 359, 3876, 3887, 3877, 3861, - 3888, 3880, 3861, 3889, 3890, 3891, 3881, 3881, 3881, 3881, - 3881, 3881, 3881, 3881, 3881, 3884, 3883, 3883, 3883, 3883, - 3883, 3883, 3883, 3883, 3883, 3887, 3892, 3893, 3888, 3894, - 3897, 3889, 3890, 3891, 3881, 3881, 3881, 3881, 3881, 3881, - - 3881, 3881, 3881, 3882, 355, 1273, 3882, 1212, 1211, 1195, - 3898, 3899, 3900, 3902, 3892, 3893, 3903, 3894, 3897, 1186, - 3896, 3896, 3896, 3896, 3896, 3896, 3896, 3896, 3896, 3883, - 3883, 3883, 3883, 3883, 3883, 3883, 3883, 3883, 3898, 3899, - 3900, 3902, 3904, 3905, 3903, 3896, 3896, 3896, 3896, 3896, - 3896, 3896, 3896, 3896, 3906, 3907, 3908, 3909, 3910, 3911, - 3912, 1174, 1153, 1138, 662, 1113, 645, 385, 385, 872, - 3904, 3905, 1070, 1059, 1051, 1048, 1006, 540, 538, 1004, - 533, 531, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, - - 76, 76, 76, 76, 76, 76, 76, 98, 98, 98, + 707, 706, 708, 710, 713, 703, 714, 716, 715, 695, + 423, 711, 709, 423, 690, 700, 691, 701, 717, 731, + 692, 712, 702, 888, 704, 3621, 436, 705, 707, 706, + 708, 710, 713, 703, 714, 716, 715, 732, 737, 711, + 709, 737, 733, 738, 1117, 502, 717, 731, 502, 712, + 718, 719, 740, 720, 662, 740, 721, 741, 722, 762, + 723, 724, 725, 763, 726, 732, 727, 728, 729, 730, + 733, 476, 477, 478, 476, 2145, 2145, 747, 718, 719, + 747, 720, 748, 1120, 721, 662, 722, 762, 723, 724, + + 725, 763, 726, 663, 727, 728, 729, 730, 480, 477, + 478, 480, 480, 477, 478, 481, 482, 483, 484, 482, + 889, 485, 492, 493, 494, 492, 2891, 495, 482, 483, + 484, 491, 502, 485, 1124, 502, 436, 492, 493, 494, + 492, 499, 495, 2509, 499, 751, 500, 506, 751, 510, + 752, 506, 506, 764, 756, 512, 506, 516, 513, 512, + 760, 765, 513, 436, 834, 529, 529, 436, 530, 766, + 3609, 486, 768, 529, 529, 834, 529, 496, 775, 530, + 776, 764, 536, 486, 529, 770, 777, 529, 891, 765, + 536, 533, 496, 772, 557, 540, 501, 557, 529, 507, + + 390, 757, 778, 510, 1761, 514, 775, 761, 776, 516, + 779, 645, 540, 780, 777, 531, 767, 536, 781, 769, + 537, 782, 536, 783, 784, 536, 533, 785, 536, 800, + 778, 537, 771, 536, 801, 803, 536, 804, 779, 536, + 773, 780, 802, 805, 807, 802, 781, 808, 810, 782, + 536, 783, 784, 2299, 3602, 785, 811, 800, 266, 3600, + 812, 813, 801, 803, 814, 804, 590, 538, 3584, 590, + 835, 805, 807, 835, 2527, 808, 810, 815, 540, 786, + 816, 787, 788, 817, 811, 789, 790, 791, 812, 813, + 818, 792, 814, 819, 793, 3065, 794, 795, 796, 797, + + 824, 798, 799, 825, 820, 815, 826, 786, 816, 787, + 788, 817, 827, 789, 790, 791, 822, 823, 818, 792, + 828, 819, 793, 821, 794, 795, 796, 797, 824, 798, + 799, 825, 820, 829, 826, 830, 831, 832, 836, 837, + 827, 838, 839, 840, 822, 823, 841, 842, 828, 843, + 844, 821, 845, 846, 847, 833, 848, 849, 850, 851, + 852, 829, 853, 830, 831, 832, 836, 837, 854, 838, + 839, 840, 855, 856, 841, 842, 857, 843, 844, 351, + 845, 846, 847, 833, 848, 849, 850, 851, 852, 347, + 853, 347, 870, 3538, 357, 623, 854, 358, 623, 637, + + 855, 856, 637, 347, 857, 347, 860, 355, 867, 860, + 629, 867, 3504, 629, 347, 357, 347, 863, 358, 2527, + 863, 367, 357, 889, 368, 358, 3439, 635, 879, 367, + 635, 871, 367, 3424, 866, 368, 858, 866, 880, 367, + 367, 645, 368, 399, 861, 3418, 399, 367, 399, 3417, + 348, 383, 640, 428, 383, 734, 383, 1069, 734, 886, + 872, 348, 890, 902, 640, 359, 412, 868, 1069, 413, + 399, 864, 359, 903, 383, 640, 662, 383, 383, 382, + 422, 431, 369, 383, 388, 422, 876, 640, 383, 369, + 868, 891, 383, 388, 905, 383, 877, 383, 656, 643, + + 916, 383, 662, 917, 979, 388, 641, 979, 643, 881, + 383, 918, 392, 399, 919, 393, 909, 394, 920, 383, + 392, 921, 922, 924, 874, 925, 887, 888, 916, 873, + 590, 917, 912, 590, 392, 642, 640, 926, 389, 918, + 736, 906, 919, 736, 904, 980, 920, 647, 980, 921, + 922, 924, 672, 925, 2277, 672, 2278, 412, 642, 640, + 413, 983, 882, 875, 983, 926, 911, 878, 388, 911, + 391, 412, 3411, 391, 413, 392, 383, 388, 653, 391, + 654, 927, 391, 655, 392, 428, 884, 653, 391, 654, + 928, 391, 655, 392, 929, 884, 892, 392, 654, 744, + + 391, 655, 744, 391, 884, 392, 392, 414, 894, 927, + 895, 1104, 1117, 896, 399, 391, 897, 399, 928, 399, + 3375, 414, 929, 391, 932, 656, 899, 392, 392, 2527, + 660, 403, 391, 404, 656, 391, 900, 392, 933, 658, + 403, 399, 404, 893, 3316, 405, 934, 936, 658, 937, + 392, 938, 932, 678, 657, 898, 679, 391, 626, 392, + 899, 422, 392, 657, 1117, 403, 933, 404, 914, 406, + 900, 915, 657, 658, 934, 936, 422, 937, 406, 938, + 1327, 3308, 3302, 391, 392, 939, 391, 659, 392, 940, + 941, 403, 666, 404, 1572, 666, 405, 392, 399, 658, + + 393, 908, 394, 1510, 908, 392, 392, 901, 423, 393, + 392, 394, 659, 939, 392, 942, 391, 940, 941, 392, + 943, 944, 930, 423, 945, 947, 953, 954, 392, 931, + 931, 931, 931, 931, 931, 931, 931, 931, 907, 1395, + 955, 901, 956, 942, 948, 960, 963, 395, 943, 944, + 966, 961, 945, 947, 953, 954, 395, 949, 950, 967, + 951, 952, 968, 957, 969, 958, 962, 391, 955, 959, + 956, 964, 948, 960, 963, 970, 972, 978, 966, 961, + 991, 965, 3276, 991, 971, 949, 950, 967, 951, 952, + 968, 957, 969, 958, 962, 508, 973, 959, 974, 964, + + 975, 506, 2143, 970, 972, 978, 506, 995, 737, 965, + 995, 737, 971, 738, 981, 740, 3261, 981, 740, 982, + 741, 1002, 984, 510, 973, 984, 974, 985, 975, 987, + 747, 1003, 987, 747, 988, 748, 992, 751, 1004, 992, + 751, 993, 752, 996, 512, 1005, 996, 513, 997, 1002, + 1012, 1013, 529, 998, 1014, 530, 266, 1015, 1016, 1003, + 529, 1017, 536, 1018, 1019, 537, 1004, 536, 1020, 1021, + 536, 2527, 1022, 1005, 529, 2482, 1036, 2483, 1012, 1013, + 1037, 1025, 1014, 1038, 536, 1015, 1016, 1023, 1026, 1017, + 1024, 1018, 1019, 2527, 1000, 1027, 1020, 1021, 1034, 1028, + + 1022, 1043, 1006, 1029, 1036, 1031, 1039, 1030, 1037, 1025, + 1041, 1038, 1008, 1046, 1047, 1023, 1026, 1035, 1024, 1032, + 1048, 1033, 1040, 1027, 1052, 1042, 1034, 1028, 1044, 1043, + 1045, 1029, 1049, 1031, 1039, 1030, 802, 1053, 1041, 802, + 1055, 1046, 1047, 1049, 1056, 1035, 1057, 1032, 1048, 1033, + 1040, 1058, 1052, 1042, 1059, 1060, 1044, 1061, 1045, 1063, + 1064, 1065, 1066, 1067, 1068, 1053, 1070, 1071, 1055, 1072, + 1074, 1075, 1056, 1050, 1057, 1078, 2527, 1079, 835, 1058, + 1080, 835, 1059, 1060, 1081, 1061, 1082, 1063, 1064, 1065, + 1066, 1067, 1068, 1076, 1070, 1071, 1083, 1072, 1074, 1075, + + 1084, 1085, 1086, 1078, 1076, 1079, 1087, 1088, 1080, 1089, + 1090, 1091, 1081, 1092, 1082, 1077, 1094, 1095, 1096, 1097, + 1098, 1093, 1099, 1100, 1083, 1101, 1126, 1106, 1084, 1085, + 1086, 1103, 367, 355, 1087, 1088, 1109, 1089, 1090, 1091, + 1128, 1092, 870, 1077, 1094, 1095, 1096, 1097, 1098, 1093, + 1099, 1100, 860, 1101, 363, 860, 863, 1105, 390, 863, + 347, 357, 347, 373, 358, 867, 1107, 866, 867, 870, + 866, 390, 367, 669, 632, 368, 383, 640, 622, 383, + 367, 383, 874, 1905, 1114, 835, 1108, 675, 835, 640, + 889, 3211, 868, 383, 640, 1112, 383, 392, 383, 1130, + + 1111, 3062, 394, 383, 628, 392, 640, 348, 2509, 868, + 872, 359, 431, 634, 399, 418, 391, 1129, 1127, 391, + 383, 392, 369, 1076, 653, 391, 1113, 1130, 391, 655, + 392, 641, 884, 653, 1076, 654, 1115, 872, 655, 3060, + 428, 884, 651, 392, 889, 2299, 391, 649, 873, 391, + 979, 392, 392, 979, 653, 399, 1113, 1460, 891, 655, + 642, 640, 884, 1131, 677, 671, 1205, 914, 1460, 399, + 915, 656, 399, 392, 399, 422, 391, 642, 640, 391, + 885, 392, 1713, 1116, 894, 886, 895, 3338, 1132, 896, + 399, 1131, 897, 399, 391, 399, 399, 391, 1133, 392, + + 657, 885, 653, 392, 654, 1134, 1119, 655, 1135, 657, + 884, 980, 891, 755, 980, 911, 1132, 399, 911, 3200, + 412, 392, 423, 413, 656, 3191, 1133, 1714, 1136, 1193, + 657, 888, 1193, 1134, 391, 2813, 1135, 391, 391, 392, + 2989, 391, 894, 392, 895, 898, 894, 896, 1121, 1118, + 897, 896, 392, 888, 897, 393, 1136, 394, 2991, 391, + 392, 392, 391, 392, 392, 392, 393, 1122, 394, 895, + 414, 392, 896, 891, 392, 897, 981, 983, 657, 981, + 983, 982, 1140, 1141, 1143, 392, 391, 1145, 1146, 898, + 2813, 391, 1137, 898, 391, 908, 392, 1138, 908, 1125, + + 392, 404, 395, 393, 405, 394, 3147, 658, 392, 1139, + 1140, 1141, 1143, 395, 1123, 1145, 1146, 1147, 391, 1148, + 1137, 1149, 392, 3106, 2527, 1138, 1144, 1144, 1144, 1144, + 1144, 1144, 1144, 1144, 1144, 1150, 1151, 1139, 1152, 1153, + 1154, 1155, 1156, 1159, 1160, 1147, 665, 1148, 1161, 1149, + 395, 931, 931, 931, 931, 931, 931, 931, 931, 931, + 1162, 1163, 1164, 1150, 1151, 1165, 1152, 1153, 1154, 1155, + 1156, 1159, 1160, 1168, 1166, 391, 1161, 1167, 1169, 1170, + 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1162, 1163, + 1164, 1180, 1182, 1165, 1183, 1181, 1185, 1184, 1186, 1187, + + 1188, 1168, 1189, 1190, 1192, 1167, 1169, 1170, 1171, 1172, + 1173, 1174, 1175, 1176, 1177, 1178, 3068, 1905, 1194, 1180, + 1182, 1194, 1183, 1181, 1185, 1184, 1186, 1187, 1188, 1207, + 1189, 1190, 1192, 984, 1195, 3060, 984, 1195, 985, 1196, + 987, 1197, 2884, 987, 1197, 988, 1198, 991, 3047, 1198, + 991, 1199, 992, 1201, 1209, 992, 1201, 993, 1202, 995, + 1210, 1202, 995, 1203, 996, 1204, 510, 996, 1204, 997, + 516, 1206, 1211, 1208, 1213, 529, 759, 1215, 1212, 1218, + 1219, 536, 1209, 529, 1214, 1220, 536, 1221, 1210, 536, + 3014, 1222, 1460, 533, 1223, 1224, 540, 3006, 1225, 1226, + + 1211, 1227, 1228, 1460, 1229, 1230, 1235, 1218, 1219, 1231, + 1232, 1233, 1234, 1220, 1238, 1221, 1239, 3151, 757, 1222, + 761, 769, 1223, 1224, 773, 767, 1225, 1226, 1240, 1227, + 1228, 771, 1229, 1230, 1235, 1241, 1242, 1231, 1232, 1233, + 1234, 1236, 1238, 1243, 1239, 1237, 1244, 1245, 1246, 1247, + 1250, 1253, 1255, 1248, 1251, 1249, 1240, 1256, 1252, 1257, + 1258, 1259, 1260, 1241, 1242, 1265, 1266, 2813, 1254, 1236, + 1269, 1243, 1270, 1237, 1244, 1245, 1246, 1247, 1250, 1253, + 1255, 1248, 1251, 1249, 1271, 1256, 1252, 1257, 1258, 1259, + 1260, 1261, 1267, 1265, 1266, 1262, 1254, 1272, 1269, 1273, + + 1270, 1274, 1263, 1267, 1264, 3005, 1275, 1276, 1277, 1279, + 1280, 1281, 1271, 1282, 1283, 1284, 1285, 1286, 2996, 1261, + 1294, 1295, 2991, 1262, 1296, 1272, 1297, 1273, 1298, 1274, + 1263, 1299, 1264, 1268, 1275, 1276, 1277, 1279, 1280, 1281, + 1300, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1294, 1295, + 1289, 1301, 1296, 1302, 1297, 1290, 1298, 1303, 1304, 1299, + 1305, 1291, 1306, 1307, 1308, 1292, 1309, 1293, 1300, 1310, + 1311, 1312, 1313, 1314, 1287, 1288, 1315, 1316, 1289, 1301, + 1317, 1302, 1318, 1290, 1319, 1303, 1304, 351, 1305, 1291, + 1306, 1307, 1308, 1292, 1309, 1293, 889, 1310, 1311, 1312, + + 1313, 1314, 889, 2954, 1315, 1316, 383, 640, 1317, 383, + 1318, 383, 1319, 1322, 1326, 355, 870, 889, 391, 1320, + 2937, 391, 868, 392, 2299, 428, 653, 391, 654, 1335, + 391, 1324, 392, 383, 884, 1330, 3612, 654, 3613, 391, + 655, 1328, 391, 884, 392, 392, 1337, 894, 1331, 1121, + 1334, 1338, 896, 431, 391, 897, 1117, 1335, 662, 1339, + 2879, 641, 1193, 885, 891, 1193, 392, 399, 1194, 399, + 891, 1194, 399, 656, 1337, 399, 1340, 399, 1195, 1338, + 2299, 1195, 893, 1196, 1323, 1327, 1397, 1339, 1119, 1397, + 1321, 640, 2840, 391, 888, 1332, 391, 906, 392, 399, + + 1341, 894, 1325, 895, 1340, 391, 896, 1342, 391, 897, + 392, 657, 1344, 894, 399, 895, 1345, 399, 896, 399, + 392, 897, 1348, 1343, 1350, 1351, 1352, 898, 1341, 1353, + 660, 1354, 392, 1356, 1357, 1342, 1358, 1360, 1361, 1362, + 1344, 399, 1363, 2839, 1345, 1364, 1365, 1366, 898, 2815, + 1348, 1343, 1350, 1351, 1352, 1197, 2777, 1353, 1197, 1354, + 1333, 1356, 1357, 2362, 1358, 1360, 1361, 1362, 1368, 406, + 1363, 1349, 1369, 1364, 1365, 1366, 1370, 1325, 1144, 1144, + 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1367, 1367, 1367, + 1367, 1367, 1367, 1367, 1367, 1367, 1368, 1371, 399, 1372, + + 1369, 1373, 1374, 1377, 1370, 1375, 1376, 1378, 1379, 1380, + 1381, 1382, 1383, 1384, 1385, 1387, 1388, 1389, 1390, 1391, + 1398, 1198, 508, 1398, 1198, 1371, 1199, 1372, 1402, 1373, + 1374, 1377, 2360, 1375, 1376, 1378, 1379, 1380, 1381, 1382, + 1383, 1384, 1385, 1387, 1388, 1389, 1390, 1391, 1399, 1201, + 510, 1399, 1201, 1400, 1202, 1401, 1402, 1202, 1401, 1203, + 1204, 1403, 1404, 1204, 1407, 1408, 1409, 1410, 1411, 1412, + 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1422, 1423, + 1424, 1425, 1426, 1421, 1427, 1428, 1429, 1430, 1431, 1403, + 1404, 1432, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, + + 1415, 1416, 1417, 1418, 1419, 1420, 1422, 1423, 1424, 1425, + 1426, 1421, 1427, 1428, 1429, 1430, 1431, 1433, 1434, 1432, + 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1445, + 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 2745, + 1459, 1461, 1462, 1444, 1463, 1433, 1434, 1465, 1435, 1436, + 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1445, 1446, 1447, + 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1459, 1461, + 1462, 1444, 1463, 1466, 1467, 1465, 1468, 1470, 1456, 1471, + 1472, 1473, 1475, 1457, 1458, 1477, 1478, 1479, 1480, 1482, + 1483, 1484, 1486, 1487, 1481, 1455, 1488, 1489, 1490, 1491, + + 1492, 1466, 1467, 1493, 1468, 1470, 1456, 1471, 1472, 1473, + 1475, 1457, 1458, 1477, 1478, 1479, 1480, 1482, 1483, 1484, + 1486, 1487, 1481, 1494, 1488, 1489, 1490, 1491, 1492, 1495, + 1496, 1493, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, + 1505, 1506, 1507, 1508, 870, 889, 1512, 2743, 662, 1397, + 1515, 1494, 1397, 1398, 2686, 2515, 1398, 1495, 1496, 3965, + 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, + 1507, 1508, 391, 1509, 1512, 391, 1516, 392, 1515, 1517, + 894, 889, 895, 871, 890, 896, 1518, 3612, 897, 3613, + 399, 2513, 399, 399, 1519, 399, 2091, 1520, 1576, 392, + + 1513, 1576, 1514, 1521, 1516, 1522, 886, 1517, 1527, 3684, + 1528, 3685, 872, 891, 1518, 659, 391, 399, 1529, 391, + 1116, 392, 1519, 1530, 1511, 1520, 895, 898, 1513, 896, + 1514, 1521, 897, 1522, 1524, 1531, 1527, 1524, 1528, 1524, + 1532, 1537, 1533, 391, 1525, 656, 1529, 1524, 1538, 891, + 2299, 1530, 1539, 1541, 1547, 1548, 1551, 1552, 1553, 1554, + 1555, 1399, 1401, 1531, 1399, 1401, 1400, 1583, 1532, 1537, + 1583, 1123, 1535, 1556, 888, 1557, 1538, 1558, 1536, 1559, + 1539, 1541, 1547, 1548, 1551, 1552, 1553, 1554, 1555, 1526, + 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1560, + + 1535, 1556, 1561, 1557, 1562, 1558, 1536, 1559, 1563, 1564, + 1565, 1566, 1568, 1569, 1570, 1571, 1577, 1567, 1578, 1581, + 1582, 1584, 1585, 1586, 1587, 1588, 1589, 1560, 1590, 1591, + 1561, 1592, 1562, 1593, 1597, 1598, 1563, 1564, 1565, 1566, + 1568, 1569, 1570, 1571, 1577, 1567, 1578, 1581, 1582, 1584, + 1585, 1586, 1587, 1588, 1589, 1594, 1590, 1591, 1599, 1592, + 1600, 1593, 1597, 1598, 1601, 1602, 1603, 1604, 1595, 1605, + 1606, 1610, 1611, 1596, 1612, 1613, 1607, 1614, 1608, 1615, + 1616, 1609, 2299, 1594, 1623, 1624, 1599, 1625, 1600, 1626, + 1627, 1628, 1601, 1602, 1603, 1604, 1595, 1605, 1606, 1610, + + 1611, 1596, 1612, 1613, 1607, 1614, 1608, 1615, 1616, 1609, + 1617, 1629, 1623, 1624, 1618, 1625, 1630, 1626, 1627, 1628, + 1631, 1619, 1632, 1620, 1621, 1633, 1622, 1634, 1635, 1636, + 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1647, 1617, 1629, + 1648, 1649, 1618, 1650, 1630, 1651, 2492, 1658, 1631, 1619, + 1632, 1620, 1621, 1633, 1622, 1634, 1635, 1636, 1637, 1638, + 1639, 1640, 1641, 1642, 1643, 1647, 1659, 1652, 1648, 1649, + 1660, 1650, 1665, 1651, 1653, 1658, 1666, 1663, 1667, 1668, + 1669, 1670, 1654, 1661, 1671, 1662, 1672, 1655, 1663, 1673, + 1674, 1675, 1676, 1677, 1659, 1652, 1678, 1679, 1660, 1664, + + 1665, 1682, 1653, 1683, 1666, 1684, 1667, 1668, 1669, 1670, + 1654, 1661, 1671, 1662, 1672, 1655, 1685, 1673, 1674, 1675, + 1676, 1677, 1686, 1680, 1678, 1679, 1687, 1664, 1681, 1682, + 1688, 1683, 1689, 1684, 1690, 1691, 1692, 1693, 1695, 1697, + 1698, 1699, 889, 1696, 1685, 1701, 1702, 3684, 1703, 3685, + 1686, 1680, 1704, 1694, 1687, 1705, 1681, 1706, 1688, 1707, + 1689, 1757, 1690, 1691, 1692, 1693, 1695, 1697, 1698, 1699, + 1700, 1696, 399, 1701, 1702, 399, 1703, 399, 1117, 1708, + 1704, 1694, 2490, 1705, 1709, 1706, 1710, 1707, 1119, 399, + 1524, 1524, 1716, 1524, 1524, 1524, 1524, 1719, 1720, 399, + + 1711, 1711, 1721, 1524, 1524, 1576, 1395, 1708, 1576, 885, + 891, 2076, 1709, 1726, 1710, 1723, 1727, 1332, 2683, 1724, + 1716, 1725, 1728, 1729, 1730, 1719, 1720, 898, 1732, 1733, + 1721, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, + 1736, 1726, 1737, 1723, 1727, 1712, 1526, 1724, 1738, 1725, + 1728, 1729, 1730, 1739, 1740, 1741, 1732, 1733, 1734, 1734, + 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1742, 1736, 1743, + 1737, 1744, 1745, 1746, 1747, 1748, 1738, 1749, 1750, 1751, + 1752, 1739, 1740, 1741, 1753, 1754, 1755, 1756, 1758, 1762, + 1763, 1583, 1766, 1663, 1583, 1742, 1764, 1743, 1767, 1744, + + 1745, 1746, 1747, 1748, 1663, 1749, 1750, 1751, 1752, 1768, + 1769, 1772, 1753, 1754, 1755, 1756, 1758, 1762, 1763, 1773, + 1766, 1770, 1774, 1775, 1776, 1777, 1767, 1778, 1771, 1779, + 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1768, 1769, 1772, + 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1773, 1794, 1770, + 1774, 1775, 1776, 1777, 1795, 1778, 1771, 1779, 1780, 1781, + 1782, 1783, 1784, 1785, 1786, 1796, 1797, 1798, 1787, 1788, + 1789, 1790, 1791, 1792, 1793, 1799, 1794, 1800, 1801, 1802, + 1803, 1804, 1795, 1805, 1806, 1807, 1808, 1809, 1810, 1811, + 1812, 1813, 1814, 1796, 1797, 1798, 1815, 1818, 1819, 1816, + + 1820, 1821, 1822, 1799, 1823, 1800, 1801, 1802, 1803, 1804, + 1816, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, + 1814, 1824, 1825, 1826, 1815, 1818, 1819, 1827, 1820, 1821, + 1822, 1828, 1823, 1829, 1830, 1832, 1833, 1834, 1835, 1836, + 1817, 1837, 1838, 1848, 1850, 1851, 1852, 1853, 1854, 1824, + 1825, 1826, 1855, 1839, 1848, 1827, 1856, 1857, 3750, 1828, + 3751, 1829, 1830, 1832, 1833, 1834, 1835, 1836, 2680, 1837, + 1838, 1858, 1850, 1851, 1852, 1853, 1854, 1859, 1860, 1861, + 1855, 1839, 1840, 1841, 1856, 1857, 1842, 1862, 1843, 1863, + 1864, 1865, 1844, 1845, 1866, 1867, 1846, 1868, 1869, 1858, + + 1870, 1847, 1871, 1872, 1873, 1859, 1860, 1861, 1874, 1875, + 1840, 1841, 1876, 1881, 1842, 1862, 1843, 1863, 1864, 1865, + 1844, 1845, 1866, 1867, 1846, 1868, 1869, 1882, 1870, 1847, + 1871, 1872, 1873, 1877, 1883, 1879, 1874, 1875, 1880, 1884, + 1876, 1881, 1885, 1117, 1887, 1888, 1878, 1889, 1890, 1891, + 1894, 1892, 1895, 1898, 1900, 1882, 3750, 1903, 3751, 1904, + 1906, 1877, 1883, 1879, 1893, 2989, 1880, 1884, 1907, 1908, + 1885, 1909, 1887, 1888, 1878, 1889, 1890, 1891, 1894, 1892, + 1895, 1524, 1900, 2659, 1524, 1903, 1524, 1904, 1906, 1913, + 1918, 1896, 1893, 1905, 1524, 2648, 1907, 1908, 1899, 1909, + + 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1910, + 888, 1911, 1914, 2638, 2636, 2990, 3965, 1913, 1918, 3965, + 2620, 3965, 1919, 1920, 1915, 1921, 1922, 1923, 1924, 1916, + 1925, 1926, 1927, 1928, 1929, 1930, 1526, 1910, 1572, 1911, + 1914, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, + 1919, 1920, 1915, 1921, 1922, 1923, 1924, 1916, 1925, 1926, + 1927, 1928, 1929, 1930, 1931, 1937, 1934, 1938, 1939, 1940, + 1941, 1942, 1943, 1944, 1932, 1950, 1848, 1935, 1951, 1953, + 1954, 1955, 1956, 1573, 1957, 1933, 1936, 1848, 1958, 1959, + 1960, 1961, 1931, 1937, 1934, 1938, 1939, 1940, 1941, 1942, + + 1943, 1944, 1932, 1950, 1962, 1935, 1951, 1953, 1954, 1955, + 1956, 1963, 1957, 1933, 1936, 1964, 1958, 1959, 1960, 1961, + 1965, 1966, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, + 1976, 1977, 1962, 1978, 1979, 1980, 1982, 1967, 1981, 1963, + 1983, 1981, 1984, 1964, 1985, 1986, 1987, 1988, 1965, 1966, + 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, + 1989, 1978, 1979, 1980, 1982, 1967, 1990, 1991, 1983, 1992, + 1984, 1993, 1985, 1986, 1987, 1988, 1994, 1995, 1997, 1998, + 1999, 1997, 2000, 1996, 2001, 2003, 2004, 2005, 1989, 2002, + 2006, 2007, 2008, 2010, 1990, 1991, 2011, 1992, 2012, 1993, + + 2015, 2016, 2013, 2008, 1994, 1995, 2017, 1998, 1999, 2018, + 2000, 1996, 2001, 2003, 2004, 2005, 2014, 2002, 2006, 2007, + 2019, 2010, 2021, 2022, 2011, 2023, 2012, 2024, 2015, 2016, + 2013, 2025, 2026, 2009, 2017, 2027, 2028, 2018, 2029, 2031, + 2032, 2033, 2034, 2035, 2036, 2037, 2043, 3656, 2019, 2044, + 2021, 2022, 2030, 2023, 2045, 2024, 2046, 2047, 2048, 2025, + 2026, 2605, 2050, 2027, 2028, 2051, 2029, 2031, 2032, 2033, + 2034, 2035, 2036, 2037, 2043, 2038, 2039, 2044, 2052, 2053, + 2030, 2040, 2045, 2054, 2046, 2047, 2048, 2055, 2056, 2041, + 2050, 2057, 2042, 2051, 2058, 2059, 2060, 3657, 2066, 2075, + + 2067, 2068, 2069, 2038, 2039, 2070, 2052, 2053, 2061, 2040, + 2062, 2054, 2071, 2072, 2063, 2055, 2056, 2041, 2077, 2057, + 2042, 2078, 2058, 2059, 2060, 2064, 2066, 2065, 2067, 2068, + 2069, 2081, 2082, 2070, 2083, 2084, 2061, 2061, 2062, 2062, + 2071, 2072, 2063, 2063, 2076, 2079, 2077, 2085, 2086, 2078, + 1713, 1713, 2080, 2064, 2064, 2065, 2073, 2090, 2092, 2081, + 2082, 2093, 2083, 2084, 2094, 2061, 2095, 2062, 2362, 2098, + 2096, 2063, 2097, 2079, 2282, 2085, 2086, 2099, 1524, 2100, + 2080, 1524, 2064, 1524, 2073, 2101, 2092, 2102, 1711, 2093, + 2103, 1524, 2094, 2104, 2095, 1714, 1899, 2098, 2096, 2115, + + 2097, 2116, 2091, 2117, 2118, 2099, 2360, 2100, 2119, 2120, + 2121, 2122, 2123, 2101, 2166, 2102, 2552, 2166, 2103, 2283, + 2513, 2104, 2124, 2125, 2127, 2298, 2128, 2115, 2299, 2116, + 2126, 2117, 2118, 1712, 2105, 2129, 2119, 2120, 2121, 2122, + 2123, 2106, 2106, 2106, 2106, 2106, 2106, 2106, 2106, 2106, + 2124, 2125, 2127, 2107, 2128, 2108, 2109, 2110, 2126, 2130, + 2131, 2111, 2132, 2129, 2135, 2133, 2112, 2136, 2137, 2138, + 2139, 2140, 2141, 2149, 2151, 2113, 2134, 2144, 2145, 2146, + 2144, 2107, 2152, 2108, 2109, 2110, 2153, 2130, 2131, 2111, + 2132, 2154, 2135, 2133, 2112, 2136, 2137, 2138, 2139, 2140, + + 2141, 2149, 2151, 2113, 2134, 2147, 2145, 2148, 2147, 2155, + 2152, 2156, 2157, 2158, 2153, 2159, 2160, 2161, 2162, 2154, + 2163, 2164, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, + 2175, 2176, 1947, 2177, 2091, 2180, 2181, 2155, 2182, 2156, + 2157, 2158, 2183, 2159, 2160, 2161, 2162, 2184, 2163, 2164, + 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, + 1949, 2177, 1981, 2180, 2181, 1981, 2182, 2179, 2185, 2186, + 2183, 2187, 2188, 2189, 2190, 2184, 2191, 2192, 2193, 2194, + 1997, 2197, 2198, 1997, 2199, 2195, 2200, 2201, 2202, 2203, + 2204, 2205, 2206, 2207, 2208, 2209, 2185, 2186, 2210, 2187, + + 2188, 2189, 2190, 2206, 2191, 2192, 2193, 2194, 2211, 2197, + 2198, 2212, 2199, 2213, 2200, 2201, 2202, 2203, 2204, 2205, + 2214, 2207, 2208, 2209, 2215, 2216, 2210, 2217, 2510, 2166, + 2509, 2230, 2166, 2231, 2386, 3965, 2211, 2232, 3965, 2212, + 3965, 2213, 3965, 2233, 2234, 3965, 2235, 3965, 2214, 2236, + 2237, 2238, 2215, 2216, 2239, 2217, 2218, 2219, 2220, 2230, + 2221, 2231, 2222, 2223, 2240, 2232, 2224, 2225, 2226, 2241, + 2227, 2233, 2234, 2228, 2235, 2229, 2242, 2236, 2237, 2238, + 2243, 2244, 2239, 2245, 2218, 2219, 2220, 2246, 2221, 2247, + 2222, 2223, 2240, 2248, 2224, 2225, 2226, 2241, 2227, 2249, + + 2250, 2228, 2251, 2229, 2242, 2252, 2253, 2254, 2243, 2244, + 2255, 2245, 2257, 2258, 2259, 2246, 2260, 2247, 2263, 2264, + 2265, 2248, 2266, 2267, 2268, 2269, 2270, 2249, 2250, 2271, + 2251, 2272, 2273, 2252, 2253, 2254, 2274, 2279, 2255, 2285, + 2257, 2258, 2259, 2280, 2260, 2281, 2263, 2264, 2265, 2282, + 2266, 2267, 2268, 2269, 2270, 2287, 2300, 2271, 2288, 2272, + 2273, 2289, 2290, 2291, 2274, 2279, 2303, 2292, 2293, 2294, + 2295, 2280, 2296, 2281, 2300, 2305, 2306, 2307, 2308, 2309, + 2310, 2311, 2312, 2287, 2286, 2313, 2288, 2314, 2325, 2289, + 2290, 2291, 2490, 2076, 2076, 2292, 2293, 2294, 2295, 2487, + + 2296, 2301, 2326, 2305, 2306, 2307, 2308, 2309, 2310, 2311, + 2312, 2304, 2315, 2313, 2316, 2314, 2325, 2472, 2428, 2091, + 2106, 2106, 2106, 2106, 2106, 2106, 2106, 2106, 2106, 2428, + 2326, 2463, 2327, 2328, 2330, 2362, 2331, 2332, 2329, 2334, + 2315, 2335, 2316, 2317, 2317, 2317, 2317, 2317, 2317, 2317, + 2317, 2317, 2336, 2337, 2338, 2318, 2339, 2319, 2320, 2321, + 2327, 2328, 2330, 2322, 2331, 2332, 2329, 2334, 2323, 2335, + 2340, 2341, 2342, 2343, 2344, 2345, 2346, 2324, 2347, 2348, + 2336, 2337, 2338, 2318, 2339, 2319, 2320, 2321, 2349, 2350, + 2351, 2322, 2352, 2353, 2354, 2355, 2323, 2356, 2340, 2341, + + 2342, 2343, 2344, 2345, 2346, 2324, 2347, 2348, 2357, 2358, + 2144, 2145, 2146, 2144, 2145, 2146, 2349, 2350, 2351, 2363, + 2352, 2353, 2354, 2355, 2364, 2356, 2147, 2145, 2148, 2147, + 2145, 2148, 2365, 2366, 2367, 2376, 2357, 2358, 2377, 2378, + 2360, 2379, 2380, 2381, 2382, 2383, 2384, 2363, 2385, 2390, + 2388, 2391, 2364, 2388, 2392, 2393, 2488, 2262, 2394, 2395, + 2365, 2366, 2367, 2376, 2396, 1947, 2377, 2378, 1947, 2379, + 2380, 2381, 2382, 2383, 2384, 2397, 2385, 2390, 2398, 2391, + 2399, 1949, 2392, 2393, 1949, 2368, 2394, 2395, 2368, 2261, + 2389, 2256, 2396, 2401, 2402, 2403, 2404, 2405, 2406, 2407, + + 2408, 2489, 2409, 2397, 2369, 2165, 2398, 2410, 2399, 2412, + 2413, 2414, 2415, 2417, 2418, 2419, 2420, 2370, 2389, 2371, + 2421, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2372, + 2409, 2373, 2374, 2375, 2423, 2410, 2424, 2412, 2413, 2414, + 2415, 2417, 2418, 2419, 2420, 2370, 2422, 2371, 2421, 2422, + 2425, 2426, 2427, 2430, 2429, 2431, 2432, 2372, 2433, 2373, + 2374, 2375, 2423, 2434, 2424, 2429, 2435, 2437, 2438, 2439, + 2440, 2441, 2442, 2443, 2444, 2436, 2445, 2446, 2425, 2426, + 2427, 2430, 2447, 2431, 2432, 2450, 2433, 2451, 2448, 2452, + 2453, 2434, 2454, 2455, 2435, 2437, 2438, 2439, 2440, 2441, + + 2442, 2443, 2444, 2449, 2445, 2446, 2456, 2457, 2458, 2459, + 2447, 2460, 2461, 2450, 2462, 2451, 2448, 2452, 2453, 2464, + 2454, 2455, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2473, + 2474, 2449, 2475, 2476, 2456, 2457, 2458, 2459, 2477, 2460, + 2461, 2478, 2462, 2479, 2480, 2481, 2484, 2464, 2485, 2486, + 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2473, 2474, 2491, + 2475, 2476, 2493, 2494, 2495, 2496, 2477, 2497, 2498, 2478, + 2499, 2479, 2480, 2481, 2484, 2500, 2485, 2486, 2501, 2511, + 2514, 2516, 2517, 2150, 2504, 2518, 2519, 2504, 2520, 2504, + 2493, 2494, 2495, 2496, 2505, 2497, 2498, 2506, 2499, 2521, + + 2522, 2523, 2524, 2500, 2492, 2525, 2501, 2526, 2528, 2516, + 2517, 2507, 2529, 2518, 2519, 2368, 2520, 1949, 2368, 1947, + 2572, 2114, 2530, 2533, 2512, 2515, 2531, 2521, 2522, 2523, + 2524, 2532, 2534, 2525, 2527, 2526, 2528, 2535, 2536, 2508, + 2529, 2317, 2317, 2317, 2317, 2317, 2317, 2317, 2317, 2317, + 2530, 2533, 2537, 2538, 2531, 2539, 2540, 2541, 2542, 2532, + 2534, 2543, 2544, 2545, 2546, 2535, 2536, 2547, 2548, 2549, + 2550, 2551, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, + 2537, 2538, 2561, 2539, 2540, 2541, 2542, 2088, 2567, 2543, + 2544, 2545, 2546, 2568, 2571, 2547, 2548, 2549, 2550, 2551, + + 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2563, 2564, + 2561, 2563, 2566, 2564, 2575, 2566, 2567, 2569, 2578, 2576, + 2574, 2568, 2571, 2574, 2570, 2577, 2579, 2580, 2581, 2582, + 2583, 2584, 2585, 2583, 2586, 2087, 2587, 2588, 2589, 2994, + 2590, 2591, 2575, 1899, 2595, 2569, 2578, 2576, 2049, 2596, + 2994, 2597, 2570, 2577, 2579, 2580, 2581, 2582, 2598, 2584, + 2585, 2599, 2586, 2360, 2587, 2588, 2589, 2362, 2590, 2591, + 3965, 2388, 2595, 3965, 2388, 3965, 2593, 2596, 2359, 2597, + 2600, 2601, 2361, 2602, 2603, 2604, 2598, 2603, 2606, 2599, + 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, + + 2617, 2618, 2619, 2621, 2622, 2624, 2625, 2623, 2600, 2601, + 2623, 2602, 2627, 2604, 2629, 2627, 2606, 2628, 2607, 2608, + 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, + 2619, 2621, 2622, 2624, 2625, 2630, 2631, 2632, 2633, 2634, + 2635, 2637, 2629, 2639, 2641, 2642, 2643, 2644, 2645, 2646, + 2647, 2649, 2650, 2651, 2639, 2652, 2020, 2653, 2654, 2655, + 2656, 2657, 2658, 2630, 2631, 2632, 2633, 2634, 2635, 2637, + 2660, 2661, 2641, 2642, 2643, 2644, 2645, 2646, 2647, 2649, + 2650, 2651, 2662, 2652, 2640, 2653, 2654, 2655, 2656, 2657, + 2658, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2660, 2661, + + 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, + 2662, 2681, 2682, 2684, 2282, 2488, 2686, 2687, 2688, 2663, + 2664, 2665, 2666, 2667, 2668, 2669, 2689, 2690, 2670, 2671, + 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2691, 2681, + 2682, 2692, 2693, 2299, 2686, 2687, 2688, 2698, 2712, 2710, + 2997, 1949, 2300, 2511, 2689, 2690, 1947, 2502, 2492, 2685, + 2492, 2997, 2504, 2713, 2699, 2504, 2691, 2504, 2504, 2692, + 2693, 2504, 2695, 2504, 2504, 2506, 2712, 2504, 2702, 2504, + 2714, 2715, 1945, 2504, 2706, 2701, 2504, 2506, 2504, 2696, + 1905, 2713, 2700, 2695, 2515, 2703, 2506, 2711, 2515, 2716, + + 2717, 2707, 2718, 2719, 2720, 2721, 2722, 2723, 2714, 2715, + 2696, 2724, 2725, 2726, 2727, 2728, 2729, 2697, 1905, 2730, + 2731, 2732, 2733, 2704, 2734, 2735, 2736, 2716, 2717, 2708, + 2718, 2719, 2720, 2721, 2722, 2723, 2737, 2738, 2508, 2724, + 2725, 2726, 2727, 2728, 2729, 2739, 2740, 2730, 2731, 2732, + 2733, 2741, 2734, 2735, 2736, 2742, 2744, 2746, 2747, 2748, + 2749, 2750, 2751, 2752, 2737, 2738, 2753, 2563, 2564, 2754, + 2563, 2755, 2756, 2739, 2740, 2566, 2564, 2757, 2566, 2741, + 2760, 2761, 2762, 2742, 2744, 2746, 2747, 2748, 2749, 2750, + 2751, 2752, 2574, 2763, 2753, 2574, 2764, 2754, 2765, 2755, + + 2756, 2766, 1917, 2767, 2770, 2757, 2771, 2772, 2760, 2761, + 2762, 2583, 2773, 2774, 2583, 2775, 2768, 1912, 2776, 2779, + 2780, 2763, 2360, 2781, 2764, 2782, 2765, 2783, 2784, 2766, + 2362, 2767, 2770, 2789, 2771, 2772, 2785, 2359, 2786, 2788, + 2773, 2774, 2788, 2775, 2790, 2361, 2776, 2779, 2780, 2791, + 2792, 2781, 2793, 2782, 2794, 2783, 2784, 2795, 2796, 2797, + 2798, 2789, 2797, 2800, 2785, 2801, 2786, 2802, 2803, 2804, + 2805, 2623, 2790, 2810, 2623, 2814, 2806, 2791, 2792, 2799, + 2793, 2816, 2794, 2808, 2809, 2795, 2796, 2627, 2798, 2817, + 2627, 2800, 2628, 2801, 2818, 2802, 2803, 2804, 2805, 2819, + + 2820, 2810, 2821, 2814, 2822, 2823, 2824, 2799, 2825, 2816, + 2826, 2808, 2809, 2827, 2828, 2829, 2830, 2817, 2831, 2832, + 2833, 2834, 2818, 2835, 2836, 2837, 2838, 2819, 2820, 2841, + 2821, 2842, 2822, 2823, 2824, 2843, 2825, 2844, 2826, 2845, + 2846, 2827, 2828, 2829, 2830, 2847, 2831, 2832, 2833, 2834, + 2848, 2835, 2836, 2837, 2838, 2849, 2850, 2841, 2851, 2842, + 2852, 2853, 2854, 2843, 2855, 2844, 2856, 2845, 2846, 2857, + 2858, 2859, 2860, 2847, 2861, 2862, 2863, 2864, 2848, 2488, + 2865, 2866, 2867, 2849, 2850, 2868, 2851, 2869, 2852, 2853, + 2854, 2870, 2855, 2871, 2856, 1902, 2511, 2857, 2858, 2859, + + 2860, 2880, 2861, 2862, 2863, 2864, 2299, 2509, 2958, 2866, + 2867, 2958, 2883, 2868, 2508, 2869, 2895, 2299, 2881, 2870, + 2502, 2871, 1526, 2873, 2489, 2076, 2873, 2504, 2873, 2699, + 2504, 2502, 2504, 2874, 1897, 2885, 2875, 2878, 1715, 2873, + 2506, 2512, 2873, 1886, 2873, 2896, 2882, 2897, 2701, 2887, + 2876, 2898, 2875, 2504, 2696, 2899, 2504, 2884, 2504, 2504, + 2900, 2091, 2504, 2890, 2504, 1849, 2888, 2959, 2901, 2706, + 2959, 2873, 2506, 2896, 2873, 2897, 2873, 2902, 2877, 2898, + 2703, 2874, 2508, 2899, 2875, 2903, 2707, 2904, 2900, 1831, + 2504, 2905, 2906, 2504, 2889, 2504, 2901, 2907, 2876, 2908, + + 2893, 2909, 2910, 2506, 2911, 2902, 2912, 2913, 2891, 2914, + 2915, 2916, 2917, 2903, 2708, 2904, 2918, 2707, 2919, 2905, + 2906, 2920, 2921, 2922, 2923, 2907, 2877, 2908, 2924, 2909, + 2910, 2925, 2911, 2926, 2912, 2913, 2927, 2914, 2915, 2916, + 2917, 2928, 2929, 2930, 2918, 2894, 2919, 2931, 2932, 2920, + 2921, 2922, 2923, 2933, 2934, 2935, 2924, 2936, 2938, 2925, + 2939, 2926, 2940, 2941, 2927, 2942, 2943, 2944, 2945, 2928, + 2929, 2930, 2947, 2948, 2949, 2931, 2932, 2950, 2951, 2952, + 2953, 2933, 2934, 2935, 2955, 2936, 2938, 2956, 2939, 2957, + 2940, 2941, 2960, 2942, 2943, 2944, 2945, 2961, 2962, 2963, + + 2947, 2948, 2949, 2964, 2971, 2950, 2951, 2952, 2953, 2972, + 2788, 2973, 2955, 2788, 2974, 2956, 2797, 2957, 2977, 2797, + 2960, 2975, 2966, 2978, 2979, 2961, 2962, 2963, 2980, 2981, + 2967, 2968, 2971, 2969, 2965, 2970, 2982, 2972, 2983, 2973, + 2984, 2986, 2974, 2987, 2988, 2992, 2977, 2993, 2995, 2998, + 2966, 2978, 2979, 2999, 3000, 3001, 2980, 2981, 2967, 2968, + 3002, 2969, 2965, 2970, 2982, 3003, 2983, 3004, 2984, 2986, + 3007, 2987, 2988, 2992, 3009, 2993, 2995, 2998, 3010, 3011, + 3012, 2999, 3000, 3001, 3008, 3013, 3015, 3016, 3002, 3017, + 3018, 3019, 3020, 3003, 3021, 3004, 3013, 3022, 3007, 3023, + + 3024, 3025, 3009, 3026, 3027, 3028, 3010, 3011, 3012, 3029, + 3030, 3031, 3032, 3033, 3015, 3016, 3034, 3017, 3018, 3019, + 3020, 3035, 3021, 3036, 3037, 3022, 3038, 3023, 3024, 3025, + 3039, 3026, 3027, 3028, 3040, 3041, 3042, 3029, 3030, 3031, + 3032, 3033, 2488, 3043, 3034, 3044, 3045, 3046, 3048, 3035, + 3052, 3036, 3037, 2894, 3038, 1759, 2299, 3112, 3039, 3154, + 3112, 1395, 3040, 3041, 3042, 3069, 3049, 2881, 3052, 1574, + 3154, 3043, 2511, 3044, 3045, 3046, 3048, 3118, 2873, 2873, + 3118, 2873, 2873, 2873, 2873, 2881, 1735, 2286, 3050, 3055, + 3070, 2875, 3071, 3069, 3049, 3053, 1731, 2873, 2873, 3061, + + 2873, 2873, 2873, 2873, 2698, 2876, 3056, 3050, 3058, 2504, + 2875, 2875, 2504, 3053, 2504, 2698, 2881, 2304, 3070, 2695, + 3071, 2699, 2506, 3072, 2876, 2876, 3073, 3074, 3134, 3075, + 3076, 3134, 2699, 3051, 3057, 2873, 2696, 1718, 2873, 3077, + 2873, 1717, 1715, 3142, 3062, 3063, 3142, 3059, 2875, 2700, + 2299, 3072, 3051, 3059, 3073, 3074, 2873, 3075, 3076, 2873, + 2884, 2873, 2888, 1657, 2697, 2873, 3063, 3077, 2873, 2875, + 2873, 2504, 1656, 3078, 2504, 3066, 2504, 2504, 2875, 1646, + 2504, 2702, 2504, 2888, 3079, 1645, 2504, 2702, 3080, 2504, + 3064, 2504, 2888, 3081, 3082, 3083, 2706, 2504, 2703, 2506, + + 2504, 3078, 2504, 3084, 2703, 3085, 3086, 2706, 3087, 3088, + 2506, 3064, 3079, 2707, 3089, 3090, 3080, 3091, 3092, 3093, + 3067, 3081, 3082, 3083, 2707, 3094, 2704, 3095, 3096, 3097, + 3098, 3084, 2891, 3085, 3086, 3099, 3087, 3088, 3100, 3101, + 3102, 2708, 3089, 3090, 3103, 3091, 3092, 3093, 3104, 3105, + 3107, 3108, 2894, 3094, 3109, 3095, 3096, 3097, 3098, 3110, + 3111, 3113, 3114, 3099, 3115, 3116, 3100, 3101, 3102, 3121, + 2959, 3122, 3103, 2959, 3124, 3119, 3104, 3105, 3107, 3108, + 3125, 3126, 3109, 3127, 3128, 3129, 3133, 3110, 3111, 3113, + 3114, 3139, 3115, 3116, 3130, 3140, 3135, 3121, 3965, 3122, + + 3136, 3965, 3124, 3965, 3141, 3131, 3132, 3137, 3125, 3126, + 3143, 3127, 3128, 3129, 3133, 3144, 3145, 3146, 3148, 3139, + 3149, 3150, 3130, 3140, 3135, 3152, 3153, 3155, 3136, 3156, + 3157, 3158, 3141, 3131, 3132, 3137, 3159, 3160, 3143, 3161, + 3162, 3163, 3166, 3144, 3145, 3146, 3148, 3167, 3149, 3150, + 3164, 3165, 3168, 3152, 3153, 3155, 3169, 3156, 3157, 3158, + 3170, 3171, 3172, 3173, 3159, 3160, 3174, 3161, 3162, 3163, + 3166, 3175, 3176, 3177, 3178, 3167, 3179, 3180, 3164, 3165, + 3168, 3181, 3183, 3186, 3169, 3184, 3187, 3188, 3170, 3171, + 3172, 3173, 3181, 3189, 3174, 3190, 3184, 3192, 1644, 3175, + + 3176, 3177, 3178, 3193, 3179, 3180, 3194, 3195, 3196, 3197, + 3183, 3186, 3198, 3199, 3187, 3188, 3201, 3202, 3203, 3205, + 3206, 3189, 3182, 3190, 3067, 3192, 3185, 2299, 2509, 3219, + 3220, 3193, 3406, 3204, 3194, 3195, 3196, 3197, 3208, 3245, + 3198, 3199, 3245, 3406, 3201, 3202, 3203, 3205, 3206, 2873, + 3221, 2698, 2873, 3222, 2873, 2881, 3209, 3219, 3220, 3207, + 2873, 3204, 2875, 2873, 2873, 2873, 3223, 2873, 2699, 2873, + 3063, 3052, 2504, 2875, 3210, 2504, 2876, 2504, 3221, 3224, + 1580, 3222, 2706, 3062, 3225, 2506, 3226, 2888, 2881, 3256, + 2873, 3056, 3256, 2873, 3223, 2873, 3213, 1579, 3118, 2707, + + 3050, 3118, 3281, 2875, 3059, 3281, 3227, 3224, 2873, 3228, + 3229, 2873, 3225, 2873, 3226, 3064, 3062, 2876, 3214, 3211, + 2504, 2875, 3230, 2504, 3231, 2504, 2873, 3212, 3232, 2873, + 3216, 2873, 3233, 2506, 3227, 2888, 3063, 3228, 3229, 2875, + 3234, 3235, 3236, 3237, 3238, 3059, 3239, 3217, 3240, 3241, + 3230, 3242, 3231, 2888, 3243, 3244, 3232, 3246, 3247, 3248, + 3233, 3249, 3250, 3067, 3251, 3252, 3253, 3255, 3234, 3235, + 3236, 3237, 3238, 3257, 3239, 3218, 3240, 3241, 3725, 3242, + 3725, 3067, 3243, 3244, 1574, 3246, 3247, 3248, 3112, 3249, + 3250, 3112, 3251, 3252, 3253, 3255, 3259, 3965, 3260, 3262, + + 3965, 3257, 3965, 3263, 3264, 3254, 3254, 3254, 3254, 3254, + 3254, 3254, 3254, 3254, 3265, 3266, 3267, 3268, 3269, 3270, + 3271, 3273, 3359, 1550, 3259, 3359, 3260, 3262, 3726, 1549, + 3657, 3263, 3264, 3134, 3274, 3275, 3134, 3277, 3278, 3279, + 3282, 3283, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3273, + 3272, 3272, 3272, 3272, 3272, 3272, 3272, 3272, 3272, 3284, + 3285, 3286, 3274, 3275, 3287, 3277, 3278, 3279, 3282, 3283, + 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 3297, + 3298, 3299, 3300, 3301, 3303, 3304, 3305, 3284, 3285, 3286, + 3306, 3307, 3287, 3309, 3310, 3311, 3312, 3313, 3288, 3289, + + 3290, 3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, + 3300, 3301, 3303, 3304, 3305, 3314, 3315, 3317, 3306, 3307, + 3319, 3309, 3310, 3311, 3312, 3313, 3320, 3321, 3317, 3322, + 1546, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, + 3332, 3334, 3245, 3314, 3315, 3245, 3341, 3362, 3319, 3390, + 3342, 3333, 3390, 3281, 3320, 3321, 3281, 3322, 3318, 3323, + 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3334, + 2873, 3052, 1545, 2873, 3341, 2873, 1544, 3336, 3342, 3333, + 3050, 2873, 2873, 2875, 2873, 2873, 2873, 2873, 2881, 1543, + 2504, 3055, 3055, 2504, 2699, 2504, 1542, 2876, 1540, 3343, + + 3335, 2873, 2504, 2506, 2873, 2504, 2873, 2504, 3056, 3056, + 3344, 3063, 3216, 3345, 2875, 2506, 3053, 2707, 3346, 3347, + 1117, 2873, 2884, 3348, 2873, 3051, 2873, 3343, 2888, 3217, + 3349, 2887, 3350, 3351, 2875, 3352, 3057, 3211, 3344, 2504, + 3353, 3345, 2504, 3354, 2504, 2894, 3346, 3347, 2888, 3339, + 3355, 3348, 2506, 3356, 3357, 3358, 3064, 3337, 3349, 3360, + 3350, 3351, 3361, 3352, 3364, 3365, 3217, 3366, 3353, 3367, + 3368, 3354, 3369, 3370, 3371, 874, 2889, 3399, 3355, 1485, + 3399, 3356, 3357, 3358, 3372, 3377, 3401, 3360, 3377, 3401, + 3361, 1476, 3364, 3365, 3340, 3366, 3256, 3367, 3368, 3256, + + 3369, 3370, 3371, 3254, 3254, 3254, 3254, 3254, 3254, 3254, + 3254, 3254, 3372, 3373, 3373, 3373, 3373, 3373, 3373, 3373, + 3373, 3373, 3374, 3376, 3380, 3381, 3382, 3383, 3384, 3385, + 3386, 3378, 3387, 3388, 3389, 3272, 3272, 3272, 3272, 3272, + 3272, 3272, 3272, 3272, 3391, 3392, 3393, 3394, 3395, 3396, + 3374, 3376, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 3378, + 3387, 3388, 3389, 3397, 3398, 3400, 3402, 3403, 3404, 3405, + 3407, 3408, 3391, 3392, 3393, 3394, 3395, 3396, 3409, 3410, + 3412, 3413, 3414, 3415, 3416, 3419, 3420, 3421, 3422, 3423, + 3425, 3397, 3398, 3400, 3402, 3403, 3404, 3405, 3407, 3408, + + 3426, 3427, 3430, 3431, 3432, 3433, 3409, 3410, 3412, 3413, + 3414, 3415, 3416, 3419, 3420, 3421, 3422, 3423, 3425, 3428, + 3434, 3435, 3436, 3437, 3438, 3440, 3441, 3429, 3426, 3427, + 3430, 3431, 3432, 3433, 3442, 3443, 3444, 3445, 3340, 3461, + 3052, 2299, 3461, 1474, 1469, 1464, 3447, 3428, 3434, 3435, + 3436, 3437, 3438, 3440, 3441, 3429, 2873, 2881, 3448, 2873, + 3449, 2873, 3442, 3443, 3444, 3445, 3050, 2504, 2873, 2875, + 2504, 2873, 2504, 2873, 3447, 3450, 3451, 3446, 3063, 2504, + 2506, 2875, 2504, 2876, 2504, 2882, 3448, 3452, 3449, 3216, + 3453, 3454, 2506, 3455, 3217, 2888, 3456, 3457, 3458, 3459, + + 1406, 3462, 3464, 3450, 3451, 3465, 3217, 3466, 3467, 3468, + 3469, 2877, 3470, 3471, 3472, 3452, 3473, 3487, 3453, 3454, + 3487, 3455, 3340, 2889, 3456, 3457, 3458, 3459, 3359, 3462, + 3464, 3359, 3503, 3465, 3340, 3466, 3467, 3468, 3469, 1405, + 3470, 3471, 3472, 3503, 3473, 3460, 3460, 3460, 3460, 3460, + 3460, 3460, 3460, 3460, 3463, 3463, 3463, 3463, 3463, 3463, + 3463, 3463, 3463, 3463, 3463, 3363, 3363, 3363, 3363, 3363, + 3363, 3363, 3363, 3363, 3363, 3363, 3474, 3476, 540, 3463, + 3373, 3373, 3373, 3373, 3373, 3373, 3373, 3373, 3373, 3377, + 3363, 3477, 3377, 3478, 3479, 3480, 3481, 3482, 3483, 3484, + + 3485, 3490, 3491, 538, 3474, 3476, 3475, 3475, 3475, 3475, + 3475, 3475, 3475, 3475, 3475, 3488, 3493, 3489, 3488, 3477, + 3489, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3490, + 3491, 3492, 3494, 3495, 3492, 3497, 3498, 3550, 3497, 3498, + 3550, 3508, 533, 3500, 3493, 3401, 3501, 3502, 3401, 3505, + 3506, 3507, 3508, 3509, 3510, 3514, 531, 516, 3515, 3516, + 3494, 3495, 3499, 3499, 3499, 3499, 3499, 3499, 3499, 3499, + 3499, 3500, 3517, 3518, 3501, 3502, 3511, 3505, 3506, 3507, + 3519, 3509, 3510, 3514, 3512, 3513, 3515, 3516, 3520, 3521, + 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, + + 3517, 3518, 3532, 3533, 3511, 3534, 3535, 3534, 3519, 3536, + 3537, 3539, 3512, 3513, 3540, 514, 3520, 3521, 3522, 3523, + 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3541, 3542, + 3532, 3533, 3543, 3544, 3535, 3545, 3546, 3536, 3537, 3539, + 2504, 3547, 3540, 2504, 3552, 2504, 3553, 3554, 3555, 3487, + 3216, 3497, 3487, 2506, 3585, 3628, 3541, 3542, 3628, 3634, + 3543, 3544, 3634, 3545, 3546, 3556, 3557, 3217, 3558, 3547, + 3559, 3560, 3552, 3561, 3553, 3554, 3555, 3534, 3460, 3460, + 3460, 3460, 3460, 3460, 3460, 3460, 3460, 3461, 3638, 3551, + 3461, 3638, 3548, 3556, 3557, 3337, 3558, 3573, 3559, 3560, + + 3573, 3561, 3574, 510, 3549, 3549, 3549, 3549, 3549, 3549, + 3549, 3549, 3549, 3463, 3463, 3463, 3463, 3463, 3463, 3463, + 3463, 3463, 3463, 3463, 3475, 3475, 3475, 3475, 3475, 3475, + 3475, 3475, 3475, 3562, 3563, 3564, 3565, 3566, 3463, 3568, + 3566, 3569, 3570, 3571, 3576, 3578, 3579, 3576, 3492, 3577, + 3581, 3492, 3582, 3580, 3583, 3587, 3701, 3704, 1396, 3701, + 3704, 3562, 3563, 3564, 3565, 3745, 3567, 3568, 3590, 3569, + 3570, 3571, 3573, 3578, 3579, 3573, 3745, 3574, 3581, 1392, + 3582, 3498, 3583, 3587, 3498, 3499, 3499, 3499, 3499, 3499, + 3499, 3499, 3499, 3499, 3567, 3591, 3590, 3592, 3586, 3586, + + 3586, 3586, 3586, 3586, 3586, 3586, 3586, 3588, 3593, 3594, + 3595, 3596, 3597, 3589, 3598, 3599, 3601, 3603, 3604, 3605, + 3606, 3607, 3608, 3591, 3610, 3592, 3611, 3614, 3615, 3576, + 3818, 1386, 3576, 3818, 3577, 3588, 3593, 3594, 3595, 3596, + 3597, 3589, 3598, 3599, 3601, 3603, 3604, 3605, 3606, 3607, + 3608, 3617, 3610, 3618, 3611, 3614, 3615, 3616, 3616, 3616, + 3616, 3616, 3616, 3616, 3616, 3616, 3616, 3616, 3619, 3622, + 3623, 3624, 3625, 3626, 3627, 3638, 3965, 1355, 3638, 3617, + 3708, 3618, 3616, 3629, 3629, 3629, 3629, 3629, 3629, 3629, + 3629, 3629, 3631, 3632, 3633, 3635, 3619, 3622, 3623, 3624, + + 3625, 3626, 3627, 3549, 3549, 3549, 3549, 3549, 3549, 3549, + 3549, 3549, 3550, 3636, 3637, 3550, 3639, 3640, 3641, 3642, + 3631, 3632, 3633, 3635, 3643, 3645, 3646, 3647, 3650, 3630, + 3630, 3630, 3630, 3630, 3630, 3630, 3630, 3630, 3653, 3654, + 3566, 3636, 3637, 3566, 3639, 3640, 3641, 3642, 3648, 1347, + 3658, 3648, 3643, 3645, 3646, 3647, 3650, 3644, 3644, 3644, + 3644, 3644, 3644, 3644, 3644, 3644, 3653, 3654, 3659, 3660, + 3584, 3662, 3663, 3664, 3665, 3667, 3668, 3649, 3658, 3669, + 3670, 3671, 3672, 3673, 3661, 3661, 3661, 3661, 3661, 3661, + 3661, 3661, 3661, 1336, 431, 3497, 3659, 3660, 3585, 3662, + + 3663, 3664, 3665, 3667, 3668, 3649, 3674, 3669, 3670, 3671, + 3672, 3673, 3661, 3661, 3661, 3661, 3661, 3661, 3661, 3661, + 3661, 3586, 3586, 3586, 3586, 3586, 3586, 3586, 3586, 3586, + 3675, 3676, 3677, 3678, 3674, 3679, 3680, 3681, 3683, 3686, + 418, 3687, 3688, 3616, 3616, 3616, 3616, 3616, 3616, 3616, + 3616, 3616, 3616, 3616, 3689, 3691, 3692, 3693, 3675, 3676, + 3677, 3678, 414, 3679, 3680, 3681, 3683, 3686, 3616, 3687, + 3688, 3819, 399, 3695, 3819, 3696, 3695, 3699, 3697, 3700, + 3702, 395, 3689, 3691, 3692, 3693, 3696, 3706, 3709, 3629, + 3629, 3629, 3629, 3629, 3629, 3629, 3629, 3629, 3630, 3630, + + 3630, 3630, 3630, 3630, 3630, 3630, 3630, 3700, 3702, 3634, + 3710, 3711, 3634, 3712, 3713, 3706, 3709, 3644, 3644, 3644, + 3644, 3644, 3644, 3644, 3644, 3644, 3703, 3703, 3703, 3703, + 3703, 3703, 3703, 3703, 3703, 3714, 3715, 373, 3710, 3711, + 3701, 3712, 3713, 3701, 369, 3759, 3717, 3718, 3648, 3721, + 3722, 3648, 3728, 3729, 3723, 3730, 3731, 3698, 3732, 3733, + 3734, 3724, 363, 3714, 3715, 3716, 3716, 3716, 3716, 3716, + 3716, 3716, 3716, 3716, 3717, 3718, 3584, 3721, 3722, 3735, + 3728, 3729, 3723, 3730, 3731, 3736, 3732, 3733, 3734, 3724, + 3661, 3661, 3661, 3661, 3661, 3661, 3661, 3661, 3661, 3737, + + 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3735, 3746, 3747, + 3748, 3752, 3754, 3736, 3755, 3756, 359, 3758, 3704, 3746, + 355, 3704, 1278, 3762, 3761, 3790, 3765, 3737, 3738, 3739, + 3740, 3741, 3742, 3743, 3744, 1217, 3790, 3747, 3748, 3752, + 3754, 1216, 3755, 3756, 3696, 3758, 3696, 3696, 3695, 3965, + 3696, 3695, 3761, 3697, 3765, 3965, 3766, 3696, 3965, 3767, + 3965, 3696, 3703, 3703, 3703, 3703, 3703, 3703, 3703, 3703, + 3703, 3768, 3769, 3770, 3771, 3716, 3716, 3716, 3716, 3716, + 3716, 3716, 3716, 3716, 3766, 3772, 3773, 3767, 3774, 3775, + 3776, 3777, 3778, 3779, 3780, 3781, 3782, 3783, 3784, 3768, + + 3769, 3770, 3771, 3785, 3795, 3786, 3787, 3788, 3789, 3791, + 3792, 3793, 3794, 3772, 3773, 3795, 3774, 3775, 3776, 3777, + 3796, 3779, 3780, 3781, 3782, 3783, 3784, 3797, 3698, 3801, + 3798, 3785, 3698, 3786, 3787, 3788, 3789, 3791, 3792, 3793, + 3794, 3799, 3657, 3805, 3965, 3808, 3809, 3965, 3796, 3965, + 3810, 3811, 3812, 3813, 3814, 3797, 3815, 3801, 3798, 3816, + 3820, 3821, 3816, 3725, 3822, 1200, 3823, 3824, 3825, 3799, + 3826, 3827, 3828, 3808, 3809, 3829, 3830, 3831, 3810, 3811, + 3812, 3813, 3814, 3832, 3815, 3840, 3834, 3835, 3820, 3821, + 3836, 3837, 3822, 3806, 3823, 3824, 3825, 3838, 3826, 3827, + + 3828, 3840, 3843, 3829, 3830, 3831, 3817, 1191, 3844, 3845, + 3846, 3832, 3847, 3726, 3834, 3835, 3848, 3849, 3836, 3837, + 3851, 3852, 3859, 3851, 3818, 3838, 3860, 3818, 3819, 3854, + 3843, 3819, 3861, 3856, 3817, 3841, 3844, 3845, 3846, 3857, + 3847, 3862, 3857, 3858, 3848, 3849, 3858, 3863, 3865, 3852, + 3859, 3806, 3866, 3867, 3860, 3868, 3869, 3870, 3873, 3874, + 3861, 3875, 3874, 3876, 3877, 3878, 3879, 3880, 3881, 3862, + 3851, 3882, 3840, 3851, 3965, 3863, 3865, 3965, 3889, 3965, + 3866, 3867, 3890, 3868, 3869, 3870, 3873, 3891, 3892, 3893, + 3894, 3876, 3877, 3878, 3879, 3880, 3881, 3965, 3857, 3882, + + 3965, 3857, 3965, 3886, 3858, 3895, 3889, 3858, 3896, 3888, + 3890, 3806, 3897, 3898, 3906, 3891, 3892, 3893, 3894, 3908, + 3904, 3909, 3841, 3904, 3899, 3905, 3907, 3900, 3910, 3907, + 3911, 3910, 3965, 3895, 3916, 3965, 3896, 3965, 3917, 3918, + 3897, 3898, 3906, 3965, 3919, 3920, 3965, 3908, 3965, 3909, + 3921, 3922, 3899, 3923, 3924, 3900, 3925, 3926, 3911, 3929, + 3904, 3931, 3916, 3904, 3931, 3905, 3917, 3918, 1179, 3932, + 3934, 3907, 3919, 3920, 3907, 1158, 1142, 3947, 3921, 3922, + 3947, 3923, 3924, 3910, 3925, 3926, 3910, 3929, 3930, 3930, + 3930, 3930, 3930, 3930, 3930, 3930, 3930, 3932, 3934, 3937, + + 3933, 3933, 3933, 3933, 3933, 3933, 3933, 3933, 3933, 3938, + 3939, 3940, 3941, 3942, 3943, 3944, 3930, 3930, 3930, 3930, + 3930, 3930, 3930, 3930, 3930, 662, 1117, 3937, 3931, 645, + 385, 3931, 385, 874, 1073, 3948, 3949, 3938, 3939, 3940, + 3941, 3942, 3943, 3944, 3950, 3946, 3946, 3946, 3946, 3946, + 3946, 3946, 3946, 3946, 3933, 3933, 3933, 3933, 3933, 3933, + 3933, 3933, 3933, 3948, 3949, 3951, 3953, 3954, 3956, 3957, + 3958, 1062, 3950, 3946, 3946, 3946, 3946, 3946, 3946, 3946, + 3946, 3946, 3947, 1054, 1051, 3947, 1009, 540, 538, 3959, + 3960, 3961, 3962, 3951, 3953, 3954, 3956, 3957, 3958, 3955, + + 3955, 3955, 3955, 3955, 3955, 3955, 3955, 3955, 3955, 3955, + 3955, 3955, 3955, 3955, 3955, 3955, 3955, 3959, 3960, 3961, + 3962, 3963, 3964, 1007, 533, 531, 1001, 516, 514, 999, + 510, 994, 986, 977, 976, 946, 935, 923, 913, 431, + 910, 418, 414, 662, 883, 399, 395, 645, 865, 3963, + 3964, 76, 76, 76, 76, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 76, 76, 76, 76, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, - 98, 98, 98, 98, 98, 128, 128, 128, 128, 128, + 98, 98, 98, 98, 98, 98, 98, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 134, 134, 134, 134, 134, 134, 134, + + 128, 128, 128, 128, 128, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, - 134, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 143, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 143, 143, 143, 143, 143, 143, 143, 149, 149, 149, - + 134, 134, 134, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 149, 156, 156, 156, 156, 156, + 149, 149, 149, 149, 149, 149, 149, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 162, 162, 162, 162, 162, 162, 162, + 156, 156, 156, 156, 156, 162, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 185, 185, 185, + 162, 162, 162, 169, 169, 169, 169, 169, 169, 169, + 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, + 169, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - - 185, 185, 185, 185, 185, 227, 227, 227, 227, 227, + 185, 185, 185, 185, 185, 185, 185, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, - 227, 227, 227, 232, 232, 232, 232, 232, 232, 232, + 227, 227, 227, 227, 227, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 239, 239, 239, + + 232, 232, 232, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 240, 240, 240, 240, 240, - + 239, 239, 239, 239, 239, 239, 239, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, + 240, 240, 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, - 241, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 249, 249, 249, 249, 249, 249, 249, 249, 251, - 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, - 251, 251, 251, 251, 251, 251, 251, 255, 255, 255, + 241, 241, 241, 249, 249, 249, 249, 249, 249, 249, + + 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, + 249, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, 251, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 258, 258, 258, 258, 258, + 255, 255, 255, 255, 255, 255, 255, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - - 258, 258, 258, 266, 266, 998, 266, 266, 266, 266, + 258, 258, 258, 258, 258, 266, 266, 373, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, - 266, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 356, - 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, - 356, 356, 356, 356, 356, 356, 356, 363, 363, 363, + 266, 266, 266, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + + 346, 356, 356, 356, 356, 356, 356, 356, 356, 356, + 356, 356, 356, 356, 356, 356, 356, 356, 356, 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, - 363, 363, 363, 363, 363, 366, 366, 366, 366, 366, + 363, 363, 363, 363, 363, 363, 363, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, - 366, 366, 366, 373, 373, 373, 373, 373, 373, 373, - + 366, 366, 366, 366, 366, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - 373, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 382, - 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 382, 387, 387, 387, - 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, - 387, 387, 387, 387, 387, 391, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, + 373, 373, 373, 376, 376, 376, 376, 376, 376, 376, + 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, + 376, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 399, 402, 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 402, 402, 402, 402, 411, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 399, 399, 399, 399, 399, + 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, + 399, 399, 399, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 411, 411, 411, 411, 411, 411, 411, 411, 411, + 411, 411, 411, 411, 411, 411, 411, 411, 411, 418, + + 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 421, 421, 421, + 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, + 421, 421, 421, 421, 421, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 511, 511, 511, 511, 511, 511, 511, + 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + 511, 516, 516, 516, 516, 516, 516, 516, 516, 516, + 516, 516, 516, 516, 516, 516, 516, 516, 516, 517, + 517, 369, 517, 517, 517, 517, 517, 517, 517, 517, + + 517, 517, 517, 517, 517, 517, 517, 518, 518, 862, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 519, 519, 363, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 533, 533, 533, 533, 533, 533, 533, 533, 533, + 533, 533, 533, 533, 533, 533, 533, 533, 533, 535, + 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, + 535, 535, 535, 535, 535, 535, 535, 540, 540, 540, + + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 266, 266, 359, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 356, 356, 356, 356, 356, 356, 356, 356, 356, + 356, 356, 356, 356, 356, 356, 356, 356, 356, 363, + 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, + 363, 363, 363, 363, 363, 859, 363, 366, 366, 366, + 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, + + 366, 366, 366, 366, 366, 373, 373, 373, 373, 373, + 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + 373, 355, 373, 376, 376, 376, 376, 376, 376, 376, + 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, + 376, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 644, 774, 644, 644, 538, + + 539, 644, 644, 644, 644, 644, 531, 644, 644, 644, + 644, 644, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, + 399, 399, 399, 399, 399, 399, 532, 399, 652, 652, + 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, + 652, 652, 652, 652, 652, 652, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + + 659, 659, 661, 514, 661, 661, 515, 508, 661, 661, + 661, 661, 661, 753, 661, 661, 661, 661, 661, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 421, 421, 421, 421, 421, + 418, 418, 418, 739, 418, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, @@ -2958,487 +3050,427 @@ static const flex_int16_t yy_nxt[14209] = 511, 511, 511, 511, 511, 511, 511, 511, 511, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, - 516, 516, 516, 516, 516, 516, 516, 517, 517, 516, + 516, 516, 516, 516, 516, 479, 516, 517, 517, 735, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, - 517, 517, 517, 517, 517, 518, 518, 514, 518, 518, + 517, 517, 517, 517, 517, 518, 518, 696, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, - 518, 518, 518, 519, 519, 996, 519, 519, 519, 519, + 518, 518, 518, 519, 519, 681, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, - 533, 533, 533, 533, 533, 533, 533, 535, 535, 535, + 533, 533, 533, 533, 533, 437, 533, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 266, 266, 510, 266, 266, 266, 266, + 540, 428, 540, 266, 266, 414, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 356, - 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, - - 356, 356, 356, 356, 356, 356, 356, 363, 363, 363, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, - 363, 363, 363, 991, 363, 366, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, - 366, 366, 366, 373, 373, 373, 373, 373, 373, 373, - 373, 373, 373, 373, 373, 373, 373, 373, 373, 983, - 373, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 382, - 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 382, 639, 639, 639, - 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, - 639, 639, 639, 639, 639, 387, 387, 387, 387, 387, + 363, 363, 363, 363, 363, 363, 363, 356, 356, 356, + 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, + 356, 356, 356, 356, 356, 373, 373, 373, 373, 373, + 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + 373, 373, 373, 366, 366, 366, 366, 366, 366, 366, + 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, + 366, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 869, + 417, 869, 869, 395, 398, 869, 869, 869, 869, 869, + 390, 869, 869, 869, 869, 869, 869, 872, 385, 872, + + 872, 369, 372, 872, 872, 872, 872, 872, 359, 872, + 872, 872, 872, 872, 872, 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, - 387, 387, 387, 644, 974, 644, 644, 973, 943, 644, - 644, 644, 644, 644, 933, 644, 644, 644, 644, 644, - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 391, 391, 391, 399, 399, + 387, 387, 387, 644, 362, 644, 644, 351, 592, 644, + 644, 644, 644, 644, 591, 644, 644, 644, 644, 644, 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 921, 399, 652, 652, 652, 652, + 399, 399, 399, 399, 399, 399, 399, 399, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, - 652, 652, 652, 652, 402, 402, 402, 402, 402, 402, + 652, 652, 652, 652, 885, 885, 885, 885, 885, 885, + 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, + 885, 885, 887, 558, 887, 887, 541, 539, 887, 887, + 887, 887, 887, 539, 887, 887, 887, 887, 887, 887, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 659, 659, 659, 659, 659, 659, 659, 659, + 402, 402, 402, 402, 402, 402, 661, 532, 661, 661, + 515, 508, 661, 661, 661, 661, 661, 479, 661, 661, + 661, 661, 661, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 661, 911, 661, 661, 431, 908, 661, 661, 661, 661, - 661, 418, 661, 661, 661, 661, 661, 411, 411, 411, + 659, 418, 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, 418, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, - 418, 414, 418, 421, 421, 421, 421, 421, 421, 421, - + 411, 411, 411, 411, 411, 411, 411, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, - 421, 505, 505, 505, 505, 505, 505, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 505, 505, 505, 511, - 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - 511, 511, 511, 511, 511, 511, 511, 516, 516, 516, + 421, 421, 421, 421, 421, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, - 516, 516, 516, 662, 516, 517, 517, 881, 517, 517, - 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, - 517, 517, 517, 518, 518, 399, 518, 518, 518, 518, - 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, - 518, 519, 519, 395, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 528, - 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, - 528, 528, 528, 528, 528, 528, 528, 533, 533, 533, + 516, 511, 511, 511, 511, 511, 511, 511, 511, 511, + 511, 511, 511, 511, 511, 511, 511, 511, 511, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, - 533, 533, 533, 645, 533, 535, 535, 535, 535, 535, + 533, 533, 533, 533, 533, 533, 533, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, - 535, 535, 535, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 863, - 540, 266, 266, 373, 266, 266, 266, 266, 266, 266, + 535, 266, 266, 437, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 363, 363, 363, - 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, - 363, 363, 363, 363, 363, 356, 356, 356, 356, 356, + 346, 346, 346, 346, 346, 346, 346, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, - 356, 356, 356, 373, 373, 373, 373, 373, 373, 373, - 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - 373, 366, 366, 366, 366, 366, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 639, - + 356, 356, 356, 356, 356, 366, 366, 366, 366, 366, + 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, + 366, 366, 366, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, - 639, 639, 639, 639, 639, 639, 639, 867, 369, 867, - 867, 860, 363, 867, 867, 867, 867, 867, 359, 867, - 867, 867, 867, 867, 867, 870, 857, 870, 870, 355, - 773, 870, 870, 870, 870, 870, 538, 870, 870, 870, - 870, 870, 870, 387, 387, 387, 387, 387, 387, 387, - 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, - 387, 644, 539, 644, 644, 531, 532, 644, 644, 644, - 644, 644, 514, 644, 644, 644, 644, 644, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, + 639, 869, 417, 869, 869, 398, 398, 869, 869, 869, + 869, 869, 385, 869, 869, 869, 869, 869, 869, 872, - 399, 399, 399, 399, 399, 399, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 391, 652, 652, 652, 652, 652, 652, + 385, 872, 872, 385, 372, 872, 872, 872, 872, 872, + 372, 872, 872, 872, 872, 872, 872, 644, 362, 644, + 644, 351, 317, 644, 644, 644, 644, 644, 3965, 644, + 644, 644, 644, 644, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, - 652, 652, 883, 883, 883, 883, 883, 883, 883, 883, - 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, - 885, 515, 885, 885, 508, 752, 885, 885, 885, 885, - 885, 738, 885, 885, 885, 885, 885, 885, 657, 657, + 652, 652, 887, 250, 887, 887, 250, 98, 887, 887, + 887, 887, 887, 98, 887, 887, 887, 887, 887, 887, 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 402, 402, 402, 402, + 657, 657, 657, 657, 657, 657, 657, 657, 891, 98, + 891, 891, 98, 98, 891, 891, 891, 891, 891, 98, + 891, 891, 891, 891, 891, 891, 885, 885, 885, 885, + 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, + 885, 885, 885, 885, 888, 888, 888, 888, 888, 888, + 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, + 888, 888, 661, 98, 661, 661, 98, 161, 661, 661, + 661, 661, 661, 161, 661, 661, 661, 661, 661, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 661, 479, 661, 661, 734, 696, - 661, 661, 661, 661, 661, 681, 661, 661, 661, 661, - 661, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 418, - 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 411, 411, 411, + 402, 402, 402, 402, 402, 402, 402, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, 421, 421, 421, 421, 421, + 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, - - 421, 421, 421, 505, 505, 505, 505, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - 505, 516, 516, 516, 516, 516, 516, 516, 516, 516, - 516, 516, 516, 516, 516, 516, 516, 516, 516, 511, + 421, 421, 421, 1157, 1157, 1157, 1157, 1157, 1157, 1157, + 1157, 1157, 160, 1157, 1157, 1157, 1157, 1157, 1157, 1157, + 1157, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - 511, 511, 511, 511, 511, 511, 511, 533, 533, 533, - 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, - 533, 533, 533, 533, 533, 528, 528, 528, 528, 528, + 511, 511, 511, 511, 511, 511, 511, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, - 528, 528, 528, 540, 540, 540, 540, 540, 540, 540, - - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 535, 535, 535, 535, 535, 535, 535, 535, 535, - 535, 535, 535, 535, 535, 535, 535, 535, 535, 266, - 266, 437, 266, 266, 266, 266, 266, 266, 266, 266, - 266, 266, 266, 266, 266, 266, 266, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 356, 356, 356, 356, 356, - 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, - 356, 356, 356, 366, 366, 366, 366, 366, 366, 366, - 366, 366, 366, 366, 366, 366, 366, 366, 366, 366, - - 366, 639, 639, 639, 639, 639, 639, 639, 639, 639, - 639, 639, 639, 639, 639, 639, 639, 639, 639, 867, - 428, 867, 867, 414, 417, 867, 867, 867, 867, 867, - 395, 867, 867, 867, 867, 867, 867, 870, 398, 870, - 870, 390, 385, 870, 870, 870, 870, 870, 369, 870, - 870, 870, 870, 870, 870, 644, 372, 644, 644, 359, - 362, 644, 644, 644, 644, 644, 351, 644, 644, 644, - 644, 644, 652, 652, 652, 652, 652, 652, 652, 652, - 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, - 885, 592, 885, 885, 591, 558, 885, 885, 885, 885, - - 885, 541, 885, 885, 885, 885, 885, 885, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 889, 539, 889, 889, - 539, 532, 889, 889, 889, 889, 889, 515, 889, 889, - 889, 889, 889, 889, 883, 883, 883, 883, 883, 883, - 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, - 883, 883, 886, 886, 886, 886, 886, 886, 886, 886, - 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, - 661, 508, 661, 661, 479, 437, 661, 661, 661, 661, - 661, 417, 661, 661, 661, 661, 661, 402, 402, 402, - - 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 421, 421, 421, 421, 421, 421, 421, - 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, - 421, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, - 398, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 505, - 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 505, 511, 511, 511, - 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - - 511, 511, 511, 511, 511, 528, 528, 528, 528, 528, - 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, - 528, 528, 528, 535, 535, 535, 535, 535, 535, 535, + 528, 528, 528, 528, 528, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, - 535, 266, 266, 398, 266, 266, 266, 266, 266, 266, - 266, 266, 266, 266, 266, 266, 266, 266, 266, 363, - 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, - 363, 363, 363, 363, 363, 363, 363, 373, 373, 373, - 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - 373, 373, 373, 373, 373, 639, 639, 639, 639, 639, - 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, - 639, 639, 639, 867, 385, 867, 867, 385, 385, 867, - 867, 867, 867, 867, 372, 867, 867, 867, 867, 867, - 867, 870, 372, 870, 870, 362, 351, 870, 870, 870, - 870, 870, 317, 870, 870, 870, 870, 870, 870, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 885, 3913, 885, - 885, 250, 250, 885, 885, 885, 885, 885, 98, 885, - 885, 885, 885, 885, 885, 886, 886, 886, 886, 886, - 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, - - 886, 886, 886, 661, 98, 661, 661, 98, 98, 661, - 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 1340, 98, 1340, 1340, - 98, 98, 1340, 1340, 1340, 98, 1340, 1340, 1340, 1340, - 1340, 1340, 1340, 1340, 1352, 1352, 1352, 1352, 1352, 1352, - 1352, 161, 1352, 161, 1352, 1352, 1352, 1352, 1352, 1352, - 1352, 1352, 1386, 1386, 1386, 1386, 1386, 1386, 1386, 1386, - - 1386, 1386, 1386, 1386, 1386, 1386, 1386, 1386, 1386, 1386, - 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, - 516, 516, 516, 516, 516, 516, 516, 516, 533, 533, - 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, - 533, 533, 533, 533, 533, 533, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 266, 266, 160, 266, 266, 266, + 535, 535, 535, 266, 266, 160, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, - 266, 266, 883, 883, 883, 883, 883, 883, 883, 883, - 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, + 266, 363, 363, 363, 363, 363, 363, 363, 363, 363, + 363, 363, 363, 363, 363, 363, 363, 363, 363, 373, + 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + 373, 373, 373, 373, 373, 373, 373, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 869, 3965, 869, 869, 3965, + 3965, 869, 869, 869, 869, 869, 3965, 869, 869, 869, + 869, 869, 869, 872, 3965, 872, 872, 3965, 3965, 872, - 1515, 1515, 1515, 1515, 1515, 1515, 1515, 1515, 1515, 1515, - 1515, 1515, 1515, 1515, 1515, 1515, 1515, 1515, 1526, 160, - 3913, 1526, 3913, 3913, 1526, 1566, 3913, 3913, 3913, 3913, - 3913, 1566, 1566, 1566, 3913, 1566, 1566, 1566, 1566, 1566, - 1566, 1566, 1566, 1516, 1516, 1516, 1516, 1516, 1516, 1516, - 1516, 1516, 1516, 1516, 1516, 1516, 1516, 1516, 1516, 1516, - 1516, 1712, 3913, 3913, 1712, 3913, 1712, 1749, 1749, 1749, - 1749, 1749, 1749, 1749, 1749, 1749, 1749, 1749, 1749, 1749, - 1749, 1749, 1749, 1749, 1749, 1754, 3913, 3913, 1754, 1754, - 3913, 3913, 1754, 3913, 1754, 3913, 1754, 1754, 1754, 1754, + 872, 872, 872, 872, 3965, 872, 872, 872, 872, 872, + 872, 399, 399, 399, 399, 399, 399, 399, 399, 399, + 399, 399, 399, 399, 399, 399, 399, 399, 399, 887, + 3965, 887, 887, 3965, 3965, 887, 887, 887, 887, 887, + 3965, 887, 887, 887, 887, 887, 887, 888, 888, 888, + 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, + 888, 888, 888, 888, 888, 661, 3965, 661, 661, 3965, + 3965, 661, 661, 661, 661, 661, 661, 661, 661, 661, + 661, 661, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 1889, 1889, 1889, 1889, 1933, 1933, 3913, 1933, 1933, 1933, - 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, - 1933, 1933, 1935, 1935, 3913, 1935, 1935, 1935, 1935, 1935, - 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, 1935, - 1939, 3913, 1939, 3913, 1939, 1939, 1939, 1939, 2061, 2061, - 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, - 2061, 2061, 2061, 2061, 2061, 2061, 2076, 2076, 2076, 2076, - 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, - 2076, 2076, 2076, 2076, 2128, 2128, 2128, 2128, 2128, 2128, - 2128, 2128, 2128, 2128, 2128, 2128, 2128, 2128, 2128, 2128, + 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, 1346, 3965, + 1346, 1346, 3965, 3965, 1346, 1346, 1346, 3965, 1346, 1346, + 1346, 1346, 1346, 1346, 1346, 1346, 1359, 1359, 1359, 1359, + 1359, 1359, 1359, 3965, 1359, 3965, 1359, 1359, 1359, 1359, + 1359, 1359, 1359, 1359, 1393, 1393, 1393, 1393, 1393, 1393, + 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, + 1393, 1393, 516, 516, 516, 516, 516, 516, 516, 516, + 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, + 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, - 2128, 2128, 2164, 2164, 3913, 3913, 2164, 2164, 2164, 2164, - 2164, 3913, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, - 2182, 3913, 3913, 2182, 2182, 3913, 3913, 2182, 3913, 2182, - 3913, 2182, 2182, 2182, 2182, 2269, 2269, 2269, 2269, 2269, - 2269, 2269, 2269, 2269, 2269, 2269, 2269, 2269, 2269, 2269, - 2269, 2269, 2269, 2282, 3913, 2282, 2282, 3913, 3913, 2282, - 2282, 2282, 2282, 2282, 2282, 2282, 2282, 2282, 2282, 2282, - 2282, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, - 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2317, - 3913, 3913, 3913, 3913, 3913, 2317, 2317, 2317, 3913, 2317, + 533, 533, 533, 533, 533, 533, 533, 533, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 266, 266, 3965, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 885, 885, 885, 885, 885, 885, + 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, + 885, 885, 1523, 1523, 1523, 1523, 1523, 1523, 1523, 1523, + 1523, 1523, 1523, 1523, 1523, 1523, 1523, 1523, 1523, 1523, + 1534, 3965, 3965, 1534, 3965, 3965, 1534, 1575, 3965, 3965, + 3965, 3965, 3965, 1575, 1575, 1575, 3965, 1575, 1575, 1575, - 2317, 2317, 2317, 2317, 2317, 2317, 2317, 2343, 2343, 3913, - 2343, 2343, 2343, 2343, 2343, 2343, 2343, 2343, 2343, 2343, - 2343, 2343, 2343, 2343, 2343, 2345, 2345, 3913, 2345, 2345, - 2345, 2345, 2345, 2345, 2345, 2345, 2345, 2345, 2345, 2345, - 2345, 2345, 2345, 2371, 3913, 3913, 2371, 2371, 3913, 3913, - 2371, 3913, 2371, 3913, 2371, 2371, 2371, 2371, 2384, 3913, - 3913, 3913, 3913, 3913, 2384, 2384, 2384, 3913, 2384, 2384, - 2384, 2384, 2384, 2384, 2384, 2384, 2395, 2395, 3913, 2395, - 2395, 3913, 2395, 2395, 2395, 2395, 2395, 2395, 2395, 2395, - 2395, 2395, 2395, 2400, 3913, 2400, 3913, 2400, 2400, 2400, + 1575, 1575, 1575, 1575, 1575, 1524, 1524, 1524, 1524, 1524, + 1524, 1524, 1524, 1524, 1524, 1524, 1524, 1524, 1524, 1524, + 1524, 1524, 1524, 1722, 3965, 3965, 1722, 3965, 1722, 1760, + 1760, 1760, 1760, 1760, 1760, 1760, 1760, 1760, 1760, 1760, + 1760, 1760, 1760, 1760, 1760, 1760, 1760, 1765, 3965, 3965, + 1765, 1765, 3965, 3965, 1765, 3965, 1765, 3965, 1765, 1765, + 1765, 1765, 1901, 1901, 1901, 1901, 1946, 1946, 3965, 1946, + 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, 1946, + 1946, 1946, 1946, 1946, 1948, 1948, 3965, 1948, 1948, 1948, + 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948, - 2400, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, - 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2284, - 3913, 2284, 2284, 3913, 3913, 2284, 2284, 2284, 2284, 2284, - 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2544, 2544, 2544, - 2544, 2544, 2544, 2544, 2544, 2544, 2544, 2544, 2544, 2544, - 2544, 2544, 2544, 2544, 2544, 2547, 2547, 2547, 2547, 2547, - 2547, 2547, 2547, 2547, 2547, 2547, 2547, 2547, 2547, 2547, - 2547, 2547, 2547, 2554, 3913, 3913, 2554, 2554, 3913, 3913, - 2554, 3913, 2554, 3913, 2554, 2554, 2554, 2554, 2573, 3913, - 2573, 3913, 2573, 2573, 2573, 2573, 2575, 3913, 3913, 2575, + 1948, 1948, 1952, 3965, 1952, 3965, 1952, 1952, 1952, 1952, + 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, + 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, + 2142, 2142, 2142, 2142, 2178, 2178, 3965, 3965, 2178, 2178, + 2178, 2178, 2178, 3965, 2178, 2178, 2178, 2178, 2178, 2178, + 2178, 2178, 2196, 3965, 3965, 2196, 2196, 3965, 3965, 2196, + 3965, 2196, 3965, 2196, 2196, 2196, 2196, 2284, 2284, 2284, - 2575, 3913, 3913, 2575, 3913, 2575, 3913, 2575, 2575, 2575, - 2575, 2607, 2607, 3913, 2607, 2607, 2607, 2607, 2607, 2607, - 2607, 2607, 2607, 2607, 2607, 2607, 2607, 2607, 2674, 3913, - 2674, 2674, 3913, 3913, 2674, 2674, 2674, 2674, 2674, 2674, - 2674, 2674, 2674, 2674, 2674, 2674, 2487, 2487, 2487, 2487, - 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, - 2487, 2487, 2487, 2487, 2489, 2489, 2489, 2489, 2489, 2489, - 2489, 2489, 2489, 2489, 2489, 2489, 2489, 2489, 2489, 2489, - 2489, 2489, 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, - 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, + 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, + 2284, 2284, 2284, 2284, 2284, 2297, 3965, 2297, 2297, 3965, + 3965, 2297, 2297, 2297, 2297, 2297, 2297, 2297, 2297, 2297, + 2297, 2297, 2297, 2302, 2302, 2302, 2302, 2302, 2302, 2302, + 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, + 2302, 2333, 3965, 3965, 3965, 3965, 3965, 2333, 2333, 2333, + 3965, 2333, 2333, 2333, 2333, 2333, 2333, 2333, 2333, 2359, + 2359, 3965, 2359, 2359, 2359, 2359, 2359, 2359, 2359, 2359, + 2359, 2359, 2359, 2359, 2359, 2359, 2359, 2361, 2361, 3965, + 2361, 2361, 2361, 2361, 2361, 2361, 2361, 2361, 2361, 2361, - 2689, 3913, 2689, 2689, 3913, 3913, 2689, 2689, 2689, 2689, - 2689, 2689, 2689, 2689, 2689, 2689, 2689, 2689, 2287, 2287, - 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, - 2287, 2287, 2287, 2287, 2287, 2287, 2076, 2076, 2076, 2076, - 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, - 2076, 2076, 2076, 2076, 2343, 2343, 3913, 2343, 2343, 2343, - 2343, 2343, 2343, 2343, 2343, 2343, 2343, 2343, 2343, 2343, - 2343, 2343, 2544, 2544, 2544, 2544, 2544, 2544, 2544, 2544, - 2544, 2544, 2544, 2544, 2544, 2544, 2544, 2544, 2544, 2544, - 2345, 2345, 3913, 2345, 2345, 2345, 2345, 2345, 2345, 2345, + 2361, 2361, 2361, 2361, 2361, 2387, 3965, 3965, 2387, 2387, + 3965, 3965, 2387, 3965, 2387, 3965, 2387, 2387, 2387, 2387, + 2400, 3965, 3965, 3965, 3965, 3965, 2400, 2400, 2400, 3965, + 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2400, 2411, 2411, + 3965, 2411, 2411, 3965, 2411, 2411, 2411, 2411, 2411, 2411, + 2411, 2411, 2411, 2411, 2411, 2416, 3965, 2416, 3965, 2416, + 2416, 2416, 2416, 2503, 2503, 2503, 2503, 2503, 2503, 2503, + 2503, 2503, 2503, 2503, 2503, 2503, 2503, 2503, 2503, 2503, + 2503, 2299, 3965, 2299, 2299, 3965, 3965, 2299, 2299, 2299, + 2299, 2299, 2299, 2299, 2299, 2299, 2299, 2299, 2299, 2562, - 2345, 2345, 2345, 2345, 2345, 2345, 2345, 2345, 2547, 2547, - 2547, 2547, 2547, 2547, 2547, 2547, 2547, 2547, 2547, 2547, - 2547, 2547, 2547, 2547, 2547, 2547, 2737, 3913, 2737, 3913, - 2737, 2737, 2737, 2737, 2554, 3913, 2554, 3913, 2554, 2554, - 2554, 2554, 2738, 3913, 3913, 2738, 3913, 3913, 3913, 2738, - 3913, 2738, 3913, 2738, 2738, 2738, 2738, 2748, 3913, 3913, - 2748, 2748, 3913, 3913, 2748, 3913, 2748, 3913, 2748, 2748, - 2748, 2748, 2573, 3913, 3913, 2573, 3913, 2573, 3913, 2573, - 2573, 2573, 2573, 2757, 3913, 2757, 3913, 2757, 2757, 2757, - 2757, 2575, 3913, 2575, 3913, 2575, 2575, 2575, 2575, 2766, + 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2562, + 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2565, 2565, 2565, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2565, 2565, 2565, 2565, 2565, 2573, 3965, 3965, 2573, 2573, + 3965, 3965, 2573, 3965, 2573, 3965, 2573, 2573, 2573, 2573, + 2592, 3965, 2592, 3965, 2592, 2592, 2592, 2592, 2594, 3965, + 3965, 2594, 2594, 3965, 3965, 2594, 3965, 2594, 3965, 2594, + 2594, 2594, 2594, 2626, 2626, 3965, 2626, 2626, 2626, 2626, + 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, + 2694, 3965, 2694, 2694, 3965, 3965, 2694, 2694, 2694, 2694, - 2766, 3913, 2766, 2766, 3913, 2766, 2766, 2766, 2766, 2766, - 2766, 2766, 2766, 2766, 2766, 2766, 2786, 3913, 3913, 2786, - 2786, 3913, 3913, 2786, 3913, 2786, 3913, 2786, 2786, 2786, - 2786, 2607, 2607, 3913, 2607, 2607, 3913, 2607, 2607, 2607, - 2607, 2607, 2607, 2607, 2607, 2607, 2607, 2607, 2790, 2790, - 2790, 2790, 2790, 2790, 2790, 2790, 2790, 2790, 2790, 2790, - 2790, 2790, 2790, 2790, 2790, 2790, 2269, 2269, 2269, 2269, - 2269, 2269, 2269, 2269, 2269, 2269, 2269, 2269, 2269, 2269, - 2269, 2269, 2269, 2269, 2061, 2061, 2061, 2061, 2061, 2061, - 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, + 2694, 2694, 2694, 2694, 2694, 2694, 2694, 2694, 2504, 2504, + 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, + 2504, 2504, 2504, 2504, 2504, 2504, 2506, 2506, 2506, 2506, + 2506, 2506, 2506, 2506, 2506, 2506, 2506, 2506, 2506, 2506, + 2506, 2506, 2506, 2506, 2705, 2705, 2705, 2705, 2705, 2705, + 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, + 2705, 2705, 2709, 3965, 2709, 2709, 3965, 3965, 2709, 2709, + 2709, 2709, 2709, 2709, 2709, 2709, 2709, 2709, 2709, 2709, + 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, + 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2089, 2089, - 2061, 2061, 2674, 3913, 2674, 2674, 3913, 3913, 2674, 2674, - 2674, 2674, 2674, 2674, 2674, 2674, 2674, 2674, 2674, 2674, - 2282, 3913, 2282, 2282, 3913, 3913, 2282, 2282, 2282, 2282, - 2282, 2282, 2282, 2282, 2282, 2282, 2282, 2282, 2850, 2850, - 2850, 2850, 2850, 2850, 2850, 2850, 2850, 2850, 2850, 2850, - 2850, 2850, 2850, 2850, 2850, 2850, 2486, 2486, 2486, 2486, - 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, - 2486, 2486, 2486, 2486, 2851, 2851, 2851, 2851, 2851, 2851, - 2851, 2851, 2851, 2851, 2851, 2851, 2851, 2851, 2851, 2851, - 2851, 2851, 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2359, 2359, 3965, 2359, + 2359, 2359, 2359, 2359, 2359, 2359, 2359, 2359, 2359, 2359, + 2359, 2359, 2359, 2359, 2562, 2562, 2562, 2562, 2562, 2562, + 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2562, + 2562, 2562, 2361, 2361, 3965, 2361, 2361, 2361, 2361, 2361, + 2361, 2361, 2361, 2361, 2361, 2361, 2361, 2361, 2361, 2361, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2758, 3965, + 2758, 3965, 2758, 2758, 2758, 2758, 2573, 3965, 2573, 3965, - 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, - 2284, 3913, 2284, 2284, 3913, 3913, 2284, 2284, 2284, 2284, - 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2864, 2864, - 2864, 2864, 2864, 2864, 2864, 2864, 2864, 2864, 2864, 2864, - 2864, 2864, 2864, 2864, 2864, 2864, 2489, 2489, 2489, 2489, - 2489, 2489, 2489, 2489, 2489, 2489, 2489, 2489, 2489, 2489, - 2489, 2489, 2489, 2489, 2685, 2685, 2685, 2685, 2685, 2685, - 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, - 2685, 2685, 2689, 3913, 2689, 2689, 3913, 3913, 2689, 2689, - 2689, 2689, 2689, 2689, 2689, 2689, 2689, 2689, 2689, 2689, + 2573, 2573, 2573, 2573, 2759, 3965, 3965, 2759, 3965, 3965, + 3965, 2759, 3965, 2759, 3965, 2759, 2759, 2759, 2759, 2769, + 3965, 3965, 2769, 2769, 3965, 3965, 2769, 3965, 2769, 3965, + 2769, 2769, 2769, 2769, 2592, 3965, 3965, 2592, 3965, 2592, + 3965, 2592, 2592, 2592, 2592, 2778, 3965, 2778, 3965, 2778, + 2778, 2778, 2778, 2594, 3965, 2594, 3965, 2594, 2594, 2594, + 2594, 2787, 2787, 3965, 2787, 2787, 3965, 2787, 2787, 2787, + 2787, 2787, 2787, 2787, 2787, 2787, 2787, 2787, 2807, 3965, + 3965, 2807, 2807, 3965, 3965, 2807, 3965, 2807, 3965, 2807, + 2807, 2807, 2807, 2626, 2626, 3965, 2626, 2626, 3965, 2626, - 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, - 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2076, 2076, - 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, - 2076, 2076, 2076, 2076, 2076, 2076, 2737, 3913, 3913, 2737, - 3913, 2737, 3913, 2737, 2737, 2737, 2737, 2738, 3913, 2738, - 3913, 2738, 2738, 2738, 2738, 2923, 3913, 2923, 3913, 2923, - 2923, 2923, 2923, 2748, 3913, 2748, 3913, 2748, 2748, 2748, - 2748, 2757, 3913, 3913, 2757, 3913, 2757, 3913, 2757, 2757, - 2757, 2757, 2766, 2766, 3913, 2766, 2766, 3913, 2766, 2766, - 2766, 2766, 2766, 2766, 2766, 2766, 2766, 2766, 2766, 2952, + 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, + 2811, 2811, 2811, 2811, 2811, 2811, 2811, 2811, 2811, 2811, + 2811, 2811, 2811, 2811, 2811, 2811, 2811, 2811, 2284, 2284, + 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, + 2284, 2284, 2284, 2284, 2284, 2284, 2074, 2074, 2074, 2074, + 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, 2074, + 2074, 2074, 2074, 2074, 2694, 3965, 2694, 2694, 3965, 3965, + 2694, 2694, 2694, 2694, 2694, 2694, 2694, 2694, 2694, 2694, + 2694, 2694, 2297, 3965, 2297, 2297, 3965, 3965, 2297, 2297, + 2297, 2297, 2297, 2297, 2297, 2297, 2297, 2297, 2297, 2297, - 3913, 3913, 2952, 2952, 3913, 3913, 2952, 3913, 2952, 3913, - 2952, 2952, 2952, 2952, 2961, 3913, 2961, 3913, 2961, 2961, - 2961, 2961, 2786, 3913, 2786, 3913, 2786, 2786, 2786, 2786, - 2790, 2790, 2790, 2790, 2790, 2790, 2790, 2790, 2790, 2790, - 2790, 2790, 2790, 2790, 2790, 2790, 2790, 2790, 2269, 2269, - 2269, 2269, 2269, 2269, 2269, 2269, 2269, 2269, 2269, 2269, - 2269, 2269, 2269, 2269, 2269, 2269, 2851, 2851, 2851, 2851, - 2851, 2851, 2851, 2851, 2851, 2851, 2851, 2851, 2851, 2851, - 2851, 2851, 2851, 2851, 2853, 2853, 2853, 2853, 2853, 2853, - 2853, 2853, 2853, 2853, 2853, 2853, 2853, 2853, 2853, 2853, + 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, + 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2503, 2503, + 2503, 2503, 2503, 2503, 2503, 2503, 2503, 2503, 2503, 2503, + 2503, 2503, 2503, 2503, 2503, 2503, 2873, 2873, 2873, 2873, + 2873, 2873, 2873, 2873, 2873, 2873, 2873, 2873, 2873, 2873, + 2873, 2873, 2873, 2873, 2504, 2504, 2504, 2504, 2504, 2504, + 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, + 2504, 2504, 2299, 3965, 2299, 2299, 3965, 3965, 2299, 2299, + 2299, 2299, 2299, 2299, 2299, 2299, 2299, 2299, 2299, 2299, + 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2886, - 2853, 2853, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, - 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, - 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, - 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2487, 2284, 3913, - 2284, 2284, 3913, 3913, 2284, 2284, 2284, 2284, 2284, 2284, - 2284, 2284, 2284, 2284, 2284, 2284, 2864, 2864, 2864, 2864, - 2864, 2864, 2864, 2864, 2864, 2864, 2864, 2864, 2864, 2864, - 2864, 2864, 2864, 2864, 2489, 2489, 2489, 2489, 2489, 2489, - 2489, 2489, 2489, 2489, 2489, 2489, 2489, 2489, 2489, 2489, - 2489, 2489, 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, + 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2506, 2506, + 2506, 2506, 2506, 2506, 2506, 2506, 2506, 2506, 2506, 2506, + 2506, 2506, 2506, 2506, 2506, 2506, 2705, 2705, 2705, 2705, + 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, + 2705, 2705, 2705, 2705, 2709, 3965, 2709, 2709, 3965, 3965, + 2709, 2709, 2709, 2709, 2709, 2709, 2709, 2709, 2709, 2709, + 2709, 2709, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, + 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2758, 3965, - 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, 2685, - 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, - 2287, 2287, 2287, 2287, 2287, 2287, 2287, 2287, 3091, 3091, - 3913, 3091, 3091, 3913, 3091, 3091, 3091, 3091, 3091, 3091, - 3091, 3091, 3091, 3091, 3091, 3094, 3913, 3913, 3094, 3094, - 3913, 3913, 3094, 3913, 3094, 3913, 3094, 3094, 3094, 3094, - 3097, 3097, 3097, 3097, 3913, 3097, 3097, 3097, 3097, 3097, - 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3111, 3913, - 3913, 3913, 3913, 3913, 3111, 3111, 3111, 3913, 3111, 3111, - 3111, 3111, 3111, 3111, 3111, 3111, 3187, 3187, 3187, 3187, + 3965, 2758, 3965, 2758, 3965, 2758, 2758, 2758, 2758, 2759, + 3965, 2759, 3965, 2759, 2759, 2759, 2759, 2946, 3965, 2946, + 3965, 2946, 2946, 2946, 2946, 2769, 3965, 2769, 3965, 2769, + 2769, 2769, 2769, 2778, 3965, 3965, 2778, 3965, 2778, 3965, + 2778, 2778, 2778, 2778, 2787, 2787, 3965, 2787, 2787, 3965, + 2787, 2787, 2787, 2787, 2787, 2787, 2787, 2787, 2787, 2787, + 2787, 2976, 3965, 3965, 2976, 2976, 3965, 3965, 2976, 3965, + 2976, 3965, 2976, 2976, 2976, 2976, 2985, 3965, 2985, 3965, + 2985, 2985, 2985, 2985, 2807, 3965, 2807, 3965, 2807, 2807, + 2807, 2807, 2811, 2811, 2811, 2811, 2811, 2811, 2811, 2811, - 3187, 3187, 3187, 3187, 3187, 3187, 3187, 3187, 3187, 3187, - 3187, 3187, 3187, 3187, 3229, 3913, 3229, 3913, 3229, 3229, - 3229, 3229, 3250, 3250, 3913, 3250, 3250, 3913, 3250, 3250, - 3250, 3250, 3250, 3250, 3250, 3250, 3250, 3250, 3250, 3331, - 3913, 3913, 3331, 3331, 3913, 3913, 3913, 3913, 3913, 3913, - 3331, 3347, 3347, 3913, 3913, 3913, 3347, 3347, 3347, 3347, - 3347, 3347, 3347, 3347, 3347, 3347, 3347, 3347, 3347, 3450, - 3450, 3913, 3450, 3450, 3913, 3450, 3450, 3450, 3450, 3450, - 3450, 3450, 3450, 3450, 3450, 3450, 3460, 3460, 3913, 3460, - 3460, 3913, 3460, 3460, 3460, 3460, 3460, 3460, 3460, 3460, + 2811, 2811, 2811, 2811, 2811, 2811, 2811, 2811, 2811, 2811, + 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, + 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2284, 2873, 2873, + 2873, 2873, 2873, 2873, 2873, 2873, 2873, 2873, 2873, 2873, + 2873, 2873, 2873, 2873, 2873, 2873, 2875, 2875, 2875, 2875, + 2875, 2875, 2875, 2875, 2875, 2875, 2875, 2875, 2875, 2875, + 2875, 2875, 2875, 2875, 2503, 2503, 2503, 2503, 2503, 2503, + 2503, 2503, 2503, 2503, 2503, 2503, 2503, 2503, 2503, 2503, + 2503, 2503, 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, + 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, 2504, - 3460, 3460, 3460, 3534, 3534, 3913, 3534, 3534, 3534, 3534, - 3534, 3534, 3534, 3534, 3534, 3534, 3534, 3534, 3534, 3534, - 3537, 3537, 3913, 3537, 3537, 3537, 3537, 3537, 3537, 3537, - 3537, 3537, 3537, 3537, 3537, 3537, 3537, 3581, 3913, 3581, - 3913, 3581, 3913, 3581, 3581, 3581, 3581, 3611, 3611, 3913, - 3611, 3611, 3913, 3611, 3611, 3611, 3611, 3611, 3611, 3611, - 3611, 3611, 3611, 3611, 3612, 3612, 3913, 3612, 3612, 3913, - 3612, 3612, 3612, 3612, 3612, 3612, 3612, 3612, 3612, 3612, - 3612, 3615, 3615, 3615, 3615, 3615, 3615, 3615, 3615, 3615, - 3615, 3615, 3615, 3615, 3615, 3615, 3615, 3615, 3615, 3649, + 2299, 3965, 2299, 2299, 3965, 3965, 2299, 2299, 2299, 2299, + 2299, 2299, 2299, 2299, 2299, 2299, 2299, 2299, 2886, 2886, + 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2886, + 2886, 2886, 2886, 2886, 2886, 2886, 2506, 2506, 2506, 2506, + 2506, 2506, 2506, 2506, 2506, 2506, 2506, 2506, 2506, 2506, + 2506, 2506, 2506, 2506, 2705, 2705, 2705, 2705, 2705, 2705, + 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, + 2705, 2705, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, + 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, + 3117, 3117, 3965, 3117, 3117, 3965, 3117, 3117, 3117, 3117, - 3913, 3649, 3913, 3649, 3913, 3649, 3649, 3649, 3649, 3653, - 3653, 3913, 3653, 3653, 3653, 3653, 3653, 3653, 3653, 3653, - 3653, 3653, 3653, 3653, 3653, 3653, 3653, 3664, 3664, 3913, - 3664, 3664, 3913, 3664, 3664, 3664, 3664, 3664, 3664, 3664, - 3664, 3664, 3664, 3664, 3666, 3666, 3913, 3913, 3666, 3666, - 3666, 3666, 3666, 3913, 3666, 3666, 3666, 3666, 3666, 3666, - 3666, 3666, 3655, 3655, 3913, 3655, 3655, 3913, 3655, 3655, - 3655, 3655, 3655, 3655, 3655, 3655, 3655, 3655, 3655, 3714, - 3913, 3913, 3913, 3913, 3913, 3714, 3714, 3714, 3913, 3714, - 3714, 3714, 3714, 3714, 3714, 3714, 3714, 3657, 3913, 3913, + 3117, 3117, 3117, 3117, 3117, 3117, 3117, 3120, 3965, 3965, + 3120, 3120, 3965, 3965, 3120, 3965, 3120, 3965, 3120, 3120, + 3120, 3120, 3123, 3123, 3123, 3123, 3965, 3123, 3123, 3123, + 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, + 3138, 3965, 3965, 3965, 3965, 3965, 3138, 3138, 3138, 3965, + 3138, 3138, 3138, 3138, 3138, 3138, 3138, 3138, 3215, 3215, + 3215, 3215, 3215, 3215, 3215, 3215, 3215, 3215, 3215, 3215, + 3215, 3215, 3215, 3215, 3215, 3215, 3258, 3965, 3258, 3965, + 3258, 3258, 3258, 3258, 3280, 3280, 3965, 3280, 3280, 3965, + 3280, 3280, 3280, 3280, 3280, 3280, 3280, 3280, 3280, 3280, - 3913, 3913, 3913, 3657, 3657, 3657, 3913, 3657, 3657, 3657, - 3657, 3657, 3657, 3657, 3657, 3717, 3913, 3913, 3717, 3717, - 3913, 3913, 3717, 3913, 3717, 3913, 3717, 3717, 3717, 3717, - 3720, 3720, 3913, 3720, 3720, 3913, 3720, 3720, 3720, 3720, - 3720, 3720, 3720, 3720, 3720, 3720, 3720, 3721, 3913, 3913, - 3913, 3913, 3913, 3721, 3721, 3721, 3913, 3721, 3721, 3721, - 3721, 3721, 3721, 3721, 3721, 3757, 3913, 3757, 3913, 3757, - 3757, 3757, 3757, 3758, 3758, 3913, 3758, 3758, 3913, 3758, - 3758, 3758, 3758, 3758, 3758, 3758, 3758, 3758, 3758, 3758, - 3759, 3759, 3759, 3759, 3759, 3759, 3759, 3759, 3759, 3759, + 3280, 3363, 3965, 3965, 3363, 3363, 3965, 3965, 3965, 3965, + 3965, 3965, 3363, 3379, 3379, 3965, 3965, 3965, 3379, 3379, + 3379, 3379, 3379, 3379, 3379, 3379, 3379, 3379, 3379, 3379, + 3379, 3486, 3486, 3965, 3486, 3486, 3965, 3486, 3486, 3486, + 3486, 3486, 3486, 3486, 3486, 3486, 3486, 3486, 3496, 3496, + 3965, 3496, 3496, 3965, 3496, 3496, 3496, 3496, 3496, 3496, + 3496, 3496, 3496, 3496, 3496, 3572, 3572, 3965, 3572, 3572, + 3572, 3572, 3572, 3572, 3572, 3572, 3572, 3572, 3572, 3572, + 3572, 3572, 3575, 3575, 3965, 3575, 3575, 3575, 3575, 3575, + 3575, 3575, 3575, 3575, 3575, 3575, 3575, 3575, 3575, 3620, - 3759, 3759, 3759, 3759, 3759, 3759, 3759, 3759, 3803, 3803, - 3913, 3803, 3803, 3913, 3803, 3803, 3803, 3803, 3803, 3803, - 3803, 3803, 3803, 3803, 3803, 3806, 3806, 3913, 3913, 3806, - 3806, 3806, 3806, 3806, 3913, 3806, 3806, 3806, 3806, 3806, - 3806, 3806, 3806, 3808, 3808, 3913, 3913, 3808, 3808, 3808, - 3808, 3808, 3913, 3808, 3808, 3808, 3808, 3808, 3808, 3808, - 3808, 3835, 3835, 3913, 3835, 3835, 3913, 3835, 3835, 3835, - 3835, 3835, 3835, 3835, 3835, 3835, 3835, 3835, 3836, 3836, - 3913, 3836, 3836, 3913, 3836, 3836, 3836, 3836, 3836, 3836, - 3836, 3836, 3836, 3836, 3836, 3837, 3837, 3913, 3913, 3837, + 3965, 3620, 3965, 3620, 3965, 3620, 3620, 3620, 3620, 3651, + 3651, 3965, 3651, 3651, 3965, 3651, 3651, 3651, 3651, 3651, + 3651, 3651, 3651, 3651, 3651, 3651, 3652, 3652, 3965, 3652, + 3652, 3965, 3652, 3652, 3652, 3652, 3652, 3652, 3652, 3652, + 3652, 3652, 3652, 3655, 3655, 3655, 3655, 3655, 3655, 3655, + 3655, 3655, 3655, 3655, 3655, 3655, 3655, 3655, 3655, 3655, + 3655, 3690, 3965, 3690, 3965, 3690, 3965, 3690, 3690, 3690, + 3690, 3694, 3694, 3965, 3694, 3694, 3694, 3694, 3694, 3694, + 3694, 3694, 3694, 3694, 3694, 3694, 3694, 3694, 3694, 3705, + 3705, 3965, 3705, 3705, 3965, 3705, 3705, 3705, 3705, 3705, - 3837, 3837, 3837, 3837, 3913, 3837, 3837, 3837, 3837, 3837, - 3837, 3837, 3837, 3839, 3839, 3913, 3913, 3839, 3839, 3839, - 3839, 3839, 3913, 3839, 3839, 3839, 3839, 3839, 3839, 3839, - 3839, 3853, 3913, 3853, 3913, 3853, 3913, 3853, 3853, 3853, - 3853, 3855, 3855, 3913, 3855, 3855, 3855, 3855, 3855, 3855, - 3855, 3855, 3855, 3855, 3855, 3855, 3855, 3855, 3865, 3865, - 3913, 3865, 3865, 3913, 3865, 3865, 3865, 3865, 3865, 3865, - 3865, 3865, 3865, 3865, 3865, 3866, 3866, 3913, 3866, 3866, - 3913, 3866, 3866, 3866, 3866, 3866, 3866, 3866, 3866, 3866, - 3866, 3866, 3878, 3913, 3878, 3913, 3878, 3913, 3878, 3878, + 3705, 3705, 3705, 3705, 3705, 3705, 3707, 3707, 3965, 3965, + 3707, 3707, 3707, 3707, 3707, 3965, 3707, 3707, 3707, 3707, + 3707, 3707, 3707, 3707, 3696, 3696, 3965, 3696, 3696, 3965, + 3696, 3696, 3696, 3696, 3696, 3696, 3696, 3696, 3696, 3696, + 3696, 3757, 3965, 3965, 3965, 3965, 3965, 3757, 3757, 3757, + 3965, 3757, 3757, 3757, 3757, 3757, 3757, 3757, 3757, 3698, + 3965, 3965, 3965, 3965, 3965, 3698, 3698, 3698, 3965, 3698, + 3698, 3698, 3698, 3698, 3698, 3698, 3698, 3760, 3965, 3965, + 3760, 3760, 3965, 3965, 3760, 3965, 3760, 3965, 3760, 3760, + 3760, 3760, 3763, 3763, 3965, 3763, 3763, 3965, 3763, 3763, - 3878, 3878, 3879, 3913, 3913, 3913, 3913, 3913, 3879, 3879, - 3879, 3913, 3879, 3879, 3879, 3879, 3879, 3879, 3879, 3879, - 75, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 3763, 3763, 3763, 3763, 3763, 3763, 3763, 3763, 3763, 3764, + 3965, 3965, 3965, 3965, 3965, 3764, 3764, 3764, 3965, 3764, + 3764, 3764, 3764, 3764, 3764, 3764, 3764, 3802, 3965, 3802, + 3965, 3802, 3802, 3802, 3802, 3803, 3803, 3965, 3803, 3803, + 3965, 3803, 3803, 3803, 3803, 3803, 3803, 3803, 3803, 3803, + 3803, 3803, 3804, 3804, 3804, 3804, 3804, 3804, 3804, 3804, + 3804, 3804, 3804, 3804, 3804, 3804, 3804, 3804, 3804, 3804, + 3850, 3850, 3965, 3850, 3850, 3965, 3850, 3850, 3850, 3850, + 3850, 3850, 3850, 3850, 3850, 3850, 3850, 3853, 3853, 3965, + 3965, 3853, 3853, 3853, 3853, 3853, 3965, 3853, 3853, 3853, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913 + 3853, 3853, 3853, 3853, 3853, 3855, 3855, 3965, 3965, 3855, + 3855, 3855, 3855, 3855, 3965, 3855, 3855, 3855, 3855, 3855, + 3855, 3855, 3855, 3883, 3883, 3965, 3883, 3883, 3965, 3883, + 3883, 3883, 3883, 3883, 3883, 3883, 3883, 3883, 3883, 3883, + 3884, 3884, 3965, 3884, 3884, 3965, 3884, 3884, 3884, 3884, + 3884, 3884, 3884, 3884, 3884, 3884, 3884, 3885, 3885, 3965, + 3965, 3885, 3885, 3885, 3885, 3885, 3965, 3885, 3885, 3885, + 3885, 3885, 3885, 3885, 3885, 3887, 3887, 3965, 3965, 3887, + 3887, 3887, 3887, 3887, 3965, 3887, 3887, 3887, 3887, 3887, + 3887, 3887, 3887, 3901, 3965, 3901, 3965, 3901, 3965, 3901, + + 3901, 3901, 3901, 3903, 3903, 3965, 3903, 3903, 3903, 3903, + 3903, 3903, 3903, 3903, 3903, 3903, 3903, 3903, 3903, 3903, + 3914, 3914, 3965, 3914, 3914, 3965, 3914, 3914, 3914, 3914, + 3914, 3914, 3914, 3914, 3914, 3914, 3914, 3915, 3915, 3965, + 3915, 3915, 3965, 3915, 3915, 3915, 3915, 3915, 3915, 3915, + 3915, 3915, 3915, 3915, 3927, 3965, 3927, 3965, 3927, 3965, + 3927, 3927, 3927, 3927, 3928, 3965, 3965, 3965, 3965, 3965, + 3928, 3928, 3928, 3965, 3928, 3928, 3928, 3928, 3928, 3928, + 3928, 3928, 75, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965 } ; -static const flex_int16_t yy_chk[14209] = +static const flex_int16_t yy_chk[14371] = { 0, 0, 1, 1, 1, 1, 5, 1, 1, 5, 6, 95, 95, 6, 0, 1, 7, 7, 7, 7, 7, - 7, 0, 9, 9, 7, 9, 9, 13, 7, 1186, - 1, 13, 1, 1, 3891, 83, 13, 1, 1, 1, - 116, 116, 14, 1, 1, 1, 14, 1, 1, 3879, - 9, 14, 1, 872, 15, 15, 1, 15, 1, 872, + 7, 0, 9, 9, 7, 9, 9, 13, 7, 1191, + 1, 13, 1, 1, 3941, 83, 13, 1, 1, 1, + 116, 116, 14, 1, 1, 1, 14, 1, 1, 3928, + 9, 14, 1, 874, 15, 15, 1, 15, 1, 874, 1, 1, 15, 83, 15, 1, 1, 1, 71, 84, - 7, 1, 1, 1, 1186, 1, 1, 9, 132, 132, + 7, 1, 1, 1, 1191, 1, 1, 9, 132, 132, 1, 2, 2, 2, 2, 71, 2, 2, 10, 10, 72, 10, 10, 85, 2, 21, 21, 84, 21, 7, 7, 86, 11, 11, 49, 11, 11, 72, 49, 15, - 2, 49, 2, 2, 87, 3866, 10, 2, 2, 2, - 88, 85, 773, 2, 2, 2, 89, 2, 2, 86, - 11, 92, 2, 250, 118, 250, 2, 118, 2, 773, - 2, 2, 87, 10, 3865, 2, 2, 2, 88, 3855, + 2, 49, 2, 2, 87, 3915, 10, 2, 2, 2, + 88, 85, 774, 2, 2, 2, 89, 2, 2, 86, + 11, 92, 2, 250, 118, 250, 2, 118, 2, 774, + 2, 2, 87, 10, 3914, 2, 2, 2, 88, 3903, 21, 2, 2, 2, 89, 2, 2, 11, 49, 92, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, @@ -3451,8 +3483,8 @@ static const flex_int16_t yy_chk[14209] = 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, 8, 8, 8, 8, 8, 93, 12, 12, 8, 12, 12, - 3836, 8, 16, 16, 2282, 16, 17, 17, 3835, 17, - 16, 17, 16, 47, 17, 47, 18, 18, 2282, 18, + 3884, 8, 16, 16, 2297, 16, 17, 17, 3883, 17, + 16, 17, 16, 47, 17, 47, 18, 18, 2297, 18, 47, 18, 93, 12, 18, 19, 19, 137, 19, 137, 19, 20, 20, 19, 20, 257, 20, 257, 19, 20, @@ -3460,12 +3492,12 @@ static const flex_int16_t yy_chk[14209] = 12, 220, 81, 297, 90, 33, 33, 16, 33, 100, 33, 17, 90, 33, 297, 27, 27, 47, 27, 94, 27, 18, 8, 8, 137, 27, 35, 35, 27, 35, - 19, 27, 90, 3826, 35, 91, 20, 100, 28, 28, + 19, 27, 90, 3873, 35, 91, 20, 100, 28, 28, 90, 28, 27, 28, 48, 101, 81, 139, 28, 139, 22, 28, 91, 388, 28, 220, 29, 29, 104, 29, - 33, 29, 3796, 91, 29, 28, 29, 107, 143, 29, - 27, 143, 29, 101, 30, 30, 3794, 30, 108, 30, - 91, 35, 30, 29, 30, 3790, 104, 30, 36, 36, + 33, 29, 3842, 91, 29, 28, 29, 107, 143, 29, + 27, 143, 29, 101, 30, 30, 3840, 30, 108, 30, + 91, 35, 30, 29, 30, 3836, 104, 30, 36, 36, 30, 36, 388, 28, 139, 107, 36, 213, 213, 27, 27, 30, 223, 223, 31, 31, 108, 31, 109, 31, @@ -3475,10 +3507,10 @@ static const flex_int16_t yy_chk[14209] = 34, 32, 34, 36, 34, 114, 65, 34, 39, 39, 39, 39, 32, 39, 115, 40, 40, 40, 40, 31, 40, 39, 105, 140, 105, 45, 196, 219, 40, 196, - 219, 46, 219, 114, 65, 195, 195, 195, 195, 3789, - 32, 225, 115, 3782, 225, 226, 226, 265, 265, 97, + 219, 46, 219, 114, 65, 195, 195, 195, 195, 3835, + 32, 225, 115, 3828, 225, 226, 226, 265, 265, 97, - 105, 140, 105, 3760, 34, 37, 37, 37, 37, 37, + 105, 140, 105, 3805, 34, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, @@ -3489,58 +3521,58 @@ static const flex_int16_t yy_chk[14209] = 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 41, 41, 41, 41, 147, 41, 42, 42, - 42, 42, 153, 42, 43, 43, 43, 43, 3757, 43, + 42, 42, 153, 42, 43, 43, 43, 43, 3802, 43, 44, 44, 44, 44, 50, 44, 102, 66, 50, 59, 66, 50, 286, 286, 147, 66, 73, 60, 102, 73, 153, 73, 129, 74, 73, 129, 74, 283, 74, 66, 283, 74, 315, 318, 102, 315, 318, 41, 73, 185, 59, 67, 59, 42, 185, 74, 102, 173, 60, 43, - 60, 59, 59, 59, 59, 44, 2686, 66, 50, 60, + 60, 59, 59, 59, 59, 44, 2706, 66, 50, 60, 60, 60, 60, 68, 77, 77, 73, 77, 59, 348, 59, 183, 67, 74, 67, 173, 60, 129, 60, 59, 59, 59, 59, 67, 67, 67, 67, 60, 60, 60, - 60, 185, 99, 484, 68, 99, 68, 103, 2686, 183, + 60, 185, 99, 484, 68, 99, 68, 103, 2706, 183, 67, 106, 67, 111, 103, 68, 68, 68, 68, 189, - 110, 67, 67, 67, 67, 106, 348, 3748, 111, 77, + 110, 67, 67, 67, 67, 106, 348, 3793, 111, 77, 99, 106, 68, 99, 68, 103, 110, 112, 177, 106, - 177, 111, 103, 68, 68, 68, 68, 189, 110, 3721, + 177, 111, 103, 68, 68, 68, 68, 189, 110, 3764, 113, 309, 112, 106, 113, 113, 111, 484, 145, 106, - 198, 145, 309, 2852, 110, 112, 119, 119, 119, 119, + 198, 145, 309, 2874, 110, 112, 119, 119, 119, 119, 201, 119, 120, 120, 120, 120, 179, 120, 113, 179, 112, 177, 113, 113, 121, 121, 121, 121, 198, 121, 126, 126, 126, 126, 199, 126, 203, 133, 201, 138, - 133, 199, 138, 142, 142, 2852, 187, 138, 145, 138, + 133, 199, 138, 142, 142, 2874, 187, 138, 145, 138, 142, 187, 142, 199, 133, 133, 148, 148, 436, 436, 148, 119, 199, 148, 203, 133, 179, 120, 133, 199, - 144, 156, 156, 144, 156, 144, 3714, 181, 144, 121, + 144, 156, 156, 144, 156, 144, 3757, 181, 144, 121, 181, 199, 133, 133, 205, 126, 131, 131, 131, 131, 131, 131, 208, 131, 138, 211, 131, 142, 187, 405, 131, 149, 131, 131, 149, 131, 131, 131, 188, 149, 148, 188, 205, 642, 131, 131, 131, 131, 131, 131, - 208, 131, 3685, 211, 131, 144, 156, 181, 131, 151, + 208, 131, 3727, 211, 131, 144, 156, 181, 131, 151, 131, 131, 151, 131, 131, 131, 150, 151, 405, 150, 494, 150, 157, 157, 150, 157, 155, 155, 200, 150, 155, 149, 642, 155, 159, 159, 159, 159, 155, 162, 162, 200, 162, 188, 162, 166, 166, 212, 166, 346, - 166, 346, 162, 875, 380, 3683, 200, 380, 166, 151, - 169, 166, 3647, 169, 210, 169, 162, 210, 169, 200, - 435, 150, 166, 435, 494, 212, 2865, 157, 167, 167, - 155, 167, 169, 167, 867, 168, 168, 230, 168, 159, - 168, 167, 875, 202, 162, 210, 346, 1386, 168, 186, + 166, 346, 162, 877, 380, 3725, 200, 380, 166, 151, + 169, 166, 3688, 169, 210, 169, 162, 210, 169, 200, + 435, 150, 166, 435, 494, 212, 2887, 157, 167, 167, + 155, 167, 169, 167, 869, 168, 168, 230, 168, 159, + 168, 167, 877, 202, 162, 210, 346, 1393, 168, 186, 166, 170, 186, 202, 170, 167, 170, 186, 206, 170, - 169, 170, 168, 3642, 170, 230, 206, 171, 2865, 235, + 169, 170, 168, 3683, 170, 230, 206, 171, 2887, 235, - 171, 202, 171, 162, 162, 171, 903, 359, 170, 166, + 171, 202, 171, 162, 162, 171, 905, 359, 170, 166, 166, 202, 224, 167, 414, 224, 206, 224, 174, 171, - 168, 174, 1386, 174, 206, 176, 174, 235, 176, 174, - 176, 243, 867, 176, 186, 176, 170, 498, 176, 2057, - 174, 2057, 167, 167, 178, 178, 521, 171, 178, 168, + 168, 174, 1393, 174, 206, 176, 174, 235, 176, 174, + 176, 243, 869, 176, 186, 176, 170, 498, 176, 2070, + 174, 2070, 167, 167, 178, 178, 521, 171, 178, 168, 168, 178, 176, 178, 359, 180, 178, 521, 180, 243, - 180, 414, 244, 180, 3616, 184, 184, 224, 174, 184, - 178, 3612, 184, 903, 190, 190, 190, 486, 486, 197, + 180, 414, 244, 180, 3656, 184, 184, 224, 174, 184, + 178, 3652, 184, 905, 190, 190, 190, 486, 486, 197, 176, 190, 192, 192, 192, 192, 204, 245, 197, 209, 244, 498, 197, 209, 207, 192, 246, 197, 178, 209, @@ -3551,7 +3583,7 @@ static const flex_int16_t yy_chk[14209] = 214, 214, 214, 214, 217, 217, 217, 217, 218, 218, 218, 218, 227, 218, 221, 221, 221, 221, 247, 221, 222, 222, 222, 222, 236, 222, 248, 236, 251, 253, - 228, 251, 260, 2058, 254, 2058, 251, 254, 231, 269, + 228, 251, 260, 2071, 254, 2071, 251, 254, 231, 269, 232, 423, 254, 270, 258, 233, 247, 258, 267, 258, 251, 267, 258, 271, 248, 214, 254, 253, 272, 217, @@ -3567,1425 +3599,1442 @@ static const flex_int16_t yy_chk[14209] = 301, 302, 313, 314, 323, 327, 303, 323, 327, 323, 304, 305, 507, 307, 304, 325, 304, 308, 325, 310, - 325, 306, 306, 328, 329, 311, 312, 330, 332, 3611, - 313, 314, 319, 319, 319, 319, 885, 319, 320, 320, + 325, 306, 306, 328, 329, 311, 312, 330, 332, 3651, + 313, 314, 319, 319, 319, 319, 887, 319, 320, 320, 320, 320, 335, 320, 321, 321, 321, 321, 333, 321, 331, 328, 329, 331, 336, 330, 332, 335, 337, 507, - 327, 338, 333, 333, 334, 1113, 334, 339, 340, 341, - 335, 1113, 340, 342, 344, 337, 333, 442, 331, 345, - 337, 331, 336, 345, 745, 335, 337, 319, 3571, 338, + 327, 338, 333, 333, 334, 1117, 334, 339, 340, 341, + 335, 1117, 340, 342, 344, 337, 333, 442, 331, 345, + 337, 331, 336, 345, 746, 335, 337, 319, 3610, 338, 333, 333, 334, 320, 334, 339, 340, 341, 343, 321, - 340, 342, 344, 337, 885, 442, 349, 345, 337, 349, + 340, 342, 344, 337, 887, 442, 349, 345, 337, 349, 369, 345, 343, 343, 349, 369, 349, 350, 350, 351, 353, 351, 354, 353, 350, 355, 343, 355, 353, 354, - 353, 354, 356, 362, 360, 356, 362, 360, 745, 360, + 353, 354, 356, 362, 360, 356, 362, 360, 746, 360, 343, 343, 360, 361, 361, 363, 364, 514, 363, 364, 361, 364, 365, 443, 364, 366, 365, 369, 366, 365, - 2259, 349, 2259, 366, 372, 370, 351, 372, 370, 3025, + 2274, 349, 2274, 366, 372, 370, 351, 372, 370, 3050, 370, 350, 355, 370, 441, 353, 354, 441, 370, 371, 371, 443, 356, 362, 373, 374, 371, 373, 374, 360, 374, 371, 373, 374, 514, 363, 375, 361, 374, 444, 375, 364, 524, 375, 411, 366, 365, 411, 375, 376, - 376, 3025, 376, 524, 372, 377, 377, 445, 377, 398, + 376, 3050, 376, 524, 372, 377, 377, 445, 377, 398, 370, 379, 379, 379, 379, 381, 381, 444, 381, 384, - 384, 446, 384, 371, 373, 1106, 382, 382, 398, 382, + 384, 446, 384, 371, 373, 1110, 382, 382, 398, 382, 374, 382, 384, 395, 474, 445, 395, 474, 395, 382, 375, 395, 386, 386, 411, 386, 384, 386, 447, 446, - 2609, 416, 416, 382, 376, 386, 398, 2790, 416, 448, + 2628, 416, 416, 382, 376, 386, 398, 2811, 416, 448, 377, 488, 387, 387, 488, 387, 379, 387, 483, 386, 381, 483, 421, 483, 384, 387, 447, 421, 387, 389, 389, 382, 389, 395, 389, 390, 390, 448, 390, 387, - 390, 391, 389, 1106, 391, 389, 391, 386, 390, 391, + 390, 391, 389, 1110, 391, 389, 391, 386, 390, 391, - 2609, 426, 426, 384, 384, 416, 389, 2790, 426, 428, + 2628, 426, 426, 384, 384, 416, 389, 2811, 426, 428, 382, 382, 390, 391, 428, 394, 403, 387, 394, 403, - 394, 403, 449, 394, 421, 396, 386, 386, 396, 2260, - 396, 2260, 403, 396, 389, 396, 3555, 394, 396, 417, + 394, 403, 449, 394, 421, 396, 386, 386, 396, 2275, + 396, 2275, 403, 396, 389, 396, 3593, 394, 396, 417, 390, 391, 417, 403, 397, 397, 387, 387, 397, 562, - 449, 397, 396, 397, 399, 426, 397, 399, 3537, 399, + 449, 397, 396, 397, 399, 426, 397, 399, 3575, 399, 562, 428, 399, 389, 389, 394, 427, 427, 427, 390, 390, 403, 425, 427, 401, 425, 399, 401, 402, 401, 396, 402, 401, 402, 401, 565, 402, 401, 402, 417, 418, 402, 487, 418, 402, 487, 565, 487, 397, 403, - 403, 401, 451, 420, 399, 402, 1316, 420, 404, 406, - 420, 404, 406, 404, 406, 3534, 404, 406, 404, 406, + 403, 401, 451, 420, 399, 402, 1322, 420, 404, 406, + 420, 404, 406, 404, 406, 3572, 404, 406, 404, 406, 427, 404, 406, 415, 404, 406, 415, 425, 415, 401, - 451, 415, 856, 402, 409, 404, 406, 409, 431, 409, + 451, 415, 858, 402, 409, 404, 406, 409, 431, 409, 418, 410, 409, 431, 409, 410, 419, 409, 410, 419, 410, 419, 424, 410, 419, 424, 495, 420, 401, 495, - 424, 409, 402, 404, 406, 429, 1325, 410, 429, 430, - 3507, 430, 454, 429, 1316, 455, 430, 456, 415, 856, + 424, 409, 402, 404, 406, 429, 1331, 410, 429, 430, + 3544, 430, 454, 429, 1322, 455, 430, 456, 415, 858, 452, 432, 432, 432, 432, 438, 438, 438, 438, 409, 431, 452, 404, 406, 432, 410, 450, 457, 450, 458, 454, 419, 450, 455, 459, 456, 460, 424, 452, 462, 463, 462, 464, 465, 466, 459, 467, 468, 467, 452, - 429, 469, 464, 430, 450, 457, 450, 458, 471, 472, - 450, 465, 459, 1325, 460, 1320, 432, 462, 463, 462, - 464, 465, 466, 459, 467, 468, 467, 473, 489, 469, - 464, 489, 500, 489, 1323, 500, 471, 472, 3502, 465, - 470, 470, 493, 470, 505, 493, 470, 493, 470, 505, - 470, 470, 470, 520, 470, 473, 470, 470, 470, 470, - 476, 476, 476, 476, 480, 480, 480, 480, 470, 470, - 497, 470, 508, 497, 470, 497, 470, 508, 470, 470, - - 470, 520, 470, 1320, 470, 470, 470, 470, 481, 481, - 481, 481, 482, 482, 482, 482, 505, 482, 485, 485, - 485, 485, 1323, 485, 491, 491, 491, 491, 2792, 491, - 522, 492, 492, 492, 492, 476, 492, 499, 502, 480, - 499, 502, 499, 503, 508, 510, 503, 523, 503, 511, - 510, 515, 511, 516, 515, 525, 516, 532, 522, 2131, - 2131, 531, 528, 481, 531, 528, 542, 482, 557, 531, - 528, 557, 543, 485, 533, 523, 532, 533, 2792, 491, - 544, 545, 533, 525, 528, 535, 492, 539, 535, 539, - 535, 1571, 499, 535, 542, 546, 533, 510, 547, 511, - - 543, 515, 538, 516, 532, 538, 539, 535, 544, 545, - 538, 531, 528, 548, 540, 550, 551, 540, 552, 540, - 553, 555, 540, 546, 533, 556, 547, 558, 559, 560, - 558, 561, 563, 564, 539, 535, 540, 590, 566, 2966, - 590, 548, 567, 550, 551, 1571, 552, 568, 553, 555, - 570, 571, 538, 556, 3491, 3481, 559, 560, 572, 561, - 563, 564, 573, 574, 540, 554, 566, 554, 554, 575, - 567, 554, 554, 554, 576, 568, 3479, 554, 570, 571, - 554, 579, 554, 554, 554, 554, 572, 554, 554, 2966, - 573, 574, 580, 554, 581, 554, 554, 575, 577, 554, - - 554, 554, 576, 578, 578, 554, 582, 583, 554, 579, - 554, 554, 554, 554, 585, 554, 554, 577, 586, 587, - 580, 588, 581, 593, 591, 589, 577, 591, 594, 595, - 596, 578, 578, 598, 582, 583, 589, 599, 600, 588, - 602, 603, 585, 606, 607, 577, 586, 587, 608, 588, - 610, 593, 611, 612, 613, 614, 594, 595, 596, 615, - 616, 598, 617, 618, 619, 599, 600, 588, 602, 603, - 3460, 606, 607, 620, 626, 620, 608, 626, 610, 1932, - 611, 612, 613, 614, 3416, 3409, 623, 615, 616, 623, - 617, 618, 619, 1388, 623, 624, 623, 637, 624, 629, - - 637, 640, 629, 624, 629, 624, 630, 629, 1690, 630, - 632, 630, 638, 632, 630, 638, 639, 639, 632, 639, - 620, 639, 635, 636, 626, 635, 636, 635, 636, 639, - 635, 636, 639, 1932, 645, 635, 636, 646, 1388, 3377, - 640, 623, 674, 639, 645, 682, 733, 645, 646, 733, - 624, 675, 641, 641, 629, 641, 675, 641, 3315, 649, - 632, 630, 649, 669, 649, 641, 669, 649, 641, 640, - 674, 639, 655, 682, 663, 1690, 683, 635, 636, 641, - 684, 649, 663, 643, 643, 662, 643, 3297, 643, 647, - 647, 3281, 647, 663, 647, 662, 643, 685, 662, 643, - - 639, 639, 647, 675, 683, 647, 686, 641, 684, 649, - 643, 655, 2863, 669, 652, 645, 647, 652, 687, 652, - 823, 663, 652, 653, 652, 685, 653, 652, 653, 2863, - 652, 823, 688, 894, 686, 690, 641, 641, 643, 653, - 655, 652, 691, 692, 647, 2262, 687, 2262, 654, 656, - 653, 654, 656, 654, 656, 3275, 654, 656, 654, 656, - 688, 654, 656, 690, 654, 656, 662, 643, 643, 652, - 691, 692, 894, 647, 647, 654, 656, 693, 653, 678, - 679, 657, 678, 679, 657, 664, 657, 678, 664, 657, - 664, 657, 680, 734, 657, 680, 734, 657, 652, 3273, - - 680, 664, 694, 654, 656, 693, 653, 653, 657, 3267, - 658, 659, 664, 658, 659, 658, 659, 3229, 658, 659, - 658, 659, 735, 658, 659, 735, 658, 659, 695, 2465, - 694, 2465, 654, 656, 678, 679, 657, 658, 659, 3196, - 664, 660, 697, 3124, 660, 665, 660, 680, 665, 660, - 665, 660, 1516, 665, 660, 665, 695, 660, 665, 672, - 3159, 665, 672, 698, 672, 658, 659, 672, 660, 664, - 697, 666, 665, 3146, 666, 667, 666, 699, 667, 666, - 667, 666, 701, 667, 666, 667, 737, 736, 667, 737, - 736, 698, 736, 3124, 658, 659, 660, 1516, 666, 702, - - 665, 673, 667, 703, 673, 699, 673, 705, 696, 673, - 701, 706, 707, 708, 672, 696, 696, 696, 696, 696, - 696, 696, 696, 696, 709, 660, 666, 702, 3141, 665, - 667, 703, 710, 712, 713, 705, 714, 715, 716, 706, - 707, 708, 717, 718, 719, 718, 721, 713, 713, 718, - 713, 713, 709, 720, 723, 724, 673, 722, 725, 726, - 710, 712, 713, 728, 714, 715, 716, 722, 720, 732, - 717, 718, 719, 718, 721, 713, 713, 718, 713, 713, - 727, 720, 723, 724, 3111, 722, 725, 726, 729, 727, - 729, 728, 729, 753, 3097, 722, 720, 732, 738, 739, - - 754, 738, 739, 738, 739, 754, 740, 741, 727, 740, - 741, 743, 741, 761, 743, 3052, 729, 727, 729, 744, - 729, 753, 744, 746, 744, 762, 746, 747, 746, 748, - 747, 763, 748, 750, 748, 764, 750, 751, 750, 752, - 751, 761, 752, 758, 752, 774, 758, 766, 775, 776, - 766, 3050, 754, 762, 777, 766, 778, 770, 780, 763, - 770, 781, 770, 764, 782, 770, 783, 784, 801, 766, - 785, 801, 790, 774, 791, 834, 775, 776, 834, 770, - 789, 792, 777, 787, 778, 785, 780, 787, 785, 781, - 788, 787, 782, 758, 783, 784, 786, 766, 785, 789, - - 790, 793, 791, 786, 788, 794, 788, 770, 789, 792, - 786, 787, 795, 785, 797, 787, 785, 793, 788, 787, - 794, 796, 798, 796, 786, 799, 802, 789, 804, 793, - 806, 786, 788, 794, 788, 809, 810, 802, 786, 3048, - 795, 811, 797, 812, 813, 793, 814, 815, 794, 796, - 798, 796, 817, 799, 818, 819, 804, 820, 806, 821, - 822, 824, 825, 809, 810, 826, 828, 802, 829, 811, - 830, 812, 813, 831, 814, 815, 832, 835, 836, 837, - 817, 830, 818, 819, 838, 820, 839, 821, 822, 824, - 825, 840, 830, 826, 828, 841, 829, 842, 843, 844, - - 846, 831, 847, 848, 832, 835, 836, 837, 849, 850, - 847, 851, 838, 852, 839, 853, 854, 855, 859, 840, - 830, 3044, 857, 841, 857, 842, 843, 844, 846, 862, - 847, 848, 858, 3035, 862, 858, 849, 850, 847, 851, - 858, 852, 858, 853, 854, 855, 860, 861, 863, 860, - 861, 863, 861, 864, 865, 861, 864, 865, 864, 881, - 869, 864, 907, 873, 898, 859, 864, 866, 866, 857, - 866, 869, 866, 868, 873, 887, 862, 866, 881, 868, - 866, 887, 908, 866, 904, 908, 910, 858, 871, 871, - 914, 871, 880, 871, 866, 880, 860, 880, 863, 3027, - - 880, 871, 861, 898, 871, 1315, 881, 915, 864, 907, - 976, 882, 916, 976, 882, 871, 882, 917, 914, 882, - 3018, 882, 866, 904, 882, 918, 3008, 882, 919, 888, - 2967, 913, 908, 910, 913, 915, 2965, 888, 882, 869, - 916, 911, 880, 871, 1315, 917, 911, 868, 888, 887, - 1002, 866, 866, 918, 883, 884, 919, 883, 884, 883, - 884, 1002, 883, 884, 883, 884, 882, 883, 884, 920, - 883, 884, 871, 871, 890, 886, 888, 890, 886, 890, - 886, 883, 884, 886, 897, 886, 913, 897, 886, 897, - 890, 886, 897, 911, 995, 882, 912, 920, 923, 912, - - 924, 890, 886, 927, 912, 888, 897, 1326, 891, 883, - 884, 891, 977, 891, 930, 977, 891, 892, 891, 931, - 892, 891, 892, 2961, 891, 1265, 923, 932, 924, 890, - 886, 927, 934, 892, 897, 891, 1265, 997, 883, 884, - 893, 995, 930, 893, 892, 893, 1326, 931, 893, 895, - 893, 912, 895, 893, 895, 932, 893, 895, 890, 895, - 934, 896, 895, 891, 896, 895, 896, 893, 1395, 896, - 935, 896, 892, 936, 896, 899, 895, 896, 899, 1395, - 899, 938, 909, 899, 997, 909, 905, 909, 896, 905, - 909, 905, 891, 939, 905, 893, 905, 899, 935, 905, - - 892, 936, 905, 979, 895, 940, 979, 906, 941, 938, - 906, 942, 906, 905, 921, 906, 896, 906, 944, 921, - 906, 939, 2923, 978, 980, 899, 978, 980, 978, 945, - 946, 921, 947, 940, 906, 948, 941, 909, 949, 942, - 950, 905, 921, 3494, 2886, 3494, 944, 921, 928, 928, - 928, 928, 928, 928, 928, 928, 928, 945, 946, 921, - 947, 951, 906, 948, 951, 952, 949, 953, 950, 954, - 905, 929, 929, 929, 929, 929, 929, 929, 929, 929, - 955, 956, 957, 958, 959, 960, 961, 962, 965, 967, - 964, 968, 951, 952, 964, 953, 966, 954, 969, 966, - - 970, 971, 972, 975, 982, 2875, 999, 982, 955, 956, - 957, 958, 959, 960, 961, 962, 965, 967, 964, 968, - 981, 2874, 964, 981, 966, 981, 969, 966, 970, 971, - 972, 975, 983, 984, 999, 983, 984, 983, 984, 985, - 986, 988, 985, 986, 988, 986, 989, 990, 1000, 989, - 990, 989, 991, 992, 1001, 991, 992, 991, 993, 994, - 996, 993, 994, 993, 998, 996, 1003, 998, 1004, 1003, - 1005, 1006, 1010, 1005, 1003, 1005, 1000, 1011, 1005, 1013, - 1014, 1015, 1001, 1016, 3573, 1017, 3573, 1004, 2858, 1018, - 1006, 1019, 2857, 1020, 1021, 1022, 1023, 1025, 1027, 1028, - - 1010, 1024, 1024, 1024, 1024, 1011, 1026, 1013, 1014, 1015, - 1026, 1016, 996, 1017, 998, 1004, 1003, 1018, 1006, 1019, - 1005, 1020, 1021, 1022, 1023, 1025, 1027, 1028, 1029, 1024, - 1024, 1024, 1024, 1030, 1026, 1031, 1032, 1033, 1026, 1034, - 1035, 1036, 1037, 1039, 1038, 1036, 1040, 1036, 1038, 1041, - 1042, 1043, 1044, 1045, 2848, 1048, 1029, 1049, 3038, 3542, - 1039, 1030, 1051, 1031, 1032, 1033, 1052, 1034, 1035, 1036, - 1037, 1039, 1038, 1036, 1040, 1036, 1038, 1041, 1042, 1043, - 1044, 1045, 1047, 1048, 1053, 1049, 1047, 1050, 1039, 1054, - 1051, 1055, 1056, 1047, 1052, 1047, 1057, 1058, 1050, 1059, - - 3038, 1061, 1062, 1063, 1064, 1065, 1067, 1068, 1069, 3542, - 1047, 1071, 1053, 2807, 1047, 1072, 1074, 1054, 2806, 1055, - 1056, 1047, 1075, 1047, 1057, 1058, 1076, 1059, 1050, 1061, - 1062, 1063, 1064, 1065, 1067, 1068, 1069, 1070, 1070, 1071, - 1077, 1070, 1078, 1072, 1074, 1079, 1070, 1080, 1081, 1082, - 1075, 1083, 1070, 1084, 1076, 1085, 1070, 1086, 1070, 1088, - 1089, 1090, 1091, 1092, 1093, 1070, 1070, 1094, 1077, 1070, - 1078, 1095, 1096, 1079, 1070, 1080, 1081, 1082, 1097, 1083, - 1070, 1084, 1098, 1085, 1070, 1086, 1070, 1088, 1089, 1090, - 1091, 1092, 1093, 1105, 1110, 1094, 1105, 1110, 1124, 1095, - - 1096, 1111, 1104, 1104, 1112, 1104, 1097, 1104, 2797, 1126, - 1098, 1109, 1128, 1129, 1109, 1104, 1109, 1131, 1104, 1109, - 1114, 1109, 1564, 1114, 1109, 1114, 1124, 1109, 1114, 1104, - 1114, 1116, 2791, 1114, 1120, 1133, 1114, 1126, 1109, 1116, - 1128, 1129, 1120, 1112, 3181, 1131, 1115, 1114, 1134, 1115, - 1116, 1115, 2757, 1120, 1115, 1118, 1115, 1104, 1118, 1115, - 1118, 3181, 1115, 1133, 1105, 1110, 1109, 1564, 1111, 1111, - 1136, 1118, 1112, 1115, 1188, 1114, 1134, 1188, 1116, 1704, - 1117, 1120, 1118, 1117, 1135, 1117, 1104, 1104, 1117, 1119, - 1117, 1746, 1119, 1117, 1119, 1109, 1117, 1119, 1136, 1119, - - 1135, 1115, 1119, 1121, 1114, 1119, 1121, 1117, 1121, 1137, - 1118, 1139, 1135, 1141, 1142, 1143, 1119, 1189, 1190, 1121, - 1189, 1190, 1191, 1190, 1704, 1191, 1144, 1145, 1135, 1149, - 1121, 1151, 1154, 1155, 1156, 1117, 1746, 1137, 1140, 1139, - 1157, 1141, 1142, 1143, 1119, 1140, 1140, 1140, 1140, 1140, - 1140, 1140, 1140, 1140, 1144, 1145, 1158, 1149, 1121, 1151, - 1154, 1155, 1156, 1159, 1117, 1160, 1162, 1163, 1157, 1161, - 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1164, 1165, - 1166, 1167, 1168, 1170, 1158, 1169, 1169, 1121, 1171, 1172, - 1173, 1159, 1175, 1160, 1162, 1163, 1176, 1177, 1178, 1179, - - 1181, 1182, 1183, 1184, 1184, 2737, 1164, 1165, 1166, 1167, - 1168, 1170, 1192, 1169, 1169, 1192, 1171, 1172, 1173, 1194, - 1175, 1200, 1194, 1204, 1176, 1177, 1178, 1179, 1181, 1182, - 1183, 1184, 1184, 1193, 1195, 1205, 1193, 1195, 1193, 1195, - 1196, 1197, 1198, 1196, 1197, 1198, 1197, 1199, 1206, 1200, - 1199, 1204, 1213, 1214, 1215, 1217, 1218, 1220, 1221, 1222, - 1223, 1224, 1225, 1205, 1226, 1227, 1228, 1229, 1230, 1231, - 1232, 1233, 1228, 1234, 1235, 1236, 1206, 1237, 1238, 1239, - 1213, 1214, 1215, 1217, 1218, 1220, 1221, 1222, 1223, 1224, - 1225, 1240, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, - - 1228, 1234, 1235, 1236, 1241, 1237, 1238, 1239, 1242, 1243, - 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1240, - 1253, 1254, 1256, 1257, 1258, 1259, 1260, 1261, 1264, 1266, - 2689, 1250, 1241, 1267, 1268, 2678, 1242, 1243, 1244, 1245, - 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1263, 1253, 1254, - 1256, 1257, 1258, 1259, 1260, 1261, 1264, 1266, 1263, 1250, - 1270, 1267, 1268, 1263, 1263, 1271, 1272, 1273, 1275, 1276, - 1277, 1278, 1280, 1282, 1283, 1263, 1284, 1285, 1286, 1287, - 1288, 1290, 1292, 1285, 1293, 1294, 1263, 1295, 1270, 1296, - 1297, 1263, 1263, 1271, 1272, 1273, 1275, 1276, 1277, 1278, - - 1280, 1282, 1283, 1298, 1284, 1285, 1286, 1287, 1288, 1290, - 1292, 1285, 1293, 1294, 1299, 1295, 1300, 1296, 1297, 1301, - 1302, 1303, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, - 1313, 1298, 1314, 1318, 1329, 1328, 1390, 1391, 3188, 1390, - 1391, 1332, 1299, 3575, 1300, 3575, 1328, 1301, 1302, 1303, - 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1322, - 1319, 1324, 1329, 1319, 1324, 1319, 1324, 1322, 1319, 1332, - 1319, 1314, 1318, 1319, 2674, 1333, 1319, 1324, 1322, 1334, - 3188, 1327, 1335, 1330, 1327, 1330, 1327, 1319, 1324, 1327, - 1336, 1327, 1337, 1338, 1327, 1339, 1342, 1327, 1344, 1345, - - 1314, 1318, 1328, 1333, 1346, 1347, 1322, 1334, 1327, 1341, - 1335, 1330, 1341, 1330, 1341, 1319, 1324, 2636, 1336, 1341, - 1337, 1338, 1341, 1339, 1342, 1348, 1344, 1345, 1350, 1349, - 1351, 2635, 1346, 1347, 1353, 1322, 1327, 1392, 1359, 2611, - 1392, 1393, 1392, 1394, 1393, 1324, 1394, 2573, 1361, 1364, - 1365, 1366, 1367, 1348, 1368, 1369, 1350, 1370, 1351, 1349, - 1371, 1372, 1353, 1373, 1341, 1349, 1359, 1360, 1360, 1360, - 1360, 1360, 1360, 1360, 1360, 1360, 1361, 1364, 1365, 1366, - 1367, 1375, 1368, 1369, 1376, 1370, 1377, 1349, 1371, 1372, - 1378, 1373, 1380, 1349, 1381, 1382, 1383, 1384, 1385, 1396, - - 1381, 1397, 1400, 1401, 1402, 1403, 1404, 1402, 1405, 1375, - 1406, 1407, 1376, 1408, 1377, 1409, 1410, 1411, 1378, 1412, - 1380, 1414, 1381, 1382, 1383, 1384, 1385, 1396, 1381, 1397, - 1400, 1401, 1415, 1403, 1404, 1413, 1405, 1416, 1406, 1407, - 1417, 1408, 1418, 1409, 1410, 1411, 1419, 1412, 1413, 1414, - 1420, 1421, 1422, 1413, 1424, 1425, 1423, 1426, 1427, 1428, - 1415, 1429, 1423, 1413, 1423, 1416, 1430, 1423, 1417, 2547, - 1418, 1432, 1433, 1434, 1419, 1435, 1413, 1436, 1420, 1421, - 1422, 1413, 1424, 1425, 1423, 1426, 1427, 1428, 1437, 1429, - 1423, 1438, 1423, 1431, 1430, 1423, 1439, 1431, 1440, 1432, - - 1433, 1434, 1441, 1435, 1431, 1436, 1431, 1431, 1442, 1431, - 1443, 1444, 1445, 1446, 1447, 1448, 1437, 1449, 1450, 1438, - 1451, 1431, 1452, 1457, 1439, 1431, 1440, 1458, 1459, 1460, - 1441, 1461, 1431, 1465, 1431, 1431, 1442, 1431, 1443, 1444, - 1445, 1446, 1447, 1448, 1466, 1449, 1450, 1462, 1451, 1468, - 1452, 1457, 1469, 1467, 1462, 1458, 1459, 1460, 1470, 1461, - 1468, 1465, 1462, 1471, 1472, 1473, 1467, 1462, 1467, 1474, - 1475, 1468, 1466, 1476, 1477, 1462, 1478, 1479, 1480, 1481, - 1469, 1467, 1462, 1482, 1483, 1485, 1470, 1486, 1487, 1488, - 1462, 1471, 1472, 1473, 1467, 1462, 1467, 1474, 1475, 1468, - - 1489, 1476, 1477, 1484, 1478, 1479, 1480, 1481, 1484, 1490, - 1491, 1482, 1483, 1485, 1492, 1486, 1487, 1488, 1493, 1494, - 1497, 1498, 1499, 1495, 1500, 1497, 1501, 1504, 1489, 1503, - 1505, 1484, 1503, 1506, 1503, 1502, 1484, 1490, 1491, 1495, - 1507, 1509, 1492, 1502, 1510, 1503, 1493, 1494, 1497, 1498, - 1499, 1495, 1500, 1497, 1502, 1504, 1503, 1511, 1505, 1512, - 1513, 1506, 1514, 1519, 1522, 2544, 2535, 1495, 1507, 1509, - 1515, 1523, 1510, 1515, 1524, 1515, 1518, 1527, 2533, 1518, - 1515, 1518, 1502, 1515, 1503, 1511, 1518, 1512, 1513, 1518, - 1514, 1519, 1522, 1501, 1501, 1528, 1530, 2500, 1532, 1523, - - 1525, 1538, 1524, 2496, 1525, 1527, 1525, 1526, 1526, 1526, - 1526, 1526, 1526, 1526, 1526, 1526, 1539, 1542, 1543, 1544, - 1545, 1546, 1547, 1528, 1530, 1515, 1532, 1548, 1525, 1538, - 1549, 1518, 1525, 1550, 1525, 1540, 1540, 1540, 1540, 1540, - 1540, 1540, 1540, 1540, 1539, 1542, 1543, 1544, 1545, 1546, - 1547, 1551, 1552, 1553, 1554, 1548, 1555, 1556, 1549, 1557, - 1558, 1550, 1559, 1560, 1561, 1562, 1567, 1568, 1572, 1567, - 1573, 1574, 1569, 1576, 1574, 1577, 1574, 1578, 1579, 1551, - 1552, 1553, 1554, 1569, 1555, 1556, 1581, 1557, 1558, 1582, - 1559, 1560, 1561, 1562, 1583, 1568, 1572, 1580, 1573, 1584, - - 1585, 1576, 1586, 1577, 1580, 1578, 1579, 1587, 1588, 1589, - 1590, 1591, 1592, 1593, 1581, 1594, 1595, 1582, 1596, 1597, - 1598, 1599, 1583, 1600, 1601, 1580, 1602, 1584, 1585, 1603, - 1586, 1604, 1580, 1605, 1606, 1587, 1588, 1589, 1590, 1591, - 1592, 1593, 1607, 1594, 1595, 1608, 1596, 1597, 1598, 1599, - 1609, 1600, 1601, 1610, 1602, 1611, 1612, 1603, 1613, 1604, - 1614, 1605, 1606, 1615, 1616, 1617, 1618, 1619, 1620, 1621, - 1607, 1622, 1623, 1608, 1624, 1626, 1625, 1627, 1609, 1628, - 1630, 1610, 1631, 1611, 1612, 1632, 1613, 1625, 1614, 2494, - 1633, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1634, 1622, - - 1623, 1635, 1624, 1626, 1636, 1627, 1637, 1628, 1630, 1638, - 1631, 1639, 1641, 1632, 1642, 1643, 1644, 1625, 1633, 1645, - 1646, 1651, 1647, 1652, 1649, 1653, 1634, 1655, 1656, 1635, - 1658, 1659, 1636, 1647, 1637, 1649, 1663, 1638, 2493, 1639, - 1641, 1664, 1642, 1643, 1644, 2492, 1665, 1645, 1646, 1651, - 1647, 1652, 1666, 1653, 1668, 1655, 1656, 1669, 1658, 1659, - 1670, 1647, 1648, 1648, 1663, 1671, 1648, 1672, 1648, 1664, - 1673, 1674, 1648, 1648, 1665, 1675, 1648, 1676, 1677, 1678, - 1666, 1648, 1668, 1679, 1680, 1669, 1681, 1682, 1670, 1683, - 1648, 1648, 1685, 1671, 1648, 1672, 1648, 1686, 1673, 1674, - - 1648, 1648, 1683, 1675, 1648, 1676, 1677, 1678, 1687, 1648, - 1684, 1679, 1680, 1684, 1681, 1682, 1688, 1683, 1689, 1692, - 1685, 1693, 1695, 1696, 1697, 1686, 1698, 1699, 1700, 1706, - 1683, 1710, 1702, 1711, 2485, 1702, 1687, 1702, 1684, 1698, - 1713, 1684, 1702, 2473, 1688, 1702, 1689, 1692, 2471, 1693, - 1695, 1696, 1697, 1714, 1698, 1699, 1700, 1706, 1715, 1710, - 1716, 1711, 1712, 1717, 1722, 1717, 1719, 1698, 1713, 1712, - 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1719, 1724, - 1724, 1714, 1725, 1719, 1726, 1727, 1715, 1702, 1716, 1728, - 1729, 1717, 1722, 1717, 1719, 1723, 1723, 1723, 1723, 1723, - - 1723, 1723, 1723, 1723, 1730, 1731, 1719, 1724, 1724, 1732, - 1725, 1719, 1726, 1727, 1734, 1735, 1737, 1728, 1729, 1736, - 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1737, 1745, 1736, - 1747, 1751, 1730, 1731, 1752, 2470, 1737, 1732, 1755, 1756, - 1736, 1747, 1734, 1735, 1737, 1758, 1759, 1736, 1738, 1739, - 1740, 1741, 1742, 1743, 1744, 1737, 1745, 1736, 1754, 1751, - 1760, 1754, 1752, 1754, 1737, 1761, 1755, 1756, 1736, 1762, - 1763, 1764, 1765, 1758, 1759, 1766, 1767, 1768, 1769, 1770, - 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1760, 1779, - 1780, 1781, 1782, 1761, 1769, 1784, 2469, 1762, 1763, 1764, - - 1765, 1785, 1786, 1766, 1767, 1768, 1769, 1770, 1771, 1772, - 1773, 1774, 1775, 1776, 1777, 1778, 1787, 1779, 1780, 1781, - 1782, 1783, 1769, 1784, 1783, 1788, 1789, 1790, 1791, 1785, - 1786, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, - 1798, 1801, 1797, 1801, 1787, 1802, 1803, 1804, 1801, 1806, - 1807, 1810, 1811, 1788, 1789, 1790, 1791, 1808, 1812, 1792, - 1793, 1794, 1795, 1796, 1797, 1814, 1799, 1800, 1808, 1801, - 1797, 1801, 1815, 1802, 1803, 1804, 1801, 1806, 1807, 1810, - 1811, 1813, 1816, 1817, 1818, 1820, 1812, 1822, 1823, 1824, - 1825, 1826, 1827, 1814, 1828, 1813, 1830, 1831, 1808, 1832, - - 1815, 1833, 1834, 1835, 1836, 2464, 2439, 1829, 1839, 1813, - 1816, 1817, 1818, 1820, 1840, 1822, 1823, 1824, 1825, 1826, - 1827, 1829, 1828, 1841, 1830, 1831, 1843, 1832, 1844, 1833, - 1834, 1835, 1836, 1838, 1838, 1829, 1839, 1849, 1851, 1838, - 1852, 1853, 1840, 1854, 1856, 1857, 1858, 1838, 1859, 1829, - 1838, 1841, 1860, 1861, 1843, 1863, 1844, 1866, 1867, 1868, - 2428, 1838, 1838, 1869, 1870, 1849, 1851, 1838, 1852, 1853, - 1871, 1854, 1856, 1857, 1858, 1838, 1859, 1872, 1838, 1875, - 1860, 1861, 1864, 1863, 1864, 1866, 1867, 1868, 1864, 1874, - 1876, 1869, 1870, 1878, 1873, 1877, 1873, 1879, 1871, 1864, - - 1873, 1864, 1877, 1880, 1881, 1872, 1886, 1875, 1882, 1883, - 1864, 1873, 1864, 1873, 1887, 1890, 1864, 1955, 1876, 1891, - 1955, 1878, 1873, 1877, 1873, 1879, 1892, 1864, 1873, 1864, - 1877, 1880, 1881, 1894, 1874, 1884, 1882, 1883, 1884, 1873, - 1884, 1873, 1895, 1897, 1896, 1884, 1896, 1891, 1884, 1898, - 1899, 1886, 1901, 1902, 1892, 1903, 1906, 1907, 1909, 1887, - 1890, 1894, 1994, 2418, 1910, 1911, 1912, 1913, 1914, 1915, - 1895, 1897, 1896, 1994, 1896, 2416, 2195, 1898, 1899, 1916, - 1901, 1902, 2400, 1903, 1906, 1907, 1909, 2195, 1918, 1919, - 1884, 1904, 1910, 1911, 1912, 1913, 1914, 1915, 1904, 1904, - - 1904, 1904, 1904, 1904, 1904, 1904, 1904, 1916, 1917, 1920, - 1904, 1921, 1904, 1904, 1904, 1917, 1918, 1919, 1904, 1922, - 1923, 1925, 1924, 1904, 1926, 1927, 1928, 1929, 1930, 1931, - 1938, 1940, 1904, 1924, 2384, 2345, 1917, 1920, 1904, 1921, - 1904, 1904, 1904, 1917, 1941, 1942, 1904, 1922, 1923, 1925, - 1924, 1904, 1926, 1927, 1928, 1929, 1930, 1931, 1938, 1940, - 1904, 1924, 1934, 1934, 1934, 1934, 1936, 1936, 1936, 1936, - 1943, 1944, 1941, 1942, 1945, 1946, 1947, 1948, 1949, 1950, - 1951, 1952, 1953, 1956, 1957, 1958, 1959, 1960, 1961, 2343, - 1962, 1964, 1965, 2074, 1966, 1967, 2074, 1969, 1943, 1944, - - 1970, 2330, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, - 1953, 1956, 1957, 1958, 1959, 1960, 1961, 1934, 1962, 1964, - 1965, 1936, 1966, 1967, 1968, 1969, 1971, 1968, 1970, 1968, - 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, - 1982, 1983, 1984, 1985, 1986, 1984, 1987, 1984, 1988, 1989, - 1990, 1991, 1992, 1993, 1971, 1996, 1997, 1998, 1972, 1973, - 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, - 1999, 1985, 1986, 2000, 1987, 2001, 1988, 1989, 1990, 1991, - 1992, 1993, 2002, 1996, 1997, 1998, 2003, 2004, 2005, 2006, - 3643, 2152, 3643, 2008, 2152, 2009, 2152, 2164, 1999, 2010, - - 2164, 2000, 2164, 2001, 2011, 2012, 2013, 3645, 2014, 3645, - 2002, 2015, 2016, 2017, 2003, 2004, 2005, 2006, 2007, 2007, - 2007, 2008, 2007, 2009, 2007, 2007, 2018, 2010, 2007, 2007, - 2007, 2019, 2011, 2012, 2013, 2007, 2014, 2007, 2020, 2015, - 2016, 2017, 2021, 2022, 2023, 2024, 2007, 2007, 2007, 2025, - 2007, 2026, 2007, 2007, 2018, 2027, 2007, 2007, 2007, 2019, - 2028, 2029, 2030, 2007, 2031, 2007, 2020, 2032, 2033, 2036, - 2021, 2022, 2023, 2024, 2037, 2038, 2039, 2025, 2044, 2026, - 2045, 2046, 2047, 2027, 2048, 2049, 2050, 2051, 2028, 2029, - 2030, 2052, 2031, 2052, 2055, 2032, 2033, 2036, 2056, 2059, - - 2061, 2062, 2037, 2038, 2039, 2060, 2044, 2060, 2045, 2046, - 2047, 2063, 2048, 2049, 2050, 2051, 2064, 2288, 2076, 2052, - 2065, 2052, 2055, 2066, 2067, 2068, 2056, 2059, 2077, 2069, - 2070, 2071, 2072, 2060, 2073, 2060, 2078, 2081, 2082, 2083, - 2084, 2085, 2086, 2087, 2064, 2061, 2062, 2088, 2065, 2089, - 2093, 2066, 2067, 2068, 2286, 2285, 2063, 2069, 2070, 2071, - 2072, 2284, 2073, 2076, 2094, 2081, 2082, 2083, 2084, 2085, - 2086, 2087, 2090, 2077, 2090, 2088, 2188, 2089, 2093, 2188, - 2196, 2078, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, - 2092, 2196, 2094, 2095, 2096, 2270, 2097, 2098, 2099, 2096, - - 2090, 2101, 2090, 2091, 2091, 2091, 2091, 2091, 2091, 2091, - 2091, 2091, 2102, 2103, 2104, 2091, 2105, 2091, 2091, 2091, - 2106, 2095, 2096, 2091, 2097, 2098, 2099, 2096, 2091, 2101, - 2107, 2108, 2110, 2111, 2112, 2113, 2114, 2091, 2115, 2116, - 2102, 2103, 2104, 2091, 2105, 2091, 2091, 2091, 2106, 2117, - 2118, 2091, 2119, 2120, 2121, 2123, 2091, 2124, 2107, 2108, - 2110, 2111, 2112, 2113, 2114, 2091, 2115, 2116, 2125, 2126, - 2127, 2130, 2130, 2130, 2130, 2132, 2132, 2117, 2118, 2135, - 2119, 2120, 2121, 2123, 2137, 2124, 2133, 2133, 2133, 2133, - 2134, 2134, 2138, 2139, 2140, 2142, 2125, 2126, 2127, 2143, - - 2144, 3615, 2145, 2146, 2147, 2148, 2149, 2135, 2150, 2151, - 2153, 2154, 2137, 2153, 2155, 2156, 2269, 2268, 2157, 2158, - 2138, 2139, 2140, 2142, 2159, 2160, 2130, 2143, 2144, 2132, - 2145, 2146, 2147, 2148, 2149, 2161, 2150, 2151, 2162, 2154, - 2163, 2133, 2155, 2156, 2134, 2141, 2157, 2158, 2141, 2267, - 2153, 3615, 2159, 2160, 2166, 2167, 2168, 2169, 2170, 2171, - 2172, 2269, 2173, 2161, 2141, 2245, 2162, 2174, 2163, 2175, - 2177, 2178, 2179, 2180, 2183, 2231, 2184, 2141, 2153, 2141, - 2129, 2185, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2141, - 2173, 2141, 2141, 2141, 2186, 2174, 2187, 2175, 2177, 2178, - - 2179, 2180, 2183, 2182, 2184, 2141, 2182, 2141, 2182, 2185, - 2189, 2190, 2191, 2193, 2194, 2197, 2198, 2141, 2199, 2141, - 2141, 2141, 2186, 2200, 2187, 2201, 2202, 2203, 2204, 2205, - 2206, 2207, 2208, 2209, 2210, 2202, 2211, 2212, 2189, 2190, - 2191, 2193, 2194, 2197, 2198, 2214, 2199, 2215, 2213, 2216, - 2221, 2200, 2222, 2201, 2202, 2203, 2204, 2205, 2206, 2207, - 2208, 2209, 2210, 2213, 2211, 2212, 2223, 2224, 2225, 2226, - 2227, 2228, 2229, 2214, 2230, 2215, 2213, 2216, 2221, 2232, - 2222, 2233, 2234, 2235, 2236, 2241, 2242, 2244, 2248, 2249, - 2251, 2213, 2252, 2253, 2223, 2224, 2225, 2226, 2227, 2228, - - 2229, 2254, 2230, 2255, 2256, 2257, 2264, 2232, 2265, 2233, - 2234, 2235, 2236, 2241, 2242, 2244, 2248, 2249, 2251, 2266, - 2252, 2253, 2271, 2273, 2274, 2275, 2276, 2277, 2278, 2254, - 2279, 2255, 2256, 2257, 2264, 2280, 2265, 2281, 2287, 2289, - 2290, 2353, 2291, 2292, 2353, 2293, 2294, 2266, 2295, 2296, - 2298, 2273, 2274, 2275, 2276, 2277, 2278, 2299, 2279, 2283, - 2300, 2128, 2283, 2280, 2283, 2281, 2042, 2271, 2290, 2283, - 2291, 2292, 2283, 2293, 2294, 2302, 2295, 2296, 2298, 2303, - 2304, 2306, 2301, 2287, 2289, 2299, 2283, 2307, 2300, 2301, - 2301, 2301, 2301, 2301, 2301, 2301, 2301, 2301, 2308, 2305, - - 2309, 2310, 2311, 2302, 2305, 2312, 2313, 2303, 2304, 2306, - 2314, 2315, 2316, 2318, 2283, 2307, 2319, 2320, 2322, 2325, - 2327, 2328, 2329, 2331, 2332, 2333, 2308, 2305, 2309, 2310, - 2311, 2334, 2305, 2312, 2313, 2335, 2336, 2337, 2314, 2315, - 2316, 2318, 2340, 2342, 2319, 2320, 2322, 2325, 2327, 2328, - 2329, 2331, 2332, 2333, 2344, 2344, 2347, 2344, 2348, 2334, - 2350, 2351, 2354, 2335, 2336, 2337, 2346, 2346, 2355, 2346, - 2340, 2342, 2352, 2356, 2355, 2352, 2357, 2352, 2358, 2359, - 2360, 2040, 2361, 2362, 2347, 2361, 2348, 2363, 2350, 2351, - 2354, 2364, 2365, 2035, 2366, 2367, 2355, 2368, 2369, 2373, - - 2371, 2356, 2355, 2371, 2357, 2371, 2358, 2359, 2360, 2344, - 2374, 2362, 2375, 2372, 2376, 2363, 2372, 2377, 2372, 2364, - 2365, 2346, 2366, 2367, 2344, 2368, 2369, 2373, 2378, 2379, - 2380, 2382, 2383, 2385, 2382, 2386, 2346, 2387, 2374, 2388, - 2375, 2389, 2376, 2390, 2391, 2377, 2392, 2393, 2394, 2396, - 2397, 2398, 2399, 2401, 2402, 2404, 2378, 2379, 2380, 2403, - 2383, 2385, 2403, 2386, 2405, 2387, 2407, 2388, 2408, 2389, - 2409, 2390, 2391, 2410, 2392, 2393, 2394, 2396, 2397, 2398, - 2399, 2401, 2402, 2404, 2406, 2411, 2414, 2406, 2415, 2406, - 2417, 2419, 2405, 2420, 2407, 2422, 2408, 2423, 2409, 2424, - - 2425, 2410, 2419, 2426, 1954, 2427, 2429, 2430, 2431, 2432, - 2433, 2434, 2436, 2411, 2414, 2437, 2415, 2438, 2417, 2440, - 2441, 2420, 2442, 2422, 2444, 2423, 2445, 2424, 2425, 2446, - 2447, 2426, 2419, 2427, 2429, 2430, 2431, 2432, 2433, 2434, - 2436, 2448, 2449, 2437, 2450, 2438, 2451, 2440, 2441, 2452, - 2442, 2453, 2444, 2454, 2445, 2457, 2458, 2446, 2447, 2459, - 2461, 2462, 2463, 2467, 2468, 2472, 2474, 2475, 2476, 2448, - 2449, 2477, 2450, 2478, 2451, 2479, 2480, 2452, 2481, 2453, - 2482, 2454, 1939, 2457, 2458, 2484, 2488, 2459, 2461, 2462, - 2463, 2467, 2468, 2495, 2499, 2497, 2476, 1935, 2487, 2477, - - 2488, 2478, 1933, 2479, 2480, 2498, 2481, 3707, 2482, 3707, - 2472, 2474, 2475, 2484, 2486, 2487, 2501, 2486, 2502, 2486, - 2489, 2503, 2499, 2489, 2486, 2489, 2490, 2486, 2488, 2490, - 2489, 2490, 2491, 2504, 2505, 2491, 2490, 2491, 2495, 2490, - 2497, 2486, 2491, 2487, 2501, 2491, 2502, 2489, 2506, 2503, - 2498, 2507, 2508, 2490, 2510, 2511, 2512, 2513, 2514, 2491, - 2515, 2504, 2505, 2516, 2517, 2518, 2519, 2520, 2521, 2486, - 2522, 2523, 2524, 2525, 2526, 2489, 2506, 2527, 2528, 2507, - 2508, 2490, 2510, 2511, 2512, 2513, 2514, 2491, 2515, 2529, - 2530, 2516, 2517, 2518, 2519, 2520, 2521, 2531, 2522, 2523, - - 2524, 2525, 2526, 2532, 2534, 2527, 2528, 2536, 2537, 2538, - 2539, 2540, 2541, 2542, 2543, 2550, 2551, 2529, 2530, 2545, - 2545, 2552, 2545, 2548, 2548, 2531, 2548, 2555, 2556, 2557, - 2555, 2532, 2534, 2558, 2559, 2536, 2537, 2538, 2539, 2540, - 2541, 2542, 2543, 2550, 2551, 2560, 1905, 2561, 2562, 2552, - 2564, 2563, 2565, 2564, 2566, 2564, 2556, 2557, 2568, 2569, - 2570, 2558, 2559, 2571, 2572, 1889, 2576, 2577, 2578, 2579, - 2580, 2581, 1888, 2560, 2545, 2561, 2562, 2585, 2548, 2563, - 2565, 2583, 2566, 2583, 2587, 2588, 2568, 2569, 2570, 2545, - 2589, 2571, 2572, 2548, 2576, 2577, 2578, 2579, 2580, 2581, - - 2584, 2590, 2592, 2584, 2593, 2585, 2594, 2595, 2596, 2583, - 2595, 2583, 2587, 2588, 2597, 2598, 2599, 2600, 2589, 2602, - 2603, 2604, 2605, 2605, 2604, 2606, 2604, 2596, 2608, 2590, - 2592, 2608, 2593, 2608, 2594, 2610, 2596, 2612, 2613, 2614, - 2615, 2616, 2597, 2598, 2599, 2600, 2617, 2602, 2603, 2618, - 2605, 2605, 2619, 2606, 2621, 2596, 2622, 2623, 2624, 2625, - 2626, 2627, 2628, 2610, 2629, 2612, 2613, 2614, 2615, 2616, - 2630, 2631, 2632, 2633, 2617, 2634, 2637, 2618, 2638, 2639, - 2619, 2640, 2621, 2641, 2622, 2623, 2624, 2625, 2626, 2627, - 2628, 2642, 2629, 2643, 2644, 2645, 2647, 2648, 2630, 2631, - - 2632, 2633, 2649, 2634, 2637, 2650, 2638, 2639, 2651, 2640, - 2652, 2641, 2654, 2655, 2656, 2658, 2659, 2660, 2661, 2642, - 2662, 2643, 2644, 2645, 2647, 2648, 2663, 2664, 2665, 2667, - 2649, 2668, 2669, 2650, 2670, 2671, 2651, 2672, 2652, 2675, - 2654, 2655, 2656, 2658, 2659, 2660, 2661, 2682, 2662, 2690, - 2679, 2680, 2681, 2675, 2663, 2681, 2692, 2667, 2693, 2668, - 2669, 2676, 2670, 2671, 2676, 2672, 2676, 2679, 2680, 2681, - 2691, 2676, 2664, 2665, 2676, 2682, 2761, 2677, 2694, 2761, - 2677, 2675, 2677, 2696, 2692, 2697, 2693, 2677, 2676, 2698, - 2677, 1885, 2699, 1850, 2690, 2679, 2680, 2683, 2684, 2700, - - 2683, 2684, 2683, 2684, 2677, 1819, 2694, 2683, 2684, 2685, - 2683, 2696, 2685, 2697, 2685, 2691, 2676, 2698, 2687, 2685, - 2699, 2687, 2685, 2687, 2683, 2684, 2701, 2700, 2687, 1750, - 2688, 2687, 2677, 2688, 2702, 2688, 2685, 2703, 2704, 2705, - 2688, 2706, 2707, 2688, 2708, 2687, 2709, 2710, 2711, 2712, - 2714, 2715, 2683, 2684, 2701, 2716, 2717, 2688, 2718, 2719, - 2720, 2721, 2702, 2722, 2685, 2703, 2704, 2705, 2723, 2706, - 2707, 2724, 2708, 2687, 2709, 2710, 2711, 2712, 2714, 2715, - 2725, 2726, 2728, 2716, 2717, 2688, 2718, 2719, 2720, 2721, - 2729, 2722, 2730, 2731, 2732, 2733, 2723, 2735, 2739, 2724, - - 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2749, 2725, 2726, - 2728, 2750, 2751, 2752, 2753, 2754, 2755, 2758, 2729, 2759, - 2730, 2731, 2732, 2733, 2760, 2735, 2739, 2764, 2740, 2741, - 2742, 2743, 2744, 2745, 2746, 2749, 2765, 2768, 2769, 2750, - 2751, 2752, 2753, 2754, 2755, 2758, 2762, 2759, 2767, 2762, - 2770, 2767, 2760, 1749, 2772, 2764, 2773, 2774, 2775, 2771, - 2777, 2778, 2779, 2780, 2765, 2768, 2769, 2771, 2776, 2781, - 2771, 2776, 2771, 2776, 2782, 2783, 2784, 2787, 2788, 2789, - 2793, 2770, 2772, 2794, 2773, 2774, 2775, 2771, 2777, 2778, - 2779, 2780, 2796, 2799, 2800, 2771, 2801, 2781, 2771, 2795, - - 2771, 2798, 2782, 2783, 2784, 2787, 2788, 2789, 2793, 2770, - 2795, 2794, 2798, 2802, 2803, 2804, 2805, 2808, 2809, 2810, - 2796, 2799, 2800, 2811, 2801, 2812, 2813, 2814, 2815, 2816, - 2817, 2808, 2818, 2819, 2820, 2821, 2822, 2813, 2823, 2824, - 2826, 2802, 2803, 2804, 2805, 2808, 2809, 2810, 2827, 2828, - 2829, 2811, 2830, 2812, 2831, 2814, 2815, 2816, 2817, 2832, - 2818, 2819, 2820, 2821, 2822, 2833, 2823, 2824, 2826, 2834, - 2835, 2836, 2837, 2838, 2839, 2840, 2827, 2828, 2829, 2841, - 2830, 2842, 2831, 2843, 2844, 2845, 2846, 2832, 2847, 2851, - 2849, 2876, 2870, 2833, 2859, 2870, 3617, 2834, 2835, 2836, - - 2837, 2838, 2839, 2840, 2873, 2878, 2851, 2841, 2849, 2842, - 1748, 2859, 2844, 2845, 2846, 2879, 2847, 2850, 2849, 2876, - 2850, 2853, 2850, 2860, 2853, 2880, 2853, 2850, 2843, 1721, - 2850, 2853, 2854, 2878, 2851, 2854, 2849, 2854, 2861, 2859, - 2860, 2862, 2854, 2879, 2850, 2854, 3617, 2855, 2853, 2873, - 2855, 2856, 2855, 2880, 2856, 2861, 2856, 2855, 2862, 2854, - 2855, 2856, 1718, 2929, 2856, 2881, 2929, 1709, 2860, 1705, - 2868, 2882, 2850, 2868, 2855, 2868, 2853, 1703, 2856, 2883, - 2868, 2884, 1701, 2861, 1691, 2864, 2862, 2854, 2864, 2885, - 2864, 2866, 2887, 2881, 2866, 2864, 2866, 2868, 2864, 2882, - - 2867, 2866, 2855, 2867, 2866, 2867, 2856, 2883, 1650, 2884, - 2867, 2869, 2864, 2867, 2869, 2888, 2869, 2885, 2866, 2890, - 2887, 2869, 1640, 2871, 2892, 2868, 2871, 2867, 2871, 2872, - 2894, 2895, 2872, 2871, 2872, 2896, 2871, 2898, 2869, 2872, - 2864, 2899, 2872, 2888, 2900, 2901, 2866, 2890, 2902, 2903, - 2871, 2904, 2892, 2905, 2906, 2867, 2872, 2907, 2894, 2895, - 2908, 2912, 2913, 2896, 2915, 2898, 2869, 2916, 2917, 2899, - 2918, 2919, 2900, 2901, 2920, 2922, 2902, 2903, 2871, 2904, - 2924, 2905, 2906, 2925, 2872, 2907, 2926, 2927, 2908, 2912, - 2913, 2928, 2915, 2930, 2932, 2916, 2917, 2933, 2918, 2919, - - 2934, 2935, 2920, 2922, 2935, 2939, 2940, 2936, 2924, 2942, - 2936, 2925, 2936, 2943, 2926, 2927, 2944, 2945, 2946, 2928, - 2947, 2930, 2932, 2948, 2949, 2933, 1570, 2949, 2934, 2953, - 2954, 2947, 2947, 2939, 2940, 2955, 2950, 2942, 2957, 2956, - 2950, 2943, 2956, 2958, 2944, 2945, 2946, 2950, 2947, 2952, - 2959, 2948, 2952, 2960, 2952, 2962, 2963, 2953, 2954, 2947, - 2947, 2964, 2968, 2955, 2950, 2969, 2957, 2972, 2950, 2971, - 2974, 2958, 2975, 2976, 2977, 2950, 2978, 2979, 2959, 2980, - 2971, 2960, 2981, 2962, 2963, 2982, 2982, 2983, 2984, 2964, - 2968, 2985, 2986, 2969, 2987, 2972, 2988, 2990, 2974, 2991, - - 2975, 2976, 2977, 2992, 2978, 2979, 2993, 2980, 2994, 2995, - 2981, 2996, 2997, 2982, 2982, 2983, 2984, 2998, 2999, 2985, - 2986, 3000, 2987, 3001, 2988, 2990, 3003, 2991, 2998, 3004, - 1565, 2992, 3000, 3005, 2993, 3007, 2994, 2995, 3009, 2996, - 2997, 3010, 3011, 3013, 3014, 3015, 2999, 3016, 3017, 3019, - 3020, 3001, 3021, 3023, 3003, 3024, 3029, 3004, 2998, 3029, - 3030, 3005, 3000, 3007, 1563, 1541, 3009, 3021, 3028, 3010, - 3011, 3013, 3014, 3015, 1537, 3016, 3017, 3019, 3020, 3026, - 3021, 3023, 3026, 3024, 3026, 3028, 3036, 3040, 3030, 3026, - 3040, 3031, 3026, 3037, 3031, 3021, 3031, 3032, 3045, 3046, - - 3032, 3031, 3032, 3036, 3031, 3076, 3026, 3032, 3076, 3033, - 3037, 3047, 3033, 3028, 3033, 3049, 3051, 1521, 3031, 3033, - 3034, 3053, 3033, 3034, 3032, 3034, 3045, 3046, 3054, 3055, - 3034, 3036, 3039, 3034, 3026, 3039, 3033, 3039, 3037, 3047, - 3056, 1520, 3039, 3049, 3051, 3039, 3031, 3034, 3088, 3053, - 3041, 3088, 3032, 3041, 3058, 3041, 3054, 3055, 3059, 3039, - 3041, 3060, 3061, 3041, 3033, 1517, 3042, 3062, 3056, 3042, - 3063, 3042, 3064, 3065, 3067, 3034, 3042, 3041, 3068, 3042, - 3069, 3070, 3058, 3072, 3073, 3074, 3059, 3039, 3075, 3060, - 3061, 3077, 3078, 3042, 3079, 3062, 3081, 3082, 3063, 3083, - - 3064, 3065, 3067, 3084, 3085, 3041, 3068, 3087, 3069, 3070, - 3090, 3072, 3073, 3074, 3092, 3115, 3075, 3092, 3115, 3077, - 3078, 3042, 3079, 3086, 3081, 3082, 3086, 3083, 3095, 3096, - 3098, 3084, 3085, 3099, 3094, 3087, 3100, 3094, 3090, 3094, - 3086, 3086, 3086, 3086, 3086, 3086, 3086, 3086, 3086, 3101, - 3102, 3103, 3104, 3105, 3106, 1464, 3095, 3096, 3098, 3243, - 3251, 3099, 3243, 3251, 3100, 3108, 3107, 3109, 3110, 3107, - 3112, 3113, 3114, 3116, 3117, 3118, 3119, 3101, 3102, 3103, - 3104, 3105, 3106, 3107, 3107, 3107, 3107, 3107, 3107, 3107, - 3107, 3107, 3121, 3108, 3122, 3109, 3110, 3123, 3112, 3113, - - 3114, 3116, 3117, 3118, 3119, 3125, 3126, 3128, 3129, 3130, - 3132, 3133, 3135, 3136, 3137, 3138, 3139, 3140, 3142, 3143, - 3121, 3144, 3122, 3145, 3147, 3123, 3148, 3149, 3150, 3152, - 3154, 3157, 3161, 3125, 3126, 3128, 3129, 3130, 3132, 3133, - 3135, 3136, 3137, 3138, 3139, 3140, 3142, 3143, 3163, 3144, - 3160, 3145, 3147, 3165, 3148, 3149, 3150, 3152, 3154, 3157, - 3161, 3160, 3166, 1463, 3167, 3168, 3169, 3170, 3171, 3173, - 3174, 3175, 3176, 3177, 3178, 3216, 3163, 3191, 3216, 3192, - 3216, 3165, 3255, 3193, 3177, 3255, 3257, 3180, 1456, 3257, - 3166, 3160, 3167, 3168, 3169, 3170, 3171, 3173, 3174, 3175, - - 3176, 3177, 3178, 3179, 3180, 3191, 3179, 3192, 3179, 1455, - 3185, 3193, 3177, 3179, 3182, 3183, 3179, 3182, 3183, 3182, - 3183, 1454, 1399, 3184, 3182, 3183, 3184, 3185, 3184, 3194, - 3179, 1398, 3180, 3184, 3186, 3187, 3184, 3186, 3187, 3186, - 3187, 3182, 3183, 1387, 3186, 3187, 3189, 3186, 3187, 3189, - 3184, 3189, 3195, 1363, 3197, 3185, 3189, 3194, 3179, 3189, - 3198, 3186, 3187, 3199, 3201, 3202, 3203, 3204, 3205, 3182, - 3183, 3190, 3206, 3189, 3190, 3209, 3190, 3210, 3184, 3211, - 3195, 3190, 3197, 3212, 3190, 3213, 3214, 3217, 3198, 3186, - 3187, 3199, 3201, 3202, 3203, 3204, 3205, 3218, 3190, 3219, - - 3206, 3189, 3220, 3209, 3221, 3210, 3222, 3211, 3223, 3224, - 3226, 3212, 3228, 3213, 3214, 3217, 3225, 3225, 3225, 3225, - 3225, 3225, 3225, 3225, 3225, 3218, 3190, 3219, 3227, 3230, - 3220, 3227, 3221, 3233, 3222, 3234, 3223, 3224, 3226, 3231, - 3228, 3235, 3231, 3236, 3237, 3227, 3227, 3227, 3227, 3227, - 3227, 3227, 3227, 3227, 3238, 3239, 3240, 3230, 3241, 3244, - 3245, 3233, 3247, 3234, 3248, 3249, 3252, 3253, 3254, 3235, - 3256, 3236, 3237, 3242, 3242, 3242, 3242, 3242, 3242, 3242, - 3242, 3242, 3238, 3239, 3240, 3231, 3241, 3244, 3245, 3258, - 3247, 3259, 3248, 3249, 3252, 3253, 3254, 3260, 3256, 3261, - - 3262, 3263, 3264, 3265, 3266, 3268, 3269, 3270, 3271, 3272, - 3276, 3262, 3277, 3231, 3278, 3279, 3282, 3258, 3283, 3259, - 3284, 3287, 3289, 3290, 3291, 3260, 3292, 3261, 3293, 3263, - 3264, 3265, 3266, 3268, 3269, 3270, 3271, 3272, 3276, 3285, - 3277, 3294, 3278, 3279, 3282, 3295, 3283, 3285, 3284, 3287, - 3289, 3290, 3291, 3296, 3292, 3298, 3293, 3299, 3300, 3301, - 3302, 3303, 3305, 3307, 3310, 3328, 3307, 3285, 3328, 3294, - 3311, 3312, 1362, 3295, 3313, 3285, 1358, 3314, 1357, 3305, - 3317, 3296, 1356, 3298, 3319, 3299, 3300, 3301, 3302, 3303, - 3304, 3306, 3310, 3304, 3306, 3304, 3306, 3321, 3311, 3312, - - 3304, 3306, 3313, 3304, 3306, 3314, 3308, 3305, 3317, 3308, - 3309, 3308, 3319, 3309, 3322, 3309, 3308, 3304, 3306, 3308, - 3309, 3323, 3324, 3309, 3325, 3321, 3327, 3329, 3332, 3333, - 3334, 3335, 3336, 3308, 3337, 3338, 3339, 3309, 3357, 1355, - 3358, 3357, 3322, 3358, 3359, 3304, 3306, 3359, 3362, 3323, - 3324, 3362, 3325, 1354, 3327, 3329, 3332, 3333, 3334, 3335, - 3336, 3308, 3337, 3338, 3339, 3309, 3330, 3330, 3330, 3330, - 3330, 3330, 3330, 3330, 3330, 3330, 3330, 3331, 3331, 3331, - 3331, 3331, 3331, 3331, 3331, 3331, 3331, 3331, 3340, 3342, - 3344, 3330, 3341, 3341, 3341, 3341, 3341, 3341, 3341, 3341, - - 3341, 3346, 3331, 3345, 3348, 3349, 3345, 3350, 3351, 3352, - 3353, 3354, 3355, 3360, 3361, 3363, 3340, 3342, 3344, 3364, - 3345, 3345, 3345, 3345, 3345, 3345, 3345, 3345, 3345, 3346, - 3365, 3366, 3348, 3349, 3366, 3350, 3351, 3352, 3353, 3354, - 3355, 3360, 3361, 3363, 3370, 3367, 3368, 3364, 3367, 3368, - 3372, 3374, 3378, 3379, 3380, 3382, 3383, 1352, 3365, 3385, - 3386, 3387, 3376, 3368, 3368, 3368, 3368, 3368, 3368, 3368, - 3368, 3368, 3370, 3376, 3381, 3388, 3389, 3390, 3372, 3374, - 3378, 3379, 3380, 3382, 3383, 3381, 3384, 3385, 3386, 3387, - 3391, 3392, 3393, 3394, 3384, 3384, 3395, 3396, 3397, 3398, - - 3400, 3401, 3402, 3388, 3389, 3390, 3403, 3404, 3405, 3406, - 3405, 3407, 3408, 3410, 3384, 3411, 3413, 1321, 3391, 3392, - 3393, 3394, 3384, 3384, 3395, 3396, 3397, 3398, 3400, 3401, - 3402, 3414, 3415, 3417, 3403, 3404, 3419, 3406, 3423, 3407, - 3408, 3410, 3412, 3411, 3413, 3412, 3425, 3412, 3427, 3429, - 3430, 3427, 3412, 3431, 3451, 3412, 1317, 3451, 1289, 3414, - 3415, 3417, 1281, 3432, 3419, 3426, 3423, 3433, 3426, 3412, - 3426, 1279, 1274, 3461, 3425, 3428, 3461, 3429, 3430, 3684, - 3405, 3431, 3426, 3426, 3426, 3426, 3426, 3426, 3426, 3426, - 3426, 3432, 3434, 3435, 3437, 3433, 1269, 3412, 3438, 3428, - - 3428, 3428, 3428, 3428, 3428, 3428, 3428, 3428, 3428, 3428, - 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3441, - 3434, 3435, 3437, 3442, 3428, 3443, 3438, 3444, 3445, 3684, - 3446, 3445, 3447, 3448, 3449, 3452, 3453, 3454, 3452, 3453, - 3452, 3453, 3455, 3456, 3457, 3458, 3456, 3441, 3456, 3459, - 3464, 3442, 1212, 3443, 3469, 3444, 3470, 3445, 3446, 3471, - 3447, 3448, 3449, 3510, 3518, 3454, 3510, 3518, 1211, 1210, - 3455, 3462, 3457, 3458, 3462, 1209, 1208, 3459, 3464, 3473, - 3468, 3474, 3469, 3475, 3470, 3445, 3468, 3471, 3462, 3462, - 3462, 3462, 3462, 3462, 3462, 3462, 3462, 3463, 3463, 3463, - - 3463, 3463, 3463, 3463, 3463, 3463, 3476, 3473, 3468, 3474, - 3477, 3475, 3478, 3480, 3468, 3483, 3485, 3486, 3487, 3488, - 3489, 3492, 3493, 3495, 3496, 3511, 3511, 3511, 3511, 3511, - 3511, 3511, 3511, 3511, 3476, 1207, 3498, 3499, 3477, 3500, - 3478, 3480, 3503, 3483, 3485, 3486, 3487, 3488, 3489, 3492, - 3493, 3495, 3496, 3497, 3497, 3497, 3497, 3497, 3497, 3497, - 3497, 3497, 3497, 3497, 3498, 3499, 3504, 3500, 3505, 3506, - 3503, 3508, 3509, 3515, 3516, 3517, 3519, 1203, 3497, 3512, - 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3513, 3520, - 3521, 3513, 3522, 3523, 3504, 3522, 3505, 3506, 3524, 3508, - - 3509, 3515, 3516, 3517, 3519, 3513, 3513, 3513, 3513, 3513, - 3513, 3513, 3513, 3513, 3525, 3527, 3528, 3520, 3521, 3528, - 3529, 3523, 3530, 3531, 3532, 1202, 3524, 3532, 3533, 3719, - 3540, 3541, 3543, 3528, 3528, 3528, 3528, 3528, 3528, 3528, - 3528, 3528, 3525, 3527, 3535, 3544, 3545, 3535, 3529, 3535, - 3530, 3531, 3538, 3532, 1201, 3538, 3533, 3538, 3540, 3541, - 3543, 3593, 3596, 3550, 3593, 3596, 3599, 3660, 3546, 3599, - 3660, 3599, 3660, 3544, 3545, 3547, 1187, 3730, 3547, 3719, - 3730, 3532, 3546, 3546, 3546, 3546, 3546, 3546, 3546, 3546, - 3546, 3550, 3547, 3547, 3547, 3547, 3547, 3547, 3547, 3547, - - 3547, 3548, 3548, 3548, 3548, 3548, 3548, 3548, 3548, 3548, - 3551, 3552, 3554, 3556, 3557, 3558, 3559, 3560, 3561, 3562, - 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3572, 3576, 3591, - 3591, 3591, 3591, 3591, 3591, 3591, 3591, 3591, 3551, 3552, - 3554, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, - 3565, 3566, 3567, 3568, 3569, 3572, 3576, 3577, 3577, 3577, - 3577, 3577, 3577, 3577, 3577, 3577, 3577, 3577, 3578, 3579, - 3580, 3583, 3585, 3586, 3589, 3663, 3589, 3589, 3663, 3589, - 3663, 1185, 3577, 3592, 3594, 3731, 3598, 3589, 3731, 3600, - 3590, 3601, 3602, 3603, 3605, 3606, 3578, 3579, 3580, 3583, - - 3585, 3586, 3590, 3590, 3590, 3590, 3590, 3590, 3590, 3590, - 3590, 3592, 3594, 3595, 3598, 3770, 3595, 3600, 3770, 3601, - 3602, 3603, 3605, 3606, 3609, 3610, 3613, 3618, 3619, 3620, - 3595, 3595, 3595, 3595, 3595, 3595, 3595, 3595, 3595, 3604, - 3604, 3604, 3604, 3604, 3604, 3604, 3604, 3604, 3608, 3622, - 3636, 3608, 3609, 3610, 3613, 3618, 3619, 3620, 3589, 3623, - 3624, 3636, 1180, 1152, 1148, 3608, 3608, 3608, 3608, 3608, - 3608, 3608, 3608, 3608, 3614, 3621, 3626, 3622, 3614, 3627, - 3628, 3629, 3630, 3631, 3632, 3614, 3633, 3623, 3624, 3621, - 3621, 3621, 3621, 3621, 3621, 3621, 3621, 3621, 3634, 3635, - - 3638, 3640, 3614, 3646, 3626, 3637, 3614, 3627, 3628, 3629, - 3630, 3631, 3632, 3614, 3633, 3648, 3637, 3650, 3652, 3653, - 3659, 3653, 3653, 3661, 3653, 3734, 3634, 3635, 3638, 3640, - 3666, 3646, 3653, 3666, 3654, 3666, 3654, 3654, 3668, 3654, - 3669, 3670, 3671, 3648, 3672, 3650, 3652, 3654, 3659, 3673, - 1138, 3661, 3662, 3662, 3662, 3662, 3662, 3662, 3662, 3662, - 3662, 3675, 3676, 3679, 3680, 3681, 3668, 3682, 3669, 3670, - 3671, 3686, 3672, 3687, 3688, 3734, 3689, 3673, 3674, 3674, - 3674, 3674, 3674, 3674, 3674, 3674, 3674, 3690, 3691, 3675, - 3676, 3679, 3680, 3681, 3692, 3682, 3693, 3694, 3696, 3686, - - 3697, 3687, 3688, 3653, 3689, 3698, 3700, 3701, 3704, 3705, - 3709, 3711, 3712, 3715, 3717, 3690, 3691, 3717, 3654, 3717, - 3705, 3722, 3692, 3712, 3693, 3694, 3696, 3723, 3697, 3724, - 3725, 3726, 3727, 3698, 3700, 3701, 3704, 3728, 3709, 3711, - 3712, 3715, 3729, 3732, 3733, 3729, 3735, 3736, 3738, 3722, - 3739, 3712, 3741, 3742, 3743, 3723, 3744, 3724, 3725, 3726, - 3727, 3759, 3745, 3746, 3747, 3728, 3751, 3752, 3753, 3754, - 3756, 3732, 3733, 3761, 3735, 3736, 3738, 3763, 3739, 3764, - 3741, 3742, 3743, 1127, 3744, 3766, 3767, 3768, 3769, 3729, - 3745, 3746, 3747, 3771, 3751, 3752, 3753, 3754, 3756, 3772, - - 3776, 3777, 3772, 3773, 3772, 3763, 3773, 3764, 3773, 3774, - 3778, 3759, 3774, 3766, 3767, 3768, 3769, 3729, 3779, 3775, - 3780, 3771, 3775, 3761, 3783, 3784, 3785, 3786, 3776, 3777, - 3787, 3788, 3791, 3792, 3795, 3797, 3792, 3798, 3778, 3799, - 3801, 3802, 3804, 3805, 3806, 3804, 3779, 3806, 3780, 3806, - 3813, 1125, 3783, 3784, 3785, 3786, 3828, 3815, 3787, 3788, - 3791, 3808, 3816, 3797, 3808, 3798, 3808, 3799, 3801, 3802, - 3810, 3805, 3817, 3810, 3811, 3810, 3819, 3811, 3813, 3811, - 3820, 3821, 3822, 3823, 3795, 3815, 3827, 3824, 3829, 3827, - 3816, 3827, 3830, 3831, 3832, 3830, 3834, 3832, 3824, 3842, - - 3817, 3824, 3837, 3843, 3819, 3837, 3828, 3837, 3820, 3821, - 3822, 3823, 3844, 3845, 3839, 3824, 3829, 3839, 3846, 3839, - 3847, 3831, 3848, 3849, 3834, 3850, 3824, 3842, 3851, 3824, - 3852, 3843, 3856, 3858, 1123, 3856, 3860, 3856, 1122, 3860, - 3844, 3845, 1108, 1107, 1103, 1102, 3846, 3862, 3847, 3859, - 3848, 3849, 3859, 3850, 1101, 1100, 3851, 3867, 3852, 3861, - 3868, 3858, 3861, 3869, 3872, 3874, 3859, 3859, 3859, 3859, - 3859, 3859, 3859, 3859, 3859, 3862, 3861, 3861, 3861, 3861, - 3861, 3861, 3861, 3861, 3861, 3867, 3875, 3876, 3868, 3877, - 3884, 3869, 3872, 3874, 3881, 3881, 3881, 3881, 3881, 3881, - - 3881, 3881, 3881, 3882, 1099, 1060, 3882, 1008, 1007, 987, - 3887, 3888, 3889, 3892, 3875, 3876, 3893, 3877, 3884, 974, - 3882, 3882, 3882, 3882, 3882, 3882, 3882, 3882, 3882, 3883, - 3883, 3883, 3883, 3883, 3883, 3883, 3883, 3883, 3887, 3888, - 3889, 3892, 3900, 3903, 3893, 3896, 3896, 3896, 3896, 3896, - 3896, 3896, 3896, 3896, 3904, 3905, 3906, 3907, 3909, 3910, - 3911, 963, 943, 926, 901, 889, 878, 876, 874, 870, - 3900, 3903, 827, 816, 807, 803, 772, 771, 769, 768, - 767, 765, 3904, 3905, 3906, 3907, 3909, 3910, 3911, 3914, - 3914, 3914, 3914, 3914, 3914, 3914, 3914, 3914, 3914, 3914, - - 3914, 3914, 3914, 3914, 3914, 3914, 3914, 3915, 3915, 3915, - 3915, 3915, 3915, 3915, 3915, 3915, 3915, 3915, 3915, 3915, - 3915, 3915, 3915, 3915, 3915, 3916, 3916, 3916, 3916, 3916, - 3916, 3916, 3916, 3916, 3916, 3916, 3916, 3916, 3916, 3916, - 3916, 3916, 3916, 3917, 3917, 3917, 3917, 3917, 3917, 3917, - 3917, 3917, 3917, 3917, 3917, 3917, 3917, 3917, 3917, 3917, - 3917, 3918, 3918, 3918, 3918, 3918, 3918, 3918, 3918, 3918, - 3918, 3918, 3918, 3918, 3918, 3918, 3918, 3918, 3918, 3919, - 3919, 3919, 3919, 3919, 3919, 3919, 3919, 3919, 3919, 3919, - 3919, 3919, 3919, 3919, 3919, 3919, 3919, 3920, 3920, 3920, - - 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, - 3920, 3920, 3920, 3920, 3920, 3921, 3921, 3921, 3921, 3921, - 3921, 3921, 3921, 3921, 3921, 3921, 3921, 3921, 3921, 3921, - 3921, 3921, 3921, 3922, 3922, 3922, 3922, 3922, 3922, 3922, - 3922, 3922, 3922, 3922, 3922, 3922, 3922, 3922, 3922, 3922, - 3922, 3923, 3923, 3923, 3923, 3923, 3923, 3923, 3923, 3923, - 3923, 3923, 3923, 3923, 3923, 3923, 3923, 3923, 3923, 3924, - 3924, 3924, 3924, 3924, 3924, 3924, 3924, 3924, 3924, 3924, - 3924, 3924, 3924, 3924, 3924, 3924, 3924, 3925, 3925, 3925, - 3925, 3925, 3925, 3925, 3925, 3925, 3925, 3925, 3925, 3925, - - 3925, 3925, 3925, 3925, 3925, 3926, 3926, 3926, 3926, 3926, - 3926, 3926, 3926, 3926, 3926, 3926, 3926, 3926, 3926, 3926, - 3926, 3926, 3926, 3927, 3927, 3927, 3927, 3927, 3927, 3927, - 3927, 3927, 3927, 3927, 3927, 3927, 3927, 3927, 3927, 3927, - 3927, 3928, 3928, 3928, 3928, 3928, 3928, 3928, 3928, 3928, - 3928, 3928, 3928, 3928, 3928, 3928, 3928, 3928, 3928, 3929, - 3929, 3929, 3929, 3929, 3929, 3929, 3929, 3929, 3929, 3929, - 3929, 3929, 3929, 3929, 3929, 3929, 3929, 3930, 3930, 3930, - 3930, 3930, 3930, 3930, 3930, 3930, 3930, 3930, 3930, 3930, - 3930, 3930, 3930, 3930, 3930, 3931, 3931, 3931, 3931, 3931, - - 3931, 3931, 3931, 3931, 3931, 3931, 3931, 3931, 3931, 3931, - 3931, 3931, 3931, 3932, 3932, 3932, 3932, 3932, 3932, 3932, - 3932, 3932, 3932, 3932, 3932, 3932, 3932, 3932, 3932, 3932, - 3932, 3933, 3933, 3933, 3933, 3933, 3933, 3933, 3933, 3933, - 3933, 3933, 3933, 3933, 3933, 3933, 3933, 3933, 3933, 3934, - 3934, 3934, 3934, 3934, 3934, 3934, 3934, 3934, 3934, 3934, - 3934, 3934, 3934, 3934, 3934, 3934, 3934, 3935, 3935, 3935, - 3935, 3935, 3935, 3935, 3935, 3935, 3935, 3935, 3935, 3935, - 3935, 3935, 3935, 3935, 3935, 3936, 3936, 3936, 3936, 3936, - 3936, 3936, 3936, 3936, 3936, 3936, 3936, 3936, 3936, 3936, - - 3936, 3936, 3936, 3937, 3937, 760, 3937, 3937, 3937, 3937, - 3937, 3937, 3937, 3937, 3937, 3937, 3937, 3937, 3937, 3937, - 3937, 3938, 3938, 3938, 3938, 3938, 3938, 3938, 3938, 3938, - 3938, 3938, 3938, 3938, 3938, 3938, 3938, 3938, 3938, 3939, - 3939, 3939, 3939, 3939, 3939, 3939, 3939, 3939, 3939, 3939, - 3939, 3939, 3939, 3939, 3939, 3939, 3939, 3940, 3940, 3940, - 3940, 3940, 3940, 3940, 3940, 3940, 3940, 3940, 3940, 3940, - 3940, 3940, 3940, 3940, 3940, 3941, 3941, 3941, 3941, 3941, - 3941, 3941, 3941, 3941, 3941, 3941, 3941, 3941, 3941, 3941, - 3941, 3941, 3941, 3942, 3942, 3942, 3942, 3942, 3942, 3942, - - 3942, 3942, 3942, 3942, 3942, 3942, 3942, 3942, 3942, 3942, - 3942, 3943, 3943, 3943, 3943, 3943, 3943, 3943, 3943, 3943, - 3943, 3943, 3943, 3943, 3943, 3943, 3943, 3943, 3943, 3944, - 3944, 3944, 3944, 3944, 3944, 3944, 3944, 3944, 3944, 3944, - 3944, 3944, 3944, 3944, 3944, 3944, 3944, 3945, 3945, 3945, - 3945, 3945, 3945, 3945, 3945, 3945, 3945, 3945, 3945, 3945, - 3945, 3945, 3945, 3945, 3945, 3946, 3946, 3946, 3946, 3946, - 3946, 3946, 3946, 3946, 3946, 3946, 3946, 3946, 3946, 3946, - 3946, 3946, 3946, 3947, 3947, 3947, 3947, 3947, 3947, 3947, - 3947, 3947, 3947, 3947, 3947, 3947, 3947, 3947, 3947, 3947, - - 3947, 3948, 3948, 3948, 3948, 3948, 3948, 3948, 3948, 3948, - 3948, 3948, 3948, 3948, 3948, 3948, 3948, 3948, 3948, 3949, - 3949, 3949, 3949, 3949, 3949, 3949, 3949, 3949, 3949, 3949, - 3949, 3949, 3949, 3949, 3949, 3949, 3949, 3950, 3950, 3950, - 3950, 3950, 3950, 3950, 3950, 3950, 3950, 3950, 3950, 3950, - 3950, 3950, 3950, 3950, 3950, 3951, 3951, 3951, 3951, 3951, - 3951, 3951, 3951, 3951, 3951, 3951, 3951, 3951, 3951, 3951, - 3951, 3951, 3951, 3952, 3952, 3952, 3952, 3952, 3952, 3952, - 3952, 3952, 3952, 3952, 3952, 3952, 3952, 3952, 3952, 3952, - 3952, 3953, 3953, 3953, 3953, 3953, 3953, 3953, 3953, 3953, - - 3953, 3953, 3953, 3953, 3953, 3953, 3953, 3953, 3953, 3954, - 3954, 3954, 3954, 3954, 3954, 3954, 3954, 3954, 3954, 3954, - 3954, 3954, 3954, 3954, 3954, 3954, 3954, 3955, 3955, 759, - 3955, 3955, 3955, 3955, 3955, 3955, 3955, 3955, 3955, 3955, - 3955, 3955, 3955, 3955, 3955, 3956, 3956, 757, 3956, 3956, - 3956, 3956, 3956, 3956, 3956, 3956, 3956, 3956, 3956, 3956, - 3956, 3956, 3956, 3957, 3957, 756, 3957, 3957, 3957, 3957, - 3957, 3957, 3957, 3957, 3957, 3957, 3957, 3957, 3957, 3957, - 3957, 3958, 3958, 3958, 3958, 3958, 3958, 3958, 3958, 3958, - 3958, 3958, 3958, 3958, 3958, 3958, 3958, 3958, 3958, 3959, - - 3959, 3959, 3959, 3959, 3959, 3959, 3959, 3959, 3959, 3959, - 3959, 3959, 3959, 3959, 3959, 3959, 3959, 3960, 3960, 3960, - 3960, 3960, 3960, 3960, 3960, 3960, 3960, 3960, 3960, 3960, - 3960, 3960, 3960, 3960, 3960, 3961, 3961, 3961, 3961, 3961, - 3961, 3961, 3961, 3961, 3961, 3961, 3961, 3961, 3961, 3961, - 3961, 3961, 3961, 3962, 3962, 755, 3962, 3962, 3962, 3962, - 3962, 3962, 3962, 3962, 3962, 3962, 3962, 3962, 3962, 3962, - 3962, 3963, 3963, 3963, 3963, 3963, 3963, 3963, 3963, 3963, - 3963, 3963, 3963, 3963, 3963, 3963, 3963, 3963, 3963, 3964, - 3964, 3964, 3964, 3964, 3964, 3964, 3964, 3964, 3964, 3964, - - 3964, 3964, 3964, 3964, 3964, 3964, 3964, 3965, 3965, 3965, - 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, - 3965, 3965, 3965, 749, 3965, 3966, 3966, 3966, 3966, 3966, - 3966, 3966, 3966, 3966, 3966, 3966, 3966, 3966, 3966, 3966, - 3966, 3966, 3966, 3967, 3967, 3967, 3967, 3967, 3967, 3967, - 3967, 3967, 3967, 3967, 3967, 3967, 3967, 3967, 3967, 742, - 3967, 3968, 3968, 3968, 3968, 3968, 3968, 3968, 3968, 3968, - 3968, 3968, 3968, 3968, 3968, 3968, 3968, 3968, 3968, 3969, + 429, 465, 464, 430, 450, 457, 450, 458, 469, 471, + 450, 465, 459, 1331, 460, 3539, 432, 462, 463, 462, + 464, 465, 466, 459, 467, 468, 467, 472, 489, 465, + 464, 489, 473, 489, 896, 500, 469, 471, 500, 465, + 470, 470, 493, 470, 900, 493, 470, 493, 470, 520, + 470, 470, 470, 522, 470, 472, 470, 470, 470, 470, + 473, 476, 476, 476, 476, 2145, 2145, 497, 470, 470, + 497, 470, 497, 896, 470, 906, 470, 520, 470, 470, + + 470, 522, 470, 900, 470, 470, 470, 470, 480, 480, + 480, 480, 481, 481, 481, 481, 482, 482, 482, 482, + 1326, 482, 485, 485, 485, 485, 2885, 485, 491, 491, + 491, 491, 502, 491, 906, 502, 476, 492, 492, 492, + 492, 499, 492, 2885, 499, 503, 499, 505, 503, 508, + 503, 510, 505, 523, 508, 511, 510, 515, 511, 516, + 515, 525, 516, 480, 589, 528, 531, 481, 528, 531, + 3528, 482, 532, 528, 531, 589, 533, 485, 542, 533, + 543, 523, 538, 491, 533, 538, 544, 528, 1326, 525, + 538, 532, 492, 539, 557, 539, 499, 557, 533, 505, + + 646, 508, 545, 510, 1580, 511, 542, 515, 543, 516, + 546, 646, 539, 547, 544, 528, 531, 535, 548, 532, + 535, 550, 535, 551, 552, 535, 533, 553, 540, 555, + 545, 540, 538, 540, 556, 559, 540, 560, 546, 535, + 539, 547, 558, 561, 563, 558, 548, 564, 566, 550, + 540, 551, 552, 3063, 3518, 553, 567, 555, 1580, 3516, + 568, 570, 556, 559, 571, 560, 590, 535, 3496, 590, + 591, 561, 563, 591, 3450, 564, 566, 572, 540, 554, + 573, 554, 554, 574, 567, 554, 554, 554, 568, 570, + 575, 554, 571, 576, 554, 3063, 554, 554, 554, 554, + + 579, 554, 554, 580, 577, 572, 581, 554, 573, 554, + 554, 574, 582, 554, 554, 554, 578, 578, 575, 554, + 583, 576, 554, 577, 554, 554, 554, 554, 579, 554, + 554, 580, 577, 585, 581, 586, 587, 588, 593, 594, + 582, 595, 596, 598, 578, 578, 599, 600, 583, 602, + 603, 577, 606, 607, 608, 588, 609, 610, 611, 612, + 613, 585, 614, 586, 587, 588, 593, 594, 615, 595, + 596, 598, 616, 617, 599, 600, 618, 602, 603, 619, + 606, 607, 608, 588, 609, 610, 611, 612, 613, 620, + 614, 620, 640, 3443, 626, 623, 615, 626, 623, 637, + + 616, 617, 637, 623, 618, 623, 624, 619, 638, 624, + 629, 638, 3410, 629, 624, 629, 624, 630, 629, 3346, + 630, 632, 630, 655, 632, 630, 3328, 635, 645, 632, + 635, 640, 635, 3312, 636, 635, 620, 636, 645, 636, + 635, 645, 636, 653, 626, 3305, 653, 636, 653, 3303, + 623, 639, 639, 674, 639, 734, 639, 824, 734, 653, + 640, 624, 655, 662, 639, 629, 669, 639, 824, 669, + 653, 632, 630, 662, 641, 641, 662, 641, 639, 641, + 675, 674, 635, 643, 643, 675, 643, 641, 643, 636, + 641, 655, 647, 647, 663, 647, 643, 647, 653, 643, + + 682, 641, 663, 683, 735, 647, 639, 735, 647, 645, + 643, 684, 649, 663, 685, 649, 669, 649, 686, 647, + 649, 687, 688, 690, 1321, 691, 653, 653, 682, 641, + 679, 683, 675, 679, 649, 639, 639, 692, 643, 684, + 736, 663, 685, 736, 662, 738, 686, 647, 738, 687, + 688, 690, 672, 691, 2277, 672, 2277, 672, 641, 641, + 672, 741, 649, 1321, 741, 692, 673, 643, 643, 673, + 652, 673, 3297, 652, 673, 652, 647, 647, 652, 654, + 652, 693, 654, 652, 654, 679, 652, 654, 656, 654, + 694, 656, 654, 656, 695, 654, 656, 652, 656, 744, + + 657, 656, 744, 657, 656, 657, 654, 672, 657, 693, + 657, 861, 1329, 657, 664, 656, 657, 664, 694, 664, + 3258, 673, 695, 658, 697, 652, 658, 657, 658, 3224, + 664, 658, 659, 658, 654, 659, 658, 659, 698, 658, + 659, 664, 659, 656, 3187, 659, 699, 701, 659, 702, + 658, 703, 697, 678, 652, 657, 678, 660, 861, 659, + 660, 678, 660, 654, 1332, 660, 698, 660, 680, 664, + 660, 680, 656, 660, 699, 701, 680, 702, 658, 703, + 1329, 3174, 3168, 665, 660, 705, 665, 659, 665, 706, + 707, 665, 666, 665, 1395, 666, 665, 666, 664, 665, + + 666, 667, 666, 1332, 667, 666, 667, 658, 678, 667, + 665, 667, 660, 705, 667, 708, 659, 706, 707, 666, + 709, 710, 696, 680, 711, 713, 715, 716, 667, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 665, 1395, + 717, 660, 718, 708, 714, 720, 722, 666, 709, 710, + 724, 721, 711, 713, 715, 716, 667, 714, 714, 725, + 714, 714, 726, 719, 727, 719, 721, 665, 717, 719, + 718, 723, 714, 720, 722, 728, 729, 733, 724, 721, + 748, 723, 3138, 748, 728, 714, 714, 725, 714, 714, + 726, 719, 727, 719, 721, 754, 730, 719, 730, 723, + + 730, 755, 1945, 728, 729, 733, 755, 752, 737, 723, + 752, 737, 728, 737, 739, 740, 3123, 739, 740, 739, + 740, 762, 742, 754, 730, 742, 730, 742, 730, 745, + 747, 763, 745, 747, 745, 747, 749, 751, 764, 749, + 751, 749, 751, 753, 759, 765, 753, 759, 753, 762, + 775, 776, 767, 755, 777, 767, 1945, 778, 779, 763, + 767, 781, 771, 782, 783, 771, 764, 771, 784, 785, + 771, 3077, 786, 765, 767, 2482, 791, 2482, 775, 776, + 792, 787, 777, 793, 771, 778, 779, 786, 787, 781, + 786, 782, 783, 3075, 759, 787, 784, 785, 790, 788, + + 786, 796, 767, 788, 791, 789, 794, 788, 792, 787, + 795, 793, 771, 798, 799, 786, 787, 790, 786, 789, + 800, 789, 794, 787, 805, 795, 790, 788, 797, 796, + 797, 788, 803, 789, 794, 788, 802, 807, 795, 802, + 810, 798, 799, 803, 811, 790, 812, 789, 800, 789, + 794, 813, 805, 795, 814, 815, 797, 816, 797, 818, + 819, 820, 821, 822, 823, 807, 825, 826, 810, 827, + 829, 830, 811, 803, 812, 832, 3073, 833, 835, 813, + 836, 835, 814, 815, 837, 816, 838, 818, 819, 820, + 821, 822, 823, 831, 825, 826, 839, 827, 829, 830, + + 840, 841, 842, 832, 831, 833, 843, 844, 836, 845, + 847, 848, 837, 849, 838, 831, 850, 851, 852, 853, + 854, 849, 855, 856, 839, 857, 909, 864, 840, 841, + 842, 859, 864, 859, 843, 844, 870, 845, 847, 848, + 912, 849, 870, 831, 850, 851, 852, 853, 854, 849, + 855, 856, 860, 857, 862, 860, 863, 862, 871, 863, + 860, 863, 860, 865, 863, 867, 865, 866, 867, 871, + 866, 875, 866, 909, 864, 866, 868, 868, 859, 868, + 866, 868, 875, 3069, 889, 915, 868, 912, 915, 868, + 889, 3209, 868, 873, 873, 883, 873, 882, 873, 916, + + 882, 3060, 882, 868, 862, 882, 873, 860, 3209, 873, + 870, 863, 913, 865, 883, 910, 884, 913, 910, 884, + 873, 884, 866, 1005, 884, 885, 884, 916, 885, 884, + 885, 868, 884, 885, 1005, 885, 890, 871, 885, 3052, + 915, 885, 883, 884, 890, 3216, 886, 882, 873, 886, + 979, 886, 885, 979, 886, 890, 886, 1270, 889, 886, + 868, 868, 886, 917, 913, 910, 998, 914, 1270, 892, + 914, 884, 892, 886, 892, 914, 888, 873, 873, 888, + 885, 888, 1524, 890, 888, 892, 888, 3216, 918, 888, + 894, 917, 888, 894, 893, 894, 892, 893, 919, 893, + + 884, 886, 893, 888, 893, 920, 894, 893, 921, 885, + 893, 980, 890, 998, 980, 911, 918, 894, 911, 3043, + 911, 893, 914, 911, 892, 3033, 919, 1524, 922, 982, + 886, 888, 982, 920, 895, 2991, 921, 895, 897, 895, + 2813, 897, 895, 897, 895, 894, 897, 895, 897, 893, + 895, 897, 899, 892, 897, 899, 922, 899, 2989, 898, + 899, 895, 898, 901, 898, 897, 901, 898, 901, 898, + 911, 901, 898, 894, 899, 898, 981, 983, 893, 981, + 983, 981, 925, 926, 929, 901, 898, 932, 933, 895, + 2813, 907, 923, 897, 907, 908, 907, 923, 908, 907, + + 908, 907, 899, 908, 907, 908, 2985, 907, 908, 923, + 925, 926, 929, 901, 898, 932, 933, 934, 907, 936, + 923, 937, 908, 2946, 2908, 923, 930, 930, 930, 930, + 930, 930, 930, 930, 930, 938, 940, 923, 941, 942, + 943, 944, 945, 947, 948, 934, 907, 936, 949, 937, + 908, 931, 931, 931, 931, 931, 931, 931, 931, 931, + 950, 951, 952, 938, 940, 953, 941, 942, 943, 944, + 945, 947, 948, 955, 954, 907, 949, 954, 956, 957, + 958, 959, 960, 961, 962, 963, 964, 965, 950, 951, + 952, 967, 968, 953, 969, 967, 970, 969, 971, 972, + + 973, 955, 974, 975, 978, 954, 956, 957, 958, 959, + 960, 961, 962, 963, 964, 965, 2897, 2896, 985, 967, + 968, 985, 969, 967, 970, 969, 971, 972, 973, 1000, + 974, 975, 978, 984, 986, 2880, 984, 986, 984, 986, + 987, 988, 2879, 987, 988, 987, 989, 991, 2870, 989, + 991, 989, 992, 993, 1002, 992, 993, 992, 994, 995, + 1003, 994, 995, 994, 996, 997, 999, 996, 997, 996, + 1001, 999, 1004, 1001, 1007, 1006, 1000, 1009, 1006, 1013, + 1014, 1008, 1002, 1006, 1008, 1016, 1008, 1017, 1003, 1008, + 2835, 1018, 1402, 1007, 1019, 1020, 1009, 2828, 1021, 1022, + + 1004, 1023, 1024, 1402, 1025, 1026, 1028, 1013, 1014, 1027, + 1027, 1027, 1027, 1016, 1030, 1017, 1031, 2990, 999, 1018, + 1001, 1007, 1019, 1020, 1009, 1006, 1021, 1022, 1032, 1023, + 1024, 1008, 1025, 1026, 1028, 1033, 1034, 1027, 1027, 1027, + 1027, 1029, 1030, 1035, 1031, 1029, 1036, 1037, 1038, 1039, + 1040, 1042, 1043, 1039, 1041, 1039, 1032, 1044, 1041, 1045, + 1046, 1047, 1048, 1033, 1034, 1051, 1052, 2990, 1042, 1029, + 1054, 1035, 1055, 1029, 1036, 1037, 1038, 1039, 1040, 1042, + 1043, 1039, 1041, 1039, 1056, 1044, 1041, 1045, 1046, 1047, + 1048, 1050, 1053, 1051, 1052, 1050, 1042, 1057, 1054, 1058, + + 1055, 1059, 1050, 1053, 1050, 2827, 1060, 1061, 1062, 1064, + 1065, 1066, 1056, 1067, 1068, 1070, 1071, 1072, 2818, 1050, + 1074, 1075, 2812, 1050, 1077, 1057, 1078, 1058, 1079, 1059, + 1050, 1080, 1050, 1053, 1060, 1061, 1062, 1064, 1065, 1066, + 1081, 1067, 1068, 1070, 1071, 1072, 1073, 1073, 1074, 1075, + 1073, 1082, 1077, 1083, 1078, 1073, 1079, 1084, 1085, 1080, + 1086, 1073, 1087, 1088, 1089, 1073, 1091, 1073, 1081, 1092, + 1093, 1094, 1095, 1096, 1073, 1073, 1097, 1098, 1073, 1082, + 1099, 1083, 1100, 1073, 1101, 1084, 1085, 1102, 1086, 1073, + 1087, 1088, 1089, 1073, 1091, 1073, 1115, 1092, 1093, 1094, + + 1095, 1096, 1116, 2778, 1097, 1098, 1108, 1108, 1099, 1108, + 1100, 1108, 1101, 1109, 1114, 1102, 1109, 1114, 1113, 1108, + 2758, 1113, 1108, 1113, 2709, 1128, 1113, 1118, 1113, 1130, + 1118, 1113, 1118, 1108, 1113, 1118, 3531, 1118, 3531, 1119, + 1118, 1116, 1119, 1118, 1119, 1113, 1132, 1119, 1120, 1119, + 1124, 1133, 1119, 1128, 1118, 1119, 1120, 1130, 1124, 1135, + 2698, 1108, 1193, 1115, 1115, 1193, 1119, 1120, 1194, 1124, + 1116, 1194, 1122, 1113, 1132, 1122, 1137, 1122, 1195, 1133, + 2694, 1195, 1118, 1195, 1109, 1114, 1196, 1135, 1122, 1196, + 1108, 1108, 2656, 1121, 1119, 1120, 1121, 1124, 1121, 1122, + + 1138, 1121, 1113, 1121, 1137, 1123, 1121, 1139, 1123, 1121, + 1123, 1118, 1140, 1123, 1125, 1123, 1141, 1125, 1123, 1125, + 1121, 1123, 1143, 1139, 1145, 1146, 1147, 1122, 1138, 1148, + 1125, 1149, 1123, 1153, 1155, 1139, 1156, 1159, 1160, 1161, + 1140, 1125, 1162, 2655, 1141, 1163, 1164, 1165, 1121, 2630, + 1143, 1139, 1145, 1146, 1147, 1197, 2592, 1148, 1197, 1149, + 1123, 1153, 1155, 2565, 1156, 1159, 1160, 1161, 1167, 1125, + 1162, 1144, 1168, 1163, 1164, 1165, 1169, 1121, 1144, 1144, + 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1166, 1166, 1166, + 1166, 1166, 1166, 1166, 1166, 1166, 1167, 1170, 1125, 1171, + + 1168, 1172, 1173, 1175, 1169, 1174, 1174, 1176, 1177, 1178, + 1180, 1181, 1182, 1183, 1184, 1186, 1187, 1188, 1189, 1189, + 1199, 1198, 1205, 1199, 1198, 1170, 1198, 1171, 1209, 1172, + 1173, 1175, 2562, 1174, 1174, 1176, 1177, 1178, 1180, 1181, + 1182, 1183, 1184, 1186, 1187, 1188, 1189, 1189, 1200, 1201, + 1205, 1200, 1201, 1200, 1202, 1203, 1209, 1202, 1203, 1202, + 1204, 1210, 1211, 1204, 1218, 1219, 1220, 1222, 1223, 1225, + 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, + 1236, 1237, 1238, 1233, 1239, 1240, 1241, 1242, 1243, 1210, + 1211, 1244, 1218, 1219, 1220, 1222, 1223, 1225, 1226, 1227, + + 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, + 1238, 1233, 1239, 1240, 1241, 1242, 1243, 1245, 1246, 1244, + 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, + 1257, 1258, 1259, 1261, 1262, 1263, 1264, 1265, 1266, 2553, + 1269, 1271, 1272, 1255, 1273, 1245, 1246, 1275, 1247, 1248, + 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, + 1259, 1261, 1262, 1263, 1264, 1265, 1266, 1268, 1269, 1271, + 1272, 1255, 1273, 1276, 1277, 1275, 1278, 1280, 1268, 1281, + 1282, 1283, 1285, 1268, 1268, 1287, 1288, 1289, 1290, 1291, + 1292, 1293, 1295, 1297, 1290, 1268, 1298, 1299, 1300, 1301, + + 1302, 1276, 1277, 1303, 1278, 1280, 1268, 1281, 1282, 1283, + 1285, 1268, 1268, 1287, 1288, 1289, 1290, 1291, 1292, 1293, + 1295, 1297, 1290, 1304, 1298, 1299, 1300, 1301, 1302, 1305, + 1306, 1303, 1307, 1308, 1309, 1311, 1312, 1313, 1314, 1315, + 1316, 1317, 1318, 1319, 1320, 1324, 1335, 2551, 1334, 1397, + 1338, 1304, 1397, 1398, 2517, 2513, 1398, 1305, 1306, 1334, + 1307, 1308, 1309, 1311, 1312, 1313, 1314, 1315, 1316, 1317, + 1318, 1319, 1325, 1328, 1335, 1325, 1339, 1325, 1338, 1340, + 1325, 1328, 1325, 1320, 1324, 1325, 1341, 3612, 1325, 3612, + 1330, 2511, 1328, 1330, 1342, 1330, 2510, 1343, 1400, 1325, + + 1336, 1400, 1336, 1344, 1339, 1345, 1330, 1340, 1348, 3614, + 1350, 3614, 1320, 1324, 1341, 1334, 1333, 1330, 1351, 1333, + 1328, 1333, 1342, 1352, 1333, 1343, 1333, 1325, 1336, 1333, + 1336, 1344, 1333, 1345, 1347, 1353, 1348, 1347, 1350, 1347, + 1354, 1356, 1355, 1333, 1347, 1330, 1351, 1347, 1357, 1328, + 2509, 1352, 1358, 1360, 1366, 1368, 1371, 1372, 1373, 1374, + 1375, 1399, 1401, 1353, 1399, 1401, 1399, 1409, 1354, 1356, + 1409, 1333, 1355, 1376, 1330, 1377, 1357, 1378, 1355, 1379, + 1358, 1360, 1366, 1368, 1371, 1372, 1373, 1374, 1375, 1347, + 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1380, + + 1355, 1376, 1382, 1377, 1383, 1378, 1355, 1379, 1384, 1385, + 1387, 1388, 1389, 1390, 1391, 1392, 1403, 1388, 1404, 1407, + 1408, 1410, 1411, 1412, 1413, 1414, 1415, 1380, 1416, 1417, + 1382, 1418, 1383, 1419, 1421, 1422, 1384, 1385, 1387, 1388, + 1389, 1390, 1391, 1392, 1403, 1388, 1404, 1407, 1408, 1410, + 1411, 1412, 1413, 1414, 1415, 1420, 1416, 1417, 1423, 1418, + 1424, 1419, 1421, 1422, 1425, 1426, 1427, 1428, 1420, 1429, + 1430, 1431, 1432, 1420, 1433, 1434, 1430, 1435, 1430, 1436, + 1437, 1430, 2502, 1420, 1439, 1440, 1423, 1441, 1424, 1442, + 1443, 1444, 1425, 1426, 1427, 1428, 1420, 1429, 1430, 1431, + + 1432, 1420, 1433, 1434, 1430, 1435, 1430, 1436, 1437, 1430, + 1438, 1445, 1439, 1440, 1438, 1441, 1446, 1442, 1443, 1444, + 1447, 1438, 1448, 1438, 1438, 1449, 1438, 1450, 1451, 1452, + 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1464, 1438, 1445, + 1465, 1466, 1438, 1467, 1446, 1468, 2490, 1472, 1447, 1438, + 1448, 1438, 1438, 1449, 1438, 1450, 1451, 1452, 1453, 1454, + 1455, 1456, 1457, 1458, 1459, 1464, 1473, 1469, 1465, 1466, + 1474, 1467, 1476, 1468, 1469, 1472, 1477, 1475, 1478, 1479, + 1480, 1481, 1469, 1474, 1482, 1474, 1483, 1469, 1475, 1484, + 1485, 1486, 1487, 1488, 1473, 1469, 1489, 1490, 1474, 1475, + + 1476, 1492, 1469, 1493, 1477, 1494, 1478, 1479, 1480, 1481, + 1469, 1474, 1482, 1474, 1483, 1469, 1495, 1484, 1485, 1486, + 1487, 1488, 1496, 1491, 1489, 1490, 1497, 1475, 1491, 1492, + 1498, 1493, 1499, 1494, 1500, 1501, 1502, 1503, 1505, 1506, + 1507, 1508, 1509, 1505, 1495, 1512, 1513, 3684, 1514, 3684, + 1496, 1491, 1515, 1503, 1497, 1517, 1491, 1518, 1498, 1519, + 1499, 1573, 1500, 1501, 1502, 1503, 1505, 1506, 1507, 1508, + 1510, 1505, 1511, 1512, 1513, 1511, 1514, 1511, 1510, 1520, + 1515, 1503, 2488, 1517, 1521, 1518, 1522, 1519, 1511, 1510, + 1523, 1526, 1527, 1523, 1526, 1523, 1526, 1530, 1531, 1511, + + 1523, 1526, 1532, 1523, 1526, 1576, 1573, 1520, 1576, 1509, + 1509, 2487, 1521, 1535, 1522, 1533, 1536, 1510, 2486, 1533, + 1527, 1533, 1538, 1539, 1541, 1530, 1531, 1511, 1547, 1548, + 1532, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, + 1551, 1535, 1552, 1533, 1536, 1523, 1526, 1533, 1553, 1533, + 1538, 1539, 1541, 1554, 1555, 1556, 1547, 1548, 1549, 1549, + 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1557, 1551, 1558, + 1552, 1559, 1560, 1561, 1562, 1563, 1553, 1564, 1565, 1566, + 1567, 1554, 1555, 1556, 1568, 1569, 1570, 1571, 1577, 1581, + 1582, 1583, 1585, 1578, 1583, 1557, 1583, 1558, 1586, 1559, + + 1560, 1561, 1562, 1563, 1578, 1564, 1565, 1566, 1567, 1587, + 1588, 1590, 1568, 1569, 1570, 1571, 1577, 1581, 1582, 1591, + 1585, 1589, 1592, 1593, 1594, 1595, 1586, 1596, 1589, 1597, + 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1587, 1588, 1590, + 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1591, 1612, 1589, + 1592, 1593, 1594, 1595, 1613, 1596, 1589, 1597, 1598, 1599, + 1600, 1601, 1602, 1603, 1604, 1614, 1615, 1616, 1605, 1606, + 1607, 1608, 1609, 1610, 1611, 1617, 1612, 1618, 1619, 1620, + 1621, 1622, 1613, 1623, 1624, 1625, 1626, 1627, 1628, 1629, + 1630, 1631, 1632, 1614, 1615, 1616, 1633, 1635, 1636, 1634, + + 1637, 1639, 1640, 1617, 1641, 1618, 1619, 1620, 1621, 1622, + 1634, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, + 1632, 1642, 1643, 1644, 1633, 1635, 1636, 1645, 1637, 1639, + 1640, 1646, 1641, 1647, 1648, 1650, 1651, 1652, 1653, 1654, + 1634, 1655, 1656, 1658, 1660, 1661, 1662, 1664, 1665, 1642, + 1643, 1644, 1667, 1656, 1658, 1645, 1668, 1672, 3686, 1646, + 3686, 1647, 1648, 1650, 1651, 1652, 1653, 1654, 2481, 1655, + 1656, 1673, 1660, 1661, 1662, 1664, 1665, 1674, 1675, 1677, + 1667, 1656, 1657, 1657, 1668, 1672, 1657, 1678, 1657, 1679, + 1680, 1681, 1657, 1657, 1682, 1683, 1657, 1684, 1685, 1673, + + 1686, 1657, 1687, 1688, 1689, 1674, 1675, 1677, 1690, 1691, + 1657, 1657, 1692, 1695, 1657, 1678, 1657, 1679, 1680, 1681, + 1657, 1657, 1682, 1683, 1657, 1684, 1685, 1696, 1686, 1657, + 1687, 1688, 1689, 1693, 1697, 1694, 1690, 1691, 1694, 1698, + 1692, 1695, 1699, 1700, 1702, 1703, 1693, 1705, 1706, 1707, + 1709, 1708, 1710, 1714, 1716, 1696, 3750, 1720, 3750, 1721, + 1723, 1693, 1697, 1694, 1708, 3151, 1694, 1698, 1724, 1725, + 1699, 1726, 1702, 1703, 1693, 1705, 1706, 1707, 1709, 1708, + 1710, 1712, 1716, 2456, 1712, 1720, 1712, 1721, 1723, 1729, + 1733, 1712, 1708, 1722, 1712, 2444, 1724, 1725, 1714, 1726, + + 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1727, + 1700, 1727, 1730, 2434, 2432, 3151, 1765, 1729, 1733, 1765, + 2416, 1765, 1735, 1735, 1730, 1736, 1737, 1738, 1739, 1730, + 1740, 1741, 1742, 1743, 1745, 1746, 1712, 1727, 1757, 1727, + 1730, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, + 1735, 1735, 1730, 1736, 1737, 1738, 1739, 1730, 1740, 1741, + 1742, 1743, 1745, 1746, 1747, 1749, 1748, 1750, 1751, 1752, + 1753, 1754, 1755, 1756, 1747, 1762, 1758, 1748, 1763, 1766, + 1767, 1769, 1770, 1757, 1771, 1747, 1748, 1758, 1772, 1773, + 1774, 1775, 1747, 1749, 1748, 1750, 1751, 1752, 1753, 1754, + + 1755, 1756, 1747, 1762, 1776, 1748, 1763, 1766, 1767, 1769, + 1770, 1777, 1771, 1747, 1748, 1778, 1772, 1773, 1774, 1775, + 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, + 1789, 1790, 1776, 1791, 1792, 1793, 1795, 1780, 1794, 1777, + 1796, 1794, 1797, 1778, 1798, 1799, 1800, 1801, 1779, 1780, + 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, + 1802, 1791, 1792, 1793, 1795, 1780, 1803, 1804, 1796, 1805, + 1797, 1806, 1798, 1799, 1800, 1801, 1807, 1808, 1809, 1810, + 1811, 1809, 1812, 1808, 1812, 1813, 1814, 1815, 1802, 1812, + 1817, 1818, 1819, 1821, 1803, 1804, 1822, 1805, 1823, 1806, + + 1825, 1826, 1824, 1819, 1807, 1808, 1827, 1810, 1811, 1828, + 1812, 1808, 1812, 1813, 1814, 1815, 1824, 1812, 1817, 1818, + 1829, 1821, 1831, 1833, 1822, 1834, 1823, 1835, 1825, 1826, + 1824, 1836, 1837, 1819, 1827, 1838, 1839, 1828, 1840, 1841, + 1842, 1843, 1844, 1845, 1846, 1847, 1850, 3580, 1829, 1851, + 1831, 1833, 1840, 1834, 1852, 1835, 1854, 1855, 1860, 1836, + 1837, 2400, 1862, 1838, 1839, 1863, 1840, 1841, 1842, 1843, + 1844, 1845, 1846, 1847, 1850, 1849, 1849, 1851, 1864, 1865, + 1840, 1849, 1852, 1867, 1854, 1855, 1860, 1868, 1869, 1849, + 1862, 1870, 1849, 1863, 1871, 1872, 1875, 3580, 1878, 1886, + + 1879, 1880, 1881, 1849, 1849, 1882, 1864, 1865, 1876, 1849, + 1876, 1867, 1883, 1884, 1876, 1868, 1869, 1849, 1887, 1870, + 1849, 1888, 1871, 1872, 1875, 1876, 1878, 1876, 1879, 1880, + 1881, 1890, 1891, 1882, 1892, 1893, 1876, 1885, 1876, 1885, + 1883, 1884, 1876, 1885, 1886, 1889, 1887, 1894, 1895, 1888, + 1898, 1899, 1889, 1876, 1885, 1876, 1885, 1902, 1903, 1890, + 1891, 1904, 1892, 1893, 1906, 1885, 1907, 1885, 2361, 1909, + 1908, 1885, 1908, 1889, 2074, 1894, 1895, 1910, 1896, 1911, + 1889, 1896, 1885, 1896, 1885, 1913, 1903, 1914, 1896, 1904, + 1915, 1896, 1906, 1916, 1907, 1898, 1899, 1909, 1908, 1919, + + 1908, 1920, 1902, 1922, 1923, 1910, 2359, 1911, 1924, 1925, + 1926, 1927, 1928, 1913, 1968, 1914, 2346, 1968, 1915, 2074, + 2303, 1916, 1929, 1930, 1931, 2087, 1932, 1919, 2087, 1920, + 1930, 1922, 1923, 1896, 1917, 1933, 1924, 1925, 1926, 1927, + 1928, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, 1917, + 1929, 1930, 1931, 1917, 1932, 1917, 1917, 1917, 1930, 1934, + 1935, 1917, 1936, 1933, 1938, 1937, 1917, 1939, 1940, 1941, + 1942, 1943, 1944, 1951, 1953, 1917, 1937, 1947, 1947, 1947, + 1947, 1917, 1954, 1917, 1917, 1917, 1955, 1934, 1935, 1917, + 1936, 1956, 1938, 1937, 1917, 1939, 1940, 1941, 1942, 1943, + + 1944, 1951, 1953, 1917, 1937, 1949, 1949, 1949, 1949, 1957, + 1954, 1958, 1959, 1960, 1955, 1961, 1962, 1963, 1964, 1956, + 1965, 1966, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1977, + 1978, 1979, 1947, 1980, 2301, 1982, 1983, 1957, 1984, 1958, + 1959, 1960, 1985, 1961, 1962, 1963, 1964, 1986, 1965, 1966, + 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1977, 1978, 1979, + 1949, 1980, 1981, 1982, 1983, 1981, 1984, 1981, 1987, 1988, + 1985, 1989, 1990, 1991, 1992, 1986, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 1997, 2000, 1997, 2001, 2002, 2003, 2004, + 2005, 2006, 2007, 2009, 2010, 2011, 1987, 1988, 2012, 1989, + + 1990, 1991, 1992, 2007, 1993, 1994, 1995, 1996, 2013, 1998, + 1999, 2014, 2000, 2015, 2001, 2002, 2003, 2004, 2005, 2006, + 2016, 2009, 2010, 2011, 2017, 2018, 2012, 2019, 2300, 2166, + 2299, 2021, 2166, 2022, 2166, 2178, 2013, 2023, 2178, 2014, + 2178, 2015, 2196, 2024, 2025, 2196, 2026, 2196, 2016, 2027, + 2028, 2029, 2017, 2018, 2030, 2019, 2020, 2020, 2020, 2021, + 2020, 2022, 2020, 2020, 2031, 2023, 2020, 2020, 2020, 2032, + 2020, 2024, 2025, 2020, 2026, 2020, 2033, 2027, 2028, 2029, + 2034, 2035, 2030, 2036, 2020, 2020, 2020, 2037, 2020, 2038, + 2020, 2020, 2031, 2039, 2020, 2020, 2020, 2032, 2020, 2040, + + 2041, 2020, 2042, 2020, 2033, 2043, 2044, 2045, 2034, 2035, + 2046, 2036, 2049, 2050, 2051, 2037, 2052, 2038, 2057, 2058, + 2059, 2039, 2060, 2061, 2062, 2063, 2064, 2040, 2041, 2065, + 2042, 2065, 2068, 2043, 2044, 2045, 2069, 2072, 2046, 2075, + 2049, 2050, 2051, 2073, 2052, 2073, 2057, 2058, 2059, 2076, + 2060, 2061, 2062, 2063, 2064, 2077, 2089, 2065, 2078, 2065, + 2068, 2079, 2080, 2081, 2069, 2072, 2090, 2082, 2083, 2084, + 2085, 2073, 2086, 2073, 2091, 2094, 2095, 2096, 2097, 2098, + 2099, 2100, 2101, 2077, 2075, 2102, 2078, 2103, 2107, 2079, + 2080, 2081, 2285, 2283, 2076, 2082, 2083, 2084, 2085, 2282, + + 2086, 2089, 2108, 2094, 2095, 2096, 2097, 2098, 2099, 2100, + 2101, 2090, 2104, 2102, 2104, 2103, 2107, 2260, 2209, 2091, + 2106, 2106, 2106, 2106, 2106, 2106, 2106, 2106, 2106, 2209, + 2108, 2246, 2109, 2110, 2111, 2143, 2112, 2113, 2110, 2115, + 2104, 2116, 2104, 2105, 2105, 2105, 2105, 2105, 2105, 2105, + 2105, 2105, 2117, 2118, 2119, 2105, 2120, 2105, 2105, 2105, + 2109, 2110, 2111, 2105, 2112, 2113, 2110, 2115, 2105, 2116, + 2121, 2122, 2124, 2125, 2126, 2127, 2128, 2105, 2129, 2130, + 2117, 2118, 2119, 2105, 2120, 2105, 2105, 2105, 2131, 2132, + 2133, 2105, 2134, 2135, 2137, 2138, 2105, 2139, 2121, 2122, + + 2124, 2125, 2126, 2127, 2128, 2105, 2129, 2130, 2140, 2141, + 2144, 2144, 2144, 2144, 2146, 2146, 2131, 2132, 2133, 2149, + 2134, 2135, 2137, 2138, 2151, 2139, 2147, 2147, 2147, 2147, + 2148, 2148, 2152, 2153, 2154, 2156, 2140, 2141, 2157, 2158, + 2142, 2159, 2160, 2161, 2162, 2163, 2164, 2149, 2165, 2168, + 2167, 2169, 2151, 2167, 2170, 2171, 2284, 2055, 2172, 2173, + 2152, 2153, 2154, 2156, 2174, 2144, 2157, 2158, 2146, 2159, + 2160, 2161, 2162, 2163, 2164, 2175, 2165, 2168, 2176, 2169, + 2177, 2147, 2170, 2171, 2148, 2155, 2172, 2173, 2155, 2053, + 2167, 2048, 2174, 2180, 2181, 2182, 2183, 2184, 2185, 2186, + + 2187, 2284, 2188, 2175, 2155, 1967, 2176, 2189, 2177, 2191, + 2192, 2193, 2194, 2197, 2198, 2199, 2200, 2155, 2167, 2155, + 2201, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2155, + 2188, 2155, 2155, 2155, 2203, 2189, 2204, 2191, 2192, 2193, + 2194, 2197, 2198, 2199, 2200, 2155, 2202, 2155, 2201, 2202, + 2205, 2207, 2208, 2211, 2210, 2212, 2213, 2155, 2214, 2155, + 2155, 2155, 2203, 2215, 2204, 2210, 2216, 2217, 2218, 2219, + 2220, 2221, 2222, 2223, 2224, 2216, 2225, 2226, 2205, 2207, + 2208, 2211, 2227, 2212, 2213, 2229, 2214, 2230, 2228, 2231, + 2236, 2215, 2237, 2238, 2216, 2217, 2218, 2219, 2220, 2221, + + 2222, 2223, 2224, 2228, 2225, 2226, 2239, 2240, 2241, 2242, + 2227, 2243, 2244, 2229, 2245, 2230, 2228, 2231, 2236, 2247, + 2237, 2238, 2248, 2249, 2250, 2251, 2256, 2257, 2259, 2263, + 2264, 2228, 2266, 2267, 2239, 2240, 2241, 2242, 2268, 2243, + 2244, 2269, 2245, 2270, 2271, 2272, 2279, 2247, 2280, 2281, + 2248, 2249, 2250, 2251, 2256, 2257, 2259, 2263, 2264, 2286, + 2266, 2267, 2288, 2289, 2290, 2291, 2268, 2292, 2293, 2269, + 2294, 2270, 2271, 2272, 2279, 2295, 2280, 2281, 2296, 2302, + 2304, 2305, 2306, 1952, 2298, 2307, 2308, 2298, 2309, 2298, + 2288, 2289, 2290, 2291, 2298, 2292, 2293, 2298, 2294, 2310, + + 2311, 2312, 2314, 2295, 2286, 2315, 2296, 2316, 2318, 2305, + 2306, 2298, 2319, 2307, 2308, 2368, 2309, 1948, 2368, 1946, + 2368, 1918, 2320, 2322, 2302, 2304, 2321, 2310, 2311, 2312, + 2314, 2321, 2323, 2315, 2317, 2316, 2318, 2324, 2325, 2298, + 2319, 2317, 2317, 2317, 2317, 2317, 2317, 2317, 2317, 2317, + 2320, 2322, 2326, 2327, 2321, 2328, 2329, 2330, 2331, 2321, + 2323, 2332, 2334, 2335, 2336, 2324, 2325, 2338, 2341, 2343, + 2344, 2345, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2356, + 2326, 2327, 2358, 2328, 2329, 2330, 2331, 1901, 2363, 2332, + 2334, 2335, 2336, 2364, 2367, 2338, 2341, 2343, 2344, 2345, + + 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2356, 2360, 2360, + 2358, 2360, 2362, 2362, 2370, 2362, 2363, 2366, 2372, 2371, + 2369, 2364, 2367, 2369, 2366, 2371, 2373, 2374, 2375, 2376, + 2377, 2378, 2379, 2377, 2380, 1900, 2381, 2382, 2383, 2816, + 2384, 2385, 2370, 1897, 2389, 2366, 2372, 2371, 1861, 2390, + 2816, 2391, 2366, 2371, 2373, 2374, 2375, 2376, 2392, 2378, + 2379, 2393, 2380, 2360, 2381, 2382, 2383, 2362, 2384, 2385, + 2387, 2388, 2389, 2387, 2388, 2387, 2388, 2390, 2360, 2391, + 2394, 2395, 2362, 2396, 2398, 2399, 2392, 2398, 2401, 2393, + 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2412, + + 2413, 2414, 2415, 2417, 2418, 2420, 2421, 2419, 2394, 2395, + 2419, 2396, 2422, 2399, 2423, 2422, 2401, 2422, 2402, 2403, + 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2412, 2413, 2414, + 2415, 2417, 2418, 2420, 2421, 2424, 2425, 2426, 2427, 2430, + 2431, 2433, 2423, 2435, 2436, 2438, 2439, 2440, 2441, 2442, + 2443, 2445, 2446, 2447, 2435, 2448, 1830, 2449, 2450, 2451, + 2453, 2454, 2455, 2424, 2425, 2426, 2427, 2430, 2431, 2433, + 2457, 2458, 2436, 2438, 2439, 2440, 2441, 2442, 2443, 2445, + 2446, 2447, 2459, 2448, 2435, 2449, 2450, 2451, 2453, 2454, + 2455, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2457, 2458, + + 2468, 2469, 2470, 2471, 2474, 2475, 2476, 2478, 2479, 2480, + 2459, 2484, 2485, 2489, 2491, 2492, 2493, 2494, 2495, 2461, + 2462, 2463, 2464, 2465, 2466, 2467, 2496, 2497, 2468, 2469, + 2470, 2471, 2474, 2475, 2476, 2478, 2479, 2480, 2498, 2484, + 2485, 2499, 2501, 2505, 2493, 2494, 2495, 2504, 2516, 2512, + 2819, 1761, 2514, 2515, 2496, 2497, 1760, 2505, 2489, 2491, + 2492, 2819, 2503, 2518, 2504, 2503, 2498, 2503, 2506, 2499, + 2501, 2506, 2503, 2506, 2507, 2503, 2516, 2507, 2506, 2507, + 2519, 2520, 1759, 2508, 2507, 2505, 2508, 2507, 2508, 2503, + 2521, 2518, 2504, 2508, 2512, 2506, 2508, 2514, 2515, 2522, + + 2524, 2507, 2525, 2526, 2528, 2529, 2530, 2531, 2519, 2520, + 2508, 2532, 2533, 2534, 2535, 2536, 2537, 2503, 2521, 2538, + 2539, 2540, 2541, 2506, 2542, 2543, 2544, 2522, 2524, 2507, + 2525, 2526, 2528, 2529, 2530, 2531, 2545, 2546, 2508, 2532, + 2533, 2534, 2535, 2536, 2537, 2547, 2548, 2538, 2539, 2540, + 2541, 2549, 2542, 2543, 2544, 2550, 2552, 2554, 2555, 2556, + 2557, 2558, 2559, 2560, 2545, 2546, 2561, 2563, 2563, 2568, + 2563, 2569, 2570, 2547, 2548, 2566, 2566, 2571, 2566, 2549, + 2575, 2576, 2577, 2550, 2552, 2554, 2555, 2556, 2557, 2558, + 2559, 2560, 2574, 2578, 2561, 2574, 2579, 2568, 2580, 2569, + + 2570, 2581, 1732, 2582, 2584, 2571, 2585, 2587, 2575, 2576, + 2577, 2583, 2588, 2589, 2583, 2590, 2583, 1728, 2591, 2595, + 2596, 2578, 2563, 2597, 2579, 2598, 2580, 2599, 2600, 2581, + 2566, 2582, 2584, 2604, 2585, 2587, 2602, 2563, 2602, 2603, + 2588, 2589, 2603, 2590, 2606, 2566, 2591, 2595, 2596, 2607, + 2608, 2597, 2609, 2598, 2611, 2599, 2600, 2612, 2613, 2614, + 2615, 2604, 2614, 2616, 2602, 2617, 2602, 2618, 2619, 2621, + 2622, 2623, 2606, 2625, 2623, 2629, 2623, 2607, 2608, 2615, + 2609, 2631, 2611, 2624, 2624, 2612, 2613, 2627, 2615, 2632, + 2627, 2616, 2627, 2617, 2633, 2618, 2619, 2621, 2622, 2634, + + 2635, 2625, 2636, 2629, 2637, 2638, 2640, 2615, 2641, 2631, + 2642, 2624, 2624, 2643, 2644, 2645, 2646, 2632, 2647, 2648, + 2649, 2650, 2633, 2651, 2652, 2653, 2654, 2634, 2635, 2657, + 2636, 2658, 2637, 2638, 2640, 2659, 2641, 2660, 2642, 2661, + 2662, 2643, 2644, 2645, 2646, 2663, 2647, 2648, 2649, 2650, + 2664, 2651, 2652, 2653, 2654, 2665, 2667, 2657, 2668, 2658, + 2669, 2670, 2671, 2659, 2672, 2660, 2674, 2661, 2662, 2675, + 2676, 2678, 2679, 2663, 2680, 2681, 2682, 2683, 2664, 2684, + 2685, 2687, 2688, 2665, 2667, 2689, 2668, 2690, 2669, 2670, + 2671, 2691, 2672, 2692, 2674, 1719, 2710, 2675, 2676, 2678, + + 2679, 2699, 2680, 2681, 2682, 2683, 2695, 2702, 2782, 2687, + 2688, 2782, 2700, 2689, 2701, 2690, 2711, 2701, 2699, 2691, + 2695, 2692, 1715, 2696, 2684, 2685, 2696, 2697, 2696, 2700, + 2697, 2701, 2697, 2696, 1713, 2702, 2696, 2697, 1711, 2703, + 2697, 2710, 2703, 1701, 2703, 2712, 2699, 2713, 2695, 2703, + 2696, 2714, 2703, 2704, 2697, 2716, 2704, 2700, 2704, 2705, + 2717, 2711, 2705, 2704, 2705, 1659, 2703, 2783, 2718, 2705, + 2783, 2707, 2705, 2712, 2707, 2713, 2707, 2719, 2696, 2714, + 2704, 2707, 2697, 2716, 2707, 2720, 2705, 2721, 2717, 1649, + 2708, 2722, 2723, 2708, 2703, 2708, 2718, 2724, 2707, 2725, + + 2708, 2726, 2727, 2708, 2728, 2719, 2729, 2730, 2704, 2731, + 2732, 2734, 2735, 2720, 2705, 2721, 2736, 2708, 2737, 2722, + 2723, 2738, 2739, 2740, 2741, 2724, 2707, 2725, 2742, 2726, + 2727, 2743, 2728, 2744, 2729, 2730, 2745, 2731, 2732, 2734, + 2735, 2746, 2748, 2749, 2736, 2708, 2737, 2750, 2751, 2738, + 2739, 2740, 2741, 2752, 2753, 2755, 2742, 2756, 2760, 2743, + 2761, 2744, 2762, 2763, 2745, 2764, 2765, 2766, 2767, 2746, + 2748, 2749, 2770, 2771, 2772, 2750, 2751, 2773, 2774, 2775, + 2776, 2752, 2753, 2755, 2779, 2756, 2760, 2780, 2761, 2781, + 2762, 2763, 2785, 2764, 2765, 2766, 2767, 2786, 2789, 2790, + + 2770, 2771, 2772, 2791, 2793, 2773, 2774, 2775, 2776, 2794, + 2788, 2795, 2779, 2788, 2796, 2780, 2797, 2781, 2798, 2797, + 2785, 2797, 2792, 2799, 2800, 2786, 2789, 2790, 2801, 2802, + 2792, 2792, 2793, 2792, 2791, 2792, 2803, 2794, 2804, 2795, + 2805, 2808, 2796, 2809, 2810, 2814, 2798, 2815, 2817, 2820, + 2792, 2799, 2800, 2821, 2822, 2823, 2801, 2802, 2792, 2792, + 2824, 2792, 2791, 2792, 2803, 2825, 2804, 2826, 2805, 2808, + 2829, 2809, 2810, 2814, 2830, 2815, 2817, 2820, 2831, 2832, + 2833, 2821, 2822, 2823, 2829, 2834, 2836, 2837, 2824, 2838, + 2839, 2840, 2841, 2825, 2842, 2826, 2834, 2843, 2829, 2844, + + 2845, 2846, 2830, 2848, 2849, 2850, 2831, 2832, 2833, 2851, + 2852, 2853, 2854, 2855, 2836, 2837, 2856, 2838, 2839, 2840, + 2841, 2857, 2842, 2858, 2859, 2843, 2860, 2844, 2845, 2846, + 2861, 2848, 2849, 2850, 2862, 2863, 2864, 2851, 2852, 2853, + 2854, 2855, 2865, 2866, 2856, 2867, 2868, 2869, 2871, 2857, + 2873, 2858, 2859, 2892, 2860, 1579, 2892, 2952, 2861, 2995, + 2952, 1574, 2862, 2863, 2864, 2898, 2871, 2873, 2881, 1572, + 2995, 2866, 2895, 2867, 2868, 2869, 2871, 2958, 2872, 2875, + 2958, 2872, 2875, 2872, 2875, 2881, 1550, 2865, 2872, 2875, + 2900, 2872, 2901, 2898, 2871, 2873, 1546, 2876, 2877, 2882, + + 2876, 2877, 2876, 2877, 2883, 2872, 2875, 2876, 2877, 2878, + 2876, 2877, 2878, 2881, 2878, 2884, 2882, 2895, 2900, 2878, + 2901, 2883, 2878, 2902, 2876, 2877, 2903, 2904, 2973, 2905, + 2906, 2973, 2884, 2872, 2875, 2886, 2878, 1529, 2886, 2907, + 2886, 1528, 1525, 2980, 2882, 2886, 2980, 3054, 2886, 2883, + 3054, 2902, 2876, 2877, 2903, 2904, 2888, 2905, 2906, 2888, + 2884, 2888, 2886, 1471, 2878, 2889, 2888, 2907, 2889, 2888, + 2889, 2890, 1470, 2909, 2890, 2889, 2890, 2891, 2889, 1463, + 2891, 2890, 2891, 2888, 2910, 1462, 2893, 2891, 2912, 2893, + 2886, 2893, 2889, 2914, 2916, 2917, 2893, 2894, 2890, 2893, + + 2894, 2909, 2894, 2918, 2891, 2920, 2921, 2894, 2922, 2923, + 2894, 2888, 2910, 2893, 2924, 2925, 2912, 2926, 2927, 2928, + 2889, 2914, 2916, 2917, 2894, 2929, 2890, 2930, 2934, 2935, + 2936, 2918, 2891, 2920, 2921, 2938, 2922, 2923, 2939, 2940, + 2941, 2893, 2924, 2925, 2942, 2926, 2927, 2928, 2943, 2945, + 2947, 2948, 2894, 2929, 2949, 2930, 2934, 2935, 2936, 2950, + 2951, 2953, 2955, 2938, 2956, 2957, 2939, 2940, 2941, 2962, + 2959, 2963, 2942, 2959, 2965, 2959, 2943, 2945, 2947, 2948, + 2966, 2967, 2949, 2968, 2969, 2970, 2972, 2950, 2951, 2953, + 2955, 2977, 2956, 2957, 2971, 2978, 2974, 2962, 2976, 2963, + + 2974, 2976, 2965, 2976, 2979, 2971, 2971, 2974, 2966, 2967, + 2981, 2968, 2969, 2970, 2972, 2982, 2983, 2984, 2986, 2977, + 2987, 2988, 2971, 2978, 2974, 2992, 2993, 2996, 2974, 2998, + 2999, 3000, 2979, 2971, 2971, 2974, 3001, 3002, 2981, 3003, + 3004, 3005, 3007, 2982, 2983, 2984, 2986, 3008, 2987, 2988, + 3006, 3006, 3009, 2992, 2993, 2996, 3010, 2998, 2999, 3000, + 3011, 3012, 3014, 3015, 3001, 3002, 3016, 3003, 3004, 3005, + 3007, 3017, 3018, 3019, 3020, 3008, 3021, 3022, 3006, 3006, + 3009, 3023, 3024, 3026, 3010, 3025, 3028, 3029, 3011, 3012, + 3014, 3015, 3023, 3030, 3016, 3032, 3025, 3034, 1461, 3017, + + 3018, 3019, 3020, 3035, 3021, 3022, 3036, 3038, 3039, 3040, + 3024, 3026, 3041, 3042, 3028, 3029, 3044, 3045, 3046, 3048, + 3049, 3030, 3023, 3032, 3065, 3034, 3025, 3065, 3055, 3070, + 3071, 3035, 3292, 3046, 3036, 3038, 3039, 3040, 3053, 3102, + 3041, 3042, 3102, 3292, 3044, 3045, 3046, 3048, 3049, 3051, + 3072, 3061, 3051, 3074, 3051, 3053, 3055, 3070, 3071, 3051, + 3056, 3046, 3051, 3056, 3057, 3056, 3076, 3057, 3061, 3057, + 3056, 3062, 3058, 3056, 3057, 3058, 3051, 3058, 3072, 3078, + 1406, 3074, 3058, 3053, 3079, 3058, 3080, 3056, 3062, 3114, + 3059, 3057, 3114, 3059, 3076, 3059, 3061, 1405, 3118, 3058, + + 3059, 3118, 3142, 3059, 3051, 3142, 3081, 3078, 3064, 3083, + 3084, 3064, 3079, 3064, 3080, 3056, 3062, 3059, 3064, 3057, + 3066, 3064, 3085, 3066, 3086, 3066, 3067, 3058, 3087, 3067, + 3066, 3067, 3088, 3066, 3081, 3064, 3067, 3083, 3084, 3067, + 3089, 3090, 3092, 3093, 3094, 3059, 3095, 3066, 3097, 3098, + 3085, 3099, 3086, 3067, 3100, 3101, 3087, 3103, 3104, 3105, + 3088, 3107, 3108, 3064, 3109, 3110, 3111, 3113, 3089, 3090, + 3092, 3093, 3094, 3116, 3095, 3066, 3097, 3098, 3655, 3099, + 3657, 3067, 3100, 3101, 1394, 3103, 3104, 3105, 3112, 3107, + 3108, 3112, 3109, 3110, 3111, 3113, 3121, 3120, 3122, 3124, + + 3120, 3116, 3120, 3125, 3126, 3112, 3112, 3112, 3112, 3112, + 3112, 3112, 3112, 3112, 3127, 3128, 3129, 3130, 3131, 3132, + 3133, 3135, 3241, 1370, 3121, 3241, 3122, 3124, 3655, 1369, + 3657, 3125, 3126, 3134, 3136, 3137, 3134, 3139, 3140, 3141, + 3143, 3144, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3135, + 3134, 3134, 3134, 3134, 3134, 3134, 3134, 3134, 3134, 3145, + 3146, 3148, 3136, 3137, 3149, 3139, 3140, 3141, 3143, 3144, + 3150, 3152, 3153, 3155, 3156, 3157, 3159, 3160, 3162, 3163, + 3164, 3165, 3166, 3167, 3169, 3170, 3171, 3145, 3146, 3148, + 3172, 3173, 3149, 3175, 3176, 3177, 3178, 3180, 3150, 3152, + + 3153, 3155, 3156, 3157, 3159, 3160, 3162, 3163, 3164, 3165, + 3166, 3167, 3169, 3170, 3171, 3182, 3185, 3188, 3172, 3173, + 3189, 3175, 3176, 3177, 3178, 3180, 3191, 3193, 3188, 3194, + 1365, 3195, 3196, 3197, 3198, 3199, 3201, 3202, 3203, 3204, + 3205, 3206, 3245, 3182, 3185, 3245, 3219, 3245, 3189, 3273, + 3220, 3205, 3273, 3281, 3191, 3193, 3281, 3194, 3188, 3195, + 3196, 3197, 3198, 3199, 3201, 3202, 3203, 3204, 3205, 3206, + 3207, 3208, 1364, 3207, 3219, 3207, 1363, 3213, 3220, 3205, + 3207, 3210, 3211, 3207, 3210, 3211, 3210, 3211, 3208, 1362, + 3212, 3210, 3211, 3212, 3213, 3212, 1361, 3207, 1359, 3221, + + 3212, 3214, 3215, 3212, 3214, 3215, 3214, 3215, 3210, 3211, + 3222, 3214, 3215, 3223, 3214, 3215, 3208, 3212, 3225, 3226, + 1327, 3217, 3213, 3227, 3217, 3207, 3217, 3221, 3214, 3215, + 3229, 3217, 3230, 3231, 3217, 3232, 3210, 3211, 3222, 3218, + 3233, 3223, 3218, 3234, 3218, 3212, 3225, 3226, 3217, 3218, + 3237, 3227, 3218, 3238, 3239, 3240, 3214, 3215, 3229, 3242, + 3230, 3231, 3243, 3232, 3246, 3247, 3218, 3248, 3233, 3249, + 3250, 3234, 3251, 3252, 3253, 1323, 3217, 3285, 3237, 1294, + 3285, 3238, 3239, 3240, 3255, 3260, 3287, 3242, 3260, 3287, + 3243, 1286, 3246, 3247, 3218, 3248, 3256, 3249, 3250, 3256, + + 3251, 3252, 3253, 3254, 3254, 3254, 3254, 3254, 3254, 3254, + 3254, 3254, 3255, 3256, 3256, 3256, 3256, 3256, 3256, 3256, + 3256, 3256, 3257, 3259, 3262, 3263, 3264, 3265, 3266, 3267, + 3268, 3260, 3269, 3270, 3271, 3272, 3272, 3272, 3272, 3272, + 3272, 3272, 3272, 3272, 3274, 3275, 3277, 3278, 3279, 3282, + 3257, 3259, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3260, + 3269, 3270, 3271, 3283, 3284, 3286, 3288, 3289, 3290, 3291, + 3293, 3294, 3274, 3275, 3277, 3278, 3279, 3282, 3295, 3296, + 3298, 3299, 3300, 3301, 3302, 3306, 3307, 3308, 3309, 3310, + 3313, 3283, 3284, 3286, 3288, 3289, 3290, 3291, 3293, 3294, + + 3314, 3315, 3318, 3320, 3321, 3322, 3295, 3296, 3298, 3299, + 3300, 3301, 3302, 3306, 3307, 3308, 3309, 3310, 3313, 3316, + 3323, 3324, 3325, 3326, 3327, 3329, 3330, 3316, 3314, 3315, + 3318, 3320, 3321, 3322, 3331, 3332, 3333, 3334, 3338, 3360, + 3336, 3338, 3360, 1284, 1279, 1274, 3341, 3316, 3323, 3324, + 3325, 3326, 3327, 3329, 3330, 3316, 3335, 3336, 3342, 3335, + 3343, 3335, 3331, 3332, 3333, 3334, 3335, 3337, 3339, 3335, + 3337, 3339, 3337, 3339, 3341, 3344, 3345, 3337, 3339, 3340, + 3337, 3339, 3340, 3335, 3340, 3336, 3342, 3348, 3343, 3340, + 3350, 3352, 3340, 3353, 3337, 3339, 3354, 3355, 3356, 3358, + + 1217, 3361, 3364, 3344, 3345, 3365, 3340, 3366, 3367, 3368, + 3369, 3335, 3370, 3371, 3372, 3348, 3374, 3390, 3350, 3352, + 3390, 3353, 3337, 3339, 3354, 3355, 3356, 3358, 3359, 3361, + 3364, 3359, 3409, 3365, 3340, 3366, 3367, 3368, 3369, 1216, + 3370, 3371, 3372, 3409, 3374, 3359, 3359, 3359, 3359, 3359, + 3359, 3359, 3359, 3359, 3362, 3362, 3362, 3362, 3362, 3362, + 3362, 3362, 3362, 3362, 3362, 3363, 3363, 3363, 3363, 3363, + 3363, 3363, 3363, 3363, 3363, 3363, 3376, 3378, 1215, 3362, + 3373, 3373, 3373, 3373, 3373, 3373, 3373, 3373, 3373, 3377, + 3363, 3380, 3377, 3381, 3382, 3383, 3384, 3385, 3386, 3387, + + 3388, 3393, 3394, 1214, 3376, 3378, 3377, 3377, 3377, 3377, + 3377, 3377, 3377, 3377, 3377, 3391, 3396, 3392, 3391, 3380, + 3392, 3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3393, + 3394, 3395, 3397, 3398, 3395, 3399, 3400, 3462, 3399, 3400, + 3462, 3414, 1213, 3403, 3396, 3401, 3405, 3407, 3401, 3411, + 3412, 3413, 3414, 3415, 3416, 3418, 1212, 1208, 3419, 3420, + 3397, 3398, 3401, 3401, 3401, 3401, 3401, 3401, 3401, 3401, + 3401, 3403, 3421, 3422, 3405, 3407, 3417, 3411, 3412, 3413, + 3423, 3415, 3416, 3418, 3417, 3417, 3419, 3420, 3424, 3425, + 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3434, 3435, 3436, + + 3421, 3422, 3437, 3438, 3417, 3439, 3440, 3439, 3423, 3441, + 3442, 3444, 3417, 3417, 3445, 1207, 3424, 3425, 3426, 3427, + 3428, 3429, 3430, 3431, 3432, 3434, 3435, 3436, 3447, 3448, + 3437, 3438, 3449, 3451, 3440, 3453, 3457, 3441, 3442, 3444, + 3446, 3459, 3445, 3446, 3464, 3446, 3465, 3466, 3467, 3487, + 3446, 3497, 3487, 3446, 3497, 3547, 3447, 3448, 3547, 3555, + 3449, 3451, 3555, 3453, 3457, 3468, 3469, 3446, 3470, 3459, + 3472, 3473, 3464, 3476, 3465, 3466, 3467, 3439, 3460, 3460, + 3460, 3460, 3460, 3460, 3460, 3460, 3460, 3461, 3559, 3463, + 3461, 3559, 3461, 3468, 3469, 3446, 3470, 3488, 3472, 3473, + + 3488, 3476, 3488, 1206, 3461, 3461, 3461, 3461, 3461, 3461, + 3461, 3461, 3461, 3463, 3463, 3463, 3463, 3463, 3463, 3463, + 3463, 3463, 3463, 3463, 3475, 3475, 3475, 3475, 3475, 3475, + 3475, 3475, 3475, 3477, 3478, 3479, 3480, 3481, 3463, 3482, + 3481, 3483, 3484, 3485, 3489, 3490, 3491, 3489, 3492, 3489, + 3493, 3492, 3494, 3492, 3495, 3500, 3632, 3635, 1192, 3632, + 3635, 3477, 3478, 3479, 3480, 3677, 3481, 3482, 3505, 3483, + 3484, 3485, 3573, 3490, 3491, 3573, 3677, 3573, 3493, 1190, + 3494, 3498, 3495, 3500, 3498, 3499, 3499, 3499, 3499, 3499, + 3499, 3499, 3499, 3499, 3481, 3506, 3505, 3507, 3498, 3498, + + 3498, 3498, 3498, 3498, 3498, 3498, 3498, 3504, 3509, 3510, + 3511, 3512, 3513, 3504, 3514, 3515, 3517, 3520, 3522, 3523, + 3524, 3525, 3526, 3506, 3529, 3507, 3530, 3532, 3533, 3576, + 3774, 1185, 3576, 3774, 3576, 3504, 3509, 3510, 3511, 3512, + 3513, 3504, 3514, 3515, 3517, 3520, 3522, 3523, 3524, 3525, + 3526, 3535, 3529, 3536, 3530, 3532, 3533, 3534, 3534, 3534, + 3534, 3534, 3534, 3534, 3534, 3534, 3534, 3534, 3537, 3540, + 3541, 3542, 3543, 3545, 3546, 3638, 1157, 1152, 3638, 3535, + 3638, 3536, 3534, 3548, 3548, 3548, 3548, 3548, 3548, 3548, + 3548, 3548, 3552, 3553, 3554, 3556, 3537, 3540, 3541, 3542, + + 3543, 3545, 3546, 3549, 3549, 3549, 3549, 3549, 3549, 3549, + 3549, 3549, 3550, 3557, 3558, 3550, 3560, 3561, 3562, 3564, + 3552, 3553, 3554, 3556, 3565, 3567, 3568, 3569, 3571, 3550, + 3550, 3550, 3550, 3550, 3550, 3550, 3550, 3550, 3578, 3579, + 3566, 3557, 3558, 3566, 3560, 3561, 3562, 3564, 3570, 1142, + 3581, 3570, 3565, 3567, 3568, 3569, 3571, 3566, 3566, 3566, + 3566, 3566, 3566, 3566, 3566, 3566, 3578, 3579, 3582, 3583, + 3584, 3588, 3589, 3590, 3592, 3594, 3595, 3570, 3581, 3596, + 3597, 3598, 3599, 3600, 3584, 3584, 3584, 3584, 3584, 3584, + 3584, 3584, 3584, 1131, 1129, 3585, 3582, 3583, 3585, 3588, + + 3589, 3590, 3592, 3594, 3595, 3570, 3601, 3596, 3597, 3598, + 3599, 3600, 3585, 3585, 3585, 3585, 3585, 3585, 3585, 3585, + 3585, 3586, 3586, 3586, 3586, 3586, 3586, 3586, 3586, 3586, + 3602, 3603, 3604, 3605, 3601, 3606, 3607, 3608, 3611, 3615, + 1127, 3617, 3618, 3616, 3616, 3616, 3616, 3616, 3616, 3616, + 3616, 3616, 3616, 3616, 3619, 3622, 3624, 3625, 3602, 3603, + 3604, 3605, 1126, 3606, 3607, 3608, 3611, 3615, 3616, 3617, + 3618, 3775, 1112, 3628, 3775, 3628, 3628, 3629, 3628, 3631, + 3633, 1111, 3619, 3622, 3624, 3625, 3628, 3637, 3639, 3629, + 3629, 3629, 3629, 3629, 3629, 3629, 3629, 3629, 3630, 3630, + + 3630, 3630, 3630, 3630, 3630, 3630, 3630, 3631, 3633, 3634, + 3640, 3641, 3634, 3642, 3643, 3637, 3639, 3644, 3644, 3644, + 3644, 3644, 3644, 3644, 3644, 3644, 3634, 3634, 3634, 3634, + 3634, 3634, 3634, 3634, 3634, 3645, 3646, 1107, 3640, 3641, + 3701, 3642, 3643, 3701, 1106, 3701, 3649, 3650, 3648, 3653, + 3654, 3648, 3658, 3659, 3654, 3660, 3662, 3628, 3663, 3664, + 3666, 3654, 1105, 3645, 3646, 3648, 3648, 3648, 3648, 3648, + 3648, 3648, 3648, 3648, 3649, 3650, 3661, 3653, 3654, 3667, + 3658, 3659, 3654, 3660, 3662, 3668, 3663, 3664, 3666, 3654, + 3661, 3661, 3661, 3661, 3661, 3661, 3661, 3661, 3661, 3669, + + 3670, 3671, 3672, 3673, 3674, 3675, 3676, 3667, 3678, 3679, + 3681, 3687, 3689, 3668, 3691, 3693, 1104, 3700, 3704, 3678, + 1103, 3704, 1063, 3704, 3702, 3740, 3709, 3669, 3670, 3671, + 3672, 3673, 3674, 3675, 3676, 1011, 3740, 3679, 3681, 3687, + 3689, 1010, 3691, 3693, 3694, 3700, 3694, 3694, 3695, 3694, + 3695, 3695, 3702, 3695, 3709, 3707, 3710, 3694, 3707, 3711, + 3707, 3695, 3703, 3703, 3703, 3703, 3703, 3703, 3703, 3703, + 3703, 3712, 3713, 3714, 3715, 3716, 3716, 3716, 3716, 3716, + 3716, 3716, 3716, 3716, 3710, 3717, 3718, 3711, 3721, 3722, + 3723, 3724, 3726, 3728, 3729, 3730, 3731, 3732, 3733, 3712, + + 3713, 3714, 3715, 3734, 3748, 3735, 3736, 3738, 3739, 3741, + 3743, 3744, 3747, 3717, 3718, 3748, 3721, 3722, 3723, 3724, + 3752, 3728, 3729, 3730, 3731, 3732, 3733, 3754, 3694, 3758, + 3755, 3734, 3695, 3735, 3736, 3738, 3739, 3741, 3743, 3744, + 3747, 3755, 3726, 3762, 3760, 3765, 3766, 3760, 3752, 3760, + 3767, 3768, 3769, 3770, 3771, 3754, 3772, 3758, 3755, 3773, + 3776, 3777, 3773, 3778, 3779, 990, 3780, 3782, 3783, 3755, + 3785, 3786, 3787, 3765, 3766, 3788, 3789, 3791, 3767, 3768, + 3769, 3770, 3771, 3792, 3772, 3804, 3796, 3797, 3776, 3777, + 3798, 3799, 3779, 3762, 3780, 3782, 3783, 3801, 3785, 3786, + + 3787, 3806, 3808, 3788, 3789, 3791, 3773, 977, 3809, 3811, + 3812, 3792, 3813, 3778, 3796, 3797, 3814, 3815, 3798, 3799, + 3816, 3817, 3822, 3816, 3818, 3801, 3823, 3818, 3819, 3818, + 3808, 3819, 3824, 3819, 3773, 3804, 3809, 3811, 3812, 3820, + 3813, 3825, 3820, 3821, 3814, 3815, 3821, 3826, 3829, 3817, + 3822, 3806, 3830, 3831, 3823, 3832, 3833, 3834, 3837, 3838, + 3824, 3841, 3838, 3843, 3844, 3845, 3846, 3848, 3849, 3825, + 3851, 3852, 3875, 3851, 3853, 3826, 3829, 3853, 3860, 3853, + 3830, 3831, 3862, 3832, 3833, 3834, 3837, 3863, 3864, 3866, + 3867, 3843, 3844, 3845, 3846, 3848, 3849, 3855, 3857, 3852, + + 3855, 3857, 3855, 3857, 3858, 3868, 3860, 3858, 3869, 3858, + 3862, 3841, 3870, 3871, 3876, 3863, 3864, 3866, 3867, 3878, + 3874, 3879, 3875, 3874, 3871, 3874, 3877, 3871, 3880, 3877, + 3882, 3880, 3885, 3868, 3890, 3885, 3869, 3885, 3891, 3892, + 3870, 3871, 3876, 3887, 3893, 3894, 3887, 3878, 3887, 3879, + 3895, 3896, 3871, 3897, 3898, 3871, 3899, 3900, 3882, 3906, + 3904, 3908, 3890, 3904, 3908, 3904, 3891, 3892, 966, 3909, + 3911, 3907, 3893, 3894, 3907, 946, 928, 3932, 3895, 3896, + 3932, 3897, 3898, 3910, 3899, 3900, 3910, 3906, 3907, 3907, + 3907, 3907, 3907, 3907, 3907, 3907, 3907, 3909, 3911, 3916, + + 3910, 3910, 3910, 3910, 3910, 3910, 3910, 3910, 3910, 3917, + 3918, 3921, 3923, 3924, 3925, 3926, 3930, 3930, 3930, 3930, + 3930, 3930, 3930, 3930, 3930, 903, 891, 3916, 3931, 880, + 878, 3931, 876, 872, 828, 3934, 3937, 3917, 3918, 3921, + 3923, 3924, 3925, 3926, 3938, 3931, 3931, 3931, 3931, 3931, + 3931, 3931, 3931, 3931, 3933, 3933, 3933, 3933, 3933, 3933, + 3933, 3933, 3933, 3934, 3937, 3939, 3942, 3943, 3951, 3954, + 3956, 817, 3938, 3946, 3946, 3946, 3946, 3946, 3946, 3946, + 3946, 3946, 3947, 808, 804, 3947, 773, 772, 770, 3957, + 3958, 3959, 3961, 3939, 3942, 3943, 3951, 3954, 3956, 3947, + + 3947, 3947, 3947, 3947, 3947, 3947, 3947, 3947, 3955, 3955, + 3955, 3955, 3955, 3955, 3955, 3955, 3955, 3957, 3958, 3959, + 3961, 3962, 3963, 769, 768, 766, 761, 760, 758, 757, + 756, 750, 743, 732, 731, 712, 700, 689, 677, 676, + 671, 670, 668, 661, 651, 650, 648, 644, 634, 3962, + 3963, 3966, 3966, 3966, 3966, 3966, 3966, 3966, 3966, 3966, + 3966, 3966, 3966, 3966, 3966, 3966, 3966, 3966, 3966, 3967, + 3967, 3967, 3967, 3967, 3967, 3967, 3967, 3967, 3967, 3967, + 3967, 3967, 3967, 3967, 3967, 3967, 3967, 3968, 3968, 3968, + 3968, 3968, 3968, 3968, 3968, 3968, 3968, 3968, 3968, 3968, + + 3968, 3968, 3968, 3968, 3968, 3969, 3969, 3969, 3969, 3969, 3969, 3969, 3969, 3969, 3969, 3969, 3969, 3969, 3969, 3969, - 3969, 3969, 3969, 3969, 3969, 3969, 3969, 3970, 3970, 3970, - + 3969, 3969, 3969, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, 3970, - 3970, 3970, 3970, 3970, 3970, 3971, 3971, 3971, 3971, 3971, - 3971, 3971, 3971, 3971, 3971, 3971, 3971, 3971, 3971, 3971, - 3971, 3971, 3971, 3972, 731, 3972, 3972, 730, 711, 3972, - 3972, 3972, 3972, 3972, 700, 3972, 3972, 3972, 3972, 3972, + 3970, 3971, 3971, 3971, 3971, 3971, 3971, 3971, 3971, 3971, + 3971, 3971, 3971, 3971, 3971, 3971, 3971, 3971, 3971, 3972, + 3972, 3972, 3972, 3972, 3972, 3972, 3972, 3972, 3972, 3972, + 3972, 3972, 3972, 3972, 3972, 3972, 3972, 3973, 3973, 3973, 3973, 3973, 3973, 3973, 3973, 3973, 3973, 3973, 3973, 3973, - 3973, 3973, 3973, 3973, 3973, 3973, 3973, 3973, 3974, 3974, + 3973, 3973, 3973, 3973, 3973, 3974, 3974, 3974, 3974, 3974, + 3974, 3974, 3974, 3974, 3974, 3974, 3974, 3974, 3974, 3974, - 3974, 3974, 3974, 3974, 689, 3974, 3975, 3975, 3975, 3975, + 3974, 3974, 3974, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, - - 3975, 3975, 3975, 3975, 3976, 3976, 3976, 3976, 3976, 3976, - 3976, 3976, 3976, 3976, 3976, 3976, 3976, 3976, 3976, 3976, - 3976, 3976, 3977, 3977, 3977, 3977, 3977, 3977, 3977, 3977, + 3975, 3976, 3976, 3976, 3976, 3976, 3976, 3976, 3976, 3976, + 3976, 3976, 3976, 3976, 3976, 3976, 3976, 3976, 3976, 3977, 3977, 3977, 3977, 3977, 3977, 3977, 3977, 3977, 3977, 3977, - 3978, 677, 3978, 3978, 676, 671, 3978, 3978, 3978, 3978, - 3978, 670, 3978, 3978, 3978, 3978, 3978, 3979, 3979, 3979, + 3977, 3977, 3977, 3977, 3977, 3977, 3977, 3978, 3978, 3978, + 3978, 3978, 3978, 3978, 3978, 3978, 3978, 3978, 3978, 3978, + 3978, 3978, 3978, 3978, 3978, 3979, 3979, 3979, 3979, 3979, 3979, 3979, 3979, 3979, 3979, 3979, 3979, 3979, 3979, 3979, - 3979, 3979, 3979, 3979, 3979, 3980, 3980, 3980, 3980, 3980, + + 3979, 3979, 3979, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, 3980, - 3980, 668, 3980, 3981, 3981, 3981, 3981, 3981, 3981, 3981, - - 3981, 3981, 3981, 3981, 3981, 3981, 3981, 3981, 3981, 3981, - 3981, 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, - 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3983, + 3980, 3981, 3981, 3981, 3981, 3981, 3981, 3981, 3981, 3981, + 3981, 3981, 3981, 3981, 3981, 3981, 3981, 3981, 3981, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3982, + 3982, 3982, 3982, 3982, 3982, 3982, 3982, 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3983, - 3983, 3983, 3983, 3983, 3983, 3983, 3983, 3984, 3984, 3984, + 3983, 3983, 3983, 3983, 3983, 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, 3984, - 3984, 3984, 3984, 661, 3984, 3985, 3985, 651, 3985, 3985, + 3984, 3984, 3984, 3985, 3985, 3985, 3985, 3985, 3985, 3985, + 3985, 3985, 3985, 3985, 3985, 3985, 3985, 3985, 3985, 3985, - 3985, 3985, 3985, 3986, 3986, 650, 3986, 3986, 3986, 3986, - 3986, 3986, 3986, 3986, 3986, 3986, 3986, 3986, 3986, 3986, - - 3986, 3987, 3987, 648, 3987, 3987, 3987, 3987, 3987, 3987, - 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3988, + 3985, 3986, 3986, 3986, 3986, 3986, 3986, 3986, 3986, 3986, + 3986, 3986, 3986, 3986, 3986, 3986, 3986, 3986, 3986, 3987, + 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3987, + 3987, 3987, 3987, 3987, 3987, 3987, 3987, 3988, 3988, 3988, 3988, 3988, 3988, 3988, 3988, 3988, 3988, 3988, 3988, 3988, - 3988, 3988, 3988, 3988, 3988, 3988, 3988, 3989, 3989, 3989, + 3988, 3988, 3988, 3988, 3988, 3989, 3989, 633, 3989, 3989, 3989, 3989, 3989, 3989, 3989, 3989, 3989, 3989, 3989, 3989, - 3989, 3989, 3989, 644, 3989, 3990, 3990, 3990, 3990, 3990, + 3989, 3989, 3989, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, 3990, - 3990, 3990, 3990, 3991, 3991, 3991, 3991, 3991, 3991, 3991, - 3991, 3991, 3991, 3991, 3991, 3991, 3991, 3991, 3991, 634, - 3991, 3992, 3992, 633, 3992, 3992, 3992, 3992, 3992, 3992, - 3992, 3992, 3992, 3992, 3992, 3992, 3992, 3992, 3992, 3993, + 3990, 3991, 3991, 3991, 3991, 3991, 3991, 3991, 3991, 3991, + 3991, 3991, 3991, 3991, 3991, 3991, 3991, 3991, 3991, 3992, + 3992, 3992, 3992, 3992, 3992, 3992, 3992, 3992, 3992, 3992, + 3992, 3992, 3992, 3992, 3992, 3992, 3992, 3993, 3993, 3993, 3993, 3993, 3993, 3993, 3993, 3993, 3993, 3993, 3993, 3993, - 3993, 3993, 3993, 3993, 3993, 3993, 3993, 3994, 3994, 3994, + 3993, 3993, 3993, 3993, 3993, 3994, 3994, 3994, 3994, 3994, 3994, 3994, 3994, 3994, 3994, 3994, 3994, 3994, 3994, 3994, - 3994, 3994, 3994, 3994, 3994, 3995, 3995, 3995, 3995, 3995, + 3994, 3994, 3994, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, 3995, - 3995, 3995, 3995, 3996, 3996, 3996, 3996, 3996, 3996, 3996, - 3996, 3996, 3996, 3996, 3996, 3996, 3996, 3996, 3996, 3996, - 3996, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, - 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3998, + 3995, 3996, 3996, 3996, 3996, 3996, 3996, 3996, 3996, 3996, + 3996, 3996, 3996, 3996, 3996, 3996, 3996, 3996, 3996, 3997, + 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, + 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3998, 3998, 3998, 3998, 3998, 3998, 3998, 3998, 3998, 3998, 3998, 3998, 3998, - 3998, 3998, 3998, 3998, 3998, 3998, 3998, 3999, 631, 3999, - 3999, 628, 627, 3999, 3999, 3999, 3999, 3999, 625, 3999, - 3999, 3999, 3999, 3999, 3999, 4000, 622, 4000, 4000, 621, - 541, 4000, 4000, 4000, 4000, 4000, 537, 4000, 4000, 4000, - 4000, 4000, 4000, 4001, 4001, 4001, 4001, 4001, 4001, 4001, - 4001, 4001, 4001, 4001, 4001, 4001, 4001, 4001, 4001, 4001, - 4001, 4002, 536, 4002, 4002, 530, 529, 4002, 4002, 4002, - 4002, 4002, 513, 4002, 4002, 4002, 4002, 4002, 4003, 4003, + 3998, 3998, 3998, 3998, 3998, 3999, 3999, 3999, 3999, 3999, + 3999, 3999, 3999, 3999, 3999, 3999, 3999, 3999, 3999, 3999, + 3999, 3999, 3999, 4000, 4000, 4000, 4000, 4000, 4000, 4000, + 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 4000, + 4000, 4001, 4001, 4001, 4001, 4001, 4001, 4001, 4001, 4001, + 4001, 4001, 4001, 4001, 4001, 4001, 4001, 4001, 4001, 4002, + + 4002, 4002, 4002, 4002, 4002, 4002, 4002, 4002, 4002, 4002, + 4002, 4002, 4002, 4002, 4002, 4002, 4002, 4003, 4003, 4003, 4003, 4003, 4003, 4003, 4003, 4003, 4003, 4003, 4003, 4003, - - 4003, 4003, 4003, 4003, 4003, 4003, 4004, 4004, 4004, 4004, + 4003, 4003, 4003, 4003, 4003, 4004, 4004, 4004, 4004, 4004, 4004, 4004, 4004, 4004, 4004, 4004, 4004, 4004, 4004, 4004, - 4004, 4004, 4004, 4004, 4005, 4005, 4005, 4005, 4005, 4005, + 4004, 4004, 4004, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, 4005, - 4005, 4005, 4006, 4006, 4006, 4006, 4006, 4006, 4006, 4006, - 4006, 4006, 4006, 4006, 4006, 4006, 4006, 4006, 4006, 4006, - 4007, 512, 4007, 4007, 506, 504, 4007, 4007, 4007, 4007, - 4007, 490, 4007, 4007, 4007, 4007, 4007, 4007, 4008, 4008, - 4008, 4008, 4008, 4008, 4008, 4008, 4008, 4008, 4008, 4008, - 4008, 4008, 4008, 4008, 4008, 4008, 4009, 4009, 4009, 4009, + 4005, 4006, 4006, 4006, 4006, 4006, 4006, 4006, 4006, 4006, + 4006, 4006, 4006, 4006, 4006, 4006, 4006, 4006, 4006, 4007, + 4007, 631, 4007, 4007, 4007, 4007, 4007, 4007, 4007, 4007, + 4007, 4007, 4007, 4007, 4007, 4007, 4007, 4008, 4008, 628, + 4008, 4008, 4008, 4008, 4008, 4008, 4008, 4008, 4008, 4008, + 4008, 4008, 4008, 4008, 4008, 4009, 4009, 627, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, - 4009, 4009, 4009, 4009, 4010, 478, 4010, 4010, 475, 453, - 4010, 4010, 4010, 4010, 4010, 440, 4010, 4010, 4010, 4010, + 4009, 4009, 4009, 4010, 4010, 4010, 4010, 4010, 4010, 4010, + 4010, 4010, 4010, 4010, 4010, 4010, 4010, 4010, 4010, 4010, 4010, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4011, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4012, 4013, 4013, 4013, - 4013, 4013, 4013, 4013, 4013, 4013, 4013, 4013, 4013, 4013, - 4013, 4013, 4013, 4013, 4013, 4014, 4014, 4014, 4014, 4014, - 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4014, + 4013, 4013, 4013, 4013, 4013, 4013, 4013, 4013, 4013, 4013, + 4013, 4013, 4013, 4013, 4013, 4014, 4014, 625, 4014, 4014, + 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4014, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4015, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4016, 4017, 4017, 4017, 4017, 4017, 4017, 4017, 4017, 4017, 4017, 4017, - 4017, 4017, 4017, 4017, 4017, 4017, 4017, 4018, 4018, 4018, + 4017, 4017, 4017, 4017, 4017, 622, 4017, 4018, 4018, 4018, 4018, 4018, 4018, 4018, 4018, 4018, 4018, 4018, 4018, 4018, + 4018, 4018, 4018, 4018, 4018, 4019, 4019, 4019, 4019, 4019, 4019, 4019, 4019, 4019, 4019, 4019, 4019, 4019, 4019, 4019, - 4019, 4019, 4019, 4020, 4020, 4020, 4020, 4020, 4020, 4020, - + 4019, 621, 4019, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4020, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4021, 4022, - 4022, 434, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, + 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4022, 4023, 4023, 4023, 4023, 4023, 4023, 4023, 4023, 4023, 4023, 4023, 4023, 4023, - 4023, 4023, 4023, 4023, 4023, 4024, 4024, 4024, 4024, 4024, - 4024, 4024, 4024, 4024, 4024, 4024, 4024, 4024, 4024, 4024, - 4024, 4024, 4024, 4025, 4025, 4025, 4025, 4025, 4025, 4025, + 4023, 4023, 4023, 4023, 4023, 4024, 541, 4024, 4024, 537, + + 536, 4024, 4024, 4024, 4024, 4024, 530, 4024, 4024, 4024, + 4024, 4024, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, 4025, + 4026, 4026, 4026, 4026, 4026, 4026, 4026, 4026, 4026, 4026, + 4026, 4026, 4026, 4026, 4026, 4026, 529, 4026, 4027, 4027, + 4027, 4027, 4027, 4027, 4027, 4027, 4027, 4027, 4027, 4027, + 4027, 4027, 4027, 4027, 4027, 4027, 4028, 4028, 4028, 4028, + 4028, 4028, 4028, 4028, 4028, 4028, 4028, 4028, 4028, 4028, + 4028, 4028, 4028, 4028, 4029, 4029, 4029, 4029, 4029, 4029, + 4029, 4029, 4029, 4029, 4029, 4029, 4029, 4029, 4029, 4029, - 4025, 4026, 4026, 4026, 4026, 4026, 4026, 4026, 4026, 4026, - 4026, 4026, 4026, 4026, 4026, 4026, 4026, 4026, 4026, 4027, - 422, 4027, 4027, 413, 412, 4027, 4027, 4027, 4027, 4027, - 393, 4027, 4027, 4027, 4027, 4027, 4027, 4028, 392, 4028, - 4028, 385, 383, 4028, 4028, 4028, 4028, 4028, 368, 4028, - 4028, 4028, 4028, 4028, 4028, 4029, 367, 4029, 4029, 358, - 357, 4029, 4029, 4029, 4029, 4029, 347, 4029, 4029, 4029, - 4029, 4029, 4030, 4030, 4030, 4030, 4030, 4030, 4030, 4030, - 4030, 4030, 4030, 4030, 4030, 4030, 4030, 4030, 4030, 4030, - 4031, 317, 4031, 4031, 316, 284, 4031, 4031, 4031, 4031, - - 4031, 268, 4031, 4031, 4031, 4031, 4031, 4031, 4032, 4032, + 4029, 4029, 4030, 513, 4030, 4030, 512, 506, 4030, 4030, + 4030, 4030, 4030, 504, 4030, 4030, 4030, 4030, 4030, 4031, + 4031, 4031, 4031, 4031, 4031, 4031, 4031, 4031, 4031, 4031, + 4031, 4031, 4031, 4031, 4031, 4031, 4031, 4032, 4032, 4032, 4032, 4032, 4032, 4032, 4032, 4032, 4032, 4032, 4032, 4032, - 4032, 4032, 4032, 4032, 4032, 4032, 4033, 261, 4033, 4033, - 259, 252, 4033, 4033, 4033, 4033, 4033, 234, 4033, 4033, - 4033, 4033, 4033, 4033, 4034, 4034, 4034, 4034, 4034, 4034, + 4032, 4032, 4032, 490, 4032, 4033, 4033, 4033, 4033, 4033, + 4033, 4033, 4033, 4033, 4033, 4033, 4033, 4033, 4033, 4033, + 4033, 4033, 4033, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, 4034, - 4034, 4034, 4035, 4035, 4035, 4035, 4035, 4035, 4035, 4035, - 4035, 4035, 4035, 4035, 4035, 4035, 4035, 4035, 4035, 4035, - 4036, 229, 4036, 4036, 216, 194, 4036, 4036, 4036, 4036, - 4036, 182, 4036, 4036, 4036, 4036, 4036, 4037, 4037, 4037, + 4034, 4035, 4035, 4035, 4035, 4035, 4035, 4035, 4035, 4035, + 4035, 4035, 4035, 4035, 4035, 4035, 4035, 4035, 4035, 4036, + 4036, 4036, 4036, 4036, 4036, 4036, 4036, 4036, 4036, 4036, + 4036, 4036, 4036, 4036, 4036, 478, 4036, 4037, 4037, 475, 4037, 4037, 4037, 4037, 4037, 4037, 4037, 4037, 4037, 4037, - 4037, 4037, 4037, 4037, 4037, 4038, 4038, 4038, 4038, 4038, + 4037, 4037, 4037, 4037, 4037, 4038, 4038, 453, 4038, 4038, 4038, 4038, 4038, 4038, 4038, 4038, 4038, 4038, 4038, 4038, - 4038, 4038, 4038, 4039, 4039, 4039, 4039, 4039, 4039, 4039, + 4038, 4038, 4038, 4039, 4039, 440, 4039, 4039, 4039, 4039, 4039, 4039, 4039, 4039, 4039, 4039, 4039, 4039, 4039, 4039, 4039, 4040, 4040, 4040, 4040, 4040, 4040, 4040, 4040, 4040, - 175, 4040, 4040, 4040, 4040, 4040, 4040, 4040, 4040, 4041, - 4041, 4041, 4041, 4041, 4041, 4041, 4041, 4041, 4041, 4041, - 4041, 4041, 4041, 4041, 4041, 4041, 4041, 4042, 4042, 4042, - 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, + 4040, 4040, 4040, 4040, 4040, 4040, 4040, 4040, 4040, 4041, + 4041, 4041, 4041, 4041, 4041, 4041, 4041, 4041, 4041, 4041, + 4041, 4041, 4041, 4041, 4041, 434, 4041, 4042, 4042, 4042, + 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4042, 4043, 4043, 4043, 4043, 4043, 4043, 4043, 4043, 4043, 4043, 4043, 4043, 4043, 4043, 4043, - 4043, 4043, 4043, 4044, 4044, 4044, 4044, 4044, 4044, 4044, + 4043, 422, 4043, 4044, 4044, 413, 4044, 4044, 4044, 4044, 4044, 4044, 4044, 4044, 4044, 4044, 4044, 4044, 4044, 4044, - 4044, 4045, 4045, 172, 4045, 4045, 4045, 4045, 4045, 4045, + 4044, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4045, 4046, 4046, 4046, 4046, 4046, 4046, 4046, 4046, 4046, 4046, 4046, + 4046, 4046, 4046, 4046, 4046, 4046, 4046, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4047, 4048, 4048, 4048, 4048, 4048, - 4048, 4048, 4048, 4048, 4048, 4048, 4048, 4048, 4048, 4048, - 4048, 4048, 4048, 4049, 165, 4049, 4049, 164, 163, 4049, - 4049, 4049, 4049, 4049, 154, 4049, 4049, 4049, 4049, 4049, - 4049, 4050, 152, 4050, 4050, 146, 141, 4050, 4050, 4050, - 4050, 4050, 117, 4050, 4050, 4050, 4050, 4050, 4050, 4051, - 4051, 4051, 4051, 4051, 4051, 4051, 4051, 4051, 4051, 4051, - 4051, 4051, 4051, 4051, 4051, 4051, 4051, 4052, 75, 4052, - 4052, 64, 63, 4052, 4052, 4052, 4052, 4052, 58, 4052, + 4048, 4048, 4048, 4049, 4049, 4049, 4049, 4049, 4049, 4049, + 4049, 4049, 4049, 4049, 4049, 4049, 4049, 4049, 4049, 4049, + 4049, 4050, 4050, 4050, 4050, 4050, 4050, 4050, 4050, 4050, + 4050, 4050, 4050, 4050, 4050, 4050, 4050, 4050, 4050, 4051, + 412, 4051, 4051, 393, 392, 4051, 4051, 4051, 4051, 4051, + 385, 4051, 4051, 4051, 4051, 4051, 4051, 4052, 383, 4052, + + 4052, 368, 367, 4052, 4052, 4052, 4052, 4052, 358, 4052, 4052, 4052, 4052, 4052, 4052, 4053, 4053, 4053, 4053, 4053, 4053, 4053, 4053, 4053, 4053, 4053, 4053, 4053, 4053, 4053, - - 4053, 4053, 4053, 4054, 57, 4054, 4054, 56, 55, 4054, - 4054, 4054, 4054, 4054, 4054, 4054, 4054, 4054, 4054, 4054, + 4053, 4053, 4053, 4054, 357, 4054, 4054, 347, 317, 4054, + 4054, 4054, 4054, 4054, 316, 4054, 4054, 4054, 4054, 4054, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4055, 4056, 4056, 4056, 4056, 4056, 4056, 4056, 4056, 4056, 4056, 4056, 4056, - 4056, 4056, 4056, 4056, 4056, 4056, 4057, 54, 4057, 4057, - 53, 52, 4057, 4057, 4057, 51, 4057, 4057, 4057, 4057, - 4057, 4057, 4057, 4057, 4058, 4058, 4058, 4058, 4058, 4058, - 4058, 26, 4058, 25, 4058, 4058, 4058, 4058, 4058, 4058, - 4058, 4058, 4059, 4059, 4059, 4059, 4059, 4059, 4059, 4059, + 4056, 4056, 4056, 4056, 4056, 4056, 4057, 4057, 4057, 4057, + 4057, 4057, 4057, 4057, 4057, 4057, 4057, 4057, 4057, 4057, - 4059, 4059, 4059, 4059, 4059, 4059, 4059, 4059, 4059, 4059, + 4057, 4057, 4057, 4057, 4058, 4058, 4058, 4058, 4058, 4058, + 4058, 4058, 4058, 4058, 4058, 4058, 4058, 4058, 4058, 4058, + 4058, 4058, 4059, 284, 4059, 4059, 268, 261, 4059, 4059, + 4059, 4059, 4059, 259, 4059, 4059, 4059, 4059, 4059, 4059, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4060, 4061, 4061, 4061, 4061, 4061, 4061, 4061, 4061, 4061, 4061, 4061, 4061, - 4061, 4061, 4061, 4061, 4061, 4061, 4062, 4062, 4062, 4062, - 4062, 4062, 4062, 4062, 4062, 4062, 4062, 4062, 4062, 4062, - 4062, 4062, 4062, 4062, 4063, 4063, 24, 4063, 4063, 4063, - 4063, 4063, 4063, 4063, 4063, 4063, 4063, 4063, 4063, 4063, - 4063, 4063, 4064, 4064, 4064, 4064, 4064, 4064, 4064, 4064, - 4064, 4064, 4064, 4064, 4064, 4064, 4064, 4064, 4064, 4064, + 4061, 4061, 4061, 4061, 4061, 4061, 4062, 252, 4062, 4062, + 234, 229, 4062, 4062, 4062, 4062, 4062, 216, 4062, 4062, + 4062, 4062, 4062, 4063, 4063, 4063, 4063, 4063, 4063, 4063, + 4063, 4063, 4063, 4063, 4063, 4063, 4063, 4063, 4063, 4063, + 4063, 4064, 4064, 4064, 4064, 4064, 4064, 4064, 4064, 4064, + 4064, 4064, 4064, 4064, 4064, 4064, 4064, 4064, 4064, 4065, 4065, 4065, 4065, 4065, 4065, 4065, 4065, 4065, 4065, 4065, - 4065, 4065, 4065, 4065, 4065, 4065, 4065, 4065, 4066, 23, - 0, 4066, 0, 0, 4066, 4067, 0, 0, 0, 0, - 0, 4067, 4067, 4067, 0, 4067, 4067, 4067, 4067, 4067, + 4065, 4065, 4065, 4065, 4065, 4065, 4065, 4066, 4066, 4066, + 4066, 4066, 4066, 4066, 4066, 4066, 4066, 4066, 4066, 4066, + 4066, 4066, 4066, 4066, 4066, 4067, 4067, 4067, 4067, 4067, + 4067, 4067, 4067, 4067, 4067, 4067, 4067, 4067, 4067, 4067, 4067, 4067, 4067, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, 4068, - 4068, 4069, 0, 0, 4069, 0, 4069, 4070, 4070, 4070, + + 4068, 4069, 4069, 4069, 4069, 4069, 4069, 4069, 4069, 4069, + 4069, 4069, 4069, 4069, 4069, 4069, 4069, 4069, 4069, 4070, 4070, 4070, 4070, 4070, 4070, 4070, 4070, 4070, 4070, 4070, - 4070, 4070, 4070, 4070, 4070, 4071, 0, 0, 4071, 4071, - 0, 0, 4071, 0, 4071, 0, 4071, 4071, 4071, 4071, - - 4072, 4072, 4072, 4072, 4073, 4073, 0, 4073, 4073, 4073, + 4070, 4070, 4070, 4070, 4070, 4070, 4070, 4071, 4071, 4071, + 4071, 4071, 4071, 4071, 4071, 4071, 4071, 4071, 4071, 4071, + 4071, 4071, 4071, 4071, 4071, 4072, 4072, 4072, 4072, 4072, + 4072, 4072, 4072, 4072, 4072, 4072, 4072, 4072, 4072, 4072, + 4072, 4072, 4072, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, 4073, - 4073, 4073, 4074, 4074, 0, 4074, 4074, 4074, 4074, 4074, - 4074, 4074, 4074, 4074, 4074, 4074, 4074, 4074, 4074, 4074, - 4075, 0, 4075, 0, 4075, 4075, 4075, 4075, 4076, 4076, + 4073, 4074, 4074, 194, 4074, 4074, 4074, 4074, 4074, 4074, + + 4074, 4074, 4074, 4074, 4074, 4074, 4074, 4074, 4074, 4075, + 4075, 4075, 4075, 4075, 4075, 4075, 4075, 4075, 4075, 4075, + 4075, 4075, 4075, 4075, 4075, 4075, 4075, 4076, 4076, 4076, 4076, 4076, 4076, 4076, 4076, 4076, 4076, 4076, 4076, 4076, - 4076, 4076, 4076, 4076, 4076, 4076, 4077, 4077, 4077, 4077, + 4076, 4076, 4076, 4076, 4076, 4077, 4077, 4077, 4077, 4077, 4077, 4077, 4077, 4077, 4077, 4077, 4077, 4077, 4077, 4077, - 4077, 4077, 4077, 4077, 4078, 4078, 4078, 4078, 4078, 4078, + 4077, 4077, 4077, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, 4078, + 4078, 4079, 182, 4079, 4079, 175, 172, 4079, 4079, 4079, + 4079, 4079, 165, 4079, 4079, 4079, 4079, 4079, 4079, 4080, - 4078, 4078, 4079, 4079, 0, 0, 4079, 4079, 4079, 4079, - 4079, 0, 4079, 4079, 4079, 4079, 4079, 4079, 4079, 4079, - 4080, 0, 0, 4080, 4080, 0, 0, 4080, 0, 4080, - 0, 4080, 4080, 4080, 4080, 4081, 4081, 4081, 4081, 4081, - 4081, 4081, 4081, 4081, 4081, 4081, 4081, 4081, 4081, 4081, - 4081, 4081, 4081, 4082, 0, 4082, 4082, 0, 0, 4082, + 164, 4080, 4080, 163, 154, 4080, 4080, 4080, 4080, 4080, + 152, 4080, 4080, 4080, 4080, 4080, 4080, 4081, 146, 4081, + 4081, 141, 117, 4081, 4081, 4081, 4081, 4081, 75, 4081, + 4081, 4081, 4081, 4081, 4082, 4082, 4082, 4082, 4082, 4082, 4082, 4082, 4082, 4082, 4082, 4082, 4082, 4082, 4082, 4082, - 4082, 4083, 4083, 4083, 4083, 4083, 4083, 4083, 4083, 4083, - 4083, 4083, 4083, 4083, 4083, 4083, 4083, 4083, 4083, 4084, - 0, 0, 0, 0, 0, 4084, 4084, 4084, 0, 4084, + 4082, 4082, 4083, 64, 4083, 4083, 63, 58, 4083, 4083, + 4083, 4083, 4083, 57, 4083, 4083, 4083, 4083, 4083, 4083, + 4084, 4084, 4084, 4084, 4084, 4084, 4084, 4084, 4084, 4084, + 4084, 4084, 4084, 4084, 4084, 4084, 4084, 4084, 4085, 56, + 4085, 4085, 55, 54, 4085, 4085, 4085, 4085, 4085, 53, - 4084, 4084, 4084, 4084, 4084, 4084, 4084, 4085, 4085, 0, - 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, - 4085, 4085, 4085, 4085, 4085, 4086, 4086, 0, 4086, 4086, + 4085, 4085, 4085, 4085, 4085, 4085, 4086, 4086, 4086, 4086, 4086, 4086, 4086, 4086, 4086, 4086, 4086, 4086, 4086, 4086, - 4086, 4086, 4086, 4087, 0, 0, 4087, 4087, 0, 0, - 4087, 0, 4087, 0, 4087, 4087, 4087, 4087, 4088, 0, - 0, 0, 0, 0, 4088, 4088, 4088, 0, 4088, 4088, - 4088, 4088, 4088, 4088, 4088, 4088, 4089, 4089, 0, 4089, - 4089, 0, 4089, 4089, 4089, 4089, 4089, 4089, 4089, 4089, - 4089, 4089, 4089, 4090, 0, 4090, 0, 4090, 4090, 4090, + 4086, 4086, 4086, 4086, 4087, 4087, 4087, 4087, 4087, 4087, + 4087, 4087, 4087, 4087, 4087, 4087, 4087, 4087, 4087, 4087, + 4087, 4087, 4088, 52, 4088, 4088, 51, 26, 4088, 4088, + 4088, 4088, 4088, 25, 4088, 4088, 4088, 4088, 4088, 4089, + 4089, 4089, 4089, 4089, 4089, 4089, 4089, 4089, 4089, 4089, + 4089, 4089, 4089, 4089, 4089, 4089, 4089, 4090, 4090, 4090, + 4090, 4090, 4090, 4090, 4090, 4090, 4090, 4090, 4090, 4090, + 4090, 4090, 4090, 4090, 4090, 4091, 4091, 4091, 4091, 4091, - 4090, 4091, 4091, 4091, 4091, 4091, 4091, 4091, 4091, 4091, - 4091, 4091, 4091, 4091, 4091, 4091, 4091, 4091, 4091, 4092, - 0, 4092, 4092, 0, 0, 4092, 4092, 4092, 4092, 4092, - 4092, 4092, 4092, 4092, 4092, 4092, 4092, 4093, 4093, 4093, - 4093, 4093, 4093, 4093, 4093, 4093, 4093, 4093, 4093, 4093, - 4093, 4093, 4093, 4093, 4093, 4094, 4094, 4094, 4094, 4094, + 4091, 4091, 4091, 4091, 4091, 4091, 4091, 4091, 4091, 4091, + 4091, 4091, 4091, 4092, 4092, 4092, 4092, 4092, 4092, 4092, + 4092, 4092, 24, 4092, 4092, 4092, 4092, 4092, 4092, 4092, + 4092, 4093, 4093, 4093, 4093, 4093, 4093, 4093, 4093, 4093, + 4093, 4093, 4093, 4093, 4093, 4093, 4093, 4093, 4093, 4094, 4094, 4094, 4094, 4094, 4094, 4094, 4094, 4094, 4094, 4094, - 4094, 4094, 4094, 4095, 0, 0, 4095, 4095, 0, 0, - 4095, 0, 4095, 0, 4095, 4095, 4095, 4095, 4096, 0, - 4096, 0, 4096, 4096, 4096, 4096, 4097, 0, 0, 4097, + 4094, 4094, 4094, 4094, 4094, 4094, 4094, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095, + 4095, 4095, 4095, 4095, 4095, 4096, 4096, 4096, 4096, 4096, + 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, - 4097, 0, 0, 4097, 0, 4097, 0, 4097, 4097, 4097, - 4097, 4098, 4098, 0, 4098, 4098, 4098, 4098, 4098, 4098, - 4098, 4098, 4098, 4098, 4098, 4098, 4098, 4098, 4099, 0, - 4099, 4099, 0, 0, 4099, 4099, 4099, 4099, 4099, 4099, - 4099, 4099, 4099, 4099, 4099, 4099, 4100, 4100, 4100, 4100, + 4096, 4096, 4096, 4097, 4097, 23, 4097, 4097, 4097, 4097, + 4097, 4097, 4097, 4097, 4097, 4097, 4097, 4097, 4097, 4097, + 4097, 4098, 4098, 4098, 4098, 4098, 4098, 4098, 4098, 4098, + 4098, 4098, 4098, 4098, 4098, 4098, 4098, 4098, 4098, 4099, + 4099, 4099, 4099, 4099, 4099, 4099, 4099, 4099, 4099, 4099, + 4099, 4099, 4099, 4099, 4099, 4099, 4099, 4100, 4100, 4100, 4100, 4100, 4100, 4100, 4100, 4100, 4100, 4100, 4100, 4100, - 4100, 4100, 4100, 4100, 4101, 4101, 4101, 4101, 4101, 4101, - 4101, 4101, 4101, 4101, 4101, 4101, 4101, 4101, 4101, 4101, - 4101, 4101, 4102, 4102, 4102, 4102, 4102, 4102, 4102, 4102, - 4102, 4102, 4102, 4102, 4102, 4102, 4102, 4102, 4102, 4102, + 4100, 4100, 4100, 4100, 4100, 4101, 0, 4101, 4101, 0, + 0, 4101, 4101, 4101, 4101, 4101, 0, 4101, 4101, 4101, + 4101, 4101, 4101, 4102, 0, 4102, 4102, 0, 0, 4102, - 4103, 0, 4103, 4103, 0, 0, 4103, 4103, 4103, 4103, - 4103, 4103, 4103, 4103, 4103, 4103, 4103, 4103, 4104, 4104, - 4104, 4104, 4104, 4104, 4104, 4104, 4104, 4104, 4104, 4104, - 4104, 4104, 4104, 4104, 4104, 4104, 4105, 4105, 4105, 4105, + 4102, 4102, 4102, 4102, 0, 4102, 4102, 4102, 4102, 4102, + 4102, 4103, 4103, 4103, 4103, 4103, 4103, 4103, 4103, 4103, + 4103, 4103, 4103, 4103, 4103, 4103, 4103, 4103, 4103, 4104, + 0, 4104, 4104, 0, 0, 4104, 4104, 4104, 4104, 4104, + 0, 4104, 4104, 4104, 4104, 4104, 4104, 4105, 4105, 4105, 4105, 4105, 4105, 4105, 4105, 4105, 4105, 4105, 4105, 4105, - 4105, 4105, 4105, 4105, 4106, 4106, 0, 4106, 4106, 4106, - 4106, 4106, 4106, 4106, 4106, 4106, 4106, 4106, 4106, 4106, + 4105, 4105, 4105, 4105, 4105, 4106, 0, 4106, 4106, 0, + 0, 4106, 4106, 4106, 4106, 4106, 4106, 4106, 4106, 4106, 4106, 4106, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, - 4108, 4108, 0, 4108, 4108, 4108, 4108, 4108, 4108, 4108, - 4108, 4108, 4108, 4108, 4108, 4108, 4108, 4108, 4109, 4109, - 4109, 4109, 4109, 4109, 4109, 4109, 4109, 4109, 4109, 4109, - 4109, 4109, 4109, 4109, 4109, 4109, 4110, 0, 4110, 0, - 4110, 4110, 4110, 4110, 4111, 0, 4111, 0, 4111, 4111, - 4111, 4111, 4112, 0, 0, 4112, 0, 0, 0, 4112, - 0, 4112, 0, 4112, 4112, 4112, 4112, 4113, 0, 0, - 4113, 4113, 0, 0, 4113, 0, 4113, 0, 4113, 4113, - 4113, 4113, 4114, 0, 0, 4114, 0, 4114, 0, 4114, - 4114, 4114, 4114, 4115, 0, 4115, 0, 4115, 4115, 4115, - 4115, 4116, 0, 4116, 0, 4116, 4116, 4116, 4116, 4117, + 4108, 4108, 4108, 4108, 4108, 4108, 4108, 4108, 4108, 4108, + 4108, 4108, 4108, 4108, 4108, 4108, 4108, 4108, 4109, 0, + 4109, 4109, 0, 0, 4109, 4109, 4109, 0, 4109, 4109, + 4109, 4109, 4109, 4109, 4109, 4109, 4110, 4110, 4110, 4110, + 4110, 4110, 4110, 0, 4110, 0, 4110, 4110, 4110, 4110, + 4110, 4110, 4110, 4110, 4111, 4111, 4111, 4111, 4111, 4111, + 4111, 4111, 4111, 4111, 4111, 4111, 4111, 4111, 4111, 4111, + 4111, 4111, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, + 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, 4112, + 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, - 4117, 0, 4117, 4117, 0, 4117, 4117, 4117, 4117, 4117, - 4117, 4117, 4117, 4117, 4117, 4117, 4118, 0, 0, 4118, - 4118, 0, 0, 4118, 0, 4118, 0, 4118, 4118, 4118, - 4118, 4119, 4119, 0, 4119, 4119, 0, 4119, 4119, 4119, - 4119, 4119, 4119, 4119, 4119, 4119, 4119, 4119, 4120, 4120, + 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4114, 4114, + 4114, 4114, 4114, 4114, 4114, 4114, 4114, 4114, 4114, 4114, + 4114, 4114, 4114, 4114, 4114, 4114, 4115, 4115, 0, 4115, + 4115, 4115, 4115, 4115, 4115, 4115, 4115, 4115, 4115, 4115, + 4115, 4115, 4115, 4115, 4116, 4116, 4116, 4116, 4116, 4116, + 4116, 4116, 4116, 4116, 4116, 4116, 4116, 4116, 4116, 4116, + 4116, 4116, 4117, 4117, 4117, 4117, 4117, 4117, 4117, 4117, + 4117, 4117, 4117, 4117, 4117, 4117, 4117, 4117, 4117, 4117, + 4118, 0, 0, 4118, 0, 0, 4118, 4119, 0, 0, + 0, 0, 0, 4119, 4119, 4119, 0, 4119, 4119, 4119, + + 4119, 4119, 4119, 4119, 4119, 4120, 4120, 4120, 4120, 4120, 4120, 4120, 4120, 4120, 4120, 4120, 4120, 4120, 4120, 4120, - 4120, 4120, 4120, 4120, 4120, 4120, 4121, 4121, 4121, 4121, - 4121, 4121, 4121, 4121, 4121, 4121, 4121, 4121, 4121, 4121, - 4121, 4121, 4121, 4121, 4122, 4122, 4122, 4122, 4122, 4122, + 4120, 4120, 4120, 4121, 0, 0, 4121, 0, 4121, 4122, 4122, 4122, 4122, 4122, 4122, 4122, 4122, 4122, 4122, 4122, - - 4122, 4122, 4123, 0, 4123, 4123, 0, 0, 4123, 4123, - 4123, 4123, 4123, 4123, 4123, 4123, 4123, 4123, 4123, 4123, - 4124, 0, 4124, 4124, 0, 0, 4124, 4124, 4124, 4124, - 4124, 4124, 4124, 4124, 4124, 4124, 4124, 4124, 4125, 4125, + 4122, 4122, 4122, 4122, 4122, 4122, 4122, 4123, 0, 0, + 4123, 4123, 0, 0, 4123, 0, 4123, 0, 4123, 4123, + 4123, 4123, 4124, 4124, 4124, 4124, 4125, 4125, 0, 4125, 4125, 4125, 4125, 4125, 4125, 4125, 4125, 4125, 4125, 4125, - 4125, 4125, 4125, 4125, 4125, 4125, 4126, 4126, 4126, 4126, + 4125, 4125, 4125, 4125, 4126, 4126, 0, 4126, 4126, 4126, 4126, 4126, 4126, 4126, 4126, 4126, 4126, 4126, 4126, 4126, - 4126, 4126, 4126, 4126, 4127, 4127, 4127, 4127, 4127, 4127, - 4127, 4127, 4127, 4127, 4127, 4127, 4127, 4127, 4127, 4127, - 4127, 4127, 4128, 4128, 4128, 4128, 4128, 4128, 4128, 4128, + 4126, 4126, 4127, 0, 4127, 0, 4127, 4127, 4127, 4127, 4128, 4128, 4128, 4128, 4128, 4128, 4128, 4128, 4128, 4128, - 4129, 0, 4129, 4129, 0, 0, 4129, 4129, 4129, 4129, - 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4130, 4130, + 4128, 4128, 4128, 4128, 4128, 4128, 4128, 4128, 4129, 4129, + 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, + 4129, 4129, 4129, 4129, 4129, 4129, 4130, 4130, 4130, 4130, 4130, 4130, 4130, 4130, 4130, 4130, 4130, 4130, 4130, 4130, - 4130, 4130, 4130, 4130, 4130, 4130, 4131, 4131, 4131, 4131, - 4131, 4131, 4131, 4131, 4131, 4131, 4131, 4131, 4131, 4131, - 4131, 4131, 4131, 4131, 4132, 4132, 4132, 4132, 4132, 4132, - 4132, 4132, 4132, 4132, 4132, 4132, 4132, 4132, 4132, 4132, - 4132, 4132, 4133, 0, 4133, 4133, 0, 0, 4133, 4133, + 4130, 4130, 4130, 4130, 4131, 4131, 0, 0, 4131, 4131, + 4131, 4131, 4131, 0, 4131, 4131, 4131, 4131, 4131, 4131, + 4131, 4131, 4132, 0, 0, 4132, 4132, 0, 0, 4132, + 0, 4132, 0, 4132, 4132, 4132, 4132, 4133, 4133, 4133, + 4133, 4133, 4133, 4133, 4133, 4133, 4133, 4133, 4133, 4133, - - 4134, 4134, 4134, 4134, 4134, 4134, 4134, 4134, 4134, 4134, - 4134, 4134, 4134, 4134, 4134, 4134, 4134, 4134, 4135, 4135, + 4133, 4133, 4133, 4133, 4133, 4134, 0, 4134, 4134, 0, + 0, 4134, 4134, 4134, 4134, 4134, 4134, 4134, 4134, 4134, + 4134, 4134, 4134, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, 4135, - 4135, 4135, 4135, 4135, 4135, 4135, 4136, 0, 0, 4136, - 0, 4136, 0, 4136, 4136, 4136, 4136, 4137, 0, 4137, - 0, 4137, 4137, 4137, 4137, 4138, 0, 4138, 0, 4138, - 4138, 4138, 4138, 4139, 0, 4139, 0, 4139, 4139, 4139, - 4139, 4140, 0, 0, 4140, 0, 4140, 0, 4140, 4140, - 4140, 4140, 4141, 4141, 0, 4141, 4141, 0, 4141, 4141, - 4141, 4141, 4141, 4141, 4141, 4141, 4141, 4141, 4141, 4142, + 4135, 4136, 0, 0, 0, 0, 0, 4136, 4136, 4136, + 0, 4136, 4136, 4136, 4136, 4136, 4136, 4136, 4136, 4137, + 4137, 0, 4137, 4137, 4137, 4137, 4137, 4137, 4137, 4137, + 4137, 4137, 4137, 4137, 4137, 4137, 4137, 4138, 4138, 0, + 4138, 4138, 4138, 4138, 4138, 4138, 4138, 4138, 4138, 4138, + + 4138, 4138, 4138, 4138, 4138, 4139, 0, 0, 4139, 4139, + 0, 0, 4139, 0, 4139, 0, 4139, 4139, 4139, 4139, + 4140, 0, 0, 0, 0, 0, 4140, 4140, 4140, 0, + 4140, 4140, 4140, 4140, 4140, 4140, 4140, 4140, 4141, 4141, + 0, 4141, 4141, 0, 4141, 4141, 4141, 4141, 4141, 4141, + 4141, 4141, 4141, 4141, 4141, 4142, 0, 4142, 0, 4142, + 4142, 4142, 4142, 4143, 4143, 4143, 4143, 4143, 4143, 4143, + 4143, 4143, 4143, 4143, 4143, 4143, 4143, 4143, 4143, 4143, + 4143, 4144, 0, 4144, 4144, 0, 0, 4144, 4144, 4144, + 4144, 4144, 4144, 4144, 4144, 4144, 4144, 4144, 4144, 4145, - 0, 0, 4142, 4142, 0, 0, 4142, 0, 4142, 0, - 4142, 4142, 4142, 4142, 4143, 0, 4143, 0, 4143, 4143, - 4143, 4143, 4144, 0, 4144, 0, 4144, 4144, 4144, 4144, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, - 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4146, 4146, + 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4146, 4146, 4146, 4146, 4146, 4146, 4146, 4146, 4146, 4146, 4146, 4146, 4146, - 4146, 4146, 4146, 4146, 4146, 4146, 4147, 4147, 4147, 4147, - 4147, 4147, 4147, 4147, 4147, 4147, 4147, 4147, 4147, 4147, - 4147, 4147, 4147, 4147, 4148, 4148, 4148, 4148, 4148, 4148, - 4148, 4148, 4148, 4148, 4148, 4148, 4148, 4148, 4148, 4148, - - 4148, 4148, 4149, 4149, 4149, 4149, 4149, 4149, 4149, 4149, - 4149, 4149, 4149, 4149, 4149, 4149, 4149, 4149, 4149, 4149, + 4146, 4146, 4146, 4146, 4146, 4147, 0, 0, 4147, 4147, + 0, 0, 4147, 0, 4147, 0, 4147, 4147, 4147, 4147, + 4148, 0, 4148, 0, 4148, 4148, 4148, 4148, 4149, 0, + 0, 4149, 4149, 0, 0, 4149, 0, 4149, 0, 4149, + 4149, 4149, 4149, 4150, 4150, 0, 4150, 4150, 4150, 4150, 4150, 4150, 4150, 4150, 4150, 4150, 4150, 4150, 4150, 4150, - 4150, 4150, 4150, 4150, 4150, 4150, 4150, 4150, 4151, 0, - 4151, 4151, 0, 0, 4151, 4151, 4151, 4151, 4151, 4151, - 4151, 4151, 4151, 4151, 4151, 4151, 4152, 4152, 4152, 4152, + 4151, 0, 4151, 4151, 0, 0, 4151, 4151, 4151, 4151, + + 4151, 4151, 4151, 4151, 4151, 4151, 4151, 4151, 4152, 4152, 4152, 4152, 4152, 4152, 4152, 4152, 4152, 4152, 4152, 4152, - 4152, 4152, 4152, 4152, 4153, 4153, 4153, 4153, 4153, 4153, + 4152, 4152, 4152, 4152, 4152, 4152, 4153, 4153, 4153, 4153, 4153, 4153, 4153, 4153, 4153, 4153, 4153, 4153, 4153, 4153, - 4153, 4153, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, - + 4153, 4153, 4153, 4153, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, 4154, + 4154, 4154, 4155, 0, 4155, 4155, 0, 0, 4155, 4155, 4155, 4155, 4155, 4155, 4155, 4155, 4155, 4155, 4155, 4155, - 4155, 4155, 4155, 4155, 4155, 4155, 4155, 4155, 4156, 4156, - 0, 4156, 4156, 0, 4156, 4156, 4156, 4156, 4156, 4156, - 4156, 4156, 4156, 4156, 4156, 4157, 0, 0, 4157, 4157, - 0, 0, 4157, 0, 4157, 0, 4157, 4157, 4157, 4157, - 4158, 4158, 4158, 4158, 0, 4158, 4158, 4158, 4158, 4158, - 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4159, 0, - 0, 0, 0, 0, 4159, 4159, 4159, 0, 4159, 4159, - 4159, 4159, 4159, 4159, 4159, 4159, 4160, 4160, 4160, 4160, + 4156, 4156, 4156, 4156, 4156, 4156, 4156, 4156, 4156, 4156, + 4156, 4156, 4156, 4156, 4156, 4156, 4156, 4156, 4157, 4157, + 4157, 4157, 4157, 4157, 4157, 4157, 4157, 4157, 4157, 4157, + 4157, 4157, 4157, 4157, 4157, 4157, 4158, 4158, 0, 4158, + 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4158, + 4158, 4158, 4158, 4158, 4159, 4159, 4159, 4159, 4159, 4159, + 4159, 4159, 4159, 4159, 4159, 4159, 4159, 4159, 4159, 4159, + 4159, 4159, 4160, 4160, 0, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, - 4160, 4160, 4160, 4160, 4161, 0, 4161, 0, 4161, 4161, - 4161, 4161, 4162, 4162, 0, 4162, 4162, 0, 4162, 4162, - 4162, 4162, 4162, 4162, 4162, 4162, 4162, 4162, 4162, 4163, - 0, 0, 4163, 4163, 0, 0, 0, 0, 0, 0, - 4163, 4164, 4164, 0, 0, 0, 4164, 4164, 4164, 4164, - 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4165, - 4165, 0, 4165, 4165, 0, 4165, 4165, 4165, 4165, 4165, - 4165, 4165, 4165, 4165, 4165, 4165, 4166, 4166, 0, 4166, - 4166, 0, 4166, 4166, 4166, 4166, 4166, 4166, 4166, 4166, + 4161, 4161, 4161, 4161, 4161, 4161, 4161, 4161, 4161, 4161, + 4161, 4161, 4161, 4161, 4161, 4161, 4161, 4161, 4162, 0, + 4162, 0, 4162, 4162, 4162, 4162, 4163, 0, 4163, 0, + + 4163, 4163, 4163, 4163, 4164, 0, 0, 4164, 0, 0, + 0, 4164, 0, 4164, 0, 4164, 4164, 4164, 4164, 4165, + 0, 0, 4165, 4165, 0, 0, 4165, 0, 4165, 0, + 4165, 4165, 4165, 4165, 4166, 0, 0, 4166, 0, 4166, + 0, 4166, 4166, 4166, 4166, 4167, 0, 4167, 0, 4167, + 4167, 4167, 4167, 4168, 0, 4168, 0, 4168, 4168, 4168, + 4168, 4169, 4169, 0, 4169, 4169, 0, 4169, 4169, 4169, + 4169, 4169, 4169, 4169, 4169, 4169, 4169, 4169, 4170, 0, + 0, 4170, 4170, 0, 0, 4170, 0, 4170, 0, 4170, + 4170, 4170, 4170, 4171, 4171, 0, 4171, 4171, 0, 4171, - 4166, 4166, 4166, 4167, 4167, 0, 4167, 4167, 4167, 4167, - 4167, 4167, 4167, 4167, 4167, 4167, 4167, 4167, 4167, 4167, - 4168, 4168, 0, 4168, 4168, 4168, 4168, 4168, 4168, 4168, - 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4169, 0, 4169, - 0, 4169, 0, 4169, 4169, 4169, 4169, 4170, 4170, 0, - 4170, 4170, 0, 4170, 4170, 4170, 4170, 4170, 4170, 4170, - 4170, 4170, 4170, 4170, 4171, 4171, 0, 4171, 4171, 0, 4171, 4171, 4171, 4171, 4171, 4171, 4171, 4171, 4171, 4171, - 4171, 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4172, - 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4173, + 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4172, + 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4172, 4173, 4173, + 4173, 4173, 4173, 4173, 4173, 4173, 4173, 4173, 4173, 4173, + 4173, 4173, 4173, 4173, 4173, 4173, 4174, 4174, 4174, 4174, + 4174, 4174, 4174, 4174, 4174, 4174, 4174, 4174, 4174, 4174, + 4174, 4174, 4174, 4174, 4175, 0, 4175, 4175, 0, 0, + 4175, 4175, 4175, 4175, 4175, 4175, 4175, 4175, 4175, 4175, + 4175, 4175, 4176, 0, 4176, 4176, 0, 0, 4176, 4176, + 4176, 4176, 4176, 4176, 4176, 4176, 4176, 4176, 4176, 4176, - 0, 4173, 0, 4173, 0, 4173, 4173, 4173, 4173, 4174, - 4174, 0, 4174, 4174, 4174, 4174, 4174, 4174, 4174, 4174, - 4174, 4174, 4174, 4174, 4174, 4174, 4174, 4175, 4175, 0, - 4175, 4175, 0, 4175, 4175, 4175, 4175, 4175, 4175, 4175, - 4175, 4175, 4175, 4175, 4176, 4176, 0, 0, 4176, 4176, - 4176, 4176, 4176, 0, 4176, 4176, 4176, 4176, 4176, 4176, - 4176, 4176, 4177, 4177, 0, 4177, 4177, 0, 4177, 4177, - 4177, 4177, 4177, 4177, 4177, 4177, 4177, 4177, 4177, 4178, - 0, 0, 0, 0, 0, 4178, 4178, 4178, 0, 4178, - 4178, 4178, 4178, 4178, 4178, 4178, 4178, 4179, 0, 0, + 4177, 4177, 4177, 4177, 4177, 4177, 4177, 4177, 4177, 4177, + 4177, 4177, 4177, 4177, 4177, 4177, 4177, 4177, 4178, 4178, + 4178, 4178, 4178, 4178, 4178, 4178, 4178, 4178, 4178, 4178, + 4178, 4178, 4178, 4178, 4178, 4178, 4179, 4179, 4179, 4179, + 4179, 4179, 4179, 4179, 4179, 4179, 4179, 4179, 4179, 4179, + 4179, 4179, 4179, 4179, 4180, 4180, 4180, 4180, 4180, 4180, + 4180, 4180, 4180, 4180, 4180, 4180, 4180, 4180, 4180, 4180, + 4180, 4180, 4181, 0, 4181, 4181, 0, 0, 4181, 4181, + 4181, 4181, 4181, 4181, 4181, 4181, 4181, 4181, 4181, 4181, + 4182, 4182, 4182, 4182, 4182, 4182, 4182, 4182, 4182, 4182, - 0, 0, 0, 4179, 4179, 4179, 0, 4179, 4179, 4179, - 4179, 4179, 4179, 4179, 4179, 4180, 0, 0, 4180, 4180, - 0, 0, 4180, 0, 4180, 0, 4180, 4180, 4180, 4180, - 4181, 4181, 0, 4181, 4181, 0, 4181, 4181, 4181, 4181, - 4181, 4181, 4181, 4181, 4181, 4181, 4181, 4182, 0, 0, - 0, 0, 0, 4182, 4182, 4182, 0, 4182, 4182, 4182, - 4182, 4182, 4182, 4182, 4182, 4183, 0, 4183, 0, 4183, - 4183, 4183, 4183, 4184, 4184, 0, 4184, 4184, 0, 4184, + 4182, 4182, 4182, 4182, 4182, 4182, 4182, 4182, 4183, 4183, + 4183, 4183, 4183, 4183, 4183, 4183, 4183, 4183, 4183, 4183, + 4183, 4183, 4183, 4183, 4183, 4183, 4184, 4184, 4184, 4184, 4184, 4184, 4184, 4184, 4184, 4184, 4184, 4184, 4184, 4184, + 4184, 4184, 4184, 4184, 4185, 0, 4185, 4185, 0, 0, 4185, 4185, 4185, 4185, 4185, 4185, 4185, 4185, 4185, 4185, + 4185, 4185, 4186, 4186, 4186, 4186, 4186, 4186, 4186, 4186, + 4186, 4186, 4186, 4186, 4186, 4186, 4186, 4186, 4186, 4186, + 4187, 4187, 4187, 4187, 4187, 4187, 4187, 4187, 4187, 4187, + 4187, 4187, 4187, 4187, 4187, 4187, 4187, 4187, 4188, 0, - 4185, 4185, 4185, 4185, 4185, 4185, 4185, 4185, 4186, 4186, - 0, 4186, 4186, 0, 4186, 4186, 4186, 4186, 4186, 4186, - 4186, 4186, 4186, 4186, 4186, 4187, 4187, 0, 0, 4187, - 4187, 4187, 4187, 4187, 0, 4187, 4187, 4187, 4187, 4187, - 4187, 4187, 4187, 4188, 4188, 0, 0, 4188, 4188, 4188, - 4188, 4188, 0, 4188, 4188, 4188, 4188, 4188, 4188, 4188, - 4188, 4189, 4189, 0, 4189, 4189, 0, 4189, 4189, 4189, - 4189, 4189, 4189, 4189, 4189, 4189, 4189, 4189, 4190, 4190, - 0, 4190, 4190, 0, 4190, 4190, 4190, 4190, 4190, 4190, - 4190, 4190, 4190, 4190, 4190, 4191, 4191, 0, 0, 4191, + 0, 4188, 0, 4188, 0, 4188, 4188, 4188, 4188, 4189, + 0, 4189, 0, 4189, 4189, 4189, 4189, 4190, 0, 4190, + 0, 4190, 4190, 4190, 4190, 4191, 0, 4191, 0, 4191, + 4191, 4191, 4191, 4192, 0, 0, 4192, 0, 4192, 0, + 4192, 4192, 4192, 4192, 4193, 4193, 0, 4193, 4193, 0, + 4193, 4193, 4193, 4193, 4193, 4193, 4193, 4193, 4193, 4193, + 4193, 4194, 0, 0, 4194, 4194, 0, 0, 4194, 0, + 4194, 0, 4194, 4194, 4194, 4194, 4195, 0, 4195, 0, + 4195, 4195, 4195, 4195, 4196, 0, 4196, 0, 4196, 4196, + 4196, 4196, 4197, 4197, 4197, 4197, 4197, 4197, 4197, 4197, - 4191, 4191, 4191, 4191, 0, 4191, 4191, 4191, 4191, 4191, - 4191, 4191, 4191, 4192, 4192, 0, 0, 4192, 4192, 4192, - 4192, 4192, 0, 4192, 4192, 4192, 4192, 4192, 4192, 4192, - 4192, 4193, 0, 4193, 0, 4193, 0, 4193, 4193, 4193, - 4193, 4194, 4194, 0, 4194, 4194, 4194, 4194, 4194, 4194, - 4194, 4194, 4194, 4194, 4194, 4194, 4194, 4194, 4195, 4195, - 0, 4195, 4195, 0, 4195, 4195, 4195, 4195, 4195, 4195, - 4195, 4195, 4195, 4195, 4195, 4196, 4196, 0, 4196, 4196, - 0, 4196, 4196, 4196, 4196, 4196, 4196, 4196, 4196, 4196, - 4196, 4196, 4197, 0, 4197, 0, 4197, 0, 4197, 4197, + 4197, 4197, 4197, 4197, 4197, 4197, 4197, 4197, 4197, 4197, + 4198, 4198, 4198, 4198, 4198, 4198, 4198, 4198, 4198, 4198, + 4198, 4198, 4198, 4198, 4198, 4198, 4198, 4198, 4199, 4199, + 4199, 4199, 4199, 4199, 4199, 4199, 4199, 4199, 4199, 4199, + 4199, 4199, 4199, 4199, 4199, 4199, 4200, 4200, 4200, 4200, + 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, + 4200, 4200, 4200, 4200, 4201, 4201, 4201, 4201, 4201, 4201, + 4201, 4201, 4201, 4201, 4201, 4201, 4201, 4201, 4201, 4201, + 4201, 4201, 4202, 4202, 4202, 4202, 4202, 4202, 4202, 4202, + 4202, 4202, 4202, 4202, 4202, 4202, 4202, 4202, 4202, 4202, - 4197, 4197, 4198, 0, 0, 0, 0, 0, 4198, 4198, - 4198, 0, 4198, 4198, 4198, 4198, 4198, 4198, 4198, 4198, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913, + 4203, 0, 4203, 4203, 0, 0, 4203, 4203, 4203, 4203, + 4203, 4203, 4203, 4203, 4203, 4203, 4203, 4203, 4204, 4204, + 4204, 4204, 4204, 4204, 4204, 4204, 4204, 4204, 4204, 4204, + 4204, 4204, 4204, 4204, 4204, 4204, 4205, 4205, 4205, 4205, + 4205, 4205, 4205, 4205, 4205, 4205, 4205, 4205, 4205, 4205, + 4205, 4205, 4205, 4205, 4206, 4206, 4206, 4206, 4206, 4206, + 4206, 4206, 4206, 4206, 4206, 4206, 4206, 4206, 4206, 4206, + 4206, 4206, 4207, 4207, 4207, 4207, 4207, 4207, 4207, 4207, + 4207, 4207, 4207, 4207, 4207, 4207, 4207, 4207, 4207, 4207, + 4208, 4208, 0, 4208, 4208, 0, 4208, 4208, 4208, 4208, - 3913, 3913, 3913, 3913, 3913, 3913, 3913, 3913 + 4208, 4208, 4208, 4208, 4208, 4208, 4208, 4209, 0, 0, + 4209, 4209, 0, 0, 4209, 0, 4209, 0, 4209, 4209, + 4209, 4209, 4210, 4210, 4210, 4210, 0, 4210, 4210, 4210, + 4210, 4210, 4210, 4210, 4210, 4210, 4210, 4210, 4210, 4210, + 4211, 0, 0, 0, 0, 0, 4211, 4211, 4211, 0, + 4211, 4211, 4211, 4211, 4211, 4211, 4211, 4211, 4212, 4212, + 4212, 4212, 4212, 4212, 4212, 4212, 4212, 4212, 4212, 4212, + 4212, 4212, 4212, 4212, 4212, 4212, 4213, 0, 4213, 0, + 4213, 4213, 4213, 4213, 4214, 4214, 0, 4214, 4214, 0, + 4214, 4214, 4214, 4214, 4214, 4214, 4214, 4214, 4214, 4214, + + 4214, 4215, 0, 0, 4215, 4215, 0, 0, 0, 0, + 0, 0, 4215, 4216, 4216, 0, 0, 0, 4216, 4216, + 4216, 4216, 4216, 4216, 4216, 4216, 4216, 4216, 4216, 4216, + 4216, 4217, 4217, 0, 4217, 4217, 0, 4217, 4217, 4217, + 4217, 4217, 4217, 4217, 4217, 4217, 4217, 4217, 4218, 4218, + 0, 4218, 4218, 0, 4218, 4218, 4218, 4218, 4218, 4218, + 4218, 4218, 4218, 4218, 4218, 4219, 4219, 0, 4219, 4219, + 4219, 4219, 4219, 4219, 4219, 4219, 4219, 4219, 4219, 4219, + 4219, 4219, 4220, 4220, 0, 4220, 4220, 4220, 4220, 4220, + 4220, 4220, 4220, 4220, 4220, 4220, 4220, 4220, 4220, 4221, + + 0, 4221, 0, 4221, 0, 4221, 4221, 4221, 4221, 4222, + 4222, 0, 4222, 4222, 0, 4222, 4222, 4222, 4222, 4222, + 4222, 4222, 4222, 4222, 4222, 4222, 4223, 4223, 0, 4223, + 4223, 0, 4223, 4223, 4223, 4223, 4223, 4223, 4223, 4223, + 4223, 4223, 4223, 4224, 4224, 4224, 4224, 4224, 4224, 4224, + 4224, 4224, 4224, 4224, 4224, 4224, 4224, 4224, 4224, 4224, + 4224, 4225, 0, 4225, 0, 4225, 0, 4225, 4225, 4225, + 4225, 4226, 4226, 0, 4226, 4226, 4226, 4226, 4226, 4226, + 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4227, + 4227, 0, 4227, 4227, 0, 4227, 4227, 4227, 4227, 4227, + + 4227, 4227, 4227, 4227, 4227, 4227, 4228, 4228, 0, 0, + 4228, 4228, 4228, 4228, 4228, 0, 4228, 4228, 4228, 4228, + 4228, 4228, 4228, 4228, 4229, 4229, 0, 4229, 4229, 0, + 4229, 4229, 4229, 4229, 4229, 4229, 4229, 4229, 4229, 4229, + 4229, 4230, 0, 0, 0, 0, 0, 4230, 4230, 4230, + 0, 4230, 4230, 4230, 4230, 4230, 4230, 4230, 4230, 4231, + 0, 0, 0, 0, 0, 4231, 4231, 4231, 0, 4231, + 4231, 4231, 4231, 4231, 4231, 4231, 4231, 4232, 0, 0, + 4232, 4232, 0, 0, 4232, 0, 4232, 0, 4232, 4232, + 4232, 4232, 4233, 4233, 0, 4233, 4233, 0, 4233, 4233, + + 4233, 4233, 4233, 4233, 4233, 4233, 4233, 4233, 4233, 4234, + 0, 0, 0, 0, 0, 4234, 4234, 4234, 0, 4234, + 4234, 4234, 4234, 4234, 4234, 4234, 4234, 4235, 0, 4235, + 0, 4235, 4235, 4235, 4235, 4236, 4236, 0, 4236, 4236, + 0, 4236, 4236, 4236, 4236, 4236, 4236, 4236, 4236, 4236, + 4236, 4236, 4237, 4237, 4237, 4237, 4237, 4237, 4237, 4237, + 4237, 4237, 4237, 4237, 4237, 4237, 4237, 4237, 4237, 4237, + 4238, 4238, 0, 4238, 4238, 0, 4238, 4238, 4238, 4238, + 4238, 4238, 4238, 4238, 4238, 4238, 4238, 4239, 4239, 0, + 0, 4239, 4239, 4239, 4239, 4239, 0, 4239, 4239, 4239, + + 4239, 4239, 4239, 4239, 4239, 4240, 4240, 0, 0, 4240, + 4240, 4240, 4240, 4240, 0, 4240, 4240, 4240, 4240, 4240, + 4240, 4240, 4240, 4241, 4241, 0, 4241, 4241, 0, 4241, + 4241, 4241, 4241, 4241, 4241, 4241, 4241, 4241, 4241, 4241, + 4242, 4242, 0, 4242, 4242, 0, 4242, 4242, 4242, 4242, + 4242, 4242, 4242, 4242, 4242, 4242, 4242, 4243, 4243, 0, + 0, 4243, 4243, 4243, 4243, 4243, 0, 4243, 4243, 4243, + 4243, 4243, 4243, 4243, 4243, 4244, 4244, 0, 0, 4244, + 4244, 4244, 4244, 4244, 0, 4244, 4244, 4244, 4244, 4244, + 4244, 4244, 4244, 4245, 0, 4245, 0, 4245, 0, 4245, + + 4245, 4245, 4245, 4246, 4246, 0, 4246, 4246, 4246, 4246, + 4246, 4246, 4246, 4246, 4246, 4246, 4246, 4246, 4246, 4246, + 4247, 4247, 0, 4247, 4247, 0, 4247, 4247, 4247, 4247, + 4247, 4247, 4247, 4247, 4247, 4247, 4247, 4248, 4248, 0, + 4248, 4248, 0, 4248, 4248, 4248, 4248, 4248, 4248, 4248, + 4248, 4248, 4248, 4248, 4249, 0, 4249, 0, 4249, 0, + 4249, 4249, 4249, 4249, 4250, 0, 0, 0, 0, 0, + 4250, 4250, 4250, 0, 4250, 4250, 4250, 4250, 4250, 4250, + 4250, 4250, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, + 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965, 3965 } ; static yy_state_type yy_last_accepting_state; @@ -4994,67 +5043,68 @@ static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 1; -static const flex_int16_t yy_rule_linenum[538] = +static const flex_int16_t yy_rule_linenum[544] = { 0, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 526, 527, 528, 529, 530, 531, 532, 533, - 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, - 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 561, 562, 565, 566, - 567, 568, 569, 570, 571, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, - 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, + 527, 528, 530, 531, 532, 533, 534, 535, 536, 537, + 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 565, 566, 569, 570, + 571, 572, 573, 574, 575, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, + 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, - 608, 609, 611, 612, 613, 614, 615, 619, 624, 625, - 630, 631, 632, 637, 638, 639, 644, 649, 650, 651, - 656, 657, 661, 662, 663, 667, 668, 672, 673, 677, - 678, 679, 683, 684, 688, 689, 694, 695, 696, 700, - 704, 705, 713, 718, 719, 724, 725, 726, 735, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, - 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, - 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, - 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, - 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, + 612, 613, 615, 616, 617, 618, 619, 620, 624, 629, + 630, 635, 636, 637, 642, 643, 644, 649, 654, 655, + 656, 661, 662, 666, 667, 668, 672, 673, 677, 678, + 682, 683, 684, 688, 689, 693, 694, 699, 700, 701, + 705, 709, 710, 718, 723, 724, 729, 730, 731, 740, + 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 779, 780, 781, 782, 783, 784, 785, + 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, - 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, - 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, - 839, 840, 841, 842, 843, 844, 846, 847, 848, 850, - 851, 852, 853, 854, 855, 856, 857, 858, 859, 862, - 866, 867, 868, 869, 870, 874, 875, 876, 877, 878, - 879, 883, 884, 885, 886, 891, 892, 893, 894, 895, - 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, + 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, + 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, + 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, + 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, + 846, 847, 848, 849, 850, 851, 852, 853, 854, 856, + 857, 858, 860, 861, 862, 863, 864, 865, 866, 867, + 868, 869, 872, 876, 877, 878, 879, 880, 884, 885, + 886, 887, 888, 889, 893, 894, 895, 896, 901, 902, + 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, - 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, - 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, - 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, - 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, - 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, - 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, - 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, - 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, - 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, - 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, + 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, + 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, + 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, + 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, + 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, + 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, + 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, + 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, - 1006, 1007, 1008, 1009, 1010, 1011, 1014, 1015, 1016, 1017, - 1018, 1019, 1020, 1021, 1022, 1026, 1027, 1028, 1029, 1030, - 1031, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, - 1046, 1047, 1048, 1049, 1050, 1055, 1056, 1057, 1058, 1059, - 1060, 1062, 1063, 1065, 1066, 1072, 1073, 1074, 1075, 1076, - 1077, 1080, 1081, 1082, 1083, 1084, 1085, 1089, 1090, 1091, - 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, - 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, - 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1120, 1121, 1126, - 1130, 1134, 1135, 1139, 1140, 1143, 1144, 1148, 1149, 1153, + 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, + 1023, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, + 1038, 1039, 1040, 1041, 1042, 1043, 1048, 1049, 1050, 1051, + 1052, 1053, 1054, 1055, 1056, 1058, 1059, 1060, 1061, 1062, + 1067, 1068, 1069, 1070, 1071, 1072, 1074, 1075, 1077, 1078, + 1084, 1085, 1086, 1087, 1088, 1089, 1092, 1093, 1094, 1095, + 1096, 1097, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, + 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, + 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, + 1129, 1130, 1131, 1133, 1134, 1139, 1143, 1147, 1148, 1152, - 1154, 1158, 1159, 1164, 1166, 1167, 1168, 1169, 1171, 1172, - 1173, 1174, 1176, 1177, 1178, 1179, 1181, 1183, 1184, 1186, - 1187, 1188, 1189, 1191, 1196, 1197, 1198, 1202, 1203, 1204, - 1209, 1211, 1212, 1213, 1232, 1259, 1289 + 1153, 1156, 1157, 1161, 1162, 1166, 1167, 1171, 1172, 1177, + 1179, 1180, 1181, 1182, 1184, 1185, 1186, 1187, 1189, 1190, + 1191, 1192, 1194, 1196, 1197, 1199, 1200, 1201, 1202, 1204, + 1209, 1210, 1211, 1215, 1216, 1217, 1222, 1224, 1225, 1226, + 1245, 1273, 1303 } ; /* The intent behind this definition is that it'll catch @@ -5140,15 +5190,15 @@ static std::stack YY_PREVIOUS_STATE; #define BEGIN_PREVIOUS() { BEGIN(YY_PREVIOUS_STATE.top()); YY_PREVIOUS_STATE.pop(); } // The location of the current token. -#line 5143 "seclang-scanner.cc" +#line 5194 "seclang-scanner.cc" #define YY_NO_INPUT 1 -#line 490 "seclang-scanner.ll" +#line 494 "seclang-scanner.ll" // Code run each time a pattern is matched. # define YY_USER_ACTION driver.loc.back()->columns (yyleng); -#line 5150 "seclang-scanner.cc" -#line 5151 "seclang-scanner.cc" +#line 5201 "seclang-scanner.cc" +#line 5202 "seclang-scanner.cc" #define INITIAL 0 #define EXPECTING_ACTION_PREDICATE_VARIABLE 1 @@ -5462,15 +5512,15 @@ YY_DECL { /* %% [7.0] user's declarations go here */ -#line 495 "seclang-scanner.ll" - - - #line 499 "seclang-scanner.ll" + + + +#line 503 "seclang-scanner.ll" // Code run each time yylex is called. driver.loc.back()->step(); -#line 5473 "seclang-scanner.cc" +#line 5524 "seclang-scanner.cc" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -5499,13 +5549,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 3914 ) + if ( yy_current_state >= 3966 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_current_state != 3913 ); + while ( yy_current_state != 3965 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -5524,13 +5574,13 @@ do_action: /* This label is used only to access EOF actions. */ { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); - else if ( yy_act < 538 ) + else if ( yy_act < 544 ) fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext ); - else if ( yy_act == 538 ) + else if ( yy_act == 544 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", yytext ); - else if ( yy_act == 539 ) + else if ( yy_act == 545 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); @@ -5548,2849 +5598,2879 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 503 "seclang-scanner.ll" +#line 507 "seclang-scanner.ll" { return p::make_ACTION_APPEND(yytext, *driver.loc.back()); } YY_BREAK case 2: YY_RULE_SETUP -#line 504 "seclang-scanner.ll" +#line 508 "seclang-scanner.ll" { return p::make_ACTION_BLOCK(yytext, *driver.loc.back()); } YY_BREAK case 3: YY_RULE_SETUP -#line 505 "seclang-scanner.ll" +#line 509 "seclang-scanner.ll" { return p::make_ACTION_CAPTURE(yytext, *driver.loc.back()); } YY_BREAK case 4: YY_RULE_SETUP -#line 506 "seclang-scanner.ll" +#line 510 "seclang-scanner.ll" { return p::make_ACTION_CHAIN(yytext, *driver.loc.back()); } YY_BREAK case 5: YY_RULE_SETUP -#line 507 "seclang-scanner.ll" +#line 511 "seclang-scanner.ll" { return p::make_ACTION_DENY(yytext, *driver.loc.back()); } YY_BREAK case 6: YY_RULE_SETUP -#line 508 "seclang-scanner.ll" +#line 512 "seclang-scanner.ll" { return p::make_ACTION_DEPRECATE_VAR(yytext, *driver.loc.back()); } YY_BREAK case 7: YY_RULE_SETUP -#line 509 "seclang-scanner.ll" +#line 513 "seclang-scanner.ll" { return p::make_ACTION_DROP(yytext, *driver.loc.back()); } YY_BREAK case 8: YY_RULE_SETUP -#line 510 "seclang-scanner.ll" +#line 514 "seclang-scanner.ll" { return p::make_ACTION_ID(yytext, *driver.loc.back()); } YY_BREAK case 9: YY_RULE_SETUP -#line 511 "seclang-scanner.ll" +#line 515 "seclang-scanner.ll" { return p::make_ACTION_LOG(yytext, *driver.loc.back()); } YY_BREAK case 10: YY_RULE_SETUP -#line 512 "seclang-scanner.ll" +#line 516 "seclang-scanner.ll" { return p::make_ACTION_MULTI_MATCH(yytext, *driver.loc.back()); } YY_BREAK case 11: YY_RULE_SETUP -#line 513 "seclang-scanner.ll" +#line 517 "seclang-scanner.ll" { return p::make_ACTION_NO_AUDIT_LOG(yytext, *driver.loc.back()); } YY_BREAK case 12: YY_RULE_SETUP -#line 514 "seclang-scanner.ll" +#line 518 "seclang-scanner.ll" { return p::make_ACTION_NO_LOG(yytext, *driver.loc.back()); } YY_BREAK case 13: YY_RULE_SETUP -#line 515 "seclang-scanner.ll" +#line 519 "seclang-scanner.ll" { return p::make_ACTION_PASS(yytext, *driver.loc.back()); } YY_BREAK case 14: YY_RULE_SETUP -#line 516 "seclang-scanner.ll" +#line 520 "seclang-scanner.ll" { return p::make_ACTION_PAUSE(yytext, *driver.loc.back()); } YY_BREAK case 15: YY_RULE_SETUP -#line 517 "seclang-scanner.ll" +#line 521 "seclang-scanner.ll" { return p::make_ACTION_PREPEND(yytext, *driver.loc.back()); } YY_BREAK case 16: YY_RULE_SETUP -#line 518 "seclang-scanner.ll" +#line 522 "seclang-scanner.ll" { return p::make_ACTION_PROXY(yytext, *driver.loc.back()); } YY_BREAK case 17: YY_RULE_SETUP -#line 519 "seclang-scanner.ll" +#line 523 "seclang-scanner.ll" { return p::make_ACTION_SANITISE_ARG(yytext, *driver.loc.back()); } YY_BREAK case 18: YY_RULE_SETUP -#line 520 "seclang-scanner.ll" +#line 524 "seclang-scanner.ll" { return p::make_ACTION_SANITISE_MATCHED(yytext, *driver.loc.back()); } YY_BREAK case 19: YY_RULE_SETUP -#line 521 "seclang-scanner.ll" +#line 525 "seclang-scanner.ll" { return p::make_ACTION_SANITISE_MATCHED_BYTES(yytext, *driver.loc.back()); } YY_BREAK case 20: YY_RULE_SETUP -#line 522 "seclang-scanner.ll" +#line 526 "seclang-scanner.ll" { return p::make_ACTION_SANITISE_REQUEST_HEADER(yytext, *driver.loc.back()); } YY_BREAK case 21: YY_RULE_SETUP -#line 523 "seclang-scanner.ll" +#line 527 "seclang-scanner.ll" { return p::make_ACTION_SANITISE_RESPONSE_HEADER(yytext, *driver.loc.back()); } YY_BREAK case 22: YY_RULE_SETUP -#line 524 "seclang-scanner.ll" +#line 528 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTION_PREDICATE); return p::make_ACTION_SETRSC(yytext, *driver.loc.back()); } YY_BREAK case 23: YY_RULE_SETUP -#line 526 "seclang-scanner.ll" +#line 530 "seclang-scanner.ll" { return p::make_ACTION_STATUS(yytext, *driver.loc.back()); } YY_BREAK case 24: /* rule 24 can match eol */ YY_RULE_SETUP -#line 527 "seclang-scanner.ll" +#line 531 "seclang-scanner.ll" { return p::make_ACTION_ACCURACY(yytext, *driver.loc.back()); } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 528 "seclang-scanner.ll" +#line 532 "seclang-scanner.ll" { return p::make_ACTION_ACCURACY(yytext, *driver.loc.back()); } YY_BREAK case 26: YY_RULE_SETUP -#line 529 "seclang-scanner.ll" +#line 533 "seclang-scanner.ll" { return p::make_ACTION_ALLOW(yytext, *driver.loc.back()); } YY_BREAK case 27: YY_RULE_SETUP -#line 530 "seclang-scanner.ll" +#line 534 "seclang-scanner.ll" { return p::make_ACTION_AUDIT_LOG(yytext, *driver.loc.back()); } YY_BREAK case 28: YY_RULE_SETUP -#line 531 "seclang-scanner.ll" +#line 535 "seclang-scanner.ll" { return p::make_ACTION_CTL_AUDIT_ENGINE(yytext, *driver.loc.back()); } YY_BREAK case 29: YY_RULE_SETUP -#line 532 "seclang-scanner.ll" +#line 536 "seclang-scanner.ll" { return p::make_ACTION_CTL_AUDIT_LOG_PARTS(yytext, *driver.loc.back()); } YY_BREAK case 30: YY_RULE_SETUP -#line 533 "seclang-scanner.ll" +#line 537 "seclang-scanner.ll" { return p::make_ACTION_CTL_BDY_JSON(yytext, *driver.loc.back()); } YY_BREAK case 31: YY_RULE_SETUP -#line 534 "seclang-scanner.ll" +#line 538 "seclang-scanner.ll" { return p::make_ACTION_CTL_BDY_XML(yytext, *driver.loc.back()); } YY_BREAK case 32: YY_RULE_SETUP -#line 535 "seclang-scanner.ll" +#line 539 "seclang-scanner.ll" { return p::make_ACTION_CTL_BDY_URLENCODED(yytext, *driver.loc.back()); } YY_BREAK case 33: YY_RULE_SETUP -#line 536 "seclang-scanner.ll" +#line 540 "seclang-scanner.ll" { return p::make_ACTION_CTL_FORCE_REQ_BODY_VAR(yytext, *driver.loc.back()); } YY_BREAK case 34: YY_RULE_SETUP -#line 537 "seclang-scanner.ll" +#line 541 "seclang-scanner.ll" { return p::make_ACTION_CTL_REQUEST_BODY_ACCESS(yytext, *driver.loc.back()); } YY_BREAK case 35: YY_RULE_SETUP -#line 538 "seclang-scanner.ll" +#line 542 "seclang-scanner.ll" { return p::make_ACTION_CTL_RULE_ENGINE(*driver.loc.back()); } YY_BREAK case 36: YY_RULE_SETUP -#line 539 "seclang-scanner.ll" +#line 543 "seclang-scanner.ll" { return p::make_ACTION_CTL_RULE_REMOVE_BY_ID(yytext, *driver.loc.back()); } YY_BREAK case 37: YY_RULE_SETUP -#line 540 "seclang-scanner.ll" +#line 544 "seclang-scanner.ll" { return p::make_ACTION_CTL_RULE_REMOVE_BY_TAG(yytext, *driver.loc.back()); } YY_BREAK case 38: YY_RULE_SETUP -#line 541 "seclang-scanner.ll" +#line 545 "seclang-scanner.ll" { return p::make_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID(yytext, *driver.loc.back()); } YY_BREAK case 39: YY_RULE_SETUP -#line 542 "seclang-scanner.ll" +#line 546 "seclang-scanner.ll" { return p::make_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG(yytext, *driver.loc.back()); } YY_BREAK case 40: /* rule 40 can match eol */ YY_RULE_SETUP -#line 543 "seclang-scanner.ll" +#line 547 "seclang-scanner.ll" { return p::make_ACTION_EXEC(yytext, *driver.loc.back()); } YY_BREAK case 41: /* rule 41 can match eol */ YY_RULE_SETUP -#line 544 "seclang-scanner.ll" +#line 548 "seclang-scanner.ll" { return p::make_ACTION_EXEC(yytext, *driver.loc.back()); } YY_BREAK case 42: /* rule 42 can match eol */ YY_RULE_SETUP -#line 545 "seclang-scanner.ll" +#line 549 "seclang-scanner.ll" { return p::make_ACTION_EXPIRE_VAR(yytext, *driver.loc.back()); } YY_BREAK case 43: /* rule 43 can match eol */ YY_RULE_SETUP -#line 546 "seclang-scanner.ll" +#line 550 "seclang-scanner.ll" { return p::make_ACTION_EXPIRE_VAR(yytext, *driver.loc.back()); } YY_BREAK case 44: /* rule 44 can match eol */ YY_RULE_SETUP -#line 547 "seclang-scanner.ll" +#line 551 "seclang-scanner.ll" { return p::make_ACTION_EXPIRE_VAR(yytext, *driver.loc.back()); } YY_BREAK case 45: /* rule 45 can match eol */ YY_RULE_SETUP -#line 548 "seclang-scanner.ll" +#line 552 "seclang-scanner.ll" { return p::make_ACTION_EXPIRE_VAR(yytext, *driver.loc.back()); } YY_BREAK case 46: YY_RULE_SETUP -#line 549 "seclang-scanner.ll" +#line 553 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTION_PREDICATE); return p::make_ACTION_INITCOL(yytext, *driver.loc.back()); } YY_BREAK case 47: /* rule 47 can match eol */ YY_RULE_SETUP -#line 550 "seclang-scanner.ll" +#line 554 "seclang-scanner.ll" { return p::make_ACTION_MATURITY(yytext, *driver.loc.back()); } YY_BREAK case 48: /* rule 48 can match eol */ YY_RULE_SETUP -#line 551 "seclang-scanner.ll" +#line 555 "seclang-scanner.ll" { return p::make_ACTION_MATURITY(yytext, *driver.loc.back()); } YY_BREAK case 49: YY_RULE_SETUP -#line 552 "seclang-scanner.ll" +#line 556 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTION_PREDICATE); return p::make_ACTION_MSG(yytext, *driver.loc.back()); } YY_BREAK case 50: YY_RULE_SETUP -#line 553 "seclang-scanner.ll" +#line 557 "seclang-scanner.ll" { return p::make_ACTION_PHASE(yytext, *driver.loc.back()); } YY_BREAK case 51: YY_RULE_SETUP -#line 554 "seclang-scanner.ll" +#line 558 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTION_PREDICATE); return p::make_ACTION_REDIRECT(yytext, *driver.loc.back()); } YY_BREAK case 52: /* rule 52 can match eol */ YY_RULE_SETUP -#line 555 "seclang-scanner.ll" +#line 559 "seclang-scanner.ll" { return p::make_ACTION_REV(yytext, *driver.loc.back()); } YY_BREAK case 53: /* rule 53 can match eol */ YY_RULE_SETUP -#line 556 "seclang-scanner.ll" +#line 560 "seclang-scanner.ll" { return p::make_ACTION_REV(yytext, *driver.loc.back()); } YY_BREAK case 54: YY_RULE_SETUP -#line 557 "seclang-scanner.ll" +#line 561 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTION_PREDICATE); return p::make_ACTION_SETENV(yytext, *driver.loc.back()); } YY_BREAK case 55: YY_RULE_SETUP -#line 558 "seclang-scanner.ll" +#line 562 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTION_PREDICATE); return p::make_ACTION_SETSID(yytext, *driver.loc.back()); } YY_BREAK case 56: YY_RULE_SETUP -#line 559 "seclang-scanner.ll" +#line 563 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTION_PREDICATE); return p::make_ACTION_SETUID(yytext, *driver.loc.back()); } YY_BREAK case 57: YY_RULE_SETUP -#line 561 "seclang-scanner.ll" +#line 565 "seclang-scanner.ll" { BEGIN(SETVAR_ACTION_QUOTED); return p::make_ACTION_SETVAR(*driver.loc.back()); } YY_BREAK case 58: YY_RULE_SETUP -#line 562 "seclang-scanner.ll" +#line 566 "seclang-scanner.ll" { BEGIN(SETVAR_ACTION_NONQUOTED); return p::make_ACTION_SETVAR(*driver.loc.back()); } YY_BREAK case 59: YY_RULE_SETUP -#line 565 "seclang-scanner.ll" +#line 569 "seclang-scanner.ll" { return p::make_ACTION_SEVERITY(yytext, *driver.loc.back()); } YY_BREAK case 60: YY_RULE_SETUP -#line 566 "seclang-scanner.ll" +#line 570 "seclang-scanner.ll" { return p::make_ACTION_SEVERITY(yytext, *driver.loc.back()); } YY_BREAK case 61: YY_RULE_SETUP -#line 567 "seclang-scanner.ll" +#line 571 "seclang-scanner.ll" { return p::make_ACTION_SKIP_AFTER(yytext, *driver.loc.back()); } YY_BREAK case 62: YY_RULE_SETUP -#line 568 "seclang-scanner.ll" +#line 572 "seclang-scanner.ll" { return p::make_ACTION_SKIP(yytext, *driver.loc.back()); } YY_BREAK case 63: YY_RULE_SETUP -#line 569 "seclang-scanner.ll" +#line 573 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTION_PREDICATE); return p::make_ACTION_TAG(yytext, *driver.loc.back()); } YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 570 "seclang-scanner.ll" +#line 574 "seclang-scanner.ll" { return p::make_ACTION_VER(yytext, *driver.loc.back()); } YY_BREAK case 65: YY_RULE_SETUP -#line 571 "seclang-scanner.ll" +#line 575 "seclang-scanner.ll" { return p::make_ACTION_XMLNS(yytext, *driver.loc.back()); } YY_BREAK case 66: YY_RULE_SETUP -#line 573 "seclang-scanner.ll" +#line 577 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_PARITY_ZERO_7_BIT(yytext, *driver.loc.back()); } YY_BREAK case 67: YY_RULE_SETUP -#line 574 "seclang-scanner.ll" +#line 578 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_PARITY_ODD_7_BIT(yytext, *driver.loc.back()); } YY_BREAK case 68: YY_RULE_SETUP -#line 575 "seclang-scanner.ll" +#line 579 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_PARITY_EVEN_7_BIT(yytext, *driver.loc.back()); } YY_BREAK case 69: YY_RULE_SETUP -#line 576 "seclang-scanner.ll" +#line 580 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_SQL_HEX_DECODE(yytext, *driver.loc.back()); } YY_BREAK case 70: YY_RULE_SETUP -#line 577 "seclang-scanner.ll" +#line 581 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_BASE_64_ENCODE(yytext, *driver.loc.back()); } YY_BREAK case 71: YY_RULE_SETUP -#line 578 "seclang-scanner.ll" +#line 582 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_BASE_64_DECODE(yytext, *driver.loc.back()); } YY_BREAK case 72: YY_RULE_SETUP -#line 579 "seclang-scanner.ll" +#line 583 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_BASE_64_DECODE_EXT(yytext, *driver.loc.back()); } YY_BREAK case 73: YY_RULE_SETUP -#line 580 "seclang-scanner.ll" +#line 584 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_CMD_LINE(yytext, *driver.loc.back()); } YY_BREAK case 74: YY_RULE_SETUP -#line 581 "seclang-scanner.ll" +#line 585 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_SHA1(yytext, *driver.loc.back()); } YY_BREAK case 75: YY_RULE_SETUP -#line 582 "seclang-scanner.ll" +#line 586 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_MD5(yytext, *driver.loc.back()); } YY_BREAK case 76: YY_RULE_SETUP -#line 583 "seclang-scanner.ll" +#line 587 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE(yytext, *driver.loc.back()); } YY_BREAK case 77: YY_RULE_SETUP -#line 584 "seclang-scanner.ll" +#line 588 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_HEX_ENCODE(yytext, *driver.loc.back()); } YY_BREAK case 78: YY_RULE_SETUP -#line 585 "seclang-scanner.ll" +#line 589 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_HEX_DECODE(yytext, *driver.loc.back()); } YY_BREAK case 79: YY_RULE_SETUP -#line 586 "seclang-scanner.ll" +#line 590 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_LOWERCASE(yytext, *driver.loc.back()); } YY_BREAK case 80: YY_RULE_SETUP -#line 587 "seclang-scanner.ll" +#line 591 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_UPPERCASE(yytext, *driver.loc.back()); } YY_BREAK case 81: YY_RULE_SETUP -#line 588 "seclang-scanner.ll" +#line 592 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_URL_ENCODE(yytext, *driver.loc.back()); } YY_BREAK case 82: YY_RULE_SETUP -#line 589 "seclang-scanner.ll" +#line 593 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_URL_DECODE_UNI(yytext, *driver.loc.back()); } YY_BREAK case 83: YY_RULE_SETUP -#line 590 "seclang-scanner.ll" +#line 594 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_URL_DECODE(yytext, *driver.loc.back()); } YY_BREAK case 84: YY_RULE_SETUP -#line 591 "seclang-scanner.ll" +#line 595 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_NONE(yytext, *driver.loc.back()); } YY_BREAK case 85: YY_RULE_SETUP -#line 592 "seclang-scanner.ll" +#line 596 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_COMPRESS_WHITESPACE(yytext, *driver.loc.back()); } YY_BREAK case 86: YY_RULE_SETUP -#line 593 "seclang-scanner.ll" +#line 597 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_REMOVE_WHITESPACE(yytext, *driver.loc.back()); } YY_BREAK case 87: YY_RULE_SETUP -#line 594 "seclang-scanner.ll" +#line 598 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_REPLACE_NULLS(yytext, *driver.loc.back()); } YY_BREAK case 88: YY_RULE_SETUP -#line 595 "seclang-scanner.ll" +#line 599 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_REMOVE_NULLS(yytext, *driver.loc.back()); } YY_BREAK case 89: YY_RULE_SETUP -#line 596 "seclang-scanner.ll" +#line 600 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_HTML_ENTITY_DECODE(yytext, *driver.loc.back()); } YY_BREAK case 90: YY_RULE_SETUP -#line 597 "seclang-scanner.ll" +#line 601 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_JS_DECODE(yytext, *driver.loc.back()); } YY_BREAK case 91: YY_RULE_SETUP -#line 598 "seclang-scanner.ll" +#line 602 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_CSS_DECODE(yytext, *driver.loc.back()); } YY_BREAK case 92: YY_RULE_SETUP -#line 599 "seclang-scanner.ll" +#line 603 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_TRIM(yytext, *driver.loc.back()); } YY_BREAK case 93: YY_RULE_SETUP -#line 600 "seclang-scanner.ll" +#line 604 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_TRIM_LEFT(yytext, *driver.loc.back()); } YY_BREAK case 94: YY_RULE_SETUP -#line 601 "seclang-scanner.ll" +#line 605 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_TRIM_RIGHT(yytext, *driver.loc.back()); } YY_BREAK case 95: YY_RULE_SETUP -#line 602 "seclang-scanner.ll" +#line 606 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_NORMALISE_PATH_WIN(yytext, *driver.loc.back()); } YY_BREAK case 96: YY_RULE_SETUP -#line 603 "seclang-scanner.ll" +#line 607 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_NORMALISE_PATH(yytext, *driver.loc.back()); } YY_BREAK case 97: YY_RULE_SETUP -#line 604 "seclang-scanner.ll" +#line 608 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_LENGTH(yytext, *driver.loc.back()); } YY_BREAK case 98: YY_RULE_SETUP -#line 605 "seclang-scanner.ll" +#line 609 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_UTF8_TO_UNICODE(yytext, *driver.loc.back()); } YY_BREAK case 99: YY_RULE_SETUP -#line 606 "seclang-scanner.ll" +#line 610 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_REMOVE_COMMENTS_CHAR(yytext, *driver.loc.back()); } YY_BREAK case 100: YY_RULE_SETUP -#line 607 "seclang-scanner.ll" +#line 611 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_REMOVE_COMMENTS(yytext, *driver.loc.back()); } YY_BREAK case 101: YY_RULE_SETUP -#line 608 "seclang-scanner.ll" +#line 612 "seclang-scanner.ll" { return p::make_ACTION_TRANSFORMATION_REPLACE_COMMENTS(yytext, *driver.loc.back()); } YY_BREAK case 102: YY_RULE_SETUP -#line 609 "seclang-scanner.ll" +#line 613 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTION_PREDICATE); return p::make_ACTION_LOG_DATA(yytext, *driver.loc.back()); } YY_BREAK case 103: YY_RULE_SETUP -#line 611 "seclang-scanner.ll" +#line 615 "seclang-scanner.ll" { return p::make_CONFIG_VALUE_DETC(yytext, *driver.loc.back()); } YY_BREAK case 104: YY_RULE_SETUP -#line 612 "seclang-scanner.ll" +#line 616 "seclang-scanner.ll" { return p::make_CONFIG_VALUE_OFF(yytext, *driver.loc.back()); } YY_BREAK case 105: YY_RULE_SETUP -#line 613 "seclang-scanner.ll" +#line 617 "seclang-scanner.ll" { return p::make_CONFIG_VALUE_ON(yytext, *driver.loc.back()); } YY_BREAK case 106: -/* rule 106 can match eol */ YY_RULE_SETUP -#line 614 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); } +#line 618 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_RELEVANT_ONLY(yytext, *driver.loc.back()); } YY_BREAK case 107: /* rule 107 can match eol */ YY_RULE_SETUP -#line 615 "seclang-scanner.ll" +#line 619 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); } + YY_BREAK +case 108: +/* rule 108 can match eol */ +YY_RULE_SETUP +#line 620 "seclang-scanner.ll" { driver.loc.back()->lines(1); driver.loc.back()->step(); } YY_BREAK -case 108: +case 109: YY_RULE_SETUP -#line 619 "seclang-scanner.ll" +#line 624 "seclang-scanner.ll" { return p::make_COMMA(*driver.loc.back()); } YY_BREAK -case 109: -/* rule 109 can match eol */ -YY_RULE_SETUP -#line 624 "seclang-scanner.ll" -{ BEGIN(INITIAL); yyless(yyleng); driver.loc.back()->lines(1); driver.loc.back()->step(); } - YY_BREAK case 110: /* rule 110 can match eol */ YY_RULE_SETUP -#line 625 "seclang-scanner.ll" +#line 629 "seclang-scanner.ll" +{ BEGIN(INITIAL); yyless(yyleng); driver.loc.back()->lines(1); driver.loc.back()->step(); } + YY_BREAK +case 111: +/* rule 111 can match eol */ +YY_RULE_SETUP +#line 630 "seclang-scanner.ll" { BEGIN(INITIAL); yyless(yyleng); driver.loc.back()->lines(1); driver.loc.back()->step(); } YY_BREAK -case 111: -YY_RULE_SETUP -#line 630 "seclang-scanner.ll" -{ BEGIN(INITIAL); yyless(yyleng); } - YY_BREAK case 112: -/* rule 112 can match eol */ YY_RULE_SETUP -#line 631 "seclang-scanner.ll" -{ BEGIN(INITIAL); yyless(1); } +#line 635 "seclang-scanner.ll" +{ BEGIN(INITIAL); yyless(yyleng); } YY_BREAK case 113: /* rule 113 can match eol */ YY_RULE_SETUP -#line 632 "seclang-scanner.ll" +#line 636 "seclang-scanner.ll" +{ BEGIN(INITIAL); yyless(1); } + YY_BREAK +case 114: +/* rule 114 can match eol */ +YY_RULE_SETUP +#line 637 "seclang-scanner.ll" { BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } YY_BREAK -case 114: -YY_RULE_SETUP -#line 637 "seclang-scanner.ll" -{ BEGIN(INITIAL); yyless(yyleng); p::make_NEW_LINE(*driver.loc.back()); } - YY_BREAK case 115: -/* rule 115 can match eol */ YY_RULE_SETUP -#line 638 "seclang-scanner.ll" -{ BEGIN(INITIAL); yyless(1); } +#line 642 "seclang-scanner.ll" +{ BEGIN(INITIAL); yyless(yyleng); p::make_NEW_LINE(*driver.loc.back()); } YY_BREAK case 116: /* rule 116 can match eol */ YY_RULE_SETUP -#line 639 "seclang-scanner.ll" -{ BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } +#line 643 "seclang-scanner.ll" +{ BEGIN(INITIAL); yyless(1); } YY_BREAK - - case 117: +/* rule 117 can match eol */ YY_RULE_SETUP #line 644 "seclang-scanner.ll" -{ BEGIN(LEXING_ERROR_ACTION); yyless(0); } +{ BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } YY_BREAK case 118: YY_RULE_SETUP #line 649 "seclang-scanner.ll" -{ BEGIN(ACTION_PREDICATE_ENDS_WITH_QUOTE); } +{ BEGIN(LEXING_ERROR_ACTION); yyless(0); } YY_BREAK + + case 119: YY_RULE_SETUP -#line 650 "seclang-scanner.ll" -{ BEGIN(ACTION_PREDICATE_ENDS_WITH_DOUBLE_QUOTE); } +#line 654 "seclang-scanner.ll" +{ BEGIN(ACTION_PREDICATE_ENDS_WITH_QUOTE); } YY_BREAK case 120: YY_RULE_SETUP -#line 651 "seclang-scanner.ll" +#line 655 "seclang-scanner.ll" +{ BEGIN(ACTION_PREDICATE_ENDS_WITH_DOUBLE_QUOTE); } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 656 "seclang-scanner.ll" { BEGIN(ACTION_PREDICATE_ENDS_WITH_COMMA_OR_DOUBLE_QUOTE); yyless(0); } YY_BREAK -case 121: -/* rule 121 can match eol */ -YY_RULE_SETUP -#line 656 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); } - YY_BREAK case 122: /* rule 122 can match eol */ YY_RULE_SETUP -#line 657 "seclang-scanner.ll" +#line 661 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); } + YY_BREAK +case 123: +/* rule 123 can match eol */ +YY_RULE_SETUP +#line 662 "seclang-scanner.ll" { driver.loc.back()->lines(1); driver.loc.back()->step(); } YY_BREAK -case 123: -YY_RULE_SETUP -#line 661 "seclang-scanner.ll" -{ yyless(1); BEGIN_PREVIOUS(); } - YY_BREAK case 124: YY_RULE_SETUP -#line 662 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); } +#line 666 "seclang-scanner.ll" +{ yyless(1); BEGIN_PREVIOUS(); } YY_BREAK case 125: YY_RULE_SETUP -#line 663 "seclang-scanner.ll" +#line 667 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); } + YY_BREAK +case 126: +YY_RULE_SETUP +#line 668 "seclang-scanner.ll" { BEGIN_PREVIOUS(); } YY_BREAK -case 126: -YY_RULE_SETUP -#line 667 "seclang-scanner.ll" -{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(yyleng); } - YY_BREAK case 127: -/* rule 127 can match eol */ -YY_RULE_SETUP -#line 668 "seclang-scanner.ll" -{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } - YY_BREAK - - -case 128: YY_RULE_SETUP #line 672 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(yyleng); } YY_BREAK -case 129: -/* rule 129 can match eol */ +case 128: +/* rule 128 can match eol */ YY_RULE_SETUP #line 673 "seclang-scanner.ll" { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } YY_BREAK -case 130: +case 129: YY_RULE_SETUP #line 677 "seclang-scanner.ll" -{ yyless(0); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(yyleng); } YY_BREAK -case 131: +case 130: +/* rule 130 can match eol */ YY_RULE_SETUP #line 678 "seclang-scanner.ll" -{ yyless(0); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE);} - YY_BREAK -case 132: -/* rule 132 can match eol */ -YY_RULE_SETUP -#line 679 "seclang-scanner.ll" { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } YY_BREAK -case 133: +case 131: +YY_RULE_SETUP +#line 682 "seclang-scanner.ll" +{ yyless(0); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } + YY_BREAK +case 132: YY_RULE_SETUP #line 683 "seclang-scanner.ll" -{ BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } +{ yyless(0); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE);} YY_BREAK -case 134: +case 133: +/* rule 133 can match eol */ YY_RULE_SETUP #line 684 "seclang-scanner.ll" +{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } + YY_BREAK + + +case 134: +YY_RULE_SETUP +#line 688 "seclang-scanner.ll" +{ BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 689 "seclang-scanner.ll" { BEGIN(LEXING_ERROR_VARIABLE); yyless(0); } YY_BREAK -case 135: +case 136: YY_RULE_SETUP -#line 688 "seclang-scanner.ll" +#line 693 "seclang-scanner.ll" { return p::make_NOT(*driver.loc.back()); } YY_BREAK -case 136: -/* rule 136 can match eol */ +case 137: +/* rule 137 can match eol */ YY_RULE_SETUP -#line 689 "seclang-scanner.ll" +#line 694 "seclang-scanner.ll" { BEGIN_ACTION_OPERATION(); yyless(0); } YY_BREAK -case 137: -YY_RULE_SETUP -#line 694 "seclang-scanner.ll" -{ BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_PLUS(*driver.loc.back()); } - YY_BREAK case 138: YY_RULE_SETUP -#line 695 "seclang-scanner.ll" -{ BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_MINUS(*driver.loc.back()); } +#line 699 "seclang-scanner.ll" +{ BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_PLUS(*driver.loc.back()); } YY_BREAK case 139: YY_RULE_SETUP -#line 696 "seclang-scanner.ll" +#line 700 "seclang-scanner.ll" +{ BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_MINUS(*driver.loc.back()); } + YY_BREAK +case 140: +YY_RULE_SETUP +#line 701 "seclang-scanner.ll" { BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS(*driver.loc.back()); } YY_BREAK -case 140: -/* rule 140 can match eol */ +case 141: +/* rule 141 can match eol */ YY_RULE_SETUP -#line 700 "seclang-scanner.ll" +#line 705 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(0);} YY_BREAK -case 141: +case 142: YY_RULE_SETUP -#line 704 "seclang-scanner.ll" +#line 709 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK -case 142: -/* rule 142 can match eol */ +case 143: +/* rule 143 can match eol */ YY_RULE_SETUP -#line 705 "seclang-scanner.ll" +#line 710 "seclang-scanner.ll" { BEGIN(LEXING_ERROR_ACTION); yyless(0); } YY_BREAK -case 143: +case 144: YY_RULE_SETUP -#line 713 "seclang-scanner.ll" +#line 718 "seclang-scanner.ll" { BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } YY_BREAK -case 144: -/* rule 144 can match eol */ -YY_RULE_SETUP -#line 718 "seclang-scanner.ll" -{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } - YY_BREAK case 145: /* rule 145 can match eol */ YY_RULE_SETUP -#line 719 "seclang-scanner.ll" +#line 723 "seclang-scanner.ll" +{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } + YY_BREAK +case 146: +/* rule 146 can match eol */ +YY_RULE_SETUP +#line 724 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(0); } YY_BREAK -case 146: -YY_RULE_SETUP -#line 724 "seclang-scanner.ll" -{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } - YY_BREAK case 147: -/* rule 147 can match eol */ YY_RULE_SETUP -#line 725 "seclang-scanner.ll" -{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +#line 729 "seclang-scanner.ll" +{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 148: /* rule 148 can match eol */ YY_RULE_SETUP -#line 726 "seclang-scanner.ll" +#line 730 "seclang-scanner.ll" +{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } + YY_BREAK +case 149: +/* rule 149 can match eol */ +YY_RULE_SETUP +#line 731 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(0); } YY_BREAK case YY_STATE_EOF(FINISH_ACTIONS): -#line 734 "seclang-scanner.ll" +#line 739 "seclang-scanner.ll" { BEGIN(INITIAL); yyless(0); p::make_NEW_LINE(*driver.loc.back()); } YY_BREAK -case 149: +case 150: YY_RULE_SETUP -#line 735 "seclang-scanner.ll" +#line 740 "seclang-scanner.ll" { BEGIN(INITIAL); } YY_BREAK -case 150: -/* rule 150 can match eol */ -YY_RULE_SETUP -#line 738 "seclang-scanner.ll" -{ return p::make_CONFIG_COMPONENT_SIG(strchr(yytext, ' ') + 2, *driver.loc.back()); } - YY_BREAK case 151: /* rule 151 can match eol */ YY_RULE_SETUP -#line 739 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_SERVER_SIG(strchr(yytext, ' ') + 2, *driver.loc.back()); } +#line 743 "seclang-scanner.ll" +{ return p::make_CONFIG_COMPONENT_SIG(strchr(yytext, ' ') + 2, *driver.loc.back()); } YY_BREAK case 152: /* rule 152 can match eol */ YY_RULE_SETUP -#line 740 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_WEB_APP_ID(parserSanitizer(strchr(yytext, ' ') + 2), *driver.loc.back()); } +#line 744 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_SERVER_SIG(strchr(yytext, ' ') + 2, *driver.loc.back()); } YY_BREAK case 153: +/* rule 153 can match eol */ YY_RULE_SETUP -#line 741 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_WEB_APP_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 745 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_WEB_APP_ID(parserSanitizer(strchr(yytext, ' ') + 2), *driver.loc.back()); } YY_BREAK case 154: YY_RULE_SETUP -#line 742 "seclang-scanner.ll" -{ return p::make_CONFIG_CONTENT_INJECTION(*driver.loc.back()); } +#line 746 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_WEB_APP_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 155: YY_RULE_SETUP -#line 743 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_DIR_MOD(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 747 "seclang-scanner.ll" +{ return p::make_CONFIG_CONTENT_INJECTION(*driver.loc.back()); } YY_BREAK case 156: YY_RULE_SETUP -#line 744 "seclang-scanner.ll" +#line 748 "seclang-scanner.ll" { return p::make_CONFIG_DIR_AUDIT_DIR_MOD(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 157: YY_RULE_SETUP -#line 745 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 749 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_DIR_MOD(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 158: YY_RULE_SETUP -#line 746 "seclang-scanner.ll" +#line 750 "seclang-scanner.ll" { return p::make_CONFIG_DIR_AUDIT_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 159: YY_RULE_SETUP -#line 747 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_ARGUMENT_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 751 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 160: YY_RULE_SETUP -#line 748 "seclang-scanner.ll" +#line 752 "seclang-scanner.ll" { return p::make_CONFIG_SEC_ARGUMENT_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 161: YY_RULE_SETUP -#line 749 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_ENG(yytext, *driver.loc.back()); } +#line 753 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_ARGUMENT_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 162: YY_RULE_SETUP -#line 750 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_FLE_MOD(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 754 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_ENG(yytext, *driver.loc.back()); } YY_BREAK case 163: YY_RULE_SETUP -#line 751 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_LOG2(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 755 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_FLE_MOD(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 164: YY_RULE_SETUP -#line 752 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_LOG_P(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 756 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_LOG2(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 165: YY_RULE_SETUP -#line 753 "seclang-scanner.ll" +#line 757 "seclang-scanner.ll" { return p::make_CONFIG_DIR_AUDIT_LOG_P(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 166: YY_RULE_SETUP -#line 754 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_LOG(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 758 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_LOG_P(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 167: YY_RULE_SETUP -#line 755 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_LOG_FMT(*driver.loc.back()); } +#line 759 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_LOG(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 168: YY_RULE_SETUP -#line 756 "seclang-scanner.ll" -{ return p::make_JSON(*driver.loc.back()); } +#line 760 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_LOG_FMT(*driver.loc.back()); } YY_BREAK case 169: YY_RULE_SETUP -#line 757 "seclang-scanner.ll" -{ return p::make_NATIVE(*driver.loc.back()); } +#line 761 "seclang-scanner.ll" +{ return p::make_JSON(*driver.loc.back()); } YY_BREAK case 170: YY_RULE_SETUP -#line 758 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_LOG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 762 "seclang-scanner.ll" +{ return p::make_NATIVE(*driver.loc.back()); } YY_BREAK case 171: YY_RULE_SETUP -#line 759 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_STS(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 763 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_LOG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 172: YY_RULE_SETUP -#line 760 "seclang-scanner.ll" +#line 764 "seclang-scanner.ll" { return p::make_CONFIG_DIR_AUDIT_STS(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 173: YY_RULE_SETUP -#line 761 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_AUDIT_TPE(yytext, *driver.loc.back()); } +#line 765 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_STS(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 174: YY_RULE_SETUP -#line 762 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_DEBUG_LOG(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 766 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_AUDIT_TPE(yytext, *driver.loc.back()); } YY_BREAK case 175: YY_RULE_SETUP -#line 763 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_DEBUG_LOG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 769 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_DEBUG_LOG(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 176: YY_RULE_SETUP -#line 764 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_DEBUG_LVL(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 770 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_DEBUG_LOG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 177: YY_RULE_SETUP -#line 765 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_GEO_DB(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 771 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_DEBUG_LVL(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 178: YY_RULE_SETUP -#line 766 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 772 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_GEO_DB(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 179: YY_RULE_SETUP -#line 767 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_PCRE_MATCH_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 773 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 180: YY_RULE_SETUP -#line 768 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 774 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_PCRE_MATCH_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 181: YY_RULE_SETUP -#line 769 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_REQ_BODY_LIMIT_ACTION(yytext, *driver.loc.back()); } +#line 775 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_ARGS_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 182: YY_RULE_SETUP -#line 770 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_REQ_BODY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 776 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 183: YY_RULE_SETUP -#line 771 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 777 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 184: YY_RULE_SETUP -#line 772 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_REQ_BODY(yytext, *driver.loc.back()); } +#line 779 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_REQ_BODY_LIMIT_ACTION(yytext, *driver.loc.back()); } YY_BREAK case 185: YY_RULE_SETUP -#line 773 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_RES_BODY_LIMIT_ACTION(yytext, *driver.loc.back()); } +#line 780 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_REQ_BODY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 186: YY_RULE_SETUP -#line 774 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_RES_BODY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 781 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 187: YY_RULE_SETUP -#line 775 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_RES_BODY(yytext, *driver.loc.back()); } +#line 782 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_REQ_BODY(yytext, *driver.loc.back()); } YY_BREAK case 188: YY_RULE_SETUP -#line 776 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_RULE_ENG(yytext, *driver.loc.back()); } +#line 783 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_RES_BODY_LIMIT_ACTION(yytext, *driver.loc.back()); } YY_BREAK case 189: YY_RULE_SETUP -#line 777 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_SEC_MARKER(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 784 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_RES_BODY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 190: YY_RULE_SETUP -#line 778 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_SEC_MARKER(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 785 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_RES_BODY(yytext, *driver.loc.back()); } YY_BREAK case 191: YY_RULE_SETUP -#line 779 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_UNICODE_MAP_FILE(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 786 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_RULE_ENG(yytext, *driver.loc.back()); } YY_BREAK case 192: YY_RULE_SETUP -#line 780 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 787 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_SEC_MARKER(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 193: YY_RULE_SETUP -#line 781 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 788 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_SEC_MARKER(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 194: YY_RULE_SETUP -#line 782 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 789 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_UNICODE_MAP_FILE(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 195: YY_RULE_SETUP -#line 783 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 790 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 196: YY_RULE_SETUP -#line 784 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 791 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 197: YY_RULE_SETUP -#line 785 "seclang-scanner.ll" -{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 792 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 198: YY_RULE_SETUP -#line 786 "seclang-scanner.ll" -{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 793 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 199: YY_RULE_SETUP -#line 787 "seclang-scanner.ll" -{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 794 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_RULE_REMOVE_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 200: YY_RULE_SETUP -#line 788 "seclang-scanner.ll" -{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 795 "seclang-scanner.ll" +{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 201: YY_RULE_SETUP -#line 789 "seclang-scanner.ll" -{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 796 "seclang-scanner.ll" +{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 202: YY_RULE_SETUP -#line 790 "seclang-scanner.ll" -{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 797 "seclang-scanner.ll" +{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 203: YY_RULE_SETUP -#line 791 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 798 "seclang-scanner.ll" +{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 204: YY_RULE_SETUP -#line 792 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 799 "seclang-scanner.ll" +{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 205: YY_RULE_SETUP -#line 793 "seclang-scanner.ll" -{ return p::make_CONFIG_UPDLOAD_KEEP_FILES(yytext, *driver.loc.back()); } +#line 800 "seclang-scanner.ll" +{ state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 206: YY_RULE_SETUP -#line 794 "seclang-scanner.ll" -{ return p::make_CONFIG_UPDLOAD_SAVE_TMP_FILES(yytext, *driver.loc.back()); } +#line 801 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 207: YY_RULE_SETUP -#line 795 "seclang-scanner.ll" -{ return p::make_CONFIG_UPLOAD_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 802 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 208: YY_RULE_SETUP -#line 796 "seclang-scanner.ll" -{ return p::make_CONFIG_UPLOAD_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 803 "seclang-scanner.ll" +{ return p::make_CONFIG_UPDLOAD_KEEP_FILES(yytext, *driver.loc.back()); } YY_BREAK case 209: YY_RULE_SETUP -#line 797 "seclang-scanner.ll" -{ return p::make_CONFIG_UPLOAD_FILE_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 804 "seclang-scanner.ll" +{ return p::make_CONFIG_UPDLOAD_SAVE_TMP_FILES(yytext, *driver.loc.back()); } YY_BREAK case 210: YY_RULE_SETUP -#line 798 "seclang-scanner.ll" -{ return p::make_CONFIG_UPLOAD_FILE_MODE(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 805 "seclang-scanner.ll" +{ return p::make_CONFIG_UPLOAD_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 211: YY_RULE_SETUP -#line 799 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_ABORT(yytext, *driver.loc.back()); } +#line 806 "seclang-scanner.ll" +{ return p::make_CONFIG_UPLOAD_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 212: YY_RULE_SETUP -#line 800 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_DETC(yytext, *driver.loc.back()); } +#line 807 "seclang-scanner.ll" +{ return p::make_CONFIG_UPLOAD_FILE_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 213: YY_RULE_SETUP -#line 801 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_HTTPS(yytext, *driver.loc.back()); } +#line 808 "seclang-scanner.ll" +{ return p::make_CONFIG_UPLOAD_FILE_MODE(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 214: YY_RULE_SETUP -#line 802 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_OFF(yytext, *driver.loc.back()); } +#line 809 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_ABORT(yytext, *driver.loc.back()); } YY_BREAK case 215: YY_RULE_SETUP -#line 803 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_ON(yytext, *driver.loc.back()); } +#line 810 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_DETC(yytext, *driver.loc.back()); } YY_BREAK case 216: YY_RULE_SETUP -#line 804 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_PARALLEL(yytext, *driver.loc.back()); } +#line 811 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_HTTPS(yytext, *driver.loc.back()); } YY_BREAK case 217: YY_RULE_SETUP -#line 805 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_PROCESS_PARTIAL(yytext, *driver.loc.back()); } +#line 812 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_OFF(yytext, *driver.loc.back()); } YY_BREAK case 218: YY_RULE_SETUP -#line 806 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_REJECT(yytext, *driver.loc.back()); } +#line 813 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_ON(yytext, *driver.loc.back()); } YY_BREAK case 219: YY_RULE_SETUP -#line 807 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_RELEVANT_ONLY(yytext, *driver.loc.back()); } +#line 814 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_PARALLEL(yytext, *driver.loc.back()); } YY_BREAK case 220: YY_RULE_SETUP -#line 808 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_SERIAL(yytext, *driver.loc.back()); } +#line 815 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_PROCESS_PARTIAL(yytext, *driver.loc.back()); } YY_BREAK case 221: YY_RULE_SETUP -#line 809 "seclang-scanner.ll" -{ return p::make_CONFIG_VALUE_WARN(yytext, *driver.loc.back()); } +#line 816 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_REJECT(yytext, *driver.loc.back()); } YY_BREAK case 222: YY_RULE_SETUP -#line 810 "seclang-scanner.ll" -{ return p::make_CONFIG_XML_EXTERNAL_ENTITY(yytext, *driver.loc.back()); } +#line 817 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_RELEVANT_ONLY(yytext, *driver.loc.back()); } YY_BREAK case 223: YY_RULE_SETUP -#line 811 "seclang-scanner.ll" -{ return p::make_CONGIG_DIR_RESPONSE_BODY_MP(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 818 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_SERIAL(yytext, *driver.loc.back()); } YY_BREAK case 224: YY_RULE_SETUP -#line 812 "seclang-scanner.ll" -{ return p::make_CONGIG_DIR_RESPONSE_BODY_MP_CLEAR(*driver.loc.back()); } +#line 819 "seclang-scanner.ll" +{ return p::make_CONFIG_VALUE_WARN(yytext, *driver.loc.back()); } YY_BREAK case 225: YY_RULE_SETUP -#line 813 "seclang-scanner.ll" -{ return p::make_CONGIG_DIR_SEC_ARG_SEP(yytext, *driver.loc.back()); } +#line 820 "seclang-scanner.ll" +{ return p::make_CONFIG_XML_EXTERNAL_ENTITY(yytext, *driver.loc.back()); } YY_BREAK case 226: YY_RULE_SETUP -#line 814 "seclang-scanner.ll" -{ return p::make_CONGIG_DIR_SEC_COOKIE_FORMAT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 821 "seclang-scanner.ll" +{ return p::make_CONGIG_DIR_RESPONSE_BODY_MP(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 227: YY_RULE_SETUP -#line 815 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_COOKIEV0_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 822 "seclang-scanner.ll" +{ return p::make_CONGIG_DIR_RESPONSE_BODY_MP_CLEAR(*driver.loc.back()); } YY_BREAK case 228: YY_RULE_SETUP -#line 816 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_COOKIEV0_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 823 "seclang-scanner.ll" +{ return p::make_CONGIG_DIR_SEC_ARG_SEP(yytext, *driver.loc.back()); } YY_BREAK case 229: YY_RULE_SETUP -#line 817 "seclang-scanner.ll" -{ return p::make_CONGIG_DIR_SEC_DATA_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 824 "seclang-scanner.ll" +{ return p::make_CONGIG_DIR_SEC_COOKIE_FORMAT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 230: YY_RULE_SETUP -#line 818 "seclang-scanner.ll" -{ return p::make_CONGIG_DIR_SEC_DATA_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 825 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_COOKIEV0_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 231: YY_RULE_SETUP -#line 819 "seclang-scanner.ll" -{ return p::make_CONGIG_DIR_SEC_STATUS_ENGINE(yytext, *driver.loc.back()); } +#line 826 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_COOKIEV0_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 232: YY_RULE_SETUP -#line 820 "seclang-scanner.ll" -{ return p::make_CONGIG_DIR_SEC_TMP_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 827 "seclang-scanner.ll" +{ return p::make_CONGIG_DIR_SEC_DATA_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 233: YY_RULE_SETUP -#line 821 "seclang-scanner.ll" -{ return p::make_CONGIG_DIR_SEC_TMP_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 828 "seclang-scanner.ll" +{ return p::make_CONGIG_DIR_SEC_DATA_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 234: YY_RULE_SETUP -#line 822 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_DIRECTIVE_SECRULESCRIPT(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 829 "seclang-scanner.ll" +{ return p::make_CONGIG_DIR_SEC_STATUS_ENGINE(yytext, *driver.loc.back()); } YY_BREAK case 235: YY_RULE_SETUP -#line 823 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_DIRECTIVE_SECRULESCRIPT(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 830 "seclang-scanner.ll" +{ return p::make_CONGIG_DIR_SEC_TMP_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 236: YY_RULE_SETUP -#line 824 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_CACHE_TRANSFORMATIONS(yytext, *driver.loc.back()); } +#line 831 "seclang-scanner.ll" +{ return p::make_CONGIG_DIR_SEC_TMP_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 237: YY_RULE_SETUP -#line 825 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_CHROOT_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 832 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_DIRECTIVE_SECRULESCRIPT(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 238: YY_RULE_SETUP -#line 826 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_CHROOT_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 833 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_DIRECTIVE_SECRULESCRIPT(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 239: YY_RULE_SETUP -#line 827 "seclang-scanner.ll" -{ return p::make_CONFIG_CONN_ENGINE(yytext, *driver.loc.back()); } +#line 834 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_CACHE_TRANSFORMATIONS(yytext, *driver.loc.back()); } YY_BREAK case 240: YY_RULE_SETUP -#line 828 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_HASH_ENGINE(yytext, *driver.loc.back()); } +#line 835 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_CHROOT_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 241: YY_RULE_SETUP -#line 829 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_HASH_KEY(yytext, *driver.loc.back()); } +#line 836 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_CHROOT_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 242: YY_RULE_SETUP -#line 830 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_HASH_PARAM(yytext, *driver.loc.back()); } +#line 837 "seclang-scanner.ll" +{ return p::make_CONFIG_CONN_ENGINE(yytext, *driver.loc.back()); } YY_BREAK case 243: YY_RULE_SETUP -#line 831 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_HASH_METHOD_RX(yytext, *driver.loc.back()); } +#line 838 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_HASH_ENGINE(yytext, *driver.loc.back()); } YY_BREAK case 244: YY_RULE_SETUP -#line 832 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_HASH_METHOD_PM(yytext, *driver.loc.back()); } +#line 839 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_HASH_KEY(yytext, *driver.loc.back()); } YY_BREAK case 245: YY_RULE_SETUP -#line 833 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_GSB_DB(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 840 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_HASH_PARAM(yytext, *driver.loc.back()); } YY_BREAK case 246: YY_RULE_SETUP -#line 834 "seclang-scanner.ll" -{ return p::make_CONFIG_DIR_GSB_DB(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +#line 841 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_HASH_METHOD_RX(yytext, *driver.loc.back()); } YY_BREAK case 247: YY_RULE_SETUP -#line 835 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_GUARDIAN_LOG(yytext, *driver.loc.back()); } +#line 842 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_HASH_METHOD_PM(yytext, *driver.loc.back()); } YY_BREAK case 248: YY_RULE_SETUP -#line 836 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_INTERCEPT_ON_ERROR(yytext, *driver.loc.back()); } +#line 843 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_GSB_DB(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 249: YY_RULE_SETUP -#line 837 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_CONN_R_STATE_LIMIT(yytext, *driver.loc.back()); } +#line 844 "seclang-scanner.ll" +{ return p::make_CONFIG_DIR_GSB_DB(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } YY_BREAK case 250: YY_RULE_SETUP -#line 838 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_CONN_W_STATE_LIMIT(yytext, *driver.loc.back()); } +#line 845 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_GUARDIAN_LOG(yytext, *driver.loc.back()); } YY_BREAK case 251: YY_RULE_SETUP -#line 839 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_SENSOR_ID(yytext, *driver.loc.back()); } +#line 846 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_INTERCEPT_ON_ERROR(yytext, *driver.loc.back()); } YY_BREAK case 252: YY_RULE_SETUP -#line 840 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_RULE_INHERITANCE(yytext, *driver.loc.back()); } +#line 847 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_CONN_R_STATE_LIMIT(yytext, *driver.loc.back()); } YY_BREAK case 253: YY_RULE_SETUP -#line 841 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_RULE_PERF_TIME(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 848 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_CONN_W_STATE_LIMIT(yytext, *driver.loc.back()); } YY_BREAK case 254: YY_RULE_SETUP -#line 842 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_STREAM_IN_BODY_INSPECTION(yytext, *driver.loc.back()); } +#line 849 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_SENSOR_ID(yytext, *driver.loc.back()); } YY_BREAK case 255: YY_RULE_SETUP -#line 843 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION(yytext, *driver.loc.back()); } +#line 850 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_RULE_INHERITANCE(yytext, *driver.loc.back()); } YY_BREAK case 256: YY_RULE_SETUP -#line 844 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_DISABLE_BACKEND_COMPRESS(yytext, *driver.loc.back()); } +#line 851 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_RULE_PERF_TIME(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 257: YY_RULE_SETUP -#line 846 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_TO_VARIABLE); return p::make_DIRECTIVE(yytext, *driver.loc.back()); } +#line 852 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_STREAM_IN_BODY_INSPECTION(yytext, *driver.loc.back()); } YY_BREAK case 258: YY_RULE_SETUP -#line 847 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_CONFIG_DIR_SEC_DEFAULT_ACTION(yytext, *driver.loc.back()); } +#line 853 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION(yytext, *driver.loc.back()); } YY_BREAK case 259: YY_RULE_SETUP -#line 848 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_CONFIG_DIR_SEC_ACTION(yytext, *driver.loc.back()); } +#line 854 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_DISABLE_BACKEND_COMPRESS(yytext, *driver.loc.back()); } YY_BREAK case 260: YY_RULE_SETUP -#line 850 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION(yytext, *driver.loc.back()); } +#line 856 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_TO_VARIABLE); return p::make_DIRECTIVE(yytext, *driver.loc.back()); } YY_BREAK case 261: YY_RULE_SETUP -#line 851 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_COLLECTION_TIMEOUT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 857 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_CONFIG_DIR_SEC_DEFAULT_ACTION(yytext, *driver.loc.back()); } YY_BREAK case 262: YY_RULE_SETUP -#line 852 "seclang-scanner.ll" -{ return p::make_CONFIG_SEC_HTTP_BLKEY(strchr(yytext, ' ') + 1, *driver.loc.back()); } +#line 858 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_CONFIG_DIR_SEC_ACTION(yytext, *driver.loc.back()); } YY_BREAK case 263: -/* rule 263 can match eol */ YY_RULE_SETUP -#line 853 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); } +#line 860 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION(yytext, *driver.loc.back()); } YY_BREAK case 264: -/* rule 264 can match eol */ YY_RULE_SETUP -#line 854 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); } +#line 861 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_COLLECTION_TIMEOUT(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 265: -/* rule 265 can match eol */ YY_RULE_SETUP -#line 855 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); } +#line 862 "seclang-scanner.ll" +{ return p::make_CONFIG_SEC_HTTP_BLKEY(strchr(yytext, ' ') + 1, *driver.loc.back()); } YY_BREAK case 266: +/* rule 266 can match eol */ YY_RULE_SETUP -#line 856 "seclang-scanner.ll" -{ driver.loc.back()->step(); /* comment, just ignore. */ } +#line 863 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); } YY_BREAK case 267: +/* rule 267 can match eol */ YY_RULE_SETUP -#line 857 "seclang-scanner.ll" -{ driver.loc.back()->step(); /* carriage return, just ignore. */} +#line 864 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); } YY_BREAK case 268: +/* rule 268 can match eol */ YY_RULE_SETUP -#line 858 "seclang-scanner.ll" -{ return p::make_QUOTATION_MARK(yytext, *driver.loc.back()); } +#line 865 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); } YY_BREAK case 269: YY_RULE_SETUP -#line 859 "seclang-scanner.ll" -{ return p::make_COMMA(*driver.loc.back()); } +#line 866 "seclang-scanner.ll" +{ driver.loc.back()->step(); /* comment, just ignore. */ } YY_BREAK - case 270: YY_RULE_SETUP -#line 862 "seclang-scanner.ll" -{ BEGIN(EXPECTING_VARIABLE); } - YY_BREAK - - -case 271: -YY_RULE_SETUP -#line 866 "seclang-scanner.ll" -{ return p::make_PIPE(*driver.loc.back()); } - YY_BREAK -case 272: -YY_RULE_SETUP #line 867 "seclang-scanner.ll" -{ return p::make_PIPE(*driver.loc.back()); } +{ driver.loc.back()->step(); /* carriage return, just ignore. */} YY_BREAK -case 273: +case 271: YY_RULE_SETUP #line 868 "seclang-scanner.ll" { return p::make_QUOTATION_MARK(yytext, *driver.loc.back()); } YY_BREAK -case 274: +case 272: YY_RULE_SETUP #line 869 "seclang-scanner.ll" -{ return p::make_VAR_EXCLUSION(*driver.loc.back()); } +{ return p::make_COMMA(*driver.loc.back()); } + YY_BREAK + +case 273: +YY_RULE_SETUP +#line 872 "seclang-scanner.ll" +{ BEGIN(EXPECTING_VARIABLE); } + YY_BREAK + + +case 274: +YY_RULE_SETUP +#line 876 "seclang-scanner.ll" +{ return p::make_PIPE(*driver.loc.back()); } YY_BREAK case 275: YY_RULE_SETUP -#line 870 "seclang-scanner.ll" +#line 877 "seclang-scanner.ll" +{ return p::make_PIPE(*driver.loc.back()); } + YY_BREAK +case 276: +YY_RULE_SETUP +#line 878 "seclang-scanner.ll" +{ return p::make_QUOTATION_MARK(yytext, *driver.loc.back()); } + YY_BREAK +case 277: +YY_RULE_SETUP +#line 879 "seclang-scanner.ll" +{ return p::make_VAR_EXCLUSION(*driver.loc.back()); } + YY_BREAK +case 278: +YY_RULE_SETUP +#line 880 "seclang-scanner.ll" { return p::make_VAR_COUNT(*driver.loc.back()); } YY_BREAK -case 276: -YY_RULE_SETUP -#line 874 "seclang-scanner.ll" -{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_SPACE); } else { state_variable_from = 0; BEGIN(INITIAL);} } - YY_BREAK -case 277: -YY_RULE_SETUP -#line 875 "seclang-scanner.ll" -{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_QUOTE); } else { state_variable_from = 0; BEGIN(INITIAL);} } - YY_BREAK -case 278: -/* rule 278 can match eol */ -YY_RULE_SETUP -#line 876 "seclang-scanner.ll" -{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_SPACE); } else { state_variable_from = 0; BEGIN(INITIAL);} } - YY_BREAK case 279: -/* rule 279 can match eol */ YY_RULE_SETUP -#line 877 "seclang-scanner.ll" -{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_QUOTE); } else { state_variable_from = 0; BEGIN(INITIAL);} } +#line 884 "seclang-scanner.ll" +{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_SPACE); } else { state_variable_from = 0; BEGIN(INITIAL);} } YY_BREAK case 280: -/* rule 280 can match eol */ YY_RULE_SETUP -#line 878 "seclang-scanner.ll" -{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_SPACE); } else { state_variable_from = 0; BEGIN(INITIAL);} } +#line 885 "seclang-scanner.ll" +{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_QUOTE); } else { state_variable_from = 0; BEGIN(INITIAL);} } YY_BREAK case 281: /* rule 281 can match eol */ YY_RULE_SETUP -#line 879 "seclang-scanner.ll" +#line 886 "seclang-scanner.ll" +{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_SPACE); } else { state_variable_from = 0; BEGIN(INITIAL);} } + YY_BREAK +case 282: +/* rule 282 can match eol */ +YY_RULE_SETUP +#line 887 "seclang-scanner.ll" { if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_QUOTE); } else { state_variable_from = 0; BEGIN(INITIAL);} } YY_BREAK - - -case 282: -YY_RULE_SETUP -#line 883 "seclang-scanner.ll" -{ } - YY_BREAK case 283: +/* rule 283 can match eol */ YY_RULE_SETUP -#line 884 "seclang-scanner.ll" -{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +#line 888 "seclang-scanner.ll" +{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_SPACE); } else { state_variable_from = 0; BEGIN(INITIAL);} } YY_BREAK case 284: /* rule 284 can match eol */ YY_RULE_SETUP -#line 885 "seclang-scanner.ll" -{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +#line 889 "seclang-scanner.ll" +{ if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR_ENDS_WITH_QUOTE); } else { state_variable_from = 0; BEGIN(INITIAL);} } YY_BREAK + + case 285: -/* rule 285 can match eol */ -YY_RULE_SETUP -#line 886 "seclang-scanner.ll" -{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } - YY_BREAK - - -case 286: -YY_RULE_SETUP -#line 891 "seclang-scanner.ll" -{ BEGIN(LEXING_ERROR_VARIABLE); yyless(0); } - YY_BREAK -case 287: -YY_RULE_SETUP -#line 892 "seclang-scanner.ll" -{ return p::make_VARIABLE_ARGS_COMBINED_SIZE(*driver.loc.back()); } - YY_BREAK -case 288: YY_RULE_SETUP #line 893 "seclang-scanner.ll" -{ return p::make_VARIABLE_ARGS_GET_NAMES(*driver.loc.back()); } +{ } YY_BREAK -case 289: +case 286: YY_RULE_SETUP #line 894 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_GET_NAMES(*driver.loc.back()); } +{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } + YY_BREAK +case 287: +/* rule 287 can match eol */ +YY_RULE_SETUP +#line 895 "seclang-scanner.ll" +{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } + YY_BREAK +case 288: +/* rule 288 can match eol */ +YY_RULE_SETUP +#line 896 "seclang-scanner.ll" +{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } + YY_BREAK + + +case 289: +YY_RULE_SETUP +#line 901 "seclang-scanner.ll" +{ BEGIN(LEXING_ERROR_VARIABLE); yyless(0); } YY_BREAK case 290: YY_RULE_SETUP -#line 895 "seclang-scanner.ll" -{ return p::make_VARIABLE_ARGS_NAMES(*driver.loc.back()); } +#line 902 "seclang-scanner.ll" +{ return p::make_VARIABLE_ARGS_COMBINED_SIZE(*driver.loc.back()); } YY_BREAK case 291: YY_RULE_SETUP -#line 896 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_NAMES(*driver.loc.back()); } +#line 903 "seclang-scanner.ll" +{ return p::make_VARIABLE_ARGS_GET_NAMES(*driver.loc.back()); } YY_BREAK case 292: YY_RULE_SETUP -#line 897 "seclang-scanner.ll" -{ return p::make_VARIABLE_ARGS_POST_NAMES(*driver.loc.back()); } +#line 904 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_GET_NAMES(*driver.loc.back()); } YY_BREAK case 293: YY_RULE_SETUP -#line 898 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_POST_NAMES(*driver.loc.back()); } +#line 905 "seclang-scanner.ll" +{ return p::make_VARIABLE_ARGS_NAMES(*driver.loc.back()); } YY_BREAK case 294: YY_RULE_SETUP -#line 899 "seclang-scanner.ll" -{ return p::make_VARIABLE_AUTH_TYPE(*driver.loc.back()); } +#line 906 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_NAMES(*driver.loc.back()); } YY_BREAK case 295: YY_RULE_SETUP -#line 900 "seclang-scanner.ll" -{ return p::make_VARIABLE_FILES_COMBINED_SIZE(*driver.loc.back()); } +#line 907 "seclang-scanner.ll" +{ return p::make_VARIABLE_ARGS_POST_NAMES(*driver.loc.back()); } YY_BREAK case 296: YY_RULE_SETUP -#line 901 "seclang-scanner.ll" -{ return p::make_VARIABLE_FULL_REQUEST_LENGTH(*driver.loc.back()); } +#line 908 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_POST_NAMES(*driver.loc.back()); } YY_BREAK case 297: YY_RULE_SETUP -#line 902 "seclang-scanner.ll" -{ return p::make_VARIABLE_FULL_REQUEST(*driver.loc.back()); } +#line 909 "seclang-scanner.ll" +{ return p::make_VARIABLE_AUTH_TYPE(*driver.loc.back()); } YY_BREAK case 298: YY_RULE_SETUP -#line 903 "seclang-scanner.ll" -{ return p::make_VARIABLE_INBOUND_DATA_ERROR(*driver.loc.back()); } +#line 910 "seclang-scanner.ll" +{ return p::make_VARIABLE_FILES_COMBINED_SIZE(*driver.loc.back()); } YY_BREAK case 299: YY_RULE_SETUP -#line 904 "seclang-scanner.ll" -{ return p::make_VARIABLE_MATCHED_VAR_NAME(*driver.loc.back()); } +#line 911 "seclang-scanner.ll" +{ return p::make_VARIABLE_FULL_REQUEST_LENGTH(*driver.loc.back()); } YY_BREAK case 300: YY_RULE_SETUP -#line 905 "seclang-scanner.ll" -{ return p::make_VARIABLE_MATCHED_VAR(*driver.loc.back()); } +#line 912 "seclang-scanner.ll" +{ return p::make_VARIABLE_FULL_REQUEST(*driver.loc.back()); } YY_BREAK case 301: YY_RULE_SETUP -#line 906 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_BOUNDARY_QUOTED(*driver.loc.back()); } +#line 913 "seclang-scanner.ll" +{ return p::make_VARIABLE_INBOUND_DATA_ERROR(*driver.loc.back()); } YY_BREAK case 302: YY_RULE_SETUP -#line 907 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_BOUNDARY_WHITESPACE(*driver.loc.back()); } +#line 914 "seclang-scanner.ll" +{ return p::make_VARIABLE_MATCHED_VAR_NAME(*driver.loc.back()); } YY_BREAK case 303: YY_RULE_SETUP -#line 908 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_CRLF_LF_LINES(*driver.loc.back()); } +#line 915 "seclang-scanner.ll" +{ return p::make_VARIABLE_MATCHED_VAR(*driver.loc.back()); } YY_BREAK case 304: YY_RULE_SETUP -#line 909 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_DATA_AFTER(*driver.loc.back()); } +#line 916 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_BOUNDARY_QUOTED(*driver.loc.back()); } YY_BREAK case 305: YY_RULE_SETUP -#line 910 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_DATA_BEFORE(*driver.loc.back()); } +#line 917 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_BOUNDARY_WHITESPACE(*driver.loc.back()); } YY_BREAK case 306: YY_RULE_SETUP -#line 911 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_FILE_LIMIT_EXCEEDED(*driver.loc.back()); } +#line 918 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_CRLF_LF_LINES(*driver.loc.back()); } YY_BREAK case 307: YY_RULE_SETUP -#line 912 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MULTIPART_FILENAME(*driver.loc.back()); } +#line 919 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_DATA_AFTER(*driver.loc.back()); } YY_BREAK case 308: YY_RULE_SETUP -#line 913 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_FILENAME(*driver.loc.back()); } +#line 920 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_DATA_BEFORE(*driver.loc.back()); } YY_BREAK case 309: YY_RULE_SETUP -#line 914 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_HEADER_FOLDING(*driver.loc.back()); } +#line 921 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_FILE_LIMIT_EXCEEDED(*driver.loc.back()); } YY_BREAK case 310: YY_RULE_SETUP -#line 915 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_HEADER_FOLDING(*driver.loc.back()); } +#line 922 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MULTIPART_FILENAME(*driver.loc.back()); } YY_BREAK case 311: YY_RULE_SETUP -#line 916 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_INVALID_HEADER_FOLDING(*driver.loc.back()); } +#line 923 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_FILENAME(*driver.loc.back()); } YY_BREAK case 312: YY_RULE_SETUP -#line 917 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_INVALID_PART(*driver.loc.back()); } +#line 924 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_HEADER_FOLDING(*driver.loc.back()); } YY_BREAK case 313: YY_RULE_SETUP -#line 918 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_INVALID_QUOTING(*driver.loc.back()); } +#line 925 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_HEADER_FOLDING(*driver.loc.back()); } YY_BREAK case 314: YY_RULE_SETUP -#line 919 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_LF_LINE(*driver.loc.back()); } +#line 926 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_INVALID_HEADER_FOLDING(*driver.loc.back()); } YY_BREAK case 315: YY_RULE_SETUP -#line 920 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_MISSING_SEMICOLON(*driver.loc.back()); } +#line 927 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_INVALID_PART(*driver.loc.back()); } YY_BREAK case 316: YY_RULE_SETUP -#line 921 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_SEMICOLON_MISSING(*driver.loc.back()); } +#line 928 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_INVALID_QUOTING(*driver.loc.back()); } YY_BREAK case 317: YY_RULE_SETUP -#line 922 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MULTIPART_NAME(*driver.loc.back()); } +#line 929 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_LF_LINE(*driver.loc.back()); } YY_BREAK case 318: YY_RULE_SETUP -#line 923 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_NAME(*driver.loc.back()); } +#line 930 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_MISSING_SEMICOLON(*driver.loc.back()); } YY_BREAK case 319: YY_RULE_SETUP -#line 924 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_STRICT_ERROR(*driver.loc.back()); } +#line 931 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_SEMICOLON_MISSING(*driver.loc.back()); } YY_BREAK case 320: YY_RULE_SETUP -#line 925 "seclang-scanner.ll" -{ return p::make_VARIABLE_MULTIPART_UNMATCHED_BOUNDARY(*driver.loc.back()); } +#line 932 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MULTIPART_NAME(*driver.loc.back()); } YY_BREAK case 321: YY_RULE_SETUP -#line 926 "seclang-scanner.ll" -{ return p::make_VARIABLE_OUTBOUND_DATA_ERROR(*driver.loc.back()); } +#line 933 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_NAME(*driver.loc.back()); } YY_BREAK case 322: YY_RULE_SETUP -#line 927 "seclang-scanner.ll" -{ return p::make_VARIABLE_PATH_INFO(*driver.loc.back()); } +#line 934 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_STRICT_ERROR(*driver.loc.back()); } YY_BREAK case 323: YY_RULE_SETUP -#line 928 "seclang-scanner.ll" -{ return p::make_VARIABLE_QUERY_STRING(*driver.loc.back()); } +#line 935 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_UNMATCHED_BOUNDARY(*driver.loc.back()); } YY_BREAK case 324: YY_RULE_SETUP -#line 929 "seclang-scanner.ll" -{ return p::make_VARIABLE_REMOTE_ADDR(*driver.loc.back()); } +#line 936 "seclang-scanner.ll" +{ return p::make_VARIABLE_OUTBOUND_DATA_ERROR(*driver.loc.back()); } YY_BREAK case 325: YY_RULE_SETUP -#line 930 "seclang-scanner.ll" -{ return p::make_VARIABLE_REMOTE_HOST(*driver.loc.back()); } +#line 937 "seclang-scanner.ll" +{ return p::make_VARIABLE_PATH_INFO(*driver.loc.back()); } YY_BREAK case 326: YY_RULE_SETUP -#line 931 "seclang-scanner.ll" -{ return p::make_VARIABLE_REMOTE_PORT(*driver.loc.back()); } +#line 938 "seclang-scanner.ll" +{ return p::make_VARIABLE_QUERY_STRING(*driver.loc.back()); } YY_BREAK case 327: YY_RULE_SETUP -#line 932 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQBODY_ERROR_MSG(*driver.loc.back()); } +#line 939 "seclang-scanner.ll" +{ return p::make_VARIABLE_REMOTE_ADDR(*driver.loc.back()); } YY_BREAK case 328: YY_RULE_SETUP -#line 933 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQBODY_ERROR(*driver.loc.back()); } +#line 940 "seclang-scanner.ll" +{ return p::make_VARIABLE_REMOTE_HOST(*driver.loc.back()); } YY_BREAK case 329: YY_RULE_SETUP -#line 934 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQBODY_PROCESSOR_ERROR_MSG(*driver.loc.back()); } +#line 941 "seclang-scanner.ll" +{ return p::make_VARIABLE_REMOTE_PORT(*driver.loc.back()); } YY_BREAK case 330: YY_RULE_SETUP -#line 935 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQBODY_PROCESSOR_ERROR(*driver.loc.back()); } +#line 942 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQBODY_ERROR_MSG(*driver.loc.back()); } YY_BREAK case 331: YY_RULE_SETUP -#line 936 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQBODY_PROCESSOR(*driver.loc.back()); } +#line 943 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQBODY_ERROR(*driver.loc.back()); } YY_BREAK case 332: YY_RULE_SETUP -#line 937 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_BASENAME(*driver.loc.back()); } +#line 944 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQBODY_PROCESSOR_ERROR_MSG(*driver.loc.back()); } YY_BREAK case 333: YY_RULE_SETUP -#line 938 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_BODY_LENGTH(*driver.loc.back()); } +#line 945 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQBODY_PROCESSOR_ERROR(*driver.loc.back()); } YY_BREAK case 334: YY_RULE_SETUP -#line 939 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_BODY(*driver.loc.back()); } +#line 946 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQBODY_PROCESSOR(*driver.loc.back()); } YY_BREAK case 335: YY_RULE_SETUP -#line 940 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_FILE_NAME(*driver.loc.back()); } +#line 947 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_BASENAME(*driver.loc.back()); } YY_BREAK case 336: YY_RULE_SETUP -#line 941 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_HEADERS_NAMES(*driver.loc.back()); } +#line 948 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_BODY_LENGTH(*driver.loc.back()); } YY_BREAK case 337: YY_RULE_SETUP -#line 942 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_REQUEST_HEADERS_NAMES(*driver.loc.back()); } +#line 949 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_BODY(*driver.loc.back()); } YY_BREAK case 338: YY_RULE_SETUP -#line 943 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_LINE(*driver.loc.back()); } +#line 950 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_FILE_NAME(*driver.loc.back()); } YY_BREAK case 339: YY_RULE_SETUP -#line 944 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_METHOD(*driver.loc.back()); } +#line 951 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_HEADERS_NAMES(*driver.loc.back()); } YY_BREAK case 340: YY_RULE_SETUP -#line 945 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_PROTOCOL(*driver.loc.back()); } +#line 952 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_REQUEST_HEADERS_NAMES(*driver.loc.back()); } YY_BREAK case 341: YY_RULE_SETUP -#line 946 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_URI_RAW(*driver.loc.back()); } +#line 953 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_LINE(*driver.loc.back()); } YY_BREAK case 342: YY_RULE_SETUP -#line 947 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_URI(*driver.loc.back()); } +#line 954 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_METHOD(*driver.loc.back()); } YY_BREAK case 343: YY_RULE_SETUP -#line 948 "seclang-scanner.ll" -{ return p::make_VARIABLE_RESPONSE_BODY(*driver.loc.back()); } +#line 955 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_PROTOCOL(*driver.loc.back()); } YY_BREAK case 344: YY_RULE_SETUP -#line 949 "seclang-scanner.ll" -{ return p::make_VARIABLE_RESPONSE_CONTENT_LENGTH(*driver.loc.back()); } +#line 956 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_URI_RAW(*driver.loc.back()); } YY_BREAK case 345: YY_RULE_SETUP -#line 950 "seclang-scanner.ll" -{ return p::make_VARIABLE_RESPONSE_CONTENT_TYPE(*driver.loc.back()); } +#line 957 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_URI(*driver.loc.back()); } YY_BREAK case 346: YY_RULE_SETUP -#line 951 "seclang-scanner.ll" -{ return p::make_VARIABLE_RESPONSE_HEADERS_NAMES(*driver.loc.back()); } +#line 958 "seclang-scanner.ll" +{ return p::make_VARIABLE_RESPONSE_BODY(*driver.loc.back()); } YY_BREAK case 347: YY_RULE_SETUP -#line 952 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_RESPONSE_HEADERS_NAMES(*driver.loc.back()); } +#line 959 "seclang-scanner.ll" +{ return p::make_VARIABLE_RESPONSE_CONTENT_LENGTH(*driver.loc.back()); } YY_BREAK case 348: YY_RULE_SETUP -#line 953 "seclang-scanner.ll" -{ return p::make_VARIABLE_RESPONSE_PROTOCOL(*driver.loc.back()); } +#line 960 "seclang-scanner.ll" +{ return p::make_VARIABLE_RESPONSE_CONTENT_TYPE(*driver.loc.back()); } YY_BREAK case 349: YY_RULE_SETUP -#line 954 "seclang-scanner.ll" -{ return p::make_VARIABLE_RESPONSE_STATUS(*driver.loc.back()); } +#line 961 "seclang-scanner.ll" +{ return p::make_VARIABLE_RESPONSE_HEADERS_NAMES(*driver.loc.back()); } YY_BREAK case 350: YY_RULE_SETUP -#line 955 "seclang-scanner.ll" -{ return p::make_VARIABLE_SERVER_ADDR(*driver.loc.back()); } +#line 962 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_RESPONSE_HEADERS_NAMES(*driver.loc.back()); } YY_BREAK case 351: YY_RULE_SETUP -#line 956 "seclang-scanner.ll" -{ return p::make_VARIABLE_SERVER_NAME(*driver.loc.back()); } +#line 963 "seclang-scanner.ll" +{ return p::make_VARIABLE_RESPONSE_PROTOCOL(*driver.loc.back()); } YY_BREAK case 352: YY_RULE_SETUP -#line 957 "seclang-scanner.ll" -{ return p::make_VARIABLE_SERVER_PORT(*driver.loc.back()); } +#line 964 "seclang-scanner.ll" +{ return p::make_VARIABLE_RESPONSE_STATUS(*driver.loc.back()); } YY_BREAK case 353: YY_RULE_SETUP -#line 958 "seclang-scanner.ll" -{ return p::make_VARIABLE_SESSION_ID(*driver.loc.back()); } +#line 965 "seclang-scanner.ll" +{ return p::make_VARIABLE_SERVER_ADDR(*driver.loc.back()); } YY_BREAK case 354: YY_RULE_SETUP -#line 959 "seclang-scanner.ll" -{ return p::make_VARIABLE_UNIQUE_ID(*driver.loc.back()); } +#line 966 "seclang-scanner.ll" +{ return p::make_VARIABLE_SERVER_NAME(*driver.loc.back()); } YY_BREAK case 355: YY_RULE_SETUP -#line 960 "seclang-scanner.ll" -{ return p::make_VARIABLE_URL_ENCODED_ERROR(*driver.loc.back()); } +#line 967 "seclang-scanner.ll" +{ return p::make_VARIABLE_SERVER_PORT(*driver.loc.back()); } YY_BREAK case 356: YY_RULE_SETUP -#line 961 "seclang-scanner.ll" -{ return p::make_VARIABLE_USER_ID(*driver.loc.back()); } +#line 968 "seclang-scanner.ll" +{ return p::make_VARIABLE_SESSION_ID(*driver.loc.back()); } YY_BREAK case 357: YY_RULE_SETUP -#line 962 "seclang-scanner.ll" -{ return p::make_VARIABLE_WEB_APP_ID(*driver.loc.back()); } +#line 969 "seclang-scanner.ll" +{ return p::make_VARIABLE_UNIQUE_ID(*driver.loc.back()); } YY_BREAK case 358: YY_RULE_SETUP -#line 963 "seclang-scanner.ll" -{ return p::make_VARIABLE_ARGS(*driver.loc.back()); } +#line 970 "seclang-scanner.ll" +{ return p::make_VARIABLE_URL_ENCODED_ERROR(*driver.loc.back()); } YY_BREAK case 359: YY_RULE_SETUP -#line 964 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS(*driver.loc.back()); } +#line 971 "seclang-scanner.ll" +{ return p::make_VARIABLE_USER_ID(*driver.loc.back()); } YY_BREAK case 360: YY_RULE_SETUP -#line 965 "seclang-scanner.ll" -{ return p::make_VARIABLE_ARGS_GET(*driver.loc.back()); } +#line 972 "seclang-scanner.ll" +{ return p::make_VARIABLE_WEB_APP_ID(*driver.loc.back()); } YY_BREAK case 361: YY_RULE_SETUP -#line 966 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_GET(*driver.loc.back()); } +#line 973 "seclang-scanner.ll" +{ return p::make_VARIABLE_ARGS(*driver.loc.back()); } YY_BREAK case 362: YY_RULE_SETUP -#line 967 "seclang-scanner.ll" -{ return p::make_VARIABLE_ARGS_POST(*driver.loc.back()); } +#line 974 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS(*driver.loc.back()); } YY_BREAK case 363: YY_RULE_SETUP -#line 968 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_POST(*driver.loc.back()); } +#line 975 "seclang-scanner.ll" +{ return p::make_VARIABLE_ARGS_GET(*driver.loc.back()); } YY_BREAK case 364: YY_RULE_SETUP -#line 969 "seclang-scanner.ll" -{ return p::make_VARIABLE_FILES_SIZES(*driver.loc.back()); } +#line 976 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_GET(*driver.loc.back()); } YY_BREAK case 365: YY_RULE_SETUP -#line 970 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES_SIZES(*driver.loc.back()); } +#line 977 "seclang-scanner.ll" +{ return p::make_VARIABLE_ARGS_POST(*driver.loc.back()); } YY_BREAK case 366: YY_RULE_SETUP -#line 971 "seclang-scanner.ll" -{ return p::make_VARIABLE_FILES_NAMES(*driver.loc.back()); } +#line 978 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_ARGS_POST(*driver.loc.back()); } YY_BREAK case 367: YY_RULE_SETUP -#line 972 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES_NAMES(*driver.loc.back()); } +#line 979 "seclang-scanner.ll" +{ return p::make_VARIABLE_FILES_SIZES(*driver.loc.back()); } YY_BREAK case 368: YY_RULE_SETUP -#line 973 "seclang-scanner.ll" -{ return p::make_VARIABLE_FILES_TMP_CONTENT(*driver.loc.back()); } +#line 980 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES_SIZES(*driver.loc.back()); } YY_BREAK case 369: YY_RULE_SETUP -#line 974 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES_TMP_CONTENT(*driver.loc.back()); } +#line 981 "seclang-scanner.ll" +{ return p::make_VARIABLE_FILES_NAMES(*driver.loc.back()); } YY_BREAK case 370: YY_RULE_SETUP -#line 975 "seclang-scanner.ll" -{ return p::make_VARIABLE_MATCHED_VARS_NAMES(*driver.loc.back()); } +#line 982 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES_NAMES(*driver.loc.back()); } YY_BREAK case 371: YY_RULE_SETUP -#line 976 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MATCHED_VARS_NAMES(*driver.loc.back()); } +#line 983 "seclang-scanner.ll" +{ return p::make_VARIABLE_FILES_TMP_CONTENT(*driver.loc.back()); } YY_BREAK case 372: YY_RULE_SETUP -#line 977 "seclang-scanner.ll" -{ return p::make_VARIABLE_MATCHED_VARS(*driver.loc.back()); } +#line 984 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES_TMP_CONTENT(*driver.loc.back()); } YY_BREAK case 373: YY_RULE_SETUP -#line 978 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MATCHED_VARS(*driver.loc.back()); } +#line 985 "seclang-scanner.ll" +{ return p::make_VARIABLE_MATCHED_VARS_NAMES(*driver.loc.back()); } YY_BREAK case 374: YY_RULE_SETUP -#line 979 "seclang-scanner.ll" -{ return p::make_VARIABLE_FILES(*driver.loc.back()); } +#line 986 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MATCHED_VARS_NAMES(*driver.loc.back()); } YY_BREAK case 375: YY_RULE_SETUP -#line 980 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES(*driver.loc.back()); } +#line 987 "seclang-scanner.ll" +{ return p::make_VARIABLE_MATCHED_VARS(*driver.loc.back()); } YY_BREAK case 376: YY_RULE_SETUP -#line 981 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_COOKIES(*driver.loc.back()); } +#line 988 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MATCHED_VARS(*driver.loc.back()); } YY_BREAK case 377: YY_RULE_SETUP -#line 982 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_REQUEST_COOKIES(*driver.loc.back()); } +#line 989 "seclang-scanner.ll" +{ return p::make_VARIABLE_FILES(*driver.loc.back()); } YY_BREAK case 378: YY_RULE_SETUP -#line 983 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_HEADERS(*driver.loc.back()); } +#line 990 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES(*driver.loc.back()); } YY_BREAK case 379: YY_RULE_SETUP -#line 984 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_REQUEST_HEADERS(*driver.loc.back()); } +#line 991 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_COOKIES(*driver.loc.back()); } YY_BREAK case 380: YY_RULE_SETUP -#line 985 "seclang-scanner.ll" -{ return p::make_VARIABLE_RESPONSE_HEADERS(*driver.loc.back()); } +#line 992 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_REQUEST_COOKIES(*driver.loc.back()); } YY_BREAK case 381: YY_RULE_SETUP -#line 986 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_RESPONSE_HEADERS(*driver.loc.back()); } +#line 993 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_HEADERS(*driver.loc.back()); } YY_BREAK case 382: YY_RULE_SETUP -#line 987 "seclang-scanner.ll" -{ return p::make_VARIABLE_GEO(*driver.loc.back()); } +#line 994 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_REQUEST_HEADERS(*driver.loc.back()); } YY_BREAK case 383: YY_RULE_SETUP -#line 988 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_GEO(*driver.loc.back()); } +#line 995 "seclang-scanner.ll" +{ return p::make_VARIABLE_RESPONSE_HEADERS(*driver.loc.back()); } YY_BREAK case 384: YY_RULE_SETUP -#line 989 "seclang-scanner.ll" -{ return p::make_VARIABLE_REQUEST_COOKIES_NAMES(*driver.loc.back()); } +#line 996 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_RESPONSE_HEADERS(*driver.loc.back()); } YY_BREAK case 385: YY_RULE_SETUP -#line 990 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_REQUEST_COOKIES_NAMES(*driver.loc.back()); } +#line 997 "seclang-scanner.ll" +{ return p::make_VARIABLE_GEO(*driver.loc.back()); } YY_BREAK case 386: YY_RULE_SETUP -#line 991 "seclang-scanner.ll" -{ return p::make_VARIABLE_RULE(*driver.loc.back()); } +#line 998 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_GEO(*driver.loc.back()); } YY_BREAK case 387: YY_RULE_SETUP -#line 992 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_RULE(*driver.loc.back()); } +#line 999 "seclang-scanner.ll" +{ return p::make_VARIABLE_REQUEST_COOKIES_NAMES(*driver.loc.back()); } YY_BREAK case 388: YY_RULE_SETUP -#line 993 "seclang-scanner.ll" -{ return p::make_VARIABLE_FILES_TMP_NAMES(*driver.loc.back()); } +#line 1000 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_REQUEST_COOKIES_NAMES(*driver.loc.back()); } YY_BREAK case 389: YY_RULE_SETUP -#line 994 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES_TMP_NAMES(*driver.loc.back()); } +#line 1001 "seclang-scanner.ll" +{ return p::make_VARIABLE_MULTIPART_PART_HEADERS(*driver.loc.back()); } YY_BREAK case 390: YY_RULE_SETUP -#line 995 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_XML(*driver.loc.back()); } +#line 1002 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MULTIPART_PART_HEADERS(*driver.loc.back()); } YY_BREAK case 391: YY_RULE_SETUP -#line 996 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_RUN_TIME_VAR_XML(*driver.loc.back()); } +#line 1003 "seclang-scanner.ll" +{ return p::make_VARIABLE_RULE(*driver.loc.back()); } YY_BREAK case 392: YY_RULE_SETUP -#line 997 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_ENV(*driver.loc.back()); } +#line 1004 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_RULE(*driver.loc.back()); } YY_BREAK case 393: YY_RULE_SETUP -#line 998 "seclang-scanner.ll" -{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_RUN_TIME_VAR_ENV(*driver.loc.back()); } +#line 1005 "seclang-scanner.ll" +{ return p::make_VARIABLE_FILES_TMP_NAMES(*driver.loc.back()); } YY_BREAK case 394: YY_RULE_SETUP -#line 999 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_BLD(yytext, *driver.loc.back()); } +#line 1006 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_FILES_TMP_NAMES(*driver.loc.back()); } YY_BREAK case 395: YY_RULE_SETUP -#line 1000 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_DUR(yytext, *driver.loc.back()); } +#line 1007 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_XML(*driver.loc.back()); } YY_BREAK case 396: YY_RULE_SETUP -#line 1001 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_HSV(yytext, *driver.loc.back()); } +#line 1008 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_RUN_TIME_VAR_XML(*driver.loc.back()); } YY_BREAK case 397: YY_RULE_SETUP -#line 1002 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_REMOTE_USER(yytext, *driver.loc.back()); } +#line 1009 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_ENV(*driver.loc.back()); } YY_BREAK case 398: YY_RULE_SETUP -#line 1003 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_TIME_DAY(yytext, *driver.loc.back()); } +#line 1010 "seclang-scanner.ll" +{ BEGINX(EXPECTING_VAR_PARAMETER); return p::make_RUN_TIME_VAR_ENV(*driver.loc.back()); } YY_BREAK case 399: YY_RULE_SETUP -#line 1004 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_TIME_EPOCH(yytext, *driver.loc.back()); } +#line 1011 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_BLD(yytext, *driver.loc.back()); } YY_BREAK case 400: YY_RULE_SETUP -#line 1005 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_TIME_HOUR(yytext, *driver.loc.back()); } +#line 1012 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_DUR(yytext, *driver.loc.back()); } YY_BREAK case 401: YY_RULE_SETUP -#line 1006 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_TIME_MIN(yytext, *driver.loc.back()); } +#line 1013 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_HSV(yytext, *driver.loc.back()); } YY_BREAK case 402: YY_RULE_SETUP -#line 1007 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_TIME_MON(yytext, *driver.loc.back()); } +#line 1014 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_REMOTE_USER(yytext, *driver.loc.back()); } YY_BREAK case 403: YY_RULE_SETUP -#line 1008 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_TIME_SEC(yytext, *driver.loc.back()); } +#line 1015 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_TIME_DAY(yytext, *driver.loc.back()); } YY_BREAK case 404: YY_RULE_SETUP -#line 1009 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_TIME_YEAR(yytext, *driver.loc.back()); } +#line 1016 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_TIME_EPOCH(yytext, *driver.loc.back()); } YY_BREAK case 405: YY_RULE_SETUP -#line 1010 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_TIME(yytext, *driver.loc.back()); } +#line 1017 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_TIME_HOUR(yytext, *driver.loc.back()); } YY_BREAK case 406: YY_RULE_SETUP -#line 1011 "seclang-scanner.ll" -{ return p::make_RUN_TIME_VAR_TIME_WDAY(yytext, *driver.loc.back()); } +#line 1018 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_TIME_MIN(yytext, *driver.loc.back()); } YY_BREAK case 407: YY_RULE_SETUP -#line 1014 "seclang-scanner.ll" -{ driver.error (*driver.loc.back(), "Variable VARIABLE_WEBSERVER_ERROR_LOG is not supported by libModSecurity", ""); throw p::syntax_error(*driver.loc.back(), "");} +#line 1019 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_TIME_MON(yytext, *driver.loc.back()); } YY_BREAK case 408: YY_RULE_SETUP -#line 1015 "seclang-scanner.ll" -{ return p::make_VARIABLE_GLOBAL(*driver.loc.back()); } +#line 1020 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_TIME_SEC(yytext, *driver.loc.back()); } YY_BREAK case 409: YY_RULE_SETUP -#line 1016 "seclang-scanner.ll" -{ return p::make_VARIABLE_IP(*driver.loc.back()); } +#line 1021 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_TIME_YEAR(yytext, *driver.loc.back()); } YY_BREAK case 410: YY_RULE_SETUP -#line 1017 "seclang-scanner.ll" -{ return p::make_VARIABLE_RESOURCE(*driver.loc.back()); } +#line 1022 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_TIME(yytext, *driver.loc.back()); } YY_BREAK case 411: YY_RULE_SETUP -#line 1018 "seclang-scanner.ll" -{ return p::make_VARIABLE_SESSION(*driver.loc.back()); } +#line 1023 "seclang-scanner.ll" +{ return p::make_RUN_TIME_VAR_TIME_WDAY(yytext, *driver.loc.back()); } YY_BREAK case 412: YY_RULE_SETUP -#line 1019 "seclang-scanner.ll" -{ return p::make_VARIABLE_STATUS(*driver.loc.back()); } +#line 1026 "seclang-scanner.ll" +{ driver.error (*driver.loc.back(), "Variable VARIABLE_WEBSERVER_ERROR_LOG is not supported by libModSecurity", ""); throw p::syntax_error(*driver.loc.back(), "");} YY_BREAK case 413: YY_RULE_SETUP -#line 1020 "seclang-scanner.ll" -{ return p::make_VARIABLE_STATUS_LINE(*driver.loc.back()); } +#line 1027 "seclang-scanner.ll" +{ return p::make_VARIABLE_GLOBAL(*driver.loc.back()); } YY_BREAK case 414: YY_RULE_SETUP -#line 1021 "seclang-scanner.ll" -{ return p::make_VARIABLE_TX(*driver.loc.back()); } +#line 1028 "seclang-scanner.ll" +{ return p::make_VARIABLE_IP(*driver.loc.back()); } YY_BREAK case 415: YY_RULE_SETUP -#line 1022 "seclang-scanner.ll" +#line 1029 "seclang-scanner.ll" +{ return p::make_VARIABLE_RESOURCE(*driver.loc.back()); } + YY_BREAK +case 416: +YY_RULE_SETUP +#line 1030 "seclang-scanner.ll" +{ return p::make_VARIABLE_SESSION(*driver.loc.back()); } + YY_BREAK +case 417: +YY_RULE_SETUP +#line 1031 "seclang-scanner.ll" +{ return p::make_VARIABLE_STATUS(*driver.loc.back()); } + YY_BREAK +case 418: +YY_RULE_SETUP +#line 1032 "seclang-scanner.ll" +{ return p::make_VARIABLE_STATUS_LINE(*driver.loc.back()); } + YY_BREAK +case 419: +YY_RULE_SETUP +#line 1033 "seclang-scanner.ll" +{ return p::make_VARIABLE_TX(*driver.loc.back()); } + YY_BREAK +case 420: +YY_RULE_SETUP +#line 1034 "seclang-scanner.ll" { return p::make_VARIABLE_USER(*driver.loc.back()); } YY_BREAK -case 416: -YY_RULE_SETUP -#line 1026 "seclang-scanner.ll" -{ BEGINX_(); return p::make_VARIABLE_GLOBAL(*driver.loc.back()); } - YY_BREAK -case 417: -YY_RULE_SETUP -#line 1027 "seclang-scanner.ll" -{ BEGINX_(); return p::make_VARIABLE_IP(*driver.loc.back()); } - YY_BREAK -case 418: -YY_RULE_SETUP -#line 1028 "seclang-scanner.ll" -{ BEGINX_(); return p::make_VARIABLE_RESOURCE(*driver.loc.back()); } - YY_BREAK -case 419: -YY_RULE_SETUP -#line 1029 "seclang-scanner.ll" -{ BEGINX_(); return p::make_VARIABLE_SESSION(*driver.loc.back()); } - YY_BREAK -case 420: -YY_RULE_SETUP -#line 1030 "seclang-scanner.ll" -{ BEGINX_(); return p::make_VARIABLE_TX(*driver.loc.back()); } - YY_BREAK case 421: YY_RULE_SETUP -#line 1031 "seclang-scanner.ll" +#line 1038 "seclang-scanner.ll" +{ BEGINX_(); return p::make_VARIABLE_GLOBAL(*driver.loc.back()); } + YY_BREAK +case 422: +YY_RULE_SETUP +#line 1039 "seclang-scanner.ll" +{ BEGINX_(); return p::make_VARIABLE_IP(*driver.loc.back()); } + YY_BREAK +case 423: +YY_RULE_SETUP +#line 1040 "seclang-scanner.ll" +{ BEGINX_(); return p::make_VARIABLE_RESOURCE(*driver.loc.back()); } + YY_BREAK +case 424: +YY_RULE_SETUP +#line 1041 "seclang-scanner.ll" +{ BEGINX_(); return p::make_VARIABLE_SESSION(*driver.loc.back()); } + YY_BREAK +case 425: +YY_RULE_SETUP +#line 1042 "seclang-scanner.ll" +{ BEGINX_(); return p::make_VARIABLE_TX(*driver.loc.back()); } + YY_BREAK +case 426: +YY_RULE_SETUP +#line 1043 "seclang-scanner.ll" { BEGINX_(); return p::make_VARIABLE_USER(*driver.loc.back()); } YY_BREAK -case 422: +case 427: YY_RULE_SETUP -#line 1036 "seclang-scanner.ll" +#line 1048 "seclang-scanner.ll" { BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_PLUS(*driver.loc.back()); } YY_BREAK -case 423: +case 428: YY_RULE_SETUP -#line 1037 "seclang-scanner.ll" +#line 1049 "seclang-scanner.ll" { BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_MINUS(*driver.loc.back()); } YY_BREAK -case 424: -YY_RULE_SETUP -#line 1038 "seclang-scanner.ll" -{ BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS(*driver.loc.back()); } - YY_BREAK -case 425: -/* rule 425 can match eol */ -YY_RULE_SETUP -#line 1039 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } - YY_BREAK -case 426: -/* rule 426 can match eol */ -YY_RULE_SETUP -#line 1040 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } - YY_BREAK -case 427: -/* rule 427 can match eol */ -YY_RULE_SETUP -#line 1041 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng - 0); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } - YY_BREAK -case 428: -/* rule 428 can match eol */ -YY_RULE_SETUP -#line 1042 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } - YY_BREAK case 429: -/* rule 429 can match eol */ YY_RULE_SETUP -#line 1043 "seclang-scanner.ll" -{ yyless(yyleng - 1); BEGIN_PREVIOUS(); return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +#line 1050 "seclang-scanner.ll" +{ BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS(*driver.loc.back()); } YY_BREAK case 430: /* rule 430 can match eol */ YY_RULE_SETUP -#line 1044 "seclang-scanner.ll" -{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +#line 1051 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } YY_BREAK case 431: /* rule 431 can match eol */ YY_RULE_SETUP -#line 1046 "seclang-scanner.ll" +#line 1052 "seclang-scanner.ll" { BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } YY_BREAK case 432: /* rule 432 can match eol */ YY_RULE_SETUP -#line 1047 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } +#line 1053 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng - 0); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } YY_BREAK case 433: +/* rule 433 can match eol */ YY_RULE_SETUP -#line 1048 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(0); } +#line 1054 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } YY_BREAK case 434: +/* rule 434 can match eol */ YY_RULE_SETUP -#line 1049 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(0); } +#line 1055 "seclang-scanner.ll" +{ yyless(yyleng - 1); BEGIN_PREVIOUS(); return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } YY_BREAK case 435: +/* rule 435 can match eol */ YY_RULE_SETUP -#line 1050 "seclang-scanner.ll" -{ BEGINX(LEXING_ERROR_ACTION); yyless(0); } +#line 1056 "seclang-scanner.ll" +{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } YY_BREAK - - case 436: /* rule 436 can match eol */ YY_RULE_SETUP -#line 1055 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } +#line 1058 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } YY_BREAK case 437: /* rule 437 can match eol */ YY_RULE_SETUP -#line 1056 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } - YY_BREAK -case 438: -/* rule 438 can match eol */ -YY_RULE_SETUP -#line 1057 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } - YY_BREAK -case 439: -/* rule 439 can match eol */ -YY_RULE_SETUP -#line 1058 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng - 0); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } - YY_BREAK -case 440: -/* rule 440 can match eol */ -YY_RULE_SETUP #line 1059 "seclang-scanner.ll" { BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } YY_BREAK +case 438: +YY_RULE_SETUP +#line 1060 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(0); } + YY_BREAK +case 439: +YY_RULE_SETUP +#line 1061 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(0); } + YY_BREAK +case 440: +YY_RULE_SETUP +#line 1062 "seclang-scanner.ll" +{ BEGINX(LEXING_ERROR_ACTION); yyless(0); } + YY_BREAK + + case 441: /* rule 441 can match eol */ YY_RULE_SETUP -#line 1060 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); return p::make_DICT_ELEMENT(yytext, *driver.loc.back()); } +#line 1067 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } YY_BREAK case 442: /* rule 442 can match eol */ YY_RULE_SETUP -#line 1062 "seclang-scanner.ll" +#line 1068 "seclang-scanner.ll" { BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } YY_BREAK case 443: /* rule 443 can match eol */ YY_RULE_SETUP -#line 1063 "seclang-scanner.ll" -{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } +#line 1069 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } YY_BREAK case 444: +/* rule 444 can match eol */ YY_RULE_SETUP -#line 1065 "seclang-scanner.ll" -{ BEGINX(LEXING_ERROR_ACTION); yyless(0); } +#line 1070 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng - 0); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } YY_BREAK case 445: +/* rule 445 can match eol */ YY_RULE_SETUP -#line 1066 "seclang-scanner.ll" +#line 1071 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } + YY_BREAK +case 446: +/* rule 446 can match eol */ +YY_RULE_SETUP +#line 1072 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); return p::make_DICT_ELEMENT(yytext, *driver.loc.back()); } + YY_BREAK +case 447: +/* rule 447 can match eol */ +YY_RULE_SETUP +#line 1074 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); } + YY_BREAK +case 448: +/* rule 448 can match eol */ +YY_RULE_SETUP +#line 1075 "seclang-scanner.ll" +{ BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); } + YY_BREAK +case 449: +YY_RULE_SETUP +#line 1077 "seclang-scanner.ll" +{ BEGINX(LEXING_ERROR_ACTION); yyless(0); } + YY_BREAK +case 450: +YY_RULE_SETUP +#line 1078 "seclang-scanner.ll" { return p::make_QUOTATION_MARK(yytext, *driver.loc.back()); } YY_BREAK -case 446: -YY_RULE_SETUP -#line 1072 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_GEOLOOKUP(*driver.loc.back()); } - YY_BREAK -case 447: -YY_RULE_SETUP -#line 1073 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_UNCONDITIONAL_MATCH(*driver.loc.back()); } - YY_BREAK -case 448: -YY_RULE_SETUP -#line 1074 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_SQLI(*driver.loc.back()); } - YY_BREAK -case 449: -YY_RULE_SETUP -#line 1075 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_XSS(*driver.loc.back()); } - YY_BREAK -case 450: -YY_RULE_SETUP -#line 1076 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_URL_ENCODING(*driver.loc.back()); } - YY_BREAK case 451: YY_RULE_SETUP -#line 1077 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_UTF8_ENCODING(*driver.loc.back()); } +#line 1084 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_GEOLOOKUP(*driver.loc.back()); } YY_BREAK - - case 452: YY_RULE_SETUP -#line 1080 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_GEOLOOKUP(*driver.loc.back()); } +#line 1085 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_UNCONDITIONAL_MATCH(*driver.loc.back()); } YY_BREAK case 453: YY_RULE_SETUP -#line 1081 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_UNCONDITIONAL_MATCH(*driver.loc.back()); } +#line 1086 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_SQLI(*driver.loc.back()); } YY_BREAK case 454: YY_RULE_SETUP -#line 1082 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_SQLI(*driver.loc.back()); } +#line 1087 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_XSS(*driver.loc.back()); } YY_BREAK case 455: YY_RULE_SETUP -#line 1083 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_XSS(*driver.loc.back()); } +#line 1088 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_URL_ENCODING(*driver.loc.back()); } YY_BREAK case 456: YY_RULE_SETUP -#line 1084 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_URL_ENCODING(*driver.loc.back()); } - YY_BREAK -case 457: -YY_RULE_SETUP -#line 1085 "seclang-scanner.ll" +#line 1089 "seclang-scanner.ll" { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_UTF8_ENCODING(*driver.loc.back()); } YY_BREAK +case 457: +YY_RULE_SETUP +#line 1092 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_GEOLOOKUP(*driver.loc.back()); } + YY_BREAK case 458: YY_RULE_SETUP -#line 1089 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_WITHIN(*driver.loc.back()); } +#line 1093 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_UNCONDITIONAL_MATCH(*driver.loc.back()); } YY_BREAK case 459: YY_RULE_SETUP -#line 1090 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_CONTAINS_WORD(*driver.loc.back()); } +#line 1094 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_SQLI(*driver.loc.back()); } YY_BREAK case 460: YY_RULE_SETUP -#line 1091 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_CONTAINS(*driver.loc.back()); } +#line 1095 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_XSS(*driver.loc.back()); } YY_BREAK case 461: YY_RULE_SETUP -#line 1092 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_ENDS_WITH(*driver.loc.back()); } +#line 1096 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_URL_ENCODING(*driver.loc.back()); } YY_BREAK case 462: YY_RULE_SETUP -#line 1093 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_EQ(*driver.loc.back()); } +#line 1097 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_UTF8_ENCODING(*driver.loc.back()); } YY_BREAK + + case 463: YY_RULE_SETUP -#line 1094 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_GE(*driver.loc.back()); } +#line 1101 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_WITHIN(*driver.loc.back()); } YY_BREAK case 464: YY_RULE_SETUP -#line 1095 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_GT(*driver.loc.back()); } +#line 1102 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_CONTAINS_WORD(*driver.loc.back()); } YY_BREAK case 465: YY_RULE_SETUP -#line 1096 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_IP_MATCH_FROM_FILE(*driver.loc.back()); } +#line 1103 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_CONTAINS(*driver.loc.back()); } YY_BREAK case 466: YY_RULE_SETUP -#line 1097 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_IP_MATCH(*driver.loc.back()); } +#line 1104 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_ENDS_WITH(*driver.loc.back()); } YY_BREAK case 467: YY_RULE_SETUP -#line 1098 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_LE(*driver.loc.back()); } +#line 1105 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_EQ(*driver.loc.back()); } YY_BREAK case 468: YY_RULE_SETUP -#line 1099 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_LT(*driver.loc.back()); } +#line 1106 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_GE(*driver.loc.back()); } YY_BREAK case 469: YY_RULE_SETUP -#line 1100 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_PM_FROM_FILE(*driver.loc.back()); } +#line 1107 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_GT(*driver.loc.back()); } YY_BREAK case 470: YY_RULE_SETUP -#line 1101 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_PM(*driver.loc.back()); } +#line 1108 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_IP_MATCH_FROM_FILE(*driver.loc.back()); } YY_BREAK case 471: YY_RULE_SETUP -#line 1102 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_RBL( *driver.loc.back()); } +#line 1109 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_IP_MATCH(*driver.loc.back()); } YY_BREAK case 472: YY_RULE_SETUP -#line 1103 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_RX(*driver.loc.back()); } +#line 1110 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_LE(*driver.loc.back()); } YY_BREAK case 473: YY_RULE_SETUP -#line 1104 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_STR_EQ(*driver.loc.back()); } +#line 1111 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_LT(*driver.loc.back()); } YY_BREAK case 474: YY_RULE_SETUP -#line 1105 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_STR_MATCH(*driver.loc.back()); } +#line 1112 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_PM_FROM_FILE(*driver.loc.back()); } YY_BREAK case 475: YY_RULE_SETUP -#line 1106 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_BEGINS_WITH(*driver.loc.back()); } +#line 1113 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_PM(*driver.loc.back()); } YY_BREAK case 476: YY_RULE_SETUP -#line 1107 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_INSPECT_FILE(*driver.loc.back()); } +#line 1114 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_RBL( *driver.loc.back()); } YY_BREAK case 477: YY_RULE_SETUP -#line 1108 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_FUZZY_HASH(*driver.loc.back()); } +#line 1115 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_RX(*driver.loc.back()); } YY_BREAK case 478: YY_RULE_SETUP -#line 1109 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_VALIDATE_BYTE_RANGE(*driver.loc.back()); } +#line 1116 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_RX_GLOBAL(*driver.loc.back()); } YY_BREAK case 479: YY_RULE_SETUP -#line 1110 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_VALIDATE_DTD(*driver.loc.back()); } +#line 1117 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_STR_EQ(*driver.loc.back()); } YY_BREAK case 480: YY_RULE_SETUP -#line 1111 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_VALIDATE_HASH(*driver.loc.back()); } +#line 1118 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_STR_MATCH(*driver.loc.back()); } YY_BREAK case 481: YY_RULE_SETUP -#line 1112 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_VALIDATE_SCHEMA(*driver.loc.back()); } +#line 1119 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_BEGINS_WITH(*driver.loc.back()); } YY_BREAK case 482: YY_RULE_SETUP -#line 1113 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_VERIFY_CC(*driver.loc.back()); } +#line 1120 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_INSPECT_FILE(*driver.loc.back()); } YY_BREAK case 483: YY_RULE_SETUP -#line 1114 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_VERIFY_CPF(*driver.loc.back()); } +#line 1121 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_FUZZY_HASH(*driver.loc.back()); } YY_BREAK case 484: YY_RULE_SETUP -#line 1115 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_VERIFY_SSN(*driver.loc.back()); } +#line 1122 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_VALIDATE_BYTE_RANGE(*driver.loc.back()); } YY_BREAK case 485: YY_RULE_SETUP -#line 1116 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_VERIFY_SVNR(*driver.loc.back()); } +#line 1123 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_VALIDATE_DTD(*driver.loc.back()); } YY_BREAK case 486: YY_RULE_SETUP -#line 1117 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_GSB_LOOKUP(*driver.loc.back()); } +#line 1124 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_VALIDATE_HASH(*driver.loc.back()); } YY_BREAK case 487: YY_RULE_SETUP -#line 1118 "seclang-scanner.ll" -{ BEGIN_PARAMETER(); return p::make_OPERATOR_RSUB(*driver.loc.back()); } +#line 1125 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_VALIDATE_SCHEMA(*driver.loc.back()); } YY_BREAK case 488: YY_RULE_SETUP -#line 1120 "seclang-scanner.ll" -{ return p::make_NOT(*driver.loc.back()); } +#line 1126 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_VERIFY_CC(*driver.loc.back()); } YY_BREAK case 489: YY_RULE_SETUP -#line 1121 "seclang-scanner.ll" -{ BEGIN_NO_OP_INFORMED(); yyless(0); } +#line 1127 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_VERIFY_CPF(*driver.loc.back()); } YY_BREAK - - case 490: YY_RULE_SETUP -#line 1126 "seclang-scanner.ll" -{ BEGIN(EXPECTING_PARAMETER_ENDS_WITH_SPACE); } +#line 1128 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_VERIFY_SSN(*driver.loc.back()); } YY_BREAK - - case 491: YY_RULE_SETUP -#line 1130 "seclang-scanner.ll" -{ BEGIN(EXPECTING_PARAMETER_ENDS_WITH_QUOTE); } +#line 1129 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_VERIFY_SVNR(*driver.loc.back()); } YY_BREAK - - case 492: YY_RULE_SETUP -#line 1134 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } +#line 1130 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_GSB_LOOKUP(*driver.loc.back()); } YY_BREAK case 493: -/* rule 493 can match eol */ YY_RULE_SETUP -#line 1135 "seclang-scanner.ll" -{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +#line 1131 "seclang-scanner.ll" +{ BEGIN_PARAMETER(); return p::make_OPERATOR_RSUB(*driver.loc.back()); } YY_BREAK - - case 494: YY_RULE_SETUP -#line 1139 "seclang-scanner.ll" -{ BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } +#line 1133 "seclang-scanner.ll" +{ return p::make_NOT(*driver.loc.back()); } YY_BREAK case 495: -/* rule 495 can match eol */ YY_RULE_SETUP -#line 1140 "seclang-scanner.ll" -{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +#line 1134 "seclang-scanner.ll" +{ BEGIN_NO_OP_INFORMED(); yyless(0); } YY_BREAK case 496: YY_RULE_SETUP -#line 1143 "seclang-scanner.ll" -{ BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } +#line 1139 "seclang-scanner.ll" +{ BEGIN(EXPECTING_PARAMETER_ENDS_WITH_SPACE); } YY_BREAK + + case 497: YY_RULE_SETUP -#line 1144 "seclang-scanner.ll" -{ BEGIN(LEXING_ERROR); yyless(0); } +#line 1143 "seclang-scanner.ll" +{ BEGIN(EXPECTING_PARAMETER_ENDS_WITH_QUOTE); } YY_BREAK case 498: YY_RULE_SETUP -#line 1148 "seclang-scanner.ll" +#line 1147 "seclang-scanner.ll" { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } YY_BREAK case 499: /* rule 499 can match eol */ YY_RULE_SETUP -#line 1149 "seclang-scanner.ll" +#line 1148 "seclang-scanner.ll" { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } YY_BREAK case 500: YY_RULE_SETUP -#line 1153 "seclang-scanner.ll" +#line 1152 "seclang-scanner.ll" { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } YY_BREAK case 501: /* rule 501 can match eol */ YY_RULE_SETUP -#line 1154 "seclang-scanner.ll" +#line 1153 "seclang-scanner.ll" { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } YY_BREAK case 502: YY_RULE_SETUP -#line 1158 "seclang-scanner.ll" +#line 1156 "seclang-scanner.ll" { BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } YY_BREAK case 503: YY_RULE_SETUP -#line 1159 "seclang-scanner.ll" -{ BEGIN(LEXING_ERROR_VARIABLE); yyless(0); } +#line 1157 "seclang-scanner.ll" +{ BEGIN(LEXING_ERROR); yyless(0); } YY_BREAK case 504: YY_RULE_SETUP -#line 1164 "seclang-scanner.ll" -{ BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } +#line 1161 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } YY_BREAK case 505: /* rule 505 can match eol */ YY_RULE_SETUP -#line 1166 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +#line 1162 "seclang-scanner.ll" +{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } YY_BREAK + + case 506: -/* rule 506 can match eol */ YY_RULE_SETUP -#line 1167 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +#line 1166 "seclang-scanner.ll" +{ BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } YY_BREAK case 507: /* rule 507 can match eol */ YY_RULE_SETUP -#line 1168 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } +#line 1167 "seclang-scanner.ll" +{ return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } YY_BREAK + + case 508: -/* rule 508 can match eol */ -YY_RULE_SETUP -#line 1169 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } - YY_BREAK -case 509: -/* rule 509 can match eol */ YY_RULE_SETUP #line 1171 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +{ BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } YY_BREAK -case 510: -/* rule 510 can match eol */ +case 509: YY_RULE_SETUP #line 1172 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +{ BEGIN(LEXING_ERROR_VARIABLE); yyless(0); } + YY_BREAK + + +case 510: +YY_RULE_SETUP +#line 1177 "seclang-scanner.ll" +{ BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } YY_BREAK case 511: /* rule 511 can match eol */ YY_RULE_SETUP -#line 1173 "seclang-scanner.ll" +#line 1179 "seclang-scanner.ll" { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 512: /* rule 512 can match eol */ YY_RULE_SETUP -#line 1174 "seclang-scanner.ll" +#line 1180 "seclang-scanner.ll" { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 513: /* rule 513 can match eol */ YY_RULE_SETUP -#line 1176 "seclang-scanner.ll" +#line 1181 "seclang-scanner.ll" { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } YY_BREAK case 514: /* rule 514 can match eol */ YY_RULE_SETUP -#line 1177 "seclang-scanner.ll" +#line 1182 "seclang-scanner.ll" { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } YY_BREAK case 515: /* rule 515 can match eol */ YY_RULE_SETUP -#line 1178 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } +#line 1184 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 516: /* rule 516 can match eol */ YY_RULE_SETUP -#line 1179 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } +#line 1185 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 517: +/* rule 517 can match eol */ YY_RULE_SETUP -#line 1181 "seclang-scanner.ll" -{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +#line 1186 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 518: /* rule 518 can match eol */ YY_RULE_SETUP -#line 1183 "seclang-scanner.ll" +#line 1187 "seclang-scanner.ll" { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 519: /* rule 519 can match eol */ YY_RULE_SETUP -#line 1184 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +#line 1189 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } YY_BREAK case 520: /* rule 520 can match eol */ YY_RULE_SETUP -#line 1186 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +#line 1190 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } YY_BREAK case 521: /* rule 521 can match eol */ YY_RULE_SETUP -#line 1187 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +#line 1191 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } YY_BREAK case 522: /* rule 522 can match eol */ YY_RULE_SETUP -#line 1188 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +#line 1192 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ONLY_ONE); } YY_BREAK case 523: -/* rule 523 can match eol */ YY_RULE_SETUP -#line 1189 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } - YY_BREAK -case 524: -YY_RULE_SETUP -#line 1191 "seclang-scanner.ll" +#line 1194 "seclang-scanner.ll" { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK - - -case 525: +case 524: +/* rule 524 can match eol */ YY_RULE_SETUP #line 1196 "seclang-scanner.ll" -{ } +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } + YY_BREAK +case 525: +/* rule 525 can match eol */ +YY_RULE_SETUP +#line 1197 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 526: /* rule 526 can match eol */ YY_RULE_SETUP -#line 1197 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); } +#line 1199 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 527: /* rule 527 can match eol */ YY_RULE_SETUP -#line 1198 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); } +#line 1200 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK - - case 528: /* rule 528 can match eol */ YY_RULE_SETUP -#line 1202 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); } +#line 1201 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 529: /* rule 529 can match eol */ YY_RULE_SETUP -#line 1203 "seclang-scanner.ll" -{ driver.loc.back()->lines(1); driver.loc.back()->step(); } +#line 1202 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK case 530: -/* rule 530 can match eol */ YY_RULE_SETUP #line 1204 "seclang-scanner.ll" -{ BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } +{ BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } YY_BREAK + case 531: YY_RULE_SETUP #line 1209 "seclang-scanner.ll" -{ BEGIN(LEXING_ERROR); yyless(0); } +{ } YY_BREAK case 532: +/* rule 532 can match eol */ YY_RULE_SETUP -#line 1211 "seclang-scanner.ll" -{ driver.error (*driver.loc.back(), "Invalid input: ", yytext); throw p::syntax_error(*driver.loc.back(), ""); } +#line 1210 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); } YY_BREAK case 533: +/* rule 533 can match eol */ YY_RULE_SETUP -#line 1212 "seclang-scanner.ll" +#line 1211 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); } + YY_BREAK + + +case 534: +/* rule 534 can match eol */ +YY_RULE_SETUP +#line 1215 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); } + YY_BREAK +case 535: +/* rule 535 can match eol */ +YY_RULE_SETUP +#line 1216 "seclang-scanner.ll" +{ driver.loc.back()->lines(1); driver.loc.back()->step(); } + YY_BREAK +case 536: +/* rule 536 can match eol */ +YY_RULE_SETUP +#line 1217 "seclang-scanner.ll" +{ BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } + YY_BREAK + +case 537: +YY_RULE_SETUP +#line 1222 "seclang-scanner.ll" +{ BEGIN(LEXING_ERROR); yyless(0); } + YY_BREAK +case 538: +YY_RULE_SETUP +#line 1224 "seclang-scanner.ll" +{ driver.error (*driver.loc.back(), "Invalid input: ", yytext); throw p::syntax_error(*driver.loc.back(), ""); } + YY_BREAK +case 539: +YY_RULE_SETUP +#line 1225 "seclang-scanner.ll" { driver.error (*driver.loc.back(), "Expecting an action, got: ", yytext); throw p::syntax_error(*driver.loc.back(), ""); } YY_BREAK -case 534: +case 540: YY_RULE_SETUP -#line 1213 "seclang-scanner.ll" +#line 1226 "seclang-scanner.ll" { driver.error (*driver.loc.back(), "Expecting a variable, got: : ", yytext); throw p::syntax_error(*driver.loc.back(), ""); } YY_BREAK case YY_STATE_EOF(INITIAL): @@ -8429,7 +8509,7 @@ case YY_STATE_EOF(SETVAR_ACTION_QUOTED): case YY_STATE_EOF(SETVAR_ACTION_QUOTED_WAITING_COLLECTION_ELEM): case YY_STATE_EOF(SETVAR_ACTION_QUOTED_WAITING_OPERATION): case YY_STATE_EOF(SETVAR_ACTION_QUOTED_WAITING_CONTENT): -#line 1216 "seclang-scanner.ll" +#line 1229 "seclang-scanner.ll" { if (yyin) { fclose(yyin); @@ -8445,12 +8525,13 @@ case YY_STATE_EOF(SETVAR_ACTION_QUOTED_WAITING_CONTENT): delete l; } YY_BREAK -case 535: +case 541: YY_RULE_SETUP -#line 1232 "seclang-scanner.ll" +#line 1245 "seclang-scanner.ll" { std::string err; - const char *file = strchr(yytext, ' ') + 1; + const char *tmpStr = yytext + strlen("include"); + const char *file = tmpStr + strspn( tmpStr, " \t"); std::string fi = modsecurity::utils::find_resource(file, *driver.loc.back()->end.filename, &err); if (fi.empty() == true) { BEGIN(INITIAL); @@ -8475,14 +8556,14 @@ YY_RULE_SETUP } } YY_BREAK -case 536: +case 542: YY_RULE_SETUP -#line 1259 "seclang-scanner.ll" +#line 1273 "seclang-scanner.ll" { std::string err; - const char *file = strchr(yytext, ' ') + 1; - char *f = strdup(file + 1); - f[strlen(f)-1] = '\0'; + const char *tmpStr = yytext + strlen("include"); + const char *file = tmpStr + strspn( tmpStr, " \t"); + char *f = strdup(file); std::string fi = modsecurity::utils::find_resource(f, *driver.loc.back()->end.filename, &err); if (fi.empty() == true) { BEGIN(INITIAL); @@ -8508,10 +8589,10 @@ YY_RULE_SETUP free(f); } YY_BREAK -case 537: -/* rule 537 can match eol */ +case 543: +/* rule 543 can match eol */ YY_RULE_SETUP -#line 1289 "seclang-scanner.ll" +#line 1303 "seclang-scanner.ll" { HttpsClient c; std::string key; @@ -8535,10 +8616,10 @@ YY_RULE_SETUP if (ret == false) { BEGIN(INITIAL); - if (driver.m_remoteRulesActionOnFailed == Rules::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction) { + if (driver.m_remoteRulesActionOnFailed == RulesSet::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction) { /** TODO: Implement the server logging mechanism. */ } - if (driver.m_remoteRulesActionOnFailed == Rules::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction) { + if (driver.m_remoteRulesActionOnFailed == RulesSet::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction) { driver.error (*driver.loc.back(), "", yytext + std::string(" - Failed to download: ") + c.error); throw p::syntax_error(*driver.loc.back(), ""); } @@ -8547,12 +8628,12 @@ YY_RULE_SETUP yy_scan_string(c.content.c_str()); } YY_BREAK -case 538: +case 544: YY_RULE_SETUP -#line 1325 "seclang-scanner.ll" +#line 1339 "seclang-scanner.ll" ECHO; YY_BREAK -#line 8555 "seclang-scanner.cc" +#line 8637 "seclang-scanner.cc" case YY_END_OF_BUFFER: { @@ -8871,7 +8952,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 3914 ) + if ( yy_current_state >= 3966 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -8904,11 +8985,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 3914 ) + if ( yy_current_state >= 3966 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 3913); + yy_is_jam = (yy_current_state == 3965); return yy_is_jam ? 0 : yy_current_state; } @@ -9657,7 +9738,7 @@ void yyfree (void * ptr ) /* %ok-for-header */ -#line 1325 "seclang-scanner.ll" +#line 1339 "seclang-scanner.ll" namespace modsecurity { diff --git a/src/deps/src/ModSecurity/src/parser/seclang-scanner.ll b/src/deps/src/ModSecurity/src/parser/seclang-scanner.ll index a477d29f1..2e32fea04 100755 --- a/src/deps/src/ModSecurity/src/parser/seclang-scanner.ll +++ b/src/deps/src/ModSecurity/src/parser/seclang-scanner.ll @@ -140,7 +140,7 @@ ACTION_TRANSFORMATION_BASE_64_DECODE (?i:t:base64Decode) ACTION_TRANSFORMATION_BASE_64_DECODE_EXT (?i:t:base64DecodeExt) ACTION_TRANSFORMATION_CMD_LINE (?i:t:cmdLine) ACTION_TRANSFORMATION_COMPRESS_WHITESPACE (?i:t:compressWhitespace) -ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE (?i:t:escapeSeqDecode) +ACTION_TRANSFORMATION_ESCAPE_SEQ_DECODE (?i:t:escapeSeqDecode) ACTION_TRANSFORMATION_CSS_DECODE (?i:t:cssDecode) ACTION_TRANSFORMATION_HEX_ENCODE (?i:t:hexEncode) ACTION_TRANSFORMATION_HEX_DECODE (?i:t:hexDecode) @@ -253,6 +253,7 @@ VARIABLE_REQUEST_HEADERS (?i:REQUEST_HEADERS) VARIABLE_RESPONSE_HEADERS (?i:RESPONSE_HEADERS) VARIABLE_GEO (?i:GEO) VARIABLE_REQUEST_COOKIES_NAMES (?i:REQUEST_COOKIES_NAMES) +VARIABLE_MULTIPART_PART_HEADERS (?i:MULTIPART_PART_HEADERS) VARIABLE_RULE (?i:RULE) VARIABLE_SESSION (?i:(SESSION)) VARIABLE_IP (?i:(IP)) @@ -302,6 +303,7 @@ OPERATOR_PM (?i:@pm) OPERATOR_RBL (?i:@rbl) OPERATOR_RSUB (?i:@rsub) OPERATOR_RX (?i:@rx) +OPERATOR_RX_GLOBAL (?i:@rxGlobal) OPERATOR_STR_EQ (?i:@streq) OPERATOR_STR_MATCH (?i:@strmatch) OPERATOR_UNCONDITIONAL_MATCH (?i:@unconditionalMatch) @@ -359,6 +361,8 @@ CONFIG_SEC_STREAM_IN_BODY_INSPECTION (?i:SecStreamInBodyInspection) CONFIG_SEC_STREAM_OUT_BODY_INSPECTION (?i:SecStreamOutBodyInspection) CONFIG_DIR_PCRE_MATCH_LIMIT (?i:SecPcreMatchLimit) CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION (?i:SecPcreMatchLimitRecursion) +CONFIG_DIR_ARGS_LIMIT (?i:SecArgumentsLimit) +CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT (?i:SecRequestBodyJsonDepthLimit) CONFIG_DIR_REQ_BODY (?i:SecRequestBodyAccess) CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT (?i:SecRequestBodyInMemoryLimit) CONFIG_DIR_REQ_BODY_LIMIT (?i:SecRequestBodyLimit) @@ -417,9 +421,9 @@ DICT_ELEMENT_WITH_PIPE [^ =\t"]+ DICT_ELEMENT_NO_PIPE [^ =\|\t"]+ DICT_ELEMENT_NO_MACRO ([^\"|,%{\n \t}=]|([^\\]\\\"))+ -DICT_ELEMENT_TWO [^\"\=, \t\r\n\\]* -DICT_ELEMENT_TWO_QUOTED [^\"\'\=\r\n\\]* -DICT_ELEMENT_TWO2 [A-Za-z_ -\%\{\.\}\-\/]+ +DICT_ELEMENT_TWO [^\"\=, \t\r\n\\]* +DICT_ELEMENT_TWO_QUOTED [^\"\'\=\r\n\\]* +DICT_ELEMENT_TWO2 [A-Za-z_ -\%\{\.\}\-\/]+ DIRECTIVE (?i:SecRule) DIRECTIVE_SECRULESCRIPT (?i:SecRuleScript) FREE_TEXT_NEW_LINE [^\"|\n]+ @@ -427,12 +431,12 @@ FREE_TEXT_QUOTE ([^\']|([^\\]\\\'))+ QUOTE_BUT_SCAPED (') DOUBLE_QUOTE_BUT_SCAPED (") COMMA_BUT_SCAPED (,) -FREE_TEXT_QUOTE_MACRO_EXPANSION (([^%'])|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\][']|[^\\]([\\][\\])+[\\]['])+ -FREE_TEXT_DOUBLE_QUOTE_MACRO_EXPANSION ((([^"%])|([%][^{]))|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\]["]|[^\\]([\\][\\])+[\\]["])+ -FREE_TEXT_EQUALS_MACRO_EXPANSION ((([^",=%])|([%][^{]))|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\][=]|[^\\]([\\][\\])+[\\][=])+ -FREE_TEXT_EQUALS_QUOTE_MACRO_EXPANSION ((([^'",=%])|([%][^{]))|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\][=]|[^\\][\\][']|[^\\]([\\][\\])+[\\][=])+ -FREE_TEXT_COMMA_MACRO_EXPANSION (([^%,])|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\][,]|[^\\]([\\][\\])+[\\][,])+ -FREE_TEXT_COMMA_DOUBLE_QUOTE_MACRO_EXPANSION ((([^,"%])|([%][^{]))|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\]["]|[^\\]([\\][\\])+[\\]["])+ +FREE_TEXT_QUOTE_MACRO_EXPANSION (([^%'])|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\][']|[^\\]([\\][\\])+[\\]['])+ +FREE_TEXT_DOUBLE_QUOTE_MACRO_EXPANSION ((([^"%])|([%][^{]))|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\]["]|[^\\]([\\][\\])+[\\]["])+ +FREE_TEXT_EQUALS_MACRO_EXPANSION ((([^",=%])|([%][^{]))|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\][=]|[^\\]([\\][\\])+[\\][=])+ +FREE_TEXT_EQUALS_QUOTE_MACRO_EXPANSION ((([^'",=%])|([%][^{]))|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\][=]|[^\\][\\][']|[^\\]([\\][\\])+[\\][=])+ +FREE_TEXT_COMMA_MACRO_EXPANSION (([^%,])|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\][,]|[^\\]([\\][\\])+[\\][,])+ +FREE_TEXT_COMMA_DOUBLE_QUOTE_MACRO_EXPANSION ((([^,"%])|([%][^{]))|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\]["]|[^\\]([\\][\\])+[\\]["])+ FREE_TEXT_SPACE_MACRO_EXPANSION (([^% ])|([^\\][\\][%][{])|([^\\]([\\][\\])+[\\][%][{])|[^\\][\\][ ]|[^\\]([\\][\\])+[\\][ ])+ START_MACRO_VARIABLE (\%\{) @@ -536,7 +540,7 @@ EQUALS_MINUS (?i:=\-) {ACTION_CTL_REQUEST_BODY_ACCESS}= { return p::make_ACTION_CTL_REQUEST_BODY_ACCESS(yytext, *driver.loc.back()); } {ACTION_CTL_RULE_ENGINE}= { return p::make_ACTION_CTL_RULE_ENGINE(*driver.loc.back()); } {ACTION_CTL_RULE_REMOVE_BY_ID}[=]{REMOVE_RULE_BY} { return p::make_ACTION_CTL_RULE_REMOVE_BY_ID(yytext, *driver.loc.back()); } -{ACTION_CTL_RULE_REMOVE_BY_TAG}[=]{REMOVE_RULE_BY} { return p::make_ACTION_CTL_RULE_REMOVE_BY_TAG(yytext, *driver.loc.back()); } +{ACTION_CTL_RULE_REMOVE_BY_TAG}[=]{REMOVE_RULE_BY} { return p::make_ACTION_CTL_RULE_REMOVE_BY_TAG(yytext, *driver.loc.back()); } {ACTION_CTL_RULE_REMOVE_TARGET_BY_ID}[=]{REMOVE_RULE_BY} { return p::make_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID(yytext, *driver.loc.back()); } {ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG}[=]{REMOVE_RULE_BY} { return p::make_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG(yytext, *driver.loc.back()); } {ACTION_EXEC}:'{VAR_FREE_TEXT_QUOTE}' { return p::make_ACTION_EXEC(yytext, *driver.loc.back()); } @@ -610,6 +614,7 @@ EQUALS_MINUS (?i:=\-) {CONFIG_VALUE_DETC} { return p::make_CONFIG_VALUE_DETC(yytext, *driver.loc.back()); } {CONFIG_VALUE_OFF} { return p::make_CONFIG_VALUE_OFF(yytext, *driver.loc.back()); } {CONFIG_VALUE_ON} { return p::make_CONFIG_VALUE_ON(yytext, *driver.loc.back()); } +{CONFIG_VALUE_RELEVANT_ONLY} { return p::make_CONFIG_VALUE_RELEVANT_ONLY(yytext, *driver.loc.back()); } [ \t]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } [ \t]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } } @@ -626,21 +631,21 @@ EQUALS_MINUS (?i:=\-) { -[ ][ \t]* { BEGIN(INITIAL); yyless(yyleng); } -[ ]*[ \t]*\n { BEGIN(INITIAL); yyless(1); } -[ ]*[ \t]*\r\n { BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } +[ ][ \t]* { BEGIN(INITIAL); yyless(yyleng); } +[ ]*[ \t]*\n { BEGIN(INITIAL); yyless(1); } +[ ]*[ \t]*\r\n { BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } } { -["][ \t]* { BEGIN(INITIAL); yyless(yyleng); p::make_NEW_LINE(*driver.loc.back()); } -["][ \t]*\n { BEGIN(INITIAL); yyless(1); } -["][ \t]*\r\n { BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } +["][ \t]* { BEGIN(INITIAL); yyless(yyleng); p::make_NEW_LINE(*driver.loc.back()); } +["][ \t]*\n { BEGIN(INITIAL); yyless(1); } +["][ \t]*\r\n { BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } } { -. { BEGIN(LEXING_ERROR_ACTION); yyless(0); } +. { BEGIN(LEXING_ERROR_ACTION); yyless(0); } } @@ -652,8 +657,8 @@ EQUALS_MINUS (?i:=\-) { -[ \t]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } -[ \t]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } +[ \t]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } +[ \t]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } } { @@ -684,24 +689,24 @@ EQUALS_MINUS (?i:=\-) } { -{NOT} { return p::make_NOT(*driver.loc.back()); } -.|\n { BEGIN_ACTION_OPERATION(); yyless(0); } +{NOT} { return p::make_NOT(*driver.loc.back()); } +.|\n { BEGIN_ACTION_OPERATION(); yyless(0); } } { -{EQUALS_PLUS} { BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_PLUS(*driver.loc.back()); } -{EQUALS_MINUS} { BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_MINUS(*driver.loc.back()); } -{EQUALS} { BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS(*driver.loc.back()); } +{EQUALS_PLUS} { BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_PLUS(*driver.loc.back()); } +{EQUALS_MINUS} { BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS_MINUS(*driver.loc.back()); } +{EQUALS} { BEGIN_ACTION_WAITING_CONTENT(); return p::make_SETVAR_OPERATION_EQUALS(*driver.loc.back()); } } { -.|\n { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(0);} +.|\n { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(0);} } { -\' { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } -.|\n { BEGIN(LEXING_ERROR_ACTION); yyless(0); } +\' { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +.|\n { BEGIN(LEXING_ERROR_ACTION); yyless(0); } } @@ -709,20 +714,20 @@ EQUALS_MINUS (?i:=\-) { -{START_MACRO_VARIABLE} { BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } +{START_MACRO_VARIABLE} { BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } } { -{FREE_TEXT_EQUALS_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } -.|\n { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(0); } +{FREE_TEXT_EQUALS_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +.|\n { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(0); } } { -\' { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } -{FREE_TEXT_EQUALS_QUOTE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } -.|\n { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(0); } +\' { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); } +{FREE_TEXT_EQUALS_QUOTE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +.|\n { BEGIN(EXPECTING_ACTIONS_ENDS_WITH_DOUBLE_QUOTE); yyless(0); } } @@ -746,55 +751,60 @@ EQUALS_MINUS (?i:=\-) {CONFIG_SEC_ARGUMENT_SEPARATOR}[ \t]+["]{NEW_LINE_FREE_TEXT}["] { return p::make_CONFIG_SEC_ARGUMENT_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_SEC_ARGUMENT_SEPARATOR}[ \t]+{NEW_LINE_FREE_TEXT} { return p::make_CONFIG_SEC_ARGUMENT_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_DIR_AUDIT_ENG} { return p::make_CONFIG_DIR_AUDIT_ENG(yytext, *driver.loc.back()); } -{CONFIG_DIR_AUDIT_FLE_MOD}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_AUDIT_FLE_MOD(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_DIR_AUDIT_LOG2}[ \t]+{CONFIG_VALUE_PATH} { return p::make_CONFIG_DIR_AUDIT_LOG2(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_AUDIT_FLE_MOD}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_AUDIT_FLE_MOD(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_AUDIT_LOG2}[ \t]+{CONFIG_VALUE_PATH} { return p::make_CONFIG_DIR_AUDIT_LOG2(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONFIG_DIR_AUDIT_LOG_P}[ \t]+{AUDIT_PARTS} { return p::make_CONFIG_DIR_AUDIT_LOG_P(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_DIR_AUDIT_LOG_P}[ \t]+["]{AUDIT_PARTS}["] { return p::make_CONFIG_DIR_AUDIT_LOG_P(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_DIR_AUDIT_LOG}[ \t]+{CONFIG_VALUE_PATH} { return p::make_CONFIG_DIR_AUDIT_LOG(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_AUDIT_LOG}[ \t]+{CONFIG_VALUE_PATH} { return p::make_CONFIG_DIR_AUDIT_LOG(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONFIG_DIR_AUDIT_LOG_FMT} { return p::make_CONFIG_DIR_AUDIT_LOG_FMT(*driver.loc.back()); } {JSON} { return p::make_JSON(*driver.loc.back()); } {NATIVE} { return p::make_NATIVE(*driver.loc.back()); } -{CONFIG_DIR_AUDIT_LOG}[ \t]+["]{CONFIG_VALUE_PATH}["] { return p::make_CONFIG_DIR_AUDIT_LOG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_DIR_AUDIT_STS}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_DIR_AUDIT_STS(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_DIR_AUDIT_LOG}[ \t]+["]{CONFIG_VALUE_PATH}["] { return p::make_CONFIG_DIR_AUDIT_LOG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_DIR_AUDIT_STS}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_DIR_AUDIT_STS(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_DIR_AUDIT_STS}[ \t]+["]{NEW_LINE_FREE_TEXT}["] { return p::make_CONFIG_DIR_AUDIT_STS(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_DIR_AUDIT_TPE} { return p::make_CONFIG_DIR_AUDIT_TPE(yytext, *driver.loc.back()); } -{CONFIG_DIR_DEBUG_LOG}[ \t]+{CONFIG_VALUE_PATH} { return p::make_CONFIG_DIR_DEBUG_LOG(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_DIR_DEBUG_LOG}[ \t]+["]{CONFIG_VALUE_PATH}["] { return p::make_CONFIG_DIR_DEBUG_LOG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_DIR_DEBUG_LVL}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_DEBUG_LVL(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_DIR_GEO_DB}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_DIR_GEO_DB(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_DIR_PCRE_MATCH_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_PCRE_MATCH_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } + + +{CONFIG_DIR_DEBUG_LOG}[ \t]+{CONFIG_VALUE_PATH} { return p::make_CONFIG_DIR_DEBUG_LOG(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_DEBUG_LOG}[ \t]+["]{CONFIG_VALUE_PATH}["] { return p::make_CONFIG_DIR_DEBUG_LOG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_DIR_DEBUG_LVL}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_DEBUG_LVL(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_GEO_DB}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_DIR_GEO_DB(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_PCRE_MATCH_LIMIT_RECURSION(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_PCRE_MATCH_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_PCRE_MATCH_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_ARGS_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_ARGS_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_REQ_BODY_JSON_DEPTH_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_REQ_BODY_IN_MEMORY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } + {CONFIG_DIR_REQ_BODY_LIMIT_ACTION} { return p::make_CONFIG_DIR_REQ_BODY_LIMIT_ACTION(yytext, *driver.loc.back()); } -{CONFIG_DIR_REQ_BODY_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_REQ_BODY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_REQ_BODY_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_REQ_BODY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_REQ_BODY_NO_FILES_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONFIG_DIR_REQ_BODY} { return p::make_CONFIG_DIR_REQ_BODY(yytext, *driver.loc.back()); } {CONFIG_DIR_RES_BODY_LIMIT_ACTION} { return p::make_CONFIG_DIR_RES_BODY_LIMIT_ACTION(yytext, *driver.loc.back()); } -{CONFIG_DIR_RES_BODY_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_RES_BODY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_DIR_RES_BODY_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_RES_BODY_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONFIG_DIR_RES_BODY} { return p::make_CONFIG_DIR_RES_BODY(yytext, *driver.loc.back()); } {CONFIG_DIR_RULE_ENG} { return p::make_CONFIG_DIR_RULE_ENG(yytext, *driver.loc.back()); } {CONFIG_DIR_SEC_MARKER}[ \t]+["]{NEW_LINE_FREE_TEXT}["] { return p::make_CONFIG_DIR_SEC_MARKER(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONFIG_DIR_SEC_MARKER}[ \t]+{NEW_LINE_FREE_TEXT} { return p::make_CONFIG_DIR_SEC_MARKER(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONFIG_DIR_UNICODE_MAP_FILE}[ \t]+{FREE_TEXT_NEW_LINE}[ ]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_DIR_UNICODE_MAP_FILE(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_SEC_REMOVE_RULES_BY_ID}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_RULE_REMOVE_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_SEC_REMOVE_RULES_BY_ID}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_RULE_REMOVE_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_SEC_REMOVE_RULES_BY_MSG}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_RULE_REMOVE_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_SEC_REMOVE_RULES_BY_MSG}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { return p::make_CONFIG_SEC_RULE_REMOVE_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_SEC_REMOVE_RULES_BY_TAG}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_RULE_REMOVE_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_SEC_REMOVE_RULES_BY_TAG}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { return p::make_CONFIG_SEC_RULE_REMOVE_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_SEC_UPDATE_TARGET_BY_TAG}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_SEC_UPDATE_TARGET_BY_TAG}[ \t]+{FREE_TEXT_SPACE_COMMA_QUOTE} { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_SEC_UPDATE_TARGET_BY_MSG}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_SEC_UPDATE_TARGET_BY_MSG}[ \t]+{FREE_TEXT_SPACE_COMMA_QUOTE} { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_SEC_UPDATE_TARGET_BY_ID}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_SEC_UPDATE_TARGET_BY_ID}[ \t]+{FREE_TEXT_SPACE_COMMA_QUOTE} { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_SEC_UPDATE_ACTION_BY_ID}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_SEC_UPDATE_ACTION_BY_ID}[ \t]+{FREE_TEXT_SPACE_COMMA_QUOTE} { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_SEC_UPDATE_TARGET_BY_TAG}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_SEC_UPDATE_TARGET_BY_TAG}[ \t]+{FREE_TEXT_SPACE_COMMA_QUOTE} { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_SEC_UPDATE_TARGET_BY_MSG}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_SEC_UPDATE_TARGET_BY_MSG}[ \t]+{FREE_TEXT_SPACE_COMMA_QUOTE} { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_SEC_UPDATE_TARGET_BY_ID}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_SEC_UPDATE_TARGET_BY_ID}[ \t]+{FREE_TEXT_SPACE_COMMA_QUOTE} { state_variable_from = 1; BEGIN(TRANSACTION_TO_VARIABLE); return p::make_CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_SEC_UPDATE_ACTION_BY_ID}[ \t]+["]{FREE_TEXT_NEW_LINE}["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } +{CONFIG_SEC_UPDATE_ACTION_BY_ID}[ \t]+{FREE_TEXT_SPACE_COMMA_QUOTE} { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_UPDLOAD_KEEP_FILES} { return p::make_CONFIG_UPDLOAD_KEEP_FILES(yytext, *driver.loc.back()); } {CONFIG_UPDLOAD_SAVE_TMP_FILES} { return p::make_CONFIG_UPDLOAD_SAVE_TMP_FILES(yytext, *driver.loc.back()); } {CONFIG_UPLOAD_DIR}[ \t]+{CONFIG_VALUE_PATH} { return p::make_CONFIG_UPLOAD_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_UPLOAD_DIR}[ \t]+["]{CONFIG_VALUE_PATH}["] { return p::make_CONFIG_UPLOAD_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONFIG_UPLOAD_FILE_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_UPLOAD_FILE_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_UPLOAD_FILE_MODE}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_UPLOAD_FILE_MODE(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_UPLOAD_FILE_LIMIT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_UPLOAD_FILE_LIMIT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_UPLOAD_FILE_MODE}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_UPLOAD_FILE_MODE(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONFIG_VALUE_ABORT} { return p::make_CONFIG_VALUE_ABORT(yytext, *driver.loc.back()); } {CONFIG_VALUE_DETC} { return p::make_CONFIG_VALUE_DETC(yytext, *driver.loc.back()); } {CONFIG_VALUE_HTTPS} { return p::make_CONFIG_VALUE_HTTPS(yytext, *driver.loc.back()); } @@ -807,15 +817,15 @@ EQUALS_MINUS (?i:=\-) {CONFIG_VALUE_SERIAL} { return p::make_CONFIG_VALUE_SERIAL(yytext, *driver.loc.back()); } {CONFIG_VALUE_WARN} { return p::make_CONFIG_VALUE_WARN(yytext, *driver.loc.back()); } {CONFIG_XML_EXTERNAL_ENTITY} { return p::make_CONFIG_XML_EXTERNAL_ENTITY(yytext, *driver.loc.back()); } -{CONGIG_DIR_RESPONSE_BODY_MP}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONGIG_DIR_RESPONSE_BODY_MP(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONGIG_DIR_RESPONSE_BODY_MP}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONGIG_DIR_RESPONSE_BODY_MP(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONGIG_DIR_RESPONSE_BODY_MP_CLEAR} { return p::make_CONGIG_DIR_RESPONSE_BODY_MP_CLEAR(*driver.loc.back()); } -{CONGIG_DIR_SEC_ARG_SEP}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONGIG_DIR_SEC_ARG_SEP(yytext, *driver.loc.back()); } -{CONGIG_DIR_SEC_COOKIE_FORMAT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONGIG_DIR_SEC_COOKIE_FORMAT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONGIG_DIR_SEC_ARG_SEP}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONGIG_DIR_SEC_ARG_SEP(yytext, *driver.loc.back()); } +{CONGIG_DIR_SEC_COOKIE_FORMAT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONGIG_DIR_SEC_COOKIE_FORMAT(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONFIG_SEC_COOKIEV0_SEPARATOR}[ \t]+["]{NEW_LINE_FREE_TEXT}["] { return p::make_CONFIG_SEC_COOKIEV0_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONFIG_SEC_COOKIEV0_SEPARATOR}[ \t]+{NEW_LINE_FREE_TEXT} { return p::make_CONFIG_SEC_COOKIEV0_SEPARATOR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONGIG_DIR_SEC_DATA_DIR}[ \t]+{CONFIG_VALUE_PATH} { return p::make_CONGIG_DIR_SEC_DATA_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONGIG_DIR_SEC_DATA_DIR}[ \t]+["]{CONFIG_VALUE_PATH}["] { return p::make_CONGIG_DIR_SEC_DATA_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } -{CONGIG_DIR_SEC_STATUS_ENGINE}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONGIG_DIR_SEC_STATUS_ENGINE(yytext, *driver.loc.back()); } +{CONGIG_DIR_SEC_STATUS_ENGINE}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONGIG_DIR_SEC_STATUS_ENGINE(yytext, *driver.loc.back()); } {CONGIG_DIR_SEC_TMP_DIR}[ \t]+{CONFIG_VALUE_PATH} { return p::make_CONGIG_DIR_SEC_TMP_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {CONGIG_DIR_SEC_TMP_DIR}[ \t]+["]{CONFIG_VALUE_PATH}["] { return p::make_CONGIG_DIR_SEC_TMP_DIR(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } {DIRECTIVE_SECRULESCRIPT}[ \t]+{CONFIG_VALUE_PATH} { BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_DIRECTIVE_SECRULESCRIPT(parserSanitizer(strchr(yytext, ' ') + 1), *driver.loc.back()); } @@ -837,7 +847,7 @@ EQUALS_MINUS (?i:=\-) {CONFIG_SEC_CONN_W_STATE_LIMIT}{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_CONN_W_STATE_LIMIT(yytext, *driver.loc.back()); } {CONFIG_SEC_SENSOR_ID}{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_SENSOR_ID(yytext, *driver.loc.back()); } {CONFIG_SEC_RULE_INHERITANCE} { return p::make_CONFIG_SEC_RULE_INHERITANCE(yytext, *driver.loc.back()); } -{CONFIG_SEC_RULE_PERF_TIME}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_SEC_RULE_PERF_TIME(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_SEC_RULE_PERF_TIME}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_SEC_RULE_PERF_TIME(strchr(yytext, ' ') + 1, *driver.loc.back()); } {CONFIG_SEC_STREAM_IN_BODY_INSPECTION} { return p::make_CONFIG_SEC_STREAM_IN_BODY_INSPECTION(yytext, *driver.loc.back()); } {CONFIG_SEC_STREAM_OUT_BODY_INSPECTION} { return p::make_CONFIG_SEC_STREAM_OUT_BODY_INSPECTION(yytext, *driver.loc.back()); } {CONFIG_SEC_DISABLE_BACKEND_COMPRESS} { return p::make_CONFIG_SEC_DISABLE_BACKEND_COMPRESS(yytext, *driver.loc.back()); } @@ -847,8 +857,8 @@ EQUALS_MINUS (?i:=\-) {CONFIG_DIR_SEC_ACTION} { BEGIN(TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS); return p::make_CONFIG_DIR_SEC_ACTION(yytext, *driver.loc.back()); } {CONFIG_SEC_REMOTE_RULES_FAIL_ACTION} { return p::make_CONFIG_SEC_REMOTE_RULES_FAIL_ACTION(yytext, *driver.loc.back()); } -{CONFIG_SEC_COLLECTION_TIMEOUT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_SEC_COLLECTION_TIMEOUT(strchr(yytext, ' ') + 1, *driver.loc.back()); } -{CONFIG_SEC_HTTP_BLKEY}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_HTTP_BLKEY(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_SEC_COLLECTION_TIMEOUT}[ \t]+{CONFIG_VALUE_NUMBER} { return p::make_CONFIG_SEC_COLLECTION_TIMEOUT(strchr(yytext, ' ') + 1, *driver.loc.back()); } +{CONFIG_SEC_HTTP_BLKEY}[ \t]+{FREE_TEXT_NEW_LINE} { return p::make_CONFIG_SEC_HTTP_BLKEY(strchr(yytext, ' ') + 1, *driver.loc.back()); } [ \t]*[\n] { driver.loc.back()->lines(1); driver.loc.back()->step(); } #[ \t]*SecRule[^\\].*\\[ \t]*[\r\n]* { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); } #[ \t]*SecAction[^\\].*\\[ \t]*[^\\n] { driver.loc.back()->lines(1); driver.loc.back()->step(); BEGIN(COMMENT); } @@ -987,6 +997,8 @@ EQUALS_MINUS (?i:=\-) {VARIABLE_GEO}[:.] { BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_GEO(*driver.loc.back()); } {VARIABLE_REQUEST_COOKIES_NAMES} { return p::make_VARIABLE_REQUEST_COOKIES_NAMES(*driver.loc.back()); } {VARIABLE_REQUEST_COOKIES_NAMES}[:.] { BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_REQUEST_COOKIES_NAMES(*driver.loc.back()); } +{VARIABLE_MULTIPART_PART_HEADERS} { return p::make_VARIABLE_MULTIPART_PART_HEADERS(*driver.loc.back()); } +{VARIABLE_MULTIPART_PART_HEADERS}[:.] { BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_MULTIPART_PART_HEADERS(*driver.loc.back()); } {VARIABLE_RULE} { return p::make_VARIABLE_RULE(*driver.loc.back()); } {VARIABLE_RULE}[:.] { BEGINX(EXPECTING_VAR_PARAMETER); return p::make_VARIABLE_RULE(*driver.loc.back()); } {VARIABLE_FILES_TMP_NAMES} { return p::make_VARIABLE_FILES_TMP_NAMES(*driver.loc.back()); } @@ -1068,20 +1080,20 @@ EQUALS_MINUS (?i:=\-) { -{OPERATOR_GEOLOOKUP}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_GEOLOOKUP(*driver.loc.back()); } -{OPERATOR_UNCONDITIONAL_MATCH}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_UNCONDITIONAL_MATCH(*driver.loc.back()); } -{OPERATOR_DETECT_SQLI}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_SQLI(*driver.loc.back()); } -{OPERATOR_DETECT_XSS}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_XSS(*driver.loc.back()); } -{OPERATOR_VALIDATE_URL_ENCODING}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_URL_ENCODING(*driver.loc.back()); } -{OPERATOR_VALIDATE_UTF8_ENCODING}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_UTF8_ENCODING(*driver.loc.back()); } +{OPERATOR_GEOLOOKUP}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_GEOLOOKUP(*driver.loc.back()); } +{OPERATOR_UNCONDITIONAL_MATCH}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_UNCONDITIONAL_MATCH(*driver.loc.back()); } +{OPERATOR_DETECT_SQLI}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_SQLI(*driver.loc.back()); } +{OPERATOR_DETECT_XSS}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_XSS(*driver.loc.back()); } +{OPERATOR_VALIDATE_URL_ENCODING}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_URL_ENCODING(*driver.loc.back()); } +{OPERATOR_VALIDATE_UTF8_ENCODING}[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_UTF8_ENCODING(*driver.loc.back()); } } { -{OPERATOR_GEOLOOKUP}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_GEOLOOKUP(*driver.loc.back()); } -{OPERATOR_UNCONDITIONAL_MATCH}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_UNCONDITIONAL_MATCH(*driver.loc.back()); } -{OPERATOR_DETECT_SQLI}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_SQLI(*driver.loc.back()); } -{OPERATOR_DETECT_XSS}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_XSS(*driver.loc.back()); } -{OPERATOR_VALIDATE_URL_ENCODING}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_URL_ENCODING(*driver.loc.back()); } -{OPERATOR_VALIDATE_UTF8_ENCODING}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_UTF8_ENCODING(*driver.loc.back()); } +{OPERATOR_GEOLOOKUP}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_GEOLOOKUP(*driver.loc.back()); } +{OPERATOR_UNCONDITIONAL_MATCH}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_UNCONDITIONAL_MATCH(*driver.loc.back()); } +{OPERATOR_DETECT_SQLI}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_SQLI(*driver.loc.back()); } +{OPERATOR_DETECT_XSS}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_DETECT_XSS(*driver.loc.back()); } +{OPERATOR_VALIDATE_URL_ENCODING}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_URL_ENCODING(*driver.loc.back()); } +{OPERATOR_VALIDATE_UTF8_ENCODING}[ ]*["] { BEGIN(TRANSACTION_FROM_OPERATOR_TO_ACTIONS); return p::make_OPERATOR_VALIDATE_UTF8_ENCODING(*driver.loc.back()); } } { @@ -1100,6 +1112,7 @@ EQUALS_MINUS (?i:=\-) {OPERATOR_PM} { BEGIN_PARAMETER(); return p::make_OPERATOR_PM(*driver.loc.back()); } {OPERATOR_RBL} { BEGIN_PARAMETER(); return p::make_OPERATOR_RBL( *driver.loc.back()); } {OPERATOR_RX} { BEGIN_PARAMETER(); return p::make_OPERATOR_RX(*driver.loc.back()); } +{OPERATOR_RX_GLOBAL} { BEGIN_PARAMETER(); return p::make_OPERATOR_RX_GLOBAL(*driver.loc.back()); } {OPERATOR_STR_EQ} { BEGIN_PARAMETER(); return p::make_OPERATOR_STR_EQ(*driver.loc.back()); } {OPERATOR_STR_MATCH} { BEGIN_PARAMETER(); return p::make_OPERATOR_STR_MATCH(*driver.loc.back()); } {OPERATOR_BEGINS_WITH} { BEGIN_PARAMETER(); return p::make_OPERATOR_BEGINS_WITH(*driver.loc.back()); } @@ -1130,32 +1143,32 @@ EQUALS_MINUS (?i:=\-) } { -["] { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } -{FREE_TEXT_DOUBLE_QUOTE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +["] { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } +{FREE_TEXT_DOUBLE_QUOTE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } } { -[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } -{FREE_TEXT_SPACE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } +{FREE_TEXT_SPACE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } } { -{START_MACRO_VARIABLE} { BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } -. { BEGIN(LEXING_ERROR); yyless(0); } +{START_MACRO_VARIABLE} { BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } +. { BEGIN(LEXING_ERROR); yyless(0); } } { -["] { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } -{FREE_TEXT_DOUBLE_QUOTE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +["] { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } +{FREE_TEXT_DOUBLE_QUOTE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } } { -[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } -{FREE_TEXT_SPACE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } +[ ] { BEGIN(TRANSACTION_FROM_OPERATOR_PARAMETERS_TO_ACTIONS); } +{FREE_TEXT_SPACE_MACRO_EXPANSION} { return p::make_FREE_TEXT_QUOTE_MACRO_EXPANSION(yytext, *driver.loc.back()); } } { -{START_MACRO_VARIABLE} { BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } -. { BEGIN(LEXING_ERROR_VARIABLE); yyless(0); } +{START_MACRO_VARIABLE} { BEGINX(EXPECTING_ACTION_PREDICATE_VARIABLE); } +. { BEGIN(LEXING_ERROR_VARIABLE); yyless(0); } } @@ -1192,20 +1205,20 @@ EQUALS_MINUS (?i:=\-) { -[ \t]+ { } -[ \t]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } -[ \t]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } +[ \t]+ { } +[ \t]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } +[ \t]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } } { -.*[ \t]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } -.*[ \t]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } -.*[^\\] { BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } +.*[ \t]*\\\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } +.*[ \t]*\\\r\n[ \t]* { driver.loc.back()->lines(1); driver.loc.back()->step(); } +.*[^\\] { BEGIN(INITIAL); driver.loc.back()->lines(1); driver.loc.back()->step(); } } -. { BEGIN(LEXING_ERROR); yyless(0); } +. { BEGIN(LEXING_ERROR); yyless(0); } .+ { driver.error (*driver.loc.back(), "Invalid input: ", yytext); throw p::syntax_error(*driver.loc.back(), ""); } .+ { driver.error (*driver.loc.back(), "Expecting an action, got: ", yytext); throw p::syntax_error(*driver.loc.back(), ""); } @@ -1230,7 +1243,8 @@ EQUALS_MINUS (?i:=\-) {CONFIG_INCLUDE}[ \t]+{CONFIG_VALUE_PATH} { std::string err; - const char *file = strchr(yytext, ' ') + 1; + const char *tmpStr = yytext + strlen("include"); + const char *file = tmpStr + strspn( tmpStr, " \t"); std::string fi = modsecurity::utils::find_resource(file, *driver.loc.back()->end.filename, &err); if (fi.empty() == true) { BEGIN(INITIAL); @@ -1257,9 +1271,9 @@ EQUALS_MINUS (?i:=\-) {CONFIG_INCLUDE}[ \t]+["]{CONFIG_VALUE_PATH}["] { std::string err; - const char *file = strchr(yytext, ' ') + 1; - char *f = strdup(file + 1); - f[strlen(f)-1] = '\0'; + const char *tmpStr = yytext + strlen("include"); + const char *file = tmpStr + strspn( tmpStr, " \t"); + char *f = strdup(file); std::string fi = modsecurity::utils::find_resource(f, *driver.loc.back()->end.filename, &err); if (fi.empty() == true) { BEGIN(INITIAL); @@ -1308,10 +1322,10 @@ EQUALS_MINUS (?i:=\-) if (ret == false) { BEGIN(INITIAL); - if (driver.m_remoteRulesActionOnFailed == Rules::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction) { + if (driver.m_remoteRulesActionOnFailed == RulesSet::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction) { /** TODO: Implement the server logging mechanism. */ } - if (driver.m_remoteRulesActionOnFailed == Rules::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction) { + if (driver.m_remoteRulesActionOnFailed == RulesSet::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction) { driver.error (*driver.loc.back(), "", yytext + std::string(" - Failed to download: ") + c.error); throw p::syntax_error(*driver.loc.back(), ""); } diff --git a/src/deps/src/ModSecurity/src/parser/stack.hh b/src/deps/src/ModSecurity/src/parser/stack.hh index e9db42924..e6c46cc8d 100644 --- a/src/deps/src/ModSecurity/src/parser/stack.hh +++ b/src/deps/src/ModSecurity/src/parser/stack.hh @@ -1,8 +1,8 @@ -// A Bison parser, made by GNU Bison 3.3.2. +// A Bison parser, made by GNU Bison 3.7.6. // Starting with Bison 3.2, this file is useless: the structure it // used to define is now defined with the parser itself. // // To get rid of this file: -// 1. add 'require "3.2"' (or newer) to your grammar file +// 1. add '%require "3.2"' (or newer) to your grammar file // 2. remove references to this file from your build system. diff --git a/src/deps/src/ModSecurity/src/request_body_processor/json.cc b/src/deps/src/ModSecurity/src/request_body_processor/json.cc index a6dd4ad4d..585976b48 100644 --- a/src/deps/src/ModSecurity/src/request_body_processor/json.cc +++ b/src/deps/src/ModSecurity/src/request_body_processor/json.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -26,9 +26,15 @@ namespace modsecurity { namespace RequestBodyProcessor { +static const double json_depth_limit_default = 10000.0; +static const char* json_depth_limit_exceeded_msg = ". Parsing depth limit exceeded"; + JSON::JSON(Transaction *transaction) : m_transaction(transaction), m_handle(NULL), - m_current_key("") { + m_current_key(""), + m_max_depth(json_depth_limit_default), + m_current_depth(0), + m_depth_limit_exceeded(false) { /** * yajl callback functions * For more information on the function signatures and order, check @@ -91,6 +97,9 @@ bool JSON::processChunk(const char *buf, unsigned int size, std::string *err) { (const unsigned char *)buf, size); /* We need to free the yajl error message later, how to do this? */ err->assign((const char *)e); + if (m_depth_limit_exceeded) { + err->append(json_depth_limit_exceeded_msg); + } yajl_free_error(m_handle, e); return false; } @@ -106,6 +115,9 @@ bool JSON::complete(std::string *err) { unsigned char *e = yajl_get_error(m_handle, 0, NULL, 0); /* We need to free the yajl error message later, how to do this? */ err->assign((const char *)e); + if (m_depth_limit_exceeded) { + err->append(json_depth_limit_exceeded_msg); + } yajl_free_error(m_handle, e); return false; } @@ -142,7 +154,10 @@ int JSON::addArgument(const std::string& value) { } - m_transaction->addArgument("JSON", path + data, value, 0); + if (!m_transaction->addArgument("JSON", path + data, value, 0)) { + // cancel parsing by returning false + return 0; + } return 1; } @@ -223,13 +238,19 @@ int JSON::yajl_start_array(void *ctx) { std::string name = tthis->getCurrentKey(); tthis->m_containers.push_back( reinterpret_cast(new JSONContainerArray(name))); + tthis->m_current_depth++; + if (tthis->m_current_depth > tthis->m_max_depth) { + tthis->m_depth_limit_exceeded = true; + return 0; + } return 1; } int JSON::yajl_end_array(void *ctx) { JSON *tthis = reinterpret_cast(ctx); - if (tthis->m_containers.size() <= 0) { + if (tthis->m_containers.empty()) { + tthis->m_current_depth--; return 1; } @@ -237,12 +258,13 @@ int JSON::yajl_end_array(void *ctx) { tthis->m_containers.pop_back(); delete a; if (tthis->m_containers.size() > 0) { - JSONContainerArray *a = dynamic_cast( + JSONContainerArray *ja = dynamic_cast( tthis->m_containers.back()); - if (a) { - a->m_elementCounter++; + if (ja) { + ja->m_elementCounter++; } } + tthis->m_current_depth--; return 1; } @@ -253,6 +275,11 @@ int JSON::yajl_start_map(void *ctx) { std::string name(tthis->getCurrentKey()); tthis->m_containers.push_back( reinterpret_cast(new JSONContainerMap(name))); + tthis->m_current_depth++; + if (tthis->m_current_depth > tthis->m_max_depth) { + tthis->m_depth_limit_exceeded = true; + return 0; + } return 1; } @@ -263,7 +290,8 @@ int JSON::yajl_start_map(void *ctx) { */ int JSON::yajl_end_map(void *ctx) { JSON *tthis = reinterpret_cast(ctx); - if (tthis->m_containers.size() <= 0) { + if (tthis->m_containers.empty()) { + tthis->m_current_depth--; return 1; } @@ -272,13 +300,14 @@ int JSON::yajl_end_map(void *ctx) { delete a; if (tthis->m_containers.size() > 0) { - JSONContainerArray *a = dynamic_cast( + JSONContainerArray *ja = dynamic_cast( tthis->m_containers.back()); - if (a) { - a->m_elementCounter++; + if (ja) { + ja->m_elementCounter++; } } + tthis->m_current_depth--; return 1; } diff --git a/src/deps/src/ModSecurity/src/request_body_processor/json.h b/src/deps/src/ModSecurity/src/request_body_processor/json.h index 8c4c502dd..19c469ee9 100644 --- a/src/deps/src/ModSecurity/src/request_body_processor/json.h +++ b/src/deps/src/ModSecurity/src/request_body_processor/json.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -26,8 +26,7 @@ #include #include "modsecurity/transaction.h" -#include "modsecurity/rules.h" - +#include "modsecurity/rules_set.h" namespace modsecurity { @@ -36,7 +35,7 @@ namespace RequestBodyProcessor { class JSONContainer { public: - explicit JSONContainer(std::string name) : m_name(name) { } + explicit JSONContainer(const std::string &name) : m_name(name) { } virtual ~JSONContainer() { } std::string m_name; }; @@ -44,7 +43,7 @@ class JSONContainer { class JSONContainerArray : public JSONContainer { public: - explicit JSONContainerArray(std::string name) : JSONContainer(name), + explicit JSONContainerArray(const std::string &name) : JSONContainer(name), m_elementCounter(0) { } size_t m_elementCounter; }; @@ -52,7 +51,7 @@ class JSONContainerArray : public JSONContainer { class JSONContainerMap : public JSONContainer { public: - explicit JSONContainerMap(std::string name) : JSONContainer(name) { } + explicit JSONContainerMap(const std::string &name) : JSONContainer(name) { } }; @@ -61,7 +60,7 @@ class JSON { explicit JSON(Transaction *transaction); ~JSON(); - bool init(); + static bool init(); bool processChunk(const char *buf, unsigned int size, std::string *err); bool complete(std::string *err); @@ -79,7 +78,7 @@ class JSON { static int yajl_start_array(void *ctx); static int yajl_end_array(void *ctx); - bool isPreviousArray() { + bool isPreviousArray() const { JSONContainerArray *prev = NULL; if (m_containers.size() < 1) { return false; @@ -104,12 +103,19 @@ class JSON { return ret; } + void setMaxDepth(double max_depth) { + m_max_depth = max_depth; + } + private: std::deque m_containers; Transaction *m_transaction; yajl_handle m_handle; yajl_status m_status; std::string m_current_key; + double m_max_depth; + int64_t m_current_depth; + bool m_depth_limit_exceeded; }; diff --git a/src/deps/src/ModSecurity/src/request_body_processor/multipart.cc b/src/deps/src/ModSecurity/src/request_body_processor/multipart.cc index b38d09864..cfce8434f 100644 --- a/src/deps/src/ModSecurity/src/request_body_processor/multipart.cc +++ b/src/deps/src/ModSecurity/src/request_body_processor/multipart.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -27,16 +27,73 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/collection/collections.h" -#include "modsecurity/rules.h" #include "src/utils/string.h" namespace modsecurity { namespace RequestBodyProcessor { +static const char* mime_charset_special = "!#$%&+-^_`{}~"; +static const char* attr_char_special = "!#$&+-.^_`~"; -Multipart::Multipart(std:: string header, Transaction *transaction) +MultipartPartTmpFile::~MultipartPartTmpFile() { + if (!m_tmp_file_name.empty() && m_delete) { + /* make sure it is closed first */ + if (m_tmp_file_fd > 0) { + Close(); + } + + const int unlink_rc = unlink(m_tmp_file_name.c_str()); + if (unlink_rc < 0) { + ms_dbg_a(m_transaction, 1, "Multipart: Failed to delete file (part) \"" \ + + m_tmp_file_name + "\" because " \ + + std::to_string(errno) + "(" \ + + strerror(errno) + ")"); + } else { + ms_dbg_a(m_transaction, 4, "Multipart: file deleted successfully (part) \"" \ + + m_tmp_file_name + "\""); + } + + } +} + +void MultipartPartTmpFile::Open() { + struct tm timeinfo; + char tstr[300]; + time_t tt = time(NULL); + + localtime_r(&tt, &timeinfo); + + memset(tstr, '\0', 300); + strftime(tstr, 299, "/%Y%m%d-%H%M%S", &timeinfo); + + std::string path = m_transaction->m_rules->m_uploadDirectory.m_value; + path = path + tstr + "-" + *m_transaction->m_id.get(); + path += "-file-XXXXXX"; + + char* tmp = strdup(path.c_str()); + m_tmp_file_fd = mkstemp(tmp); + m_tmp_file_name.assign(tmp); + free(tmp); + ms_dbg_a(m_transaction, 4, "MultipartPartTmpFile: Create filename= " + m_tmp_file_name); + + int mode = m_transaction->m_rules->m_uploadFileMode.m_value; + if ((m_tmp_file_fd != -1) && (mode != 0)) { + if (fchmod(m_tmp_file_fd, mode) == -1) { + m_tmp_file_fd = -1; + } + } +} + +void MultipartPartTmpFile::Close() { + close(m_tmp_file_fd); + m_tmp_file_fd = -1; +} + + +Multipart::Multipart(const std::string &header, Transaction *transaction) : m_reqbody_no_files_length(0), m_nfiles(0), m_boundary_count(0), @@ -45,8 +102,11 @@ Multipart::Multipart(std:: string header, Transaction *transaction) m_bufptr(NULL), m_bufleft(0), m_buf_offset(0), + m_crlf_state(0), + m_crlf_state_buf_end(0), m_mpp(NULL), m_mpp_state(0), + m_mpp_substate_part_data_read(0), m_reserve{0}, m_seen_data(0), m_is_complete(0), @@ -71,37 +131,21 @@ Multipart::Multipart(std:: string header, Transaction *transaction) Multipart::~Multipart() { ms_dbg_a(m_transaction, 4, "Multipart: Cleanup started (keep files set to " \ - + RulesProperties::configBooleanString( + + RulesSetProperties::configBooleanString( m_transaction->m_rules->m_uploadKeepFiles) \ + ")"); if (m_transaction->m_rules->m_uploadKeepFiles - != RulesProperties::TrueConfigBoolean) { + != RulesSetProperties::TrueConfigBoolean) { for (MultipartPart *m : m_parts) { - if (m->m_type == MULTIPART_FILE) { - if (!m->m_tmp_file_name.empty()) { - /* make sure it is closed first */ - if (m->m_tmp_file_fd > 0) { - close(m->m_tmp_file_fd); - m->m_tmp_file_fd = -1; - } - const int unlink_rc = - unlink(m->m_tmp_file_name.c_str()); - - if (unlink_rc < 0) { - ms_dbg_a(m_transaction, 1, - "Multipart: Failed to delete file (part) \"" \ - + m->m_tmp_file_name + "\" because " \ - + std::to_string(errno) + "(" \ - + strerror(errno) + ")"); - } else { - ms_dbg_a(m_transaction, 4, - "Multipart: file deleted successfully (part) \"" \ - + m->m_tmp_file_name + "\""); - } - - } + if ((m->m_type == MULTIPART_FILE) && (m->m_tmp_file)) { + // only mark for deletion for now; the file should stay on disk until + // the transaction is complete + ms_dbg_a(m_transaction, 9, "Multipart: Marking temporary file for deletion: " \ + + m->m_tmp_file->getFilename()); + m->m_tmp_file->setDelete(); } + } } @@ -186,12 +230,18 @@ int Multipart::boundary_characters_valid(const char *boundary) { } -void Multipart::validate_quotes(const char *data) { +void Multipart::validate_quotes(const char *data, char quote) { int i, len; if (data == NULL) return; + // if the value was enclosed in double quotes, then we don't care about + // a single quote character within the name. + if (quote == '"') { + return; + } + len = strlen(data); for (i = 0; i < len; i++) { @@ -208,6 +258,7 @@ void Multipart::validate_quotes(const char *data) { int Multipart::parse_content_disposition(const char *c_d_value, int offset) { const char *p = NULL; + std::string filenameStar; /* accept only what we understand */ if (strncmp(c_d_value, "form-data", 9) != 0) { @@ -276,14 +327,47 @@ int Multipart::parse_content_disposition(const char *c_d_value, int offset) { return -6; } - /* Accept both quotes as some backends will accept them, but - * technically "'" is invalid and so flag_invalid_quoting is - * set so the user can deal with it in the rules if they so wish. - */ + char quote = '\0'; + if (name == "filename*") { + /* filename*=charset'[optional-language]'filename */ + /* Read beyond the charset and the optional language*/ + const char* start_of_charset = p; + while ((*p != '\0') && (isalnum(*p) || (strchr(mime_charset_special, *p)))) { + p++; + } + if ((*p != '\'') || (p == start_of_charset)) { + return -16; // Must be at least one legit char before ' for start of language + } + p++; + while ((*p != '\0') && (*p != '\'')) { + p++; + } + if (*p != '\'') { + return -17; // Single quote for end-of-language not found + } + p++; - if ((*p == '"') || (*p == '\'')) { - /* quoted */ - char quote = *p; + /* Now read what should be the actual filename */ + const char* start_of_filename = p; + while ((*p != '\0') && (*p != ';')) { + if (*p == '%') { + if ((*(p+1) == '\0') || (!isxdigit(*(p+1))) || (!isxdigit(*(p+2)))) { + return -18; + } + p += 3; + } else if (isalnum(*p) || strchr(attr_char_special, *p)) { + p++; + } else { + return -19; + } + } + value.assign(start_of_filename, p - start_of_filename); + } else if ((*p == '"') || (*p == '\'')) { + /* Accept both quotes as some backends will accept them, but + * technically "'" is invalid and so flag_invalid_quoting is + * set so the user can deal with it in the rules if they so wish. + */ + quote = *p; // remember which quote character was used for the value if (quote == '\'') { m_flag_invalid_quoting = 1; @@ -334,7 +418,7 @@ int Multipart::parse_content_disposition(const char *c_d_value, int offset) { /* evaluate part */ if (name == "name") { - validate_quotes(value.c_str()); + validate_quotes(value.c_str(), quote); m_transaction->m_variableMultipartName.set(value, value, offset + ((p - c_d_value) - value.size())); @@ -350,7 +434,7 @@ int Multipart::parse_content_disposition(const char *c_d_value, int offset) { ms_dbg_a(m_transaction, 9, "Multipart: Content-Disposition name: " + value + "."); } else if (name == "filename") { - validate_quotes(value.c_str()); + validate_quotes(value.c_str(), quote); m_transaction->m_variableMultipartFileName.set(value, value, \ offset + ((p - c_d_value) - value.size())); @@ -364,8 +448,17 @@ int Multipart::parse_content_disposition(const char *c_d_value, int offset) { m_mpp->m_filenameOffset = offset + ((p - c_d_value) - value.size()); ms_dbg_a(m_transaction, 9, - "Multipart: Content-Disposition filename: " \ - + value + "."); + "Multipart: Content-Disposition filename: " + value + "."); + } else if (name == "filename*") { + if (!filenameStar.empty()) { + ms_dbg_a(m_transaction, 4, + "Multipart: Warning: Duplicate Content-Disposition " \ + "filename*: " + value + "."); + return -20; + } + filenameStar.assign(value); + ms_dbg_a(m_transaction, 9, + "Multipart: Content-Disposition filename*: " + value + "."); } else { return -11; } @@ -377,61 +470,35 @@ int Multipart::parse_content_disposition(const char *c_d_value, int offset) { /* the next character must be a zero or a semi-colon */ if (*p == '\0') { - return 1; /* this is OK */ - } - if (*p != ';') { - p--; - if (*p == '\'' || *p == '\"') { - ms_dbg_a(m_transaction, 9, - "Multipart: Invalid quoting detected: " \ - + std::string(p) + " length " \ - + std::to_string(strlen(p)) + " bytes"); - m_flag_invalid_quoting = 1; + // Just let the 'while' condition end the loop + } else { + if (*p != ';') { + p--; + if (*p == '\'' || *p == '\"') { + ms_dbg_a(m_transaction, 9, + "Multipart: Invalid quoting detected: " \ + + std::string(p) + " length " \ + + std::to_string(strlen(p)) + " bytes"); + m_flag_invalid_quoting = 1; + } + /* p++; */ + return -12; } - p++; - return -12; + p++; /* move over the semi-colon */ } - p++; /* move over the semi-colon */ } /* loop will stop when (*p == '\0') */ } - return 1; -} - - -int Multipart::tmp_file_name(std::string *filename) const { - std::string path; - struct tm timeinfo; - char tstr[300]; - char *tmp; - int fd; - int mode; - time_t tt = time(NULL); - - localtime_r(&tt, &timeinfo); - - path = m_transaction->m_rules->m_uploadDirectory.m_value; - mode = m_transaction->m_rules->m_uploadFileMode.m_value; - - memset(tstr, '\0', 300); - strftime(tstr, 299, "/%Y%m%d-%H%M%S", &timeinfo); - path = path + tstr + "-" + m_transaction->m_id; - path = path + "-file-XXXXXX"; - - tmp = strdup(path.c_str()); - - fd = mkstemp(tmp); - filename->assign(tmp); - free(tmp); - if ((fd != -1) && (mode != 0)) { - if (fchmod(fd, mode) == -1) { - return -1; - } + if (!filenameStar.empty() && m_mpp->m_filename.empty()) { + ms_dbg_a(m_transaction, 4, + "Multipart: Warning: no filename= but filename*:" \ + + filenameStar + "."); + return -21; } - return fd; + return 1; } @@ -440,6 +507,8 @@ int Multipart::process_part_data(std::string *error, size_t offset) { char localreserve[2] = { '\0', '\0' }; /* initialized to quiet warning */ int bytes_reserved = 0; + m_mpp_substate_part_data_read = 1; + /* Preserve some bytes for later. */ if (((MULTIPART_BUF_SIZE - m_bufleft) >= 1) && (*(p - 1) == '\n')) { if (((MULTIPART_BUF_SIZE - m_bufleft) >= 2) && (*(p - 2) == '\r')) { @@ -462,9 +531,9 @@ int Multipart::process_part_data(std::string *error, size_t offset) { /* add data to the part we are building */ if (m_mpp->m_type == MULTIPART_FILE) { bool extract = m_transaction->m_rules->m_uploadKeepFiles \ - == RulesProperties::TrueConfigBoolean \ + == RulesSetProperties::TrueConfigBoolean \ || m_transaction->m_rules->m_tmpSaveUploadedFiles \ - == RulesProperties::TrueConfigBoolean; + == RulesSetProperties::TrueConfigBoolean; /* remember where we started */ if (m_mpp->m_length == 0) { @@ -494,20 +563,18 @@ int Multipart::process_part_data(std::string *error, size_t offset) { */ if (extract) { /* first create a temporary file if we don't have it already */ - if (m_mpp->m_tmp_file_fd == 0) { - std::string path; - m_mpp->m_tmp_file_fd = tmp_file_name(&path); - - /* construct temporary file name */ - m_mpp->m_tmp_file_name = path; + if (!m_mpp->m_tmp_file || !m_mpp->m_tmp_file->isValid()) { + m_mpp->m_tmp_file = std::make_shared(m_transaction); + m_transaction->m_multipartPartTmpFiles.push_back(m_mpp->m_tmp_file); + m_mpp->m_tmp_file->Open(); /* do we have an opened file? */ - if (m_mpp->m_tmp_file_fd < 0) { + if (!m_mpp->m_tmp_file || m_mpp->m_tmp_file->getFd() < 0) { ms_dbg_a(m_transaction, 1, "Multipart: Failed to create file: " \ - + m_mpp->m_tmp_file_name); + + m_mpp->m_tmp_file->getFilename()); error->assign("Multipart: Failed to create file: " \ - + m_mpp->m_tmp_file_name); + + m_mpp->m_tmp_file->getFilename()); return -1; } /* keep track of the files count */ @@ -517,18 +584,18 @@ int Multipart::process_part_data(std::string *error, size_t offset) { ms_dbg_a(m_transaction, 4, "Multipart: Created temporary file " \ + std::to_string(m_nfiles) + " (mode o" + std::to_string(m_transaction->m_rules->m_uploadFileMode.m_value) + "): " \ - + m_mpp->m_tmp_file_name); + + m_mpp->m_tmp_file->getFilename()); } /* write the reserve first */ if (m_reserve[0] != 0) { - if (write(m_mpp->m_tmp_file_fd, &m_reserve[1], m_reserve[0]) + if (write(m_mpp->m_tmp_file->getFd(), &m_reserve[1], m_reserve[0]) != m_reserve[0]) { ms_dbg_a(m_transaction, 1, "Multipart: writing to \"" \ - + m_mpp->m_tmp_file_name + "\" failed"); + + m_mpp->m_tmp_file->getFilename() + "\" failed"); error->assign("Multipart: writing to \"" \ - + m_mpp->m_tmp_file_name + "\" failed"); + + m_mpp->m_tmp_file->getFilename() + "\" failed"); return -1; } @@ -542,14 +609,14 @@ int Multipart::process_part_data(std::string *error, size_t offset) { /* write data to the file */ - if (write(m_mpp->m_tmp_file_fd, m_buf, + if (write(m_mpp->m_tmp_file->getFd(), m_buf, MULTIPART_BUF_SIZE - m_bufleft) != (MULTIPART_BUF_SIZE - m_bufleft)) { ms_dbg_a(m_transaction, 1, "Multipart: writing to \"" \ - + m_mpp->m_tmp_file_name + "\" failed"); + + m_mpp->m_tmp_file->getFilename() + "\" failed"); error->assign("Multipart: writing to \"" \ - + m_mpp->m_tmp_file_name + "\" failed"); + + m_mpp->m_tmp_file->getFilename() + "\" failed"); return -1; } @@ -635,6 +702,7 @@ int Multipart::process_part_header(std::string *error, int offset) { /* Check for nul bytes. */ len = MULTIPART_BUF_SIZE - m_bufleft; + int len_without_termination = len - 1; for (i = 0; i < len; i++) { if (m_buf[i] == '\0') { ms_dbg_a(m_transaction, 1, @@ -652,6 +720,7 @@ int Multipart::process_part_header(std::string *error, int offset) { if (len > 1) { if (m_buf[len - 2] == '\r') { m_flag_crlf_line = 1; + len_without_termination--; } else { m_flag_lf_line = 1; } @@ -665,6 +734,13 @@ int Multipart::process_part_header(std::string *error, int offset) { std::string header_value(""); int rc; + /* record the previous completed header */ + if (!m_mpp->m_last_header_line.empty()) { + m_mpp->m_header_lines.push_back(std::make_pair( + offset-m_mpp->m_last_header_line.length(), m_mpp->m_last_header_line)); + m_mpp->m_last_header_line.assign(""); + } + if (m_mpp->m_headers.count("Content-Disposition") == 0) { ms_dbg_a(m_transaction, 1, "Multipart: Part missing Content-Disposition header."); @@ -675,8 +751,14 @@ int Multipart::process_part_header(std::string *error, int offset) { } header_value = m_mpp->m_headers.at("Content-Disposition").second; - rc = parse_content_disposition(header_value.c_str(), - m_mpp->m_headers.at("Content-Disposition").first); + try { + rc = parse_content_disposition(header_value.c_str(), + m_mpp->m_headers.at("Content-Disposition").first); + } catch (...) { + ms_dbg_a(m_transaction, 1, + "Multipart: Unexpected error parsing Content-Disposition header."); + rc = -99; + } if (rc < 0) { ms_dbg_a(m_transaction, 1, "Multipart: Invalid Content-Disposition header (" @@ -719,6 +801,7 @@ int Multipart::process_part_header(std::string *error, int offset) { } m_mpp_state = 1; + m_mpp_substate_part_data_read = 0; m_mpp->m_last_header_name.assign(""); } else { /* Header line. */ if (isspace(m_buf[0])) { @@ -780,12 +863,21 @@ int Multipart::process_part_header(std::string *error, int offset) { error->assign("Multipart: Part header too long."); return false; } + + m_mpp->m_last_header_line = m_mpp->m_last_header_name + ": " + new_value; } else { char *data; std::string header_value; std::string header_name; /* new header */ + /* record the previous completed header */ + if (!m_mpp->m_last_header_line.empty()) { + m_mpp->m_header_lines.push_back(std::make_pair( + offset-m_mpp->m_last_header_line.length(), m_mpp->m_last_header_line)); + m_mpp->m_last_header_line.assign(""); + } + data = m_buf; while ((*data != ':') && (*data != '\0')) { data++; @@ -842,6 +934,11 @@ int Multipart::process_part_header(std::string *error, int offset) { ms_dbg_a(m_transaction, 9, "Multipart: Added part header \"" + header_name \ + "\" \"" + header_value + "\"."); + if (len_without_termination > 0) { + m_mpp->m_last_header_line.assign(m_buf); + } else { + m_mpp->m_last_header_line.assign(""); + } } } @@ -852,12 +949,17 @@ int Multipart::process_part_header(std::string *error, int offset) { int Multipart::process_boundary(int last_part) { /* if there was a part being built finish it */ if (m_mpp != NULL) { + /* record all the part header lines from the part into the transaction collection */ + for (const auto& header_line : m_mpp->m_header_lines) { + m_transaction->m_variableMultipartPartHeaders.set(m_mpp->m_name, + header_line.second, header_line.first); + ms_dbg_a(m_transaction, 9, "Multipart: Added part header line:" + header_line.second ); + } + /* close the temp file */ - if ((m_mpp->m_type == MULTIPART_FILE) - && (!m_mpp->m_tmp_file_name.empty()) - && (m_mpp->m_tmp_file_fd != 0)) { - close(m_mpp->m_tmp_file_fd); - m_mpp->m_tmp_file_fd = -1; + if ((m_mpp->m_type == MULTIPART_FILE) && (m_mpp->m_tmp_file) + && (m_mpp->m_tmp_file->isValid())) { + m_mpp->m_tmp_file->Close(); } if (m_mpp->m_type != MULTIPART_FILE) { @@ -906,6 +1008,7 @@ int Multipart::process_boundary(int last_part) { m_mpp = new MultipartPart(); m_mpp_state = 0; + m_mpp_substate_part_data_read = 0; m_reserve[0] = 0; m_reserve[1] = 0; @@ -1033,6 +1136,33 @@ int Multipart::multipart_complete(std::string *error) { m_boundary.size()) == 0) && (*(m_buf + 2 + m_boundary.size()) == '-') && (*(m_buf + 2 + m_boundary.size() + 1) == '-')) { + // these next two checks may result in repeating work from earlier in this fn + // ignore the duplication for now to minimize refactoring + if ((m_crlf_state_buf_end == 2) && (m_flag_lf_line != 1)) { + m_flag_lf_line = 1; + m_transaction->m_variableMultipartLFLine.set(std::to_string(m_flag_lf_line), + m_transaction->m_variableOffset); + m_transaction->m_variableMultipartCrlfLFLines.set(std::to_string(m_flag_crlf_line && m_flag_lf_line), + m_transaction->m_variableOffset); + if (m_flag_crlf_line && m_flag_lf_line) { + ms_dbg_a(m_transaction, 4, "Multipart: Warning: mixed line endings used (CRLF/LF)."); + } else if (m_flag_lf_line) { + ms_dbg_a(m_transaction, 4, "Multipart: Warning: incorrect line endings used (LF)."); + } + m_transaction->m_variableMultipartStrictError.set( + std::to_string(m_flag_lf_line) , m_transaction->m_variableOffset); + } + if ((m_mpp_substate_part_data_read == 0) && (m_flag_invalid_part != 1)) { + // it looks like the final boundary, but it's where part data should begin + m_flag_invalid_part = 1; + ms_dbg_a(m_transaction, 3, "Multipart: Invalid part (data contains final boundary)"); + m_transaction->m_variableMultipartStrictError.set( + std::to_string(m_flag_invalid_part) , m_transaction->m_variableOffset); + m_transaction->m_variableMultipartInvalidPart.set(std::to_string(m_flag_invalid_part), + m_transaction->m_variableOffset); + ms_dbg_a(m_transaction, 4, "Multipart: Warning: invalid part parsing."); + } + /* Looks like the final boundary - process it. */ if (process_boundary(1 /* final */) < 0) { m_flag_error = 1; @@ -1070,14 +1200,16 @@ int Multipart::multipart_complete(std::string *error) { if (m->m_type == MULTIPART_FILE) { std::string tmp_name; std::string name; - if (!m->m_tmp_file_name.empty()) { - tmp_name.assign(m->m_tmp_file_name); + if (m->m_tmp_file && !m->m_tmp_file->getFilename().empty()) { + tmp_name.assign(m->m_tmp_file->getFilename()); + m_transaction->m_variableFilesTmpNames.set(m->m_tmp_file->getFilename(), + m->m_tmp_file->getFilename(), m->m_filenameOffset); } if (!m->m_filename.empty()) { name.assign(m->m_filename); } - m_transaction->m_variableFiles.set(m->m_filename, + m_transaction->m_variableFiles.set(m->m_name, m->m_filename, m->m_filenameOffset); m_transaction->m_variableFilesNames.set(m->m_name, @@ -1088,12 +1220,9 @@ int Multipart::multipart_complete(std::string *error) { m->m_tmp_file_size.second, m->m_tmp_file_size.first); - m_transaction->m_variableFilesTmpContent.set(m->m_filename, + m_transaction->m_variableFilesTmpContent.set(m->m_name, m->m_value, m->m_valueOffset); - m_transaction->m_variableFilesTmpNames.set(m->m_tmp_file_name, - m->m_tmp_file_name, m->m_filenameOffset); - file_combined_size = file_combined_size + m->m_tmp_file_size.first; m_transaction->m_variableFilesCombinedSize.set( @@ -1277,7 +1406,7 @@ bool Multipart::init(std::string *error) { /* Quoted. */ m_boundary.assign(std::string(b + 1, len - 2)); if (m_boundary.empty()) { - return -1; + return false; } m_flag_boundary_quoted = 1; } else { @@ -1310,6 +1439,16 @@ bool Multipart::init(std::string *error) { return false; } + /* Some frameworks are known to incorrectly include a charset= parameter */ + /* after the boundary. Doing so is not RFC-compliant, but we will tolerate it.*/ + if (boundary_characters_valid(m_boundary.c_str()) != 1) { + size_t semicolon_after_boundary = m_boundary.find(';'); + if (semicolon_after_boundary != std::string::npos) { + ms_dbg_a(m_transaction, 3, + "Multipart: Invalid parameter after boundary in C-T (tolerated)."); + m_boundary = m_boundary.substr(0, semicolon_after_boundary); + } + } /* Validate the characters used in the boundary. */ if (boundary_characters_valid(m_boundary.c_str()) != 1) { m_flag_error = 1; @@ -1418,71 +1557,81 @@ bool Multipart::process(const std::string& data, std::string *error, if ((strlen(m_buf) >= m_boundary.size() + 2) && (strncmp(m_buf + 2, m_boundary.c_str(), m_boundary.size()) == 0)) { - char *boundary_end = m_buf + 2 + m_boundary.size(); - /* if it match, AND there was a matched boundary at least, - set the m_flag_unmatched_boundary flag to 2 - this indicates that there were an opened boundary, which - matches the reference, and here is the final boundary. - The flag will differ from 0, so the previous rules ("!@eq 0") - will catch all "errors", without any modification, but we can - use the new, permission mode with "@eq 1" - */ - if (m_boundary_count > 0) { - m_flag_unmatched_boundary = 2; - } - int is_final = 0; + if (m_crlf_state_buf_end == 2) { + m_flag_lf_line = 1; + } + if ((m_mpp_substate_part_data_read == 0) && (m_boundary_count > 0)) { + /* string matches our boundary, but it's where part data should begin */ + m_flag_invalid_part = 1; + ms_dbg_a(m_transaction, 3, "Multipart: Invalid part (data contains boundary)"); - /* Is this the final boundary? */ - if ((*boundary_end == '-') - && (*(boundary_end + 1)== '-')) { - is_final = 1; - boundary_end += 2; + } else { + char *boundary_end = m_buf + 2 + m_boundary.size(); + /* if it match, AND there was a matched boundary at least, + set the m_flag_unmatched_boundary flag to 2 + this indicates that there were an opened boundary, which + matches the reference, and here is the final boundary. + The flag will differ from 0, so the previous rules ("!@eq 0") + will catch all "errors", without any modification, but we can + use the new, permission mode with "@eq 1" + */ + if (m_boundary_count > 0) { + m_flag_unmatched_boundary = 2; + } + int is_final = 0; - if (m_is_complete != 0) { + /* Is this the final boundary? */ + if ((*boundary_end == '-') + && (*(boundary_end + 1)== '-')) { + is_final = 1; + boundary_end += 2; + + if (m_is_complete != 0) { + m_flag_error = 1; + ms_dbg_a(m_transaction, 4, + "Multipart: Invalid boundary " \ + "(final duplicate)."); + + error->assign("Multipart: Invalid boundary " \ + "(final duplicate)."); + return false; + } + } + + /* Allow for CRLF and LF line endings. */ + if (((*boundary_end == '\r') + && (*(boundary_end + 1) == '\n') + && (*(boundary_end + 2) == '\0')) + || ((*boundary_end == '\n') + && (*(boundary_end + 1) == '\0'))) { + if (*boundary_end == '\n') { + m_flag_lf_line = 1; + } else { + m_flag_crlf_line = 1; + } + + if (process_boundary((is_final ? 1 : 0)) < 0) { + m_flag_error = true; + return false; + } + + if (is_final) { + m_is_complete = 1; + } + + processed_as_boundary = 1; + m_boundary_count++; + } else { + /* error */ m_flag_error = 1; ms_dbg_a(m_transaction, 4, - "Multipart: Invalid boundary " \ - "(final duplicate)."); - - error->assign("Multipart: Invalid boundary " \ - "(final duplicate)."); + "Multipart: Invalid boundary: " \ + + std::string(m_buf)); + error->assign("Multipart: Invalid boundary: " \ + + std::string(m_buf)); return false; } } - - /* Allow for CRLF and LF line endings. */ - if (((*boundary_end == '\r') - && (*(boundary_end + 1) == '\n') - && (*(boundary_end + 2) == '\0')) - || ((*boundary_end == '\n') - && (*(boundary_end + 1) == '\0'))) { - if (*boundary_end == '\n') { - m_flag_lf_line = 1; - } else { - m_flag_crlf_line = 1; - } - - if (process_boundary((is_final ? 1 : 0)) < 0) { - m_flag_error = true; - return false; - } - - if (is_final) { - m_is_complete = 1; - } - - processed_as_boundary = 1; - m_boundary_count++; - } else { - /* error */ - m_flag_error = 1; - ms_dbg_a(m_transaction, 4, - "Multipart: Invalid boundary: " \ - + std::string(m_buf)); - error->assign("Multipart: Invalid boundary: " \ - + std::string(m_buf)); - return false; - } } else { /* It looks like a boundary but */ /* we couldn't match it. */ char *p = NULL; @@ -1592,8 +1741,25 @@ bool Multipart::process(const std::string& data, std::string *error, m_bufptr = m_buf; m_bufleft = MULTIPART_BUF_SIZE; m_buf_contains_line = (c == 0x0a) ? 1 : 0; + + if (c == 0x0a) { + if (m_crlf_state == 1) { + m_crlf_state = 3; + } else { + m_crlf_state = 2; + } + } + m_crlf_state_buf_end = m_crlf_state; + } + if (c == 0x0d) { + m_crlf_state = 1; + } else if (c != 0x0a) { + m_crlf_state = 0; + } + + if ((m_is_complete) && (inleft != 0)) { m_flag_data_after = 1; ms_dbg_a(m_transaction, 4, diff --git a/src/deps/src/ModSecurity/src/request_body_processor/multipart.h b/src/deps/src/ModSecurity/src/request_body_processor/multipart.h index 896d11b72..bfada4b97 100644 --- a/src/deps/src/ModSecurity/src/request_body_processor/multipart.h +++ b/src/deps/src/ModSecurity/src/request_body_processor/multipart.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -54,15 +54,53 @@ struct MyEqual { }; +class MultipartPartTmpFile { + public: + explicit MultipartPartTmpFile(Transaction *transaction) + : m_transaction(transaction), + m_tmp_file_fd(0), + m_delete(false) + { } + + ~MultipartPartTmpFile(); + + // forbid copying + MultipartPartTmpFile(const MultipartPartTmpFile&) = delete; + MultipartPartTmpFile& operator=(const MultipartPartTmpFile&) = delete; + + int getFd() const {return m_tmp_file_fd;} + void setFd(int fd) {m_tmp_file_fd = fd;} + const std::string& getFilename() const {return m_tmp_file_name;} + void setDelete() {m_delete = true;} + + bool isValid() const {return ((m_tmp_file_fd != 0) && (!m_tmp_file_name.empty()));} + + void Open(); + void Close(); + + private: + Transaction *m_transaction; + int m_tmp_file_fd; + std::string m_tmp_file_name; + bool m_delete; // whether to delete when transaction is done +}; + + class MultipartPart { public: MultipartPart() : m_type(MULTIPART_FORMDATA), - m_tmp_file_fd(0), - m_offset(0), - m_filenameOffset(0), + m_name(""), m_nameOffset(0), + m_value(""), m_valueOffset(0), + m_value_parts(), + m_tmp_file_size(), + m_filename(""), + m_filenameOffset(0), + m_last_header_name(""), + m_headers(), + m_offset(0), m_length(0) { m_tmp_file_size.first = 0; m_tmp_file_size.second = 0; @@ -90,8 +128,7 @@ class MultipartPart { /* std::string m_content_type; */ /* files only, the name of the temporary file holding data */ - std::string m_tmp_file_name; - int m_tmp_file_fd; + std::shared_ptr m_tmp_file; std::pair m_tmp_file_size; /* files only, filename as supplied by the browser */ @@ -101,6 +138,9 @@ class MultipartPart { std::string m_last_header_name; std::unordered_map, MyHash, MyEqual> m_headers; + std::string m_last_header_line; + std::vector> m_header_lines; + unsigned int m_offset; unsigned int m_length; @@ -109,14 +149,14 @@ class MultipartPart { class Multipart { public: - Multipart(std::string header, Transaction *transaction); + Multipart(const std::string &header, Transaction *transaction); ~Multipart(); bool init(std::string *err); - int boundary_characters_valid(const char *boundary); - int count_boundary_params(const std::string& str_header_value); - int is_token_char(unsigned char c); + static int boundary_characters_valid(const char *boundary); + static int count_boundary_params(const std::string& str_header_value); + static int is_token_char(unsigned char c); int multipart_complete(std::string *err); int parse_content_disposition(const char *c_d_value, int offset); @@ -125,9 +165,7 @@ class Multipart { int process_part_header(std::string *error, int offset); int process_part_data(std::string *error, size_t offset); - int tmp_file_name(std::string *filename) const; - - void validate_quotes(const char *data); + void validate_quotes(const char *data, char quote); size_t m_reqbody_no_files_length; std::list m_parts; @@ -151,6 +189,15 @@ class Multipart { unsigned int m_buf_offset; + /* line ending status seen immediately before current position. + * 0 = neither LF nor CR; 1 = prev char CR; 2 = prev char LF alone; + * 3 = prev two chars were CRLF + */ + int m_crlf_state; + + /* crlf_state at end of previous buffer */ + int m_crlf_state_buf_end; + /* pointer that keeps track of a part while * it is being built */ @@ -162,6 +209,14 @@ class Multipart { */ int m_mpp_state; + /* part parsing substate; if mpp_state is 1 (collecting + * data), then for this variable: + * 0 means we have not yet read any data between the + * post-headers blank line and the next boundary + * 1 means we have read at some data after that blank line + */ + int m_mpp_substate_part_data_read; + /* because of the way this parsing algorithm * works we hold back the last two bytes of * each data chunk so that we can discard it diff --git a/src/deps/src/ModSecurity/src/request_body_processor/xml.cc b/src/deps/src/ModSecurity/src/request_body_processor/xml.cc index 9483a0f49..6d8a5ec13 100644 --- a/src/deps/src/ModSecurity/src/request_body_processor/xml.cc +++ b/src/deps/src/ModSecurity/src/request_body_processor/xml.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -46,13 +46,13 @@ XML::~XML() { bool XML::init() { - xmlParserInputBufferCreateFilenameFunc entity; + //xmlParserInputBufferCreateFilenameFunc entity; if (m_transaction->m_rules->m_secXMLExternalEntity - == RulesProperties::TrueConfigBoolean) { - entity = xmlParserInputBufferCreateFilenameDefault( + == RulesSetProperties::TrueConfigBoolean) { + /*entity = */xmlParserInputBufferCreateFilenameDefault( __xmlParserInputBufferCreateFilename); } else { - entity = xmlParserInputBufferCreateFilenameDefault( + /*entity = */xmlParserInputBufferCreateFilenameDefault( this->unloadExternalEntity); } diff --git a/src/deps/src/ModSecurity/src/request_body_processor/xml.h b/src/deps/src/ModSecurity/src/request_body_processor/xml.h index 78d8355dd..1d29f62fe 100644 --- a/src/deps/src/ModSecurity/src/request_body_processor/xml.h +++ b/src/deps/src/ModSecurity/src/request_body_processor/xml.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -22,7 +22,7 @@ #include #include "modsecurity/transaction.h" -#include "modsecurity/rules.h" +#include "modsecurity/rules_set.h" #ifndef SRC_REQUEST_BODY_PROCESSOR_XML_H_ #define SRC_REQUEST_BODY_PROCESSOR_XML_H_ diff --git a/src/deps/src/ModSecurity/src/rule.cc b/src/deps/src/ModSecurity/src/rule.cc index 0b97d428f..28f9b3b7d 100644 --- a/src/deps/src/ModSecurity/src/rule.cc +++ b/src/deps/src/ModSecurity/src/rule.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,13 +25,13 @@ #include #include +#include "modsecurity/rules_set.h" #include "src/operators/operator.h" #include "modsecurity/actions/action.h" #include "modsecurity/modsecurity.h" #include "src/actions/transformations/none.h" #include "src/actions/tag.h" #include "src/utils/string.h" -#include "modsecurity/rules.h" #include "modsecurity/rule_message.h" #include "src/actions/msg.h" #include "src/actions/log_data.h" @@ -41,831 +41,3 @@ #include "src/actions/set_var.h" #include "src/actions/block.h" #include "src/variables/variable.h" - - -namespace modsecurity { - -using operators::Operator; -using actions::Action; -using variables::Variable; -using actions::transformations::None; - - -Rule::Rule(std::string marker) - : m_accuracy(0), - m_actionsRuntimePos(), - m_actionsRuntimePre(), - m_actionsSetVar(), - m_actionsTag(), - m_chained(false), - m_chainedRuleChild(NULL), - m_fileName(""), - m_lineNumber(0), - m_marker(marker), - m_maturity(0), - m_op(NULL), - m_phase(-1), - m_rev(""), - m_ruleId(0), - m_secMarker(true), - m_variables(NULL), - m_ver(""), - m_unconditional(false), - m_referenceCount(1), - m_theDisruptiveAction(nullptr), - m_containsStaticBlockAction(false), - m_containsCaptureAction(false), - m_containsMultiMatchAction(false), - m_severity(nullptr), - m_logData(nullptr), - m_msg(nullptr) { } - - -Rule::Rule(Operator *_op, - variables::Variables *_variables, - std::vector *actions, - std::string fileName, - int lineNumber) - : m_accuracy(0), - m_actionsRuntimePos(), - m_actionsRuntimePre(), - m_actionsSetVar(), - m_actionsTag(), - m_chained(false), - m_chainedRuleChild(NULL), - m_chainedRuleParent(NULL), - m_fileName(fileName), - m_lineNumber(lineNumber), - m_marker(""), - m_maturity(0), - m_op(_op), - m_phase(-1), - m_rev(""), - m_ruleId(0), - m_secMarker(false), - m_variables(_variables), - m_ver(""), - m_unconditional(false), - m_referenceCount(1), - m_theDisruptiveAction(nullptr), - m_containsStaticBlockAction(false), - m_containsCaptureAction(false), - m_containsMultiMatchAction(false), - m_severity(nullptr), - m_logData(nullptr), - m_msg(nullptr) { - /* */ - organizeActions(actions); - - /** - * If phase is not entered, we assume phase 2. For historical reasons. - * - */ - if (m_phase == -1) { - m_phase = modsecurity::Phases::RequestHeadersPhase; - } - - m_unconditional = (m_op == NULL); - - delete actions; -} - - -Rule::~Rule() { - if (m_op != NULL) { - delete m_op; - } - - cleanUpActions(); - - while (m_variables != NULL && m_variables->empty() == false) { - auto *a = m_variables->back(); - m_variables->pop_back(); - delete a; - } - - if (m_variables != NULL) { - delete m_variables; - } - - if (m_chainedRuleChild != NULL) { - delete m_chainedRuleChild; - } -} - - -void Rule::organizeActions(std::vector *actions) { - if (!actions) { - return; - } - for (Action *a : *actions) { - if (a->action_kind == Action::ConfigurationKind) { - a->evaluate(this, NULL); - delete a; - } else if (a->action_kind == Action::RunTimeBeforeMatchAttemptKind) { - m_actionsRuntimePre.push_back(a); - } else if (a->action_kind == Action::RunTimeOnlyIfMatchKind) { - if (dynamic_cast(a)) { - m_containsCaptureAction = true; - delete a; - } else if (dynamic_cast(a)) { - m_containsMultiMatchAction = true; - delete a; - } else if (dynamic_cast(a)) { - m_severity = dynamic_cast(a); - } else if (dynamic_cast(a)) { - m_logData = dynamic_cast(a); - } else if (dynamic_cast(a)) { - m_msg = dynamic_cast(a); - } else if (dynamic_cast(a)) { - m_actionsSetVar.push_back( - dynamic_cast(a)); - } else if (dynamic_cast(a)) { - m_actionsTag.push_back(dynamic_cast(a)); - } else if (dynamic_cast(a)) { - m_actionsRuntimePos.push_back(a); - m_containsStaticBlockAction = true; - } else if (a->isDisruptive() == true) { - if (m_theDisruptiveAction != nullptr) { - delete m_theDisruptiveAction; - m_theDisruptiveAction = nullptr; - } - m_theDisruptiveAction = a; - } else { - m_actionsRuntimePos.push_back(a); - } - } else { - std::cout << "General failure, action: " << a->m_name; - std::cout << " has an unknown type." << std::endl; - delete a; - } - } -} - - -void Rule::cleanUpActions() { - if (m_severity) { - delete m_severity; - m_severity = nullptr; - } - if (m_logData) { - delete m_logData; - m_logData = nullptr; - } - if (m_msg) { - delete m_msg; - m_msg = nullptr; - } - while (m_actionsRuntimePre.empty() == false) { - auto *a = m_actionsRuntimePre.back(); - m_actionsRuntimePre.pop_back(); - delete a; - } - while (m_actionsRuntimePos.empty() == false) { - auto *a = m_actionsRuntimePos.back(); - m_actionsRuntimePos.pop_back(); - delete a; - } - while (m_actionsSetVar.empty() == false) { - auto *a = m_actionsSetVar.back(); - m_actionsSetVar.pop_back(); - delete a; - } - while (m_actionsTag.empty() == false) { - auto *a = m_actionsTag.back(); - m_actionsTag.pop_back(); - delete a; - } - if (m_theDisruptiveAction != nullptr) { - delete m_theDisruptiveAction; - m_theDisruptiveAction = nullptr; - } -} - - -inline void Rule::updateMatchedVars(Transaction *trans, const std::string &key, - const std::string &value) { - ms_dbg_a(trans, 9, "Matched vars updated."); - trans->m_variableMatchedVar.set(value, trans->m_variableOffset); - trans->m_variableMatchedVarName.set(key, trans->m_variableOffset); - - trans->m_variableMatchedVars.set(key, value, trans->m_variableOffset); - trans->m_variableMatchedVarsNames.set(key, key, trans->m_variableOffset); -} - - -inline void Rule::cleanMatchedVars(Transaction *trans) { - ms_dbg_a(trans, 9, "Matched vars cleaned."); - trans->m_variableMatchedVar.unset(); - trans->m_variableMatchedVars.unset(); - trans->m_variableMatchedVarName.unset(); - trans->m_variableMatchedVarsNames.unset(); -} - - -void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trans, - bool *containsBlock, std::shared_ptr ruleMessage) { - - for (actions::SetVar *a : m_actionsSetVar) { - ms_dbg_a(trans, 4, "Running [independent] (non-disruptive) " \ - "action: " + a->m_name); - - a->evaluate(this, trans); - } - - for (auto &b : - trans->m_rules->m_exceptions.m_action_pre_update_target_by_id) { - if (m_ruleId != b.first) { - continue; - } - actions::Action *a = dynamic_cast(b.second.get()); - if (a->isDisruptive() == true && a->m_name == "block") { - ms_dbg_a(trans, 9, "Rule contains a `block' action"); - *containsBlock = true; - } else if (a->m_name == "setvar") { - ms_dbg_a(trans, 4, "Running [independent] (non-disruptive) " \ - "action: " + a->m_name); - a->evaluate(this, trans, ruleMessage); - } - } - - if (m_severity) { - m_severity->evaluate(this, trans, ruleMessage); - } - - if (m_logData) { - m_logData->evaluate(this, trans, ruleMessage); - } - - if (m_msg) { - m_msg->evaluate(this, trans, ruleMessage); - } -} - - -bool Rule::executeOperatorAt(Transaction *trans, std::string key, - std::string value, std::shared_ptr ruleMessage) { -#if MSC_EXEC_CLOCK_ENABLED - clock_t begin = clock(); - clock_t end; - double elapsed_s = 0; -#endif - bool ret; - - ms_dbg_a(trans, 9, "Target value: \"" + utils::string::limitTo(80, - utils::string::toHexIfNeeded(value)) \ - + "\" (Variable: " + key + ")"); - - ret = this->m_op->evaluateInternal(trans, this, value, ruleMessage); - if (ret == false) { - return false; - } - -#if MSC_EXEC_CLOCK_ENABLED - end = clock(); - elapsed_s = static_cast(end - begin) / CLOCKS_PER_SEC; - - ms_dbg_a(trans, 5, "Operator completed in " + \ - std::to_string(elapsed_s) + " seconds"); -#endif - return ret; -} - - -inline void Rule::executeTransformation(actions::Action *a, - std::shared_ptr *value, - Transaction *trans, - std::list, - std::shared_ptr>> *ret, - std::string *path, - int *nth) { - - std::string *oldValue = (*value).get(); - std::string newValue = a->evaluate(*oldValue, trans); - - if (newValue != *oldValue) { - std::shared_ptr u(new std::string(newValue)); - if (m_containsMultiMatchAction) { - std::shared_ptr t(new std::string(a->m_name)); - ret->push_back(std::make_pair(u, t)); - (*nth)++; - } - *value = u; - } - - if (path->empty()) { - path->append(a->m_name); - } else { - path->append("," + a->m_name); - } - - ms_dbg_a(trans, 9, " T (" + \ - std::to_string(*nth) + ") " + \ - a->m_name + ": \"" + \ - utils::string::limitTo(80, newValue) +"\""); -} - - -std::list, - std::shared_ptr>> - Rule::executeDefaultTransformations( - Transaction *trans, const std::string &in) { - int none = 0; - int transformations = 0; - std::string path(""); - std::list, - std::shared_ptr>> ret; - std::shared_ptr value = - std::shared_ptr(new std::string(in)); - - if (m_containsMultiMatchAction == true) { - /* keep the original value */ - ret.push_back(std::make_pair( - std::shared_ptr(new std::string(*value)), - std::shared_ptr(new std::string(path)))); - } - - for (Action *a : this->m_actionsRuntimePre) { - if (a->m_isNone) { - none++; - } - } - - // Check for transformations on the SecDefaultAction - // Notice that first we make sure that won't be a t:none - // on the target rule. - if (none == 0) { - for (Action *a : trans->m_rules->m_defaultActions[this->m_phase]) { - if (a->action_kind \ - != actions::Action::RunTimeBeforeMatchAttemptKind) { - continue; - } - - executeTransformation(a, &value, trans, &ret, &path, - &transformations); - } - } - - for (Action *a : this->m_actionsRuntimePre) { - if (none == 0) { - executeTransformation(a, &value, trans, &ret, &path, - &transformations); - } - if (a->m_isNone) { - none--; - } - } - - for (auto &b : - trans->m_rules->m_exceptions.m_action_pre_update_target_by_id) { - if (m_ruleId != b.first) { - continue; - } - actions::Action *a = dynamic_cast(b.second.get()); - if (a->m_isNone) { - none++; - } - } - - for (auto &b : - trans->m_rules->m_exceptions.m_action_pre_update_target_by_id) { - if (m_ruleId != b.first) { - continue; - } - actions::Action *a = dynamic_cast(b.second.get()); - if (none == 0) { - executeTransformation(a, &value, trans, &ret, &path, - &transformations); - } - if (a->m_isNone) { - none--; - } - } - - if (m_containsMultiMatchAction == true) { - ms_dbg_a(trans, 9, "multiMatch is enabled. " \ - + std::to_string(ret.size()) + \ - " values to be tested."); - } - - if (!m_containsMultiMatchAction) { - ret.push_back(std::make_pair( - std::shared_ptr(new std::string(*value)), - std::shared_ptr(new std::string(path)))); - } - - return ret; -} - - -void Rule::getVariablesExceptions(Transaction *t, - variables::Variables *exclusion, variables::Variables *addition) { - for (auto &a : t->m_rules->m_exceptions.m_variable_update_target_by_tag) { - if (containsTag(*a.first.get(), t) == false) { - continue; - } - Variable *b = a.second.get(); - if (dynamic_cast(b)) { - exclusion->push_back( - dynamic_cast( - b)->m_base.get()); - } else { - addition->push_back(b); - } - } - - for (auto &a : t->m_rules->m_exceptions.m_variable_update_target_by_msg) { - if (containsMsg(*a.first.get(), t) == false) { - continue; - } - Variable *b = a.second.get(); - if (dynamic_cast(b)) { - exclusion->push_back( - dynamic_cast( - b)->m_base.get()); - } else { - addition->push_back(b); - } - } - - for (auto &a : t->m_rules->m_exceptions.m_variable_update_target_by_id) { - if (m_ruleId != a.first) { - continue; - } - Variable *b = a.second.get(); - if (dynamic_cast(b)) { - exclusion->push_back( - dynamic_cast( - b)->m_base.get()); - } else { - addition->push_back(b); - } - } -} - - -inline void Rule::getFinalVars(variables::Variables *vars, - variables::Variables *exclusion, Transaction *trans) { - variables::Variables addition; - - getVariablesExceptions(trans, exclusion, &addition); - - for (int i = 0; i < m_variables->size(); i++) { - Variable *variable = m_variables->at(i); - std::vector e; - - - if (exclusion->contains(variable)) { - continue; - } - if (std::find_if(trans->m_ruleRemoveTargetById.begin(), - trans->m_ruleRemoveTargetById.end(), - [&, variable, this](std::pair &m) -> bool { - return m.first == m_ruleId - && m.second == *variable->m_fullName.get(); - }) != trans->m_ruleRemoveTargetById.end()) { - continue; - } - if (std::find_if(trans->m_ruleRemoveTargetByTag.begin(), - trans->m_ruleRemoveTargetByTag.end(), - [&, variable, trans, this]( - std::pair &m) -> bool { - return containsTag(m.first, trans) - && m.second == *variable->m_fullName.get(); - }) != trans->m_ruleRemoveTargetByTag.end()) { - continue; - } - vars->push_back(variable); - } - - for (int i = 0; i < addition.size(); i++) { - Variable *variable = addition.at(i); - vars->push_back(variable); - } -} - - - -void Rule::executeAction(Transaction *trans, - bool containsBlock, std::shared_ptr ruleMessage, - Action *a, bool defaultContext) { - if (a->isDisruptive() == false && a->m_name != "block") { - ms_dbg_a(trans, 9, "Running " \ - "action: " + a->m_name); - a->evaluate(this, trans, ruleMessage); - return; - } - - if (defaultContext && !containsBlock) { - ms_dbg_a(trans, 4, "Ignoring action: " + a->m_name + \ - " (rule does not cotains block)"); - return; - } - - if (trans->getRuleEngineState() == Rules::EnabledRuleEngine) { - ms_dbg_a(trans, 4, "Running (disruptive) action: " + a->m_name + \ - "."); - a->evaluate(this, trans, ruleMessage); - return; - } - - ms_dbg_a(trans, 4, "Not running any disruptive action (or block): " \ - + a->m_name + ". SecRuleEngine is not On."); -} - - - -void Rule::executeActionsAfterFullMatch(Transaction *trans, - bool containsBlock, std::shared_ptr ruleMessage) { - bool disruptiveAlreadyExecuted = false; - - for (Action *a : trans->m_rules->m_defaultActions[this->m_phase]) { - if (a->action_kind != actions::Action::RunTimeOnlyIfMatchKind) { - continue; - } - if (!a->isDisruptive()) { - executeAction(trans, containsBlock, ruleMessage, a, true); - } - } - - for (actions::Tag *a : this->m_actionsTag) { - ms_dbg_a(trans, 4, "Running (non-disruptive) action: " \ - + a->m_name); - a->evaluate(this, trans, ruleMessage); - } - - for (auto &b : - trans->m_rules->m_exceptions.m_action_pos_update_target_by_id) { - if (m_ruleId != b.first) { - continue; - } - actions::Action *a = dynamic_cast(b.second.get()); - executeAction(trans, containsBlock, ruleMessage, a, false); - disruptiveAlreadyExecuted = true; - } - for (Action *a : this->m_actionsRuntimePos) { - if (!a->isDisruptive() - && !(disruptiveAlreadyExecuted - && dynamic_cast(a))) { - executeAction(trans, containsBlock, ruleMessage, a, false); - } - } - if (!disruptiveAlreadyExecuted && m_theDisruptiveAction != nullptr) { - executeAction(trans, containsBlock, ruleMessage, - m_theDisruptiveAction, false); - } -} - - -bool Rule::evaluate(Transaction *trans, - std::shared_ptr ruleMessage) { - bool globalRet = false; - variables::Variables *variables = this->m_variables; - bool recursiveGlobalRet; - bool containsBlock = m_containsStaticBlockAction; - std::vector> finalVars; - std::string eparam; - variables::Variables vars; - vars.reserve(4); - variables::Variables exclusion; - - if (ruleMessage == NULL) { - ruleMessage = std::shared_ptr( - new RuleMessage(this, trans)); - } - - trans->m_matched.clear(); - - if (m_secMarker == true) { - return true; - } - - if (m_unconditional == true) { - ms_dbg_a(trans, 4, "(Rule: " + std::to_string(m_ruleId) \ - + ") Executing unconditional rule..."); - executeActionsIndependentOfChainedRuleResult(trans, - &containsBlock, ruleMessage); - goto end_exec; - } - - for (auto &i : trans->m_ruleRemoveById) { - if (m_ruleId != i) { - continue; - } - ms_dbg_a(trans, 9, "Rule id: " + std::to_string(m_ruleId) + - " was skipped due to a ruleRemoveById action..."); - return true; - } - for (auto &i : trans->m_ruleRemoveByIdRange) { - if (!(i.first <= m_ruleId && i.second >= m_ruleId)) { - continue; - } - ms_dbg_a(trans, 9, "Rule id: " + std::to_string(m_ruleId) + - " was skipped due to a ruleRemoveById action..."); - return true; - } - - if (m_op->m_string) { - eparam = m_op->m_string->evaluate(trans); - - if (m_op->m_string->containsMacro()) { - eparam = "\"" + eparam + "\" Was: \"" \ - + m_op->m_string->evaluate(NULL) + "\""; - } else { - eparam = "\"" + eparam + "\""; - } - ms_dbg_a(trans, 4, "(Rule: " + std::to_string(m_ruleId) \ - + ") Executing operator \"" + this->m_op->m_op \ - + "\" with param " \ - + eparam \ - + " against " \ - + variables + "."); - } else { - ms_dbg_a(trans, 4, "(Rule: " + std::to_string(m_ruleId) \ - + ") Executing operator \"" + this->m_op->m_op \ - + " against " \ - + variables + "."); - } - - getFinalVars(&vars, &exclusion, trans); - - for (auto &var : vars) { - std::vector e; - if (!var) { - continue; - } - var->evaluate(trans, this, &e); - for (const VariableValue *v : e) { - const std::string &value = v->getValue(); - const std::string &key = v->getKeyWithCollection(); - - if (exclusion.contains(v->getKey()) || - std::find_if(trans->m_ruleRemoveTargetById.begin(), - trans->m_ruleRemoveTargetById.end(), - [&, v, this](std::pair &m) -> bool { - return m.first == m_ruleId && m.second == v->getKeyWithCollection(); - }) != trans->m_ruleRemoveTargetById.end() - ) { - delete v; - v = NULL; - continue; - } - if (exclusion.contains(v->getKey()) || - std::find_if(trans->m_ruleRemoveTargetByTag.begin(), - trans->m_ruleRemoveTargetByTag.end(), - [&, v, trans, this](std::pair &m) -> bool { - return containsTag(m.first, trans) && m.second == v->getKeyWithCollection(); - }) != trans->m_ruleRemoveTargetByTag.end() - ) { - delete v; - v = NULL; - continue; - } - - std::list, - std::shared_ptr>> values; - - values = executeDefaultTransformations(trans, value); - - for (const auto &valueTemp : values) { - bool ret; - std::string valueAfterTrans = std::move(*valueTemp.first); - - ret = executeOperatorAt(trans, key, valueAfterTrans, ruleMessage); - - if (ret == true) { - ruleMessage->m_match = m_op->resolveMatchMessage(trans, - key, value); - for (auto &i : v->getOrigin()) { - ruleMessage->m_reference.append(i->toText()); - } - - ruleMessage->m_reference.append(*valueTemp.second); - updateMatchedVars(trans, key, valueAfterTrans); - executeActionsIndependentOfChainedRuleResult(trans, - &containsBlock, ruleMessage); - - bool isItToBeLogged = ruleMessage->m_saveMessage; - if (m_containsMultiMatchAction && isItToBeLogged) { - /* warn */ - trans->m_rulesMessages.push_back(*ruleMessage); - - /* error */ - if (!ruleMessage->m_isDisruptive) { - trans->serverLog(ruleMessage); - } - - RuleMessage *rm = new RuleMessage(this, trans); - rm->m_saveMessage = ruleMessage->m_saveMessage; - ruleMessage.reset(rm); - } - - globalRet = true; - } - } - delete v; - v = NULL; - } - e.clear(); - e.reserve(4); - } - - if (globalRet == false) { - ms_dbg_a(trans, 4, "Rule returned 0."); - cleanMatchedVars(trans); - goto end_clean; - } - ms_dbg_a(trans, 4, "Rule returned 1."); - - if (this->m_chained == false) { - goto end_exec; - } - - if (this->m_chainedRuleChild == NULL) { - ms_dbg_a(trans, 4, "Rule is marked as chained but there " \ - "isn't a subsequent rule."); - goto end_clean; - } - - ms_dbg_a(trans, 4, "Executing chained rule."); - recursiveGlobalRet = this->m_chainedRuleChild->evaluate(trans, ruleMessage); - - if (recursiveGlobalRet == true) { - goto end_exec; - } - -end_clean: - return false; - -end_exec: - executeActionsAfterFullMatch(trans, containsBlock, ruleMessage); - - /* last rule in the chain. */ - bool isItToBeLogged = (ruleMessage->m_saveMessage && (m_chainedRuleParent == nullptr)); - if (isItToBeLogged && !m_containsMultiMatchAction) { - /* warn */ - trans->m_rulesMessages.push_back(*ruleMessage); - - /* error */ - if (!ruleMessage->m_isDisruptive) { - trans->serverLog(ruleMessage); - } - } - - return true; -} - - -std::vector Rule::getActionsByName(const std::string& name, - Transaction *trans) { - std::vector ret; - for (auto &z : m_actionsRuntimePos) { - if (z->m_name == name) { - ret.push_back(z); - } - } - for (auto &z : m_actionsRuntimePre) { - if (z->m_name == name) { - ret.push_back(z); - } - } - for (auto &b : - trans->m_rules->m_exceptions.m_action_pre_update_target_by_id) { - if (m_ruleId != b.first) { - continue; - } - actions::Action *z = dynamic_cast(b.second.get()); - if (z->m_name == name) { - ret.push_back(z); - } - } - for (auto &b : - trans->m_rules->m_exceptions.m_action_pos_update_target_by_id) { - if (m_ruleId != b.first) { - continue; - } - actions::Action *z = dynamic_cast(b.second.get()); - if (z->m_name == name) { - ret.push_back(z); - } - } - return ret; -} - - -bool Rule::containsTag(const std::string& name, Transaction *t) { - for (auto &tag : m_actionsTag) { - if (tag != NULL && tag->getName(t) == name) { - return true; - } - } - return false; -} - - -bool Rule::containsMsg(const std::string& name, Transaction *t) { - return m_msg && m_msg->data(t) == name; -} - - -} // namespace modsecurity diff --git a/src/deps/src/ModSecurity/src/rule_message.cc b/src/deps/src/ModSecurity/src/rule_message.cc index 8a3630874..eb6795548 100644 --- a/src/deps/src/ModSecurity/src/rule_message.cc +++ b/src/deps/src/ModSecurity/src/rule_message.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,10 +13,9 @@ * */ -#include "modsecurity/rules.h" - #include "modsecurity/rule_message.h" +#include "modsecurity/rules_set.h" #include "modsecurity/modsecurity.h" #include "modsecurity/transaction.h" #include "src/utils/string.h" @@ -27,7 +26,7 @@ namespace modsecurity { std::string RuleMessage::_details(const RuleMessage *rm) { std::string msg; - msg.append(" [file \"" + std::string(rm->m_ruleFile) + "\"]"); + msg.append(" [file \"" + std::string(*rm->m_ruleFile.get()) + "\"]"); msg.append(" [line \"" + std::to_string(rm->m_ruleLine) + "\"]"); msg.append(" [id \"" + std::to_string(rm->m_ruleId) + "\"]"); msg.append(" [rev \"" + rm->m_rev + "\"]"); @@ -38,13 +37,15 @@ std::string RuleMessage::_details(const RuleMessage *rm) { msg.append(" [ver \"" + rm->m_ver + "\"]"); msg.append(" [maturity \"" + std::to_string(rm->m_maturity) + "\"]"); msg.append(" [accuracy \"" + std::to_string(rm->m_accuracy) + "\"]"); + for (auto &a : rm->m_tags) { msg.append(" [tag \"" + a + "\"]"); } - msg.append(" [hostname \"" + std::string(rm->m_serverIpAddress) \ + + msg.append(" [hostname \"" + *rm->m_serverIpAddress.get() \ + "\"]"); - msg.append(" [uri \"" + utils::string::limitTo(200, rm->m_uriNoQueryStringDecoded) + "\"]"); - msg.append(" [unique_id \"" + rm->m_id + "\"]"); + msg.append(" [uri \"" + utils::string::limitTo(200, *rm->m_uriNoQueryStringDecoded.get()) + "\"]"); + msg.append(" [unique_id \"" + *rm->m_id + "\"]"); msg.append(" [ref \"" + utils::string::limitTo(200, rm->m_reference) + "\"]"); return msg; @@ -54,9 +55,9 @@ std::string RuleMessage::_details(const RuleMessage *rm) { std::string RuleMessage::_errorLogTail(const RuleMessage *rm) { std::string msg; - msg.append("[hostname \"" + std::string(rm->m_serverIpAddress) + "\"]"); - msg.append(" [uri \"" + utils::string::limitTo(200, rm->m_uriNoQueryStringDecoded) + "\"]"); - msg.append(" [unique_id \"" + rm->m_id + "\"]"); + msg.append("[hostname \"" + *rm->m_serverIpAddress.get() + "\"]"); + msg.append(" [uri \"" + utils::string::limitTo(200, *rm->m_uriNoQueryStringDecoded.get()) + "\"]"); + msg.append(" [unique_id \"" + *rm->m_id + "\"]"); return msg; } @@ -64,9 +65,10 @@ std::string RuleMessage::_errorLogTail(const RuleMessage *rm) { std::string RuleMessage::log(const RuleMessage *rm, int props, int code) { std::string msg(""); + msg.reserve(2048); if (props & ClientLogMessageInfo) { - msg.append("[client " + std::string(rm->m_clientIpAddress) + "] "); + msg.append("[client " + std::string(*rm->m_clientIpAddress.get()) + "] "); } if (rm->m_isDisruptive) { @@ -77,7 +79,7 @@ std::string RuleMessage::log(const RuleMessage *rm, int props, int code) { msg.append(std::to_string(code)); } msg.append(" (phase "); - msg.append(std::to_string(rm->m_rule->m_phase - 1) + "). "); + msg.append(std::to_string(rm->m_rule->getPhase() - 1) + "). "); } else { msg.append("ModSecurity: Warning. "); } diff --git a/src/deps/src/ModSecurity/src/rule_script.cc b/src/deps/src/ModSecurity/src/rule_script.cc index 032053225..c74497d3f 100644 --- a/src/deps/src/ModSecurity/src/rule_script.cc +++ b/src/deps/src/ModSecurity/src/rule_script.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -24,19 +24,16 @@ bool RuleScript::init(std::string *err) { bool RuleScript::evaluate(Transaction *trans, std::shared_ptr ruleMessage) { + ms_dbg_a(trans, 4, " Executing script: " + m_name + "."); bool containsDisruptive = false; - if (ruleMessage == NULL) { - ruleMessage = std::shared_ptr( - new RuleMessage(this, trans)); - } - executeActionsIndependentOfChainedRuleResult(trans, &containsDisruptive, ruleMessage); bool ret = m_lua.run(trans); + if (ret) { executeActionsAfterFullMatch(trans, containsDisruptive, ruleMessage); } diff --git a/src/deps/src/ModSecurity/src/rule_script.h b/src/deps/src/ModSecurity/src/rule_script.h index 9b4466320..237ad6ab8 100644 --- a/src/deps/src/ModSecurity/src/rule_script.h +++ b/src/deps/src/ModSecurity/src/rule_script.h @@ -1,7 +1,7 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,6 +18,7 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/rule.h" #include "src/engine/lua.h" #include "src/operators/operator.h" @@ -26,7 +27,6 @@ #include "src/actions/transformations/none.h" #include "src/actions/tag.h" #include "src/utils/string.h" -#include "modsecurity/rules.h" #include "modsecurity/rule_message.h" #include "src/actions/msg.h" #include "src/actions/log_data.h" @@ -42,14 +42,18 @@ namespace modsecurity { using actions::Action; /** @ingroup ModSecurity_CPP_API */ -class RuleScript : public Rule { +class RuleScript : public RuleWithActions { public: - RuleScript(std::string name, + RuleScript(const std::string &name, std::vector *actions, - std::string fileName, + Transformations *t, + std::unique_ptr fileName, int lineNumber) - : Rule(NULL, NULL, actions, fileName, lineNumber), - m_name(name) { } + : RuleWithActions(actions, t, std::move(fileName), lineNumber), + m_name(name), + m_lua() { } + + RuleScript(const RuleWithActions& r) = delete; bool init(std::string *err); bool evaluate(Transaction *trans, diff --git a/src/deps/src/ModSecurity/src/rule_unconditional.cc b/src/deps/src/ModSecurity/src/rule_unconditional.cc new file mode 100644 index 000000000..e6bacd666 --- /dev/null +++ b/src/deps/src/ModSecurity/src/rule_unconditional.cc @@ -0,0 +1,42 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include "modsecurity/rule_unconditional.h" + + +namespace modsecurity { + + +bool RuleUnconditional::evaluate(Transaction *trans, + std::shared_ptr ruleMessage) { + RuleWithActions::evaluate(trans, ruleMessage); + + // FIXME: This needs to be romeved on the runtime exeption review. + bool containsBlock = false; + + ms_dbg_a(trans, 4, "(Rule: " + std::to_string(m_ruleId) \ + + ") Executing unconditional rule..."); + + executeActionsIndependentOfChainedRuleResult(trans, + &containsBlock, ruleMessage); + + executeActionsAfterFullMatch(trans, containsBlock, ruleMessage); + + performLogging(trans, ruleMessage); + + return true; +} + +} // namespace modsecurity diff --git a/src/deps/src/ModSecurity/src/rule_with_actions.cc b/src/deps/src/ModSecurity/src/rule_with_actions.cc new file mode 100644 index 000000000..39c1c1c8c --- /dev/null +++ b/src/deps/src/ModSecurity/src/rule_with_actions.cc @@ -0,0 +1,565 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include "modsecurity/rule.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "modsecurity/rules_set.h" +#include "src/operators/operator.h" +#include "modsecurity/actions/action.h" +#include "modsecurity/modsecurity.h" +#include "src/actions/transformations/none.h" +#include "src/actions/tag.h" +#include "src/utils/string.h" +#include "modsecurity/rule_message.h" +#include "modsecurity/rule_with_actions.h" +#include "src/actions/msg.h" +#include "src/actions/log_data.h" +#include "src/actions/severity.h" +#include "src/actions/capture.h" +#include "src/actions/multi_match.h" +#include "src/actions/set_var.h" +#include "src/actions/block.h" +#include "src/variables/variable.h" + + +namespace modsecurity { + +using operators::Operator; +using actions::Action; +using variables::Variable; +using actions::transformations::None; +using actions::transformations::Transformation; + + + +RuleWithActions::RuleWithActions( + Actions *actions, + Transformations *transformations, + std::unique_ptr fileName, + int lineNumber) + : Rule(std::move(fileName), lineNumber), + m_rev(""), + m_ver(""), + m_accuracy(0), + m_maturity(0), + m_ruleId(0), + m_chainedRuleChild(nullptr), + m_chainedRuleParent(nullptr), + m_disruptiveAction(nullptr), + m_logData(nullptr), + m_msg(nullptr), + m_severity(nullptr), + m_actionsRuntimePos(), + m_actionsSetVar(), + m_actionsTag(), + m_transformations(transformations != NULL ? *transformations : Transformations()), + m_containsCaptureAction(false), + m_containsMultiMatchAction(false), + m_containsStaticBlockAction(false), + m_isChained(false) { + + if (transformations != NULL) { + delete transformations; + } + + if (actions) { + for (Action *a : *actions) { + if (a->action_kind == Action::ConfigurationKind) { + a->evaluate(this, NULL); + delete a; + + } else if (a->action_kind == Action::RunTimeOnlyIfMatchKind) { + if (dynamic_cast(a)) { + m_containsCaptureAction = true; + delete a; + } else if (dynamic_cast(a)) { + m_containsMultiMatchAction = true; + delete a; + } else if (dynamic_cast(a)) { + m_severity = dynamic_cast(a); + } else if (dynamic_cast(a)) { + m_logData = dynamic_cast(a); + } else if (dynamic_cast(a)) { + m_msg = dynamic_cast(a); + } else if (dynamic_cast(a)) { + m_actionsSetVar.push_back( + dynamic_cast(a)); + } else if (dynamic_cast(a)) { + m_actionsTag.push_back(dynamic_cast(a)); + } else if (dynamic_cast(a)) { + m_actionsRuntimePos.push_back(a); + m_containsStaticBlockAction = true; + } else if (a->isDisruptive() == true) { + if (m_disruptiveAction != nullptr) { + delete m_disruptiveAction; + m_disruptiveAction = nullptr; + } + m_disruptiveAction = a; + } else { + m_actionsRuntimePos.push_back(a); + } + } else { + delete a; + std::cout << "General failure, action: " << a->m_name; + std::cout << " has an unknown type." << std::endl; + throw; + } + } + delete actions; + } +} + +RuleWithActions::~RuleWithActions() { + if (m_severity) { + delete m_severity; + m_severity = nullptr; + } + if (m_logData) { + delete m_logData; + m_logData = nullptr; + } + if (m_msg) { + delete m_msg; + m_msg = nullptr; + } + while (m_transformations.empty() == false) { + auto *a = m_transformations.back(); + m_transformations.pop_back(); + delete a; + } + while (m_actionsRuntimePos.empty() == false) { + auto *a = m_actionsRuntimePos.back(); + m_actionsRuntimePos.pop_back(); + delete a; + } + while (m_actionsSetVar.empty() == false) { + auto *a = m_actionsSetVar.back(); + m_actionsSetVar.pop_back(); + delete a; + } + while (m_actionsTag.empty() == false) { + auto *a = m_actionsTag.back(); + m_actionsTag.pop_back(); + delete a; + } + if (m_disruptiveAction != nullptr) { + delete m_disruptiveAction; + m_disruptiveAction = nullptr; + } +} + + +bool RuleWithActions::evaluate(Transaction *transaction) { + RuleMessage rm(this, transaction); + std::shared_ptr rm2 = std::make_shared(&rm); + return evaluate(transaction, rm2); +} + + +bool RuleWithActions::evaluate(Transaction *transaction, + std::shared_ptr ruleMessage) { + + /* Rule evaluate is pure virtual. + * + * Rule::evaluate(transaction, ruleMessage); + */ + + /* Matched vars needs to be clear at every new rule execution */ + transaction->m_matched.clear(); + + return true; +} + + +void RuleWithActions::executeActionsIndependentOfChainedRuleResult(Transaction *trans, + bool *containsBlock, std::shared_ptr ruleMessage) { + + for (actions::SetVar *a : m_actionsSetVar) { + ms_dbg_a(trans, 4, "Running [independent] (non-disruptive) " \ + "action: " + *a->m_name.get()); + + a->evaluate(this, trans); + } + + for (auto &b : + trans->m_rules->m_exceptions.m_action_pre_update_target_by_id) { + if (m_ruleId != b.first) { + continue; + } + actions::Action *a = dynamic_cast(b.second.get()); + if (a->isDisruptive() == true && *a->m_name.get() == "block") { + ms_dbg_a(trans, 9, "Rule contains a `block' action"); + *containsBlock = true; + } else if (*a->m_name.get() == "setvar") { + ms_dbg_a(trans, 4, "Running [independent] (non-disruptive) " \ + "action: " + *a->m_name.get()); + a->evaluate(this, trans, ruleMessage); + } + } + + if (m_containsMultiMatchAction && !m_isChained) { + if (m_severity) { + m_severity->evaluate(this, trans, ruleMessage); + } + if (m_logData) { + m_logData->evaluate(this, trans, ruleMessage); + } + if (m_msg) { + m_msg->evaluate(this, trans, ruleMessage); + } + } + +} + + +void RuleWithActions::executeActionsAfterFullMatch(Transaction *trans, + bool containsBlock, std::shared_ptr ruleMessage) { + bool disruptiveAlreadyExecuted = false; + + for (auto &a : trans->m_rules->m_defaultActions[getPhase()]) { + if (a.get()->action_kind != actions::Action::RunTimeOnlyIfMatchKind) { + continue; + } + if (!a.get()->isDisruptive()) { + executeAction(trans, containsBlock, ruleMessage, a.get(), true); + } + } + + for (actions::Tag *a : this->m_actionsTag) { + ms_dbg_a(trans, 4, "Running (non-disruptive) action: " \ + + *a->m_name.get()); + a->evaluate(this, trans, ruleMessage); + } + + for (auto &b : + trans->m_rules->m_exceptions.m_action_pos_update_target_by_id) { + if (m_ruleId != b.first) { + continue; + } + actions::Action *a = dynamic_cast(b.second.get()); + executeAction(trans, containsBlock, ruleMessage, a, false); + disruptiveAlreadyExecuted = true; + } + if (m_severity) { + m_severity->evaluate(this, trans, ruleMessage); + } + + if (m_logData) { + m_logData->evaluate(this, trans, ruleMessage); + } + + if (m_msg) { + m_msg->evaluate(this, trans, ruleMessage); + } + for (Action *a : this->m_actionsRuntimePos) { + if (!a->isDisruptive() + && !(disruptiveAlreadyExecuted + && dynamic_cast(a))) { + executeAction(trans, containsBlock, ruleMessage, a, false); + } + } + if (!disruptiveAlreadyExecuted && m_disruptiveAction != nullptr) { + executeAction(trans, containsBlock, ruleMessage, + m_disruptiveAction, false); + } +} + + +void RuleWithActions::executeAction(Transaction *trans, + bool containsBlock, std::shared_ptr ruleMessage, + Action *a, bool defaultContext) { + if (a->isDisruptive() == false && *a->m_name.get() != "block") { + ms_dbg_a(trans, 9, "Running " \ + "action: " + *a->m_name.get()); + a->evaluate(this, trans, ruleMessage); + return; + } + + if (defaultContext && !containsBlock) { + ms_dbg_a(trans, 4, "Ignoring action: " + *a->m_name.get() + \ + " (rule does not cotains block)"); + return; + } + + if (trans->getRuleEngineState() == RulesSet::EnabledRuleEngine) { + ms_dbg_a(trans, 4, "Running (disruptive) action: " + *a->m_name.get() + \ + "."); + a->evaluate(this, trans, ruleMessage); + return; + } + + ms_dbg_a(trans, 4, "Not running any disruptive action (or block): " \ + + *a->m_name.get() + ". SecRuleEngine is not On."); +} + + +inline void RuleWithActions::executeTransformation( + actions::transformations::Transformation *a, + std::shared_ptr *value, + Transaction *trans, + TransformationResults *ret, + std::string *path, + int *nth) const { + + std::string *oldValue = (*value).get(); + std::string newValue = a->evaluate(*oldValue, trans); + + if (newValue != *oldValue) { + std::shared_ptr u(new std::string(newValue)); + if (m_containsMultiMatchAction) { + ret->push_back(std::make_pair(u, a->m_name)); + (*nth)++; + } + *value = u; + } + + if (path->empty()) { + path->append(*a->m_name.get()); + } else { + path->append("," + *a->m_name.get()); + } + + ms_dbg_a(trans, 9, " T (" + \ + std::to_string(*nth) + ") " + \ + *a->m_name.get() + ": \"" + \ + utils::string::limitTo(80, newValue) +"\""); +} + +void RuleWithActions::executeTransformations( + Transaction *trans, const std::string &in, TransformationResults &ret) { + int none = 0; + int transformations = 0; + std::string path(""); + std::shared_ptr value = + std::shared_ptr(new std::string(in)); + + if (m_containsMultiMatchAction == true) { + /* keep the original value */ + ret.push_back(std::make_pair( + std::shared_ptr(new std::string(*value)), + std::shared_ptr(new std::string(path)))); + } + + for (Action *a : m_transformations) { + if (a->m_isNone) { + none++; + } + } + + // Check for transformations on the SecDefaultAction + // Notice that first we make sure that won't be a t:none + // on the target rule. + if (none == 0) { + for (auto &a : trans->m_rules->m_defaultActions[getPhase()]) { + if (a->action_kind \ + != actions::Action::RunTimeBeforeMatchAttemptKind) { + continue; + } + + // FIXME: here the object needs to be a transformation already. + Transformation *t = dynamic_cast(a.get()); + executeTransformation(t, &value, trans, &ret, &path, + &transformations); + } + } + + for (Transformation *a : m_transformations) { + if (none == 0) { + Transformation *t = dynamic_cast(a); + executeTransformation(t, &value, trans, &ret, &path, + &transformations); + } + if (a->m_isNone) { + none--; + } + } + + // FIXME: It can't be something different from transformation. Sort this + // on rules compile time. + for (auto &b : + trans->m_rules->m_exceptions.m_action_pre_update_target_by_id) { + if (m_ruleId != b.first) { + continue; + } + Transformation *a = dynamic_cast(b.second.get()); + if (a->m_isNone) { + none++; + } + } + + for (auto &b : + trans->m_rules->m_exceptions.m_action_pre_update_target_by_id) { + if (m_ruleId != b.first) { + continue; + } + Transformation *a = dynamic_cast(b.second.get()); + if (none == 0) { + Transformation *t = dynamic_cast(a); + executeTransformation(t, &value, trans, &ret, &path, + &transformations); + } + if (a->m_isNone) { + none--; + } + } + + if (m_containsMultiMatchAction == true) { + ms_dbg_a(trans, 9, "multiMatch is enabled. " \ + + std::to_string(ret.size()) + \ + " values to be tested."); + } + + if (!m_containsMultiMatchAction) { + ret.push_back(std::make_pair( + std::shared_ptr(new std::string(*value)), + std::shared_ptr(new std::string(path)))); + } +} + + +bool RuleWithActions::containsTag(const std::string& name, Transaction *t) { + for (auto &tag : m_actionsTag) { + if (tag != NULL && tag->getName(t) == name) { + return true; + } + } + return false; +} + + +bool RuleWithActions::containsMsg(const std::string& name, Transaction *t) { + return m_msg && m_msg->data(t) == name; +} + + +std::vector RuleWithActions::getActionsByName(const std::string& name, + Transaction *trans) { + std::vector ret; + for (auto &z : m_actionsRuntimePos) { + if (*z->m_name.get() == name) { + ret.push_back(z); + } + } + for (auto &z : m_transformations) { + if (*z->m_name.get() == name) { + ret.push_back(z); + } + } + for (auto &b : + trans->m_rules->m_exceptions.m_action_pre_update_target_by_id) { + if (m_ruleId != b.first) { + continue; + } + actions::Action *z = dynamic_cast(b.second.get()); + if (*z->m_name.get() == name) { + ret.push_back(z); + } + } + for (auto &b : + trans->m_rules->m_exceptions.m_action_pos_update_target_by_id) { + if (m_ruleId != b.first) { + continue; + } + actions::Action *z = dynamic_cast(b.second.get()); + if (*z->m_name.get() == name) { + ret.push_back(z); + } + } + return ret; +} + +void RuleWithActions::performLogging(Transaction *trans, + std::shared_ptr ruleMessage, + bool lastLog, + bool chainedParentNull) { + + /* last rule in the chain. */ + bool isItToBeLogged = ruleMessage->m_saveMessage; + + /** + * + * RuleMessage is stacked allocated for the rule execution, + * anything beyond this may lead to invalid pointer access. + * + * In case of a warning, o set of messages is saved to be read + * at audit log generation. Therefore demands a copy here. + * + * FIXME: Study an way to avoid the copy. + * + **/ + if (lastLog) { + if (chainedParentNull) { + isItToBeLogged = (ruleMessage->m_saveMessage && (m_chainedRuleParent == nullptr)); + if (isItToBeLogged && !hasMultimatch()) { + /* warn */ + trans->m_rulesMessages.push_back(*ruleMessage); + + /* error */ + if (!ruleMessage->m_isDisruptive) { + trans->serverLog(ruleMessage); + } + } + } else if (hasBlockAction() && !hasMultimatch()) { + /* warn */ + trans->m_rulesMessages.push_back(*ruleMessage); + /* error */ + if (!ruleMessage->m_isDisruptive) { + trans->serverLog(ruleMessage); + } + } else { + if (isItToBeLogged && !hasMultimatch() + && !ruleMessage->m_message.empty()) { + /* warn */ + trans->m_rulesMessages.push_back(*ruleMessage); + + /* error */ + if (!ruleMessage->m_isDisruptive) { + trans->serverLog(ruleMessage); + } + } + } + } else { + if (hasMultimatch() && isItToBeLogged) { + /* warn */ + trans->m_rulesMessages.push_back(*ruleMessage.get()); + + /* error */ + if (!ruleMessage->m_isDisruptive) { + trans->serverLog(ruleMessage); + } + + RuleMessage *rm = new RuleMessage(this, trans); + rm->m_saveMessage = ruleMessage->m_saveMessage; + ruleMessage.reset(rm); + } + } +} + +std::string RuleWithActions::logData(Transaction *t) { return m_logData->data(t); } +std::string RuleWithActions::msg(Transaction *t) { return m_msg->data(t); } +int RuleWithActions::severity() const { return m_severity->m_severity; } + + +} // namespace modsecurity diff --git a/src/deps/src/ModSecurity/src/rule_with_operator.cc b/src/deps/src/ModSecurity/src/rule_with_operator.cc new file mode 100644 index 000000000..d218f14b8 --- /dev/null +++ b/src/deps/src/ModSecurity/src/rule_with_operator.cc @@ -0,0 +1,380 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include "modsecurity/rule_with_operator.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "modsecurity/rules_set.h" +#include "src/operators/operator.h" +#include "modsecurity/actions/action.h" +#include "modsecurity/modsecurity.h" +#include "src/actions/transformations/none.h" +#include "src/actions/tag.h" +#include "src/utils/string.h" +#include "modsecurity/rule_message.h" +#include "src/actions/msg.h" +#include "src/actions/log_data.h" +#include "src/actions/severity.h" +#include "src/actions/capture.h" +#include "src/actions/multi_match.h" +#include "src/actions/set_var.h" +#include "src/actions/block.h" +#include "src/variables/variable.h" + + +namespace modsecurity { + +using operators::Operator; +using actions::Action; +using variables::Variable; +using actions::transformations::None; + + +RuleWithOperator::RuleWithOperator(Operator *op, + variables::Variables *_variables, + std::vector *actions, + Transformations *transformations, + std::unique_ptr fileName, + int lineNumber) + : RuleWithActions(actions, transformations, std::move(fileName), lineNumber), + m_variables(_variables), + m_operator(op) { /* */ } + + +RuleWithOperator::~RuleWithOperator() { + if (m_operator != NULL) { + delete m_operator; + } + + while (m_variables != NULL && m_variables->empty() == false) { + auto *a = m_variables->back(); + m_variables->pop_back(); + delete a; + } + + if (m_variables != NULL) { + delete m_variables; + } +} + + +void RuleWithOperator::updateMatchedVars(Transaction *trans, const std::string &key, + const std::string &value) { + ms_dbg_a(trans, 9, "Matched vars updated."); + trans->m_variableMatchedVar.set(value, trans->m_variableOffset); + trans->m_variableMatchedVarName.set(key, trans->m_variableOffset); + + trans->m_variableMatchedVars.set(key, value, trans->m_variableOffset); + trans->m_variableMatchedVarsNames.set(key, key, trans->m_variableOffset); +} + + +void RuleWithOperator::cleanMatchedVars(Transaction *trans) { + ms_dbg_a(trans, 9, "Matched vars cleaned."); + trans->m_variableMatchedVar.unset(); + trans->m_variableMatchedVars.unset(); + trans->m_variableMatchedVarName.unset(); + trans->m_variableMatchedVarsNames.unset(); +} + + + +bool RuleWithOperator::executeOperatorAt(Transaction *trans, const std::string &key, + const std::string &value, std::shared_ptr ruleMessage) { +#if MSC_EXEC_CLOCK_ENABLED + clock_t begin = clock(); + clock_t end; + double elapsed_s = 0; +#endif + bool ret; + + ms_dbg_a(trans, 9, "Target value: \"" + utils::string::limitTo(80, + utils::string::toHexIfNeeded(value)) \ + + "\" (Variable: " + key + ")"); + + ret = this->m_operator->evaluateInternal(trans, this, value, ruleMessage); + + if (ret == false) { + return false; + } + +#if MSC_EXEC_CLOCK_ENABLED + end = clock(); + elapsed_s = static_cast(end - begin) / CLOCKS_PER_SEC; + + ms_dbg_a(trans, 5, "Operator completed in " + \ + std::to_string(elapsed_s) + " seconds"); +#endif + return ret; +} + + +void RuleWithOperator::getVariablesExceptions(Transaction *t, + variables::Variables *exclusion, variables::Variables *addition) { + for (auto &a : t->m_rules->m_exceptions.m_variable_update_target_by_tag) { + if (containsTag(*a.first.get(), t) == false) { + continue; + } + Variable *b = a.second.get(); + if (dynamic_cast(b)) { + exclusion->push_back( + dynamic_cast( + b)->m_base.get()); + } else { + addition->push_back(b); + } + } + + for (auto &a : t->m_rules->m_exceptions.m_variable_update_target_by_msg) { + if (containsMsg(*a.first.get(), t) == false) { + continue; + } + Variable *b = a.second.get(); + if (dynamic_cast(b)) { + exclusion->push_back( + dynamic_cast( + b)->m_base.get()); + } else { + addition->push_back(b); + } + } + + for (auto &a : t->m_rules->m_exceptions.m_variable_update_target_by_id) { + if (m_ruleId != a.first) { + continue; + } + Variable *b = a.second.get(); + if (dynamic_cast(b)) { + exclusion->push_back( + dynamic_cast( + b)->m_base.get()); + } else { + addition->push_back(b); + } + } +} + + +inline void RuleWithOperator::getFinalVars(variables::Variables *vars, + variables::Variables *exclusion, Transaction *trans) { + variables::Variables addition; + getVariablesExceptions(trans, exclusion, &addition); + + for (int i = 0; i < m_variables->size(); i++) { + Variable *variable = m_variables->at(i); + if (exclusion->contains(variable)) { + continue; + } + if (std::find_if(trans->m_ruleRemoveTargetById.begin(), + trans->m_ruleRemoveTargetById.end(), + [&, variable, this](std::pair &m) -> bool { + return m.first == m_ruleId + && m.second == *variable->m_fullName.get(); + }) != trans->m_ruleRemoveTargetById.end()) { + continue; + } + if (std::find_if(trans->m_ruleRemoveTargetByTag.begin(), + trans->m_ruleRemoveTargetByTag.end(), + [&, variable, trans, this]( + std::pair &m) -> bool { + return containsTag(m.first, trans) + && m.second == *variable->m_fullName.get(); + }) != trans->m_ruleRemoveTargetByTag.end()) { + continue; + } + vars->push_back(variable); + } + + for (int i = 0; i < addition.size(); i++) { + Variable *variable = addition.at(i); + vars->push_back(variable); + } +} + + +bool RuleWithOperator::evaluate(Transaction *trans, + std::shared_ptr ruleMessage) { + bool globalRet = false; + variables::Variables *variables = this->m_variables; + bool recursiveGlobalRet; + bool containsBlock = hasBlockAction(); + std::string eparam; + variables::Variables vars; + vars.reserve(4); + variables::Variables exclusion; + + RuleWithActions::evaluate(trans, ruleMessage); + + + // FIXME: Make a class runTimeException to handle this cases. + for (auto &i : trans->m_ruleRemoveById) { + if (m_ruleId != i) { + continue; + } + ms_dbg_a(trans, 9, "Rule id: " + std::to_string(m_ruleId) + + " was skipped due to a ruleRemoveById action..."); + return true; + } + for (auto &i : trans->m_ruleRemoveByIdRange) { + if (!(i.first <= m_ruleId && i.second >= m_ruleId)) { + continue; + } + ms_dbg_a(trans, 9, "Rule id: " + std::to_string(m_ruleId) + + " was skipped due to a ruleRemoveById action..."); + return true; + } + + if (m_operator->m_string) { + eparam = m_operator->m_string->evaluate(trans); + + if (m_operator->m_string->containsMacro()) { + eparam = "\"" + eparam + "\" Was: \"" \ + + m_operator->m_string->evaluate(NULL) + "\""; + } else { + eparam = "\"" + eparam + "\""; + } + ms_dbg_a(trans, 4, "(Rule: " + std::to_string(m_ruleId) \ + + ") Executing operator \"" + getOperatorName() \ + + "\" with param " \ + + eparam \ + + " against " \ + + variables + "."); + } else { + ms_dbg_a(trans, 4, "(Rule: " + std::to_string(m_ruleId) \ + + ") Executing operator \"" + getOperatorName() \ + + " against " \ + + variables + "."); + } + + + getFinalVars(&vars, &exclusion, trans); + + for (auto &var : vars) { + std::vector e; + if (!var) { + continue; + } + var->evaluate(trans, this, &e); + for (const VariableValue *v : e) { + const std::string &value = v->getValue(); + const std::string &key = v->getKeyWithCollection(); + + if (exclusion.contains(v) || + std::find_if(trans->m_ruleRemoveTargetById.begin(), + trans->m_ruleRemoveTargetById.end(), + [&, v, this](std::pair &m) -> bool { + return m.first == m_ruleId && m.second == v->getKeyWithCollection(); + }) != trans->m_ruleRemoveTargetById.end() + ) { + delete v; + v = NULL; + continue; + } + if (exclusion.contains(v) || + std::find_if(trans->m_ruleRemoveTargetByTag.begin(), + trans->m_ruleRemoveTargetByTag.end(), + [&, v, trans, this](std::pair &m) -> bool { + return containsTag(m.first, trans) && m.second == v->getKeyWithCollection(); + }) != trans->m_ruleRemoveTargetByTag.end() + ) { + delete v; + v = NULL; + continue; + } + + TransformationResults values; + + executeTransformations(trans, value, values); + + for (const auto &valueTemp : values) { + bool ret; + std::string valueAfterTrans = std::move(*valueTemp.first); + + ret = executeOperatorAt(trans, key, valueAfterTrans, ruleMessage); + + if (ret == true) { + ruleMessage->m_match = m_operator->resolveMatchMessage(trans, + key, value); + for (auto &i : v->getOrigin()) { + ruleMessage->m_reference.append(i->toText()); + } + + ruleMessage->m_reference.append(*valueTemp.second); + updateMatchedVars(trans, key, valueAfterTrans); + executeActionsIndependentOfChainedRuleResult(trans, + &containsBlock, ruleMessage); + + performLogging(trans, ruleMessage, false); + + globalRet = true; + } + } + delete v; + v = NULL; + } + e.clear(); + e.reserve(4); + } + + if (globalRet == false) { + ms_dbg_a(trans, 4, "Rule returned 0."); + cleanMatchedVars(trans); + goto end_clean; + } + ms_dbg_a(trans, 4, "Rule returned 1."); + + if (this->isChained() == false) { + goto end_exec; + } + + /* FIXME: this check should happens on the parser. */ + if (this->m_chainedRuleChild == nullptr) { + ms_dbg_a(trans, 4, "Rule is marked as chained but there " \ + "isn't a subsequent rule."); + goto end_clean; + } + + ms_dbg_a(trans, 4, "Executing chained rule."); + recursiveGlobalRet = m_chainedRuleChild->evaluate(trans, ruleMessage); + + if (recursiveGlobalRet == true) { + goto end_exec; + } + +end_clean: + return false; + +end_exec: + executeActionsAfterFullMatch(trans, containsBlock, ruleMessage); + + /* last rule in the chain. */ + performLogging(trans, ruleMessage, true, true); + return true; +} + + +std::string RuleWithOperator::getOperatorName() const { return m_operator->m_op; } + + +} // namespace modsecurity diff --git a/src/deps/src/ModSecurity/src/rules_exceptions.cc b/src/deps/src/ModSecurity/src/rules_exceptions.cc index dd057402c..2c22d16fc 100644 --- a/src/deps/src/ModSecurity/src/rules_exceptions.cc +++ b/src/deps/src/ModSecurity/src/rules_exceptions.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -122,8 +122,8 @@ bool RulesExceptions::loadUpdateTargetById(double id, bool RulesExceptions::load(const std::string &a, std::string *error) { bool added = false; std::vector toRemove = utils::string::ssplit(a, ' '); - for (std::string &a : toRemove) { - std::string b = modsecurity::utils::string::parserSanitizer(a); + for (std::string &r : toRemove) { + std::string b = modsecurity::utils::string::parserSanitizer(r); if (b.size() == 0) { continue; } diff --git a/src/deps/src/ModSecurity/src/rules.cc b/src/deps/src/ModSecurity/src/rules_set.cc similarity index 52% rename from src/deps/src/ModSecurity/src/rules.cc rename to src/deps/src/ModSecurity/src/rules_set.cc index eff766f9c..40f1f950b 100644 --- a/src/deps/src/ModSecurity/src/rules.cc +++ b/src/deps/src/ModSecurity/src/rules_set.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,18 +13,18 @@ * */ -#include "modsecurity/rules.h" - #include #include #include #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/modsecurity.h" #include "modsecurity/transaction.h" #include "src/parser/driver.h" #include "src/utils/https_client.h" +#include "modsecurity/rules.h" using modsecurity::Parser::Driver; using modsecurity::Utils::HttpsClient; @@ -32,57 +32,12 @@ using modsecurity::Utils::HttpsClient; namespace modsecurity { -/** - * @name incrementReferenceCount - * @brief Increment the number of transactions using this class - * @ingroup ModSecCore - * - * At certain point it is expected to have two differnt - * groups of rules attached to a specific core, this happens - * for instance when a webserver is reloading its - * configurations, the old configurations/rules is available - * for the old connections and the new rules are available - * for the newest connections. - * - * @return Number of the current transactions using this rules - * - */ -void Rules::incrementReferenceCount(void) { - this->m_referenceCount++; -} - - -/** - * @name decrementReferenceCount - * @brief Decrement the number of transactions using this class - * @ingroup ModSecCore - * - * @return Number of the current transactions using this rules - * - */ -void Rules::decrementReferenceCount(void) { - this->m_referenceCount--; - if (this->m_referenceCount == 0) { - /** - * FIXME: If there are new rules loaded (new instance - * of this class) and the reference is zero, we - * can delete this instance freeing some memory. - * - */ - /* - * std::cout << "We may want to delete this rules instance" \ - * << std::endl; - */ - } -} - - /** * @name loadFromUri * @brief load rules from a give uri * @ingroup ModSecCore * - * Load the rules from a given uri into memory into memory in + * Load the rules from a given uri into memory in * the format expected by ModSecurity core. * * @param uri Full path to the rules file. @@ -92,10 +47,10 @@ void Rules::decrementReferenceCount(void) { * @retval false Problem loading the rules. * */ -int Rules::loadFromUri(const char *uri) { +int RulesSet::loadFromUri(const char *uri) { Driver *driver = new Driver(); - if (driver->parseFile(uri) == false) { + if (driver->parseFile(uri) == 0) { m_parserError << driver->m_parserError.str(); delete driver; return -1; @@ -108,10 +63,10 @@ int Rules::loadFromUri(const char *uri) { } -int Rules::load(const char *file, const std::string &ref) { +int RulesSet::load(const char *file, const std::string &ref) { Driver *driver = new Driver(); - if (driver->parse(file, ref) == false) { + if (driver->parse(file, ref) == 0) { m_parserError << driver->m_parserError.str(); delete driver; return -1; @@ -128,7 +83,7 @@ int Rules::load(const char *file, const std::string &ref) { } -int Rules::loadRemote(const char *key, const char *uri) { +int RulesSet::loadRemote(const char *key, const char *uri) { HttpsClient client; client.setKey(key); bool ret = client.download(uri); @@ -141,25 +96,25 @@ int Rules::loadRemote(const char *key, const char *uri) { } -int Rules::load(const char *plainRules) { +int RulesSet::load(const char *plainRules) { return this->load(plainRules, ""); } -std::string Rules::getParserError() { +std::string RulesSet::getParserError() { return this->m_parserError.str(); } -int Rules::evaluate(int phase, Transaction *t) { +int RulesSet::evaluate(int phase, Transaction *t) { if (phase >= modsecurity::Phases::NUMBER_OF_PHASES) { return 0; } - std::vector rules = m_rules[phase]; + Rules *rules = m_rulesSetPhases[phase]; ms_dbg_a(t, 9, "This phase consists of " \ - + std::to_string(rules.size()) + " rule(s)."); + + std::to_string(rules->size()) + " rule(s)."); if (t->m_allowType == actions::disruptive::FromNowOnAllowType && phase != modsecurity::Phases::LoggingPhase) { @@ -173,47 +128,44 @@ int Rules::evaluate(int phase, Transaction *t) { "through the utilization of an `allow' action."); return true; } - if (t->m_allowType != actions::disruptive::NoneAllowType) { - t->m_allowType = actions::disruptive::NoneAllowType; - } + //if (t->m_allowType != actions::disruptive::NoneAllowType) { + t->m_allowType = actions::disruptive::NoneAllowType; + //} - for (int i = 0; i < rules.size(); i++) { - Rule *rule = rules[i]; - if (t->m_marker.empty() == false) { - ms_dbg_a(t, 9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \ - + "' due to a SecMarker: " + t->m_marker); -#ifndef NO_LOGS - m_secmarker_skipped++; -#endif - ms_dbg_a(t, 9, "Rule: " + rule->m_marker); + for (int i = 0; i < rules->size(); i++) { + // FIXME: This is not meant to be here. At the end of this refactoring, + // the shared pointer won't be used. + auto rule = rules->at(i); + if (t->isInsideAMarker() && !rule->isMarker()) { + ms_dbg_a(t, 9, "Skipped rule id '" + rule->getReference() \ + + "' due to a SecMarker: " + *t->getCurrentMarker()); - if (rule->m_secMarker && rule->m_marker == t->m_marker) { - ms_dbg_a(t, 4, "Out of a SecMarker after skip " \ - + std::to_string(m_secmarker_skipped) + " rules."); - t->m_marker.clear(); -#ifndef NO_LOGS - m_secmarker_skipped = 0; -#endif - } + } else if (rule->isMarker()) { + rule->evaluate(t); } else if (t->m_skip_next > 0) { t->m_skip_next--; - ms_dbg_a(t, 9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \ + ms_dbg_a(t, 9, "Skipped rule id '" + rule->getReference() \ + "' due to a `skip' action. Still " + \ std::to_string(t->m_skip_next) + " to be skipped."); } else if (t->m_allowType != actions::disruptive::NoneAllowType) { - ms_dbg_a(t, 9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \ + ms_dbg_a(t, 9, "Skipped rule id '" + rule->getReference() \ + "' as request trough the utilization of an `allow' action."); - } else if (m_exceptions.contains(rule->m_ruleId)) { - ms_dbg_a(t, 9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \ - + "'. Removed by an SecRuleRemove directive."); } else { + Rule *base = rule.get(); + RuleWithActions *ruleWithActions = dynamic_cast(base); + // FIXME: Those should be treated inside the rule itself + if (ruleWithActions && m_exceptions.contains(ruleWithActions->m_ruleId)) { + ms_dbg_a(t, 9, "Skipped rule id '" + rule->getReference() \ + + "'. Removed by an SecRuleRemove directive."); + continue; + } bool remove_rule = false; - if (m_exceptions.m_remove_rule_by_msg.empty() == false) { + if (ruleWithActions && m_exceptions.m_remove_rule_by_msg.empty() == false) { for (auto &z : m_exceptions.m_remove_rule_by_msg) { - if (rule->containsMsg(z, t) == true) { + if (ruleWithActions->containsMsg(z, t) == true) { ms_dbg_a(t, 9, "Skipped rule id '" \ - + std::to_string(rule->m_ruleId) \ + + ruleWithActions->getReference() \ + "'. Removed by a SecRuleRemoveByMsg directive."); remove_rule = true; break; @@ -224,11 +176,11 @@ int Rules::evaluate(int phase, Transaction *t) { } } - if (m_exceptions.m_remove_rule_by_tag.empty() == false) { + if (ruleWithActions && m_exceptions.m_remove_rule_by_tag.empty() == false) { for (auto &z : m_exceptions.m_remove_rule_by_tag) { - if (rule->containsTag(z, t) == true) { + if (ruleWithActions->containsTag(z, t) == true) { ms_dbg_a(t, 9, "Skipped rule id '" \ - + std::to_string(rule->m_ruleId) \ + + ruleWithActions->getReference() \ + "'. Removed by a SecRuleRemoveByTag directive."); remove_rule = true; break; @@ -239,11 +191,12 @@ int Rules::evaluate(int phase, Transaction *t) { } } - if (t->m_ruleRemoveByTag.empty() == false) { + + if (ruleWithActions) { for (auto &z : t->m_ruleRemoveByTag) { - if (rule->containsTag(z, t) == true) { + if (ruleWithActions->containsTag(z, t) == true) { ms_dbg_a(t, 9, "Skipped rule id '" \ - + std::to_string(rule->m_ruleId) \ + + ruleWithActions->getReference() \ + "'. Skipped due to a ruleRemoveByTag action."); remove_rule = true; break; @@ -254,8 +207,9 @@ int Rules::evaluate(int phase, Transaction *t) { } } - rule->evaluate(t, NULL); - if (t->m_it.disruptive == true) { + rule->evaluate(t); + if (t->m_it.disruptive > 0) { + ms_dbg_a(t, 8, "Skipping this phase as this " \ "request was already intercepted."); break; @@ -266,29 +220,35 @@ int Rules::evaluate(int phase, Transaction *t) { } -int Rules::merge(Driver *from) { +int RulesSet::merge(Driver *from) { int amount_of_rules = 0; - amount_of_rules = mergeProperties( - dynamic_cast(from), - dynamic_cast(this), + + amount_of_rules = m_rulesSetPhases.append(&from->m_rulesSetPhases, + &m_parserError); + mergeProperties( + dynamic_cast(from), + dynamic_cast(this), &m_parserError); return amount_of_rules; } -int Rules::merge(Rules *from) { +int RulesSet::merge(RulesSet *from) { int amount_of_rules = 0; - amount_of_rules = mergeProperties( - dynamic_cast(from), - dynamic_cast(this), + + amount_of_rules = m_rulesSetPhases.append(&from->m_rulesSetPhases, + &m_parserError); + mergeProperties( + dynamic_cast(from), + dynamic_cast(this), &m_parserError); return amount_of_rules; } -void Rules::debug(int level, const std::string &id, +void RulesSet::debug(int level, const std::string &id, const std::string &uri, const std::string &msg) { if (m_debugLog != NULL) { m_debugLog->write(level, id, uri, msg); @@ -296,33 +256,23 @@ void Rules::debug(int level, const std::string &id, } -void Rules::dump() { - std::cout << "Rules: " << std::endl; - for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { - std::vector rules = m_rules[i]; - std::cout << "Phase: " << std::to_string(i); - std::cout << " (" << std::to_string(rules.size()); - std::cout << " rules)" << std::endl; - for (int j = 0; j < rules.size(); j++) { - std::cout << " Rule ID: " << std::to_string(rules[j]->m_ruleId); - std::cout << "--" << rules[j] << std::endl; - } - } +void RulesSet::dump() const { + m_rulesSetPhases.dump(); } -extern "C" Rules *msc_create_rules_set(void) { - return new Rules(); +extern "C" RulesSet *msc_create_rules_set(void) { + return new RulesSet(); } -extern "C" void msc_rules_dump(Rules *rules) { +extern "C" void msc_rules_dump(RulesSet *rules) { rules->dump(); } -extern "C" int msc_rules_merge(Rules *rules_dst, - Rules *rules_from, const char **error) { +extern "C" int msc_rules_merge(RulesSet *rules_dst, + RulesSet *rules_from, const char **error) { int ret = rules_dst->merge(rules_from); if (ret < 0) { *error = strdup(rules_dst->getParserError().c_str()); @@ -331,7 +281,7 @@ extern "C" int msc_rules_merge(Rules *rules_dst, } -extern "C" int msc_rules_add_remote(Rules *rules, +extern "C" int msc_rules_add_remote(RulesSet *rules, const char *key, const char *uri, const char **error) { int ret = rules->loadRemote(key, uri); if (ret < 0) { @@ -341,7 +291,7 @@ extern "C" int msc_rules_add_remote(Rules *rules, } -extern "C" int msc_rules_add_file(Rules *rules, const char *file, +extern "C" int msc_rules_add_file(RulesSet *rules, const char *file, const char **error) { int ret = rules->loadFromUri(file); if (ret < 0) { @@ -351,7 +301,7 @@ extern "C" int msc_rules_add_file(Rules *rules, const char *file, } -extern "C" int msc_rules_add(Rules *rules, const char *plain_rules, +extern "C" int msc_rules_add(RulesSet *rules, const char *plain_rules, const char **error) { int ret = rules->load(plain_rules); if (ret < 0) { @@ -361,7 +311,7 @@ extern "C" int msc_rules_add(Rules *rules, const char *plain_rules, } -extern "C" int msc_rules_cleanup(Rules *rules) { +extern "C" int msc_rules_cleanup(RulesSet *rules) { delete rules; return true; } diff --git a/src/deps/src/ModSecurity/src/rules_set_phases.cc b/src/deps/src/ModSecurity/src/rules_set_phases.cc new file mode 100644 index 000000000..1d93330ca --- /dev/null +++ b/src/deps/src/ModSecurity/src/rules_set_phases.cc @@ -0,0 +1,80 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include +#include +#include +#include +#include + +#include "modsecurity/rules_set_phases.h" +#include "modsecurity/rule.h" +#include "modsecurity/rules.h" +#include "modsecurity/modsecurity.h" + + + +namespace modsecurity { + + +bool RulesSetPhases::insert(std::shared_ptr rule) { + if (rule->getPhase() >= modsecurity::Phases::NUMBER_OF_PHASES) { + return false; + } + m_rulesAtPhase[rule->getPhase()].insert(rule); + + return true; +} + + +int RulesSetPhases::append(RulesSetPhases *from, std::ostringstream *err) { + int amount_of_rules = 0; + std::vector v; + + for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) { + v.reserve(m_rulesAtPhase[i].size()); + for (size_t z = 0; z < m_rulesAtPhase[i].size(); z++) { + RuleWithOperator *rule_ckc = dynamic_cast(m_rulesAtPhase[i].at(z).get()); + if (!rule_ckc) { + continue; + } + v.push_back(rule_ckc->m_ruleId); + } + } + std::sort (v.begin(), v.end()); + + for (int phase = 0; phase < modsecurity::Phases::NUMBER_OF_PHASES; phase++) { + int res = m_rulesAtPhase[phase].append(from->at(phase), v, err); + if (res < 0) { + return res; + } + amount_of_rules = amount_of_rules + res; + } + + return amount_of_rules; +} + +void RulesSetPhases::dump() const { + for (int i = 0; i <= modsecurity::Phases::NUMBER_OF_PHASES; i++) { + std::cout << "Phase: " << std::to_string(i); + std::cout << " (" << std::to_string(m_rulesAtPhase[i].size()); + std::cout << " rules)" << std::endl; + m_rulesAtPhase[i].dump(); + } +} + + +} // namespace modsecurity + diff --git a/src/deps/src/ModSecurity/src/rules_properties.cc b/src/deps/src/ModSecurity/src/rules_set_properties.cc similarity index 93% rename from src/deps/src/ModSecurity/src/rules_properties.cc rename to src/deps/src/ModSecurity/src/rules_set_properties.cc index 78f0e9d1c..ffb37e768 100644 --- a/src/deps/src/ModSecurity/src/rules_properties.cc +++ b/src/deps/src/ModSecurity/src/rules_set_properties.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,10 +13,9 @@ * */ -#include "modsecurity/rules_properties.h" - #include +#include "modsecurity/rules_set_properties.h" #include "src/utils/string.h" #include "src/variables/variable.h" @@ -24,7 +23,7 @@ namespace modsecurity { void ConfigUnicodeMap::loadConfig(std::string f, double configCodePage, - RulesProperties *driver, std::string *errg) { + RulesSetProperties *driver, std::string *errg) { char *buf = NULL; char *hmap = NULL; char *p = NULL; @@ -35,7 +34,6 @@ void ConfigUnicodeMap::loadConfig(std::string f, double configCodePage, int length = 0; int Map = 0; int processing = 0; - unsigned int codepage = 0; driver->m_unicodeMapTable.m_set = true; driver->m_unicodeMapTable.m_unicodeCodePage = configCodePage; @@ -88,7 +86,7 @@ void ConfigUnicodeMap::loadConfig(std::string f, double configCodePage, p = strtok_r(buf, CODEPAGE_SEPARATORS, &savedptr); while (p != NULL) { - codepage = atol(p); + unsigned int codepage = atol(p); if (codepage == configCodePage) { found = 1; diff --git a/src/deps/src/ModSecurity/src/run_time_string.cc b/src/deps/src/ModSecurity/src/run_time_string.cc index 9d60cfc49..f2dfa686f 100644 --- a/src/deps/src/ModSecurity/src/run_time_string.cc +++ b/src/deps/src/ModSecurity/src/run_time_string.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,7 +30,7 @@ namespace modsecurity { -void RunTimeString::appendText(std::string text) { +void RunTimeString::appendText(const std::string &text) { std::unique_ptr r(new RunTimeElementHolder); r->m_string = text; m_elements.push_back(std::move(r)); @@ -58,7 +58,9 @@ std::string RunTimeString::evaluate(Transaction *t, Rule *r) { s.append(z->m_string); } else if (z->m_var != NULL && t != NULL) { std::vector l; - z->m_var->evaluate(t, r, &l); + // FIXME: This cast should be removed. + RuleWithOperator *rr = dynamic_cast(r); + z->m_var->evaluate(t, rr, &l); if (l.size() > 0) { s.append(l[0]->getValue()); } diff --git a/src/deps/src/ModSecurity/src/run_time_string.h b/src/deps/src/ModSecurity/src/run_time_string.h index 20535c9af..c6de62182 100644 --- a/src/deps/src/ModSecurity/src/run_time_string.h +++ b/src/deps/src/ModSecurity/src/run_time_string.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -46,14 +46,14 @@ class RunTimeString { public: RunTimeString() : m_containsMacro(false) { } - void appendText(std::string text); + void appendText(const std::string &text); void appendVar(std::unique_ptr var); std::string evaluate(Transaction *t); std::string evaluate(Transaction *t, Rule *r); std::string evaluate() { return evaluate(NULL); } - inline bool containsMacro() { return m_containsMacro; } + inline bool containsMacro() const { return m_containsMacro; } bool m_containsMacro; protected: diff --git a/src/deps/src/ModSecurity/src/transaction.cc b/src/deps/src/ModSecurity/src/transaction.cc index dc2ca6557..bc28abe05 100644 --- a/src/deps/src/ModSecurity/src/transaction.cc +++ b/src/deps/src/ModSecurity/src/transaction.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -49,7 +49,7 @@ #include "src/utils/random.h" #include "modsecurity/rule.h" #include "modsecurity/rule_message.h" -#include "modsecurity/rules_properties.h" +#include "modsecurity/rules_set_properties.h" #include "src/actions/disruptive/allow.h" #include "src/variables/remote_user.h" @@ -99,42 +99,72 @@ namespace modsecurity { * @endcode * */ -Transaction::Transaction(ModSecurity *ms, Rules *rules, void *logCbData) - : m_clientPort(0), - m_serverPort(0), - m_uri_no_query_string_decoded(""), - m_rules(rules), - m_timeStamp(std::time(NULL)), - m_httpCodeReturned(200), - m_highestSeverityAction(255), +Transaction::Transaction(ModSecurity *ms, RulesSet *rules, void *logCbData) + : m_creationTimeStamp(utils::cpu_seconds()), + /* m_clientIpAddress(nullptr), */ + m_httpVersion(""), + /* m_serverIpAddress(""), */ + m_uri(""), + /* m_uri_no_query_string_decoded(""), */ m_ARGScombinedSizeDouble(0), + m_clientPort(0), + m_highestSeverityAction(255), + m_httpCodeReturned(200), + m_serverPort(0), + m_ms(ms), m_requestBodyType(UnknownFormat), m_requestBodyProcessor(UnknownFormat), - m_requestBodyAccess(Rules::PropertyNotSetConfigBoolean), - m_marker(""), - m_allowType(modsecurity::actions::disruptive::NoneAllowType), + m_rules(rules), + m_ruleRemoveById(), + m_ruleRemoveByIdRange(), + m_ruleRemoveByTag(), + m_ruleRemoveTargetByTag(), + m_ruleRemoveTargetById(), + m_requestBodyAccess(RulesSet::PropertyNotSetConfigBoolean), + m_auditLogModifier(), + m_ctlAuditEngine(AuditLog::AuditLogStatus::NotSetLogStatus), + m_rulesMessages(), + m_requestBody(), + m_responseBody(), + /* m_id(), */ m_skip_next(0), - m_creationTimeStamp(utils::cpu_seconds()), - m_logCbData(logCbData), - m_ms(ms), - m_secRuleEngine(RulesProperties::PropertyNotSetRuleEngine), + m_allowType(modsecurity::actions::disruptive::NoneAllowType), + m_uri_decoded(""), + m_actions(), + m_it(), + m_timeStamp(std::time(NULL)), m_collections(ms->m_global_collection, ms->m_ip_collection, ms->m_session_collection, ms->m_user_collection, ms->m_resource_collection), -#ifdef WITH_YAJL - m_json(new RequestBodyProcessor::JSON(this)), -#else - m_json(NULL), -#endif + m_matched(), #ifdef WITH_LIBXML2 m_xml(new RequestBodyProcessor::XML(this)), #else m_xml(NULL), #endif +#ifdef WITH_YAJL + m_json(new RequestBodyProcessor::JSON(this)), +#else + m_json(NULL), +#endif + m_secRuleEngine(RulesSetProperties::PropertyNotSetRuleEngine), + m_variableDuration(""), + m_variableEnvs(), + m_variableHighestSeverityAction(""), + m_variableRemoteUser(""), + m_variableTime(""), + m_variableTimeDay(""), + m_variableTimeEpoch(""), + m_variableTimeHour(""), + m_variableTimeMin(""), + m_variableTimeSec(""), + m_variableTimeWDay(""), + m_variableTimeYear(""), + m_logCbData(logCbData), TransactionAnchoredVariables(this) { - m_id = std::to_string(this->m_timeStamp) + \ - std::to_string(modsecurity::utils::generate_transaction_unique_id()); - m_rules->incrementReferenceCount(); + m_id = std::unique_ptr( new std::string( + std::to_string(m_timeStamp) + + std::to_string(modsecurity::utils::generate_transaction_unique_id()))); m_variableUrlEncodedError.set("0", 0); @@ -143,41 +173,69 @@ Transaction::Transaction(ModSecurity *ms, Rules *rules, void *logCbData) intervention::clean(&m_it); } -Transaction::Transaction(ModSecurity *ms, Rules *rules, char *id, void *logCbData) - : m_clientPort(0), - m_serverPort(0), - m_uri_no_query_string_decoded(""), - m_rules(rules), - m_timeStamp(std::time(NULL)), - m_httpCodeReturned(200), - m_highestSeverityAction(255), +Transaction::Transaction(ModSecurity *ms, RulesSet *rules, char *id, void *logCbData) + : m_creationTimeStamp(utils::cpu_seconds()), + /* m_clientIpAddress(""), */ + m_httpVersion(""), + /* m_serverIpAddress(""), */ + m_uri(""), + /* m_uri_no_query_string_decoded(""), */ m_ARGScombinedSizeDouble(0), + m_clientPort(0), + m_highestSeverityAction(255), + m_httpCodeReturned(200), + m_serverPort(0), + m_ms(ms), m_requestBodyType(UnknownFormat), m_requestBodyProcessor(UnknownFormat), - m_requestBodyAccess(Rules::PropertyNotSetConfigBoolean), - m_marker(""), - m_allowType(modsecurity::actions::disruptive::NoneAllowType), + m_rules(rules), + m_ruleRemoveById(), + m_ruleRemoveByIdRange(), + m_ruleRemoveByTag(), + m_ruleRemoveTargetByTag(), + m_ruleRemoveTargetById(), + m_requestBodyAccess(RulesSet::PropertyNotSetConfigBoolean), + m_auditLogModifier(), + m_ctlAuditEngine(AuditLog::AuditLogStatus::NotSetLogStatus), + m_rulesMessages(), + m_requestBody(), + m_responseBody(), + m_id(std::unique_ptr(new std::string(id))), m_skip_next(0), - m_creationTimeStamp(utils::cpu_seconds()), - m_logCbData(logCbData), - m_ms(ms), - m_secRuleEngine(RulesProperties::PropertyNotSetRuleEngine), + m_allowType(modsecurity::actions::disruptive::NoneAllowType), + m_uri_decoded(""), + m_actions(), + m_it(), + m_timeStamp(std::time(NULL)), m_collections(ms->m_global_collection, ms->m_ip_collection, ms->m_session_collection, ms->m_user_collection, ms->m_resource_collection), -#ifdef WITH_YAJL - m_json(new RequestBodyProcessor::JSON(this)), -#else - m_json(NULL), -#endif + m_matched(), #ifdef WITH_LIBXML2 m_xml(new RequestBodyProcessor::XML(this)), #else m_xml(NULL), #endif +#ifdef WITH_YAJL + m_json(new RequestBodyProcessor::JSON(this)), +#else + m_json(NULL), +#endif + m_secRuleEngine(RulesSetProperties::PropertyNotSetRuleEngine), + m_variableDuration(""), + m_variableEnvs(), + m_variableHighestSeverityAction(""), + m_variableRemoteUser(""), + m_variableTime(""), + m_variableTimeDay(""), + m_variableTimeEpoch(""), + m_variableTimeHour(""), + m_variableTimeMin(""), + m_variableTimeSec(""), + m_variableTimeWDay(""), + m_variableTimeYear(""), + m_logCbData(logCbData), TransactionAnchoredVariables(this) { - m_id = std::string(id); - m_rules->incrementReferenceCount(); m_variableUrlEncodedError.set("0", 0); @@ -196,8 +254,6 @@ Transaction::~Transaction() { m_rulesMessages.clear(); - m_rules->decrementReferenceCount(); - intervention::free(&m_it); intervention::clean(&m_it); @@ -222,12 +278,12 @@ Transaction::~Transaction() { * */ #ifndef NO_LOGS -void Transaction::debug(int level, std::string message) const { +void Transaction::debug(int level, const std::string& message) const { if (m_rules == NULL) { return; } - m_rules->debug(level, m_id, m_uri, message); + m_rules->debug(level, *m_id.get(), m_uri, message); } #endif @@ -254,18 +310,18 @@ void Transaction::debug(int level, std::string message) const { */ int Transaction::processConnection(const char *client, int cPort, const char *server, int sPort) { - this->m_clientIpAddress = client; - this->m_serverIpAddress = server; + m_clientIpAddress = std::unique_ptr(new std::string(client)); + m_serverIpAddress = std::unique_ptr(new std::string(server)); this->m_clientPort = cPort; this->m_serverPort = sPort; ms_dbg(4, "Transaction context created."); ms_dbg(4, "Starting phase CONNECTION. (SecRules 0)"); - m_variableRemoteHost.set(m_clientIpAddress, m_variableOffset); - m_variableUniqueID.set(m_id, m_variableOffset); - m_variableRemoteAddr.set(m_clientIpAddress, m_variableOffset); - m_variableServerAddr.set(m_serverIpAddress, m_variableOffset); + m_variableRemoteHost.set(*m_clientIpAddress.get(), m_variableOffset); + m_variableUniqueID.set(*m_id.get(), m_variableOffset); + m_variableRemoteAddr.set(*m_clientIpAddress.get(), m_variableOffset); + m_variableServerAddr.set(*m_serverIpAddress.get(), m_variableOffset); m_variableServerPort.set(std::to_string(this->m_serverPort), m_variableOffset); m_variableRemotePort.set(std::to_string(this->m_clientPort), @@ -286,7 +342,6 @@ bool Transaction::extractArguments(const std::string &orig, for (std::string t : key_value_sets) { char sep2 = '='; - int i = 0; size_t key_s = 0; size_t value_s = 0; int invalid = 0; @@ -334,17 +389,19 @@ bool Transaction::addArgument(const std::string& orig, const std::string& key, ms_dbg(4, "Adding request argument (" + orig + "): name \"" + \ key + "\", value \"" + value + "\""); - size_t k_offset = offset; + if (m_rules->m_argumentsLimit.m_set + && m_variableArgs.size() >= m_rules->m_argumentsLimit.m_value) { + ms_dbg(4, "Skipping request argument, over limit (" + std::to_string(m_rules->m_argumentsLimit.m_value) + ")") + return false; + } + offset = offset + key.size() + 1; m_variableArgs.set(key, value, offset); - m_variableArgsNames.set(key, key, k_offset); if (orig == "GET") { m_variableArgsGet.set(key, value, offset); - m_variableArgsGetNames.set(key, key, k_offset); } else if (orig == "POST") { m_variableArgsPost.set(key, value, offset); - m_variableArgsPostNames.set(key, key, k_offset); } m_ARGScombinedSizeDouble = m_ARGScombinedSizeDouble + \ @@ -390,11 +447,21 @@ int Transaction::processURI(const char *uri, const char *method, m_httpVersion = http_version; m_uri = uri; std::string uri_s(uri); - m_uri_decoded = utils::uri_decode(uri); - size_t pos = m_uri_decoded.find("?"); - size_t pos_raw = uri_s.find("?"); - size_t var_size = pos_raw; + // any uri-fragment that was received should only be retained in + // - m_uri + // - m_variableRequestURIRaw + // - m_variableRequestLine + size_t pos_raw_fragment = uri_s.find("#"); + if (pos_raw_fragment != std::string::npos) { + uri_s = uri_s.substr(0, pos_raw_fragment); + } + + size_t pos_raw_query = uri_s.find("?"); + + m_uri_decoded = utils::uri_decode(uri_s); + + size_t var_size = pos_raw_query; m_variableRequestMethod.set(method, 0); @@ -407,26 +474,28 @@ int Transaction::processURI(const char *uri, const char *method, m_variableOffset + requestLine.size() + 1); - - if (pos != std::string::npos) { - m_uri_no_query_string_decoded = std::string(m_uri_decoded, 0, pos); + size_t pos_query = m_uri_decoded.find("?"); + if (pos_query != std::string::npos) { + m_uri_no_query_string_decoded = std::unique_ptr( + new std::string(m_uri_decoded, 0, pos_query)); } else { - m_uri_no_query_string_decoded = std::string(m_uri_decoded); + m_uri_no_query_string_decoded = std::unique_ptr( + new std::string(m_uri_decoded)); } - if (pos_raw != std::string::npos) { - std::string qry = std::string(uri_s, pos_raw + 1, - uri_s.length() - (pos_raw + 1)); - m_variableQueryString.set(qry, pos_raw + 1 + if (pos_raw_query != std::string::npos) { + std::string qry = std::string(uri_s, pos_raw_query + 1, + uri_s.length() - (pos_raw_query + 1)); + m_variableQueryString.set(qry, pos_raw_query + 1 + std::string(method).size() + 1); } std::string path_info; - if (pos == std::string::npos) { + if (pos_query == std::string::npos) { path_info = std::string(m_uri_decoded, 0); } else { - path_info = std::string(m_uri_decoded, 0, pos); + path_info = std::string(m_uri_decoded, 0, pos_query); } if (var_size == std::string::npos) { var_size = uri_s.size(); @@ -438,7 +507,6 @@ int Transaction::processURI(const char *uri, const char *method, strlen(method) + 1, var_size); - size_t offset = path_info.find_last_of("/\\"); if (offset != std::string::npos && path_info.length() > offset + 1) { std::string basename = std::string(path_info, offset + 1, @@ -466,7 +534,7 @@ int Transaction::processURI(const char *uri, const char *method, } if (netloc != std::string::npos && fullDomain == true) { size_t path = m_uri_decoded.find("/", netloc); - if (path != std::string::npos && fullDomain == true) { + if (path != std::string::npos) { parsedURI = m_uri_decoded.substr(path); } } @@ -504,7 +572,7 @@ int Transaction::processURI(const char *uri, const char *method, int Transaction::processRequestHeaders() { ms_dbg(4, "Starting phase REQUEST_HEADERS. (SecRules 1)"); - if (getRuleEngineState() == Rules::DisabledRuleEngine) { + if (getRuleEngineState() == RulesSet::DisabledRuleEngine) { ms_dbg(4, "Rule engine disabled, returning..."); return true; } @@ -717,7 +785,7 @@ int Transaction::addRequestHeader(const unsigned char *key, size_t key_n, int Transaction::processRequestBody() { ms_dbg(4, "Starting phase REQUEST_BODY. (SecRules 2)"); - if (getRuleEngineState() == RulesProperties::DisabledRuleEngine) { + if (getRuleEngineState() == RulesSetProperties::DisabledRuleEngine) { ms_dbg(4, "Rule engine disabled, returning..."); return true; } @@ -736,25 +804,43 @@ int Transaction::processRequestBody() { */ std::unique_ptr a = m_variableRequestHeaders.resolveFirst( "Content-Type"); + + bool requestBodyNoFilesLimitExceeded = false; + if ((m_requestBodyType == WWWFormUrlEncoded) || + (m_requestBodyProcessor == JSONRequestBody) || + (m_requestBodyProcessor == XMLRequestBody)) { + if ((m_rules->m_requestBodyNoFilesLimit.m_set) + && (m_requestBody.str().size() > m_rules->m_requestBodyNoFilesLimit.m_value)) { + m_variableReqbodyError.set("1", 0); + m_variableReqbodyErrorMsg.set("Request body excluding files is bigger than the maximum expected.", 0); + m_variableInboundDataError.set("1", m_variableOffset); + ms_dbg(5, "Request body excluding files is bigger than the maximum expected."); + requestBodyNoFilesLimitExceeded = true; + } + } + #ifdef WITH_LIBXML2 if (m_requestBodyProcessor == XMLRequestBody) { - std::string error; - if (m_xml->init() == true) { - m_xml->processChunk(m_requestBody.str().c_str(), - m_requestBody.str().size(), - &error); - m_xml->complete(&error); - } - if (error.empty() == false) { - m_variableReqbodyError.set("1", m_variableOffset); - m_variableReqbodyErrorMsg.set("XML parsing error: " + error, - m_variableOffset); - m_variableReqbodyProcessorErrorMsg.set("XML parsing error: " \ - + error, m_variableOffset); - m_variableReqbodyProcessorError.set("1", m_variableOffset); - } else { - m_variableReqbodyError.set("0", m_variableOffset); - m_variableReqbodyProcessorError.set("0", m_variableOffset); + // large size might cause issues in the parsing itself; omit if exceeded + if (!requestBodyNoFilesLimitExceeded) { + std::string error; + if (m_xml->init() == true) { + m_xml->processChunk(m_requestBody.str().c_str(), + m_requestBody.str().size(), + &error); + m_xml->complete(&error); + } + if (error.empty() == false) { + m_variableReqbodyError.set("1", m_variableOffset); + m_variableReqbodyErrorMsg.set("XML parsing error: " + error, + m_variableOffset); + m_variableReqbodyProcessorErrorMsg.set("XML parsing error: " \ + + error, m_variableOffset); + m_variableReqbodyProcessorError.set("1", m_variableOffset); + } else { + m_variableReqbodyError.set("0", m_variableOffset); + m_variableReqbodyProcessorError.set("0", m_variableOffset); + } } #endif #if WITH_YAJL @@ -763,23 +849,29 @@ int Transaction::processRequestBody() { #else if (m_requestBodyProcessor == JSONRequestBody) { #endif - std::string error; - if (m_json->init() == true) { - m_json->processChunk(m_requestBody.str().c_str(), - m_requestBody.str().size(), - &error); - m_json->complete(&error); - } - if (error.empty() == false && m_requestBody.str().size() > 0) { - m_variableReqbodyError.set("1", m_variableOffset); - m_variableReqbodyProcessorError.set("1", m_variableOffset); - m_variableReqbodyErrorMsg.set("JSON parsing error: " + error, - m_variableOffset); - m_variableReqbodyProcessorErrorMsg.set("JSON parsing error: " \ - + error, m_variableOffset); - } else { - m_variableReqbodyError.set("0", m_variableOffset); - m_variableReqbodyProcessorError.set("0", m_variableOffset); + // large size might cause issues in the parsing itself; omit if exceeded + if (!requestBodyNoFilesLimitExceeded) { + std::string error; + if (m_rules->m_requestBodyJsonDepthLimit.m_set) { + m_json->setMaxDepth(m_rules->m_requestBodyJsonDepthLimit.m_value); + } + if (m_json->init() == true) { + m_json->processChunk(m_requestBody.str().c_str(), + m_requestBody.str().size(), + &error); + m_json->complete(&error); + } + if (error.empty() == false && m_requestBody.str().size() > 0) { + m_variableReqbodyError.set("1", m_variableOffset); + m_variableReqbodyProcessorError.set("1", m_variableOffset); + m_variableReqbodyErrorMsg.set("JSON parsing error: " + error, + m_variableOffset); + m_variableReqbodyProcessorErrorMsg.set("JSON parsing error: " \ + + error, m_variableOffset); + } else { + m_variableReqbodyError.set("0", m_variableOffset); + m_variableReqbodyProcessorError.set("0", m_variableOffset); + } } #endif #if defined(WITH_LIBXML2) or defined(WITH_YAJL) @@ -788,11 +880,13 @@ int Transaction::processRequestBody() { if (m_requestBodyType == MultiPartRequestBody) { #endif std::string error; + int reqbodyNoFilesLength = 0; if (a != NULL) { Multipart m(*a, this); if (m.init(&error) == true) { m.process(m_requestBody.str(), &error, m_variableOffset); } + reqbodyNoFilesLength = m.m_reqbody_no_files_length; m.multipart_complete(&error); } if (error.empty() == false) { @@ -802,13 +896,22 @@ int Transaction::processRequestBody() { m_variableOffset); m_variableReqbodyProcessorErrorMsg.set("Multipart parsing " \ "error: " + error, m_variableOffset); + } else if (((m_rules->m_requestBodyNoFilesLimit.m_set) + && (reqbodyNoFilesLength > m_rules->m_requestBodyNoFilesLimit.m_value))) { + m_variableReqbodyError.set("1", 0); + m_variableReqbodyErrorMsg.set("Request body excluding files is bigger than the maximum expected.", 0); + m_variableInboundDataError.set("1", m_variableOffset); + ms_dbg(5, "Request body excluding files is bigger than the maximum expected."); } else { m_variableReqbodyError.set("0", m_variableOffset); m_variableReqbodyProcessorError.set("0", m_variableOffset); } } else if (m_requestBodyType == WWWFormUrlEncoded) { m_variableOffset++; - extractArguments("POST", m_requestBody.str(), m_variableOffset); + // large size might cause issues in the parsing itself; omit if exceeded + if (!requestBodyNoFilesLimitExceeded) { + extractArguments("POST", m_requestBody.str(), m_variableOffset); + } } else if (m_requestBodyType != UnknownFormat) { /** * FIXME: double check to see if that is a valid scenario... @@ -830,8 +933,8 @@ int Transaction::processRequestBody() { m_variableReqbodyProcessorError.set("0", m_variableOffset); } - if (m_rules->m_secRequestBodyAccess == RulesProperties::FalseConfigBoolean) { - if (m_requestBodyAccess != RulesProperties::TrueConfigBoolean) { + if (m_rules->m_secRequestBodyAccess == RulesSetProperties::FalseConfigBoolean) { + if (m_requestBodyAccess != RulesSetProperties::TrueConfigBoolean) { ms_dbg(4, "Request body processing is disabled"); return true; } else { @@ -840,7 +943,7 @@ int Transaction::processRequestBody() { "action"); } } else { - if (m_requestBodyAccess == RulesProperties::FalseConfigBoolean) { + if (m_requestBodyAccess == RulesSetProperties::FalseConfigBoolean) { ms_dbg(4, "Request body processing is enabled, but " \ "disabled to this transaction due to ctl:requestBodyAccess " \ "action"); @@ -855,9 +958,9 @@ int Transaction::processRequestBody() { std::string fullRequest; std::vector l; m_variableRequestHeaders.resolve(&l); - for (auto &a : l) { - fullRequest = fullRequest + a->getKey() + ": " + a->getValue() + "\n"; - delete a; + for (auto &h : l) { + fullRequest = fullRequest + h->getKey() + ": " + h->getValue() + "\n"; + delete h; } fullRequest = fullRequest + "\n\n"; @@ -945,7 +1048,7 @@ int Transaction::appendRequestBody(const unsigned char *buf, size_t len) { ms_dbg(5, "Request body is bigger than the maximum expected."); if (this->m_rules->m_requestBodyLimitAction == - Rules::BodyLimitAction::ProcessPartialBodyLimitAction) { + RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction) { size_t spaceLeft = this->m_rules->m_requestBodyLimit.m_value - current_size; this->m_requestBody.write(reinterpret_cast(buf), @@ -954,10 +1057,10 @@ int Transaction::appendRequestBody(const unsigned char *buf, size_t len) { return false; } else { if (this->m_rules->m_requestBodyLimitAction == - Rules::BodyLimitAction::RejectBodyLimitAction) { + RulesSet::BodyLimitAction::RejectBodyLimitAction) { ms_dbg(5, "Request body limit is marked to reject the " \ "request"); - if (getRuleEngineState() == Rules::EnabledRuleEngine) { + if (getRuleEngineState() == RulesSet::EnabledRuleEngine) { intervention::free(&m_it); m_it.log = strdup("Request body limit is marked to " \ "reject the request"); @@ -1002,7 +1105,7 @@ int Transaction::processResponseHeaders(int code, const std::string& proto) { m_variableResponseStatus.set(std::to_string(code), m_variableOffset); m_variableResponseProtocol.set(proto, m_variableOffset); - if (getRuleEngineState() == Rules::DisabledRuleEngine) { + if (getRuleEngineState() == RulesSet::DisabledRuleEngine) { ms_dbg(4, "Rule engine disabled, returning..."); return true; } @@ -1123,12 +1226,12 @@ int Transaction::addResponseHeader(const unsigned char *key, size_t key_n, int Transaction::processResponseBody() { ms_dbg(4, "Starting phase RESPONSE_BODY. (SecRules 4)"); - if (getRuleEngineState() == Rules::DisabledRuleEngine) { + if (getRuleEngineState() == RulesSet::DisabledRuleEngine) { ms_dbg(4, "Rule engine disabled, returning..."); return true; } - if (m_rules->m_secResponseBodyAccess != RulesProperties::TrueConfigBoolean) { + if (m_rules->m_secResponseBodyAccess != RulesSetProperties::TrueConfigBoolean) { ms_dbg(4, "Response body is disabled, returning... " + std::to_string(m_rules->m_secResponseBodyAccess)); return true; } @@ -1143,7 +1246,7 @@ int Transaction::processResponseBody() { + ". It is not marked to be inspected."); std::string validContetTypes(""); for (std::set::iterator i = bi.begin(); - i != bi.end(); i++) { + i != bi.end(); ++i) { validContetTypes.append(*i + " "); } ms_dbg(8, "Content-Type(s) marked to be inspected: " \ @@ -1204,7 +1307,7 @@ int Transaction::appendResponseBody(const unsigned char *buf, size_t len) { m_variableOutboundDataError.set("1", m_variableOffset); ms_dbg(5, "Response body is bigger than the maximum expected."); if (this->m_rules->m_responseBodyLimitAction == - Rules::BodyLimitAction::ProcessPartialBodyLimitAction) { + RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction) { size_t spaceLeft = this->m_rules->m_responseBodyLimit.m_value \ - current_size; this->m_responseBody.write(reinterpret_cast(buf), @@ -1213,10 +1316,10 @@ int Transaction::appendResponseBody(const unsigned char *buf, size_t len) { return false; } else { if (this->m_rules->m_responseBodyLimitAction == - Rules::BodyLimitAction::RejectBodyLimitAction) { + RulesSet::BodyLimitAction::RejectBodyLimitAction) { ms_dbg(5, "Response body limit is marked to reject the " \ "request"); - if (getRuleEngineState() == Rules::EnabledRuleEngine) { + if (getRuleEngineState() == RulesSet::EnabledRuleEngine) { intervention::free(&m_it); m_it.log = strdup("Response body limit is marked to reject " \ "the request"); @@ -1245,14 +1348,13 @@ int Transaction::appendResponseBody(const unsigned char *buf, size_t len) { * contents of the response body, otherwise there is no need to call this * method. * + * WARN: This is a skeleton that it is not in use yet. + * * @return It returns a buffer (const char *) - * @retval >0 body was update and available. - * @retval NULL Nothing was updated. * */ -const char *Transaction::getResponseBody() { - // int there_is_update = this->rules->loadResponseBodyFromJS(this); - return this->m_responseBody.str().c_str(); +const char *Transaction::getResponseBody() const { + return strdup(this->m_responseBody.str().c_str()); } @@ -1311,7 +1413,7 @@ size_t Transaction::getRequestBodyLength() { int Transaction::processLogging() { ms_dbg(4, "Starting phase LOGGING. (SecRules 5)"); - if (getRuleEngineState() == Rules::DisabledRuleEngine) { + if (getRuleEngineState() == RulesSet::DisabledRuleEngine) { ms_dbg(4, "Rule engine disabled, returning..."); return true; } @@ -1324,7 +1426,7 @@ int Transaction::processLogging() { ms_dbg(8, "Checking if this request is suitable to be " \ "saved as an audit log."); - if (this->m_auditLogModifier.size() > 0) { + if (!this->m_auditLogModifier.empty()) { ms_dbg(4, "There was an audit log modifier for this transaction."); std::list>::iterator it; ms_dbg(7, "AuditLog parts before modification(s): " + @@ -1401,11 +1503,14 @@ std::string Transaction::toOldAuditLogFormatIndex(const std::string &filename, ss << utils::string::dash_if_empty( m_variableRequestHeaders.resolveFirst("Host").get()) << " "; - ss << utils::string::dash_if_empty(this->m_clientIpAddress.c_str()) << " "; + ss << utils::string::dash_if_empty(this->m_clientIpAddress->c_str()) << " "; /** TODO: Check variable */ variables::RemoteUser *r = new variables::RemoteUser("REMOTE_USER"); std::vector l; r->evaluate(this, NULL, &l); + for (auto &a : l) { + delete a; + } delete r; ss << utils::string::dash_if_empty( @@ -1433,7 +1538,7 @@ std::string Transaction::toOldAuditLogFormatIndex(const std::string &filename, ss << utils::string::dash_if_empty( m_variableRequestHeaders.resolveFirst("User-Agent").get()); ss << "\" "; - ss << this->m_id << " "; + ss << *m_id.get() << " "; /** TODO: Check variable */ ss << utils::string::dash_if_empty( m_variableRequestHeaders.resolveFirst("REFERER").get()) << " "; @@ -1459,10 +1564,10 @@ std::string Transaction::toOldAuditLogFormat(int parts, audit_log << "--" << trailer << "-" << "A--" << std::endl; strftime(tstr, 299, "[%d/%b/%Y:%H:%M:%S %z]", &timeinfo); audit_log << tstr; - audit_log << " " << this->m_id.c_str(); - audit_log << " " << this->m_clientIpAddress; + audit_log << " " << m_id->c_str(); + audit_log << " " << this->m_clientIpAddress->c_str(); audit_log << " " << this->m_clientPort; - audit_log << " " << this->m_serverIpAddress; + audit_log << " " << m_serverIpAddress->c_str(); audit_log << " " << this->m_serverPort; audit_log << std::endl; @@ -1579,13 +1684,13 @@ std::string Transaction::toJSON(int parts) { yajl_gen_map_open(g); /* Part: A (header mandatory) */ - LOGFY_ADD("client_ip", this->m_clientIpAddress.c_str()); + LOGFY_ADD("client_ip", this->m_clientIpAddress->c_str()); LOGFY_ADD("time_stamp", ts.c_str()); LOGFY_ADD("server_id", uniqueId.c_str()); LOGFY_ADD_NUM("client_port", m_clientPort); - LOGFY_ADD("host_ip", m_serverIpAddress.c_str()); + LOGFY_ADD("host_ip", m_serverIpAddress->c_str()); LOGFY_ADD_NUM("host_port", m_serverPort); - LOGFY_ADD("unique_id", this->m_id.c_str()); + LOGFY_ADD("unique_id", m_id->c_str()); /* request */ yajl_gen_string(g, reinterpret_cast("request"), @@ -1667,8 +1772,8 @@ std::string Transaction::toJSON(int parts) { /* producer > engine state */ LOGFY_ADD("secrules_engine", - Rules::ruleEngineStateString( - (RulesProperties::RuleEngine) getRuleEngineState())); + RulesSet::ruleEngineStateString( + (RulesSetProperties::RuleEngine) getRuleEngineState())); /* producer > components */ yajl_gen_string(g, @@ -1701,7 +1806,7 @@ std::string Transaction::toJSON(int parts) { LOGFY_ADD("match", a.m_match.c_str()); LOGFY_ADD("reference", a.m_reference.c_str()); LOGFY_ADD("ruleId", std::to_string(a.m_ruleId).c_str()); - LOGFY_ADD("file", a.m_ruleFile.c_str()); + LOGFY_ADD("file", a.m_ruleFile->c_str()); LOGFY_ADD("lineNumber", std::to_string(a.m_ruleLine).c_str()); LOGFY_ADD("data", a.m_data.c_str()); LOGFY_ADD("severity", std::to_string(a.m_severity).c_str()); @@ -1754,8 +1859,8 @@ void Transaction::serverLog(std::shared_ptr rm) { } -int Transaction::getRuleEngineState() { - if (m_secRuleEngine == RulesProperties::PropertyNotSetRuleEngine) { +int Transaction::getRuleEngineState() const { + if (m_secRuleEngine == RulesSetProperties::PropertyNotSetRuleEngine) { return m_rules->m_secRuleEngine; } @@ -1806,11 +1911,11 @@ int Transaction::updateStatusCode(int code) { * */ extern "C" Transaction *msc_new_transaction(ModSecurity *ms, - Rules *rules, void *logCbData) { + RulesSet *rules, void *logCbData) { return new Transaction(ms, rules, logCbData); } extern "C" Transaction *msc_new_transaction_with_id(ModSecurity *ms, - Rules *rules, char *id, void *logCbData) { + RulesSet *rules, char *id, void *logCbData) { return new Transaction(ms, rules, id, logCbData); } @@ -2135,10 +2240,6 @@ extern "C" int msc_add_n_response_header(Transaction *transaction, * * @param transaction ModSecurity transaction. * - * @returns If the operation was successful or not. - * @retval 1 Operation was successful. - * @retval 0 Operation failed. - * */ extern "C" void msc_transaction_cleanup(Transaction *transaction) { delete transaction; diff --git a/src/deps/src/ModSecurity/src/unique_id.cc b/src/deps/src/ModSecurity/src/unique_id.cc index 7334d5a45..a78ebd751 100644 --- a/src/deps/src/ModSecurity/src/unique_id.cc +++ b/src/deps/src/ModSecurity/src/unique_id.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -72,7 +72,7 @@ void UniqueId::fillUniqueId() { // Based on: // http://stackoverflow.com/questions/16858782/how-to-obtain-almost-unique-system-identifier-in-a-cross-platform-way -std::string const UniqueId::machineName() { +std::string UniqueId::machineName() { char machine_name[MAX_MACHINE_NAME_SIZE]; size_t len = MAX_MACHINE_NAME_SIZE; #ifdef WIN32 @@ -105,7 +105,7 @@ failed: #endif } -std::string const UniqueId::ethernetMacAddress() { +std::string UniqueId::ethernetMacAddress() { char mac[MAC_ADDRESS_SIZE]; memset(mac, '\0', sizeof(char)*(MAC_ADDRESS_SIZE)); #ifdef DARWIN @@ -159,7 +159,6 @@ std::string const UniqueId::ethernetMacAddress() { } if (ioctl(sock, SIOCGIFHWADDR, ifr) == 0) { - int i = 0; if (!ifr->ifr_addr.sa_data[0] && !ifr->ifr_addr.sa_data[1] && !ifr->ifr_addr.sa_data[2]) { continue; @@ -223,7 +222,9 @@ std::string const UniqueId::ethernetMacAddress() { free(pAdapterInfo); #endif +#if defined(__linux__) || defined(__gnu_linux__) || defined(DARWIN) || defined(WIN32) end: +#endif return std::string(reinterpret_cast(mac)); #if defined(__linux__) || defined(__gnu_linux__) || defined(DARWIN) || defined(WIN32) failed: diff --git a/src/deps/src/ModSecurity/src/unique_id.h b/src/deps/src/ModSecurity/src/unique_id.h index 437ef657d..7ed6e32cf 100644 --- a/src/deps/src/ModSecurity/src/unique_id.h +++ b/src/deps/src/ModSecurity/src/unique_id.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -46,8 +46,8 @@ class UniqueId { } void fillUniqueId(); - std::string const machineName(); - std::string const ethernetMacAddress(); + static std::string machineName(); + static std::string ethernetMacAddress(); std::string uniqueId_str; diff --git a/src/deps/src/ModSecurity/src/utils/acmp.cc b/src/deps/src/ModSecurity/src/utils/acmp.cc index 1a68f6662..2bfe7acb9 100644 --- a/src/deps/src/ModSecurity/src/utils/acmp.cc +++ b/src/deps/src/ModSecurity/src/utils/acmp.cc @@ -1,6 +1,6 @@ /* * ModSecurity for Apache 2.x, http://www.modsecurity.org/ -* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/) +* Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License.  You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/acmp.h b/src/deps/src/ModSecurity/src/utils/acmp.h index cd6674336..1af454e1d 100644 --- a/src/deps/src/ModSecurity/src/utils/acmp.h +++ b/src/deps/src/ModSecurity/src/utils/acmp.h @@ -1,6 +1,6 @@ /* * ModSecurity for Apache 2.x, http://www.modsecurity.org/ -* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/) +* Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License.  You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/base64.cc b/src/deps/src/ModSecurity/src/utils/base64.cc index 5ddc6b84f..ebbb7393c 100644 --- a/src/deps/src/ModSecurity/src/utils/base64.cc +++ b/src/deps/src/ModSecurity/src/utils/base64.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -119,7 +119,7 @@ void Base64::decode_forgiven_engine(unsigned char *plain_text, int i = 0, j = 0, k = 0; int ch = 0; static const char b64_pad = '='; - static int b64_reverse_t[256] = { + static const int b64_reverse_t[256] = { -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -2, -2, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 62, -2, -2, -2, 63, @@ -152,9 +152,9 @@ void Base64::decode_forgiven_engine(unsigned char *plain_text, ch = b64_reverse_t[ch]; if (ch < 0) { continue; - } else if (ch == -2) { + /*} else if (ch == -2) { *aiming_size = 0; - return; + return;*/ } switch (i % 4) { case 0: diff --git a/src/deps/src/ModSecurity/src/utils/base64.h b/src/deps/src/ModSecurity/src/utils/base64.h index ab63449e8..97639a541 100644 --- a/src/deps/src/ModSecurity/src/utils/base64.h +++ b/src/deps/src/ModSecurity/src/utils/base64.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,9 +32,10 @@ class Base64 { static std::string decode(const std::string& data); static std::string decode_forgiven(const std::string& data); - static void decode_forgiven_engine(unsigned char *output, - size_t output_size, size_t *aiming_size, const unsigned char *input, - size_t input_size); + static void decode_forgiven_engine(unsigned char *plain_text, + size_t plain_text_size, size_t *aiming_size, + const unsigned char *encoded, + size_t input_len); }; diff --git a/src/deps/src/ModSecurity/src/utils/decode.cc b/src/deps/src/ModSecurity/src/utils/decode.cc index 04dc12180..c63110119 100644 --- a/src/deps/src/ModSecurity/src/utils/decode.cc +++ b/src/deps/src/ModSecurity/src/utils/decode.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/decode.h b/src/deps/src/ModSecurity/src/utils/decode.h index 983047221..e0e31bcbf 100644 --- a/src/deps/src/ModSecurity/src/utils/decode.h +++ b/src/deps/src/ModSecurity/src/utils/decode.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/geo_lookup.cc b/src/deps/src/ModSecurity/src/utils/geo_lookup.cc index 313d81ff4..33a80be5c 100644 --- a/src/deps/src/ModSecurity/src/utils/geo_lookup.cc +++ b/src/deps/src/ModSecurity/src/utils/geo_lookup.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -56,8 +56,12 @@ void GeoLookup::cleanUp() { bool GeoLookup::setDataBase(const std::string& filePath, std::string *err) { +#ifdef WITH_MAXMIND std::string intMax; +#endif +#ifdef WITH_GEOIP std::string intGeo; +#endif #ifdef WITH_MAXMIND int status = MMDB_open(filePath.c_str(), MMDB_MODE_MMAP, &mmdb); @@ -70,7 +74,7 @@ bool GeoLookup::setDataBase(const std::string& filePath, #ifdef WITH_GEOIP if (m_version == NOT_LOADED) { - m_gi = GeoIP_open(filePath.c_str(), GEOIP_INDEX_CACHE); + m_gi = GeoIP_open(filePath.c_str(), GEOIP_MEMORY_CACHE); if (m_gi == NULL) { intGeo.append("GeoIP: Can't open: " + filePath + "."); } else { @@ -85,19 +89,22 @@ bool GeoLookup::setDataBase(const std::string& filePath, #ifdef WITH_MAXMIND err->append(" libMaxMind"); #endif - #ifdef WITH_GEOIP err->append(" GeoIP"); #endif err->append("."); - if (intMax.size() > 0) { +#ifdef WITH_MAXMIND + if (!intMax.empty()) { err->append(" " + intMax); - } - if (intGeo.size() > 0) { +#endif +#ifdef WITH_GEOIP + if (!intGeo.empty()) { err->append(" " + intGeo); } +#endif + return false; } @@ -106,7 +113,7 @@ bool GeoLookup::setDataBase(const std::string& filePath, bool GeoLookup::lookup(const std::string& target, Transaction *trans, - std::function debug) { + std::function debug) const { if (m_version == NOT_LOADED) { if (debug) { @@ -120,7 +127,6 @@ bool GeoLookup::lookup(const std::string& target, Transaction *trans, if (m_version == VERSION_MAXMIND) { int gai_error, mmdb_error; MMDB_lookup_result_s r; - int status; r = MMDB_lookup_string(&mmdb, target.c_str(), &gai_error, &mmdb_error); @@ -145,7 +151,7 @@ bool GeoLookup::lookup(const std::string& target, Transaction *trans, } else { MMDB_entry_data_s entry_data; - status = MMDB_get_value(&r.entry, &entry_data, + int status = MMDB_get_value(&r.entry, &entry_data, "country", "iso_code", NULL); if (status == MMDB_SUCCESS && entry_data.has_data) { trans->m_variableGeo.set("COUNTRY_CODE", diff --git a/src/deps/src/ModSecurity/src/utils/geo_lookup.h b/src/deps/src/ModSecurity/src/utils/geo_lookup.h index c1e3ab492..33428e0c8 100644 --- a/src/deps/src/ModSecurity/src/utils/geo_lookup.h +++ b/src/deps/src/ModSecurity/src/utils/geo_lookup.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -49,15 +49,16 @@ class GeoLookup { bool setDataBase(const std::string& filePath, std::string *err); void cleanUp(); - bool lookup(const std::string& target, Transaction *t, - std::function callback); + bool lookup(const std::string& target, Transaction *transaction, + std::function debug) const; private: GeoLookup() : + m_version(NOT_LOADED) #if WITH_GEOIP - m_gi(NULL), + ,m_gi(NULL) #endif - m_version(NOT_LOADED) { } + { } ~GeoLookup(); GeoLookup(GeoLookup const&); void operator=(GeoLookup const&); diff --git a/src/deps/src/ModSecurity/src/utils/https_client.cc b/src/deps/src/ModSecurity/src/utils/https_client.cc index 5db88a2c1..1ba5fd864 100644 --- a/src/deps/src/ModSecurity/src/utils/https_client.cc +++ b/src/deps/src/ModSecurity/src/utils/https_client.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -64,7 +64,7 @@ bool HttpsClient::download(const std::string &uri) { CURL *curl; CURLcode res; std::string uniqueId = "ModSec-unique-id: " + UniqueId::uniqueId(); - std::string status = "ModSec-status: " MODSECURITY_VERSION_NUM; + std::string status = "ModSec-status: " + std::to_string(MODSECURITY_VERSION_NUM); curl = curl_easy_init(); if (!curl) { diff --git a/src/deps/src/ModSecurity/src/utils/https_client.h b/src/deps/src/ModSecurity/src/utils/https_client.h index 3eca6fdd6..2f38218fc 100644 --- a/src/deps/src/ModSecurity/src/utils/https_client.h +++ b/src/deps/src/ModSecurity/src/utils/https_client.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -47,7 +47,7 @@ class HttpsClient { size_t handle_impl(char * data, size_t size, size_t nmemb); void setKey(const std::string& key); void setRequestType(const std::string& requestType); - void setRequestBody(const std::string& requestType); + void setRequestBody(const std::string& requestBody); std::string error; private: diff --git a/src/deps/src/ModSecurity/src/utils/ip_tree.cc b/src/deps/src/ModSecurity/src/utils/ip_tree.cc index 25e06e006..c4b7349de 100644 --- a/src/deps/src/ModSecurity/src/utils/ip_tree.cc +++ b/src/deps/src/ModSecurity/src/utils/ip_tree.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/ip_tree.h b/src/deps/src/ModSecurity/src/utils/ip_tree.h index d14f0f4bd..ea560acb1 100644 --- a/src/deps/src/ModSecurity/src/utils/ip_tree.h +++ b/src/deps/src/ModSecurity/src/utils/ip_tree.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/md5.cc b/src/deps/src/ModSecurity/src/utils/md5.cc index 0601bf93e..847460078 100644 --- a/src/deps/src/ModSecurity/src/utils/md5.cc +++ b/src/deps/src/ModSecurity/src/utils/md5.cc @@ -7,7 +7,7 @@ namespace modsecurity { namespace Utils { -std::string Md5::hexdigest(std::string& input) { +std::string Md5::hexdigest(const std::string& input) { unsigned char digest[16]; mbedtls_md5(reinterpret_cast(input.c_str()), @@ -22,7 +22,7 @@ std::string Md5::hexdigest(std::string& input) { } -std::string Md5::digest(std::string& input) { +std::string Md5::digest(const std::string& input) { unsigned char output[16]; std::string ret; diff --git a/src/deps/src/ModSecurity/src/utils/md5.h b/src/deps/src/ModSecurity/src/utils/md5.h index 8534dac7c..b6ebc1201 100644 --- a/src/deps/src/ModSecurity/src/utils/md5.h +++ b/src/deps/src/ModSecurity/src/utils/md5.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,8 +31,8 @@ class Md5 { public: Md5() { } - static std::string hexdigest(std::string& input); - static std::string digest(std::string& input); + static std::string hexdigest(const std::string& input); + static std::string digest(const std::string& input); }; } // namespace Utils diff --git a/src/deps/src/ModSecurity/src/utils/msc_tree.cc b/src/deps/src/ModSecurity/src/utils/msc_tree.cc index 248122421..1fc9201a7 100644 --- a/src/deps/src/ModSecurity/src/utils/msc_tree.cc +++ b/src/deps/src/ModSecurity/src/utils/msc_tree.cc @@ -1,6 +1,6 @@ /* * ModSecurity for Apache 2.x, http://www.modsecurity.org/ - * Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License.  You may obtain a copy of the License at @@ -290,7 +290,7 @@ TreeNode *CPTAddElement(unsigned char *ipdata, unsigned int ip_bitmask, CPTTree unsigned char *buffer = NULL; unsigned char bitlen = 0; int bit_validation = 0, test_bit = 0; - int i = 0; + size_t i = 0; unsigned int x, y; TreeNode *node = NULL, *new_node = NULL; TreeNode *parent = NULL, *i_node = NULL; diff --git a/src/deps/src/ModSecurity/src/utils/msc_tree.h b/src/deps/src/ModSecurity/src/utils/msc_tree.h index 6f79ae086..837eb24b9 100644 --- a/src/deps/src/ModSecurity/src/utils/msc_tree.h +++ b/src/deps/src/ModSecurity/src/utils/msc_tree.h @@ -1,6 +1,6 @@ /* * ModSecurity for Apache 2.x, http://www.modsecurity.org/ -* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/) +* Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License.  You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/phase.h b/src/deps/src/ModSecurity/src/utils/phase.h index e0943e348..0ec9041b3 100644 --- a/src/deps/src/ModSecurity/src/utils/phase.h +++ b/src/deps/src/ModSecurity/src/utils/phase.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/random.cc b/src/deps/src/ModSecurity/src/utils/random.cc index 6c00a8f43..ca15bdc7e 100644 --- a/src/deps/src/ModSecurity/src/utils/random.cc +++ b/src/deps/src/ModSecurity/src/utils/random.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/random.h b/src/deps/src/ModSecurity/src/utils/random.h index 870da50ed..07e9b155b 100644 --- a/src/deps/src/ModSecurity/src/utils/random.h +++ b/src/deps/src/ModSecurity/src/utils/random.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/regex.cc b/src/deps/src/ModSecurity/src/utils/regex.cc index 461f0288a..45878ed09 100644 --- a/src/deps/src/ModSecurity/src/utils/regex.cc +++ b/src/deps/src/ModSecurity/src/utils/regex.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,11 +15,6 @@ #include "src/utils/regex.h" -#include -#include -#include -#include -#include #include #include @@ -28,29 +23,76 @@ #include "src/utils/geo_lookup.h" +#ifndef WITH_PCRE2 #if PCRE_HAVE_JIT #define pcre_study_opt PCRE_STUDY_JIT_COMPILE #else #define pcre_study_opt 0 #endif +#endif namespace modsecurity { namespace Utils { +// Helper function to tell us if the current config indicates CRLF is a valid newline sequence +bool crlfIsNewline() { +#if WITH_PCRE2 + uint32_t newline = 0; + pcre2_config(PCRE2_CONFIG_NEWLINE, &newline); + bool crlf_is_newline = + newline == PCRE2_NEWLINE_ANY || + newline == PCRE2_NEWLINE_CRLF || + newline == PCRE2_NEWLINE_ANYCRLF; +#else + int d = 0; + pcre_config(PCRE_CONFIG_NEWLINE, &d); -Regex::Regex(const std::string& pattern_) + unsigned int option_bits = (d == 13)? PCRE_NEWLINE_CR : + (d == 10)? PCRE_NEWLINE_LF : + (d == (13<<8 | 10))? PCRE_NEWLINE_CRLF : + (d == -2)? PCRE_NEWLINE_ANYCRLF : + (d == -1)? PCRE_NEWLINE_ANY : 0; + + bool crlf_is_newline = + option_bits == PCRE_NEWLINE_ANY || + option_bits == PCRE_NEWLINE_CRLF || + option_bits == PCRE_NEWLINE_ANYCRLF; +#endif + return crlf_is_newline; +} + +Regex::Regex(const std::string& pattern_, bool ignoreCase) : pattern(pattern_.empty() ? ".*" : pattern_) { +#if WITH_PCRE2 + PCRE2_SPTR pcre2_pattern = reinterpret_cast(pattern.c_str()); + uint32_t pcre2_options = (PCRE2_DOTALL|PCRE2_MULTILINE); + if (ignoreCase) { + pcre2_options |= PCRE2_CASELESS; + } + int errornumber = 0; + PCRE2_SIZE erroroffset = 0; + m_pc = pcre2_compile(pcre2_pattern, PCRE2_ZERO_TERMINATED, + pcre2_options, &errornumber, &erroroffset, NULL); +#else const char *errptr = NULL; int erroffset; + int flags = (PCRE_DOTALL|PCRE_MULTILINE); - m_pc = pcre_compile(pattern.c_str(), PCRE_DOTALL|PCRE_MULTILINE, + if (ignoreCase == true) { + flags |= PCRE_CASELESS; + } + m_pc = pcre_compile(pattern.c_str(), flags, &errptr, &erroffset, NULL); m_pce = pcre_study(m_pc, pcre_study_opt, &errptr); +#endif } Regex::~Regex() { +#if WITH_PCRE2 + pcre2_code_free(m_pc); +#else if (m_pc != NULL) { pcre_free(m_pc); m_pc = NULL; @@ -63,29 +105,40 @@ Regex::~Regex() { #endif m_pce = NULL; } +#endif } std::list Regex::searchAll(const std::string& s) const { - const char *subject = s.c_str(); - const std::string tmpString = std::string(s.c_str(), s.size()); - int ovector[OVECCOUNT]; - int rc, i, offset = 0; std::list retList; + int rc; +#ifdef WITH_PCRE2 + PCRE2_SPTR pcre2_s = reinterpret_cast(s.c_str()); + PCRE2_SIZE offset = 0; + + pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(m_pc, NULL); + do { + rc = pcre2_match(m_pc, pcre2_s, s.length(), + offset, 0, match_data, NULL); + PCRE2_SIZE *ovector = pcre2_get_ovector_pointer(match_data); +#else + const char *subject = s.c_str(); + int ovector[OVECCOUNT]; + int offset = 0; do { rc = pcre_exec(m_pc, m_pce, subject, s.size(), offset, 0, ovector, OVECCOUNT); - - for (i = 0; i < rc; i++) { +#endif + for (int i = 0; i < rc; i++) { size_t start = ovector[2*i]; size_t end = ovector[2*i+1]; size_t len = end - start; if (end > s.size()) { - rc = 0; + rc = -1; break; } - std::string match = std::string(tmpString, start, len); + std::string match = std::string(s, start, len); offset = start + len; retList.push_front(SMatch(match, start)); @@ -96,27 +149,166 @@ std::list Regex::searchAll(const std::string& s) const { } } while (rc > 0); +#ifdef WITH_PCRE2 + pcre2_match_data_free(match_data); +#endif return retList; } +bool Regex::searchOneMatch(const std::string& s, std::vector& captures) const { +#ifdef WITH_PCRE2 + PCRE2_SPTR pcre2_s = reinterpret_cast(s.c_str()); + pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(m_pc, NULL); + int rc = pcre2_match(m_pc, pcre2_s, s.length(), 0, 0, match_data, NULL); + PCRE2_SIZE *ovector = pcre2_get_ovector_pointer(match_data); +#else + const char *subject = s.c_str(); + int ovector[OVECCOUNT]; + + int rc = pcre_exec(m_pc, m_pce, subject, s.size(), 0, 0, ovector, OVECCOUNT); +#endif + + for (int i = 0; i < rc; i++) { + size_t start = ovector[2*i]; + size_t end = ovector[2*i+1]; + size_t len = end - start; + if (end > s.size()) { + continue; + } + SMatchCapture capture(i, start, len); + captures.push_back(capture); + } + +#ifdef WITH_PCRE2 + pcre2_match_data_free(match_data); +#endif + return (rc > 0); +} + +bool Regex::searchGlobal(const std::string& s, std::vector& captures) const { + bool prev_match_zero_length = false; +#ifdef WITH_PCRE2 + PCRE2_SPTR pcre2_s = reinterpret_cast(s.c_str()); + PCRE2_SIZE startOffset = 0; + + pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(m_pc, NULL); + while (startOffset <= s.length()) { + uint32_t pcre2_options = 0; + if (prev_match_zero_length) { + pcre2_options = PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED; + } + int rc = pcre2_match(m_pc, pcre2_s, s.length(), + startOffset, pcre2_options, match_data, NULL); + PCRE2_SIZE *ovector = pcre2_get_ovector_pointer(match_data); + +#else + const char *subject = s.c_str(); + int startOffset = 0; + + while (startOffset <= s.length()) { + int ovector[OVECCOUNT]; + int pcre_options = 0; + if (prev_match_zero_length) { + pcre_options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED; + } + int rc = pcre_exec(m_pc, m_pce, subject, s.length(), startOffset, pcre_options, ovector, OVECCOUNT); + +#endif + if (rc > 0) { + size_t firstGroupForThisFullMatch = captures.size(); + for (int i = 0; i < rc; i++) { + size_t start = ovector[2*i]; + size_t end = ovector[2*i+1]; + size_t len = end - start; + if (end > s.length()) { + continue; + } + SMatchCapture capture(firstGroupForThisFullMatch + i, start, len); + captures.push_back(capture); + + if (i == 0) { + if (len > 0) { + // normal case; next call to pcre_exec should start after the end of the last full match string + startOffset = end; + prev_match_zero_length = false; + } else { + if ( startOffset == s.length()) { + // zero-length match at end of string; force end of while-loop + startOffset++; + } else { + // zero-length match mid-string; adjust next match attempt + prev_match_zero_length = true; + } + } + } + } + } else { + if (prev_match_zero_length) { + // The n-1 search found a zero-length match, so we did a subsequent search + // with the special flags. That subsequent exec did not find a match, so now advance + // by one character (unless CRLF, then advance by two) + startOffset++; + if (crlfIsNewline() && (startOffset < s.length()) && (s[startOffset-1] == '\r') + && (s[startOffset] == '\n')) { + startOffset++; + } + prev_match_zero_length = false; + } else { + // normal case; no match on most recent scan (with options=0). We are done. + break; + } + } + } + +#ifdef WITH_PCRE2 + pcre2_match_data_free(match_data); +#endif + return (captures.size() > 0); +} + int Regex::search(const std::string& s, SMatch *match) const { +#ifdef WITH_PCRE2 + PCRE2_SPTR pcre2_s = reinterpret_cast(s.c_str()); + pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(m_pc, NULL); + int ret = pcre2_match(m_pc, pcre2_s, s.length(), + 0, 0, match_data, NULL) > 0; + + if (ret > 0) { // match + PCRE2_SIZE *ovector = pcre2_get_ovector_pointer(match_data); +#else int ovector[OVECCOUNT]; int ret = pcre_exec(m_pc, m_pce, s.c_str(), s.size(), 0, 0, ovector, OVECCOUNT) > 0; if (ret > 0) { +#endif *match = SMatch( std::string(s, ovector[ret-1], ovector[ret] - ovector[ret-1]), 0); } +#ifdef WITH_PCRE2 + pcre2_match_data_free(match_data); +#endif return ret; } int Regex::search(const std::string& s) const { +#ifdef WITH_PCRE2 + PCRE2_SPTR pcre2_s = reinterpret_cast(s.c_str()); + pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(m_pc, NULL); + int rc = pcre2_match(m_pc, pcre2_s, s.length(), 0, 0, match_data, NULL); + pcre2_match_data_free(match_data); + if (rc > 0) { + return 1; // match + } else { + return 0; // no match + } +#else int ovector[OVECCOUNT]; return pcre_exec(m_pc, m_pce, s.c_str(), s.size(), 0, 0, ovector, OVECCOUNT) > 0; +#endif } } // namespace Utils diff --git a/src/deps/src/ModSecurity/src/utils/regex.h b/src/deps/src/ModSecurity/src/utils/regex.h index 92eb118b4..6bd8ce927 100644 --- a/src/deps/src/ModSecurity/src/utils/regex.h +++ b/src/deps/src/ModSecurity/src/utils/regex.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,13 +12,18 @@ * directly using the email address security@modsecurity.org. * */ - +#if WITH_PCRE2 +#define PCRE2_CODE_UNIT_WIDTH 8 +#include +#else #include +#endif #include #include #include #include +#include #ifndef SRC_UTILS_REGEX_H_ #define SRC_UTILS_REGEX_H_ @@ -47,24 +52,43 @@ class SMatch { size_t m_offset; }; +struct SMatchCapture { + SMatchCapture(size_t group, size_t offset, size_t length) : + m_group(group), + m_offset(offset), + m_length(length) { } + + size_t m_group; // E.g. 0 = full match; 6 = capture group 6 + size_t m_offset; // offset of match within the analyzed string + size_t m_length; +}; class Regex { public: - explicit Regex(const std::string& pattern_); + explicit Regex(const std::string& pattern_, bool ignoreCase = false); ~Regex(); // m_pc and m_pce can't be easily copied Regex(const Regex&) = delete; Regex& operator=(const Regex&) = delete; + bool hasError() const { + return (m_pc == NULL); + } std::list searchAll(const std::string& s) const; - int search(const std::string &s, SMatch *m) const; + bool searchOneMatch(const std::string& s, std::vector& captures) const; + bool searchGlobal(const std::string& s, std::vector& captures) const; + int search(const std::string &s, SMatch *match) const; int search(const std::string &s) const; const std::string pattern; private: +#if WITH_PCRE2 + pcre2_code *m_pc; +#else pcre *m_pc = NULL; pcre_extra *m_pce = NULL; +#endif }; diff --git a/src/deps/src/ModSecurity/src/utils/sha1.cc b/src/deps/src/ModSecurity/src/utils/sha1.cc index 1bff5a44b..116d51070 100644 --- a/src/deps/src/ModSecurity/src/utils/sha1.cc +++ b/src/deps/src/ModSecurity/src/utils/sha1.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/sha1.h b/src/deps/src/ModSecurity/src/utils/sha1.h index 0167c35ff..6bae47c2b 100644 --- a/src/deps/src/ModSecurity/src/utils/sha1.h +++ b/src/deps/src/ModSecurity/src/utils/sha1.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/shared_files.cc b/src/deps/src/ModSecurity/src/utils/shared_files.cc index 4c76ba3e5..73216bd00 100644 --- a/src/deps/src/ModSecurity/src/utils/shared_files.cc +++ b/src/deps/src/ModSecurity/src/utils/shared_files.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/shared_files.h b/src/deps/src/ModSecurity/src/utils/shared_files.h index 47f06d2d6..bec28f652 100644 --- a/src/deps/src/ModSecurity/src/utils/shared_files.h +++ b/src/deps/src/ModSecurity/src/utils/shared_files.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -75,12 +75,13 @@ class SharedFiles { private: SharedFiles() #ifdef MODSEC_USE_GENERAL_LOCK - : m_generalLock(NULL) + : m_generalLock(NULL), + m_memKeyStructure(0) #endif { #ifdef MODSEC_USE_GENERAL_LOCK int shm_id; - bool toBeCreated = true; + bool toBeCreated(false); bool err = false; m_memKeyStructure = ftok(".", 1); @@ -122,7 +123,6 @@ err_shmget1: err_shmat1: std::cerr << "err_shmat1" << std::endl; } - toBeCreated = false; #endif } ~SharedFiles() { diff --git a/src/deps/src/ModSecurity/src/utils/string.cc b/src/deps/src/ModSecurity/src/utils/string.cc index cd830e219..b7ec196a7 100644 --- a/src/deps/src/ModSecurity/src/utils/string.cc +++ b/src/deps/src/ModSecurity/src/utils/string.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/string.h b/src/deps/src/ModSecurity/src/utils/string.h index 29680eaaf..b864a38f7 100644 --- a/src/deps/src/ModSecurity/src/utils/string.h +++ b/src/deps/src/ModSecurity/src/utils/string.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/utils/system.cc b/src/deps/src/ModSecurity/src/utils/system.cc index 730999e99..690b5936a 100644 --- a/src/deps/src/ModSecurity/src/utils/system.cc +++ b/src/deps/src/ModSecurity/src/utils/system.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -151,7 +151,7 @@ std::list expandEnv(const std::string& var, int flags) { return vars; } -bool createDir(std::string dir, int mode, std::string *error) { +bool createDir(const std::string& dir, int mode, std::string *error) { int ret = mkdir(dir.data(), mode); if (ret != 0 && errno != EEXIST) { error->assign("Not able to create directory: " + dir + ": " \ @@ -163,7 +163,7 @@ bool createDir(std::string dir, int mode, std::string *error) { } -bool isFile(std::string f) { +bool isFile(const std::string& f) { struct stat fileInfo; FILE *fp = fopen(f.c_str(), "r"); if (fp == NULL) { diff --git a/src/deps/src/ModSecurity/src/utils/system.h b/src/deps/src/ModSecurity/src/utils/system.h index 04ef35a95..b3033b44e 100644 --- a/src/deps/src/ModSecurity/src/utils/system.h +++ b/src/deps/src/ModSecurity/src/utils/system.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,12 +29,12 @@ namespace utils { double cpu_seconds(void); -std::string find_resource(const std::string& file, const std::string& param, +std::string find_resource(const std::string& file, const std::string& config, std::string *err); std::string get_path(const std::string& file); std::list expandEnv(const std::string& var, int flags); -bool createDir(std::string dir, int mode, std::string *error); -bool isFile(std::string f); +bool createDir(const std::string& dir, int mode, std::string *error); +bool isFile(const std::string& f); } // namespace utils } // namespace modsecurity diff --git a/src/deps/src/ModSecurity/src/variables/args.h b/src/deps/src/ModSecurity/src/variables/args.h index 524afb858..e10b806a1 100644 --- a/src/deps/src/ModSecurity/src/variables/args.h +++ b/src/deps/src/ModSecurity/src/variables/args.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/args_combined_size.h b/src/deps/src/ModSecurity/src/variables/args_combined_size.h index c8d1ffbc3..e739ed686 100644 --- a/src/deps/src/ModSecurity/src/variables/args_combined_size.h +++ b/src/deps/src/ModSecurity/src/variables/args_combined_size.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/args_get.h b/src/deps/src/ModSecurity/src/variables/args_get.h index 253ac81c5..65b718b3f 100644 --- a/src/deps/src/ModSecurity/src/variables/args_get.h +++ b/src/deps/src/ModSecurity/src/variables/args_get.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/args_get_names.h b/src/deps/src/ModSecurity/src/variables/args_get_names.h index aad21bac3..4e15253c5 100644 --- a/src/deps/src/ModSecurity/src/variables/args_get_names.h +++ b/src/deps/src/ModSecurity/src/variables/args_get_names.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/args_names.h b/src/deps/src/ModSecurity/src/variables/args_names.h index 2cd212100..3e4e8b1bc 100644 --- a/src/deps/src/ModSecurity/src/variables/args_names.h +++ b/src/deps/src/ModSecurity/src/variables/args_names.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/args_post.h b/src/deps/src/ModSecurity/src/variables/args_post.h index 9f14df5fd..59e4417d0 100644 --- a/src/deps/src/ModSecurity/src/variables/args_post.h +++ b/src/deps/src/ModSecurity/src/variables/args_post.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/args_post_names.h b/src/deps/src/ModSecurity/src/variables/args_post_names.h index 0035291e3..b5cc6451a 100644 --- a/src/deps/src/ModSecurity/src/variables/args_post_names.h +++ b/src/deps/src/ModSecurity/src/variables/args_post_names.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/auth_type.h b/src/deps/src/ModSecurity/src/variables/auth_type.h index 59b7d13c2..595d6d2dd 100644 --- a/src/deps/src/ModSecurity/src/variables/auth_type.h +++ b/src/deps/src/ModSecurity/src/variables/auth_type.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/duration.cc b/src/deps/src/ModSecurity/src/variables/duration.cc index 18fa7e5d1..cf3dea6d9 100644 --- a/src/deps/src/ModSecurity/src/variables/duration.cc +++ b/src/deps/src/ModSecurity/src/variables/duration.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,7 +28,7 @@ namespace modsecurity { namespace variables { void Duration::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { double e = utils::cpu_seconds() - transaction->m_creationTimeStamp; diff --git a/src/deps/src/ModSecurity/src/variables/duration.h b/src/deps/src/ModSecurity/src/variables/duration.h index e9a51a0bd..9e117bb7f 100644 --- a/src/deps/src/ModSecurity/src/variables/duration.h +++ b/src/deps/src/ModSecurity/src/variables/duration.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class Duration : public Variable { public: - explicit Duration(std::string _name) + explicit Duration(const std::string &_name) : Variable(_name), m_retName("DURATION") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/env.cc b/src/deps/src/ModSecurity/src/variables/env.cc index b08a79044..dfb2c3f03 100644 --- a/src/deps/src/ModSecurity/src/variables/env.cc +++ b/src/deps/src/ModSecurity/src/variables/env.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,7 +33,7 @@ namespace modsecurity { namespace variables { void Env::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { for (char **current = environ; *current; current++) { std::string env = std::string(*current); diff --git a/src/deps/src/ModSecurity/src/variables/env.h b/src/deps/src/ModSecurity/src/variables/env.h index 2e97c93fd..832c8b4a3 100644 --- a/src/deps/src/ModSecurity/src/variables/env.h +++ b/src/deps/src/ModSecurity/src/variables/env.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,11 +30,11 @@ namespace variables { class Env : public Variable { public: - explicit Env(std::string _name) + explicit Env(const std::string &_name) : Variable(_name) { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; }; diff --git a/src/deps/src/ModSecurity/src/variables/files.h b/src/deps/src/ModSecurity/src/variables/files.h index 4db985b3c..5150e2b8e 100644 --- a/src/deps/src/ModSecurity/src/variables/files.h +++ b/src/deps/src/ModSecurity/src/variables/files.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/files_combined_size.h b/src/deps/src/ModSecurity/src/variables/files_combined_size.h index d3e240caf..2193f2fc7 100644 --- a/src/deps/src/ModSecurity/src/variables/files_combined_size.h +++ b/src/deps/src/ModSecurity/src/variables/files_combined_size.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/files_names.h b/src/deps/src/ModSecurity/src/variables/files_names.h index dc0b3099e..745558bc5 100644 --- a/src/deps/src/ModSecurity/src/variables/files_names.h +++ b/src/deps/src/ModSecurity/src/variables/files_names.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/files_sizes.h b/src/deps/src/ModSecurity/src/variables/files_sizes.h index 7498f052c..147105acd 100644 --- a/src/deps/src/ModSecurity/src/variables/files_sizes.h +++ b/src/deps/src/ModSecurity/src/variables/files_sizes.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/files_tmp_content.h b/src/deps/src/ModSecurity/src/variables/files_tmp_content.h index 79c620030..712bddeb7 100644 --- a/src/deps/src/ModSecurity/src/variables/files_tmp_content.h +++ b/src/deps/src/ModSecurity/src/variables/files_tmp_content.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/files_tmp_names.h b/src/deps/src/ModSecurity/src/variables/files_tmp_names.h index ce4860c00..3952fdda6 100644 --- a/src/deps/src/ModSecurity/src/variables/files_tmp_names.h +++ b/src/deps/src/ModSecurity/src/variables/files_tmp_names.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/full_request.h b/src/deps/src/ModSecurity/src/variables/full_request.h index 4c11a7c8c..46be730dd 100644 --- a/src/deps/src/ModSecurity/src/variables/full_request.h +++ b/src/deps/src/ModSecurity/src/variables/full_request.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/full_request_length.h b/src/deps/src/ModSecurity/src/variables/full_request_length.h index 92578ff1d..2fd303196 100644 --- a/src/deps/src/ModSecurity/src/variables/full_request_length.h +++ b/src/deps/src/ModSecurity/src/variables/full_request_length.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/geo.h b/src/deps/src/ModSecurity/src/variables/geo.h index 5a6c16f21..4f9395444 100644 --- a/src/deps/src/ModSecurity/src/variables/geo.h +++ b/src/deps/src/ModSecurity/src/variables/geo.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/global.h b/src/deps/src/ModSecurity/src/variables/global.h index dac0432b9..8a040c292 100644 --- a/src/deps/src/ModSecurity/src/variables/global.h +++ b/src/deps/src/ModSecurity/src/variables/global.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,12 +34,12 @@ namespace variables { class Global_DictElement : public Variable { public: - explicit Global_DictElement(std::string dictElement) + explicit Global_DictElement(const std::string &dictElement) : Variable("GLOBAL:" + dictElement), m_dictElement("GLOBAL:" + dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_global_collection->resolveMultiMatches( m_name, t->m_collections.m_global_collection_key, @@ -56,7 +56,7 @@ class Global_NoDictElement : public Variable { : Variable("GLOBAL") { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_global_collection->resolveMultiMatches("", t->m_collections.m_global_collection_key, @@ -67,12 +67,12 @@ class Global_NoDictElement : public Variable { class Global_DictElementRegexp : public VariableRegex { public: - explicit Global_DictElementRegexp(std::string dictElement) + explicit Global_DictElementRegexp(const std::string &dictElement) : VariableRegex("GLOBAL", dictElement), m_dictElement(dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_global_collection->resolveRegularExpression( m_dictElement, @@ -91,7 +91,7 @@ class Global_DynamicElement : public Variable { m_string(std::move(dictElement)) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { std::string string = m_string->evaluate(t); t->m_collections.m_global_collection->resolveMultiMatches( @@ -100,13 +100,13 @@ class Global_DynamicElement : public Variable { t->m_rules->m_secWebAppId.m_value, l, m_keyExclusion); } - void del(Transaction *t, std::string k) { + static void del(Transaction *t, const std::string &k) { t->m_collections.m_global_collection->del(k, t->m_collections.m_global_collection_key, t->m_rules->m_secWebAppId.m_value); } - void storeOrUpdateFirst(Transaction *t, std::string var, + static void storeOrUpdateFirst(Transaction *t, std::string var, std::string value) { t->m_collections.m_global_collection->storeOrUpdateFirst( var, t->m_collections.m_global_collection_key, diff --git a/src/deps/src/ModSecurity/src/variables/highest_severity.cc b/src/deps/src/ModSecurity/src/variables/highest_severity.cc index 9ace72df8..79ec048f4 100644 --- a/src/deps/src/ModSecurity/src/variables/highest_severity.cc +++ b/src/deps/src/ModSecurity/src/variables/highest_severity.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -27,7 +27,7 @@ namespace modsecurity { namespace variables { void HighestSeverity::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { transaction->m_variableHighestSeverityAction.assign( std::to_string(transaction->m_highestSeverityAction)); diff --git a/src/deps/src/ModSecurity/src/variables/highest_severity.h b/src/deps/src/ModSecurity/src/variables/highest_severity.h index 42c602d3b..90fa252fd 100644 --- a/src/deps/src/ModSecurity/src/variables/highest_severity.h +++ b/src/deps/src/ModSecurity/src/variables/highest_severity.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class HighestSeverity : public Variable { public: - explicit HighestSeverity(std::string _name) + explicit HighestSeverity(const std::string &_name) : Variable(_name) { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; }; diff --git a/src/deps/src/ModSecurity/src/variables/inbound_data_error.h b/src/deps/src/ModSecurity/src/variables/inbound_data_error.h index a63512e48..40f642883 100644 --- a/src/deps/src/ModSecurity/src/variables/inbound_data_error.h +++ b/src/deps/src/ModSecurity/src/variables/inbound_data_error.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/ip.h b/src/deps/src/ModSecurity/src/variables/ip.h index 40f43ac44..b06774839 100644 --- a/src/deps/src/ModSecurity/src/variables/ip.h +++ b/src/deps/src/ModSecurity/src/variables/ip.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,12 +34,12 @@ namespace variables { class Ip_DictElement : public Variable { public: - explicit Ip_DictElement(std::string dictElement) + explicit Ip_DictElement(const std::string &dictElement) : Variable("IP:" + dictElement), m_dictElement("IP:" + dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_ip_collection->resolveMultiMatches( m_name, t->m_collections.m_ip_collection_key, @@ -56,7 +56,7 @@ class Ip_NoDictElement : public Variable { : Variable("IP") { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_ip_collection->resolveMultiMatches("", t->m_collections.m_ip_collection_key, @@ -67,12 +67,12 @@ class Ip_NoDictElement : public Variable { class Ip_DictElementRegexp : public VariableRegex { public: - explicit Ip_DictElementRegexp(std::string dictElement) + explicit Ip_DictElementRegexp(const std::string &dictElement) : VariableRegex("IP", dictElement), m_dictElement(dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_ip_collection->resolveRegularExpression( m_dictElement, t->m_collections.m_ip_collection_key, @@ -90,7 +90,7 @@ class Ip_DynamicElement : public Variable { m_string(std::move(dictElement)) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { std::string string = m_string->evaluate(t); t->m_collections.m_ip_collection->resolveMultiMatches( @@ -99,14 +99,14 @@ class Ip_DynamicElement : public Variable { t->m_rules->m_secWebAppId.m_value, l, m_keyExclusion); } - void del(Transaction *t, std::string k) { + static void del(Transaction *t, const std::string &k) { t->m_collections.m_ip_collection->del(k, t->m_collections.m_ip_collection_key, t->m_rules->m_secWebAppId.m_value); } - void storeOrUpdateFirst(Transaction *t, std::string var, - std::string value) { + static void storeOrUpdateFirst(Transaction *t, const std::string &var, + const std::string &value) { t->m_collections.m_ip_collection->storeOrUpdateFirst( var, t->m_collections.m_ip_collection_key, t->m_rules->m_secWebAppId.m_value, diff --git a/src/deps/src/ModSecurity/src/variables/matched_var.h b/src/deps/src/ModSecurity/src/variables/matched_var.h index 81fb6fbe6..b205dd715 100644 --- a/src/deps/src/ModSecurity/src/variables/matched_var.h +++ b/src/deps/src/ModSecurity/src/variables/matched_var.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/matched_var_name.h b/src/deps/src/ModSecurity/src/variables/matched_var_name.h index 0953b8cca..c71a90506 100644 --- a/src/deps/src/ModSecurity/src/variables/matched_var_name.h +++ b/src/deps/src/ModSecurity/src/variables/matched_var_name.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/matched_vars.h b/src/deps/src/ModSecurity/src/variables/matched_vars.h index 28dbe6253..a6df1e008 100644 --- a/src/deps/src/ModSecurity/src/variables/matched_vars.h +++ b/src/deps/src/ModSecurity/src/variables/matched_vars.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/matched_vars_names.h b/src/deps/src/ModSecurity/src/variables/matched_vars_names.h index 44afb0b5c..2df8f72f8 100644 --- a/src/deps/src/ModSecurity/src/variables/matched_vars_names.h +++ b/src/deps/src/ModSecurity/src/variables/matched_vars_names.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/modsec_build.cc b/src/deps/src/ModSecurity/src/variables/modsec_build.cc index f7124321b..d59da1b41 100644 --- a/src/deps/src/ModSecurity/src/variables/modsec_build.cc +++ b/src/deps/src/ModSecurity/src/variables/modsec_build.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -25,7 +25,7 @@ namespace modsecurity { namespace variables { void ModsecBuild::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { l->push_back(new VariableValue(&m_retName, &m_build)); diff --git a/src/deps/src/ModSecurity/src/variables/modsec_build.h b/src/deps/src/ModSecurity/src/variables/modsec_build.h index 556cc4136..73a5c2414 100644 --- a/src/deps/src/ModSecurity/src/variables/modsec_build.h +++ b/src/deps/src/ModSecurity/src/variables/modsec_build.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,7 +32,7 @@ namespace variables { class ModsecBuild : public Variable { public: - explicit ModsecBuild(std::string _name) + explicit ModsecBuild(const std::string &_name) : Variable(_name), m_retName("MODSEC_BUILD") { std::ostringstream ss; @@ -44,7 +44,7 @@ class ModsecBuild : public Variable { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_build; diff --git a/src/deps/src/ModSecurity/src/variables/multipart_boundary_quoted.h b/src/deps/src/ModSecurity/src/variables/multipart_boundary_quoted.h index 1ad985f42..cafc07d2e 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_boundary_quoted.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_boundary_quoted.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_boundary_whitespace.h b/src/deps/src/ModSecurity/src/variables/multipart_boundary_whitespace.h index a52a5d2d6..e3220de64 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_boundary_whitespace.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_boundary_whitespace.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_crlf_lf_lines.h b/src/deps/src/ModSecurity/src/variables/multipart_crlf_lf_lines.h index ac6817d0b..25b439956 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_crlf_lf_lines.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_crlf_lf_lines.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_data_after.h b/src/deps/src/ModSecurity/src/variables/multipart_data_after.h index f3e64c300..4563b8661 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_data_after.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_data_after.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_data_before.h b/src/deps/src/ModSecurity/src/variables/multipart_data_before.h index 8540a38ca..c9bc820ae 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_data_before.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_data_before.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_file_limit_exceeded.h b/src/deps/src/ModSecurity/src/variables/multipart_file_limit_exceeded.h index 13a34660a..cd7e9915d 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_file_limit_exceeded.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_file_limit_exceeded.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_file_name.h b/src/deps/src/ModSecurity/src/variables/multipart_file_name.h index 185ec172f..e61bbf822 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_file_name.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_file_name.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_header_folding.h b/src/deps/src/ModSecurity/src/variables/multipart_header_folding.h index 817885d7a..3341fd6db 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_header_folding.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_header_folding.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_invalid_header_folding.h b/src/deps/src/ModSecurity/src/variables/multipart_invalid_header_folding.h index 331bdebe1..ec3ca606e 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_invalid_header_folding.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_invalid_header_folding.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_invalid_part.h b/src/deps/src/ModSecurity/src/variables/multipart_invalid_part.h index 51d49866c..b444f9b3b 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_invalid_part.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_invalid_part.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,7 +31,7 @@ namespace variables { DEFINE_VARIABLE(MultipartInvalidPart, MULTIPART_INVALID_PART, - m_variableMultipartInvalidHeaderFolding) + m_variableMultipartInvalidPart) } // namespace variables diff --git a/src/deps/src/ModSecurity/src/variables/multipart_invalid_quoting.h b/src/deps/src/ModSecurity/src/variables/multipart_invalid_quoting.h index 1ac10bff6..0038f45eb 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_invalid_quoting.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_invalid_quoting.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_lf_line.h b/src/deps/src/ModSecurity/src/variables/multipart_lf_line.h index 8dc8e3548..72a62afc7 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_lf_line.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_lf_line.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_missing_semicolon.h b/src/deps/src/ModSecurity/src/variables/multipart_missing_semicolon.h index 14c288036..f6f665a9d 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_missing_semicolon.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_missing_semicolon.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_name.h b/src/deps/src/ModSecurity/src/variables/multipart_name.h index ee4e41450..b755547ab 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_name.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_name.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_part_headers.h b/src/deps/src/ModSecurity/src/variables/multipart_part_headers.h new file mode 100644 index 000000000..f7ffd789c --- /dev/null +++ b/src/deps/src/ModSecurity/src/variables/multipart_part_headers.h @@ -0,0 +1,41 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2022 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + +#include +#include +#include +#include +#include + +#ifndef SRC_VARIABLES_MULTIPART_PART_HEADERS_H_ +#define SRC_VARIABLES_MULTIPART_PART_HEADERS_H_ + +#include "src/variables/variable.h" + +namespace modsecurity { + +class Transaction; +namespace variables { + + +DEFINE_VARIABLE_DICT(MultipartPartHeaders, MULTIPART_PART_HEADERS, + m_variableMultipartPartHeaders) + + +} // namespace variables +} // namespace modsecurity + +#endif // SRC_VARIABLES_MULTIPART_PART_HEADERS_H_ + diff --git a/src/deps/src/ModSecurity/src/variables/multipart_strict_error.h b/src/deps/src/ModSecurity/src/variables/multipart_strict_error.h index f7c0d0a47..28b25a515 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_strict_error.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_strict_error.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/multipart_unmatched_boundary.h b/src/deps/src/ModSecurity/src/variables/multipart_unmatched_boundary.h index 1769f8841..c0a3a2400 100644 --- a/src/deps/src/ModSecurity/src/variables/multipart_unmatched_boundary.h +++ b/src/deps/src/ModSecurity/src/variables/multipart_unmatched_boundary.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/outbound_data_error.h b/src/deps/src/ModSecurity/src/variables/outbound_data_error.h index db869b9da..35c1c263d 100644 --- a/src/deps/src/ModSecurity/src/variables/outbound_data_error.h +++ b/src/deps/src/ModSecurity/src/variables/outbound_data_error.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/path_info.h b/src/deps/src/ModSecurity/src/variables/path_info.h index f8821918b..fa751611a 100644 --- a/src/deps/src/ModSecurity/src/variables/path_info.h +++ b/src/deps/src/ModSecurity/src/variables/path_info.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/query_string.h b/src/deps/src/ModSecurity/src/variables/query_string.h index f225c718a..e10840dac 100644 --- a/src/deps/src/ModSecurity/src/variables/query_string.h +++ b/src/deps/src/ModSecurity/src/variables/query_string.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/remote_addr.h b/src/deps/src/ModSecurity/src/variables/remote_addr.h index deb98586f..e9dda006a 100644 --- a/src/deps/src/ModSecurity/src/variables/remote_addr.h +++ b/src/deps/src/ModSecurity/src/variables/remote_addr.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/remote_host.h b/src/deps/src/ModSecurity/src/variables/remote_host.h index 75ab2785b..47b0a85f3 100644 --- a/src/deps/src/ModSecurity/src/variables/remote_host.h +++ b/src/deps/src/ModSecurity/src/variables/remote_host.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/remote_port.h b/src/deps/src/ModSecurity/src/variables/remote_port.h index f661d97b4..600653d2e 100644 --- a/src/deps/src/ModSecurity/src/variables/remote_port.h +++ b/src/deps/src/ModSecurity/src/variables/remote_port.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/remote_user.cc b/src/deps/src/ModSecurity/src/variables/remote_user.cc index d11ddb8f6..a6c6816b8 100644 --- a/src/deps/src/ModSecurity/src/variables/remote_user.cc +++ b/src/deps/src/ModSecurity/src/variables/remote_user.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -37,7 +37,7 @@ namespace variables { void RemoteUser::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { size_t pos; std::string base64; diff --git a/src/deps/src/ModSecurity/src/variables/remote_user.h b/src/deps/src/ModSecurity/src/variables/remote_user.h index 226f776c3..34460b766 100644 --- a/src/deps/src/ModSecurity/src/variables/remote_user.h +++ b/src/deps/src/ModSecurity/src/variables/remote_user.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -32,12 +32,12 @@ namespace variables { class RemoteUser : public Variable { public: - explicit RemoteUser(std::string _name) + explicit RemoteUser(const std::string &_name) : Variable(_name), m_retName("REMOTE_USER") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/reqbody_error.h b/src/deps/src/ModSecurity/src/variables/reqbody_error.h index 7bff88ac4..08a985b09 100644 --- a/src/deps/src/ModSecurity/src/variables/reqbody_error.h +++ b/src/deps/src/ModSecurity/src/variables/reqbody_error.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/reqbody_error_msg.h b/src/deps/src/ModSecurity/src/variables/reqbody_error_msg.h index d74c4e232..2bbc62abd 100644 --- a/src/deps/src/ModSecurity/src/variables/reqbody_error_msg.h +++ b/src/deps/src/ModSecurity/src/variables/reqbody_error_msg.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/reqbody_processor.h b/src/deps/src/ModSecurity/src/variables/reqbody_processor.h index 6425fe83f..74620d1a8 100644 --- a/src/deps/src/ModSecurity/src/variables/reqbody_processor.h +++ b/src/deps/src/ModSecurity/src/variables/reqbody_processor.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/reqbody_processor_error.h b/src/deps/src/ModSecurity/src/variables/reqbody_processor_error.h index 7a64a82f7..2790bb1a7 100644 --- a/src/deps/src/ModSecurity/src/variables/reqbody_processor_error.h +++ b/src/deps/src/ModSecurity/src/variables/reqbody_processor_error.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/reqbody_processor_error_msg.h b/src/deps/src/ModSecurity/src/variables/reqbody_processor_error_msg.h index cf7a0ec80..4ddf10bf1 100644 --- a/src/deps/src/ModSecurity/src/variables/reqbody_processor_error_msg.h +++ b/src/deps/src/ModSecurity/src/variables/reqbody_processor_error_msg.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_base_name.h b/src/deps/src/ModSecurity/src/variables/request_base_name.h index 4b7ab580f..43e8210e5 100644 --- a/src/deps/src/ModSecurity/src/variables/request_base_name.h +++ b/src/deps/src/ModSecurity/src/variables/request_base_name.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_body.h b/src/deps/src/ModSecurity/src/variables/request_body.h index 65fbd5884..c9d103a68 100644 --- a/src/deps/src/ModSecurity/src/variables/request_body.h +++ b/src/deps/src/ModSecurity/src/variables/request_body.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_body_length.h b/src/deps/src/ModSecurity/src/variables/request_body_length.h index 9737caab1..861caa141 100644 --- a/src/deps/src/ModSecurity/src/variables/request_body_length.h +++ b/src/deps/src/ModSecurity/src/variables/request_body_length.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_cookies.h b/src/deps/src/ModSecurity/src/variables/request_cookies.h index fbdf36620..83a31f9a1 100644 --- a/src/deps/src/ModSecurity/src/variables/request_cookies.h +++ b/src/deps/src/ModSecurity/src/variables/request_cookies.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_cookies_names.h b/src/deps/src/ModSecurity/src/variables/request_cookies_names.h index fb27ad6a5..9730e2cd3 100644 --- a/src/deps/src/ModSecurity/src/variables/request_cookies_names.h +++ b/src/deps/src/ModSecurity/src/variables/request_cookies_names.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_file_name.h b/src/deps/src/ModSecurity/src/variables/request_file_name.h index 974dde003..0cfabafaf 100644 --- a/src/deps/src/ModSecurity/src/variables/request_file_name.h +++ b/src/deps/src/ModSecurity/src/variables/request_file_name.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_headers.h b/src/deps/src/ModSecurity/src/variables/request_headers.h index 8271720e4..39d38b511 100644 --- a/src/deps/src/ModSecurity/src/variables/request_headers.h +++ b/src/deps/src/ModSecurity/src/variables/request_headers.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_headers_names.h b/src/deps/src/ModSecurity/src/variables/request_headers_names.h index 688381821..68a424dfd 100644 --- a/src/deps/src/ModSecurity/src/variables/request_headers_names.h +++ b/src/deps/src/ModSecurity/src/variables/request_headers_names.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_line.h b/src/deps/src/ModSecurity/src/variables/request_line.h index 3d7db9816..4b89d613c 100644 --- a/src/deps/src/ModSecurity/src/variables/request_line.h +++ b/src/deps/src/ModSecurity/src/variables/request_line.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_method.h b/src/deps/src/ModSecurity/src/variables/request_method.h index 1606f2565..7e14be94b 100644 --- a/src/deps/src/ModSecurity/src/variables/request_method.h +++ b/src/deps/src/ModSecurity/src/variables/request_method.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_protocol.h b/src/deps/src/ModSecurity/src/variables/request_protocol.h index 947af7cbf..915257347 100644 --- a/src/deps/src/ModSecurity/src/variables/request_protocol.h +++ b/src/deps/src/ModSecurity/src/variables/request_protocol.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_uri.h b/src/deps/src/ModSecurity/src/variables/request_uri.h index 331b82279..b6757769e 100644 --- a/src/deps/src/ModSecurity/src/variables/request_uri.h +++ b/src/deps/src/ModSecurity/src/variables/request_uri.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/request_uri_raw.h b/src/deps/src/ModSecurity/src/variables/request_uri_raw.h index f0c352165..fcffe8643 100644 --- a/src/deps/src/ModSecurity/src/variables/request_uri_raw.h +++ b/src/deps/src/ModSecurity/src/variables/request_uri_raw.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/resource.h b/src/deps/src/ModSecurity/src/variables/resource.h index 14fc5e982..a66a71182 100644 --- a/src/deps/src/ModSecurity/src/variables/resource.h +++ b/src/deps/src/ModSecurity/src/variables/resource.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,12 +34,12 @@ namespace variables { class Resource_DictElement : public Variable { public: - explicit Resource_DictElement(std::string dictElement) + explicit Resource_DictElement(const std::string &dictElement) : Variable("RESOURCE:" + dictElement), m_dictElement("RESOURCE:" + dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_resource_collection->resolveMultiMatches( m_name, t->m_collections.m_resource_collection_key, @@ -56,7 +56,7 @@ class Resource_NoDictElement : public Variable { : Variable("RESOURCE") { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_resource_collection->resolveMultiMatches(m_name, t->m_collections.m_resource_collection_key, @@ -67,12 +67,12 @@ class Resource_NoDictElement : public Variable { class Resource_DictElementRegexp : public VariableRegex { public: - explicit Resource_DictElementRegexp(std::string dictElement) + explicit Resource_DictElementRegexp(const std::string &dictElement) : VariableRegex("RESOURCE:", dictElement), m_dictElement(dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_resource_collection->resolveRegularExpression( m_dictElement, t->m_collections.m_resource_collection_key, @@ -90,7 +90,7 @@ class Resource_DynamicElement : public Variable { m_string(std::move(dictElement)) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { std::string string = m_string->evaluate(t); t->m_collections.m_resource_collection->resolveMultiMatches( @@ -99,14 +99,14 @@ class Resource_DynamicElement : public Variable { t->m_rules->m_secWebAppId.m_value, l, m_keyExclusion); } - void del(Transaction *t, std::string k) { + static void del(Transaction *t, const std::string &k) { t->m_collections.m_resource_collection->del(k, t->m_collections.m_resource_collection_key, t->m_rules->m_secWebAppId.m_value); } - void storeOrUpdateFirst(Transaction *t, std::string var, - std::string value) { + static void storeOrUpdateFirst(Transaction *t, const std::string &var, + const std::string &value) { t->m_collections.m_resource_collection->storeOrUpdateFirst( var, t->m_collections.m_resource_collection_key, t->m_rules->m_secWebAppId.m_value, value); diff --git a/src/deps/src/ModSecurity/src/variables/response_body.h b/src/deps/src/ModSecurity/src/variables/response_body.h index 70730ee24..8dc083377 100644 --- a/src/deps/src/ModSecurity/src/variables/response_body.h +++ b/src/deps/src/ModSecurity/src/variables/response_body.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/response_content_length.h b/src/deps/src/ModSecurity/src/variables/response_content_length.h index e4c07176c..0e3d54606 100644 --- a/src/deps/src/ModSecurity/src/variables/response_content_length.h +++ b/src/deps/src/ModSecurity/src/variables/response_content_length.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/response_content_type.h b/src/deps/src/ModSecurity/src/variables/response_content_type.h index 4e5c20de9..fa1923585 100644 --- a/src/deps/src/ModSecurity/src/variables/response_content_type.h +++ b/src/deps/src/ModSecurity/src/variables/response_content_type.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/response_headers.h b/src/deps/src/ModSecurity/src/variables/response_headers.h index 44c444a1f..3ea6e9de2 100644 --- a/src/deps/src/ModSecurity/src/variables/response_headers.h +++ b/src/deps/src/ModSecurity/src/variables/response_headers.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/response_headers_names.h b/src/deps/src/ModSecurity/src/variables/response_headers_names.h index 167b1bec4..915c4a1c4 100644 --- a/src/deps/src/ModSecurity/src/variables/response_headers_names.h +++ b/src/deps/src/ModSecurity/src/variables/response_headers_names.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/response_protocol.h b/src/deps/src/ModSecurity/src/variables/response_protocol.h index 5080db459..2577735a7 100644 --- a/src/deps/src/ModSecurity/src/variables/response_protocol.h +++ b/src/deps/src/ModSecurity/src/variables/response_protocol.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/response_status.h b/src/deps/src/ModSecurity/src/variables/response_status.h index 27971aaa7..0cfe3b624 100644 --- a/src/deps/src/ModSecurity/src/variables/response_status.h +++ b/src/deps/src/ModSecurity/src/variables/response_status.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/rule.cc b/src/deps/src/ModSecurity/src/variables/rule.cc index 1f5713b25..6ac8394b5 100644 --- a/src/deps/src/ModSecurity/src/variables/rule.cc +++ b/src/deps/src/ModSecurity/src/variables/rule.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/rule.h b/src/deps/src/ModSecurity/src/variables/rule.h index 4f58113d9..f9e2f989d 100644 --- a/src/deps/src/ModSecurity/src/variables/rule.h +++ b/src/deps/src/ModSecurity/src/variables/rule.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,13 +34,13 @@ namespace variables { class Rule_DictElement : public VariableDictElement { \ public: - explicit Rule_DictElement(std::string dictElement) + explicit Rule_DictElement(const std::string &dictElement) : VariableDictElement(std::string("RULE"), dictElement) { } static void id(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) { - Rule *r = rule; + RuleWithActions *r = rule; while (r && r->m_ruleId == 0) { r = r->m_chainedRuleParent; @@ -63,9 +63,9 @@ class Rule_DictElement : public VariableDictElement { \ static void rev(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) { - Rule *r = rule; + RuleWithActions *r = rule; while (r && r->m_rev.empty()) { r = r->m_chainedRuleParent; @@ -89,17 +89,17 @@ class Rule_DictElement : public VariableDictElement { \ static void severity(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) { - Rule *r = rule; + RuleWithActions *r = rule; - while (r && !r->m_severity) { + while (r && !r->hasSeverity()) { r = r->m_chainedRuleParent; } - if (r && r->m_severity) { + if (r && r->hasSeverity()) { std::unique_ptr origin(new VariableOrigin()); - std::string *a = new std::string(std::to_string(r->m_severity->m_severity)); + std::string *a = new std::string(std::to_string(r->severity())); VariableValue *var = new VariableValue(&m_rule, &m_rule_severity, a ); @@ -113,17 +113,17 @@ class Rule_DictElement : public VariableDictElement { \ static void logData(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) { - Rule *r = rule; + RuleWithActions *r = rule; - while (r && !r->m_logData) { + while (r && !r->hasLogData()) { r = r->m_chainedRuleParent; } - if (r && r->m_logData) { + if (r && r->hasLogData()) { std::unique_ptr origin(new VariableOrigin()); - std::string *a = new std::string(r->m_logData->data(t)); + std::string *a = new std::string(r->logData(t)); VariableValue *var = new VariableValue(&m_rule, &m_rule_logdata, a ); @@ -136,17 +136,17 @@ class Rule_DictElement : public VariableDictElement { \ } static void msg(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) { - Rule *r = rule; + RuleWithActions *r = rule; - while (r && !r->m_msg) { + while (r && !r->hasMsg()) { r = r->m_chainedRuleParent; } - if (r && r->m_msg) { + if (r && r->hasMsg()) { std::unique_ptr origin(new VariableOrigin()); - std::string *a = new std::string(r->m_msg->data(t)); + std::string *a = new std::string(r->msg(t)); VariableValue *var = new VariableValue(&m_rule, &m_rule_msg, a ); @@ -159,7 +159,7 @@ class Rule_DictElement : public VariableDictElement { \ } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { if (m_dictElement == "id") { id(t, rule, l); @@ -194,11 +194,11 @@ class Rule_DictElement : public VariableDictElement { \ class Rule_DictElementRegexp : public VariableRegex { public: - explicit Rule_DictElementRegexp(std::string regex) + explicit Rule_DictElementRegexp(const std::string ®ex) : VariableRegex("RULE", regex) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { if (Utils::regex_search("id", m_r) > 0) { Rule_DictElement::id(t, rule, l); @@ -230,7 +230,7 @@ class Rule_NoDictElement : public Variable { : Variable("RULE") { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { Rule_DictElement::id(t, rule, l); Rule_DictElement::rev(t, rule, l); diff --git a/src/deps/src/ModSecurity/src/variables/server_addr.h b/src/deps/src/ModSecurity/src/variables/server_addr.h index 02a3c5fd0..a0f3bfae3 100644 --- a/src/deps/src/ModSecurity/src/variables/server_addr.h +++ b/src/deps/src/ModSecurity/src/variables/server_addr.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/server_name.h b/src/deps/src/ModSecurity/src/variables/server_name.h index 03527d053..c6c32d66d 100644 --- a/src/deps/src/ModSecurity/src/variables/server_name.h +++ b/src/deps/src/ModSecurity/src/variables/server_name.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/server_port.h b/src/deps/src/ModSecurity/src/variables/server_port.h index e209d624d..26109cdf5 100644 --- a/src/deps/src/ModSecurity/src/variables/server_port.h +++ b/src/deps/src/ModSecurity/src/variables/server_port.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/session.h b/src/deps/src/ModSecurity/src/variables/session.h index a0257d625..114f5d7ec 100644 --- a/src/deps/src/ModSecurity/src/variables/session.h +++ b/src/deps/src/ModSecurity/src/variables/session.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,12 +34,12 @@ namespace variables { class Session_DictElement : public Variable { public: - explicit Session_DictElement(std::string dictElement) + explicit Session_DictElement(const std::string &dictElement) : Variable("SESSION:" + dictElement), m_dictElement("SESSION:" + dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_session_collection->resolveMultiMatches( m_name, t->m_collections.m_session_collection_key, @@ -56,7 +56,7 @@ class Session_NoDictElement : public Variable { : Variable("SESSION") { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_session_collection->resolveMultiMatches("", t->m_collections.m_session_collection_key, @@ -67,12 +67,12 @@ class Session_NoDictElement : public Variable { class Session_DictElementRegexp : public VariableRegex { public: - explicit Session_DictElementRegexp(std::string dictElement) + explicit Session_DictElementRegexp(const std::string &dictElement) : VariableRegex("SESSION", dictElement), m_dictElement(dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_session_collection->resolveRegularExpression( m_dictElement, t->m_collections.m_session_collection_key, @@ -90,7 +90,7 @@ class Session_DynamicElement : public Variable { m_string(std::move(dictElement)) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { std::string string = m_string->evaluate(t); t->m_collections.m_session_collection->resolveMultiMatches( @@ -99,14 +99,14 @@ class Session_DynamicElement : public Variable { t->m_rules->m_secWebAppId.m_value, l, m_keyExclusion); } - void del(Transaction *t, std::string k) { + static void del(Transaction *t, const std::string &k) { t->m_collections.m_session_collection->del(k, t->m_collections.m_session_collection_key, t->m_collections.m_ip_collection_key); } - void storeOrUpdateFirst(Transaction *t, std::string var, - std::string value) { + static void storeOrUpdateFirst(Transaction *t, const std::string &var, + const std::string &value) { t->m_collections.m_session_collection->storeOrUpdateFirst( var, t->m_collections.m_session_collection_key, t->m_rules->m_secWebAppId.m_value, diff --git a/src/deps/src/ModSecurity/src/variables/session_id.h b/src/deps/src/ModSecurity/src/variables/session_id.h index 508095b1b..982fc50de 100644 --- a/src/deps/src/ModSecurity/src/variables/session_id.h +++ b/src/deps/src/ModSecurity/src/variables/session_id.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/status.h b/src/deps/src/ModSecurity/src/variables/status.h index 7013eec32..8c4218b29 100644 --- a/src/deps/src/ModSecurity/src/variables/status.h +++ b/src/deps/src/ModSecurity/src/variables/status.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/time.cc b/src/deps/src/ModSecurity/src/variables/time.cc index d7cfbf229..ae071b496 100644 --- a/src/deps/src/ModSecurity/src/variables/time.cc +++ b/src/deps/src/ModSecurity/src/variables/time.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace modsecurity { namespace variables { void Time::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { char tstr[200]; diff --git a/src/deps/src/ModSecurity/src/variables/time.h b/src/deps/src/ModSecurity/src/variables/time.h index 60f4eb030..168750b4e 100644 --- a/src/deps/src/ModSecurity/src/variables/time.h +++ b/src/deps/src/ModSecurity/src/variables/time.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,12 +31,12 @@ namespace variables { class Time : public Variable { public: - explicit Time(std::string _name) + explicit Time(const std::string &_name) : Variable(_name), m_retName("TIME") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/time_day.cc b/src/deps/src/ModSecurity/src/variables/time_day.cc index b409f77f5..f74a8409b 100644 --- a/src/deps/src/ModSecurity/src/variables/time_day.cc +++ b/src/deps/src/ModSecurity/src/variables/time_day.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace modsecurity { namespace variables { void TimeDay::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { char tstr[200]; struct tm timeinfo; diff --git a/src/deps/src/ModSecurity/src/variables/time_day.h b/src/deps/src/ModSecurity/src/variables/time_day.h index 9d9205b0c..f8af07559 100644 --- a/src/deps/src/ModSecurity/src/variables/time_day.h +++ b/src/deps/src/ModSecurity/src/variables/time_day.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class TimeDay : public Variable { public: - explicit TimeDay(std::string _name) + explicit TimeDay(const std::string &_name) : Variable(_name), m_retName("TIME_DAY") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/time_epoch.cc b/src/deps/src/ModSecurity/src/variables/time_epoch.cc index d6b667866..333c5c1a6 100644 --- a/src/deps/src/ModSecurity/src/variables/time_epoch.cc +++ b/src/deps/src/ModSecurity/src/variables/time_epoch.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace modsecurity { namespace variables { void TimeEpoch::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { transaction->m_variableTimeEpoch.assign( std::to_string(std::time(nullptr))); diff --git a/src/deps/src/ModSecurity/src/variables/time_epoch.h b/src/deps/src/ModSecurity/src/variables/time_epoch.h index 7937d1a26..d58164246 100644 --- a/src/deps/src/ModSecurity/src/variables/time_epoch.h +++ b/src/deps/src/ModSecurity/src/variables/time_epoch.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class TimeEpoch : public Variable { public: - explicit TimeEpoch(std::string _name) + explicit TimeEpoch(const std::string &_name) : Variable(_name), m_retName("TIME_EPOCH") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/time_hour.cc b/src/deps/src/ModSecurity/src/variables/time_hour.cc index ade779467..0f2a42193 100644 --- a/src/deps/src/ModSecurity/src/variables/time_hour.cc +++ b/src/deps/src/ModSecurity/src/variables/time_hour.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace modsecurity { namespace variables { void TimeHour::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { char tstr[200]; struct tm timeinfo; diff --git a/src/deps/src/ModSecurity/src/variables/time_hour.h b/src/deps/src/ModSecurity/src/variables/time_hour.h index 91d97bd40..67c539293 100644 --- a/src/deps/src/ModSecurity/src/variables/time_hour.h +++ b/src/deps/src/ModSecurity/src/variables/time_hour.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class TimeHour : public Variable { public: - explicit TimeHour(std::string _name) + explicit TimeHour(const std::string &_name) : Variable(_name), m_retName("TIME_HOUR") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/time_min.cc b/src/deps/src/ModSecurity/src/variables/time_min.cc index 4cbd6b9eb..526d8e6f6 100644 --- a/src/deps/src/ModSecurity/src/variables/time_min.cc +++ b/src/deps/src/ModSecurity/src/variables/time_min.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace modsecurity { namespace variables { void TimeMin::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { char tstr[200]; struct tm timeinfo; diff --git a/src/deps/src/ModSecurity/src/variables/time_min.h b/src/deps/src/ModSecurity/src/variables/time_min.h index d608303ee..789cc1188 100644 --- a/src/deps/src/ModSecurity/src/variables/time_min.h +++ b/src/deps/src/ModSecurity/src/variables/time_min.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class TimeMin : public Variable { public: - explicit TimeMin(std::string _name) + explicit TimeMin(const std::string &_name) : Variable(_name), m_retName("TIME_MIN") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/time_mon.cc b/src/deps/src/ModSecurity/src/variables/time_mon.cc index 8b93b62e6..53ba29190 100644 --- a/src/deps/src/ModSecurity/src/variables/time_mon.cc +++ b/src/deps/src/ModSecurity/src/variables/time_mon.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace modsecurity { namespace variables { void TimeMon::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { char tstr[200]; struct tm timeinfo; diff --git a/src/deps/src/ModSecurity/src/variables/time_mon.h b/src/deps/src/ModSecurity/src/variables/time_mon.h index 13f26ed09..aba406e26 100644 --- a/src/deps/src/ModSecurity/src/variables/time_mon.h +++ b/src/deps/src/ModSecurity/src/variables/time_mon.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class TimeMon : public Variable { public: - explicit TimeMon(std::string _name) + explicit TimeMon(const std::string &_name) : Variable(_name), m_retName("TIME_MON") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/time_sec.cc b/src/deps/src/ModSecurity/src/variables/time_sec.cc index 41269fff3..20d3be7a9 100644 --- a/src/deps/src/ModSecurity/src/variables/time_sec.cc +++ b/src/deps/src/ModSecurity/src/variables/time_sec.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace modsecurity { namespace variables { void TimeSec::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { char tstr[200]; struct tm timeinfo; diff --git a/src/deps/src/ModSecurity/src/variables/time_sec.h b/src/deps/src/ModSecurity/src/variables/time_sec.h index 898c9732b..3f736ad87 100644 --- a/src/deps/src/ModSecurity/src/variables/time_sec.h +++ b/src/deps/src/ModSecurity/src/variables/time_sec.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class TimeSec : public Variable { public: - explicit TimeSec(std::string _name) + explicit TimeSec(const std::string &_name) : Variable(_name), m_retName("TIME_SEC") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/time_wday.cc b/src/deps/src/ModSecurity/src/variables/time_wday.cc index 99a3901f8..ff9825c18 100644 --- a/src/deps/src/ModSecurity/src/variables/time_wday.cc +++ b/src/deps/src/ModSecurity/src/variables/time_wday.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace modsecurity { namespace variables { void TimeWDay::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { char tstr[200]; struct tm timeinfo; diff --git a/src/deps/src/ModSecurity/src/variables/time_wday.h b/src/deps/src/ModSecurity/src/variables/time_wday.h index 1ca5fc4f1..73b62f75f 100644 --- a/src/deps/src/ModSecurity/src/variables/time_wday.h +++ b/src/deps/src/ModSecurity/src/variables/time_wday.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class TimeWDay : public Variable { public: - explicit TimeWDay(std::string _name) + explicit TimeWDay(const std::string &_name) : Variable(_name), m_retName("TIME_WDAY") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/time_year.cc b/src/deps/src/ModSecurity/src/variables/time_year.cc index 3312bba49..a46561254 100644 --- a/src/deps/src/ModSecurity/src/variables/time_year.cc +++ b/src/deps/src/ModSecurity/src/variables/time_year.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,7 +34,7 @@ namespace modsecurity { namespace variables { void TimeYear::evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) { char tstr[200]; struct tm timeinfo; diff --git a/src/deps/src/ModSecurity/src/variables/time_year.h b/src/deps/src/ModSecurity/src/variables/time_year.h index 57f9e379c..688e41982 100644 --- a/src/deps/src/ModSecurity/src/variables/time_year.h +++ b/src/deps/src/ModSecurity/src/variables/time_year.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,12 +30,12 @@ namespace variables { class TimeYear : public Variable { public: - explicit TimeYear(std::string _name) + explicit TimeYear(const std::string &_name) : Variable(_name), m_retName("TIME_YEAR") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; std::string m_retName; }; diff --git a/src/deps/src/ModSecurity/src/variables/tx.cc b/src/deps/src/ModSecurity/src/variables/tx.cc index 3d28d81b3..a08c15f26 100644 --- a/src/deps/src/ModSecurity/src/variables/tx.cc +++ b/src/deps/src/ModSecurity/src/variables/tx.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/tx.h b/src/deps/src/ModSecurity/src/variables/tx.h index ac7f30056..1fae827f1 100644 --- a/src/deps/src/ModSecurity/src/variables/tx.h +++ b/src/deps/src/ModSecurity/src/variables/tx.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,12 +34,12 @@ namespace variables { class Tx_DictElement : public Variable { public: - explicit Tx_DictElement(std::string dictElement) + explicit Tx_DictElement(const std::string &dictElement) : Variable("TX:" + dictElement), m_dictElement("TX:" + dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_tx_collection->resolveMultiMatches( m_name, l, m_keyExclusion); @@ -55,7 +55,7 @@ class Tx_NoDictElement : public Variable { : Variable("TX") { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_tx_collection->resolveMultiMatches("", l, m_keyExclusion); @@ -65,12 +65,12 @@ class Tx_NoDictElement : public Variable { class Tx_DictElementRegexp : public VariableRegex { public: - explicit Tx_DictElementRegexp(std::string dictElement) + explicit Tx_DictElementRegexp(const std::string &dictElement) : VariableRegex("TX", dictElement), m_dictElement(dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_tx_collection->resolveRegularExpression( m_dictElement, l, m_keyExclusion); @@ -87,19 +87,19 @@ class Tx_DynamicElement : public Variable { m_string(std::move(dictElement)) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { std::string string = m_string->evaluate(t); t->m_collections.m_tx_collection->resolveMultiMatches(string, l, m_keyExclusion); } - void del(Transaction *t, std::string k) { + static void del(Transaction *t, const std::string &k) { t->m_collections.m_tx_collection->del(k); } - void storeOrUpdateFirst(Transaction *t, std::string var, - std::string value) { + static void storeOrUpdateFirst(Transaction *t, const std::string &var, + const std::string &value) { t->m_collections.m_tx_collection->storeOrUpdateFirst(var, value); } diff --git a/src/deps/src/ModSecurity/src/variables/unique_id.h b/src/deps/src/ModSecurity/src/variables/unique_id.h index ef27acdc0..0c97a4b7a 100644 --- a/src/deps/src/ModSecurity/src/variables/unique_id.h +++ b/src/deps/src/ModSecurity/src/variables/unique_id.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/url_encoded_error.h b/src/deps/src/ModSecurity/src/variables/url_encoded_error.h index 377baf764..0e983e5f6 100644 --- a/src/deps/src/ModSecurity/src/variables/url_encoded_error.h +++ b/src/deps/src/ModSecurity/src/variables/url_encoded_error.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/user.h b/src/deps/src/ModSecurity/src/variables/user.h index b6d1a99c3..7d31b4270 100644 --- a/src/deps/src/ModSecurity/src/variables/user.h +++ b/src/deps/src/ModSecurity/src/variables/user.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,12 +34,12 @@ namespace variables { class User_DictElement : public Variable { public: - explicit User_DictElement(std::string dictElement) + explicit User_DictElement(const std::string &dictElement) : Variable("USER:" + dictElement), m_dictElement("USER:" + dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_user_collection->resolveMultiMatches( m_name, t->m_collections.m_user_collection_key, @@ -56,7 +56,7 @@ class User_NoDictElement : public Variable { : Variable("USER") { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_user_collection->resolveMultiMatches(m_name, t->m_collections.m_user_collection_key, @@ -67,12 +67,12 @@ class User_NoDictElement : public Variable { class User_DictElementRegexp : public VariableRegex { public: - explicit User_DictElementRegexp(std::string dictElement) + explicit User_DictElementRegexp(const std::string &dictElement) : VariableRegex("USER", dictElement), m_dictElement(dictElement) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { t->m_collections.m_user_collection->resolveRegularExpression( m_dictElement, t->m_collections.m_user_collection_key, @@ -90,7 +90,7 @@ class User_DynamicElement : public Variable { m_string(std::move(dictElement)) { } void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { std::string string = m_string->evaluate(t); t->m_collections.m_user_collection->resolveMultiMatches( @@ -99,14 +99,14 @@ class User_DynamicElement : public Variable { t->m_rules->m_secWebAppId.m_value, l, m_keyExclusion); } - void del(Transaction *t, std::string k) { + static void del(Transaction *t, const std::string &k) { t->m_collections.m_user_collection->del(k, t->m_collections.m_user_collection_key, t->m_rules->m_secWebAppId.m_value); } - void storeOrUpdateFirst(Transaction *t, std::string var, - std::string value) { + static void storeOrUpdateFirst(Transaction *t, const std::string &var, + const std::string &value) { t->m_collections.m_user_collection->storeOrUpdateFirst( var, t->m_collections.m_user_collection_key, t->m_rules->m_secWebAppId.m_value, diff --git a/src/deps/src/ModSecurity/src/variables/user_id.h b/src/deps/src/ModSecurity/src/variables/user_id.h index acf5f7412..faf33128e 100644 --- a/src/deps/src/ModSecurity/src/variables/user_id.h +++ b/src/deps/src/ModSecurity/src/variables/user_id.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/src/variables/variable.cc b/src/deps/src/ModSecurity/src/variables/variable.cc index 1d1935937..0a50d3223 100644 --- a/src/deps/src/ModSecurity/src/variables/variable.cc +++ b/src/deps/src/ModSecurity/src/variables/variable.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -28,7 +28,7 @@ namespace modsecurity { namespace variables { -Variable::Variable(std::string name) +Variable::Variable(const std::string &name) : m_name(name), m_collectionName("") { size_t a = m_name.find(":"); @@ -76,12 +76,12 @@ void Variable::addsKeyExclusion(Variable *v) { } -std::string operator+(std::string a, Variable *v) { +std::string operator+(const std::string &a, Variable *v) { return a + *v->m_fullName.get(); } -std::string operator+(std::string a, Variables *v) { +std::string operator+(const std::string &a, Variables *v) { std::string test; for (auto &b : *v) { if (test.empty()) { diff --git a/src/deps/src/ModSecurity/src/variables/variable.h b/src/deps/src/ModSecurity/src/variables/variable.h index e62ed6c1e..492df4bd9 100644 --- a/src/deps/src/ModSecurity/src/variables/variable.h +++ b/src/deps/src/ModSecurity/src/variables/variable.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -21,9 +21,9 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/transaction.h" #include "modsecurity/rule.h" -#include "modsecurity/rules.h" #include "src/utils/string.h" #include "src/utils/regex.h" @@ -45,11 +45,11 @@ #define VAR_WITH_REGEX(n, N, e) \ class n ## _DictElementRegexp : public VariableRegex { \ public: \ - explicit n ## _DictElementRegexp(std::string regex) \ + explicit n ## _DictElementRegexp(const std::string ®ex) \ : VariableRegex(#N, regex) { } \ \ void evaluate(Transaction *transaction, \ - Rule *rule, \ + RuleWithActions *rule, \ std::vector *l) override { \ transaction-> e .resolveRegularExpression(&m_r, l, \ m_keyExclusion); \ @@ -60,11 +60,11 @@ class n ## _DictElementRegexp : public VariableRegex { \ #define VAR_WITH_DICT_ELEMENT(n, N, e) \ class n ## _DictElement : public VariableDictElement { \ public: \ - explicit n ## _DictElement(std::string dictElement) \ + explicit n ## _DictElement(const std::string &dictElement) \ : VariableDictElement(#N, dictElement) { } \ \ void evaluate(Transaction *transaction, \ - Rule *rule, \ + RuleWithActions *rule, \ std::vector *l) override { \ transaction-> e .resolve(m_dictElement, l); \ } \ @@ -78,7 +78,7 @@ class n ## _NoDictElement : public Variable { \ : Variable(#N) { } \ \ void evaluate(Transaction *transaction, \ - Rule *rule, \ + RuleWithActions *rule, \ std::vector *l) override { \ transaction-> e .resolve(l, m_keyExclusion); \ } \ @@ -92,7 +92,7 @@ class n : public Variable { \ : Variable(#N) { } \ \ void evaluate(Transaction *transaction, \ - Rule *rule, \ + RuleWithActions *rule, \ std::vector *l) override { \ transaction-> e .evaluate(l); \ } \ @@ -106,6 +106,7 @@ namespace variables { class KeyExclusion { public: + KeyExclusion() { } virtual bool match(const std::string &a) = 0; virtual ~KeyExclusion() { } }; @@ -114,10 +115,10 @@ class KeyExclusion { // FIXME: use pre built regex. class KeyExclusionRegex : public KeyExclusion { public: - explicit KeyExclusionRegex(Utils::Regex re) - : m_re(re.pattern) { } - explicit KeyExclusionRegex(std::string re) - : m_re(re) { } + explicit KeyExclusionRegex(const Utils::Regex &re) + : m_re(re.pattern, true) { } + explicit KeyExclusionRegex(const std::string &re) + : m_re(re, true) { } ~KeyExclusionRegex() override { } @@ -131,7 +132,7 @@ class KeyExclusionRegex : public KeyExclusion { class KeyExclusionString : public KeyExclusion { public: - KeyExclusionString(std::string &a) + explicit KeyExclusionString(std::string &a) : m_key(utils::string::toupper(a)) { } ~KeyExclusionString() override { } @@ -150,6 +151,9 @@ class KeyExclusionString : public KeyExclusion { class KeyExclusions : public std::deque> { public: + KeyExclusions() { + } + bool toOmit(std::string a) { for (auto &z : *this) { if (z->match(a)) { @@ -163,6 +167,7 @@ class KeyExclusions : public std::deque> { class VariableMonkeyResolution { public: + VariableMonkeyResolution () { } static inline bool comp(const std::string &a, const std::string &b) { return a.size() == b.size() && std::equal(a.begin(), a.end(), b.begin(), @@ -539,13 +544,13 @@ class VariableMonkeyResolution { class Variable : public VariableMonkeyResolution { public: - explicit Variable(std::string _name); + explicit Variable(const std::string &name); explicit Variable(Variable *_name); virtual ~Variable() { } virtual void evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) = 0; @@ -562,7 +567,7 @@ class Variable : public VariableMonkeyResolution { void addsKeyExclusion(Variable *v); - bool operator==(const Variable& b) { + bool operator==(const Variable& b) const { return m_collectionName == b.m_collectionName && m_name == b.m_name && *m_fullName == *b.m_fullName; @@ -580,7 +585,7 @@ class Variable : public VariableMonkeyResolution { class VariableDictElement : public Variable { public: - VariableDictElement(std::string name, std::string dict_element) + VariableDictElement(const std::string &name, const std::string &dict_element) : m_dictElement(dict_element), Variable(name + ":" + dict_element) { } std::string m_dictElement; @@ -589,14 +594,14 @@ class VariableDictElement : public Variable { class VariableRegex : public Variable { public: - VariableRegex(std::string name, std::string regex) - : m_r(regex), + VariableRegex(const std::string &name, const std::string ®ex) + : m_r(regex, true), m_regex(regex), Variable(name + ":" + "regex(" + regex + ")") { } + Utils::Regex m_r; // FIXME: no need for that. std::string m_regex; - Utils::Regex m_r; }; class Variables : public std::vector { @@ -605,14 +610,14 @@ class Variables : public std::vector { return std::find_if(begin(), end(), [v](Variable *m) -> bool { return *v == *m; }) != end(); }; - bool contains(const std::string &v) { + bool contains(const VariableValue *v) { return std::find_if(begin(), end(), [v](Variable *m) -> bool { VariableRegex *r = dynamic_cast(m); if (r) { - return r->m_r.searchAll(v).size() > 0; + return r->m_r.searchAll(v->getKey()).size() > 0; } - return v == *m->m_fullName.get(); + return v->getKeyWithCollection() == *m->m_fullName.get(); }) != end(); }; }; @@ -621,11 +626,12 @@ class Variables : public std::vector { class VariableModificatorExclusion : public Variable { public: explicit VariableModificatorExclusion(std::unique_ptr var) - : m_base(std::move(var)), Variable(var.get()) { } + : Variable(var.get()), + m_base(std::move(var)) { } void evaluate(Transaction *t, - Rule *rule, - std::vector *l) { + RuleWithActions *rule, + std::vector *l) override { m_base->evaluate(t, rule, l); } @@ -642,8 +648,8 @@ class VariableModificatorCount : public Variable { } void evaluate(Transaction *t, - Rule *rule, - std::vector *l) { + RuleWithActions *rule, + std::vector *l) override { std::vector reslIn; VariableValue *val = NULL; int count = 0; @@ -669,8 +675,8 @@ class VariableModificatorCount : public Variable { }; -std::string operator+(std::string a, modsecurity::variables::Variable *v); -std::string operator+(std::string a, modsecurity::variables::Variables *v); +std::string operator+(const std::string &a, modsecurity::variables::Variable *v); +std::string operator+(const std::string &a, modsecurity::variables::Variables *v); } // namespace variables diff --git a/src/deps/src/ModSecurity/src/variables/web_app_id.h b/src/deps/src/ModSecurity/src/variables/web_app_id.h index 036701c2e..f9b201b54 100644 --- a/src/deps/src/ModSecurity/src/variables/web_app_id.h +++ b/src/deps/src/ModSecurity/src/variables/web_app_id.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -36,9 +36,8 @@ class WebAppId : public Variable { : Variable("WEBAPPID") { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { - const std::string name("WEBAPPID"); const std::string rname = transaction->m_rules->m_secWebAppId.m_value; l->push_back(new VariableValue(&m_name, &rname)); } diff --git a/src/deps/src/ModSecurity/src/variables/xml.cc b/src/deps/src/ModSecurity/src/variables/xml.cc index b508ad98c..9b3d8ff96 100644 --- a/src/deps/src/ModSecurity/src/variables/xml.cc +++ b/src/deps/src/ModSecurity/src/variables/xml.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -36,8 +36,8 @@ #include #include "modsecurity/transaction.h" -#include "modsecurity/rules_properties.h" -#include "modsecurity/rules.h" +#include "modsecurity/rules_set_properties.h" +#include "modsecurity/rules_set.h" #include "src/request_body_processor/xml.h" #include "modsecurity/actions/action.h" @@ -48,12 +48,12 @@ namespace variables { #ifndef WITH_LIBXML2 void XML::evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) { } #else void XML::evaluate(Transaction *t, - Rule *rule, + RuleWithActions *rule, std::vector *l) { xmlXPathContextPtr xpathCtx; xmlXPathObjectPtr xpathObj; @@ -61,7 +61,7 @@ void XML::evaluate(Transaction *t, std::string param; const xmlChar* xpathExpr = NULL; int i; - size_t pos; + //size_t pos; param = m_name; /* diff --git a/src/deps/src/ModSecurity/src/variables/xml.h b/src/deps/src/ModSecurity/src/variables/xml.h index 1ffae96fe..998fcd64c 100644 --- a/src/deps/src/ModSecurity/src/variables/xml.h +++ b/src/deps/src/ModSecurity/src/variables/xml.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -43,7 +43,7 @@ class XML_NoDictElement : public Variable { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override { l->push_back(new VariableValue(&m_var)); } @@ -55,11 +55,11 @@ class XML_NoDictElement : public Variable { class XML : public Variable { public: - explicit XML(std::string _name) + explicit XML(const std::string &_name) : Variable(_name) { } void evaluate(Transaction *transaction, - Rule *rule, + RuleWithActions *rule, std::vector *l) override; }; diff --git a/src/deps/src/ModSecurity/test/Makefile.am b/src/deps/src/ModSecurity/test/Makefile.am index 97364554d..9237a8749 100644 --- a/src/deps/src/ModSecurity/test/Makefile.am +++ b/src/deps/src/ModSecurity/test/Makefile.am @@ -42,7 +42,6 @@ noinst_HEADERS = \ unit_tests_LDADD = \ - $(top_builddir)/src/.libs/libmodsecurity.a \ $(CURL_LDADD) \ $(GEOIP_LDADD) \ $(MAXMIND_LDADD) \ @@ -51,12 +50,18 @@ unit_tests_LDADD = \ $(LMDB_LDADD) \ $(LUA_LDADD) \ $(PCRE_LDADD) \ + $(PCRE2_LDADD) \ $(SSDEEP_LDADD) \ $(YAJL_LDADD) unit_tests_LDFLAGS = \ + -L$(top_builddir)/src/.libs/ \ $(GEOIP_LDFLAGS) \ + -lmodsecurity \ + -lpthread \ + -lm \ + -lstdc++ \ $(MAXMIND_LDFLAGS) \ $(LMDB_LDFLAGS) \ $(LUA_LDFLAGS) \ @@ -77,6 +82,7 @@ unit_tests_CPPFLAGS = \ $(GLOBAL_CPPFLAGS) \ $(LMDB_CFLAGS) \ $(PCRE_CFLAGS) \ + $(PCRE2_CFLAGS) \ $(YAJL_CFLAGS) \ $(LUA_CFLAGS) \ $(SSDEEP_CFLAGS) \ @@ -92,7 +98,6 @@ regression_tests_SOURCES = \ regression/custom_debug_log.cc regression_tests_LDADD = \ - $(top_builddir)/src/.libs/libmodsecurity.a \ $(CURL_LDADD) \ $(GEOIP_LDADD) \ $(MAXMIND_LDADD) \ @@ -101,12 +106,18 @@ regression_tests_LDADD = \ $(LMDB_LDADD) \ $(LUA_LDADD) \ $(PCRE_LDADD) \ + $(PCRE2_LDADD) \ $(SSDEEP_LDADD) \ $(YAJL_LDADD) regression_tests_LDFLAGS = \ + -L$(top_builddir)/src/.libs/ \ $(GEOIP_LDFLAGS) \ + -lmodsecurity \ + -lpthread \ + -lm \ + -lstdc++ \ $(MAXMIND_LDFLAGS) \ $(YAJL_LDFLAGS) \ $(LMDB_LDFLAGS) \ @@ -129,6 +140,7 @@ regression_tests_CPPFLAGS = \ $(LUA_CFLAGS) \ $(SSDEEP_CFLAGS) \ $(PCRE_CFLAGS) \ + $(PCRE2_CFLAGS) \ $(YAJL_CFLAGS) \ $(LIBXML2_CFLAGS) @@ -141,7 +153,6 @@ rules_optimization_SOURCES = \ optimization/optimization.cc rules_optimization_LDADD = \ - $(top_builddir)/src/.libs/libmodsecurity.a \ $(CURL_LDADD) \ $(GEOIP_LDADD) \ $(MAXMIND_LDADD) \ @@ -150,11 +161,17 @@ rules_optimization_LDADD = \ $(LMDB_LDADD) \ $(LUA_LDADD) \ $(PCRE_LDADD) \ + $(PCRE2_LDADD) \ $(SSDEEP_LDADD) \ $(YAJL_LDADD) rules_optimization_LDFLAGS = \ + -L$(top_builddir)/src/.libs/ \ $(GEOIP_LDFLAGS) \ + -lmodsecurity \ + -lpthread \ + -lm \ + -lstdc++ \ $(MAXMIND_LDFLAGS) \ $(LMDB_LDFLAGS) \ $(LUA_LDFLAGS) \ @@ -176,6 +193,7 @@ rules_optimization_CPPFLAGS = \ $(LUA_CFLAGS) \ $(SSDEEP_CFLAGS) \ $(PCRE_CFLAGS) \ + $(PCRE2_CFLAGS) \ $(YAJL_CFLAGS) \ $(LIBXML2_CFLAGS) diff --git a/src/deps/src/ModSecurity/test/benchmark/Makefile.am b/src/deps/src/ModSecurity/test/benchmark/Makefile.am index e14f50e5e..73a975b33 100644 --- a/src/deps/src/ModSecurity/test/benchmark/Makefile.am +++ b/src/deps/src/ModSecurity/test/benchmark/Makefile.am @@ -6,7 +6,6 @@ benchmark_SOURCES = \ benchmark.cc benchmark_LDADD = \ - $(top_builddir)/src/.libs/libmodsecurity.a \ $(CURL_LDADD) \ $(GEOIP_LDADD) \ $(MAXMIND_LDADD) \ @@ -19,7 +18,12 @@ benchmark_LDADD = \ $(GLOBAL_LDADD) benchmark_LDFLAGS = \ - $(top_builddir)/src/.libs/libmodsecurity.a \ + -L$(top_builddir)/src/.libs/ \ + $(GEOIP_LDFLAGS) \ + -lmodsecurity \ + -lpthread \ + -lm \ + -lstdc++ \ $(GEOIP_LDFLAGS) \ $(MAXMIND_LDFLAGS) \ $(YAJL_LDFLAGS) \ diff --git a/src/deps/src/ModSecurity/test/benchmark/benchmark.cc b/src/deps/src/ModSecurity/test/benchmark/benchmark.cc index 0ec083f1b..a1037a470 100644 --- a/src/deps/src/ModSecurity/test/benchmark/benchmark.cc +++ b/src/deps/src/ModSecurity/test/benchmark/benchmark.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,8 +19,8 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/modsecurity.h" -#include "modsecurity/rules.h" using modsecurity::Transaction; @@ -71,14 +71,14 @@ int main(int argc, char *argv[]) { } std::cout << "Doing " << NUM_REQUESTS << " transactions...\n"; modsecurity::ModSecurity *modsec; - modsecurity::Rules *rules; + modsecurity::RulesSet *rules; modsecurity::ModSecurityIntervention it; modsecurity::intervention::reset(&it); modsec = new modsecurity::ModSecurity(); modsec->setConnectorInformation("ModSecurity-benchmark v0.0.1-alpha" \ " (ModSecurity benchmark utility)"); - rules = new modsecurity::Rules(); + rules = new modsecurity::RulesSet(); if (rules->loadFromUri(rules_file) < 0) { std::cout << "Problems loading the rules..." << std::endl; std::cout << rules->m_parserError.str() << std::endl; diff --git a/src/deps/src/ModSecurity/test/common/colors.h b/src/deps/src/ModSecurity/test/common/colors.h index ad878ed59..0a66bd065 100644 --- a/src/deps/src/ModSecurity/test/common/colors.h +++ b/src/deps/src/ModSecurity/test/common/colors.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/test/common/modsecurity_test.cc b/src/deps/src/ModSecurity/test/common/modsecurity_test.cc index 28a48500c..5b63580f6 100644 --- a/src/deps/src/ModSecurity/test/common/modsecurity_test.cc +++ b/src/deps/src/ModSecurity/test/common/modsecurity_test.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -78,8 +78,8 @@ bool ModSecurityTest::load_test_json(std::string file) { if (this->count(u->filename + ":" + u->name) == 0) { std::vector *vector = new std::vector; vector->push_back(u); - std::pair *> a(u->filename + ":" + - u->name, vector); + std::string filename(u->filename + ":" + u->name); + std::pair*> a(filename, vector); this->insert(a); } else { std::vector *vec = this->at(u->filename + ":" + u->name); @@ -145,7 +145,7 @@ void ModSecurityTest::cmd_options(int argc, char **argv) { i++; m_count_all = true; } - if (const char* env_p = std::getenv("AUTOMAKE_TESTS")) { + if (std::getenv("AUTOMAKE_TESTS")) { m_automake_output = true; } diff --git a/src/deps/src/ModSecurity/test/common/modsecurity_test.h b/src/deps/src/ModSecurity/test/common/modsecurity_test.h index 67c5be632..83e06ab8f 100644 --- a/src/deps/src/ModSecurity/test/common/modsecurity_test.h +++ b/src/deps/src/ModSecurity/test/common/modsecurity_test.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/test/common/modsecurity_test_results.h b/src/deps/src/ModSecurity/test/common/modsecurity_test_results.h index 3b3c908bd..a786fd19f 100644 --- a/src/deps/src/ModSecurity/test/common/modsecurity_test_results.h +++ b/src/deps/src/ModSecurity/test/common/modsecurity_test_results.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/src/deps/src/ModSecurity/test/cppcheck_suppressions.txt b/src/deps/src/ModSecurity/test/cppcheck_suppressions.txt index 7c0f13565..9258341ce 100644 --- a/src/deps/src/ModSecurity/test/cppcheck_suppressions.txt +++ b/src/deps/src/ModSecurity/test/cppcheck_suppressions.txt @@ -1,50 +1,102 @@ -unusedFunction:test/regression/regression_test.cc -unusedFunction:src/utils/string.cc -unusedFunction:src/transaction.cc -unusedFunction:src/utils/mbedtls/sha1.c -unusedFunction:src/utils/mbedtls/md5.c -unusedFunction:src/utils/mbedtls/base64.c -unusedFunction:src/modsecurity.cc -unusedFunction:src/utils/msc_tree.cc -unusedFunction:src/utils/acmp.cc -unusedFunction:src/macro_expansion.cc -unusedFunction:src/rules.cc -unusedFunction:test/optimization/optimization.cc -unusedFunction:src/utils.cc -*:src/parser/seclang-parser.hh -*:src/parser/seclang-scanner.cc -*:parser/seclang-parser.hh -*:parser/seclang-scanner.cc -*:seclang-parser.tab.hh -*:seclang-scanner.ll -*:seclang-scanner.cc -*:src/seclang-scanner.cc -*:src/parser/seclang-parser.cc +// +// Ignore libinjection related stuff. +// *:others/libinjection/src/libinjection_html5.c *:others/libinjection/src/libinjection_sqli.c *:others/libinjection/src/libinjection_xss.c -*:others/libinjection/src/libinjection_xss.c *:others/libinjection/src/reader.c *:others/libinjection/src/sqli_cli.c +*:others/libinjection/src/testdriver.c *:others/libinjection/src/test_speed_sqli.c *:others/libinjection/src/test_speed_xss.c -*:others/libinjection/src/testdriver.c -initializerList:src/actions/action.h:90 -initializerList:src/actions/action.h:91 -unusedLabel:src/unique_id.cc:222 -unusedLabel:src/unique_id.cc:224 -leakReturnValNotUsed:src/debug_log_writer_agent.cc:31 -postfixOperator:* -*:others/mbedtls/base64.c -*:others/mbedtls/sha1.c -*:others/mbedtls/md5.c -readdirCalled:test/common/modsecurity_test.cc:114 -missingInclude:* -unreadVariable:test/regression/regression.cc:380 -shiftNegative:src/utils/msc_tree.cc -nullPointerRedundantCheck:src/utils/msc_tree.cc:654 -*:test/benchmark/owasp-v3/util/av-scanning/runAV/common.c -passedByValue:src/variables/time.h:34 -knownConditionTrueFalse:test/regression/regression.cc:453 -unusedFunction:test/unit/unit_test.cc:33 + +// +// Lets ignore mbedtls. +// +*:others/mbedtls/base64.c +*:others/mbedtls/md5.c +*:others/mbedtls/sha1.c + + +// +// Code imported from ModSecurity v2... +// +shiftNegative:src/utils/msc_tree.cc +*:src/utils/acmp.cc +*:src/utils/msc_tree.cc +invalidScanfArgType_int:src/rules_set_properties.cc:101 +invalidScanfArgType_int:src/rules_set_properties.cc:102 + + +// +// ModSecurity v3 code... +// +unmatchedSuppression:src/utils/geo_lookup.cc:82 +useInitializationList:src/utils/shared_files.h:87 +unmatchedSuppression:src/utils/msc_tree.cc +functionStatic:headers/modsecurity/transaction.h:408 +duplicateBranch:src/audit_log/audit_log.cc:226 +unreadVariable:src/request_body_processor/multipart.cc:435 +stlcstrParam:src/audit_log/writer/parallel.cc:145 +functionStatic:src/engine/lua.h:70 +functionStatic:src/engine/lua.h:71 +functionConst:src/utils/geo_lookup.h:49 +useInitializationList:src/operators/rbl.h:69 +constStatement:test/common/modsecurity_test.cc:82 +danglingTemporaryLifetime:src/modsecurity.cc:206 +functionStatic:src/operators/geo_lookup.h:35 +duplicateBreak:src/operators/validate_utf8_encoding.cc +syntaxError:src/transaction.cc:62 +noConstructor:src/variables/variable.h:152 +duplicateBranch:src/request_body_processor/multipart.cc:93 +danglingTempReference:src/modsecurity.cc:206 +knownConditionTrueFalse:src/operators/validate_url_encoding.cc:77 +knownConditionTrueFalse:src/operators/verify_svnr.cc:87 +rethrowNoCurrentException:headers/modsecurity/transaction.h:309 +rethrowNoCurrentException:src/rule_with_actions.cc:127 +ctunullpointer:src/rule_with_actions.cc:241 +ctunullpointer:src/rule_with_operator.cc:135 +ctunullpointer:src/rule_with_operator.cc:95 +passedByValue:src/variables/global.h:109 +passedByValue:src/variables/global.h:110 +passedByValue:src/parser/driver.cc:45 +passedByValue:test/common/modsecurity_test.cc:49 +passedByValue:test/common/modsecurity_test.cc:98 +unreadVariable:src/rule_with_operator.cc:219 + +uninitvar:src/operators/verify_cpf.cc:77 +uninitvar:src/operators/verify_svnr.cc:67 + +noExplicitConstructor:seclang-parser.hh +constParameter:seclang-parser.hh +accessMoved:seclang-parser.hh +returnTempReference:seclang-parser.hh + +unusedFunction +missingIncludeSystem +useStlAlgorithm +preprocessorErrorDirective +funcArgNamesDifferent +unmatchedSuppression +missingInclude + +purgedConfiguration + +constParameter + +nullPointerRedundantCheck +knownConditionTrueFalse +cstyleCast +functionStatic +variableScope +shadowFunction + +constVariable +stlcstrConstructor +stlcstrStream +uselessCallsSubstr + +// Examples +memleak:examples/reading_logs_via_rule_message/reading_logs_via_rule_message.h:147 +memleak:examples/using_bodies_in_chunks/simple_request.cc diff --git a/src/deps/src/ModSecurity/test/fuzzer/Makefile.am b/src/deps/src/ModSecurity/test/fuzzer/Makefile.am index 2e4475c0d..d1fd08dc7 100644 --- a/src/deps/src/ModSecurity/test/fuzzer/Makefile.am +++ b/src/deps/src/ModSecurity/test/fuzzer/Makefile.am @@ -37,6 +37,7 @@ afl_fuzzer_CPPFLAGS = \ -O0 \ -g \ -I$(top_builddir)/headers \ + $(CURL_CFLAGS) \ $(GEOIP_CFLAGS) \ $(MAXMIND_CFLAGS) \ $(GLOBAL_CPPFLAGS) \ diff --git a/src/deps/src/ModSecurity/test/fuzzer/afl_fuzzer.cc b/src/deps/src/ModSecurity/test/fuzzer/afl_fuzzer.cc index 936a56ac1..6b19a18f0 100644 --- a/src/deps/src/ModSecurity/test/fuzzer/afl_fuzzer.cc +++ b/src/deps/src/ModSecurity/test/fuzzer/afl_fuzzer.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,17 +15,16 @@ #include - +#include "modsecurity/rules_set.h" #include "modsecurity/modsecurity.h" -#include "modsecurity/rules.h" #include "src/actions/transformations/transformation.h" /** * for i in $(ls -l src/actions/transformations/*.h | awk {'print $9'}); do echo "#include \"$i\""; done; * */ -#include "src/actions/transformations/base64_decode_ext.h" #include "src/actions/transformations/base64_decode.h" +#include "src/actions/transformations/base64_decode_ext.h" #include "src/actions/transformations/base64_encode.h" #include "src/actions/transformations/cmd_line.h" #include "src/actions/transformations/compress_whitespace.h" @@ -44,8 +43,8 @@ #include "src/actions/transformations/parity_even_7bit.h" #include "src/actions/transformations/parity_odd_7bit.h" #include "src/actions/transformations/parity_zero_7bit.h" -#include "src/actions/transformations/remove_comments_char.h" #include "src/actions/transformations/remove_comments.h" +#include "src/actions/transformations/remove_comments_char.h" #include "src/actions/transformations/remove_nulls.h" #include "src/actions/transformations/remove_whitespace.h" #include "src/actions/transformations/replace_comments.h" @@ -56,6 +55,7 @@ #include "src/actions/transformations/trim.h" #include "src/actions/transformations/trim_left.h" #include "src/actions/transformations/trim_right.h" +#include "src/actions/transformations/upper_case.h" #include "src/actions/transformations/url_decode.h" #include "src/actions/transformations/url_decode_uni.h" #include "src/actions/transformations/url_encode.h" @@ -118,11 +118,19 @@ using namespace modsecurity; #include #include +inline void op_test(const std::string &opName, const std::string &s) { + Operator *op = Operator::instantiate(opName, ""); + op->init("", nullptr); + op->evaluate(nullptr, nullptr, s, nullptr); + delete op; +} int main(int argc, char** argv) { uint8_t buf[128]; +#if 0 std::string lastString; +#endif while (__AFL_LOOP(1000)) { ssize_t read_bytes; @@ -132,10 +140,12 @@ int main(int argc, char** argv) { std::string currentString = std::string(read_bytes, 128); std::string s = currentString; +#if 0 std::string z = lastString; +#endif ModSecurity *ms = new ModSecurity(); - Rules *rules = new Rules(); + RulesSet *rules = new RulesSet(); // Here it is possible to load a real transaction from a JSON. // like we do on the regression tests. Transaction *t = new Transaction(ms, rules, NULL); @@ -147,8 +157,8 @@ int main(int argc, char** argv) { * for i in $(grep "class " -Ri src/actions/transformations/* | grep " :" | grep -v "InstantCache" | awk {'print $2'}); do echo $i *$(echo $i | awk '{print tolower($0)}') = new $i\(\"$i\"\)\; $(echo $i | awk '{print tolower($0)}')-\>evaluate\(s, NULL\)\; delete $(echo $i | awk '{print tolower($0)}')\;; done; * */ -Base64DecodeExt *base64decodeext = new Base64DecodeExt("Base64DecodeExt"); base64decodeext->evaluate(s, NULL); delete base64decodeext; Base64Decode *base64decode = new Base64Decode("Base64Decode"); base64decode->evaluate(s, NULL); delete base64decode; +Base64DecodeExt *base64decodeext = new Base64DecodeExt("Base64DecodeExt"); base64decodeext->evaluate(s, NULL); delete base64decodeext; Base64Encode *base64encode = new Base64Encode("Base64Encode"); base64encode->evaluate(s, NULL); delete base64encode; CmdLine *cmdline = new CmdLine("CmdLine"); cmdline->evaluate(s, NULL); delete cmdline; CompressWhitespace *compresswhitespace = new CompressWhitespace("CompressWhitespace"); compresswhitespace->evaluate(s, NULL); delete compresswhitespace; @@ -167,8 +177,8 @@ NormalisePathWin *normalisepathwin = new NormalisePathWin("NormalisePathWin"); n ParityEven7bit *parityeven7bit = new ParityEven7bit("ParityEven7bit"); parityeven7bit->evaluate(s, NULL); delete parityeven7bit; ParityOdd7bit *parityodd7bit = new ParityOdd7bit("ParityOdd7bit"); parityodd7bit->evaluate(s, NULL); delete parityodd7bit; ParityZero7bit *parityzero7bit = new ParityZero7bit("ParityZero7bit"); parityzero7bit->evaluate(s, NULL); delete parityzero7bit; -RemoveCommentsChar *removecommentschar = new RemoveCommentsChar("RemoveCommentsChar"); removecommentschar->evaluate(s, NULL); delete removecommentschar; RemoveComments *removecomments = new RemoveComments("RemoveComments"); removecomments->evaluate(s, NULL); delete removecomments; +RemoveCommentsChar *removecommentschar = new RemoveCommentsChar("RemoveCommentsChar"); removecommentschar->evaluate(s, NULL); delete removecommentschar; RemoveNulls *removenulls = new RemoveNulls("RemoveNulls"); removenulls->evaluate(s, NULL); delete removenulls; RemoveWhitespace *removewhitespace = new RemoveWhitespace("RemoveWhitespace"); removewhitespace->evaluate(s, NULL); delete removewhitespace; ReplaceComments *replacecomments = new ReplaceComments("ReplaceComments"); replacecomments->evaluate(s, NULL); delete replacecomments; @@ -179,60 +189,59 @@ Transformation *transformation = new Transformation("Transformation"); transform Trim *trim = new Trim("Trim"); trim->evaluate(s, NULL); delete trim; TrimLeft *trimleft = new TrimLeft("TrimLeft"); trimleft->evaluate(s, NULL); delete trimleft; TrimRight *trimright = new TrimRight("TrimRight"); trimright->evaluate(s, NULL); delete trimright; +UpperCase *uppercase = new UpperCase("UpperCase"); uppercase->evaluate(s, NULL); delete uppercase; UrlDecode *urldecode = new UrlDecode("UrlDecode"); urldecode->evaluate(s, NULL); delete urldecode; UrlDecodeUni *urldecodeuni = new UrlDecodeUni("UrlDecodeUni"); urldecodeuni->evaluate(s, NULL); delete urldecodeuni; UrlEncode *urlencode = new UrlEncode("UrlEncode"); urlencode->evaluate(s, NULL); delete urlencode; Utf8ToUnicode *utf8tounicode = new Utf8ToUnicode("Utf8ToUnicode"); utf8tounicode->evaluate(s, NULL); delete utf8tounicode; - /** * Operators, generated by: * * for i in $(grep "class " -Ri src/operators/* | grep " :" | awk {'print $2'}); do echo $i *$(echo $i | awk '{print tolower($0)}') = new $i\(\"$i\", z, false\)\; $(echo $i | awk '{print tolower($0)}')-\>evaluate\(t, s\)\; delete $(echo $i | awk '{print tolower($0)}')\;; done; * */ -BeginsWith *beginswith = new BeginsWith("BeginsWith", z, false); beginswith->evaluate(t, s); delete beginswith; -Contains *contains = new Contains("Contains", z, false); contains->evaluate(t, s); delete contains; -ContainsWord *containsword = new ContainsWord("ContainsWord", z, false); containsword->evaluate(t, s); delete containsword; -DetectSQLi *detectsqli = new DetectSQLi("DetectSQLi", z, false); detectsqli->evaluate(t, s); delete detectsqli; -DetectXSS *detectxss = new DetectXSS("DetectXSS", z, false); detectxss->evaluate(t, s); delete detectxss; -EndsWith *endswith = new EndsWith("EndsWith", z, false); endswith->evaluate(t, s); delete endswith; -Eq *eq = new Eq("Eq", z, false); eq->evaluate(t, s); delete eq; -FuzzyHash *fuzzyhash = new FuzzyHash("FuzzyHash", z, false); fuzzyhash->evaluate(t, s); delete fuzzyhash; -Ge *ge = new Ge("Ge", z, false); ge->evaluate(t, s); delete ge; -GeoLookup *geolookup = new GeoLookup("GeoLookup", z, false); geolookup->evaluate(t, s); delete geolookup; -GsbLookup *gsblookup = new GsbLookup("GsbLookup", z, false); gsblookup->evaluate(t, s); delete gsblookup; -Gt *gt = new Gt("Gt", z, false); gt->evaluate(t, s); delete gt; -InspectFile *inspectfile = new InspectFile("InspectFile", z, false); inspectfile->evaluate(t, s); delete inspectfile; -IpMatchF *ipmatchf = new IpMatchF("IpMatchF", z, false); ipmatchf->evaluate(t, s); delete ipmatchf; -IpMatchFromFile *ipmatchfromfile = new IpMatchFromFile("IpMatchFromFile", z, false); ipmatchfromfile->evaluate(t, s); delete ipmatchfromfile; -IpMatch *ipmatch = new IpMatch("IpMatch", z, false); ipmatch->evaluate(t, s); delete ipmatch; -Le *le = new Le("Le", z, false); le->evaluate(t, s); delete le; -Lt *lt = new Lt("Lt", z, false); lt->evaluate(t, s); delete lt; -NoMatch *nomatch = new NoMatch("NoMatch", z, false); nomatch->evaluate(t, s); delete nomatch; -PmF *pmf = new PmF("PmF", z, false); pmf->evaluate(t, s); delete pmf; -PmFromFile *pmfromfile = new PmFromFile("PmFromFile", z, false); pmfromfile->evaluate(t, s); delete pmfromfile; -Pm *pm = new Pm("Pm", z, false); pm->evaluate(t, s); delete pm; -// Rbl test is too slow to be tested here. -// Rbl *rbl = new Rbl("Rbl", z, false); rbl->evaluate(t, s); delete rbl; -Rsub *rsub = new Rsub("Rsub", z, false); rsub->evaluate(t, s); delete rsub; -Rx *rx = new Rx("Rx", z, false); rx->evaluate(t, s); delete rx; +op_test("BeginsWith", s); +op_test("Contains", s); +op_test("ContainsWord", s); +op_test("DetectSQLi", s); +op_test("DetectXSS", s); +op_test("EndsWith", s); +op_test("Eq", s); +//op_test("FuzzyHash", s); +op_test("Ge", s); +//op_test("GeoLookup", s); +//op_test("GsbLookup", s); +op_test("Gt", s); +//op_test("InspectFile", s); +//op_test("IpMatchF", s); +//op_test("IpMatchFromFile", s); +op_test("IpMatch", s); +op_test("Le", s); +op_test("Lt", s); +op_test("NoMatch", s); +//op_test("PmF", s); +//op_test("PmFromFile", s); +op_test("Pm", s); +op_test("Rbl", s); +op_test("Rsub", s); +op_test("Rx", s); +op_test("StrEq", s); +op_test("StrMatch", s); +op_test("UnconditionalMatch", s); +//op_test("ValidateByteRange", s); +//op_test("ValidateDTD", s); +//op_test("ValidateHash", s); +//op_test("ValidateSchema", s); +//op_test("ValidateUrlEncoding", s); +op_test("ValidateUtf8Encoding", s); +op_test("VerifyCC", s); +op_test("VerifyCPF", s); +op_test("VerifySSN", s); +op_test("VerifySVNR", s); +op_test("Within", s); -StrEq *streq = new StrEq("StrEq", z, false); streq->evaluate(t, s); delete streq; - -StrMatch *strmatch = new StrMatch("StrMatch", z, false); strmatch->evaluate(t, s); delete strmatch; -UnconditionalMatch *unconditionalmatch = new UnconditionalMatch("UnconditionalMatch", z, false); unconditionalmatch->evaluate(t, s); delete unconditionalmatch; -ValidateByteRange *validatebyterange = new ValidateByteRange("ValidateByteRange", z, false); validatebyterange->evaluate(t, s); delete validatebyterange; -ValidateDTD *validatedtd = new ValidateDTD("ValidateDTD", z, false); validatedtd->evaluate(t, s); delete validatedtd; -ValidateHash *validatehash = new ValidateHash("ValidateHash", z, false); validatehash->evaluate(t, s); delete validatehash; -ValidateSchema *validateschema = new ValidateSchema("ValidateSchema", z, false); validateschema->evaluate(t, s); delete validateschema; -ValidateUrlEncoding *validateurlencoding = new ValidateUrlEncoding("ValidateUrlEncoding", z, false); validateurlencoding->evaluate(t, s); delete validateurlencoding; -ValidateUtf8Encoding *validateutf8encoding = new ValidateUtf8Encoding("ValidateUtf8Encoding", z, false); validateutf8encoding->evaluate(t, s); delete validateutf8encoding; -VerifyCC *verifycc = new VerifyCC("VerifyCC", z, false); verifycc->evaluate(t, s); delete verifycc; -VerifyCPF *verifycpf = new VerifyCPF("VerifyCPF", z, false); verifycpf->evaluate(t, s); delete verifycpf; -VerifySSN *verifyssn = new VerifySSN("VerifySSN", z, false); verifyssn->evaluate(t, s); delete verifyssn; -Within *within = new Within("Within", z, false); within->evaluate(t, s); delete within; /** * ModSec API @@ -261,8 +270,9 @@ Within *within = new Within("Within", z, false); within->evaluate(t, s); delete delete t; delete rules; delete ms; - +#if 0 lastString = currentString; +#endif } return 0; } diff --git a/src/deps/src/ModSecurity/test/optimization/optimization.cc b/src/deps/src/ModSecurity/test/optimization/optimization.cc index ea8ac4c98..5443065b0 100644 --- a/src/deps/src/ModSecurity/test/optimization/optimization.cc +++ b/src/deps/src/ModSecurity/test/optimization/optimization.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -20,13 +20,16 @@ #include #include +#include "modsecurity/rules_set_properties.h" +#include "modsecurity/rules_set.h" #include "modsecurity/modsecurity.h" -#include "modsecurity/rules.h" #include "src/utils/system.h" #include "src/parser/driver.h" #include "src/utils/https_client.h" -#include "modsecurity/rules_properties.h" #include "modsecurity/transaction.h" +#include "modsecurity/rule_unconditional.h" +#include "modsecurity/rule_with_operator.h" + void print_help() { std::cout << "Use ./optimization /path/to/files.something" << std::endl; @@ -36,18 +39,18 @@ void print_help() { int main(int argc, char **argv) { - modsecurity::Rules *modsecRules = new modsecurity::Rules(); + modsecurity::RulesSet *modsecRules = new modsecurity::RulesSet(); std::list files; int total = 0; - int i = 1; - while (i < argc) { + int p = 1; + while (p < argc) { std::list tfiles = modsecurity::utils::expandEnv( - argv[i], 0); + argv[p], 0); for (const auto &file : tfiles) { files.insert(files.begin(), file); } - i++; + p++; } @@ -67,54 +70,49 @@ int main(int argc, char **argv) { std::cout << std::endl; int nphases = modsecurity::Phases::NUMBER_OF_PHASES; - for (int i = 0; i < nphases; i++) { - std::vector rules = modsecRules->m_rules[i]; - if (rules.size() == 0) { + for (int j = 0; j < nphases; j++) { + Rules *rules = modsecRules->m_rulesSetPhases[j]; + if (rules->size() == 0) { continue; } - std::cout << "Phase: " << std::to_string(i); - std::cout << " (" << std::to_string(rules.size()); + std::cout << "Phase: " << std::to_string(j); + std::cout << " (" << std::to_string(rules->size()); std::cout << " rules)" << std::endl; std::unordered_map operators; - std::unordered_map variables; - std::unordered_map op2var; - for (auto &z : rules) { - std::string key; + + for (int i = 0; i < rules->size(); i++) { + auto z = rules->at(i); if (z == NULL) { continue; } - if (z->m_op != NULL) { - std::string op = z->m_op->m_op; + + if (dynamic_cast(z.get()) != nullptr) { + std::string op = "Unconditional"; if (operators.count(op) > 0) { operators[op] = 1 + operators[op]; } else { operators[op] = 1; } - key = op; } - if (z->m_variables != NULL) { - std::string var = std::string("") + z->m_variables; - if (variables.count(var) > 0) { - variables[var] = 1 + variables[var]; - } else { - variables[var] = 1; - } - key = key + var; - } - if (z->m_variables != NULL && z->m_op != NULL) { - if (op2var.count(key) > 0) { - op2var[key] = 1 + op2var[key]; - } else { - op2var[key] = 1; - } - } - } - if (operators.empty() && variables.empty() && op2var.empty()) { + if (dynamic_cast(z.get()) != nullptr) { + auto *rwo = dynamic_cast(z.get()); + + std::string op = rwo->getOperatorName(); + if (operators.count(op) > 0) { + operators[op] = 1 + operators[op]; + } else { + operators[op] = 1; + } + } + + } + if (operators.empty()) { std::cout << " ~ no SecRule found ~ " << std::endl; continue; } + std::cout << " Operators" << std::endl; for (auto &z : operators) { auto &s = z.second; @@ -123,22 +121,7 @@ int main(int argc, char **argv) { std::cout << std::endl; } - std::cout << " Variables" << std::endl; - for (auto &z : variables) { - auto &s = z.second; - std::cout << " " << std::left << std::setw(20) << z.first; - std::cout << std::right << std::setw(4) << s; - std::cout << std::endl; - } - std::cout << " Operators applied to variables" << std::endl; - for (auto &z : op2var) { - auto &s = z.second; - std::cout << " " << std::left << std::setw(40) << z.first; - std::cout << std::right << std::setw(4) << s; - std::cout << std::endl; - } - - total += rules.size(); + total += rules->size(); } std::cout << std::endl; diff --git a/src/deps/src/ModSecurity/test/regression/custom_debug_log.cc b/src/deps/src/ModSecurity/test/regression/custom_debug_log.cc index bffcfa7d0..1e7de0e02 100644 --- a/src/deps/src/ModSecurity/test/regression/custom_debug_log.cc +++ b/src/deps/src/ModSecurity/test/regression/custom_debug_log.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -36,13 +36,13 @@ void CustomDebugLog::write(int level, const std::string &id, m_log << msgf << std::endl; } -bool CustomDebugLog::contains(const std::string& pattern) { +bool const CustomDebugLog::contains(const std::string& pattern) const { modsecurity::Utils::Regex re(pattern); std::string s = m_log.str(); return modsecurity::Utils::regex_search(s, re); } -std::string CustomDebugLog::log_messages() { +std::string const CustomDebugLog::log_messages() const { return m_log.str(); } diff --git a/src/deps/src/ModSecurity/test/regression/custom_debug_log.h b/src/deps/src/ModSecurity/test/regression/custom_debug_log.h index 5ec1849c3..f1868acd6 100644 --- a/src/deps/src/ModSecurity/test/regression/custom_debug_log.h +++ b/src/deps/src/ModSecurity/test/regression/custom_debug_log.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,8 +31,8 @@ class CustomDebugLog : public modsecurity::debug_log::DebugLog { void write(int level, const std::string& message) override; void write(int level, const std::string &id, const std::string &uri, const std::string &msg) override; - bool contains(const std::string& pattern); - std::string log_messages(); + bool const contains(const std::string& pattern) const; + std::string const log_messages() const; std::string error_log_messages(); int getDebugLogLevel() override; diff --git a/src/deps/src/ModSecurity/test/regression/regression.cc b/src/deps/src/ModSecurity/test/regression/regression.cc index 46da615e4..b4c9dca39 100644 --- a/src/deps/src/ModSecurity/test/regression/regression.cc +++ b/src/deps/src/ModSecurity/test/regression/regression.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -23,9 +23,8 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/modsecurity.h" -#include "modsecurity/rules.h" - #include "test/common/modsecurity_test.h" #include "test/common/colors.h" #include "test/regression/regression_test.h" @@ -59,6 +58,30 @@ bool contains(const std::string &s, const std::string &pattern) { return ret; } +void clearAuditLog(const std::string &filename) { + if (!filename.empty()) { + std::ifstream file; + file.open(filename.c_str(), std::ifstream::out | std::ifstream::trunc); + if (!file.is_open() || file.fail()) { + std::cout << std::endl << "Failed to clear previous contents of audit log: " \ + << filename << std::endl; + } + file.close(); + } +} +std::string getAuditLogContent(const std::string &filename) { + std::stringstream buffer; + if (!filename.empty()) { + try { + std::ifstream t(filename); + buffer << t.rdbuf(); + } catch (...) { + std::cout << "Failed to read file:" << filename << std::endl; + } + } + return buffer.str(); +} + void actions(ModSecurityTestResults *r, modsecurity::Transaction *a, std::stringstream *serverLog) { @@ -99,7 +122,7 @@ void perform_unit_test(ModSecurityTest *test, for (RegressionTest *t : *tests) { CustomDebugLog *debug_log = new CustomDebugLog(); modsecurity::ModSecurity *modsec = NULL; - modsecurity::Rules *modsec_rules = NULL; + modsecurity::RulesSet *modsec_rules = NULL; modsecurity::Transaction *modsec_transaction = NULL; ModSecurityTestResults r; std::stringstream serverLog; @@ -148,7 +171,7 @@ void perform_unit_test(ModSecurityTest *test, modsec->setConnectorInformation("ModSecurity-regression v0.0.1-alpha" \ " (ModSecurity regression test utility)"); modsec->setServerLogCb(logCb); - modsec_rules = new modsecurity::Rules(debug_log); + modsec_rules = new modsecurity::RulesSet(debug_log); bool found = true; if (t->resource.empty() == false) { @@ -188,7 +211,7 @@ void perform_unit_test(ModSecurityTest *test, */ if (test->m_automake_output) { std::cout << ":test-result: FAIL " << filename \ - << ":" << t->name << std::endl; + << ":" << t->name << ":" << *count << std::endl; } else { std::cout << KRED << "failed!" << RESET << std::endl; } @@ -231,7 +254,7 @@ void perform_unit_test(ModSecurityTest *test, /* Parser error was expected, but with a different content */ if (test->m_automake_output) { std::cout << ":test-result: FAIL " << filename \ - << ":" << t->name << std::endl; + << ":" << t->name << ":" << *count << std::endl; } else { std::cout << KRED << "failed!" << RESET << std::endl; } @@ -257,7 +280,7 @@ void perform_unit_test(ModSecurityTest *test, if (t->parser_error.empty() == false) { if (test->m_automake_output) { std::cout << ":test-result: FAIL " << filename \ - << ":" << t->name << std::endl; + << ":" << t->name << ":" << *count << std::endl; } else { std::cout << KRED << "failed!" << RESET << std::endl; std::cout << KWHT << "Expected a parser error." \ @@ -279,6 +302,8 @@ void perform_unit_test(ModSecurityTest *test, modsec_transaction = new modsecurity::Transaction(modsec, modsec_rules, &serverLog); + clearAuditLog(modsec_transaction->m_rules->m_auditLog->m_path1); + modsec_transaction->processConnection(t->clientIp.c_str(), t->clientPort, t->serverIp.c_str(), t->serverPort); @@ -362,7 +387,7 @@ end: if (!d->contains(t->debug_log)) { if (test->m_automake_output) { std::cout << ":test-result: FAIL " << filename \ - << ":" << t->name << std::endl; + << ":" << t->name << ":" << *count << std::endl; } else { std::cout << KRED << "failed!" << RESET << std::endl; } @@ -374,7 +399,7 @@ end: } else if (r.status != t->http_code) { if (test->m_automake_output) { std::cout << ":test-result: FAIL " << filename \ - << ":" << t->name << std::endl; + << ":" << t->name << ":" << *count << std::endl; } else { std::cout << KRED << "failed!" << RESET << std::endl; } @@ -394,6 +419,19 @@ end: testRes->reason << KWHT << "Expecting: " << RESET \ << t->error_log + ""; testRes->passed = false; + } else if (!t->audit_log.empty() + && !contains(getAuditLogContent(modsec_transaction->m_rules->m_auditLog->m_path1), t->audit_log)) { + if (test->m_automake_output) { + std::cout << ":test-result: FAIL " << filename \ + << ":" << t->name << ":" << *count << std::endl; + } else { + std::cout << KRED << "failed!" << RESET << std::endl; + } + testRes->reason << "Audit log was not matching the " \ + << "expected results." << std::endl; + testRes->reason << KWHT << "Expecting: " << RESET \ + << t->audit_log + ""; + testRes->passed = false; } else { if (test->m_automake_output) { std::cout << ":test-result: PASS " << filename \ @@ -411,6 +449,8 @@ end: testRes->reason << d->log_messages() << std::endl; testRes->reason << KWHT << "Error log:" << RESET << std::endl; testRes->reason << serverLog.str() << std::endl; + testRes->reason << KWHT << "Audit log:" << RESET << std::endl; + testRes->reason << getAuditLogContent(modsec_transaction->m_rules->m_auditLog->m_path1) << std::endl; } } diff --git a/src/deps/src/ModSecurity/test/regression/regression_test.cc b/src/deps/src/ModSecurity/test/regression/regression_test.cc index 812586788..1580a0257 100644 --- a/src/deps/src/ModSecurity/test/regression/regression_test.cc +++ b/src/deps/src/ModSecurity/test/regression/regression_test.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -180,7 +180,7 @@ RegressionTest *RegressionTest::from_yajl_node(const yajl_val &node) { yajl_val val2 = val->u.object.values[j]; if (strcmp(key2, "audit_log") == 0) { - u->audit_log = yajl_array_to_str(val2); + u->audit_log = YAJL_GET_STRING(val2); } if (strcmp(key2, "debug_log") == 0) { u->debug_log = YAJL_GET_STRING(val2); @@ -200,13 +200,13 @@ RegressionTest *RegressionTest::from_yajl_node(const yajl_val &node) { } } if (strcmp(key, "rules") == 0) { - std::stringstream i; + std::stringstream si; for (int j = 0; j < val->u.array.len; j++) { yajl_val val2 = val->u.array.values[ j ]; - const char *key = YAJL_GET_STRING(val2); - i << key << "\n"; + const char *keyj = YAJL_GET_STRING(val2); + si << keyj << "\n"; } - u->rules = i.str(); + u->rules = si.str(); } } diff --git a/src/deps/src/ModSecurity/test/regression/regression_test.h b/src/deps/src/ModSecurity/test/regression/regression_test.h index 557271f91..5ed93b86f 100644 --- a/src/deps/src/ModSecurity/test/regression/regression_test.h +++ b/src/deps/src/ModSecurity/test/regression/regression_test.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,7 +33,7 @@ class RegressionTest { public: static RegressionTest *from_yajl_node(const yajl_val &); - std::string print(); + static std::string print(); std::string filename; std::string name; std::string title; diff --git a/src/deps/src/ModSecurity/test/test-cases/data/inspectFile-abcdef.lua b/src/deps/src/ModSecurity/test/test-cases/data/inspectFile-abcdef.lua new file mode 100644 index 000000000..13164633a --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/data/inspectFile-abcdef.lua @@ -0,0 +1,10 @@ +#!/usr/bin/lua + +function main(filename) + local file = io.open(filename, 'r') + local chunk = file:read(1024) + local ret = string.match(chunk, 'abcdef') + io.close(file) + + return ret +end diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/action-allow.json b/src/deps/src/ModSecurity/test/test-cases/regression/action-allow.json index d4e3cdf11..357d451bc 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/action-allow.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/action-allow.json @@ -4,7 +4,7 @@ "version_min":300000, "title":"Testing allow action (1/3)", "expected":{ - "debug_log": "Skipped rule id '500066' as request trough the utilization of an `allow' action", + "debug_log": "Skipped rule id 'action-allow.json:3' as request trough the utilization of an `allow' action", "http_code": 200 }, "client":{ diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/action-ctl_audit_engine.json b/src/deps/src/ModSecurity/test/test-cases/regression/action-ctl_audit_engine.json new file mode 100644 index 000000000..3848ee7e5 --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/action-ctl_audit_engine.json @@ -0,0 +1,51 @@ +[ + { + "enabled": 1, + "version_min": 300000, + "version_max": 0, + "title": "auditengine : Config=Off, ctl:auditEngine=on", + "client": { + "ip": "200.249.12.31", + "port": 2313 + }, + "server": { + "ip": "200.249.12.31", + "port": 80 + }, + "request": { + "headers": { + "Host": "www.modsecurity.org", + "User-Agent": "Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", + "Accept": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip,deflate", + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Keep-Alive": "300", + "Connection": "keep-alive", + "Pragma": "no-cache", + "Cache-Control": "no-cache" + }, + "uri": "\/test.pl?parm1=test1&parm2=test2", + "method": "GET", + "http_version": 1.1, + "body": "" + }, + "expected": { + "audit_log": "--A--", + "error_log": "", + "http_code": 200 + }, + "rules": [ + "SecRuleEngine On", + "SecDefaultAction \"phase:2,nolog,pass\"", + "SecAuditEngine Off", + "SecAuditLogParts ABCFHZ", + "SecAuditLog /tmp/modsec_test_ctl_auditengine_auditlog_1.log", + "SecAuditLogDirMode 0766", + "SecAuditLogFileMode 0666", + "SecAuditLogType Serial", + "SecAuditLogRelevantStatus \"^(?:5|4(?!04))\"", + "SecRule ARGS \"@contains test2\" \"id:1701,phase:2,pass,nolog,ctl:auditEngine=on\"" + ] + } +] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/action-setenv.json b/src/deps/src/ModSecurity/test/test-cases/regression/action-setenv.json index 595b5a60e..2bbe967a4 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/action-setenv.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/action-setenv.json @@ -2,9 +2,9 @@ { "enabled":1, "version_min":300000, - "title":"Testing setsid action (1/2)", + "title":"Testing setsid action (1/3)", "expected":{ - "debug_log": "Setting envoriment variable: variable=PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120" + "debug_log": "Setting environment variable: variable to PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120" }, "client":{ "ip":"200.249.12.31", @@ -33,9 +33,9 @@ { "enabled":1, "version_min":300000, - "title":"Testing setenv action (2/2)", + "title":"Testing setenv action (2/3)", "expected":{ - "debug_log": "Setting envoriment variable: variable=PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120" + "debug_log": "Setting environment variable: variable to PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120" }, "client":{ "ip":"200.249.12.31", @@ -60,5 +60,36 @@ "SecRuleEngine On", "SecRule REQUEST_HEADERS:Cookie \"^(.*)$\" \"id:'900018',phase:2,setenv:variable=%{matched_var},pass\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing setenv action (3/3)", + "expected":{ + "debug_log": "Setting environment variable: variable to PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120==test=test" + }, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "User-Agent":"My sweet little browser", + "Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120" + }, + "uri":"/?key=value&key=other_value", + "method":"GET" + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_HEADERS:Cookie \"^(.*)$\" \"id:'900018',phase:2,setenv:variable=%{matched_var}==test=test,pass\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/auditlog.json b/src/deps/src/ModSecurity/test/test-cases/regression/auditlog.json index 33b611011..715a4767d 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/auditlog.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/auditlog.json @@ -220,5 +220,103 @@ "SecAuditLogType Serial", "SecAuditLogRelevantStatus \"^(?:5|4(?!04))\"" ] + }, + { + "enabled": 1, + "version_min": 300000, + "version_max": 0, + "title": "auditlog : multiMatch data, match after last transform", + "client": { + "ip": "200.249.12.31", + "port": 2313 + }, + "server": { + "ip": "200.249.12.31", + "port": 80 + }, + "request": { + "headers": { + "Host": "www.modsecurity.org", + "User-Agent": "Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", + "Accept": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip,deflate", + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Keep-Alive": "300", + "Connection": "keep-alive", + "Pragma": "no-cache", + "Cache-Control": "no-cache" + }, + "uri": "\/test.pl?param1=test¶m2=tEst2", + "method": "GET", + "http_version": 1.1, + "body": "" + }, + "expected": { + "audit_log": "\\[msg \"testmsg\"\\]", + "error_log": "", + "http_code": 403 + }, + "rules": [ + "SecRuleEngine On", + "SecDefaultAction \"phase:1,nolog,auditlog,deny,status:403\"", + "SecRule ARGS \"@contains test2\" \"id:1557,phase:1,multiMatch,block,log,t:none,t:urlDecode,t:lowercase,msg:'testmsg'\"", + "SecAuditEngine RelevantOnly", + "SecAuditLogParts ABCFHZ", + "SecAuditLog /tmp/test/modsec_audit_multimatch_1.log", + "SecAuditLogDirMode 0766", + "SecAuditLogFileMode 0666", + "SecAuditLogType Serial", + "SecAuditLogRelevantStatus \"^(?:5|4(?!04))\"" + ] + }, + { + "enabled": 1, + "version_min": 300000, + "version_max": 0, + "title": "auditlog : multiMatch data, match only after intermediate transform", + "client": { + "ip": "200.249.12.31", + "port": 2313 + }, + "server": { + "ip": "200.249.12.31", + "port": 80 + }, + "request": { + "headers": { + "Host": "www.modsecurity.org", + "User-Agent": "Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko\/20091102 Firefox\/3.5.5 (.NET CLR 3.5.30729)", + "Accept": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip,deflate", + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Keep-Alive": "300", + "Connection": "keep-alive", + "Pragma": "no-cache", + "Cache-Control": "no-cache" + }, + "uri": "\/test.pl?param1=test¶m2=%20tEst2", + "method": "GET", + "http_version": 1.1, + "body": "" + }, + "expected": { + "audit_log": "\\[msg \"tstmsg\"\\]", + "error_log": "", + "http_code": 403 + }, + "rules": [ + "SecRuleEngine On", + "SecDefaultAction \"phase:1,nolog,auditlog,deny,status:403\"", + "SecRule ARGS \"@streq tEst2\" \"id:1558,phase:1,multiMatch,block,log,t:none,t:trim,t:lowercase,msg:'tstmsg'\"", + "SecAuditEngine RelevantOnly", + "SecAuditLogParts ABCFHZ", + "SecAuditLog /tmp/test/modsec_audit_multimatch_2.log", + "SecAuditLogDirMode 0766", + "SecAuditLogFileMode 0666", + "SecAuditLogType Serial", + "SecAuditLogRelevantStatus \"^(?:5|4(?!04))\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/config-body_limits.json b/src/deps/src/ModSecurity/test/test-cases/regression/config-body_limits.json index a88035ba0..ebc047db5 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/config-body_limits.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/config-body_limits.json @@ -386,6 +386,398 @@ "SecResponseBodyLimitAction Reject", "SecResponseBodyLimit 5" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyNoFilesLimit - urlencoded, limit exceeded", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "41", + "Content-Type": "application/x-www-form-urlencoded" + }, + "uri":"/", + "method":"POST", + "body": [ + "param1=value1¶m2=value2¶m3=value3" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Request body excluding files is bigger than the maximum expected.", + "http_code":400 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyNoFilesLimit 20", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyNoFilesLimit - urlencoded, limit not exceeded", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "41", + "Content-Type": "application/x-www-form-urlencoded" + }, + "uri":"/", + "method":"POST", + "body": [ + "param1=value1¶m2=value2¶m3=value3" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyNoFilesLimit 60", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyNoFilesLimit - json, limit exceeded", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "41", + "Content-Type": "application/json" + }, + "uri":"/", + "method":"POST", + "body": [ + "{\"param1\":{\"param2\":\"value2\",\"param3\":\"value3\"}}" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Request body excluding files is bigger than the maximum expected.", + "http_code":400 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyNoFilesLimit 20", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyNoFilesLimit - json, limit not exceeded", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "41", + "Content-Type": "application/json" + }, + "uri":"/", + "method":"POST", + "body": [ + "{\"param1\":{\"param2\":\"value2\",\"param3\":\"value3\"}}" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyNoFilesLimit 80", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyNoFilesLimit - xml, limit exceeded", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "77", + "Content-Type": "application/xml" + }, + "uri":"/", + "method":"POST", + "body": [ + "ccceee" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Request body excluding files is bigger than the maximum expected.", + "http_code":400 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyNoFilesLimit 20", + "SecRule REQUEST_HEADERS:Content-Type \"(?:application(?:/soap\\+|/)|text/)xml\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyNoFilesLimit - xml, limit not exceeded", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "77", + "Content-Type": "application/xml" + }, + "uri":"/", + "method":"POST", + "body": [ + "ccceee" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyNoFilesLimit 90", + "SecRule REQUEST_HEADERS:Content-Type \"(?:application(?:/soap\\+|/)|text/)xml\" \"id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyNoFilesLimit - multipart, limit exceeded", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "77", + "Content-Type": "multipart/form-data; boundary=0000" + }, + "uri":"/", + "method":"POST", + "body": [ + "--0000", + "Content-Disposition: form-data; name=\"a\"", + "", + "1", + "--0000", + "Content-Disposition: form-data; name=\"b\"; filename=\"c.txt\"", + "", + "2222222222222222222222222222222222222222222222222222222222222222222222", + "--0000--" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Request body excluding files is bigger than the maximum expected.", + "http_code":400 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyNoFilesLimit 80", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRequestBodyNoFilesLimit - multipart, limit not exceeded", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "77", + "Content-Type": "multipart/form-data; boundary=0000" + }, + "uri":"/", + "method":"POST", + "body": [ + "--0000", + "Content-Disposition: form-data; name=\"a\"", + "", + "1", + "--0000", + "Content-Disposition: form-data; name=\"b\"; filename=\"c.txt\"", + "", + "2222222222222222222222222222222222222222222222222222222222222222222222", + "--0000--" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRequestBodyNoFilesLimit 120", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/config-update-target-by-id.json b/src/deps/src/ModSecurity/test/test-cases/regression/config-update-target-by-id.json index 3d7c3c73e..8faecaefe 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/config-update-target-by-id.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/config-update-target-by-id.json @@ -2,7 +2,7 @@ { "enabled":1, "version_min":300000, - "title":"SecRuleUpdateTargetById", + "title":"SecRuleUpdateTargetById - exclude whole collection", "client":{ "ip":"200.249.12.31", "port":123 @@ -34,6 +34,7 @@ "http_code": 200 }, "rules":[ + "SecRuleEngine On", "SecRuleUpdateTargetById 1 !ARGS", "SecRule ARGS \"@contains value\" \"id:1,pass,t:trim,tag:'test',deny\"" ] @@ -41,7 +42,7 @@ { "enabled":1, "version_min":300000, - "title":"SecRuleUpdateTargetById", + "title":"SecRuleUpdateTargetById - exclude using regex", "client":{ "ip":"200.249.12.31", "port":123 @@ -56,7 +57,7 @@ "User-Agent":"curl/7.38.0", "Accept":"*/*" }, - "uri":"/?mixpanel$=value&mixpanel$=other_value", + "uri":"/?mixpanel=value&mixpanel=other_value", "method":"GET" }, "response":{ @@ -73,8 +74,129 @@ "http_code": 200 }, "rules":[ + "SecRuleEngine On", "SecRuleUpdateTargetById 1 !ARGS:/mixpanel$/", "SecRule ARGS \"@contains value\" \"id:1,pass,t:trim,tag:'test',deny\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRuleUpdateTargetById - exclude using full name", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?mixpanel=value", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 200 + }, + "rules":[ + "SecRuleEngine On", + "SecRuleUpdateTargetById 1 !ARGS:mixpanel", + "SecRule ARGS \"@contains value\" \"id:1,t:trim,tag:'test',deny\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRuleUpdateTargetById - exclude from ARGS_NAMES using regex (match)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?xxxyyy=value", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 200 + }, + "rules":[ + "SecRuleEngine On", + "SecRuleUpdateTargetById 1 \"!ARGS:/xxx/\"", + "SecRule ARGS_NAMES \"@contains yyy\" \"id:1,phase:2,deny,status:403\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRuleUpdateTargetById - exclude from ARGS_NAMES using regex (no match)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?xxyyy=value", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRuleUpdateTargetById 1 \"!ARGS:/xxx/\"", + "SecRule ARGS_NAMES \"@contains yyy\" \"id:1,phase:2,deny,status:403\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/config-update-target-by-tag.json b/src/deps/src/ModSecurity/test/test-cases/regression/config-update-target-by-tag.json index 4061d52ae..10d4c1b48 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/config-update-target-by-tag.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/config-update-target-by-tag.json @@ -238,5 +238,45 @@ "SecRuleUpdateTargetByTag test !ARGS:'/^ref/'", "SecRule ARGS \"@contains something\" \"id:1,pass,t:trim,tag:'test',deny\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"SecRuleUpdateTargetByTag Test (7/6) Exclusion by full name", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?key=value&ref=something", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 200 + }, + "rules":[ + "SecRuleEngine On", + "SecRuleUpdateTargetByTag test !ARGS:ref", + "SecRule ARGS \"@contains something\" \"id:1,pass,t:trim,tag:'test',deny\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/issue-1825.json b/src/deps/src/ModSecurity/test/test-cases/regression/issue-1825.json new file mode 100644 index 000000000..41fc349ff --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/issue-1825.json @@ -0,0 +1,339 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"multipart Content-Disposition should allow filename* field (1/7)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=utf-8''03CB1664.txt", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "response":{ + "headers":"", + "body":"" + }, + "expected":{ + "debug_log":"Target value: \"03CB1664.txt\" \\(Variable: MULTIPART_FILENAME" + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"multipart Content-Disposition should allow filename* field (2/7)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename*= ISO-8859-1''ab0-_xy.txt; filename=\"ab0-_xy.txt\"", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "response":{ + "headers":"", + "body":"" + }, + "expected":{ + "debug_log":"Target value: \"ab0-_xy.txt\" \\(Variable: MULTIPART_FILENAME" + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"multipart Content-Disposition should allow filename* field (3/7)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename*=utf-8''03CB1664.txt", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2--\r" + ] + }, + "response":{ + "headers":"", + "body":"" + }, + "expected":{ + "debug_log":"Warning: no filename= but filename*" + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"multipart Content-Disposition should allow filename* field (4/7)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=''03CB1664.txt", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "response":{ + "headers":"", + "body":"" + }, + "expected":{ + "debug_log":"Multipart: Invalid Content-Disposition header \\(-16" + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"multipart Content-Disposition should allow filename* field (5/7)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=UTF-8'03CB1664.txt", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "response":{ + "headers":"", + "body":"" + }, + "expected":{ + "debug_log":"Multipart: Invalid Content-Disposition header \\(-17" + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"multipart Content-Disposition should allow filename* field (6/7)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=utf-8''%61%4G.txt", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "response":{ + "headers":"", + "body":"" + }, + "expected":{ + "debug_log":"Multipart: Invalid Content-Disposition header \\(-18" + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_FILENAME \"@contains 0\" \"id:1,phase:2,pass,t:trim\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"multipart Content-Disposition should allow filename* field (7/7)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"03CB1664.txt\"; filename*=utf-8''%61%62.txt", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "response":{ + "headers":"", + "body":"" + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:1,phase:2,deny,status:403\"" + ] + } +] + diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/issue-1831.json b/src/deps/src/ModSecurity/test/test-cases/regression/issue-1831.json index 6ebd495c7..773a0eec9 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/issue-1831.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/issue-1831.json @@ -191,7 +191,7 @@ "rules": [ "SecRuleEngine On", "SecRule ARGS \"@rx .\" \"id:954100,phase:1,block,capture,t:none,t:lowercase,msg:'Disclosure of IIS install location',logdata:'Matched Data',tag:'application-multi',tag:'language-multi',tag:'platform-iis',tag:'platform-windows',tag:'attack-disclosure',ctl:auditLogParts=+E,rev:3,ver:'OWASP_CRS/3.0.0',severity:'ERROR',chain\"", - "SecRule &GLOBAL:alerted_970018_iisDefLoc \"@eq 0\" \"setvar:'global.alerted_970018_iisDefLoc',setvar:'tx.msg=%{rule.msg}',setvar:'tx.outbound_anomaly_score=+%{tx.error_anomaly_score}',setvar:'tx.anomaly_score=+%{tx.error_anomaly_score}'\"" + "SecRule ARGS \"@eq 0\" \"setvar:'global.alerted_970018_iisDefLoc',setvar:'tx.msg=%{rule.msg}',setvar:'tx.outbound_anomaly_score=+%{tx.error_anomaly_score}',setvar:'tx.anomaly_score=+%{tx.error_anomaly_score}'\"" ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/issue-2000.json b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2000.json new file mode 100644 index 000000000..05610b457 --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2000.json @@ -0,0 +1,45 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Testing audit log part H should output when deny - issue-2000", + "expected":{ + "http_code":200 + }, + "client":{ + "ip":"127.0.0.1", + "port":123 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"index.php?foo=bar&a=xxx", + "method":"GET", + "body": "" + }, + "expected": { + "http_code": 403, + "audit_log": "id \"1234" + }, + + "server":{ + "ip":"127.0.0.1", + "port":80 + }, + "rules":[ + "SecRuleEngine On", + "SecAuditLogParts ABIJDEFHZ", + "SecAuditEngine RelevantOnly", + "SecAuditLogParts ABCFHZ", + "SecAuditLog /tmp/test/modsec_audit.log", + "SecAuditLogDirMode 0766", + "SecAuditLogFileMode 0666", + "SecAuditLogType Serial", + "SecAuditLogRelevantStatus \"^(?:5|4(?!04))\"", + "SecRule ARGS:foo \"@rx ^bar$\" \"id:1234,phase:1,deny,status:403\"" + ] + } +] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/issue-2196.json b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2196.json new file mode 100644 index 000000000..44347bd08 --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2196.json @@ -0,0 +1,45 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Testing audit log not written when nolog - issue-2196", + "expected":{ + "http_code":200 + }, + "client":{ + "ip":"127.0.0.1", + "port":123 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"index.php?foo=bar&a=xxx", + "method":"GET", + "body": "" + }, + "expected": { + "http_code": 200, + "audit_log": "\\A[\\s\\S]{0}\\z" + }, + + "server":{ + "ip":"127.0.0.1", + "port":80 + }, + "rules":[ + "SecRuleEngine On", + "SecAuditLogParts ABIJDEFHZ", + "SecAuditEngine RelevantOnly", + "SecAuditLogParts ABCFHZ", + "SecAuditLog /tmp/test/modsec_audit.log", + "SecAuditLogDirMode 0766", + "SecAuditLogFileMode 0666", + "SecAuditLogType Serial", + "SecAuditLogRelevantStatus \"^(?:5|4(?!04))\"", + "SecRule ARGS:foo \"@rx ^bar$\" \"id:1234,phase:1,nolog,pass\"" + ] + } +] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/issue-2296.json b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2296.json new file mode 100644 index 000000000..bc64d19bd --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2296.json @@ -0,0 +1,433 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression (1/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/?THIS=is+a+simple+test", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200, + "debug_log":"Target value: \"is a simple test\"", + "error_log":"Operator `Rx' with parameter `test' against variable `ARGS:THIS'" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS:/^ThIs$/ \"test\" \"id:1\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression (2/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/?THIS=is+a+simple+test", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200, + "debug_log":"Rule returned 0", + "error_log":"" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS:/^ThIz$/ \"test\" \"id:1,deny,status:302\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression - msg (3/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/?THIS=is+a+simple+test", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200, + "debug_log":"Target value: \"is a simple test\"", + "error_log":"msg \"Testing is a simple test\"" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS:/^ThIs$/ \"test\" \"id:1,msg:'Testing %{ARGS:/^ThIs$/}'\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression - matched_vars (4/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/?THIS=is+a+simple+test", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200, + "debug_log":"Target value: \"is a simple test\"", + "error_log":"msg \"Testing is a simple test\"" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS:/^ThIs$/ \"test\" \"id:1,msg:'Testing %{ARGS:/^ThIs$/}',chain\"", + "SecRule MATCHED_VARS:/thIs/ \"is a simple test\" \"log\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression - rule (5/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/?THIS=is+a+simple+test", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":403, + "debug_log":"Target value: .1. .Variable: RULE:id.", + "error_log":"Operator `Rx' with parameter `1' against variable `RULE:id' .Value: `1' ." + }, + "rules":[ + "SecRuleEngine On", + "SecRule RULE:/^Id$/ \"1\" \"id:1,msg:'Testing %{RULE.id}% -- ',deny\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression - TX (6/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":437, + "error_log":"`Within' with parameter `/name1/' against variable `TX:header_name_name1'" + }, + "rules":[ + "SecRuleEngine On", + "SecAction \"id:1,phase:1,setvar:'TX.restricted_headers=/name1/'\"", + "SecRule REQUEST_HEADERS_NAMES \"^.*$\" \"id:2,phase:2,setvar:'tx.header_name_%{tx.0}=/%{tx.0}/',deny,status:437,chain,capture\"", + "SecRule TX:/^header_name_/ \"@within %{TX:/esTrictEd_headers/}\" \"setvar:'tx.matched=1'\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression - TX (7/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":437, + "error_log":"`Within' with parameter `/name1/' against variable `TX:header_name_name1'" + }, + "rules":[ + "SecRuleEngine On", + "SecAction \"id:1,phase:1,setvar:'TX.restricted_headers=/name1/'\"", + "SecRule REQUEST_HEADERS_NAMES \"^.*$\" \"id:2,phase:2,setvar:'tx.header_name_%{tx.0}=/%{tx.0}/',deny,status:437,capture,chain\"", + "SecRule TX:/^HEADER_NAME_/ \"@within %{tx.restricted_headers}\" \"setvar:'tx.matched=1',log\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression - exclusion (8/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/?THIS=is+a+simple+test", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS \"test\" \"id:1,msg:'Testing %{ARGS:/^ThIs$/}',deny,status:500,chain\"", + "SecRule MATCHED_VARS:/thIs/ \"is a simple test\" \"log\"", + "SecRuleUpdateTargetById 1 !ARGS:/ThIs/" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression - exclusion/ARGS (9/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/?THIS=is+a+simple+test", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS|!ARGS:/tHiS/ \"test\" \"id:1,msg:'Testing %{ARGS:/^ThIs$/}',deny,status:500,chain\"", + "SecRule MATCHED_VARS:/thIs/ \"is a simple test\" \"log\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable key selection using a regular expression - exclusion/TX (10/n)", + "url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/2296", + "gihub_issue": 2296, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "name1": "value1" + }, + "uri":"/?THIS=is+a+simple+test", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecAction \"phase:1,setvar:'tx.a=10'\"", + "SecRule TX|!TX:/a/ \"10\" \"id:10,deny,status:500\"" + ] + } +] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/issue-2423-msg-in-chain.json b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2423-msg-in-chain.json new file mode 100644 index 000000000..c667de054 --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2423-msg-in-chain.json @@ -0,0 +1,127 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Test match variable (1/n)", + "github_issue": 2423, + "expected":{ + "http_code": 437, + "error_log": "against variable `REQUEST_HEADERS:Transfer-Encoding' .Value: `deflate'" + }, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "request":{ + "headers":{ + "Host":"localhost", + "Transfer-Encoding": "deflate" + }, + "uri":"/match-this", + "method":"GET" + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_URI \"^.*$\" \"phase:2,deny,capture,id:1,msg:'MatchedVar On Msg: [%{MATCHED_VAR}]',logdata:'MatchedVar On LogData %{MATCHED_VAR}',chain\"", + "SecRule REQUEST_HEADERS \"^.*$\" \"status:437\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Test match variable (2/n)", + "github_issue": 2423, + "expected":{ + "http_code": 437, + "error_log": "MatchedVar On Msg: .deflate." + }, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "request":{ + "headers":{ + "Host":"localhost", + "Transfer-Encoding": "deflate" + }, + "uri":"/match-this", + "method":"GET" + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_URI \"^.*$\" \"phase:2,deny,capture,id:1,msg:'MatchedVar On Msg: [%{MATCHED_VAR}]',logdata:'MatchedVar On LogData %{MATCHED_VAR}',chain\"", + "SecRule REQUEST_HEADERS \"^.*$\" \"status:437\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Test match variable (3/n)", + "github_issue": 2423, + "expected":{ + "http_code": 437, + "error_log": "MatchedVar On LogData: deflate" + }, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "request":{ + "headers":{ + "Host":"localhost", + "Transfer-Encoding": "deflate" + }, + "uri":"/match-this", + "method":"GET" + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_URI \"^.*$\" \"phase:2,deny,capture,id:1,msg:'MatchedVar On Msg: [%{MATCHED_VAR}]',logdata:'MatchedVar On LogData: %{MATCHED_VAR}',chain\"", + "SecRule REQUEST_HEADERS \"^.*$\" \"status:437\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Test match variable (4/n)", + "github_issue": 2423, + "expected":{ + "http_code": 437, + "error_log": "msg \"Illegal header \\[/restricted/\\]\"" + }, + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "request":{ + "headers":{ + "Host":"localhost", + "Restricted":"attack", + "Other": "Value" + }, + "uri":"/", + "method":"GET" + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_HEADERS_NAMES \"^.*$\" \"phase:2,setvar:'tx.header_name_%{TX.0}=/%{TX.0}/',deny,t:lowercase,capture,id:500065,msg:'Illegal header [%{MATCHED_VAR}]',logdata:'Restricted header detected: %{MATCHED_VAR}',chain\"", + "SecRule TX:/^header_name_/ \"@within /name1/restricted/name3/\" \"status:437\"" + ] + } +] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/issue-2427.json b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2427.json new file mode 100644 index 000000000..02f7b16f8 --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/issue-2427.json @@ -0,0 +1,121 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Tmp file retained for @inspectFile (1/2)", + "resource":"lua", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/wheee/f%20i%20l%20e%20", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name2\"", + "", + "test2", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"small2.txt\" ", + "Content-Type: text/plain", + "", + "This is another very small test file that contains the search content abcdef..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "expected":{ + "debug_log":"Returning from lua script: abcdef.*Rule returned 1", + "http_code":403 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecTmpSaveUploadedFiles On", + "SecUploadKeepFiles Off", + "SecUploadDir /tmp", + "SecTmpDir /tmp", + "SecRule FILES_TMPNAMES \"@inspectFile test-cases/data/inspectFile-abcdef.lua\" \"id:1,phase:2,deny,status:403\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Tmp file retained for @inspectFile (2/2)", + "resource":"lua", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/wheee/f%20i%20l%20e%20", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name2\"", + "", + "test2", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file1.txt\"", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; filename=\"small_text_file2.txt\"; name=\"small2.txt\" ", + "Content-Type: text/plain", + "", + "This is another very small test file that does not contain the search content.", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "expected":{ + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecTmpSaveUploadedFiles On", + "SecUploadKeepFiles Off", + "SecUploadDir /tmp", + "SecTmpDir /tmp", + "SecRule FILES_TMPNAMES \"@inspectFile test-cases/data/inspectFile-abcdef.lua\" \"id:1,phase:2,deny,status:403\"" + ] + } +] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/offset-variable.json b/src/deps/src/ModSecurity/test/test-cases/regression/offset-variable.json index 99c9e19a7..9aa5120c2 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/offset-variable.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/offset-variable.json @@ -882,11 +882,11 @@ ] }, "expected":{ - "error_log":"o0,1v228,1t:lowercase" + "error_log":"o0,1v228,1t:lowercase,t:trim" }, "rules":[ "SecRequestBodyAccess On", - "SecRule REQUEST_COOKIES \"b\" \"id:1,phase:2,pass,t:lowercase,msg:'ops'\"" + "SecRule REQUEST_COOKIES \"b\" \"id:1,phase:2,pass,t:lowercase,t:trim,msg:'ops'\"" ] }, { @@ -1784,7 +1784,7 @@ "SecRequestBodyAccess On", "SecUploadKeepFiles On", "SecUploadDir /tmp", - "SecRule FILES_TMP_CONTENT:small_text_file1.txt \"small\" \"id:1,phase:3,pass,t:trim,msg:'s'\"" + "SecRule FILES_TMP_CONTENT:filedata \"small\" \"id:1,phase:3,pass,t:trim,msg:'s'\"" ] }, { @@ -1951,5 +1951,67 @@ "SecUploadDir /tmp", "SecRule MULTIPART_NAME \"fiasdfasdfledata\" \"id:1,phase:3,pass,t:trim,msg:'s'\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable offset - ARGS n", + "request":{ + "headers":{ + "Host":"localhost", + "Content-Length": "27", + "Content-Type": "application/x-www-form-urlencoded" + }, + "uri":"/index.html?param01=5555&bbbbbbbmy_id=6", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403, + "error_log":"o0,1v42,1" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS \"@contains 6\" \"id:1,phase:2,deny,status:403,log\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Variable offset - ARGS_NAMES n", + "request":{ + "headers":{ + "Host":"localhost", + "Content-Length": "27", + "Content-Type": "application/x-www-form-urlencoded" + }, + "uri":"/index.html?param01=5555&bbbbbbbmy_id=6", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403, + "error_log":"o7,5v29,12" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS_NAMES \"@contains my_id\" \"id:1,phase:2,deny,status:403,log\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/operator-rx.json b/src/deps/src/ModSecurity/test/test-cases/regression/operator-rx.json index d6b9839fe..f0a4957a0 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/operator-rx.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/operator-rx.json @@ -85,5 +85,47 @@ "SecRuleEngine On", "SecRule REQUEST_HEADERS:Content-Length \"!^0$\" \"id:1,phase:2,pass,t:trim,block\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Operator :: @rx with non-compiling pattern", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "27", + "Content-Type": "application/x-www-form-urlencoded" + }, + "uri":"/", + "method":"HEAD", + "body": [ ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Error with regular expression" + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_HEADERS:Content-Type \"@rx a(b\" \"id:1,phase:2,pass,t:trim,block\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/operator-rxGlobal.json b/src/deps/src/ModSecurity/test/test-cases/regression/operator-rxGlobal.json new file mode 100644 index 000000000..d49f31d6a --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/operator-rxGlobal.json @@ -0,0 +1,46 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Testing Operator :: @rxGlobal", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length": "27", + "Content-Type": "application/x-www-form-urlencoded" + }, + "uri":"/", + "method":"POST", + "body": [ + "param1=value1¶m2=value2" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Executing operator \"RxGlobal" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS \"@rxGlobal (value1)\" \"id:1,phase:2,pass,t:trim\"" + ] + } +] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/request-body-parser-json.json b/src/deps/src/ModSecurity/test/test-cases/regression/request-body-parser-json.json index c13a43296..b7a7ab6f3 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/request-body-parser-json.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/request-body-parser-json.json @@ -150,6 +150,95 @@ "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", "SecRule REQBODY_ERROR \"0\" \"id:'200441',phase:3,log\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing JSON request body parser - depth not over limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Content-Type":"application/json" + }, + "uri":"/?foo=bar", + "method":"POST", + "body": [ + "{", + " \"key1\":", + "{", + " \"key2\":", + "{", + " \"key3\":", + "{", + " \"key4\":", + "{", + " \"key5\":\"thevalue\"", + "}}}}}" + ] + }, + "expected":{ + "debug_log": "json.key1.key2.key3.key4.key5", + "http_code":200 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyJsonDepthLimit 5", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:403,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}'\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing JSON request body parser - depth over limit", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Content-Type":"application/json" + }, + "uri":"/?foo=bar", + "method":"POST", + "body": [ + "{", + " \"key1\":", + "{", + " \"key2\":", + "{", + " \"key3\":", + "{", + " \"key4\":", + "{", + " \"key5\":\"thevalue\"", + "}}}}}" + ] + }, + "expected":{ + "debug_log": "Failed to parse request body", + "http_code":403 + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyJsonDepthLimit 4", + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:403,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}'\"" + ] } ] - diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/request-body-parser-multipart.json b/src/deps/src/ModSecurity/test/test-cases/regression/request-body-parser-multipart.json index c9fc14dd3..c92205737 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/request-body-parser-multipart.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/request-body-parser-multipart.json @@ -3239,5 +3239,60 @@ "SecRuleEngine On", "SecRule MULTIPART_UNMATCHED_BOUNDARY \"@eq 1\" \"phase:2,deny,id:500095\"" ] - } + }, + { + "enabled":1, + "version_min":300000, + "title":"multipart parser (C-T parm after boundary -- invalid but tolerated)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"145", + "Content-Type":"multipart/form-data; boundary=00000000; charset=UTF-8", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "--00000000\r", + "Content-Disposition: form-data; name=\"namea\"\r", + "\r", + "111\r", + "--00000000\r", + "Content-Disposition: form-data; name=\"nameb\"\r", + "\r", + "222\r", + "--00000000--\r" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403, + "debug_log":"Multipart: Invalid parameter after boundary in C-T \\(tolerated\\).*Added data" + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRule ARGS:namea \"@streq 111\" \"phase:2,deny,id:500096\"" + ] + } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/secargumentslimit.json b/src/deps/src/ModSecurity/test/test-cases/regression/secargumentslimit.json new file mode 100644 index 000000000..8f556b359 --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/secargumentslimit.json @@ -0,0 +1,86 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Testing SecArgumentLimit not over limit (1/1)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Content-Type":"application/json" + }, + "uri":"/?foo=bar", + "method":"POST", + "body": [ + "{", + " \"k1\":\"v1\",", + " \"k2\":\"v2\",", + " \"k3\":\"v3\",", + " \"k4\":\"v4\",", + " \"k5\":\"v5\"", + "}" + ] + }, + "expected":{ + "debug_log": " Running action deny", + "http_code":403 + }, + "rules":[ + "SecRuleEngine On", + "SecArgumentsLimit 6", + "SecRule REQUEST_HEADERS:Content-Type \"^application/json\" \"id:'200001',phase:1,t:none,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}'\"", + "SecRule ARGS:/k5/ \"@rx v5\" \"id:'1234',phase:2,deny,status:403,t:none,log,auditlog\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing SecArgumentLimit over limit (2/2)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Content-Type":"application/json" + }, + "uri":"/?foo=bar", + "method":"POST", + "body": [ + "{", + " \"k1\":\"v1\",", + " \"k2\":\"v2\",", + " \"k3\":\"v3\",", + " \"k4\":\"v4\",", + " \"k5\":\"v5\"", + "}" + ] + }, + "expected":{ + "debug_log": "Skipping request argument, over limit", + "http_code":400 + }, + "rules":[ + "SecRuleEngine On", + "SecArgumentsLimit 5", + "SecRule REQUEST_HEADERS:Content-Type \"^application/json\" \"id:'200001',phase:1,t:none,pass,nolog,ctl:requestBodyProcessor=JSON\"", + "SecRule REQBODY_ERROR \"!@eq 0\" \"id:'200002', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}'\"", + "SecRule ARGS:/k5/ \"@rx v5\" \"id:'1234',phase:2,deny,status:403,t:none,log,auditlog\"" + ] + } +] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/secmarker.json b/src/deps/src/ModSecurity/test/test-cases/regression/secmarker.json index bf5354c97..20c20bce7 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/secmarker.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/secmarker.json @@ -110,7 +110,7 @@ }, "expected": { "audit_log": "", - "debug_log": "Out of a SecMarker after skip 6 rules.", + "debug_log": "Rule: 6", "error_log": "" }, "rules": [ diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_GET.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_GET.json index b1be844e0..dde6d690e 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_GET.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_GET.json @@ -2,7 +2,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: ARGS_GET (1/5)", + "title":"Testing Variables :: ARGS_GET (1/6)", "client":{ "ip":"200.249.12.31", "port":123 @@ -41,7 +41,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: ARGS_GET (2/5)", + "title":"Testing Variables :: ARGS_GET (2/6)", "client":{ "ip":"200.249.12.31", "port":123 @@ -80,7 +80,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: ARGS_GET (3/5)", + "title":"Testing Variables :: ARGS_GET (3/6)", "client":{ "ip":"200.249.12.31", "port":123 @@ -119,7 +119,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: ARGS_GET (4/5)", + "title":"Testing Variables :: ARGS_GET (4/6)", "client":{ "ip":"200.249.12.31", "port":123 @@ -158,7 +158,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: ARGS_GET (5/5)", + "title":"Testing Variables :: ARGS_GET (5/6)", "client":{ "ip":"200.249.12.31", "port":123 @@ -193,6 +193,46 @@ "SecRuleEngine On", "SecRule ARGS_GET \"@rx ^othervalue$ \" \"id:1,pass,t:none\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: ARGS_GET (6/6)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?key=value&second_key=other_value#urifrag", + "method":"GET", + "http_version":1.1 + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS_GET \"@streq other_value\" \"id:1,phase:1,deny,status:403\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_NAMES.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_NAMES.json index 97c9aa80c..bf3e80d42 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_NAMES.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_NAMES.json @@ -164,6 +164,58 @@ "SecRuleEngine On", "SecRule ARGS_NAMES \"@contains test \" \"id:1,phase:3,pass,t:trim\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: ARGS_POST_NAMES (3/x)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=0000", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "--0000\r", + "Content-Disposition: form-data; name=\"name1\"\r", + "\r", + "content1\r", + "--0000\r", + "Content-Disposition: form-data; name=\"name2\"\r", + "\r", + "content2\r", + "--0000--\r" + ] + }, + "response":{ + "headers":{ + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Target value: \"name1\" \\(Variable: ARGS_NAMES:name1\\)" + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRule ARGS_NAMES \"@contains test \" \"id:1,phase:3,pass,t:trim\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_POST_NAMES.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_POST_NAMES.json index 5c3fd404c..e414c8763 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_POST_NAMES.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-ARGS_POST_NAMES.json @@ -2,7 +2,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: ARGS_POST_NAMES (1/2)", + "title":"Testing Variables :: ARGS_POST_NAMES (1/x)", "client":{ "ip":"200.249.12.31", "port":123 @@ -46,7 +46,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: ARGS_POST_NAMES (2/2)", + "title":"Testing Variables :: ARGS_POST_NAMES (2/x)", "client":{ "ip":"200.249.12.31", "port":123 @@ -86,6 +86,110 @@ "SecRuleEngine On", "SecRule ARGS_POST_NAMES \"@contains test \" \"id:1,phase:3,pass,t:trim\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: ARGS_POST_NAMES (3/x)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=0000", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "--0000\r", + "Content-Disposition: form-data; name=\"name1\"\r", + "\r", + "content1\r", + "--0000\r", + "Content-Disposition: form-data; name=\"name2\"\r", + "\r", + "content2\r", + "--0000--\r" + ] + }, + "response":{ + "headers":{ + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Target value: \"name1\" \\(Variable: ARGS_POST_NAMES:name1\\)" + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRule ARGS_POST_NAMES \"@contains test \" \"id:1,phase:3,pass,t:trim\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: ARGS_POST_NAMES (3/x)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=0000", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "--0000\r", + "Content-Disposition: form-data; name=\"name1\"\r", + "\r", + "content1\r", + "--0000\r", + "Content-Disposition: form-data; name=\"name2\"\r", + "\r", + "content2\r", + "--0000--\r" + ] + }, + "response":{ + "headers":{ + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "error_log":"o0,5v206,5t:trim" + }, + "rules":[ + "SecRuleEngine On", + "SecRequestBodyAccess On", + "SecRule ARGS_POST_NAMES \"@contains name1\" \"id:1,phase:3,pass,t:trim\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-FILES.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-FILES.json index e426ab7bf..7f0f4dcf5 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-FILES.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-FILES.json @@ -2,7 +2,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: FILES (1/1)", + "title":"Testing Variables :: FILES (1/2)", "client":{ "ip":"200.249.12.31", "port":123 @@ -57,5 +57,64 @@ "SecRuleEngine On", "SecRule FILES \"@contains small_text_file.txt\" \"id:1,phase:3,pass,t:trim\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: FILES (2/2)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata1\"; filename=\"myfile.txt\"", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata2\"; filename=\"nextfile.txt\"", + "Content-Type: text/plain", + "", + "This is another very small test file..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule FILES:filedata1 \"@contains myfile.txt\" \"id:1,phase:2,deny,status:403\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-MATCHED_VAR_NAME.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-MATCHED_VAR_NAME.json index 318a32060..ef9c43ca4 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-MATCHED_VAR_NAME.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-MATCHED_VAR_NAME.json @@ -2,7 +2,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: MATCHED_VAR_NAME (1/2)", + "title":"Testing Variables :: MATCHED_VAR_NAME (1/3)", "client":{ "ip":"200.249.12.31", "port":123 @@ -43,7 +43,7 @@ { "enabled":1, "version_min":300000, - "title":"Testing Variables :: MATCHED_VAR_NAME (2/2)", + "title":"Testing Variables :: MATCHED_VAR_NAME (2/3)", "client":{ "ip":"200.249.12.31", "port":123 @@ -81,6 +81,46 @@ "SecRule MATCHED_VAR_NAME \"@contains asdf\" \"\"", "SecRule MATCHED_VAR_NAME \"@contains value\" \"id:29\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: MATCHED_VAR_NAME (3/3)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?key1=value&key2=other_value", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":" Target value: \"ARGS_NAMES:key1\" \\(Variable: MATCHED_VAR_NAME\\)" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS_NAMES \"@contains ey1\" \"chain,id:30,pass\"", + "SecRule MATCHED_VAR_NAME \"@contains key1\" \"id:31\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-MULTIPART_PART_HEADERS.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-MULTIPART_PART_HEADERS.json new file mode 100644 index 000000000..f2798ddbd --- /dev/null +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-MULTIPART_PART_HEADERS.json @@ -0,0 +1,167 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: MULTIPART_PART_HEADERS (all headers)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=-----------------------------69343412719991675451336310646", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "-------------------------------69343412719991675451336310646", + "Content-Disposition: form-data; name=parm1", + "Content-Type: image/jpeg", + "", + "1", + "-------------------------------69343412719991675451336310646", + "Content-Disposition: form-data; name=parm2", + "", + "2", + "-------------------------------69343412719991675451336310646--" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403, + "debug_log":"Variable: MULTIPART_PART_HEADERS:parm1.*Rule returned 1" + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_PART_HEADERS \"@rx content-type:.*jpeg\" \"phase:2,deny,status:403,id:500074,t:lowercase\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: MULTIPART_PART_HEADERS (specific header - match)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=-----------------------------69343412719991675451336310646", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "-------------------------------69343412719991675451336310646", + "Content-Disposition: form-data; name=parm1", + "Content-Type: image/jpeg", + "", + "1", + "-------------------------------69343412719991675451336310646", + "Content-Disposition: form-data; name=parm2", + "", + "2", + "-------------------------------69343412719991675451336310646--" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403, + "debug_log":"Variable: MULTIPART_PART_HEADERS:parm1.*Rule returned 1" + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_PART_HEADERS:parm1 \"@rx content-type:.*jpeg\" \"phase:2,deny,status:403,id:500074,t:lowercase\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: MULTIPART_PART_HEADERS (specific header - no match)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=-----------------------------69343412719991675451336310646", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "-------------------------------69343412719991675451336310646", + "Content-Disposition: form-data; name=parm1", + "Content-Type: image/jpeg", + "", + "1", + "-------------------------------69343412719991675451336310646", + "Content-Disposition: form-data; name=parm2", + "", + "2", + "-------------------------------69343412719991675451336310646--" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 200 + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_PART_HEADERS:parm2 \"@rx content-type:.*jpeg\" \"phase:2,deny,status:403,id:500074,t:lowercase\"" + ] + } +] + diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json index 9e53bb643..402e4541d 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-MULTIPART_STRICT_ERROR.json @@ -342,6 +342,126 @@ "SecRuleEngine On", "SecRule REQBODY_ERROR \"@contains 0\" \"id:1,phase:3,pass,t:trim\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: MULTIPART_STRICT_ERROR - IQ ", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=file'data; filename=\"small_text_file.txt\"", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", + "Content-Type: text/plain", + "", + "This is another very small test file..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403, + "debug_log":"Warning: invalid quoting used" + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_STRICT_ERROR \"!@eq 0\" \"id:1,phase:2,deny,status:403\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: MULTIPART_STRICT_ERROR - IQ ", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*", + "Content-Length":"330", + "Content-Type":"multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2", + "Expect":"100-continue" + }, + "uri":"/", + "method":"POST", + "body":[ + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"name\"", + "", + "test", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"file'data\"; filename=\"small_text_file.txt\"", + "Content-Type: text/plain", + "", + "This is a very small test file..", + "----------------------------756b6d74fa1a8ee2", + "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"", + "Content-Type: text/plain", + "", + "This is another very small test file..", + "----------------------------756b6d74fa1a8ee2--" + ] + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 200 + }, + "rules":[ + "SecRuleEngine On", + "SecRule MULTIPART_INVALID_QUOTING \"!@eq 0\" \"id:1,phase:2,deny,status:403\"", + "SecRule MULTIPART_STRICT_ERROR \"!@eq 0\" \"id:2,phase:2,pass\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-QUERY_STRING.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-QUERY_STRING.json index a2246a1bc..02fc497ba 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-QUERY_STRING.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-QUERY_STRING.json @@ -39,5 +39,85 @@ "SecRuleEngine On", "SecRule QUERY_STRING \"@contains test \" \"id:1,phase:3,pass,t:trim\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: QUERY_STRING (URI contains fragment)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?key=value&key=other_value#urifrag", + "method":"GET", + "http_version":1.1 + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule QUERY_STRING \"!@contains urifrag\" \"id:1,phase:1,deny,status:403\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: QUERY_STRING (URI contains fragment)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/one/two/testpost.php#urifrag", + "method":"GET", + "http_version":1.1 + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule QUERY_STRING \"@eq 0\" \"id:1,phase:1,t:length,deny,status:403\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQBODY_PROCESSOR.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQBODY_PROCESSOR.json index 965128b29..87f43facf 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQBODY_PROCESSOR.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQBODY_PROCESSOR.json @@ -73,7 +73,7 @@ }, "rules":[ "SecRuleEngine On", - "SecRule REQUEST_HEADERS:Content-Type \"^text/xml$\" \"id:500005,phase:1,t:none,t:lowercase,nolog,pass,ctl:requestBodyProcessor=XML\"", + "SecRule REQUEST_HEADERS:Content-Type \"^(?:application(?:/soap\+|/)|text/)xml\" \"id:500005,phase:1,t:none,t:lowercase,nolog,pass,ctl:requestBodyProcessor=XML\"", "SecRule REQBODY_PROCESSOR \"@contains test\" \"id:1,pass,phase:2,t:trim\"" ] }, diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_LINE.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_LINE.json index 83b493bb4..586f0c312 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_LINE.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_LINE.json @@ -38,6 +38,86 @@ "SecRuleEngine On", "SecRule REQUEST_LINE \"@contains test \" \"id:1,pass,t:trim\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: REQUEST_LINE (with URI fragment)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?key=value&key=other_value#urifrag", + "method":"GET", + "http_version":1.1 + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_LINE \"@contains urifrag\" \"id:1,phase:1,deny,status:403\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: REQUEST_URI_RAW (with URI fragment)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/one/two/testpost.php#urifrag", + "method":"GET", + "http_version":1.1 + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_URI_RAW \"@contains urifrag\" \"id:1,phase:1,deny,status:403\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_URI.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_URI.json index 8336c9faf..795ce29b6 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_URI.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_URI.json @@ -38,6 +38,86 @@ "SecRuleEngine On", "SecRule REQUEST_URI \"@contains test \" \"id:1,pass,t:trim\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: REQUEST_URI (with URI fragment)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?key=value&key=other_value#urifrag", + "method":"GET", + "http_version":1.1 + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_URI \"!@contains urifrag\" \"id:1,phase:1,deny,status:403\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: REQUEST_URI (with URI fragment)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/one/two/testpost.php#urifrag", + "method":"GET", + "http_version":1.1 + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_URI \"!@contains urifrag\" \"id:1,phase:1,deny,status:403\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_URI_RAW.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_URI_RAW.json index d4ea9b37f..09fff33cd 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_URI_RAW.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-REQUEST_URI_RAW.json @@ -38,6 +38,86 @@ "SecRuleEngine On", "SecRule REQUEST_URI_RAW \"@contains test \" \"id:1,pass,t:trim\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: REQUEST_URI_RAW (with URI fragment)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/?key=value&key=other_value#urifrag", + "method":"GET", + "http_version":1.1 + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_URI_RAW \"@contains urifrag\" \"id:1,phase:1,deny,status:403\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: REQUEST_URI_RAW (with URI fragment)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "headers":{ + "Host":"localhost", + "User-Agent":"curl/7.38.0", + "Accept":"*/*" + }, + "uri":"/one/two/testpost.php#urifrag", + "method":"GET", + "http_version":1.1 + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "http_code": 403 + }, + "rules":[ + "SecRuleEngine On", + "SecRule REQUEST_URI_RAW \"@contains urifrag\" \"id:1,phase:1,deny,status:403\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-cases/regression/variable-TX.json b/src/deps/src/ModSecurity/test/test-cases/regression/variable-TX.json index 0cd45381b..904628e9b 100644 --- a/src/deps/src/ModSecurity/test/test-cases/regression/variable-TX.json +++ b/src/deps/src/ModSecurity/test/test-cases/regression/variable-TX.json @@ -80,5 +80,143 @@ "SecRule REQUEST_HEADERS \"@rx ([A-z]+)\" \"id:1,log,pass,capture,id:14\"", "SecRule TX:0 \"@rx ([A-z]+)\" \"id:15\"" ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: capture group match after unused group", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "uri":"/?key=aadd", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Added regex subexpression TX\\.3: dd[\\s\\S]*Target value: \"dd\" \\(Variable\\: TX\\:3[\\s\\S]*Rule returned 1" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS \"@rx (aa)(bb|cc)?(dd)\" \"id:1,log,pass,capture,id:16\"", + "SecRule TX:3 \"@streq dd\" \"id:19,phase:2,log,pass\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: empty capture group match followed by nonempty capture group", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "uri":"/?key=aadd", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Added regex subexpression TX\\.3: dd[\\s\\S]*Target value: \"dd\" \\(Variable\\: TX\\:3[\\s\\S]*Rule returned 1" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS \"@rx (aa)(bb|cc|)(dd)\" \"id:18,phase:1,log,pass,capture\"", + "SecRule TX:3 \"@streq dd\" \"id:19,phase:2,log,pass\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: repeating capture group -- alternates", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "uri":"/?key=_abc123_", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Added regex subexpression TX\\.2: abc[\\s\\S]*Added regex subexpression TX\\.3: 123" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS \"@rx _((?:(abc)|(123))+)_\" \"id:18,phase:1,log,pass,capture\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: repeating capture group -- same (nested)", + "client":{ + "ip":"200.249.12.31", + "port":123 + }, + "server":{ + "ip":"200.249.12.31", + "port":80 + }, + "request":{ + "uri":"/?key=a:5a:8a:9", + "method":"GET" + }, + "response":{ + "headers":{ + "Date":"Mon, 13 Jul 2015 20:02:41 GMT", + "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", + "Content-Type":"text/html" + }, + "body":[ + "no need." + ] + }, + "expected":{ + "debug_log":"Added regex subexpression TX\\.1: 5[\\s\\S]*Added regex subexpression TX\\.2: 8[\\s\\S]*Added regex subexpression TX\\.3: 9" + }, + "rules":[ + "SecRuleEngine On", + "SecRule ARGS \"@rx a:([0-9])(?:a:([0-9])(?:a:([0-9]))*)*\" \"id:18,phase:1,log,pass,capture\"" + ] } ] diff --git a/src/deps/src/ModSecurity/test/test-suite.sh b/src/deps/src/ModSecurity/test/test-suite.sh index ff8924b7a..ce03c244e 100755 --- a/src/deps/src/ModSecurity/test/test-suite.sh +++ b/src/deps/src/ModSecurity/test/test-suite.sh @@ -11,14 +11,30 @@ FILE=${@: -1} if [[ $FILE == *"test-cases/regression/"* ]] then AMOUNT=$(./regression_tests countall ../$FILE) + RET=$? + if [ $RET -ne 0 ]; then + echo ":test-result: SKIP: json is not enabled. (regression/$RET) ../$FILE:$i" + exit 0 + fi + for i in `seq 1 $AMOUNT`; do $VALGRIND $PARAM ./regression_tests ../$FILE:$i - if [ $? -eq 139 ]; then - echo ":test-result: FAIL segfault: ../$FILE:$i" + RET=$? + if [ $RET -ne 0 ]; then + echo ":test-result: FAIL possible segfault/$RET: ../$FILE:$i" fi echo $VALGRIND $PARAM ./regression_tests ../$FILE:$i done; else $VALGRIND $PARAM ./unit_tests ../$FILE + RET=$? + if [ $RET -eq 127 ] + then + echo ":test-result: SKIP: json is not enabled. (unit/$RET) ../$FILE:$i" + elif [ $RET -ne 0 ] + then + echo ":test-result: FAIL possible segfault: (unit/$RET) ../$FILE:$i" + fi fi + cd - 1> /dev/null diff --git a/src/deps/src/ModSecurity/test/unit/unit.cc b/src/deps/src/ModSecurity/test/unit/unit.cc index 4d88a771b..49aeabd20 100644 --- a/src/deps/src/ModSecurity/test/unit/unit.cc +++ b/src/deps/src/ModSecurity/test/unit/unit.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -20,9 +20,8 @@ #include #include - +#include "modsecurity/rules_set.h" #include "modsecurity/modsecurity.h" -#include "modsecurity/rules.h" #include "src/operators/operator.h" #include "src/actions/transformations/transformation.h" #include "modsecurity/transaction.h" diff --git a/src/deps/src/ModSecurity/test/unit/unit_test.cc b/src/deps/src/ModSecurity/test/unit/unit_test.cc index 23bbcb234..d15533a3c 100644 --- a/src/deps/src/ModSecurity/test/unit/unit_test.cc +++ b/src/deps/src/ModSecurity/test/unit/unit_test.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -66,7 +66,7 @@ void json2bin(std::string *str) { unsigned int p; std::string toBeReplaced = match.str(); toBeReplaced.erase(0, 2); - sscanf(toBeReplaced.c_str(), "%x", &p); + sscanf(toBeReplaced.c_str(), "%3x", &p); replaceAll(str, match.str(), p); } @@ -119,7 +119,7 @@ std::string UnitTest::print() { } -UnitTest *UnitTest::from_yajl_node(yajl_val &node) { +UnitTest *UnitTest::from_yajl_node(const yajl_val &node) { size_t num_tests = node->u.object.len; UnitTest *u = new UnitTest(); diff --git a/src/deps/src/ModSecurity/test/unit/unit_test.h b/src/deps/src/ModSecurity/test/unit/unit_test.h index 34aa59142..d200db5db 100644 --- a/src/deps/src/ModSecurity/test/unit/unit_test.h +++ b/src/deps/src/ModSecurity/test/unit/unit_test.h @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -27,7 +27,7 @@ namespace modsecurity_test { class UnitTest { public: - static UnitTest *from_yajl_node(yajl_val &); + static UnitTest *from_yajl_node(const yajl_val &); std::string print(); diff --git a/src/deps/src/ModSecurity/tools/rules-check/rules-check.cc b/src/deps/src/ModSecurity/tools/rules-check/rules-check.cc index fac289234..f59439ee9 100644 --- a/src/deps/src/ModSecurity/tools/rules-check/rules-check.cc +++ b/src/deps/src/ModSecurity/tools/rules-check/rules-check.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -21,8 +21,8 @@ #include #include +#include "modsecurity/rules_set.h" #include "modsecurity/modsecurity.h" -#include "modsecurity/rules.h" void print_help(const char *name) { @@ -32,9 +32,9 @@ void print_help(const char *name) { int main(int argc, char **argv) { - modsecurity::Rules *rules; + modsecurity::RulesSet *rules; char **args = argv; - rules = new modsecurity::Rules(); + rules = new modsecurity::RulesSet(); int ret = 0; args++; @@ -71,7 +71,7 @@ int main(int argc, char **argv) { } if (argFull.empty() == false) { - arg = argFull.c_str(); + arg = strdup(argFull.c_str()); argFull.clear(); } diff --git a/src/deps/src/headers-more-nginx-module/.travis.yml b/src/deps/src/headers-more-nginx-module/.travis.yml index 9748a9958..766ea1b28 100644 --- a/src/deps/src/headers-more-nginx-module/.travis.yml +++ b/src/deps/src/headers-more-nginx-module/.travis.yml @@ -23,6 +23,7 @@ env: matrix: - NGINX_VERSION=1.19.3 - NGINX_VERSION=1.19.9 + - NGINX_VERSION=1.23.0 WITHOUT_PCRE2=1 before_install: - sudo apt-get update -y @@ -51,3 +52,4 @@ script: - export NGX_BUILD_CC=$CC - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - prove -I. -r t + diff --git a/src/deps/src/headers-more-nginx-module/README.markdown b/src/deps/src/headers-more-nginx-module/README.markdown index 018a14b28..336d3ce86 100644 --- a/src/deps/src/headers-more-nginx-module/README.markdown +++ b/src/deps/src/headers-more-nginx-module/README.markdown @@ -104,7 +104,7 @@ For example, more_set_headers -t 'text/html text/plain' 'X-Foo: Bar'; ``` -Never use other paramemters like `charset=utf-8` in the `-t` option values; they will not +Never use other parameters like `charset=utf-8` in the `-t` option values; they will not work as you would expect. Input headers can be modified as well. For example @@ -382,6 +382,8 @@ Compatibility The following versions of Nginx should work with this module: +* **1.21.x** (last tested: 1.21.4) +* **1.19.x** (last tested: 1.19.9) * **1.17.x** (last tested: 1.17.8) * **1.16.x** * **1.15.x** (last tested: 1.15.8) diff --git a/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_headers_in.c b/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_headers_in.c index c3eb8f7d9..217666506 100644 --- a/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_headers_in.c +++ b/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_headers_in.c @@ -158,9 +158,15 @@ static ngx_http_headers_more_set_header_t ngx_http_headers_more_set_handlers[] ngx_http_set_builtin_header }, #endif +#if defined(nginx_version) && nginx_version >= 1023000 + { ngx_string("Cookie"), + offsetof(ngx_http_headers_in_t, cookie), + ngx_http_set_builtin_multi_header }, +#else { ngx_string("Cookie"), offsetof(ngx_http_headers_in_t, cookies), ngx_http_set_builtin_multi_header }, +#endif { ngx_null_string, 0, ngx_http_set_header } }; @@ -329,6 +335,9 @@ matched: h->key = hv->key; h->value = *value; +#if defined(nginx_version) && nginx_version >= 1023000 + h->next = NULL; +#endif h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); if (h->lowcase_key == NULL) { @@ -752,6 +761,50 @@ static ngx_int_t ngx_http_set_builtin_multi_header(ngx_http_request_t *r, ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) { +#if defined(nginx_version) && nginx_version >= 1023000 + ngx_table_elt_t **headers, **ph, *h; + int nelts; + + if (r->headers_out.status == 400 || r->headers_in.headers.last == NULL) { + /* must be a 400 Bad Request */ + return NGX_OK; + } + + headers = (ngx_table_elt_t **) ((char *) &r->headers_in + hv->offset); + + if (*headers) { + nelts = 0; + for (h = *headers; h; h = h->next) { + nelts++; + } + + *headers = NULL; + + dd("clear multi-value headers: %d", nelts); + } + + if (ngx_http_set_header_helper(r, hv, value, &h) == NGX_ERROR) { + return NGX_ERROR; + } + + if (value->len == 0) { + return NGX_OK; + } + + dd("new multi-value header: %p", h); + + if (*headers) { + for (ph = headers; *ph; ph = &(*ph)->next) { /* void */ } + *ph = h; + + } else { + *headers = h; + } + + h->next = NULL; + + return NGX_OK; +#else ngx_array_t *headers; ngx_table_elt_t **v, *h; @@ -804,6 +857,7 @@ ngx_http_set_builtin_multi_header(ngx_http_request_t *r, *v = h; return NGX_OK; +#endif } @@ -836,6 +890,7 @@ ngx_http_headers_more_validate_host(ngx_str_t *host, ngx_pool_t *pool, if (dot_pos == i - 1) { return NGX_DECLINED; } + dot_pos = i; break; diff --git a/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_headers_out.c b/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_headers_out.c index 0f9bc877c..9d58edef8 100644 --- a/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_headers_out.c +++ b/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_headers_out.c @@ -327,6 +327,46 @@ static ngx_int_t ngx_http_set_builtin_multi_header(ngx_http_request_t *r, ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) { +#if defined(nginx_version) && nginx_version >= 1023000 + ngx_table_elt_t **headers, *h, *ho, **ph; + + headers = (ngx_table_elt_t **) ((char *) &r->headers_out + hv->offset); + + if (*headers) { + for (h = (*headers)->next; h; h = h->next) { + h->hash = 0; + h->value.len = 0; + } + + h = *headers; + + h->value = *value; + + if (value->len == 0) { + h->hash = 0; + + } else { + h->hash = hv->hash; + } + + return NGX_OK; + } + + for (ph = headers; *ph; ph = &(*ph)->next) { /* void */ } + + ho = ngx_list_push(&r->headers_out.headers); + if (ho == NULL) { + return NGX_ERROR; + } + + ho->value = *value; + ho->hash = hv->hash; + ngx_str_set(&ho->key, "Cache-Control"); + ho->next = NULL; + *ph = ho; + + return NGX_OK; +#else ngx_array_t *pa; ngx_table_elt_t *ho, **ph; ngx_uint_t i; @@ -378,6 +418,7 @@ ngx_http_set_builtin_multi_header(ngx_http_request_t *r, *ph = ho; return NGX_OK; +#endif } diff --git a/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_util.c b/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_util.c index caf372e94..e1f36364c 100644 --- a/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_util.c +++ b/src/deps/src/headers-more-nginx-module/src/ngx_http_headers_more_util.c @@ -295,6 +295,7 @@ ngx_http_headers_more_rm_header_helper(ngx_list_t *l, ngx_list_part_t *cur, if (part->next == NULL) { return NGX_ERROR; } + part = part->next; } @@ -338,6 +339,7 @@ ngx_http_headers_more_rm_header_helper(ngx_list_t *l, ngx_list_part_t *cur, if (part->next == NULL) { return NGX_ERROR; } + part = part->next; } diff --git a/src/deps/src/headers-more-nginx-module/util/build.sh b/src/deps/src/headers-more-nginx-module/util/build.sh index 007194d73..00a191fbc 100755 --- a/src/deps/src/headers-more-nginx-module/util/build.sh +++ b/src/deps/src/headers-more-nginx-module/util/build.sh @@ -6,6 +6,10 @@ root=`pwd` version=$1 home=~ force=$2 +pcre2_opt="" +if [ "$WITHOUT_PCRE2" = "1" ]; then + pcre2_opt="--without-pcre2" +fi #--with-cc=gcc46 \ @@ -21,6 +25,7 @@ ngx-build $force $version \ --without-http_autoindex_module \ --without-http_auth_basic_module \ --without-http_userid_module \ + $pcre2_opt \ --with-http_realip_module \ --with-http_dav_module \ --add-module=$root/../eval-nginx-module \ diff --git a/src/deps/src/libmaxminddb/.github/workflows/clang-addresssanitizer.yml b/src/deps/src/libmaxminddb/.github/workflows/clang-addresssanitizer.yml new file mode 100644 index 000000000..a00984bda --- /dev/null +++ b/src/deps/src/libmaxminddb/.github/workflows/clang-addresssanitizer.yml @@ -0,0 +1,26 @@ +name: Run Clang AddressSanitizer +on: + push: + pull_request: + schedule: + - cron: '13 20 * * SUN' +jobs: + addresssanitizer: + name: Clang AddressSanitizer + runs-on: ubuntu-latest + env: + ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_invalid_pointer_pairs=2 + CC: clang + CXX: clang++ + CFLAGS: -fsanitize=address -Wall -Wextra -Wpedantic -Wformat=2 -Walloca -Wvla -Wimplicit-fallthrough -Wcast-qual -Wconversion -Wshadow -Wundef -Wstrict-prototypes -Wswitch-enum -fstack-protector -D_FORTIFY_SOURCE=2 + CXXFLAGS: -fsanitize=address + LDFLAGS: -fsanitize=address + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - run: sudo apt install clang libipc-run3-perl + - run: ./bootstrap + - run: ./configure + - run: make + - run: make check diff --git a/src/deps/src/libmaxminddb/.github/workflows/clang-analyzer.yml b/src/deps/src/libmaxminddb/.github/workflows/clang-analyzer.yml new file mode 100644 index 000000000..8939ceb37 --- /dev/null +++ b/src/deps/src/libmaxminddb/.github/workflows/clang-analyzer.yml @@ -0,0 +1,19 @@ +name: Run Clang Static Analysis +on: + push: + pull_request: + schedule: + - cron: '3 20 * * SUN' +jobs: + clang-analyzer: + name: Clang static analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt install clang-tools libipc-run3-perl + - run: ./bootstrap + - run: scan-build ./configure + env: + CFLAGS: -std=c99 -Wall -Wextra -Werror -Wno-unused-function -Wno-unused-parameter -Wno-unknown-pragmas + - run: cd src; scan-build --status-bugs make; cd .. + - run: cd bin; scan-build --status-bugs make; cd .. diff --git a/src/deps/src/libmaxminddb/.github/workflows/codeql-analysis.yml b/src/deps/src/libmaxminddb/.github/workflows/codeql-analysis.yml index 386a1aee0..a6501c495 100644 --- a/src/deps/src/libmaxminddb/.github/workflows/codeql-analysis.yml +++ b/src/deps/src/libmaxminddb/.github/workflows/codeql-analysis.yml @@ -29,7 +29,7 @@ jobs: - name: Initialize CodeQL uses: github/codeql-action/init@v1 - - run: sudo apt install libipc-run3-perl libfile-slurp-perl libfile-which-perl pandoc + - run: sudo apt install libipc-run3-perl libipc-system-simple-perl libfile-slurp-perl libfile-which-perl pandoc - run: | ./bootstrap ./configure diff --git a/src/deps/src/libmaxminddb/.github/workflows/test.yml b/src/deps/src/libmaxminddb/.github/workflows/test.yml index 2c97268af..33eaf4c99 100644 --- a/src/deps/src/libmaxminddb/.github/workflows/test.yml +++ b/src/deps/src/libmaxminddb/.github/workflows/test.yml @@ -27,7 +27,9 @@ jobs: - run: ./bootstrap - run: ./configure env: - CFLAGS: -std=c99 -Wall -Wextra -Werror -Wno-unused-function -Wno-unused-parameter ${{ matrix.posix }} + # -Wno-unknown-pragmas because we have some Clang specific pragmas + # which aren't interesting to cause failures for. + CFLAGS: -std=c99 -Wall -Wextra -Werror -Wno-unused-function -Wno-unused-parameter -Wno-unknown-pragmas ${{ matrix.posix }} - run: make - run: make check @@ -43,4 +45,4 @@ jobs: submodules: true - run: cmake -DBUILD_TESTING=ON . - run: cmake --build . - - run: ctest -V . + - run: ctest -V . -C Debug diff --git a/src/deps/src/libmaxminddb/CMakeLists.txt b/src/deps/src/libmaxminddb/CMakeLists.txt index 8d222fdde..6a989c791 100644 --- a/src/deps/src/libmaxminddb/CMakeLists.txt +++ b/src/deps/src/libmaxminddb/CMakeLists.txt @@ -1,15 +1,21 @@ cmake_minimum_required (VERSION 3.9) + project(maxminddb LANGUAGES C - VERSION 1.5.2 + VERSION 1.7.1 ) set(MAXMINDDB_SOVERSION 0.0.7) set(CMAKE_C_STANDARD 99) set(CMAKE_C_EXTENSIONS OFF) +if (WIN32) + option(MSVC_STATIC_RUNTIME "When ON the library will be built by using MT/MTd run-time libraries" OFF) +endif() option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF) option(BUILD_TESTING "Build test programs" ON) +include(GNUInstallDirs) + include(CheckTypeSize) check_type_size("unsigned __int128" UINT128) check_type_size("unsigned int __attribute__((mode(TI)))" UINT128_USING_MODE) @@ -57,6 +63,17 @@ if(WIN32) if(BUILD_SHARED_LIBS) set_target_properties(maxminddb PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() + if(MSVC_STATIC_RUNTIME) + # On MSVC, when MSVC_STATIC_RUNTIME is ON, MT (Release) and MTd (Debug) + # run-time libraries will be used instead of MD/MDd. The default is OFF so + # MD/MDd are used when nothing related is passed. + # + # Adapted from https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#make-override-files + set(CMAKE_USER_MAKE_RULES_OVERRIDE + ${CMAKE_CURRENT_SOURCE_DIR}/c_flag_overrides.cmake) + set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX + ${CMAKE_CURRENT_SOURCE_DIR}/cxx_flag_overrides.cmake) + endif() endif() target_include_directories(maxminddb PUBLIC @@ -78,7 +95,7 @@ install(TARGETS maxminddb install(EXPORT maxminddb FILE maxminddb-config.cmake NAMESPACE maxminddb:: - DESTINATION lib/cmake/maxminddb) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/maxminddb) # We always want to build mmdblookup add_subdirectory(bin) @@ -88,3 +105,17 @@ if (BUILD_TESTING) add_subdirectory(t) endif() +# Generate libmaxminddb.pc file for pkg-config +# Set the required variables as same with autotools +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(exec_prefix \${prefix}) +set(libdir \${exec_prefix}/lib) +set(includedir \${prefix}/include) +set(PACKAGE_VERSION ${maxminddb_VERSION}) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/libmaxminddb.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/src/libmaxminddb.pc + @ONLY) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/libmaxminddb.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/src/deps/src/libmaxminddb/Changes.md b/src/deps/src/libmaxminddb/Changes.md index e2c5c31c4..0dfc028e5 100644 --- a/src/deps/src/libmaxminddb/Changes.md +++ b/src/deps/src/libmaxminddb/Changes.md @@ -1,3 +1,22 @@ +## 1.7.1 - 2022-09-30 + +* The external symbols test now only runs on Linux. It assumes a Linux + environment. Reported by Carlo Cabrera. GitHub #304. + +## 1.7.0 - 2022-09-28 + +* `FD_CLOEXEC` is now set on platforms that do not support `O_CLOEXEC`. + Reported by rittneje. GitHub #273. +* When building with Visual Studio, you may now build a static runtime with + CMake by setting `MSVC_STATIC_RUNTIME` to `ON`. Pull request by Rafael + Santiago. GitHub #269. +* The CMake build now works on iOS. Pull request by SpaceIm. GitHub #271. +* The CMake build now uses the correct library directory on Linux systems + using alternate directory structures. Pull request by Satadru Pramanik. + GitHub #284. +* File size check now correctly compares the size to `SSIZE_MAX`. Reported + by marakew. GitHub #301. + ## 1.6.0 - 2021-04-29 * This release includes several improvements to the CMake build. In diff --git a/src/deps/src/libmaxminddb/NOTICE b/src/deps/src/libmaxminddb/NOTICE index 7fe2706b9..7a695dee9 100644 --- a/src/deps/src/libmaxminddb/NOTICE +++ b/src/deps/src/libmaxminddb/NOTICE @@ -1,4 +1,4 @@ -Copyright 2013-2021 MaxMind, Inc. +Copyright 2013-2022 MaxMind, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/deps/src/libmaxminddb/README.dev.md b/src/deps/src/libmaxminddb/README.dev.md index 00d5f5582..3f6817156 100644 --- a/src/deps/src/libmaxminddb/README.dev.md +++ b/src/deps/src/libmaxminddb/README.dev.md @@ -1,7 +1,6 @@ # Releasing this library -We release by uploading the tarball to GitHub, uploading Ubuntu PPAs, and by -updating the Homebrew recipe for this library. +We release by uploading the tarball to GitHub and uploading Ubuntu PPAs. ## Creating the release tarball You may want to refer to the section about prerequisites. @@ -9,9 +8,12 @@ You may want to refer to the section about prerequisites. * Check whether there are any open issues to fix while you're doing this. * Update `Changes.md` to include specify the new version, today's date, and list relevant changes. Commit this. +* Create a new branch off of the latest `main` for the release. * Run `./dev-bin/release.sh` to update various files in the distro, our GitHub pages, and creates a GitHub release with the tarball. * Check the release looks good on both GitHub and launchpad.net. +* Make a pull request against `main` with the changes from the release + script. ## PPA @@ -29,7 +31,14 @@ before running it. You should run it from `main`. -## Homebrew +## Homebrew (optional) + +Releasing to Homebrew is no longer required as the formulas are easily +updated by the end-user using a built-in feature in the tool. These +directions remain in case there is a more significant change to the +build process that may require a non-trivial update to the formula or +in the case where we want the Homebrew version updated promptly for +some reason. * Go to https://github.com/Homebrew/homebrew-core/edit/master/Formula/libmaxminddb.rb * Edit the file to update the url and sha256. You can get the sha256 for the @@ -43,8 +52,7 @@ You should run it from `main`. autoconf automake libtool git-buildpackage libfile-slurp-perl pandoc dirmngr libfile-slurp-tiny-perl libdatetime-perl debhelper dh-autoreconf libipc-run3-perl libtest-output-perl devscripts -* Install [hub](https://github.com/github/hub/releases). (Using `./install` - from the tarball is fine) +* Install [gh](https://github.com/cli/cli/releases). * GitHub ssh key (e.g. in `~/.ssh/id_rsa`) * Git config (e.g. `~/.gitconfig`) * Import your GPG secret key (or create one if you don't have a suitable diff --git a/src/deps/src/libmaxminddb/README.md b/src/deps/src/libmaxminddb/README.md index 0a6007308..2a4df66ab 100644 --- a/src/deps/src/libmaxminddb/README.md +++ b/src/deps/src/libmaxminddb/README.md @@ -6,10 +6,10 @@ designed to facilitate fast lookups of IP addresses while allowing for great flexibility in the type of data associated with an address. The MaxMind DB format is an open format. The spec is available at -http://maxmind.github.io/MaxMind-DB/. This spec is licensed under the Creative -Commons Attribution-ShareAlike 3.0 Unported License. +https://maxmind.github.io/MaxMind-DB/. This spec is licensed under the +Creative Commons Attribution-ShareAlike 3.0 Unported License. -See http://dev.maxmind.com/ for more details about MaxMind's GeoIP2 products. +See https://dev.maxmind.com/ for more details about MaxMind's GeoIP2 products. # License @@ -68,18 +68,26 @@ You can clone this repository and build it by running: $ git clone --recursive https://github.com/maxmind/libmaxminddb After cloning, run `./bootstrap` from the `libmaxminddb` directory and then -follow the instructions for installing from a named release tarball as described above. +follow the instructions for installing from a named release tarball as +described above. ## Using CMake We provide a CMake build script. This is primarily targeted at Windows users, but it can be used in other circumstances where the Autotools script does not work. - + + $ mkdir build && cd build + $ cmake .. $ cmake --build . $ ctest -V . $ cmake --build . --target install +When building with Visual Studio, you may build a multithreaded (MT/MTd) +runtime library, using the `MSVC_STATIC_RUNTIME` setting: + + $ cmake -DMSVC_STATIC_RUNTIME=ON -DBUILD_SHARED_LIBS=OFF .. + ## On Ubuntu via PPA MaxMind provides a PPA for recent version of Ubuntu. To add the PPA to your @@ -92,41 +100,34 @@ Then install the packages by running: $ sudo apt update $ sudo apt install libmaxminddb0 libmaxminddb-dev mmdb-bin -## On OS X via Homebrew +## On macOS via Homebrew or MacPorts -If you are on OS X and you have homebrew (see http://brew.sh/) you can install -libmaxminddb via brew. +You can install libmaxminddb on macOS using [Homebrew](https://brew.sh): $ brew install libmaxminddb +Or with [MacPorts](https://ports.macports.org/port/libmaxminddb): + + $ sudo port install libmaxminddb + # Bug Reports Please report bugs by filing an issue with our GitHub issue tracker at https://github.com/maxmind/libmaxminddb/issues -# Dev Tools - -We have a few development tools under the `dev-bin` directory to make -development easier. These are written in Perl or shell. They are: - -* `uncrustify-all.sh` - This runs `uncrustify` on all the code. Please run - this before submitting patches. -* `valgrind-all.pl` - This runs Valgrind on the tests and `mmdblookup` to - check for memory leaks. - # Creating a Release Tarball Use `make safedist` to check the resulting tarball. # Copyright and License -Copyright 2013-2021 MaxMind, Inc. +Copyright 2013-2022 MaxMind, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/deps/src/libmaxminddb/bin/CMakeLists.txt b/src/deps/src/libmaxminddb/bin/CMakeLists.txt index 9026be83b..b6eefb840 100644 --- a/src/deps/src/libmaxminddb/bin/CMakeLists.txt +++ b/src/deps/src/libmaxminddb/bin/CMakeLists.txt @@ -1,13 +1,20 @@ # getopt is required by mmdblookup which is not available by default on Windows -if(NOT WIN32) +# but available in mingw-64 toolchain by-default. + +if(NOT MSVC) add_executable(mmdblookup mmdblookup.c ) +# Otherwise 'undefined reference to WinMain' linker error happen due to wmain() + if(MINGW) + target_link_options(mmdblookup PRIVATE "-municode") + endif() + target_link_libraries(mmdblookup maxminddb pthread) install( TARGETS mmdblookup - RUNTIME DESTINATION bin + DESTINATION bin ) endif() diff --git a/src/deps/src/libmaxminddb/bin/Makefile.am b/src/deps/src/libmaxminddb/bin/Makefile.am index c00ba95b5..76aa4ed9c 100644 --- a/src/deps/src/libmaxminddb/bin/Makefile.am +++ b/src/deps/src/libmaxminddb/bin/Makefile.am @@ -4,6 +4,10 @@ AM_LDFLAGS = $(top_builddir)/src/libmaxminddb.la bin_PROGRAMS = mmdblookup +if WINDOWS +AM_LDFLAGS += -municode +endif + if !WINDOWS AM_CPPFLAGS += -pthread AM_LDFLAGS += -pthread diff --git a/src/deps/src/libmaxminddb/bin/mmdblookup.c b/src/deps/src/libmaxminddb/bin/mmdblookup.c index 929f868ac..1989c57ba 100644 --- a/src/deps/src/libmaxminddb/bin/mmdblookup.c +++ b/src/deps/src/libmaxminddb/bin/mmdblookup.c @@ -7,6 +7,7 @@ #ifndef _WIN32 #include #endif +#include #include #include #include @@ -139,7 +140,7 @@ int main(int argc, char **argv) { free((void *)lookup_path); - srand((int)time(NULL)); + srand((unsigned int)time(NULL)); #ifndef _WIN32 if (thread_count > 0) { @@ -223,6 +224,14 @@ static const char **get_options(int argc, static int help = 0; static int version = 0; +#ifdef _WIN32 + char *program = alloca(strlen(argv[0])); + _splitpath(argv[0], NULL, NULL, program, NULL); + _splitpath(argv[0], NULL, NULL, NULL, program + strlen(program)); +#else + char *program = basename(argv[0]); +#endif + while (1) { static struct option options[] = { {"file", required_argument, 0, 'f'}, @@ -259,24 +268,24 @@ static const char **get_options(int argc, } else if ('n' == opt_char) { version = 1; } else if ('b' == opt_char) { - *iterations = strtol(optarg, NULL, 10); + long const i = strtol(optarg, NULL, 10); + if (i > INT_MAX) { + usage(program, 1, "iterations exceeds maximum value"); + } + *iterations = (int)i; } else if ('h' == opt_char || '?' == opt_char) { help = 1; } else if (opt_char == 't') { - *thread_count = strtol(optarg, NULL, 10); + long const i = strtol(optarg, NULL, 10); + if (i > INT_MAX) { + usage(program, 1, "thread count exceeds maximum value"); + } + *thread_count = (int)i; } else if (opt_char == 'I') { *ip_file = optarg; } } -#ifdef _WIN32 - char *program = alloca(strlen(argv[0])); - _splitpath(argv[0], NULL, NULL, program, NULL); - _splitpath(argv[0], NULL, NULL, NULL, program + strlen(program)); -#else - char *program = basename(argv[0]); -#endif - if (help) { usage(program, 0, NULL); } @@ -295,7 +304,7 @@ static const char **get_options(int argc, } const char **lookup_path = - calloc((argc - optind) + 1, sizeof(const char *)); + calloc((size_t)(argc - optind) + 1, sizeof(const char *)); if (!lookup_path) { fprintf(stderr, "calloc(): %s\n", strerror(errno)); exit(1); @@ -452,12 +461,12 @@ static bool lookup_from_file(MMDB_s *const mmdb, if (dump) { fprintf(stdout, "%s:\n", buf); - int const status = + int const status2 = MMDB_dump_entry_data_list(stderr, entry_data_list, 0); - if (status != MMDB_SUCCESS) { + if (status2 != MMDB_SUCCESS) { fprintf(stderr, "MMDB_dump_entry_data_list(): %s\n", - MMDB_strerror(status)); + MMDB_strerror(status2)); fclose(fh); MMDB_free_entry_data_list(entry_data_list); return false; @@ -472,10 +481,10 @@ static bool lookup_from_file(MMDB_s *const mmdb, fprintf( stdout, - "Looked up %llu addresses in %.2f seconds. %.2f lookups per second.\n", + "Looked up %llu addresses in %.2f seconds. %.2Lf lookups per second.\n", i, seconds, - i / seconds); + (long double)i / seconds); return true; } @@ -594,15 +603,15 @@ static MMDB_lookup_result_s lookup_or_die(MMDB_s *mmdb, const char *ipstr) { MMDB_lookup_string(mmdb, ipstr, &gai_error, &mmdb_error); if (0 != gai_error) { +#ifdef _WIN32 + char const *const strerr = gai_strerrorA(gai_error); +#else + char const *const strerr = gai_strerror(gai_error); +#endif fprintf(stderr, "\n Error from call to getaddrinfo for %s - %s\n\n", ipstr, -#ifdef _WIN32 - gai_strerrorA(gai_error) -#else - gai_strerror(gai_error) -#endif - ); + strerr); exit(3); } @@ -643,7 +652,7 @@ static bool start_threaded_benchmark(MMDB_s *const mmdb, int const thread_count, int const iterations) { struct thread_info *const tinfo = - calloc(thread_count, sizeof(struct thread_info)); + calloc((size_t)thread_count, sizeof(struct thread_info)); if (!tinfo) { fprintf(stderr, "calloc(): %s\n", strerror(errno)); return false; @@ -685,7 +694,8 @@ static bool start_threaded_benchmark(MMDB_s *const mmdb, } long double const elapsed = end_time - start_time; - unsigned long long const total_ips = iterations * thread_count; + unsigned long long const total_ips = + (unsigned long long)(iterations * thread_count); long double rate = total_ips; if (elapsed != 0) { rate = total_ips / elapsed; @@ -717,7 +727,7 @@ static long double get_time(void) { fprintf(stderr, "clock_gettime(): %s\n", strerror(errno)); return -1; } - return tp.tv_sec + ((float)tp.tv_nsec / 1e9); + return (long double)tp.tv_sec + ((float)tp.tv_nsec / 1e9); #else time_t t = time(NULL); if (t == (time_t)-1) { diff --git a/src/deps/src/libmaxminddb/c_flag_overrides.cmake b/src/deps/src/libmaxminddb/c_flag_overrides.cmake new file mode 100644 index 000000000..26ff1d19e --- /dev/null +++ b/src/deps/src/libmaxminddb/c_flag_overrides.cmake @@ -0,0 +1,7 @@ +if(MSVC) + set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") + set(CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG") + set(CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG") + set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG") +endif() + diff --git a/src/deps/src/libmaxminddb/configure.ac b/src/deps/src/libmaxminddb/configure.ac index 67724715f..b1ed796ef 100644 --- a/src/deps/src/libmaxminddb/configure.ac +++ b/src/deps/src/libmaxminddb/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([libmaxminddb], [1.5.2], [support@maxmind.com]) +AC_INIT([libmaxminddb], [1.7.1], [support@maxmind.com]) AC_CONFIG_SRCDIR([include/maxminddb.h]) AC_CONFIG_HEADERS([config.h include/maxminddb_config.h]) diff --git a/src/deps/src/libmaxminddb/cxx_flag_overrides.cmake b/src/deps/src/libmaxminddb/cxx_flag_overrides.cmake new file mode 100644 index 000000000..603f72f95 --- /dev/null +++ b/src/deps/src/libmaxminddb/cxx_flag_overrides.cmake @@ -0,0 +1,6 @@ +if(MSVC) + set(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") + set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG") + set(CMAKE_CXX_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG") +endif() diff --git a/src/deps/src/libmaxminddb/dev-bin/release.sh b/src/deps/src/libmaxminddb/dev-bin/release.sh index 71f94c398..4a713e9b8 100755 --- a/src/deps/src/libmaxminddb/dev-bin/release.sh +++ b/src/deps/src/libmaxminddb/dev-bin/release.sh @@ -115,8 +115,4 @@ popd git push -message="$version - -$notes" - -hub release create -a "$dist" -m "$message" "$version" +gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$version" "$dist" diff --git a/src/deps/src/libmaxminddb/doc/libmaxminddb.md b/src/deps/src/libmaxminddb/doc/libmaxminddb.md index 6e841cbc9..431d80541 100644 --- a/src/deps/src/libmaxminddb/doc/libmaxminddb.md +++ b/src/deps/src/libmaxminddb/doc/libmaxminddb.md @@ -93,11 +93,11 @@ typedef struct MMDB_entry_data_list_s { # DESCRIPTION The libmaxminddb library provides functions for working MaxMind DB files. See -http://maxmind.github.io/MaxMind-DB/ for the MaxMind DB format specification. -The database and results are all represented by different data structures. -Databases are opened by calling `MMDB_open()`. You can look up IP addresses as -a string with `MMDB_lookup_string()` or as a pointer to a `sockaddr` -structure with `MMDB_lookup_sockaddr()`. +https://maxmind.github.io/MaxMind-DB/ for the MaxMind DB format +specification. The database and results are all represented by different +data structures. Databases are opened by calling `MMDB_open()`. You can +look up IP addresses as a string with `MMDB_lookup_string()` or as a +pointer to a `sockaddr` structure with `MMDB_lookup_sockaddr()`. If the lookup finds the IP address in the database, it returns a `MMDB_lookup_result_s` structure. If that structure indicates that the database @@ -878,13 +878,13 @@ Rolsky (drolsky@maxmind.com). # COPYRIGHT AND LICENSE -Copyright 2013-2014 MaxMind, Inc. +Copyright 2013-2022 MaxMind, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/deps/src/libmaxminddb/doc/mmdblookup.md b/src/deps/src/libmaxminddb/doc/mmdblookup.md index 2d7000522..6278d11a2 100644 --- a/src/deps/src/libmaxminddb/doc/mmdblookup.md +++ b/src/deps/src/libmaxminddb/doc/mmdblookup.md @@ -84,13 +84,13 @@ Rolsky (drolsky@maxmind.com). # COPYRIGHT AND LICENSE -Copyright 2013-2014 MaxMind, Inc. +Copyright 2013-2022 MaxMind, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/deps/src/libmaxminddb/include/maxminddb.h b/src/deps/src/libmaxminddb/include/maxminddb.h index 0e4c096de..4002ec660 100644 --- a/src/deps/src/libmaxminddb/include/maxminddb.h +++ b/src/deps/src/libmaxminddb/include/maxminddb.h @@ -28,7 +28,7 @@ extern "C" { #include #include /* libmaxminddb package version from configure */ -#define PACKAGE_VERSION "1.5.2" +#define PACKAGE_VERSION "1.7.1" typedef ADDRESS_FAMILY sa_family_t; diff --git a/src/deps/src/libmaxminddb/src/Makefile.am b/src/deps/src/libmaxminddb/src/Makefile.am index 6d57acaae..6d86368fb 100644 --- a/src/deps/src/libmaxminddb/src/Makefile.am +++ b/src/deps/src/libmaxminddb/src/Makefile.am @@ -5,6 +5,10 @@ lib_LTLIBRARIES = libmaxminddb.la libmaxminddb_la_SOURCES = maxminddb.c maxminddb-compat-util.h \ data-pool.c data-pool.h libmaxminddb_la_LDFLAGS = -version-info 0:7:0 -export-symbols-regex '^MMDB_.*' +if WINDOWS +libmaxminddb_la_LDFLAGS += -no-undefined +endif + include_HEADERS = $(top_srcdir)/include/maxminddb.h pkgconfig_DATA = libmaxminddb.pc diff --git a/src/deps/src/libmaxminddb/src/libmaxminddb.pc.in b/src/deps/src/libmaxminddb/src/libmaxminddb.pc.in index 00ced3ba9..c695cf915 100644 --- a/src/deps/src/libmaxminddb/src/libmaxminddb.pc.in +++ b/src/deps/src/libmaxminddb/src/libmaxminddb.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: libmaxminddb Description: C library for the MaxMind DB file format -URL: http://maxmind.github.io/libmaxminddb/ +URL: https://maxmind.github.io/libmaxminddb/ Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lmaxminddb Cflags: -I${includedir} diff --git a/src/deps/src/libmaxminddb/src/maxminddb-compat-util.h b/src/deps/src/libmaxminddb/src/maxminddb-compat-util.h index 5d7199439..586bbce7f 100644 --- a/src/deps/src/libmaxminddb/src/maxminddb-compat-util.h +++ b/src/deps/src/libmaxminddb/src/maxminddb-compat-util.h @@ -42,9 +42,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -static void * +static const void * mmdb_memmem(const void *l, size_t l_len, const void *s, size_t s_len) { - register char *cur, *last; + const char *cur, *last; const char *cl = (const char *)l; const char *cs = (const char *)s; @@ -61,9 +61,9 @@ mmdb_memmem(const void *l, size_t l_len, const void *s, size_t s_len) { return memchr(l, (int)*cs, l_len); /* the last position where its possible to find "s" in "l" */ - last = (char *)cl + l_len - s_len; + last = cl + l_len - s_len; - for (cur = (char *)cl; cur <= last; cur++) + for (cur = cl; cur <= last; cur++) if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0) return cur; diff --git a/src/deps/src/libmaxminddb/src/maxminddb.c b/src/deps/src/libmaxminddb/src/maxminddb.c index 5e97426cf..7da1d340a 100644 --- a/src/deps/src/libmaxminddb/src/maxminddb.c +++ b/src/deps/src/libmaxminddb/src/maxminddb.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -152,7 +153,7 @@ static int populate_description_metadata(MMDB_s *mmdb, MMDB_entry_s *metadata_start); static int resolve_any_address(const char *ipstr, struct addrinfo **addresses); static int find_address_in_search_tree(const MMDB_s *const mmdb, - uint8_t *address, + uint8_t const *address, sa_family_t address_family, MMDB_lookup_result_s *result); static record_info_s record_info_for_database(const MMDB_s *const mmdb); @@ -162,7 +163,7 @@ static uint32_t get_left_28_bit_record(const uint8_t *record); static uint32_t get_right_28_bit_record(const uint8_t *record); static uint32_t data_section_offset_for_record(const MMDB_s *const mmdb, uint64_t record); -static int path_length(va_list va_path); +static size_t path_length(va_list va_path); static int lookup_path_in_array(const char *path_elem, const MMDB_s *const mmdb, MMDB_entry_data_s *entry_data); @@ -201,7 +202,7 @@ dump_entry_data_list(FILE *stream, int indent, int *status); static void print_indentation(FILE *stream, int i); -static char *bytes_to_hex(uint8_t *bytes, uint32_t size); +static char *bytes_to_hex(uint8_t const *bytes, uint32_t size); #define CHECKED_DECODE_ONE(mmdb, offset, entry_data) \ do { \ @@ -406,28 +407,39 @@ cleanup:; #else // _WIN32 static int map_file(MMDB_s *const mmdb) { - ssize_t size; int status = MMDB_SUCCESS; - int flags = O_RDONLY; + int o_flags = O_RDONLY; #ifdef O_CLOEXEC - flags |= O_CLOEXEC; + o_flags |= O_CLOEXEC; #endif - int fd = open(mmdb->filename, flags); - struct stat s; - if (fd < 0 || fstat(fd, &s)) { + int fd = open(mmdb->filename, o_flags); + if (fd < 0) { status = MMDB_FILE_OPEN_ERROR; goto cleanup; } - size = s.st_size; - if (size < 0 || size != s.st_size) { +#if defined(FD_CLOEXEC) && !defined(O_CLOEXEC) + int fd_flags = fcntl(fd, F_GETFD); + if (fd_flags >= 0) { + fcntl(fd, F_SETFD, fd_flags | FD_CLOEXEC); + } +#endif + + struct stat s; + if (fstat(fd, &s)) { + status = MMDB_FILE_OPEN_ERROR; + goto cleanup; + } + + off_t size = s.st_size; + if (size < 0 || size > SSIZE_MAX) { status = MMDB_OUT_OF_MEMORY_ERROR; goto cleanup; } uint8_t *file_content = - (uint8_t *)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); + (uint8_t *)mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, fd, 0); if (MAP_FAILED == file_content) { if (ENOMEM == errno) { status = MMDB_OUT_OF_MEMORY_ERROR; @@ -437,7 +449,7 @@ static int map_file(MMDB_s *const mmdb) { goto cleanup; } - mmdb->file_size = size; + mmdb->file_size = (ssize_t)size; mmdb->file_content = file_content; cleanup:; @@ -459,12 +471,16 @@ static const uint8_t *find_metadata(const uint8_t *file_content, ssize_t max_size = file_size > METADATA_BLOCK_MAX_SIZE ? METADATA_BLOCK_MAX_SIZE : file_size; + if (max_size < 0) { + return NULL; + } - uint8_t *search_area = (uint8_t *)(file_content + (file_size - max_size)); - uint8_t *start = search_area; - uint8_t *tmp; + uint8_t const *search_area = (file_content + (file_size - max_size)); + uint8_t const *start = search_area; + uint8_t const *tmp; do { - tmp = mmdb_memmem(search_area, max_size, METADATA_MARKER, marker_len); + tmp = mmdb_memmem( + search_area, (size_t)max_size, METADATA_MARKER, marker_len); if (NULL != tmp) { max_size -= tmp - search_area; @@ -671,7 +687,7 @@ value_for_key_as_string(MMDB_entry_s *start, char *key, char const **value) { type_num_to_name(entry_data.type)); return MMDB_INVALID_METADATA_ERROR; } - *value = mmdb_strndup((char *)entry_data.utf8_string, entry_data.data_size); + *value = mmdb_strndup(entry_data.utf8_string, entry_data.data_size); if (NULL == *value) { return MMDB_OUT_OF_MEMORY_ERROR; } @@ -719,9 +735,8 @@ static int populate_languages_metadata(MMDB_s *mmdb, return MMDB_INVALID_METADATA_ERROR; } - mmdb->metadata.languages.names[i] = - mmdb_strndup((char *)member->entry_data.utf8_string, - member->entry_data.data_size); + mmdb->metadata.languages.names[i] = mmdb_strndup( + member->entry_data.utf8_string, member->entry_data.data_size); if (NULL == mmdb->metadata.languages.names[i]) { return MMDB_OUT_OF_MEMORY_ERROR; @@ -803,9 +818,8 @@ static int populate_description_metadata(MMDB_s *mmdb, goto cleanup; } - mmdb->metadata.description.descriptions[i]->language = - mmdb_strndup((char *)member->entry_data.utf8_string, - member->entry_data.data_size); + mmdb->metadata.description.descriptions[i]->language = mmdb_strndup( + member->entry_data.utf8_string, member->entry_data.data_size); if (NULL == mmdb->metadata.description.descriptions[i]->language) { status = MMDB_OUT_OF_MEMORY_ERROR; @@ -819,9 +833,8 @@ static int populate_description_metadata(MMDB_s *mmdb, goto cleanup; } - mmdb->metadata.description.descriptions[i]->description = - mmdb_strndup((char *)member->entry_data.utf8_string, - member->entry_data.data_size); + mmdb->metadata.description.descriptions[i]->description = mmdb_strndup( + member->entry_data.utf8_string, member->entry_data.data_size); if (NULL == mmdb->metadata.description.descriptions[i]->description) { status = MMDB_OUT_OF_MEMORY_ERROR; @@ -879,22 +892,24 @@ MMDB_lookup_result_s MMDB_lookup_sockaddr(const MMDB_s *const mmdb, .netmask = 0, .entry = {.mmdb = mmdb, .offset = 0}}; - uint8_t mapped_address[16], *address; + uint8_t mapped_address[16]; + uint8_t const *address; if (mmdb->metadata.ip_version == 4) { if (sockaddr->sa_family == AF_INET6) { *mmdb_error = MMDB_IPV6_LOOKUP_IN_IPV4_DATABASE_ERROR; return result; } - address = (uint8_t *)&((struct sockaddr_in *)sockaddr)->sin_addr.s_addr; + address = (uint8_t const *)&((struct sockaddr_in const *)sockaddr) + ->sin_addr.s_addr; } else { if (sockaddr->sa_family == AF_INET6) { - address = (uint8_t *)&((struct sockaddr_in6 *)sockaddr) + address = (uint8_t const *)&((struct sockaddr_in6 const *)sockaddr) ->sin6_addr.s6_addr; } else { address = mapped_address; - memset(address, 0, 12); - memcpy(address + 12, - &((struct sockaddr_in *)sockaddr)->sin_addr.s_addr, + memset(mapped_address, 0, 12); + memcpy(mapped_address + 12, + &((struct sockaddr_in const *)sockaddr)->sin_addr.s_addr, 4); } } @@ -906,7 +921,7 @@ MMDB_lookup_result_s MMDB_lookup_sockaddr(const MMDB_s *const mmdb, } static int find_address_in_search_tree(const MMDB_s *const mmdb, - uint8_t *address, + uint8_t const *address, sa_family_t address_family, MMDB_lookup_result_s *result) { record_info_s record_info = record_info_for_database(mmdb); @@ -1040,7 +1055,7 @@ static uint8_t record_type(const MMDB_s *const mmdb, uint64_t record) { static uint32_t get_left_28_bit_record(const uint8_t *record) { return record[0] * 65536 + record[1] * 256 + record[2] + - ((record[3] & 0xf0) << 20); + (uint32_t)((record[3] & 0xf0) << 20); } static uint32_t get_right_28_bit_record(const uint8_t *record) { @@ -1104,13 +1119,13 @@ int MMDB_get_value(MMDB_entry_s *const start, int MMDB_vget_value(MMDB_entry_s *const start, MMDB_entry_data_s *const entry_data, va_list va_path) { - int length = path_length(va_path); + size_t length = path_length(va_path); const char *path_elem; int i = 0; - MAYBE_CHECK_SIZE_OVERFLOW(length, - SIZE_MAX / sizeof(const char *) - 1, - MMDB_INVALID_METADATA_ERROR); + if (length == SIZE_MAX) { + return MMDB_INVALID_METADATA_ERROR; + } const char **path = calloc(length + 1, sizeof(const char *)); if (NULL == path) { @@ -1125,18 +1140,17 @@ int MMDB_vget_value(MMDB_entry_s *const start, int status = MMDB_aget_value(start, entry_data, path); - free((char **)path); + free(path); return status; } -static int path_length(va_list va_path) { - int i = 0; - const char *ignore; +static size_t path_length(va_list va_path) { + size_t i = 0; va_list path_copy; va_copy(path_copy, va_path); - while (NULL != (ignore = va_arg(path_copy, char *))) { + while (NULL != va_arg(path_copy, char *)) { i++; } @@ -1209,7 +1223,7 @@ static int lookup_path_in_array(const char *path_elem, int saved_errno = errno; errno = 0; - int array_index = strtol(path_elem, &first_invalid, 10); + long array_index = strtol(path_elem, &first_invalid, 10); if (ERANGE == errno) { errno = saved_errno; return MMDB_INVALID_LOOKUP_PATH_ERROR; @@ -1224,11 +1238,11 @@ static int lookup_path_in_array(const char *path_elem, } } - if (*first_invalid || (uint32_t)array_index >= size) { + if (*first_invalid || (unsigned long)array_index >= size) { return MMDB_LOOKUP_PATH_DOES_NOT_MATCH_DATA_ERROR; } - for (int i = 0; i < array_index; i++) { + for (long i = 0; i < array_index; i++) { /* We don't want to follow a pointer here. If the next element is a * pointer we simply skip it and keep going */ CHECKED_DECODE_ONE(mmdb, entry_data->offset_to_next, entry_data); @@ -1394,7 +1408,7 @@ static int decode_one(const MMDB_s *const mmdb, DEBUG_MSGF("Extended type: %i (%s)", type, type_num_to_name(type)); } - entry_data->type = type; + entry_data->type = (uint32_t)type; if (type == MMDB_DATA_TYPE_POINTER) { uint8_t psize = ((ctrl >> 3) & 3) + 1; @@ -1450,6 +1464,7 @@ static int decode_one(const MMDB_s *const mmdb, } size = 65821 + get_uint24(&mem[offset]); offset += 3; + break; default: break; } @@ -1485,28 +1500,28 @@ static int decode_one(const MMDB_s *const mmdb, DEBUG_MSGF("uint16 of size %d", size); return MMDB_INVALID_DATA_ERROR; } - entry_data->uint16 = (uint16_t)get_uintX(&mem[offset], size); + entry_data->uint16 = (uint16_t)get_uintX(&mem[offset], (int)size); DEBUG_MSGF("uint16 value: %u", entry_data->uint16); } else if (type == MMDB_DATA_TYPE_UINT32) { if (size > 4) { DEBUG_MSGF("uint32 of size %d", size); return MMDB_INVALID_DATA_ERROR; } - entry_data->uint32 = (uint32_t)get_uintX(&mem[offset], size); + entry_data->uint32 = (uint32_t)get_uintX(&mem[offset], (int)size); DEBUG_MSGF("uint32 value: %u", entry_data->uint32); } else if (type == MMDB_DATA_TYPE_INT32) { if (size > 4) { DEBUG_MSGF("int32 of size %d", size); return MMDB_INVALID_DATA_ERROR; } - entry_data->int32 = get_sintX(&mem[offset], size); + entry_data->int32 = get_sintX(&mem[offset], (int)size); DEBUG_MSGF("int32 value: %i", entry_data->int32); } else if (type == MMDB_DATA_TYPE_UINT64) { if (size > 8) { DEBUG_MSGF("uint64 of size %d", size); return MMDB_INVALID_DATA_ERROR; } - entry_data->uint64 = get_uintX(&mem[offset], size); + entry_data->uint64 = get_uintX(&mem[offset], (int)size); DEBUG_MSGF("uint64 value: %" PRIu64, entry_data->uint64); } else if (type == MMDB_DATA_TYPE_UINT128) { if (size > 16) { @@ -1519,7 +1534,7 @@ static int decode_one(const MMDB_s *const mmdb, memcpy(entry_data->uint128 + 16 - size, &mem[offset], size); } #else - entry_data->uint128 = get_uint128(&mem[offset], size); + entry_data->uint128 = get_uint128(&mem[offset], (int)size); #endif } else if (type == MMDB_DATA_TYPE_FLOAT) { if (size != 4) { @@ -1538,7 +1553,7 @@ static int decode_one(const MMDB_s *const mmdb, entry_data->double_value = get_ieee754_double(&mem[offset]); DEBUG_MSGF("double value: %f", entry_data->double_value); } else if (type == MMDB_DATA_TYPE_UTF8_STRING) { - entry_data->utf8_string = size == 0 ? "" : (char *)&mem[offset]; + entry_data->utf8_string = size == 0 ? "" : (char const *)&mem[offset]; entry_data->data_size = size; #ifdef MMDB_DEBUG char *string = @@ -1566,13 +1581,15 @@ get_ptr_from(uint8_t ctrl, uint8_t const *const ptr, int ptr_size) { uint32_t new_offset; switch (ptr_size) { case 1: - new_offset = ((ctrl & 7) << 8) + ptr[0]; + new_offset = (uint32_t)((ctrl & 7) << 8) + ptr[0]; break; case 2: - new_offset = 2048 + ((ctrl & 7) << 16) + (ptr[0] << 8) + ptr[1]; + new_offset = 2048 + (uint32_t)((ctrl & 7) << 16) + + (uint32_t)(ptr[0] << 8) + ptr[1]; break; case 3: - new_offset = 2048 + 524288 + ((ctrl & 7) << 24) + get_uint24(ptr); + new_offset = + 2048 + 524288 + (uint32_t)((ctrl & 7) << 24) + get_uint24(ptr); break; case 4: default: @@ -1720,7 +1737,7 @@ static int get_entry_data_list(const MMDB_s *const mmdb, static float get_ieee754_float(const uint8_t *restrict p) { volatile float f; - uint8_t *q = (void *)&f; + volatile uint8_t *q = (volatile void *)&f; /* Windows builds don't use autoconf but we can assume they're all * little-endian. */ #if MMDB_LITTLE_ENDIAN || _WIN32 @@ -1736,7 +1753,7 @@ static float get_ieee754_float(const uint8_t *restrict p) { static double get_ieee754_double(const uint8_t *restrict p) { volatile double d; - uint8_t *q = (void *)&d; + volatile uint8_t *q = (volatile void *)&d; #if MMDB_LITTLE_ENDIAN || _WIN32 q[7] = p[0]; q[6] = p[1]; @@ -1791,7 +1808,12 @@ static void free_mmdb_struct(MMDB_s *const mmdb) { } if (NULL != mmdb->filename) { +// This is a const char * that we need to free, which isn't valid. However it +// would mean changing the public API to fix this. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-qual" FREE_AND_SET_NULL(mmdb->filename); +#pragma clang diagnostic pop } if (NULL != mmdb->file_content) { #ifdef _WIN32 @@ -1800,12 +1822,22 @@ static void free_mmdb_struct(MMDB_s *const mmdb) { * to cleanup then. */ WSACleanup(); #else - munmap((void *)mmdb->file_content, mmdb->file_size); +// This is a const char * that we need to free, which isn't valid. However it +// would mean changing the public API to fix this. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-qual" + munmap((void *)mmdb->file_content, (size_t)mmdb->file_size); +#pragma clang diagnostic pop #endif } if (NULL != mmdb->metadata.database_type) { +// This is a const char * that we need to free, which isn't valid. However it +// would mean changing the public API to fix this. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-qual" FREE_AND_SET_NULL(mmdb->metadata.database_type); +#pragma clang diagnostic pop } free_languages_metadata(mmdb); @@ -1818,7 +1850,12 @@ static void free_languages_metadata(MMDB_s *mmdb) { } for (size_t i = 0; i < mmdb->metadata.languages.count; i++) { +// This is a const char * that we need to free, which isn't valid. However it +// would mean changing the public API to fix this. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-qual" FREE_AND_SET_NULL(mmdb->metadata.languages.names[i]); +#pragma clang diagnostic pop } FREE_AND_SET_NULL(mmdb->metadata.languages.names); } @@ -1831,14 +1868,24 @@ static void free_descriptions_metadata(MMDB_s *mmdb) { for (size_t i = 0; i < mmdb->metadata.description.count; i++) { if (NULL != mmdb->metadata.description.descriptions[i]) { if (NULL != mmdb->metadata.description.descriptions[i]->language) { +// This is a const char * that we need to free, which isn't valid. However it +// would mean changing the public API to fix this. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-qual" FREE_AND_SET_NULL( mmdb->metadata.description.descriptions[i]->language); +#pragma clang diagnostic pop } if (NULL != mmdb->metadata.description.descriptions[i]->description) { +// This is a const char * that we need to free, which isn't valid. However it +// would mean changing the public API to fix this. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-qual" FREE_AND_SET_NULL( mmdb->metadata.description.descriptions[i]->description); +#pragma clang diagnostic pop } FREE_AND_SET_NULL(mmdb->metadata.description.descriptions[i]); } @@ -1879,9 +1926,9 @@ dump_entry_data_list(FILE *stream, *status = MMDB_INVALID_DATA_ERROR; return NULL; } - char *key = mmdb_strndup( - (char *)entry_data_list->entry_data.utf8_string, - entry_data_list->entry_data.data_size); + char *key = + mmdb_strndup(entry_data_list->entry_data.utf8_string, + entry_data_list->entry_data.data_size); if (NULL == key) { *status = MMDB_OUT_OF_MEMORY_ERROR; return NULL; @@ -1926,9 +1973,8 @@ dump_entry_data_list(FILE *stream, fprintf(stream, "]\n"); } break; case MMDB_DATA_TYPE_UTF8_STRING: { - char *string = - mmdb_strndup((char *)entry_data_list->entry_data.utf8_string, - entry_data_list->entry_data.data_size); + char *string = mmdb_strndup(entry_data_list->entry_data.utf8_string, + entry_data_list->entry_data.data_size); if (NULL == string) { *status = MMDB_OUT_OF_MEMORY_ERROR; return NULL; @@ -1940,7 +1986,7 @@ dump_entry_data_list(FILE *stream, } break; case MMDB_DATA_TYPE_BYTES: { char *hex_string = - bytes_to_hex((uint8_t *)entry_data_list->entry_data.bytes, + bytes_to_hex(entry_data_list->entry_data.bytes, entry_data_list->entry_data.data_size); if (NULL == hex_string) { @@ -2032,12 +2078,12 @@ dump_entry_data_list(FILE *stream, static void print_indentation(FILE *stream, int i) { char buffer[1024]; int size = i >= 1024 ? 1023 : i; - memset(buffer, 32, size); + memset(buffer, 32, (size_t)size); buffer[size] = '\0'; fputs(buffer, stream); } -static char *bytes_to_hex(uint8_t *bytes, uint32_t size) { +static char *bytes_to_hex(uint8_t const *bytes, uint32_t size) { char *hex_string; MAYBE_CHECK_SIZE_OVERFLOW(size, SIZE_MAX / 2 - 1, NULL); diff --git a/src/deps/src/libmaxminddb/t/CMakeLists.txt b/src/deps/src/libmaxminddb/t/CMakeLists.txt index afbe484b8..86252f6e3 100644 --- a/src/deps/src/libmaxminddb/t/CMakeLists.txt +++ b/src/deps/src/libmaxminddb/t/CMakeLists.txt @@ -42,5 +42,5 @@ foreach(TEST_TARGET_NAME ${TEST_TARGET_NAMES}) target_link_libraries(${TEST_TARGET_NAME} ${CMAKE_THREAD_LIBS_INIT}) endif() - add_test(${TEST_TARGET_NAME} ${TEST_TARGET_NAME}) + add_test( NAME ${TEST_TARGET_NAME} COMMAND ${TEST_TARGET_NAME} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/t) endforeach() diff --git a/src/deps/src/libmaxminddb/t/bad_pointers_t.c b/src/deps/src/libmaxminddb/t/bad_pointers_t.c index e0fe3a816..6247539a4 100644 --- a/src/deps/src/libmaxminddb/t/bad_pointers_t.c +++ b/src/deps/src/libmaxminddb/t/bad_pointers_t.c @@ -2,9 +2,9 @@ void run_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-broken-pointers-24.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); { const char *ip = "1.1.1.16"; diff --git a/src/deps/src/libmaxminddb/t/basic_lookup_t.c b/src/deps/src/libmaxminddb/t/basic_lookup_t.c index 8baabbeb1..adb4349e4 100644 --- a/src/deps/src/libmaxminddb/t/basic_lookup_t.c +++ b/src/deps/src/libmaxminddb/t/basic_lookup_t.c @@ -36,7 +36,7 @@ void test_one_result(MMDB_s *mmdb, } else { // When looking up IPv4 addresses in a mixed DB the result will be // something like "::1.2.3.4", not just "1.2.3.4". - int maxlen = strlen(expect) + 3; + size_t maxlen = strlen(expect) + 3; real_expect = malloc(maxlen); if (!real_expect) { BAIL_OUT("could not allocate memory"); @@ -77,12 +77,12 @@ void run_ipX_tests(const char *filename, int missing_ips_length, const char *pairs[][2], int pairs_rows) { - const char *path = test_database_path(filename); + char *path = test_database_path(filename); int mode = Current_Mode; const char *mode_desc = Current_Mode_Description; MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); char desc_suffix[500]; snprintf(desc_suffix, 500, "%s - %s", filename, mode_desc); @@ -180,12 +180,12 @@ void all_record_sizes(int mode, const char *description) { static void test_big_lookup(void) { const char *const db_filename = "GeoIP2-Precision-Enterprise-Test.mmdb"; - const char *const db_path = test_database_path(db_filename); + char *db_path = test_database_path(db_filename); ok(db_path != NULL, "got database path"); MMDB_s *const mmdb = open_ok(db_path, MMDB_MODE_MMAP, "mmap mode"); ok(mmdb != NULL, "opened MMDB"); - free((char *)db_path); + free(db_path); int gai_err = 0, mmdb_err = 0; const char *const ip_address = "81.2.69.160"; diff --git a/src/deps/src/libmaxminddb/t/compile_c++_t.pl b/src/deps/src/libmaxminddb/t/compile_c++_t.pl index ec1d88640..ffb6d5369 100755 --- a/src/deps/src/libmaxminddb/t/compile_c++_t.pl +++ b/src/deps/src/libmaxminddb/t/compile_c++_t.pl @@ -28,7 +28,11 @@ int main(int argc, char *argv[]) { const char *fname = "$test_db"; MMDB_s mmdb; - return MMDB_open(fname, MMDB_MODE_MMAP, &mmdb); + if (MMDB_open(fname, MMDB_MODE_MMAP, &mmdb) != MMDB_SUCCESS) { + return 1; + } + MMDB_close(&mmdb); + return 0; } EOF @@ -45,8 +49,17 @@ my $include_dir = abs_path("$Bin/../include"); my $lib_dir = abs_path("$Bin/../src/.libs"); my $cxx = $ENV{CXX} || 'c++'; +my @cxxflags = $ENV{CXXFLAGS} ? ( split ' ', $ENV{CXXFLAGS} ) : (); _test_cmd( - [ $cxx, $file, "-I$include_dir", "-L$lib_dir", "-lmaxminddb", "-o$exe" ], + [ + $cxx, + $file, + @cxxflags, + "-I$include_dir", + "-L$lib_dir", + "-lmaxminddb", + "-o$exe", + ], qr/^$/, q{}, 0, diff --git a/src/deps/src/libmaxminddb/t/data_entry_list_t.c b/src/deps/src/libmaxminddb/t/data_entry_list_t.c index 2b595db76..76eb2266e 100644 --- a/src/deps/src/libmaxminddb/t/data_entry_list_t.c +++ b/src/deps/src/libmaxminddb/t/data_entry_list_t.c @@ -161,7 +161,7 @@ test_mapX_key_value_pair(MMDB_entry_data_list_s *entry_data_list) { "==", MMDB_DATA_TYPE_UTF8_STRING, "found a map key in 'map{mapX}'"); - const char *mapX_key_name = dup_entry_string_or_bail(mapX_key->entry_data); + char *mapX_key_name = dup_entry_string_or_bail(mapX_key->entry_data); if (strcmp(mapX_key_name, "utf8_stringX") == 0) { MMDB_entry_data_list_s *mapX_value = entry_data_list = @@ -170,18 +170,18 @@ test_mapX_key_value_pair(MMDB_entry_data_list_s *entry_data_list) { "==", MMDB_DATA_TYPE_UTF8_STRING, "'map{mapX}{utf8_stringX}' type is utf8_string"); - const char *utf8_stringX_value = + char *utf8_stringX_value = dup_entry_string_or_bail(mapX_value->entry_data); ok(strcmp(utf8_stringX_value, "hello") == 0, "map{mapX}{utf8_stringX} value is 'hello'"); - free((void *)utf8_stringX_value); + free(utf8_stringX_value); } else if (strcmp(mapX_key_name, "arrayX") == 0) { entry_data_list = test_arrayX_value(entry_data_list); } else { ok(0, "unknown key found in map{mapX} - %s", mapX_key_name); } - free((void *)mapX_key_name); + free(mapX_key_name); return entry_data_list; } @@ -203,10 +203,9 @@ test_map_value(MMDB_entry_data_list_s *entry_data_list) { "==", MMDB_DATA_TYPE_UTF8_STRING, "found a map key in 'map'"); - const char *map_key_1_name = - dup_entry_string_or_bail(map_key_1->entry_data); + char *map_key_1_name = dup_entry_string_or_bail(map_key_1->entry_data); ok(strcmp(map_key_1_name, "mapX") == 0, "key name is mapX"); - free((void *)map_key_1_name); + free(map_key_1_name); MMDB_entry_data_list_s *mapX = entry_data_list = entry_data_list->next; cmp_ok(mapX->entry_data.type, @@ -312,7 +311,7 @@ test_utf8_string_value(MMDB_entry_data_list_s *entry_data_list) { "==", MMDB_DATA_TYPE_UTF8_STRING, "'utf8_string' key's value is a string"); - const char *utf8_string = dup_entry_string_or_bail(value->entry_data); + char *utf8_string = dup_entry_string_or_bail(value->entry_data); // This is hex for "unicode! ☯ - ♫" as bytes char expect[19] = {0x75, 0x6e, @@ -323,29 +322,29 @@ test_utf8_string_value(MMDB_entry_data_list_s *entry_data_list) { 0x65, 0x21, 0x20, - 0xe2, - 0x98, - 0xaf, + (char)0xe2, + (char)0x98, + (char)0xaf, 0x20, 0x2d, 0x20, - 0xe2, - 0x99, - 0xab, + (char)0xe2, + (char)0x99, + (char)0xab, 0x00}; is(utf8_string, expect, "got expected value for utf8_string key"); - free((void *)utf8_string); + free(utf8_string); return entry_data_list; } void run_tests(int mode, const char *description) { const char *filename = "MaxMind-DB-test-decoder.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, description); - free((void *)path); + free(path); char *ip = "1.1.1.1"; MMDB_lookup_result_s result = @@ -385,7 +384,7 @@ void run_tests(int mode, const char *description) { MMDB_DATA_TYPE_UTF8_STRING, "found a map key"); - const char *key_name = dup_entry_string_or_bail(key->entry_data); + char *key_name = dup_entry_string_or_bail(key->entry_data); if (strcmp(key_name, "array") == 0) { entry_data_list = test_array_value(entry_data_list); } else if (strcmp(key_name, "boolean") == 0) { @@ -414,7 +413,7 @@ void run_tests(int mode, const char *description) { ok(0, "unknown key found in map - %s", key_name); } - free((void *)key_name); + free(key_name); } MMDB_free_entry_data_list(first); diff --git a/src/deps/src/libmaxminddb/t/data_types_t.c b/src/deps/src/libmaxminddb/t/data_types_t.c index fa2dde966..9a97c5c56 100644 --- a/src/deps/src/libmaxminddb/t/data_types_t.c +++ b/src/deps/src/libmaxminddb/t/data_types_t.c @@ -14,7 +14,7 @@ void test_all_data_types(MMDB_lookup_result_s *result, description, "utf8_string", NULL); - const char *string = mmdb_strndup(data.utf8_string, data.data_size); + char *string = mmdb_strndup(data.utf8_string, data.data_size); // This is hex for "unicode! ☯ - ♫" as bytes char expect[19] = {0x75, 0x6e, @@ -25,19 +25,19 @@ void test_all_data_types(MMDB_lookup_result_s *result, 0x65, 0x21, 0x20, - 0xe2, - 0x98, - 0xaf, + (char)0xe2, + (char)0x98, + (char)0xaf, 0x20, 0x2d, 0x20, - 0xe2, - 0x99, - 0xab, + (char)0xe2, + (char)0x99, + (char)0xab, 0x00}; is(string, expect, "got expected utf8_string value"); - free((char *)string); + free(string); } { @@ -67,7 +67,7 @@ void test_all_data_types(MMDB_lookup_result_s *result, MMDB_entry_data_s data = data_ok(result, MMDB_DATA_TYPE_BYTES, description, "bytes", NULL); uint8_t expect[] = {0x00, 0x00, 0x00, 0x2a}; - ok(memcmp((uint8_t *)data.bytes, expect, 4) == 0, + ok(memcmp(data.bytes, expect, 4) == 0, "bytes field has expected value"); } @@ -204,9 +204,9 @@ void test_all_data_types(MMDB_lookup_result_s *result, "mapX", "utf8_stringX", NULL); - const char *string = mmdb_strndup(data.utf8_string, data.data_size); + char *string = mmdb_strndup(data.utf8_string, data.data_size); is(string, "hello", "map{mapX}{utf8_stringX} is 'hello'"); - free((char *)string); + free(string); snprintf( description, 500, "map{mapX}{arrayX} for %s - %s", ip, mode_desc); @@ -417,7 +417,7 @@ void test_all_data_types_as_zero(MMDB_lookup_result_s *result, void run_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-decoder.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); // All of the remaining tests require an open mmdb @@ -426,7 +426,7 @@ void run_tests(int mode, const char *mode_desc) { return; } - free((void *)path); + free(path); { const char *ip = "not an ip"; diff --git a/src/deps/src/libmaxminddb/t/dump_t.c b/src/deps/src/libmaxminddb/t/dump_t.c index 4cb59af4d..dae32ef89 100644 --- a/src/deps/src/libmaxminddb/t/dump_t.c +++ b/src/deps/src/libmaxminddb/t/dump_t.c @@ -4,9 +4,9 @@ #ifdef HAVE_OPEN_MEMSTREAM void run_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-decoder.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); const char *ip = "1.1.1.1"; MMDB_lookup_result_s result = diff --git a/src/deps/src/libmaxminddb/t/external_symbols_t.pl b/src/deps/src/libmaxminddb/t/external_symbols_t.pl index e1301e8e1..6d4031d9e 100755 --- a/src/deps/src/libmaxminddb/t/external_symbols_t.pl +++ b/src/deps/src/libmaxminddb/t/external_symbols_t.pl @@ -5,12 +5,20 @@ use warnings; use FindBin qw( $Bin ); +_skip_tests_if_not_linux(); _skip_tests_if_required_modules_are_not_present(); _skip_tests_if_nm_is_not_present(); _test_libs_external_symbols(); done_testing(); +sub _skip_tests_if_not_linux { + return if $^O eq 'linux'; + + print "1..0 # skip all tests skipped - this test requires Linux.\n"; + exit 0; +} + sub _skip_tests_if_required_modules_are_not_present { eval <<'EOF'; use Test::More 0.88; diff --git a/src/deps/src/libmaxminddb/t/get_value_pointer_bug_t.c b/src/deps/src/libmaxminddb/t/get_value_pointer_bug_t.c index ebb91595c..2d1d52906 100644 --- a/src/deps/src/libmaxminddb/t/get_value_pointer_bug_t.c +++ b/src/deps/src/libmaxminddb/t/get_value_pointer_bug_t.c @@ -47,9 +47,9 @@ void test_one_ip(MMDB_s *mmdb, void run_tests(int mode, const char *mode_desc) { const char *filename = "GeoIP2-City-Test.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); /* This exercises a bug where the entire top-level value is a pointer to * another part of the data section. */ diff --git a/src/deps/src/libmaxminddb/t/get_value_t.c b/src/deps/src/libmaxminddb/t/get_value_t.c index e3720bb43..06dcf3b56 100644 --- a/src/deps/src/libmaxminddb/t/get_value_t.c +++ b/src/deps/src/libmaxminddb/t/get_value_t.c @@ -77,9 +77,9 @@ int call_vget_value(MMDB_entry_s *entry, MMDB_entry_data_s *entry_data, ...) { void test_simple_structure(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-decoder.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); const char *ip = "1.1.1.1"; MMDB_lookup_result_s result = @@ -242,9 +242,9 @@ void test_no_result(int status, void test_nested_structure(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-nested.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); const char *ip = "1.1.1.1"; MMDB_lookup_result_s result = diff --git a/src/deps/src/libmaxminddb/t/ipv4_start_cache_t.c b/src/deps/src/libmaxminddb/t/ipv4_start_cache_t.c index 3e13abcfa..cfd9f57fd 100644 --- a/src/deps/src/libmaxminddb/t/ipv4_start_cache_t.c +++ b/src/deps/src/libmaxminddb/t/ipv4_start_cache_t.c @@ -18,9 +18,9 @@ void test_one_ip(MMDB_s *mmdb, void run_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-no-ipv4-search-tree.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); test_one_ip(mmdb, "1.1.1.1", filename, mode_desc); test_one_ip(mmdb, "255.255.255.255", filename, mode_desc); diff --git a/src/deps/src/libmaxminddb/t/ipv6_lookup_in_ipv4_t.c b/src/deps/src/libmaxminddb/t/ipv6_lookup_in_ipv4_t.c index d42309170..0d80f1ea1 100644 --- a/src/deps/src/libmaxminddb/t/ipv6_lookup_in_ipv4_t.c +++ b/src/deps/src/libmaxminddb/t/ipv6_lookup_in_ipv4_t.c @@ -2,9 +2,9 @@ void run_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-ipv4-28.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); const char *ip = "::abcd"; int gai_error, mmdb_error; diff --git a/src/deps/src/libmaxminddb/t/maxminddb_test_helper.c b/src/deps/src/libmaxminddb/t/maxminddb_test_helper.c index 0bd53deff..7272c151e 100644 --- a/src/deps/src/libmaxminddb/t/maxminddb_test_helper.c +++ b/src/deps/src/libmaxminddb/t/maxminddb_test_helper.c @@ -26,7 +26,11 @@ void for_all_record_sizes(const char *filename_fmt, int size = sizes[i]; char filename[500]; +// This warning seems ok to ignore here in the tests. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wformat-nonliteral" snprintf(filename, 500, filename_fmt, size); +#pragma clang diagnostic pop char description[14]; snprintf(description, 14, "%i bit record", size); @@ -39,7 +43,7 @@ void for_all_modes(void (*tests)(int mode, const char *description)) { tests(MMDB_MODE_MMAP, "mmap mode"); } -const char *test_database_path(const char *filename) { +char *test_database_path(const char *filename) { char *test_db_dir; #ifdef _WIN32 test_db_dir = "../t/maxmind-db/test-data"; @@ -59,12 +63,11 @@ const char *test_database_path(const char *filename) { snprintf(path, 500, "%s/%s", test_db_dir, filename); - return (const char *)path; + return path; } -const char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data) { - const char *string = - mmdb_strndup(entry_data.utf8_string, entry_data.data_size); +char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data) { + char *string = mmdb_strndup(entry_data.utf8_string, entry_data.data_size); if (NULL == string) { BAIL_OUT("mmdb_strndup failed"); } @@ -85,7 +88,7 @@ MMDB_s *open_ok(const char *db_file, int mode, const char *mode_desc) { BAIL_OUT("could not allocate memory for our MMDB_s struct"); } - int status = MMDB_open(db_file, mode, mmdb); + int status = MMDB_open(db_file, (uint32_t)mode, mmdb); int is_ok = ok(MMDB_SUCCESS == status, "open %s status is success - %s", @@ -211,9 +214,9 @@ MMDB_entry_data_s data_ok(MMDB_lookup_result_s *result, "no error from call to MMDB_vget_value - %s", description)) { - if (!cmp_ok(data.type, + if (!cmp_ok((int)data.type, "==", - expect_type, + (int)expect_type, "got the expected data type - %s", description)) { diff --git a/src/deps/src/libmaxminddb/t/maxminddb_test_helper.h b/src/deps/src/libmaxminddb/t/maxminddb_test_helper.h index c08900cc0..a782daa1e 100644 --- a/src/deps/src/libmaxminddb/t/maxminddb_test_helper.h +++ b/src/deps/src/libmaxminddb/t/maxminddb_test_helper.h @@ -23,7 +23,7 @@ #include #endif -#if (_MSC_VER && _MSC_VER < 1900) +#if defined _MSC_VER && _MSC_VER < 1900 /* _snprintf has security issues, but I don't think it is worth worrying about for the unit tests. */ #define snprintf _snprintf @@ -45,8 +45,8 @@ extern void for_all_record_sizes(const char *filename_fmt, const char *filename, const char *description)); extern void for_all_modes(void (*tests)(int mode, const char *description)); -extern const char *test_database_path(const char *filename); -extern const char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data); +extern char *test_database_path(const char *filename); +extern char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data); extern MMDB_s *open_ok(const char *db_file, int mode, const char *mode_desc); extern MMDB_lookup_result_s lookup_string_ok(MMDB_s *mmdb, const char *ip, diff --git a/src/deps/src/libmaxminddb/t/metadata_pointers_t.c b/src/deps/src/libmaxminddb/t/metadata_pointers_t.c index 645be6ced..f3f9ff5cb 100644 --- a/src/deps/src/libmaxminddb/t/metadata_pointers_t.c +++ b/src/deps/src/libmaxminddb/t/metadata_pointers_t.c @@ -2,9 +2,9 @@ void run_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-metadata-pointers.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); char *repeated_string = "Lots of pointers in metadata"; diff --git a/src/deps/src/libmaxminddb/t/metadata_t.c b/src/deps/src/libmaxminddb/t/metadata_t.c index 696e3ecc9..8acf7c73b 100644 --- a/src/deps/src/libmaxminddb/t/metadata_t.c +++ b/src/deps/src/libmaxminddb/t/metadata_t.c @@ -101,18 +101,18 @@ test_languages_value(MMDB_entry_data_list_s *entry_data_list) { "==", MMDB_DATA_TYPE_UTF8_STRING, "first array entry is a UTF8_STRING"); - const char *lang0 = dup_entry_string_or_bail(idx0->entry_data); + char *lang0 = dup_entry_string_or_bail(idx0->entry_data); is(lang0, "en", "first language is en"); - free((void *)lang0); + free(lang0); MMDB_entry_data_list_s *idx1 = entry_data_list = entry_data_list->next; cmp_ok(idx1->entry_data.type, "==", MMDB_DATA_TYPE_UTF8_STRING, "second array entry is a UTF8_STRING"); - const char *lang1 = dup_entry_string_or_bail(idx1->entry_data); + char *lang1 = dup_entry_string_or_bail(idx1->entry_data); is(lang1, "zh", "second language is zh"); - free((void *)lang1); + free(lang1); return entry_data_list; } @@ -136,14 +136,14 @@ test_description_value(MMDB_entry_data_list_s *entry_data_list) { "==", MMDB_DATA_TYPE_UTF8_STRING, "found a map key in 'map'"); - const char *key_name = dup_entry_string_or_bail(key->entry_data); + char *key_name = dup_entry_string_or_bail(key->entry_data); MMDB_entry_data_list_s *value = entry_data_list = entry_data_list->next; cmp_ok(value->entry_data.type, "==", MMDB_DATA_TYPE_UTF8_STRING, "map value is a UTF8_STRING"); - const char *description = dup_entry_string_or_bail(value->entry_data); + char *description = dup_entry_string_or_bail(value->entry_data); if (strcmp(key_name, "en") == 0) { is(description, @@ -157,8 +157,8 @@ test_description_value(MMDB_entry_data_list_s *entry_data_list) { ok(0, "unknown key found in description map - %s", key_name); } - free((void *)key_name); - free((void *)description); + free(key_name); + free(description); } return entry_data_list; @@ -193,7 +193,7 @@ void test_metadata_as_data_entry_list(MMDB_s *mmdb, const char *mode_desc) { MMDB_DATA_TYPE_UTF8_STRING, "found a map key"); - const char *key_name = dup_entry_string_or_bail(key->entry_data); + char *key_name = dup_entry_string_or_bail(key->entry_data); if (strcmp(key_name, "node_count") == 0) { MMDB_entry_data_list_s *value = entry_data_list = entry_data_list->next; @@ -228,9 +228,9 @@ void test_metadata_as_data_entry_list(MMDB_s *mmdb, const char *mode_desc) { } else if (strcmp(key_name, "database_type") == 0) { MMDB_entry_data_list_s *value = entry_data_list = entry_data_list->next; - const char *type = dup_entry_string_or_bail(value->entry_data); + char *type = dup_entry_string_or_bail(value->entry_data); is(type, "Test", "type == Test"); - free((void *)type); + free(type); } else if (strcmp(key_name, "languages") == 0) { entry_data_list = test_languages_value(entry_data_list); } else if (strcmp(key_name, "description") == 0) { @@ -239,7 +239,7 @@ void test_metadata_as_data_entry_list(MMDB_s *mmdb, const char *mode_desc) { ok(0, "unknown key found in metadata map - %s", key_name); } - free((void *)key_name); + free(key_name); } MMDB_free_entry_data_list(first); @@ -247,7 +247,7 @@ void test_metadata_as_data_entry_list(MMDB_s *mmdb, const char *mode_desc) { void run_tests(int mode, const char *mode_desc) { const char *file = "MaxMind-DB-test-ipv4-24.mmdb"; - const char *path = test_database_path(file); + char *path = test_database_path(file); MMDB_s *mmdb = open_ok(path, mode, mode_desc); // All of the remaining tests require an open mmdb @@ -255,7 +255,7 @@ void run_tests(int mode, const char *mode_desc) { diag("could not open %s - skipping remaining tests", path); return; } - free((void *)path); + free(path); test_metadata(mmdb, mode_desc); test_metadata_as_data_entry_list(mmdb, mode_desc); diff --git a/src/deps/src/libmaxminddb/t/no_map_get_value_t.c b/src/deps/src/libmaxminddb/t/no_map_get_value_t.c index b7f75383f..8f5b79ea3 100644 --- a/src/deps/src/libmaxminddb/t/no_map_get_value_t.c +++ b/src/deps/src/libmaxminddb/t/no_map_get_value_t.c @@ -2,9 +2,9 @@ void run_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-string-value-entries.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); const char *ip = "1.1.1.1"; MMDB_lookup_result_s result = diff --git a/src/deps/src/libmaxminddb/t/read_node_t.c b/src/deps/src/libmaxminddb/t/read_node_t.c index 1db466b30..8941ade61 100644 --- a/src/deps/src/libmaxminddb/t/read_node_t.c +++ b/src/deps/src/libmaxminddb/t/read_node_t.c @@ -70,9 +70,9 @@ void run_read_node_tests(MMDB_s *mmdb, void run_24_bit_record_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-mixed-24.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); const uint32_t tests[7][5] = { {0, 1, MMDB_RECORD_TYPE_SEARCH_NODE, 242, MMDB_RECORD_TYPE_EMPTY}, @@ -126,9 +126,9 @@ void run_24_bit_record_tests(int mode, const char *mode_desc) { void run_28_bit_record_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-mixed-28.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); const uint32_t tests[7][5] = { {0, 1, MMDB_RECORD_TYPE_SEARCH_NODE, 242, MMDB_RECORD_TYPE_EMPTY}, @@ -182,9 +182,9 @@ void run_28_bit_record_tests(int mode, const char *mode_desc) { void run_32_bit_record_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-mixed-32.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); const uint32_t tests[7][5] = { {0, 1, MMDB_RECORD_TYPE_SEARCH_NODE, 242, MMDB_RECORD_TYPE_EMPTY}, diff --git a/src/deps/src/libmaxminddb/t/threads_t.c b/src/deps/src/libmaxminddb/t/threads_t.c index 8b9508749..7adf7a305 100644 --- a/src/deps/src/libmaxminddb/t/threads_t.c +++ b/src/deps/src/libmaxminddb/t/threads_t.c @@ -128,10 +128,10 @@ void process_result(test_result_s *result, void run_ipX_tests(MMDB_s *mmdb, const char *pairs[][2], int pairs_rows, - int mode, const char *mode_desc) { - pthread_t threads[pairs_rows]; - struct thread_arg thread_args[pairs_rows]; + pthread_t *threads = malloc((unsigned long)pairs_rows * sizeof(pthread_t)); + struct thread_arg *thread_args = + malloc((unsigned long)pairs_rows * sizeof(struct thread_arg)); for (int i = 0; i < pairs_rows; i += 1) { thread_args[i].thread_id = i; @@ -161,13 +161,16 @@ void run_ipX_tests(MMDB_s *mmdb, free(test_result); } } + + free(threads); + free(thread_args); } void run_tests(int mode, const char *mode_desc) { const char *filename = "MaxMind-DB-test-mixed-32.mmdb"; - const char *path = test_database_path(filename); + char *path = test_database_path(filename); MMDB_s *mmdb = open_ok(path, mode, mode_desc); - free((void *)path); + free(path); const char *pairs[18][2] = { {"1.1.1.1", "::1.1.1.1"}, @@ -190,7 +193,7 @@ void run_tests(int mode, const char *mode_desc) { {"::2:0:59", "::2:0:58"}, }; - run_ipX_tests(mmdb, pairs, 18, mode, mode_desc); + run_ipX_tests(mmdb, pairs, 18, mode_desc); MMDB_close(mmdb); free(mmdb); diff --git a/src/deps/src/lua-cjson/.github/workflows/test.yml b/src/deps/src/lua-cjson/.github/workflows/test.yml new file mode 100644 index 000000000..95138ed94 --- /dev/null +++ b/src/deps/src/lua-cjson/.github/workflows/test.yml @@ -0,0 +1,61 @@ +name: test + +on: [push, pull_request] + +jobs: + test: + strategy: + fail-fast: false + matrix: + cc: ["gcc", "clang"] + luaVersion: ["5.1", "5.2", "5.3", "luajit", "luajit-openresty"] + include: + - luaVersion: "luajit" + runtestArgs: "LUA_INCLUDE_DIR=.lua/include/luajit-2.1" + runtestEnv: "SKIP_CMAKE=1" + - luaVersion: "luajit-openresty" + runtestArgs: "LUA_INCLUDE_DIR=.lua/include/luajit-2.1" + runtestEnv: "SKIP_CMAKE=1" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - uses: leafo/gh-actions-lua@master + env: + CC: ${{ matrix.cc }} + with: + luaVersion: ${{ matrix.luaVersion }} + luaCompileFlags: CC=${{ matrix.cc }} + + - uses: leafo/gh-actions-luarocks@master + + - name: runtests.sh + env: + CC: ${{ matrix.cc }} + run: | + LUA_DIR=.lua ${{ matrix.runtestEnv }} ./runtests.sh PREFIX=.lua ${{ matrix.runtestArgs }} + + - name: setup prove + env: + CC: ${{ matrix.cc }} + run: | + make PREFIX=.lua ${{ matrix.runtestArgs }} + sudo apt-get update + sudo apt-get install -q valgrind libipc-run3-perl cppcheck cpanminus + sudo cpanm --notest Test::Base Test::LongString + + - name: cppcheck + run: cppcheck -i .lua/ -i .install/ -i dtoa.c --force --error-exitcode=1 --enable=warning . + + - name: prove + run: LUA_BIN=lua prove -Itests tests + + - name: prove (valgrind) + run: LUA_BIN=lua TEST_LUA_USE_VALGRIND=1 prove -Itests tests + + - name: build + run: | + luarocks make + diff --git a/src/deps/src/lua-cjson/CMakeLists.txt b/src/deps/src/lua-cjson/CMakeLists.txt index c17239b2d..c1d670d4b 100644 --- a/src/deps/src/lua-cjson/CMakeLists.txt +++ b/src/deps/src/lua-cjson/CMakeLists.txt @@ -15,7 +15,7 @@ if(NOT CMAKE_BUILD_TYPE) FORCE) endif() -find_package(Lua51 REQUIRED) +find_package(Lua REQUIRED) include_directories(${LUA_INCLUDE_DIR}) if(NOT USE_INTERNAL_FPCONV) diff --git a/src/deps/src/lua-cjson/Makefile b/src/deps/src/lua-cjson/Makefile index 2361028d3..55c214278 100644 --- a/src/deps/src/lua-cjson/Makefile +++ b/src/deps/src/lua-cjson/Makefile @@ -15,7 +15,7 @@ LUA_VERSION = 5.1 TARGET = cjson.so PREFIX = /usr/local #CFLAGS = -g -Wall -pedantic -fno-inline -CFLAGS = -O3 -Wall -pedantic -DNDEBUG +CFLAGS = -O3 -Wall -pedantic -DNDEBUG -g CJSON_CFLAGS = -fpic CJSON_LDFLAGS = -shared LUA_INCLUDE_DIR ?= $(PREFIX)/include diff --git a/src/deps/src/lua-cjson/lua-cjson-2.1.0.6-1.rockspec b/src/deps/src/lua-cjson/lua-cjson-2.1.0.9-1.rockspec similarity index 97% rename from src/deps/src/lua-cjson/lua-cjson-2.1.0.6-1.rockspec rename to src/deps/src/lua-cjson/lua-cjson-2.1.0.9-1.rockspec index d6489f24e..32a230eed 100644 --- a/src/deps/src/lua-cjson/lua-cjson-2.1.0.6-1.rockspec +++ b/src/deps/src/lua-cjson/lua-cjson-2.1.0.9-1.rockspec @@ -1,9 +1,9 @@ package = "lua-cjson" -version = "2.1.0.6-1" +version = "2.1.0.9-1" source = { url = "git+https://github.com/openresty/lua-cjson", - tag = "2.1.0.6", + tag = "2.1.0.9", } description = { diff --git a/src/deps/src/lua-cjson/lua/cjson/util.lua b/src/deps/src/lua-cjson/lua/cjson/util.lua index 5d80106af..7cf66be4e 100644 --- a/src/deps/src/lua-cjson/lua/cjson/util.lua +++ b/src/deps/src/lua-cjson/lua/cjson/util.lua @@ -1,5 +1,28 @@ local json = require "cjson" +local unpack = unpack or table.unpack + +local maxn = table.maxn or function(t) + local max = 0 + for k,v in pairs(t) do + if type(k) == "number" and k > max then + max = k + end + end + return max +end + +local _one_of_mt = {} + +local function one_of(t) + setmetatable(t, _one_of_mt) + return t +end + +local function is_one_of(t) + return type(t) == "table" and getmetatable(t) == _one_of_mt +end + -- Various common routines used by the Lua CJSON package -- -- Mark Pulford @@ -47,7 +70,11 @@ local function serialise_table(value, indent, depth) local max = is_array(value) local comma = false - local fragment = { "{" .. spacing2 } + local prefix = "{" + if is_one_of(value) then + prefix = "ONE_OF{" + end + local fragment = { prefix .. spacing2 } if max > 0 then -- Serialise array for i = 1, max do @@ -134,6 +161,15 @@ local function file_save(filename, data) end local function compare_values(val1, val2) + if is_one_of(val2) then + for _, option in ipairs(val2) do + if compare_values(val1, option) then + return true + end + end + return false + end + local type1 = type(val1) local type2 = type(val2) if type1 ~= type2 then @@ -192,7 +228,7 @@ local function run_test(testname, func, input, should_work, output) local result = {} local tmp = { pcall(func, unpack(input)) } local success = tmp[1] - for i = 2, table.maxn(tmp) do + for i = 2, maxn(tmp) do result[i - 1] = tmp[i] end @@ -269,7 +305,8 @@ return { run_test_summary = run_test_summary, run_test = run_test, run_test_group = run_test_group, - run_script = run_script + run_script = run_script, + one_of = one_of } -- vi:ai et sw=4 ts=4: diff --git a/src/deps/src/lua-cjson/lua_cjson.c b/src/deps/src/lua-cjson/lua_cjson.c index 875bdafde..0c41cabac 100644 --- a/src/deps/src/lua-cjson/lua_cjson.c +++ b/src/deps/src/lua-cjson/lua_cjson.c @@ -52,7 +52,7 @@ #endif #ifndef CJSON_VERSION -#define CJSON_VERSION "2.1.0.6" +#define CJSON_VERSION "2.1.0.9" #endif #ifdef _MSC_VER @@ -102,6 +102,10 @@ #define json_lightudata_mask(ludata) (ludata) #endif +#if LUA_VERSION_NUM > 501 +#define lua_objlen(L,i) lua_rawlen(L, (i)) +#endif + static const char * const *json_empty_array; static const char * const *json_array; diff --git a/src/deps/src/lua-cjson/runtests.sh b/src/deps/src/lua-cjson/runtests.sh index 82dc8c1d5..fe606fa28 100755 --- a/src/deps/src/lua-cjson/runtests.sh +++ b/src/deps/src/lua-cjson/runtests.sh @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash +set -eo pipefail PLATFORM="`uname -s`" [ "$1" ] && VERSION="$1" || VERSION="2.1devel" -set -e # Portable "ggrep -A" replacement. # Work around Solaris awk record limit of 2559 bytes. @@ -39,7 +39,7 @@ then Please ensure you do not have the Lua CJSON module installed before running these tests. EOT - exit + exit 1 fi cd .. @@ -50,20 +50,26 @@ luarocks remove --local lua-cjson make clean echo "===== Testing Makefile build =====" -make +make "$@" cp -r lua/cjson cjson.so tests do_tests make clean rm -rf tests/cjson{,.so} -echo "===== Testing Cmake build =====" -mkdir build -cd build -cmake .. -make -cd .. -cp -r lua/cjson build/cjson.so tests -do_tests -rm -rf build tests/cjson{,.so} + +if [ -z "$SKIP_CMAKE" ]; then + echo "===== Testing Cmake build =====" + mkdir build + cd build + cmake .. + make + cd .. + cp -r lua/cjson build/cjson.so tests + do_tests + rm -rf build tests/cjson{,.so} +else + echo "===== Skipping Cmake build =====" +fi + # vi:ai et sw=4 ts=4: diff --git a/src/deps/src/lua-cjson/tests/TestLua.pm b/src/deps/src/lua-cjson/tests/TestLua.pm index 64372ad11..e13bfd3f8 100644 --- a/src/deps/src/lua-cjson/tests/TestLua.pm +++ b/src/deps/src/lua-cjson/tests/TestLua.pm @@ -32,12 +32,13 @@ sub run_test ($) { my ($res, $err); my @cmd; + my $lua_bin = $ENV{LUA_BIN} || "luajit"; if ($ENV{TEST_LUA_USE_VALGRIND}) { warn "$name\n"; - @cmd = ('valgrind', '-q', '--leak-check=full', 'luajit', 'test_case.lua'); + @cmd = ('valgrind', '-q', '--leak-check=full', $lua_bin, 'test_case.lua'); } else { - @cmd = ('luajit', 'test_case.lua'); + @cmd = ($lua_bin, 'test_case.lua'); } run3 \@cmd, undef, \$res, \$err; diff --git a/src/deps/src/lua-cjson/tests/agentzh.t b/src/deps/src/lua-cjson/tests/agentzh.t index 7591902b8..2e7c8cecc 100644 --- a/src/deps/src/lua-cjson/tests/agentzh.t +++ b/src/deps/src/lua-cjson/tests/agentzh.t @@ -66,8 +66,9 @@ print(cjson.encode({arr = empty_arr})) === TEST 6: empty_array_mt and empty tables as objects (explicit) --- lua local cjson = require "cjson" +local sort_json = require "tests.sort_json" local empty_arr = setmetatable({}, cjson.empty_array_mt) -print(cjson.encode({obj = {}, arr = empty_arr})) +print(sort_json(cjson.encode({obj = {}, arr = empty_arr}))) --- out {"arr":[],"obj":{}} @@ -76,6 +77,7 @@ print(cjson.encode({obj = {}, arr = empty_arr})) === TEST 7: empty_array_mt and empty tables as objects (explicit) --- lua local cjson = require "cjson" +local sort_json = require "tests.sort_json" cjson.encode_empty_table_as_object(true) local empty_arr = setmetatable({}, cjson.empty_array_mt) local data = { @@ -88,15 +90,16 @@ local data = { } } } -print(cjson.encode(data)) +print(sort_json(cjson.encode(data))) --- out -{"foo":{"foobar":{"obj":{},"arr":[]},"obj":{}},"arr":[]} +{"arr":[],"foo":{"foobar":{"arr":[],"obj":{}},"obj":{}}} === TEST 8: empty_array_mt on non-empty tables --- lua local cjson = require "cjson" +local sort_json = require "tests.sort_json" cjson.encode_empty_table_as_object(true) local array = {"hello", "world", "lua"} setmetatable(array, cjson.empty_array_mt) @@ -110,9 +113,9 @@ local data = { } } } -print(cjson.encode(data)) +print(sort_json(cjson.encode(data))) --- out -{"foo":{"foobar":{"obj":{},"arr":[]},"obj":{}},"arr":["hello","world","lua"]} +{"arr":["hello","world","lua"],"foo":{"foobar":{"arr":[],"obj":{}},"obj":{}}} diff --git a/src/deps/src/lua-cjson/tests/sort_json.lua b/src/deps/src/lua-cjson/tests/sort_json.lua new file mode 100644 index 000000000..c95ab3c4f --- /dev/null +++ b/src/deps/src/lua-cjson/tests/sort_json.lua @@ -0,0 +1,61 @@ +-- NOTE: This will only work for simple tests. It doesn't parse strings so if +-- you put any symbols like {?[], inside of a string literal then it will break +-- The point of this function is to test basic structures, and not test JSON +-- strings + +local function sort_callback(str) + local inside = str:sub(2, -2) + + local parts = {} + local buffer = "" + local pos = 1 + + while true do + if pos > #inside then + break + end + + local append + + local parens = inside:match("^%b{}", pos) + if parens then + pos = pos + #parens + append = sort_callback(parens) + else + local array = inside:match("^%b[]", pos) + if array then + pos = pos + #array + append = array + else + local front = inside:sub(pos, pos) + pos = pos + 1 + + if front == "," then + table.insert(parts, buffer) + buffer = "" + else + append = front + end + end + end + + if append then + buffer = buffer .. append + end + end + + if buffer ~= "" then + table.insert(parts, buffer) + end + + table.sort(parts) + + return "{" .. table.concat(parts, ",") .. "}" +end + +local function sort_json(str) + return (str:gsub("%b{}", sort_callback)) +end + + +return sort_json diff --git a/src/deps/src/lua-cjson/tests/test.lua b/src/deps/src/lua-cjson/tests/test.lua index d1bf7e4f8..605fc91c7 100755 --- a/src/deps/src/lua-cjson/tests/test.lua +++ b/src/deps/src/lua-cjson/tests/test.lua @@ -93,7 +93,7 @@ local cjson_tests = { -- Test API variables { "Check module name, version", function () return json._NAME, json._VERSION end, { }, - true, { "cjson", "2.1.0.6" } }, + true, { "cjson", "2.1.0.9" } }, -- Test decoding simple types { "Decode string", @@ -293,7 +293,12 @@ local cjson_tests = { true, { '["one",null,null,"sparse test"]' } }, { "Encode sparse array as object", json.encode, { { [1] = "one", [5] = "sparse test" } }, - true, { '{"5":"sparse test","1":"one"}' } }, + true, { + util.one_of { + '{"5":"sparse test","1":"one"}', + '{"1":"one","5":"sparse test"}' + } + } }, { "Encode table with numeric string key as object", json.encode, { { ["2"] = "numeric string key test" } }, true, { '{"2":"numeric string key test"}' } }, @@ -358,32 +363,71 @@ local cjson_tests = { json.encode_keep_buffer, { true }, true, { true } }, -- Test config API errors - -- Function is listed as '?' due to pcall + -- Function is listed as '?' due to pcall for older versions of Lua { "Set encode_number_precision(0) [throw error]", json.encode_number_precision, { 0 }, - false, { "bad argument #1 to '?' (expected integer between 1 and 16)" } }, + false, { + util.one_of { + "bad argument #1 to '?' (expected integer between 1 and 16)", + "bad argument #1 to 'cjson.encode_number_precision' (expected integer between 1 and 16)" + } + } }, { "Set encode_number_precision(\"five\") [throw error]", json.encode_number_precision, { "five" }, - false, { "bad argument #1 to '?' (number expected, got string)" } }, + false, { + util.one_of { + "bad argument #1 to '?' (number expected, got string)", + "bad argument #1 to 'cjson.encode_number_precision' (number expected, got string)" + } + } }, { "Set encode_keep_buffer(nil, true) [throw error]", json.encode_keep_buffer, { nil, true }, - false, { "bad argument #2 to '?' (found too many arguments)" } }, + false, { + util.one_of { + "bad argument #2 to '?' (found too many arguments)", + "bad argument #2 to 'cjson.encode_keep_buffer' (found too many arguments)" + } + } }, { "Set encode_max_depth(\"wrong\") [throw error]", json.encode_max_depth, { "wrong" }, - false, { "bad argument #1 to '?' (number expected, got string)" } }, + false, { + util.one_of { + "bad argument #1 to '?' (number expected, got string)", + "bad argument #1 to 'cjson.encode_max_depth' (number expected, got string)" + } + } }, { "Set decode_max_depth(0) [throw error]", json.decode_max_depth, { "0" }, - false, { "bad argument #1 to '?' (expected integer between 1 and 2147483647)" } }, + false, { + util.one_of { + "bad argument #1 to '?' (expected integer between 1 and 2147483647)", + "bad argument #1 to 'cjson.decode_max_depth' (expected integer between 1 and 2147483647)" + } + } }, { "Set encode_invalid_numbers(-2) [throw error]", json.encode_invalid_numbers, { -2 }, - false, { "bad argument #1 to '?' (invalid option '-2')" } }, + false, { + util.one_of { + "bad argument #1 to '?' (invalid option '-2')", + "bad argument #1 to 'cjson.encode_invalid_numbers' (invalid option '-2')" + } + } }, { "Set decode_invalid_numbers(true, false) [throw error]", json.decode_invalid_numbers, { true, false }, - false, { "bad argument #2 to '?' (found too many arguments)" } }, + false, { + util.one_of { + "bad argument #2 to '?' (found too many arguments)", + "bad argument #2 to 'cjson.decode_invalid_numbers' (found too many arguments)" + } + } }, { "Set encode_sparse_array(\"not quite on\") [throw error]", json.encode_sparse_array, { "not quite on" }, - false, { "bad argument #1 to '?' (invalid option 'not quite on')" } }, - + false, { + util.one_of { + "bad argument #1 to '?' (invalid option 'not quite on')", + "bad argument #1 to 'cjson.encode_sparse_array' (invalid option 'not quite on')" + } + } }, { "Reset Lua CJSON configuration", function () json = json.new() end }, -- Wrap in a function to ensure the table returned by json.new() is used { "Check encode_sparse_array()", @@ -395,7 +439,12 @@ local cjson_tests = { true, { "true" } }, { "Encode (safe) argument validation [throw error]", json_safe.encode, { "arg1", "arg2" }, - false, { "bad argument #1 to '?' (expected 1 argument)" } }, + false, { + util.one_of { + "bad argument #1 to '?' (expected 1 argument)", + "bad argument #1 to 'cjson.safe.encode' (expected 1 argument)" + } + } }, { "Decode (safe) error generation", json_safe.decode, { "Oops" }, true, { nil, "Expected value but found invalid token at character 1" } }, diff --git a/src/deps/src/lua-nginx-module/.mergify.yml b/src/deps/src/lua-nginx-module/.mergify.yml index c89be4fb5..f1a8a2e25 100644 --- a/src/deps/src/lua-nginx-module/.mergify.yml +++ b/src/deps/src/lua-nginx-module/.mergify.yml @@ -33,3 +33,11 @@ pull_request_rules: label: remove: - needs-test-cases + - name: add label could-be-merged + conditions: + - "#approved-reviews-by>=2" + - status-success=Travis CI - Pull Request + actions: + label: + add: + - could-be-merged diff --git a/src/deps/src/lua-nginx-module/.travis.yml b/src/deps/src/lua-nginx-module/.travis.yml index 87f6d4c38..f4cc579b3 100644 --- a/src/deps/src/lua-nginx-module/.travis.yml +++ b/src/deps/src/lua-nginx-module/.travis.yml @@ -1,4 +1,8 @@ -dist: xenial +dist: bionic + +branches: + only: + - "master" os: linux @@ -6,24 +10,23 @@ language: c compiler: - gcc - - clang addons: apt: packages: - - axel - - cpanminus - - libtest-base-perl - - libtext-diff-perl - - liburi-perl - - libwww-perl - - libtest-longstring-perl - - liblist-moreutils-perl - - libgd-dev + - axel + - cpanminus + - libtest-base-perl + - libtext-diff-perl + - liburi-perl + - libwww-perl + - libtest-longstring-perl + - liblist-moreutils-perl + - libgd-dev cache: directories: - - download-cache + - download-cache env: global: @@ -47,24 +50,24 @@ env: - DRIZZLE_VER=2011.07.21 - TEST_NGINX_SLEEP=0.006 jobs: - - NGINX_VERSION=1.17.8 OPENSSL_VER=1.0.2u OPENSSL_PATCH_VER=1.0.2h - - NGINX_VERSION=1.19.9 OPENSSL_VER=1.0.2u OPENSSL_PATCH_VER=1.0.2h - - NGINX_VERSION=1.19.9 OPENSSL_VER=1.1.0l OPENSSL_PATCH_VER=1.1.0d - - NGINX_VERSION=1.19.9 OPENSSL_VER=1.1.1i OPENSSL_PATCH_VER=1.1.1f + - NGINX_VERSION=1.21.4 OPENSSL_VER=1.1.0l OPENSSL_PATCH_VER=1.1.0d + - NGINX_VERSION=1.21.4 OPENSSL_VER=1.1.1l OPENSSL_PATCH_VER=1.1.1f services: - - memcached - - redis - - mysql + - memcached + - redis + - mysql before_install: + - sudo apt update + - sudo apt install --only-upgrade ca-certificates - '! grep -n -P ''(?<=.{80}).+'' --color `find src -name ''*.c''` `find . -name ''*.h''` || (echo "ERROR: Found C source lines exceeding 80 columns." > /dev/stderr; exit 1)' - '! grep -n -P ''\t+'' --color `find src -name ''*.c''` `find . -name ''*.h''` || (echo "ERROR: Cannot use tabs." > /dev/stderr; exit 1)' - sudo cpanm --notest Test::Nginx IPC::Run > build.log 2>&1 || (cat build.log && exit 1) install: - if [ ! -f download-cache/drizzle7-$DRIZZLE_VER.tar.gz ]; then wget -P download-cache http://openresty.org/download/drizzle7-$DRIZZLE_VER.tar.gz; fi - - if [ ! -f download-cache/pcre-$PCRE_VER.tar.gz ]; then wget -P download-cache https://ftp.pcre.org/pub/pcre/pcre-$PCRE_VER.tar.gz; fi + - if [ ! -f download-cache/pcre-$PCRE_VER.tar.gz ]; then wget -P download-cache https://downloads.sourceforge.net/project/pcre/pcre/${PCRE_VER}/pcre-${PCRE_VER}.tar.gz; fi - if [ ! -f download-cache/openssl-$OPENSSL_VER.tar.gz ]; then wget -P download-cache https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz || wget -P download-cache https://www.openssl.org/source/old/${OPENSSL_VER//[a-z]/}/openssl-$OPENSSL_VER.tar.gz; fi - git clone https://github.com/openresty/test-nginx.git - git clone https://github.com/openresty/openresty.git ../openresty @@ -95,9 +98,13 @@ before_script: - mysql -uroot -e 'create database ngx_test; grant all on ngx_test.* to "ngx_test"@"%" identified by "ngx_test"; flush privileges;' script: + - export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:$PATH + - ngx-releng > check.txt || true + - lines=`wc -l check.txt | awk '{print $1}'`; if [ $lines -gt 5 ]; then cat check.txt; exit 1; fi - sudo iptables -I OUTPUT 1 -p udp --dport 10086 -j REJECT - sudo iptables -I OUTPUT -p tcp --dst 127.0.0.2 --dport 12345 -j DROP - sudo iptables -I OUTPUT -p udp --dst 127.0.0.2 --dport 12345 -j DROP + - sudo ip route add prohibit 0.0.0.1/32 - cd luajit2/ - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT -msse4.2' > build.log 2>&1 || (cat build.log && exit 1) - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) @@ -121,7 +128,6 @@ script: - make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1) - sudo make PATH=$PATH install_sw > build.log 2>&1 || (cat build.log && exit 1) - cd .. - - export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:$PATH - export NGX_BUILD_CC=$CC - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - nginx -V @@ -132,4 +138,4 @@ script: - dig +short myip.opendns.com @resolver1.opendns.com || exit 0 - dig +short @$TEST_NGINX_RESOLVER openresty.org || exit 0 - dig +short @$TEST_NGINX_RESOLVER agentzh.org || exit 0 - - prove -Itest-nginx/lib -r t + - prove -I. -Itest-nginx/lib -r t diff --git a/src/deps/src/lua-nginx-module/README.markdown b/src/deps/src/lua-nginx-module/README.markdown index 0d9117165..d6560185c 100644 --- a/src/deps/src/lua-nginx-module/README.markdown +++ b/src/deps/src/lua-nginx-module/README.markdown @@ -1,8 +1,3 @@ - - Name ==== @@ -379,7 +374,7 @@ Build the source with this module: # current nginx build. # You can get usually those options using command nginx -V - # you can change the parallism number 2 below to fit the number of spare CPU cores in your + # you can change the parallelism number 2 below to fit the number of spare CPU cores in your # machine. make -j2 make install @@ -908,6 +903,8 @@ As noted earlier, PCRE sequences presented within `*_by_lua_block {}` directives # evaluates to "1234" ``` +**NOTE** You are recommended to use `by_lua_file` when the Lua code is very long. + [Back to TOC](#table-of-contents) Mixing with SSI Not Supported @@ -1133,6 +1130,8 @@ Directives * [balancer_by_lua_block](#balancer_by_lua_block) * [balancer_by_lua_file](#balancer_by_lua_file) * [lua_need_request_body](#lua_need_request_body) +* [ssl_client_hello_by_lua_block](#ssl_client_hello_by_lua_block) +* [ssl_client_hello_by_lua_file](#ssl_client_hello_by_lua_file) * [ssl_certificate_by_lua_block](#ssl_certificate_by_lua_block) * [ssl_certificate_by_lua_file](#ssl_certificate_by_lua_file) * [ssl_session_fetch_by_lua_block](#ssl_session_fetch_by_lua_block) @@ -1153,6 +1152,7 @@ Directives * [lua_ssl_protocols](#lua_ssl_protocols) * [lua_ssl_trusted_certificate](#lua_ssl_trusted_certificate) * [lua_ssl_verify_depth](#lua_ssl_verify_depth) +* [lua_ssl_conf_command](#lua_ssl_conf_command) * [lua_http10_buffering](#lua_http10_buffering) * [rewrite_by_lua_no_postpone](#rewrite_by_lua_no_postpone) * [access_by_lua_no_postpone](#access_by_lua_no_postpone) @@ -1161,6 +1161,7 @@ Directives * [lua_max_pending_timers](#lua_max_pending_timers) * [lua_max_running_timers](#lua_max_running_timers) * [lua_sa_restart](#lua_sa_restart) +* [lua_worker_thread_vm_pool_size](#lua_worker_thread_vm_pool_size) The basic building blocks of scripting Nginx with Lua are directives. Directives are used to specify when the user Lua code is run and @@ -1671,6 +1672,8 @@ For example, } ``` +It's not allowed to create a timer (even a 0-delay timer) here since it runs after all timers have been processed. + This directive was first introduced in the `v0.10.18` release. [Back to TOC](#directives) @@ -2621,6 +2624,132 @@ This also applies to [access_by_lua*](#access_by_lua). [Back to TOC](#directives) +ssl_client_hello_by_lua_block +----------------------------- + +**syntax:** *ssl_client_hello_by_lua_block { lua-script }* + +**context:** *http, server* + +**phase:** *right-after-client-hello-message-was-processed* + +This directive runs user Lua code when Nginx is about to post-process the SSL client hello message for the downstream +SSL (https) connections. + +It is particularly useful for dynamically setting the SSL protocols according to the SNI. + +It is also useful to do some custom operations according to the per-connection information in the client hello message. + +For example, one can parse custom client hello extension and do the corresponding handling in pure Lua. + +This Lua handler will always run whether the SSL session is resumed (via SSL session IDs or TLS session tickets) or not. +While the `ssl_certificate_by_lua*` Lua handler will only runs when initiating a full SSL handshake. + +The [ngx.ssl.clienthello](https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/clienthello.md) Lua modules +provided by the [lua-resty-core](https://github.com/openresty/lua-resty-core/#readme) +library are particularly useful in this context. + +Note that this handler runs in extremely early stage of SSL handshake, before the SSL client hello extensions are parsed. +So you can not use some Lua API like `ssl.server_name()` which is dependent on the later stage's processing. + +Also note that only the directive in default server is valid for several virtual servers with the same IP address and port. + +Below is a trivial example using the +[ngx.ssl.clienthello](https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/clienthello.md) module +at the same time: + +```nginx + + server { + listen 443 ssl; + server_name test.com; + ssl_certificate /path/to/cert.crt; + ssl_certificate_key /path/to/key.key; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local host, err = ssl_clt.get_client_hello_server_name() + if host == "test.com" then + ssl_clt.set_protocols({"TLSv1", "TLSv1.1"}) + elseif host == "test2.com" then + ssl_clt.set_protocols({"TLSv1.2", "TLSv1.3"}) + elseif not host then + ngx.log(ngx.ERR, "failed to get the SNI name: ", err) + ngx.exit(ngx.ERROR) + else + ngx.log(ngx.ERR, "unknown SNI name: ", host) + ngx.exit(ngx.ERROR) + end + } + ... + } + server { + listen 443 ssl; + server_name test2.com; + ssl_certificate /path/to/cert.crt; + ssl_certificate_key /path/to/key.key; + ... + } +``` + +See more information in the [ngx.ssl.clienthello](https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/clienthello.md) +Lua modules' official documentation. + +Uncaught Lua exceptions in the user Lua code immediately abort the current SSL session, so does the +[ngx.exit](#ngxexit) call with an error code like `ngx.ERROR`. + +This Lua code execution context *does* support yielding, so Lua APIs that may yield +(like cosockets, sleeping, and "light threads") +are enabled in this context + +Note, you need to configure the [ssl_certificate](https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate) +and [ssl_certificate_key](https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate_key) +to avoid the following error while starting NGINX: + + + nginx: [emerg] no ssl configured for the server + + +This directive requires OpenSSL 1.1.1 or greater. + +If you are using the [official pre-built +packages](https://openresty.org/en/linux-packages.html) for +[OpenResty](https://openresty.org/) 1.19.9.2 or later, then everything should +work out of the box. + +If you are not using one of the [OpenSSL +packages](https://openresty.org/en/linux-packages.html) provided by +[OpenResty](https://openresty.org), you will need to apply patches to OpenSSL +in order to use this directive: + + + +Similarly, if you are not using the Nginx core shipped with +[OpenResty](https://openresty.org) 1.19.9.2 or later, you will need to apply +patches to the standard Nginx core: + + + +This directive was first introduced in the `v0.10.21` release. + +[Back to TOC](#directives) + +ssl_client_hello_by_lua_file +---------------------------- + +**syntax:** *ssl_client_hello_by_lua_file <path-to-lua-script-file>* + +**context:** *http, server* + +**phase:** *right-after-client-hello-message-was-processed* + +Equivalent to [ssl_client_hello_by_lua_block](#ssl_client_hello_by_lua_block), except that the file specified by `` contains the Lua code, or, as from the `v0.5.0rc32` release, the [LuaJIT bytecode](#luajit-bytecode-support) to be executed. + +When a relative path like `foo/bar.lua` is given, they will be turned into the absolute path relative to the `server prefix` path determined by the `-p PATH` command-line option while starting the Nginx server. + +This directive was first introduced in the `v0.10.21` release. + +[Back to TOC](#directives) + ssl_certificate_by_lua_block ---------------------------- @@ -3136,6 +3265,37 @@ This directive was first introduced in the `v0.9.11` release. See also [lua_ssl_trusted_certificate](#lua_ssl_trusted_certificate). +[Back to TOC](#directives) + +lua_ssl_conf_command +-------------------- + +**syntax:** *lua_ssl_conf_command <command>* + +**default:** *no* + +**context:** *http, server, location* + +Sets arbitrary OpenSSL configuration [commands](https://www.openssl.org/docs/man1.1.1/man3/SSL_CONF_cmd.html). + +The directive is supported when using OpenSSL 1.0.2 or higher and nginx 1.19.4 or higher. According to the specify command, higher OpenSSL version may be needed. + +Several `lua_ssl_conf_command` directives can be specified on the same level: + +```nginx + + lua_ssl_conf_command Options PrioritizeChaCha; + lua_ssl_conf_command Ciphersuites TLS_CHACHA20_POLY1305_SHA256; +``` + +Configuration commands are applied after OpenResty own configuration for SSL, so they can be used to override anything set by OpenResty. + +Note though that configuring OpenSSL directly with `lua_ssl_conf_command` might result in a behaviour OpenResty does not expect, and should be done with care. + +This directive was first introduced in the `v0.10.21` release. + + + [Back to TOC](#directives) lua_http10_buffering @@ -3198,7 +3358,7 @@ lua_transform_underscores_in_response_headers **context:** *http, server, location, location-if* -Controls whether to transform underscores (`_`) in the response header names specified in the [ngx.header.HEADER](#ngxheaderheader) API to hypens (`-`). +Controls whether to transform underscores (`_`) in the response header names specified in the [ngx.header.HEADER](#ngxheaderheader) API to hyphens (`-`). This directive was first introduced in the `v0.5.0rc32` release. @@ -3294,6 +3454,25 @@ This directive was first introduced in the `v0.10.14` release. [Back to TOC](#directives) +lua_worker_thread_vm_pool_size +------------------------------ + +**syntax:** *lua_worker_thread_vm_pool_size <size>* + +**default:** *lua_worker_thread_vm_pool_size 100* + +**context:** *http* + +Specifies the size limit of the Lua VM pool (default 100) that will be used in the [ngx.run_worker_thread](#ngxrun_worker_thread) API. + +Also, it is not allowed to create Lua VMs that exceeds the pool size limit. + +The Lua VM in the VM pool is used to execute Lua code in separate thread. + +The pool is global at Nginx worker level. And it is used to reuse Lua VMs between requests. + +[Back to TOC](#directives) + Nginx API for Lua ================= @@ -3446,6 +3625,7 @@ Nginx API for Lua * [coroutine.wrap](#coroutinewrap) * [coroutine.running](#coroutinerunning) * [coroutine.status](#coroutinestatus) +* [ngx.run_worker_thread](#ngxrun_worker_thread) [Back to TOC](#table-of-contents) @@ -3589,7 +3769,7 @@ This API requires a relatively expensive metamethod call and it is recommended t Core constants -------------- -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, *log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, *log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** ```lua @@ -3616,7 +3796,7 @@ The `ngx.DECLINED` constant was first introduced in the `v0.5.0rc19` release. HTTP method constants --------------------- -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** ngx.HTTP_GET @@ -3643,7 +3823,7 @@ These constants are usually used in [ngx.location.capture](#ngxlocationcapture) HTTP status constants --------------------- -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** ```nginx @@ -3689,7 +3869,7 @@ HTTP status constants Nginx log level constants ------------------------- -**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** ```lua @@ -3713,7 +3893,7 @@ print **syntax:** *print(...)* -**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Writes argument values into the Nginx `error.log` file with the `ngx.NOTICE` log level. @@ -3826,7 +4006,7 @@ Then `GET /orig` will give rather than the original `"hello"` value. Because HTTP request is created after SSL handshake, the `ngx.ctx` created -in [ssl_certificate_by_lua*](#ssl_certificate_by_lua), [ssl_session_store_by_lua*](#ssl_session_store_by_lua) and [ssl_session_fetch_by_lua*](#ssl_session_fetch_by_lua) +in [ssl_certificate_by_lua*](#ssl_certificate_by_lua), [ssl_session_store_by_lua*](#ssl_session_store_by_lua), [ssl_session_fetch_by_lua*](#ssl_session_fetch_by_lua) and [ssl_client_hello_by_lua*](#ssl_client_hello_by_lua) is not available in the following phases like [rewrite_by_lua*](#rewrite_by_lua). Since `dev`, the `ngx.ctx` created during a SSL handshake @@ -5229,7 +5409,7 @@ ngx.req.init_body **context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua** -Creates a new blank request body for the current request and inializes the buffer for later request body data writing via the [ngx.req.append_body](#ngxreqappend_body) and [ngx.req.finish_body](#ngxreqfinish_body) APIs. +Creates a new blank request body for the current request and initializes the buffer for later request body data writing via the [ngx.req.append_body](#ngxreqappend_body) and [ngx.req.finish_body](#ngxreqfinish_body) APIs. If the `buffer_size` argument is specified, then its value will be used for the size of the memory buffer for body writing with [ngx.req.append_body](#ngxreqappend_body). If the argument is omitted, then the value specified by the standard [client_body_buffer_size](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size) directive will be used instead. @@ -5568,7 +5748,7 @@ ngx.log **syntax:** *ngx.log(log_level, ...)* -**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Log arguments concatenated to error.log with the given logging level. @@ -5606,7 +5786,7 @@ ngx.exit **syntax:** *ngx.exit(status)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** When `status >= 200` (i.e., `ngx.HTTP_OK` and above), it will interrupt the execution of the current request and return status code to Nginx. @@ -5698,7 +5878,7 @@ ngx.sleep **syntax:** *ngx.sleep(seconds)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Sleeps for the specified seconds without blocking. One can specify time resolution up to 0.001 seconds (i.e., one millisecond). @@ -5715,7 +5895,7 @@ ngx.escape_uri **syntax:** *newstr = ngx.escape_uri(str, type?)* -**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Since `v0.10.16`, this function accepts an optional `type` argument. It accepts the following values (defaults to `2`): @@ -5734,7 +5914,7 @@ ngx.unescape_uri **syntax:** *newstr = ngx.unescape_uri(str)* -**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, exit_worker_by_lua** +**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Unescape `str` as an escaped URI component. @@ -5775,7 +5955,7 @@ ngx.encode_args **syntax:** *str = ngx.encode_args(table)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_client_hello_by_lua** Encode the Lua table to a query args string according to the URI encoded rules. @@ -5833,7 +6013,7 @@ ngx.decode_args **syntax:** *table, err = ngx.decode_args(str, max_args?)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Decodes a URI encoded query-string into a Lua table. This is the inverse function of [ngx.encode_args](#ngxencode_args). @@ -5857,7 +6037,7 @@ ngx.encode_base64 **syntax:** *newstr = ngx.encode_base64(str, no_padding?)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Encodes `str` to a base64 digest. @@ -5870,7 +6050,7 @@ ngx.decode_base64 **syntax:** *newstr = ngx.decode_base64(str)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Decodes the `str` argument as a base64 digest to the raw form. Returns `nil` if `str` is not well formed. @@ -5881,7 +6061,7 @@ ngx.crc32_short **syntax:** *intval = ngx.crc32_short(str)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Calculates the CRC-32 (Cyclic Redundancy Code) digest for the `str` argument. @@ -5898,7 +6078,7 @@ ngx.crc32_long **syntax:** *intval = ngx.crc32_long(str)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Calculates the CRC-32 (Cyclic Redundancy Code) digest for the `str` argument. @@ -5915,7 +6095,7 @@ ngx.hmac_sha1 **syntax:** *digest = ngx.hmac_sha1(secret_key, str)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Computes the [HMAC-SHA1](https://en.wikipedia.org/wiki/HMAC) digest of the argument `str` and turns the result using the secret key ``. @@ -5948,7 +6128,7 @@ ngx.md5 **syntax:** *digest = ngx.md5(str)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Returns the hexadecimal representation of the MD5 digest of the `str` argument. @@ -5976,7 +6156,7 @@ ngx.md5_bin **syntax:** *digest = ngx.md5_bin(str)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Returns the binary form of the MD5 digest of the `str` argument. @@ -5989,7 +6169,7 @@ ngx.sha1_bin **syntax:** *digest = ngx.sha1_bin(str)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Returns the binary form of the SHA-1 digest of the `str` argument. @@ -6004,7 +6184,7 @@ ngx.quote_sql_str **syntax:** *quoted_value = ngx.quote_sql_str(raw_value)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Returns a quoted SQL string literal according to the MySQL quoting rules. @@ -6015,7 +6195,7 @@ ngx.today **syntax:** *str = ngx.today()* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Returns current date (in the format `yyyy-mm-dd`) from the Nginx cached time (no syscall involved unlike Lua's date library). @@ -6028,7 +6208,7 @@ ngx.time **syntax:** *secs = ngx.time()* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Returns the elapsed seconds from the epoch for the current time stamp from the Nginx cached time (no syscall involved unlike Lua's date library). @@ -6041,7 +6221,7 @@ ngx.now **syntax:** *secs = ngx.now()* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Returns a floating-point number for the elapsed time in seconds (including milliseconds as the decimal part) from the epoch for the current time stamp from the Nginx cached time (no syscall involved unlike Lua's date library). @@ -6056,7 +6236,7 @@ ngx.update_time **syntax:** *ngx.update_time()* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Forcibly updates the Nginx current time cache. This call involves a syscall and thus has some overhead, so do not abuse it. @@ -6069,7 +6249,7 @@ ngx.localtime **syntax:** *str = ngx.localtime()* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Returns the current time stamp (in the format `yyyy-mm-dd hh:mm:ss`) of the Nginx cached time (no syscall involved unlike Lua's [os.date](https://www.lua.org/manual/5.1/manual.html#pdf-os.date) function). @@ -6082,7 +6262,7 @@ ngx.utctime **syntax:** *str = ngx.utctime()* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Returns the current time stamp (in the format `yyyy-mm-dd hh:mm:ss`) of the Nginx cached time (no syscall involved unlike Lua's [os.date](https://www.lua.org/manual/5.1/manual.html#pdf-os.date) function). @@ -6095,7 +6275,7 @@ ngx.cookie_time **syntax:** *str = ngx.cookie_time(sec)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Returns a formatted string can be used as the cookie expiration time. The parameter `sec` is the time stamp in seconds (like those returned from [ngx.time](#ngxtime)). @@ -6112,7 +6292,7 @@ ngx.http_time **syntax:** *str = ngx.http_time(sec)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Returns a formated string can be used as the http header time (for example, being used in `Last-Modified` header). The parameter `sec` is the time stamp in seconds (like those returned from [ngx.time](#ngxtime)). @@ -6129,7 +6309,7 @@ ngx.parse_http_time **syntax:** *sec = ngx.parse_http_time(str)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Parse the http time string (as returned by [ngx.http_time](#ngxhttp_time)) into seconds. Returns the seconds or `nil` if the input string is in bad forms. @@ -6159,7 +6339,7 @@ ngx.re.match **syntax:** *captures, err = ngx.re.match(subject, regex, options?, ctx?, res_table?)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Matches the `subject` string using the Perl compatible regular expression `regex` with the optional `options`. @@ -6318,7 +6498,7 @@ ngx.re.find **syntax:** *from, to, err = ngx.re.find(subject, regex, options?, ctx?, nth?)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Similar to [ngx.re.match](#ngxrematch) but only returns the beginning index (`from`) and end index (`to`) of the matched substring. The returned indexes are 1-based and can be fed directly into the [string.sub](https://www.lua.org/manual/5.1/manual.html#pdf-string.sub) API function to obtain the matched substring. @@ -6373,7 +6553,7 @@ ngx.re.gmatch **syntax:** *iterator, err = ngx.re.gmatch(subject, regex, options?)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Similar to [ngx.re.match](#ngxrematch), but returns a Lua iterator instead, so as to let the user programmer iterate all the matches over the `` string argument with the PCRE `regex`. @@ -6452,7 +6632,7 @@ ngx.re.sub **syntax:** *newstr, n, err = ngx.re.sub(subject, regex, replace, options?)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Substitutes the first match of the Perl compatible regular expression `regex` on the `subject` argument string with the string or function argument `replace`. The optional `options` argument has exactly the same meaning as in [ngx.re.match](#ngxrematch). @@ -6520,7 +6700,7 @@ ngx.re.gsub **syntax:** *newstr, n, err = ngx.re.gsub(subject, regex, replace, options?)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Just like [ngx.re.sub](#ngxresub), but does global substitution. @@ -6561,7 +6741,7 @@ ngx.shared.DICT **syntax:** *dict = ngx.shared\[name_var\]* -**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Fetching the shm-based Lua dictionary object for the shared memory zone named `DICT` defined by the [lua_shared_dict](#lua_shared_dict) directive. @@ -6646,7 +6826,7 @@ ngx.shared.DICT.get **syntax:** *value, flags = ngx.shared.DICT:get(key)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Retrieving the value in the dictionary [ngx.shared.DICT](#ngxshareddict) for the key `key`. If the key does not exist or has expired, then `nil` will be returned. @@ -6685,7 +6865,7 @@ ngx.shared.DICT.get_stale **syntax:** *value, flags, stale = ngx.shared.DICT:get_stale(key)* -**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Similar to the [get](#ngxshareddictget) method but returns the value even if the key has already expired. @@ -6704,7 +6884,7 @@ ngx.shared.DICT.set **syntax:** *success, err, forcible = ngx.shared.DICT:set(key, value, exptime?, flags?)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Unconditionally sets a key-value pair into the shm-based dictionary [ngx.shared.DICT](#ngxshareddict). Returns three values: @@ -6757,7 +6937,7 @@ ngx.shared.DICT.safe_set **syntax:** *ok, err = ngx.shared.DICT:safe_set(key, value, exptime?, flags?)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Similar to the [set](#ngxshareddictset) method, but never overrides the (least recently used) unexpired items in the store when running out of storage in the shared memory zone. In this case, it will immediately return `nil` and the string "no memory". @@ -6772,7 +6952,7 @@ ngx.shared.DICT.add **syntax:** *success, err, forcible = ngx.shared.DICT:add(key, value, exptime?, flags?)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Just like the [set](#ngxshareddictset) method, but only stores the key-value pair into the dictionary [ngx.shared.DICT](#ngxshareddict) if the key does *not* exist. @@ -6789,7 +6969,7 @@ ngx.shared.DICT.safe_add **syntax:** *ok, err = ngx.shared.DICT:safe_add(key, value, exptime?, flags?)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Similar to the [add](#ngxshareddictadd) method, but never overrides the (least recently used) unexpired items in the store when running out of storage in the shared memory zone. In this case, it will immediately return `nil` and the string "no memory". @@ -6804,7 +6984,7 @@ ngx.shared.DICT.replace **syntax:** *success, err, forcible = ngx.shared.DICT:replace(key, value, exptime?, flags?)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Just like the [set](#ngxshareddictset) method, but only stores the key-value pair into the dictionary [ngx.shared.DICT](#ngxshareddict) if the key *does* exist. @@ -6821,7 +7001,7 @@ ngx.shared.DICT.delete **syntax:** *ngx.shared.DICT:delete(key)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Unconditionally removes the key-value pair from the shm-based dictionary [ngx.shared.DICT](#ngxshareddict). @@ -6838,7 +7018,7 @@ ngx.shared.DICT.incr **syntax:** *newval, err, forcible? = ngx.shared.DICT:incr(key, value, init?, init_ttl?)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** **optional requirement:** `resty.core.shdict` or `resty.core` @@ -6893,7 +7073,7 @@ ngx.shared.DICT.lpush **syntax:** *length, err = ngx.shared.DICT:lpush(key, value)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Inserts the specified (numerical or string) `value` at the head of the list named `key` in the shm-based dictionary [ngx.shared.DICT](#ngxshareddict). Returns the number of elements in the list after the push operation. @@ -6912,7 +7092,7 @@ ngx.shared.DICT.rpush **syntax:** *length, err = ngx.shared.DICT:rpush(key, value)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Similar to the [lpush](#ngxshareddictlpush) method, but inserts the specified (numerical or string) `value` at the tail of the list named `key`. @@ -6927,7 +7107,7 @@ ngx.shared.DICT.lpop **syntax:** *val, err = ngx.shared.DICT:lpop(key)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Removes and returns the first element of the list named `key` in the shm-based dictionary [ngx.shared.DICT](#ngxshareddict). @@ -6944,7 +7124,7 @@ ngx.shared.DICT.rpop **syntax:** *val, err = ngx.shared.DICT:rpop(key)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Removes and returns the last element of the list named `key` in the shm-based dictionary [ngx.shared.DICT](#ngxshareddict). @@ -6961,7 +7141,7 @@ ngx.shared.DICT.llen **syntax:** *len, err = ngx.shared.DICT:llen(key)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Returns the number of elements in the list named `key` in the shm-based dictionary [ngx.shared.DICT](#ngxshareddict). @@ -6978,7 +7158,7 @@ ngx.shared.DICT.ttl **syntax:** *ttl, err = ngx.shared.DICT:ttl(key)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** **requires:** `resty.core.shdict` or `resty.core` @@ -7016,7 +7196,7 @@ ngx.shared.DICT.expire **syntax:** *success, err = ngx.shared.DICT:expire(key, exptime)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** **requires:** `resty.core.shdict` or `resty.core` @@ -7056,7 +7236,7 @@ ngx.shared.DICT.flush_all **syntax:** *ngx.shared.DICT:flush_all()* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Flushes out all the items in the dictionary. This method does not actually free up all the memory blocks in the dictionary but just marks all the existing items as expired. @@ -7071,7 +7251,7 @@ ngx.shared.DICT.flush_expired **syntax:** *flushed = ngx.shared.DICT:flush_expired(max_count?)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Flushes out the expired items in the dictionary, up to the maximal number specified by the optional `max_count` argument. When the `max_count` argument is given `0` or not given at all, then it means unlimited. Returns the number of items that have actually been flushed. @@ -7088,7 +7268,7 @@ ngx.shared.DICT.get_keys **syntax:** *keys = ngx.shared.DICT:get_keys(max_count?)* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Fetch a list of the keys from the dictionary, up to ``. @@ -7105,7 +7285,7 @@ ngx.shared.DICT.capacity **syntax:** *capacity_bytes = ngx.shared.DICT:capacity()* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** **requires:** `resty.core.shdict` or `resty.core` @@ -7137,7 +7317,7 @@ ngx.shared.DICT.free_space **syntax:** *free_page_bytes = ngx.shared.DICT:free_space()* -**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** **requires:** `resty.core.shdict` or `resty.core` @@ -7180,7 +7360,7 @@ ngx.socket.udp **syntax:** *udpsock = ngx.socket.udp()* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Creates and returns a UDP or datagram-oriented unix domain socket object (also known as one type of the "cosocket" objects). The following methods are supported on this object: @@ -7205,7 +7385,7 @@ udpsock:setpeername **syntax:** *ok, err = udpsock:setpeername("unix:/path/to/unix-domain.socket")* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Attempts to connect a UDP socket object to a remote server or to a datagram unix domain socket file. Because the datagram protocol is actually connection-less, this method does not really establish a "connection", but only just set the name of the remote peer for subsequent read/write operations. @@ -7268,7 +7448,7 @@ udpsock:send **syntax:** *ok, err = udpsock:send(data)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Sends data on the current UDP or datagram unix domain socket object. @@ -7285,7 +7465,7 @@ udpsock:receive **syntax:** *data, err = udpsock:receive(size?)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Receives data from the UDP or datagram unix domain socket object with an optional receive buffer size argument, `size`. @@ -7321,7 +7501,7 @@ udpsock:close **syntax:** *ok, err = udpsock:close()* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Closes the current UDP or datagram unix domain socket. It returns the `1` in case of success and returns `nil` with a string describing the error otherwise. @@ -7336,7 +7516,7 @@ udpsock:settimeout **syntax:** *udpsock:settimeout(time)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Set the timeout value in milliseconds for subsequent socket operations (like [receive](#udpsockreceive)). @@ -7361,7 +7541,7 @@ ngx.socket.tcp **syntax:** *tcpsock = ngx.socket.tcp()* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Creates and returns a TCP or stream-oriented unix domain socket object (also known as one type of the "cosocket" objects). The following methods are supported on this object: @@ -7410,7 +7590,7 @@ tcpsock:connect **syntax:** *ok, err = tcpsock:connect("unix:/path/to/unix-domain.socket", options_table?)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Attempts to connect a TCP socket object to a remote server or to a stream unix domain socket file without blocking. @@ -7530,7 +7710,7 @@ tcpsock:sslhandshake **syntax:** *session, err = tcpsock:sslhandshake(reused_session?, server_name?, ssl_verify?, send_status_req?)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Does SSL/TLS handshake on the currently established connection. @@ -7576,7 +7756,7 @@ tcpsock:send **syntax:** *bytes, err = tcpsock:send(data)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Sends data without blocking on the current TCP or Unix Domain Socket connection. @@ -7609,7 +7789,7 @@ tcpsock:receive **syntax:** *data, err, partial = tcpsock:receive(pattern?)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Receives data from the connected socket according to the reading pattern or size. @@ -7652,7 +7832,7 @@ tcpsock:receiveany **syntax:** *data, err = tcpsock:receiveany(max)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Returns any data received by the connected socket, at most `max` bytes. @@ -7687,7 +7867,7 @@ tcpsock:receiveuntil **syntax:** *iterator = tcpsock:receiveuntil(pattern, options?)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** This method returns an iterator Lua function that can be called to read the data stream until it sees the specified pattern or an error occurs. @@ -7787,7 +7967,7 @@ tcpsock:close **syntax:** *ok, err = tcpsock:close()* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Closes the current TCP or stream unix domain socket. It returns the `1` in case of success and returns `nil` with a string describing the error otherwise. @@ -7804,7 +7984,7 @@ tcpsock:settimeout **syntax:** *tcpsock:settimeout(time)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Set the timeout value in milliseconds for subsequent socket operations ([connect](#tcpsockconnect), [receive](#tcpsockreceive), and iterators returned from [receiveuntil](#tcpsockreceiveuntil)). @@ -7821,7 +8001,7 @@ tcpsock:settimeouts **syntax:** *tcpsock:settimeouts(connect_timeout, send_timeout, read_timeout)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Respectively sets the connect, send, and read timeout thresholds (in milliseconds) for subsequent socket operations ([connect](#tcpsockconnect), [send](#tcpsocksend), [receive](#tcpsockreceive), and iterators returned from [receiveuntil](#tcpsockreceiveuntil)). @@ -7841,7 +8021,7 @@ tcpsock:setoption **syntax:** *ok, err = tcpsock:setoption(option, value?)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** This function is added for [LuaSocket](http://w3.impa.br/~diego/software/luasocket/tcp.html) API compatibility and does nothing for now. Its functionality is implemented `v0.10.18`. @@ -7944,7 +8124,7 @@ tcpsock:setkeepalive **syntax:** *ok, err = tcpsock:setkeepalive(timeout?, size?)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Puts the current socket's connection immediately into the cosocket built-in connection pool and keep it alive until other [connect](#tcpsockconnect) method calls request it or the associated maximal idle timeout is expired. @@ -7991,7 +8171,7 @@ tcpsock:getreusedtimes **syntax:** *count, err = tcpsock:getreusedtimes()* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** This method returns the (successfully) reused times for the current connection. In case of error, it returns `nil` and a string describing the error. @@ -8033,7 +8213,7 @@ ngx.get_phase **syntax:** *str = ngx.get_phase()* -**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Retrieves the current running phase name. Possible return values are @@ -8047,6 +8227,8 @@ Retrieves the current running phase name. Possible return values are for the context of [ssl_session_fetch_by_lua*](#ssl_session_fetch_by_lua_block). * `ssl_session_store` for the context of [ssl_session_store_by_lua*](#ssl_session_store_by_lua_block). +* `ssl_client_hello` + for the context of [ssl_client_hello_by_lua*](#ssl_client_hello_by_lua_block). * `set` for the context of [set_by_lua*](#set_by_lua). * `rewrite` @@ -8077,7 +8259,7 @@ ngx.thread.spawn **syntax:** *co = ngx.thread.spawn(func, arg1, arg2, ...)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Spawns a new user "light thread" with the Lua function `func` as well as those optional arguments `arg1`, `arg2`, and etc. Returns a Lua thread (or Lua coroutine) object represents this "light thread". @@ -8216,7 +8398,7 @@ ngx.thread.wait **syntax:** *ok, res1, res2, ... = ngx.thread.wait(thread1, thread2, ...)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Waits on one or more child "light threads" and returns the results of the first "light thread" that terminates (either successfully or with an error). @@ -8320,7 +8502,7 @@ ngx.thread.kill **syntax:** *ok, err = ngx.thread.kill(thread)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** Kills a running "light thread" created by [ngx.thread.spawn](#ngxthreadspawn). Returns a true value when successful or `nil` and a string describing the error otherwise. @@ -8376,7 +8558,7 @@ ngx.timer.at **syntax:** *hdl, err = ngx.timer.at(delay, callback, user_arg1, user_arg2, ...)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Creates an Nginx timer with a user callback function as well as optional user arguments. @@ -8519,7 +8701,7 @@ ngx.timer.every **syntax:** *hdl, err = ngx.timer.every(delay, callback, user_arg1, user_arg2, ...)* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Similar to the [ngx.timer.at](#ngxtimerat) API function, but @@ -8542,7 +8724,7 @@ ngx.timer.running_count **syntax:** *count = ngx.timer.running_count()* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Returns the number of timers currently running. @@ -8555,7 +8737,7 @@ ngx.timer.pending_count **syntax:** *count = ngx.timer.pending_count()* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** Returns the number of pending timers. @@ -8793,7 +8975,7 @@ ndk.set_var.DIRECTIVE **syntax:** *res = ndk.set_var.DIRECTIVE_NAME* -**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua** +**context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua** This mechanism allows calling other Nginx C modules' directives that are implemented by [Nginx Devel Kit](https://github.com/simplresty/ngx_devel_kit) (NDK)'s set_var submodule's `ndk_set_var_value`. @@ -8835,7 +9017,7 @@ coroutine.create **syntax:** *co = coroutine.create(f)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Creates a user Lua coroutines with a Lua function, and returns a coroutine object. @@ -8852,9 +9034,9 @@ coroutine.resume **syntax:** *ok, ... = coroutine.resume(co, ...)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** -Resumes the executation of a user Lua coroutine object previously yielded or just created. +Resumes the execution of a user Lua coroutine object previously yielded or just created. Similar to the standard Lua [coroutine.resume](https://www.lua.org/manual/5.1/manual.html#pdf-coroutine.resume) API, but works in the context of the Lua coroutines created by ngx_lua. @@ -8869,7 +9051,7 @@ coroutine.yield **syntax:** *... = coroutine.yield(...)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Yields the execution of the current user Lua coroutine. @@ -8886,7 +9068,7 @@ coroutine.wrap **syntax:** *co = coroutine.wrap(f)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Similar to the standard Lua [coroutine.wrap](https://www.lua.org/manual/5.1/manual.html#pdf-coroutine.wrap) API, but works in the context of the Lua coroutines created by ngx_lua. @@ -8901,7 +9083,7 @@ coroutine.running **syntax:** *co = coroutine.running()* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Identical to the standard Lua [coroutine.running](https://www.lua.org/manual/5.1/manual.html#pdf-coroutine.running) API. @@ -8916,7 +9098,7 @@ coroutine.status **syntax:** *status = coroutine.status(co)* -**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua** +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua** Identical to the standard Lua [coroutine.status](https://www.lua.org/manual/5.1/manual.html#pdf-coroutine.status) API. @@ -8926,6 +9108,138 @@ This API was first enabled in the `v0.6.0` release. [Back to TOC](#nginx-api-for-lua) +ngx.run_worker_thread +--------------------- + +**syntax:** *ok, res1, res2, ... = ngx.run_worker_thread(threadpool, module_name, func_name, arg1, arg2, ...)* + +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua** + +**This API is still experimental and may change in the future without notice.** + +**This API is available only for Linux.** + +Wrap the [nginx worker thread](http://nginx.org/en/docs/dev/development_guide.html#threads) to execute lua function. The caller coroutine would yield until the function returns. + +Only the following ngx_lua APIs could be used in `function_name` function of the `module` module: + +* `ngx.encode_base64` +* `ngx.decode_base64` + +* `ngx.hmac_sha1` +* `ngx.encode_args` +* `ngx.decode_args` +* `ngx.quote_sql_str` + +* `ngx.re.match` +* `ngx.re.find` +* `ngx.re.gmatch` +* `ngx.re.sub` +* `ngx.re.gsub` + +* `ngx.crc32_short` +* `ngx.crc32_long` +* `ngx.hmac_sha1` +* `ngx.md5_bin` +* `ngx.md5` + +* `ngx.config.subsystem` +* `ngx.config.debug` +* `ngx.config.prefix` +* `ngx.config.nginx_version` +* `ngx.config.nginx_configure` +* `ngx.config.ngx_lua_version` + + +The first argument `threadpool` specifies the Nginx thread pool name defined by [thread_pool](https://nginx.org/en/docs/ngx_core_module.html#thread_pool). + +The second argument `module_name` specifies the lua module name to execute in the worker thread, which would return a lua table. The module must be inside the package path, e.g. + +```nginx + + lua_package_path '/opt/openresty/?.lua;;'; +``` + +The third argument `func_name` specifies the function field in the module table as the second argument. + +The type of `arg`s must be one of type below: + +* boolean +* number +* string +* nil +* table (the table may be recursive, and contains members of types above.) + +The `ok` is in boolean type, which indicate the C land error (failed to get thread from thread pool, pcall the module function failed, .etc). If `ok` is `false`, the `res1` is the error string. + +The return values (res1, ...) are returned by invocation of the module function. Normally, the `res1` should be in boolean type, so that the caller could inspect the error. + +This API is useful when you need to execute the below types of tasks: + +* CPU bound task, e.g. do md5 calculation +* File I/O task +* Call `os.execute()` or blocking C API via `ffi` +* Call external Lua library not based on cosocket or nginx + +Example1: do md5 calculation. + +```nginx + + location /calc_md5 { + default_type 'text/plain'; + + content_by_lua_block { + local ok, md5_or_err = ngx.run_worker_thread("testpool", "md5", "md5") + ngx.say(ok, " : ", md5_or_err) + } + } +``` + +`md5.lua` + +```lua +local function md5() + return ngx.md5("hello") +end +``` + +Example2: write logs into the log file. + +```nginx + + location /write_log_file { + default_type 'text/plain'; + + content_by_lua_block { + local ok, err = ngx.run_worker_thread("testpool", "write_log_file", "log", ngx.var.arg_str) + if not ok then + ngx.say(ok, " : ", err) + return + end + ngx.say(ok) + } + } +``` + +`write_log_file.lua` + +```lua + + local function log(str) + local file, err = io.open("/tmp/tmp.log", "a") + if not file then + return false, err + end + file:write(str) + file:flush() + file:close() + return true + end + return {log=log} +``` + +[Back to TOC](#nginx-api-for-lua) + Obsolete Sections ================= diff --git a/src/deps/src/lua-nginx-module/config b/src/deps/src/lua-nginx-module/config index 4b32d3831..14870a04e 100644 --- a/src/deps/src/lua-nginx-module/config +++ b/src/deps/src/lua-nginx-module/config @@ -286,6 +286,7 @@ HTTP_LUA_SRCS=" \ $ngx_addon_dir/src/ngx_http_lua_timer.c \ $ngx_addon_dir/src/ngx_http_lua_config.c \ $ngx_addon_dir/src/ngx_http_lua_worker.c \ + $ngx_addon_dir/src/ngx_http_lua_ssl_client_helloby.c \ $ngx_addon_dir/src/ngx_http_lua_ssl_certby.c \ $ngx_addon_dir/src/ngx_http_lua_ssl_ocsp.c \ $ngx_addon_dir/src/ngx_http_lua_lex.c \ @@ -296,6 +297,7 @@ HTTP_LUA_SRCS=" \ $ngx_addon_dir/src/ngx_http_lua_log_ringbuf.c \ $ngx_addon_dir/src/ngx_http_lua_input_filters.c \ $ngx_addon_dir/src/ngx_http_lua_pipe.c \ + $ngx_addon_dir/src/ngx_http_lua_worker_thread.c \ " HTTP_LUA_DEPS=" \ @@ -346,6 +348,7 @@ HTTP_LUA_DEPS=" \ $ngx_addon_dir/src/ngx_http_lua_uthread.h \ $ngx_addon_dir/src/ngx_http_lua_timer.h \ $ngx_addon_dir/src/ngx_http_lua_config.h \ + $ngx_addon_dir/src/ngx_http_lua_ssl_client_helloby.h \ $ngx_addon_dir/src/ngx_http_lua_ssl_certby.h \ $ngx_addon_dir/src/ngx_http_lua_lex.h \ $ngx_addon_dir/src/ngx_http_lua_balancer.h \ @@ -355,6 +358,7 @@ HTTP_LUA_DEPS=" \ $ngx_addon_dir/src/ngx_http_lua_log_ringbuf.h \ $ngx_addon_dir/src/ngx_http_lua_input_filters.h \ $ngx_addon_dir/src/ngx_http_lua_pipe.h \ + $ngx_addon_dir/src/ngx_http_lua_worker_thread.h \ " # ---------------------------------------- diff --git a/src/deps/src/lua-nginx-module/doc/HttpLuaModule.wiki b/src/deps/src/lua-nginx-module/doc/HttpLuaModule.wiki index 037ec3efa..7b187bc6f 100644 --- a/src/deps/src/lua-nginx-module/doc/HttpLuaModule.wiki +++ b/src/deps/src/lua-nginx-module/doc/HttpLuaModule.wiki @@ -309,7 +309,7 @@ Build the source with this module: # current nginx build. # You can get usually those options using command nginx -V - # you can change the parallism number 2 below to fit the number of spare CPU cores in your + # you can change the parallelism number 2 below to fit the number of spare CPU cores in your # machine. make -j2 make install @@ -755,6 +755,8 @@ As noted earlier, PCRE sequences presented within *_by_lua_block {} # evaluates to "1234" +'''NOTE''' You are recommended to use `by_lua_file` when the Lua code is very long. + == Mixing with SSI Not Supported == Mixing SSI with ngx_lua in the same Nginx request is not supported at all. Just use ngx_lua exclusively. Everything you can do with SSI can be done atop ngx_lua anyway and it can be more efficient when using ngx_lua. @@ -1362,6 +1364,8 @@ For example, } +It's not allowed to create a timer (even a 0-delay timer) here since it runs after all timers have been processed. + This directive was first introduced in the v0.10.18 release. == exit_worker_by_lua_file == @@ -2209,6 +2213,125 @@ It is recommended however, to use the [[#ngx.req.read_body|ngx.req.read_body]] a This also applies to [[#access_by_lua|access_by_lua*]]. +== ssl_client_hello_by_lua_block == + +'''syntax:''' ''ssl_client_hello_by_lua_block { lua-script }'' + +'''context:''' ''http, server'' + +'''phase:''' ''right-after-client-hello-message-was-processed'' + +This directive runs user Lua code when Nginx is about to post-process the SSL client hello message for the downstream +SSL (https) connections. + +It is particularly useful for dynamically setting the SSL protocols according to the SNI. + +It is also useful to do some custom operations according to the per-connection information in the client hello message. + +For example, one can parse custom client hello extension and do the corresponding handling in pure Lua. + +This Lua handler will always run whether the SSL session is resumed (via SSL session IDs or TLS session tickets) or not. +While the ssl_certificate_by_lua* Lua handler will only runs when initiating a full SSL handshake. + +The [https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/clienthello.md ngx.ssl.clienthello] Lua modules +provided by the [https://github.com/openresty/lua-resty-core/#readme lua-resty-core] +library are particularly useful in this context. + +Note that this handler runs in extremely early stage of SSL handshake, before the SSL client hello extensions are parsed. +So you can not use some Lua API like ssl.server_name() which is dependent on the later stage's processing. + +Also note that only the directive in default server is valid for several virtual servers with the same IP address and port. + +Below is a trivial example using the +[https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/clienthello.md ngx.ssl.clienthello] module +at the same time: + + +server { + listen 443 ssl; + server_name test.com; + ssl_certificate /path/to/cert.crt; + ssl_certificate_key /path/to/key.key; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local host, err = ssl_clt.get_client_hello_server_name() + if host == "test.com" then + ssl_clt.set_protocols({"TLSv1", "TLSv1.1"}) + elseif host == "test2.com" then + ssl_clt.set_protocols({"TLSv1.2", "TLSv1.3"}) + elseif not host then + ngx.log(ngx.ERR, "failed to get the SNI name: ", err) + ngx.exit(ngx.ERROR) + else + ngx.log(ngx.ERR, "unknown SNI name: ", host) + ngx.exit(ngx.ERROR) + end + } + ... +} +server { + listen 443 ssl; + server_name test2.com; + ssl_certificate /path/to/cert.crt; + ssl_certificate_key /path/to/key.key; + ... +} + + +See more information in the [https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/clienthello.md ngx.ssl.clienthello] +Lua modules' official documentation. + +Uncaught Lua exceptions in the user Lua code immediately abort the current SSL session, so does the +[[#ngx.exit|ngx.exit]] call with an error code like ngx.ERROR. + +This Lua code execution context *does* support yielding, so Lua APIs that may yield +(like cosockets, sleeping, and "light threads") +are enabled in this context + +Note, you need to configure the [https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate ssl_certificate] +and [https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate_key ssl_certificate_key] +to avoid the following error while starting NGINX: + + + nginx: [emerg] no ssl configured for the server + + +This directive requires OpenSSL 1.1.1 or greater. + +If you are using the [official pre-built +packages](https://openresty.org/en/linux-packages.html) for +[OpenResty](https://openresty.org/) 1.19.9.2 or later, then everything should +work out of the box. + +If you are not using one of the [OpenSSL +packages](https://openresty.org/en/linux-packages.html) provided by +[OpenResty](https://openresty.org), you will need to apply patches to OpenSSL +in order to use this directive: + +https://openresty.org/en/openssl-patches.html + +Similarly, if you are not using the Nginx core shipped with +[OpenResty](https://openresty.org) 1.19.9.2 or later, you will need to apply +patches to the standard Nginx core: + +https://openresty.org/en/nginx-ssl-patches.html + +This directive was first introduced in the v0.10.21 release. + +== ssl_client_hello_by_lua_file == + +'''syntax:''' ''ssl_client_hello_by_lua_file '' + +'''context:''' ''http, server'' + +'''phase:''' ''right-after-client-hello-message-was-processed'' + +Equivalent to [[#ssl_client_hello_by_lua_block|ssl_client_hello_by_lua_block]], except that the file specified by contains the Lua code, or, as from the v0.5.0rc32 release, the [[#LuaJIT bytecode support|LuaJIT bytecode]] to be executed. + +When a relative path like foo/bar.lua is given, they will be turned into the absolute path relative to the server prefix path determined by the -p PATH command-line option while starting the Nginx server. + +This directive was first introduced in the v0.10.21 release. + == ssl_certificate_by_lua_block == '''syntax:''' ''ssl_certificate_by_lua_block { lua-script }'' @@ -2664,6 +2787,33 @@ This directive was first introduced in the v0.9.11 release. See also [[#lua_ssl_trusted_certificate|lua_ssl_trusted_certificate]]. +== lua_ssl_conf_command == + +'''syntax:''' ''lua_ssl_conf_command '' + +'''default:''' ''no'' + +'''context:''' ''http, server, location'' + +Sets arbitrary OpenSSL configuration [https://www.openssl.org/docs/man1.1.1/man3/SSL_CONF_cmd.html commands]. + +The directive is supported when using OpenSSL 1.0.2 or higher and nginx 1.19.4 or higher. According to the specify command, higher OpenSSL version may be needed. + +Several lua_ssl_conf_command directives can be specified on the same level: + + +lua_ssl_conf_command Options PrioritizeChaCha; +lua_ssl_conf_command Ciphersuites TLS_CHACHA20_POLY1305_SHA256; + + +Configuration commands are applied after OpenResty own configuration for SSL, so they can be used to override anything set by OpenResty. + +Note though that configuring OpenSSL directly with lua_ssl_conf_command might result in a behaviour OpenResty does not expect, and should be done with care. + +This directive was first introduced in the v0.10.21 release. + + + == lua_http10_buffering == '''syntax:''' ''lua_http10_buffering on|off'' @@ -2714,7 +2864,7 @@ This directive was first introduced in the v0.9.20 release. '''context:''' ''http, server, location, location-if'' -Controls whether to transform underscores (_) in the response header names specified in the [[#ngx.header.HEADER|ngx.header.HEADER]] API to hypens (-). +Controls whether to transform underscores (_) in the response header names specified in the [[#ngx.header.HEADER|ngx.header.HEADER]] API to hyphens (-). This directive was first introduced in the v0.5.0rc32 release. @@ -2795,6 +2945,22 @@ This allows Lua I/O primitives to not be interrupted by Nginx's handling of vari This directive was first introduced in the v0.10.14 release. +== lua_worker_thread_vm_pool_size == + +'''syntax:''' ''lua_worker_thread_vm_pool_size '' + +'''default:''' ''lua_worker_thread_vm_pool_size 100'' + +'''context:''' ''http'' + +Specifies the size limit of the Lua VM pool (default 100) that will be used in the [ngx.run_worker_thread](#ngxrun_worker_thread) API. + +Also, it is not allowed to create Lua VMs that exceeds the pool size limit. + +The Lua VM in the VM pool is used to execute Lua code in separate thread. + +The pool is global at Nginx worker level. And it is used to reuse Lua VMs between requests. + = Nginx API for Lua = @@ -2920,7 +3086,7 @@ This API requires a relatively expensive metamethod call and it is recommended t == Core constants == -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, *log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, *log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' ngx.OK (0) @@ -2942,7 +3108,7 @@ The ngx.DECLINED constant was first introduced in the v0.5.0r == HTTP method constants == -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' ngx.HTTP_GET @@ -2966,7 +3132,7 @@ These constants are usually used in [[#ngx.location.capture|ngx.location.capture == HTTP status constants == -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' value = ngx.HTTP_CONTINUE (100) (first added in the v0.9.20 release) @@ -3008,7 +3174,7 @@ These constants are usually used in [[#ngx.location.capture|ngx.location.capture == Nginx log level constants == -'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' ngx.STDERR @@ -3028,7 +3194,7 @@ These constants are usually used by the [[#ngx.log|ngx.log]] method. '''syntax:''' ''print(...)'' -'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Writes argument values into the Nginx error.log file with the ngx.NOTICE log level. @@ -3131,7 +3297,7 @@ Then GET /orig will give rather than the original "hello" value. Because HTTP request is created after SSL handshake, the ngx.ctx created -in [[#ssl_certificate_by_lua|ssl_certificate_by_lua*]], [[#ssl_session_store_by_lua|ssl_session_store_by_lua*]] and [[#ssl_session_fetch_by_lua|ssl_session_fetch_by_lua*]] +in [[#ssl_certificate_by_lua|ssl_certificate_by_lua*]], [[#ssl_session_store_by_lua|ssl_session_store_by_lua*]], [[#ssl_session_fetch_by_lua|ssl_session_fetch_by_lua*]] and [[#ssl_client_hello_by_lua|ssl_client_hello_by_lua*]] is not available in the following phases like [[#rewrite_by_lua|rewrite_by_lua*]]. Since dev, the ngx.ctx created during a SSL handshake @@ -4383,7 +4549,7 @@ See also [[#ngx.req.set_body_data|ngx.req.set_body_data]]. '''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*'' -Creates a new blank request body for the current request and inializes the buffer for later request body data writing via the [[#ngx.req.append_body|ngx.req.append_body]] and [[#ngx.req.finish_body|ngx.req.finish_body]] APIs. +Creates a new blank request body for the current request and initializes the buffer for later request body data writing via the [[#ngx.req.append_body|ngx.req.append_body]] and [[#ngx.req.finish_body|ngx.req.finish_body]] APIs. If the buffer_size argument is specified, then its value will be used for the size of the memory buffer for body writing with [[#ngx.req.append_body|ngx.req.append_body]]. If the argument is omitted, then the value specified by the standard [[HttpCoreModule#client_body_buffer_size|client_body_buffer_size]] directive will be used instead. @@ -4676,7 +4842,7 @@ Just as [[#ngx.print|ngx.print]] but also emit a trailing newline. '''syntax:''' ''ngx.log(log_level, ...)'' -'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Log arguments concatenated to error.log with the given logging level. @@ -4708,7 +4874,7 @@ Since v0.8.3 this function returns 1 on success, or re '''syntax:''' ''ngx.exit(status)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' When status >= 200 (i.e., ngx.HTTP_OK and above), it will interrupt the execution of the current request and return status code to Nginx. @@ -4789,7 +4955,7 @@ Since v0.8.3 this function returns 1 on success, or re '''syntax:''' ''ngx.sleep(seconds)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Sleeps for the specified seconds without blocking. One can specify time resolution up to 0.001 seconds (i.e., one millisecond). @@ -4803,7 +4969,7 @@ This method was introduced in the 0.5.0rc30 release. '''syntax:''' ''newstr = ngx.escape_uri(str, type?)'' -'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Since `v0.10.16`, this function accepts an optional type argument. It accepts the following values (defaults to `2`): @@ -4819,7 +4985,7 @@ alphabetic characters, digits, -, ., _, '''syntax:''' ''newstr = ngx.unescape_uri(str)'' -'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Unescape str as an escaped URI component. @@ -4855,7 +5021,7 @@ gives the output '''syntax:''' ''str = ngx.encode_args(table)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_client_hello_by_lua*'' Encode the Lua table to a query args string according to the URI encoded rules. @@ -4907,7 +5073,7 @@ This method was first introduced in the v0.3.1rc27 release. '''syntax:''' ''table, err = ngx.decode_args(str, max_args?)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Decodes a URI encoded query-string into a Lua table. This is the inverse function of [[#ngx.encode_args|ngx.encode_args]]. @@ -4927,7 +5093,7 @@ This method was introduced in the v0.5.0rc29. '''syntax:''' ''newstr = ngx.encode_base64(str, no_padding?)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Encodes str to a base64 digest. @@ -4937,7 +5103,7 @@ Since the 0.9.16 release, an optional boolean-typed no_paddin '''syntax:''' ''newstr = ngx.decode_base64(str)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Decodes the str argument as a base64 digest to the raw form. Returns nil if str is not well formed. @@ -4945,7 +5111,7 @@ Decodes the str argument as a base64 digest to the raw form. Return '''syntax:''' ''intval = ngx.crc32_short(str)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Calculates the CRC-32 (Cyclic Redundancy Code) digest for the str argument. @@ -4959,7 +5125,7 @@ This API was first introduced in the v0.3.1rc8 release. '''syntax:''' ''intval = ngx.crc32_long(str)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Calculates the CRC-32 (Cyclic Redundancy Code) digest for the str argument. @@ -4973,7 +5139,7 @@ This API was first introduced in the v0.3.1rc8 release. '''syntax:''' ''digest = ngx.hmac_sha1(secret_key, str)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Computes the [https://en.wikipedia.org/wiki/HMAC HMAC-SHA1] digest of the argument str and turns the result using the secret key . @@ -5002,7 +5168,7 @@ This function was first introduced in the v0.3.1rc29 release. '''syntax:''' ''digest = ngx.md5(str)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Returns the hexadecimal representation of the MD5 digest of the str argument. @@ -5026,7 +5192,7 @@ See [[#ngx.md5_bin|ngx.md5_bin]] if the raw binary MD5 digest is required. '''syntax:''' ''digest = ngx.md5_bin(str)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Returns the binary form of the MD5 digest of the str argument. @@ -5036,7 +5202,7 @@ See [[#ngx.md5|ngx.md5]] if the hexadecimal form of the MD5 digest is required. '''syntax:''' ''digest = ngx.sha1_bin(str)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Returns the binary form of the SHA-1 digest of the str argument. @@ -5048,7 +5214,7 @@ This function was first introduced in the v0.5.0rc6. '''syntax:''' ''quoted_value = ngx.quote_sql_str(raw_value)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Returns a quoted SQL string literal according to the MySQL quoting rules. @@ -5056,7 +5222,7 @@ Returns a quoted SQL string literal according to the MySQL quoting rules. '''syntax:''' ''str = ngx.today()'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Returns current date (in the format yyyy-mm-dd) from the Nginx cached time (no syscall involved unlike Lua's date library). @@ -5066,7 +5232,7 @@ This is the local time. '''syntax:''' ''secs = ngx.time()'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Returns the elapsed seconds from the epoch for the current time stamp from the Nginx cached time (no syscall involved unlike Lua's date library). @@ -5076,7 +5242,7 @@ Updates of the Nginx time cache can be forced by calling [[#ngx.update_time|ngx. '''syntax:''' ''secs = ngx.now()'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Returns a floating-point number for the elapsed time in seconds (including milliseconds as the decimal part) from the epoch for the current time stamp from the Nginx cached time (no syscall involved unlike Lua's date library). @@ -5088,7 +5254,7 @@ This API was first introduced in v0.3.1rc32. '''syntax:''' ''ngx.update_time()'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Forcibly updates the Nginx current time cache. This call involves a syscall and thus has some overhead, so do not abuse it. @@ -5098,7 +5264,7 @@ This API was first introduced in v0.3.1rc32. '''syntax:''' ''str = ngx.localtime()'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Returns the current time stamp (in the format yyyy-mm-dd hh:mm:ss) of the Nginx cached time (no syscall involved unlike Lua's [https://www.lua.org/manual/5.1/manual.html#pdf-os.date os.date] function). @@ -5108,7 +5274,7 @@ This is the local time. '''syntax:''' ''str = ngx.utctime()'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Returns the current time stamp (in the format yyyy-mm-dd hh:mm:ss) of the Nginx cached time (no syscall involved unlike Lua's [https://www.lua.org/manual/5.1/manual.html#pdf-os.date os.date] function). @@ -5118,7 +5284,7 @@ This is the UTC time. '''syntax:''' ''str = ngx.cookie_time(sec)'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Returns a formatted string can be used as the cookie expiration time. The parameter sec is the time stamp in seconds (like those returned from [[#ngx.time|ngx.time]]). @@ -5131,7 +5297,7 @@ Returns a formatted string can be used as the cookie expiration time. The parame '''syntax:''' ''str = ngx.http_time(sec)'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Returns a formated string can be used as the http header time (for example, being used in Last-Modified header). The parameter sec is the time stamp in seconds (like those returned from [[#ngx.time|ngx.time]]). @@ -5144,7 +5310,7 @@ Returns a formated string can be used as the http header time (for example, bein '''syntax:''' ''sec = ngx.parse_http_time(str)'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Parse the http time string (as returned by [[#ngx.http_time|ngx.http_time]]) into seconds. Returns the seconds or nil if the input string is in bad forms. @@ -5167,7 +5333,7 @@ Returns true if the current request is an Nginx subrequest, or subject string using the Perl compatible regular expression regex with the optional options. @@ -5315,7 +5481,7 @@ This feature was introduced in the v0.2.1rc11 release. '''syntax:''' ''from, to, err = ngx.re.find(subject, regex, options?, ctx?, nth?)'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Similar to [[#ngx.re.match|ngx.re.match]] but only returns the beginning index (from) and end index (to) of the matched substring. The returned indexes are 1-based and can be fed directly into the [https://www.lua.org/manual/5.1/manual.html#pdf-string.sub string.sub] API function to obtain the matched substring. @@ -5365,7 +5531,7 @@ This API function was first introduced in the v0.9.2 release. '''syntax:''' ''iterator, err = ngx.re.gmatch(subject, regex, options?)'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Similar to [[#ngx.re.match|ngx.re.match]], but returns a Lua iterator instead, so as to let the user programmer iterate all the matches over the string argument with the PCRE regex. @@ -5439,7 +5605,7 @@ This feature was first introduced in the v0.2.1rc12 release. '''syntax:''' ''newstr, n, err = ngx.re.sub(subject, regex, replace, options?)'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Substitutes the first match of the Perl compatible regular expression regex on the subject argument string with the string or function argument replace. The optional options argument has exactly the same meaning as in [[#ngx.re.match|ngx.re.match]]. @@ -5500,7 +5666,7 @@ This feature was first introduced in the v0.2.1rc13 release. '''syntax:''' ''newstr, n, err = ngx.re.gsub(subject, regex, replace, options?)'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Just like [[#ngx.re.sub|ngx.re.sub]], but does global substitution. @@ -5536,7 +5702,7 @@ This feature was first introduced in the v0.2.1rc15 release. '''syntax:''' ''dict = ngx.shared[name_var]'' -'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Fetching the shm-based Lua dictionary object for the shared memory zone named DICT defined by the [[#lua_shared_dict|lua_shared_dict]] directive. @@ -5616,7 +5782,7 @@ This feature was first introduced in the v0.3.1rc22 release. '''syntax:''' ''value, flags = ngx.shared.DICT:get(key)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Retrieving the value in the dictionary [[#ngx.shared.DICT|ngx.shared.DICT]] for the key key. If the key does not exist or has expired, then nil will be returned. @@ -5650,7 +5816,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''value, flags, stale = ngx.shared.DICT:get_stale(key)'' -'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Similar to the [[#ngx.shared.DICT.get|get]] method but returns the value even if the key has already expired. @@ -5666,7 +5832,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''success, err, forcible = ngx.shared.DICT:set(key, value, exptime?, flags?)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Unconditionally sets a key-value pair into the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]]. Returns three values: @@ -5714,7 +5880,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''ok, err = ngx.shared.DICT:safe_set(key, value, exptime?, flags?)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Similar to the [[#ngx.shared.DICT.set|set]] method, but never overrides the (least recently used) unexpired items in the store when running out of storage in the shared memory zone. In this case, it will immediately return nil and the string "no memory". @@ -5726,7 +5892,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''success, err, forcible = ngx.shared.DICT:add(key, value, exptime?, flags?)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Just like the [[#ngx.shared.DICT.set|set]] method, but only stores the key-value pair into the dictionary [[#ngx.shared.DICT|ngx.shared.DICT]] if the key does ''not'' exist. @@ -5740,7 +5906,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''ok, err = ngx.shared.DICT:safe_add(key, value, exptime?, flags?)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Similar to the [[#ngx.shared.DICT.add|add]] method, but never overrides the (least recently used) unexpired items in the store when running out of storage in the shared memory zone. In this case, it will immediately return nil and the string "no memory". @@ -5752,7 +5918,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''success, err, forcible = ngx.shared.DICT:replace(key, value, exptime?, flags?)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Just like the [[#ngx.shared.DICT.set|set]] method, but only stores the key-value pair into the dictionary [[#ngx.shared.DICT|ngx.shared.DICT]] if the key ''does'' exist. @@ -5766,7 +5932,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''ngx.shared.DICT:delete(key)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Unconditionally removes the key-value pair from the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]]. @@ -5780,7 +5946,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''newval, err, forcible? = ngx.shared.DICT:incr(key, value, init?, init_ttl?)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' '''optional requirement:''' resty.core.shdict or resty.core @@ -5831,7 +5997,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''length, err = ngx.shared.DICT:lpush(key, value)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Inserts the specified (numerical or string) value at the head of the list named key in the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]]. Returns the number of elements in the list after the push operation. @@ -5847,7 +6013,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''length, err = ngx.shared.DICT:rpush(key, value)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Similar to the [[#ngx.shared.DICT.lpush|lpush]] method, but inserts the specified (numerical or string) value at the tail of the list named key. @@ -5859,7 +6025,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''val, err = ngx.shared.DICT:lpop(key)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Removes and returns the first element of the list named key in the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]]. @@ -5873,7 +6039,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''val, err = ngx.shared.DICT:rpop(key)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Removes and returns the last element of the list named key in the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]]. @@ -5887,7 +6053,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''len, err = ngx.shared.DICT:llen(key)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Returns the number of elements in the list named key in the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]]. @@ -5901,7 +6067,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''ttl, err = ngx.shared.DICT:ttl(key)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' '''requires:''' resty.core.shdict or resty.core @@ -5935,7 +6101,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''success, err = ngx.shared.DICT:expire(key, exptime)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' '''requires:''' resty.core.shdict or resty.core @@ -5971,7 +6137,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''ngx.shared.DICT:flush_all()'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Flushes out all the items in the dictionary. This method does not actually free up all the memory blocks in the dictionary but just marks all the existing items as expired. @@ -5983,7 +6149,7 @@ See also [[#ngx.shared.DICT.flush_expired|ngx.shared.DICT.flush_expired]] and [[ '''syntax:''' ''flushed = ngx.shared.DICT:flush_expired(max_count?)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Flushes out the expired items in the dictionary, up to the maximal number specified by the optional max_count argument. When the max_count argument is given 0 or not given at all, then it means unlimited. Returns the number of items that have actually been flushed. @@ -5997,7 +6163,7 @@ See also [[#ngx.shared.DICT.flush_all|ngx.shared.DICT.flush_all]] and [[#ngx.sha '''syntax:''' ''keys = ngx.shared.DICT:get_keys(max_count?)'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Fetch a list of the keys from the dictionary, up to . @@ -6011,7 +6177,7 @@ This feature was first introduced in the v0.7.3 release. '''syntax:''' ''capacity_bytes = ngx.shared.DICT:capacity()'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' '''requires:''' resty.core.shdict or resty.core @@ -6039,7 +6205,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''free_page_bytes = ngx.shared.DICT:free_space()'' -'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''init_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' '''requires:''' resty.core.shdict or resty.core @@ -6078,7 +6244,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]]. '''syntax:''' ''udpsock = ngx.socket.udp()'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Creates and returns a UDP or datagram-oriented unix domain socket object (also known as one type of the "cosocket" objects). The following methods are supported on this object: @@ -6100,7 +6266,7 @@ See also [[#ngx.socket.tcp|ngx.socket.tcp]]. '''syntax:''' ''ok, err = udpsock:setpeername("unix:/path/to/unix-domain.socket")'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Attempts to connect a UDP socket object to a remote server or to a datagram unix domain socket file. Because the datagram protocol is actually connection-less, this method does not really establish a "connection", but only just set the name of the remote peer for subsequent read/write operations. @@ -6157,7 +6323,7 @@ This method was first introduced in the v0.5.7 release. '''syntax:''' ''ok, err = udpsock:send(data)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Sends data on the current UDP or datagram unix domain socket object. @@ -6171,7 +6337,7 @@ This feature was first introduced in the v0.5.7 release. '''syntax:''' ''data, err = udpsock:receive(size?)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Receives data from the UDP or datagram unix domain socket object with an optional receive buffer size argument, size. @@ -6203,7 +6369,7 @@ This feature was first introduced in the v0.5.7 release. '''syntax:''' ''ok, err = udpsock:close()'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Closes the current UDP or datagram unix domain socket. It returns the 1 in case of success and returns nil with a string describing the error otherwise. @@ -6215,7 +6381,7 @@ This feature was first introduced in the v0.5.7 release. '''syntax:''' ''udpsock:settimeout(time)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Set the timeout value in milliseconds for subsequent socket operations (like [[#udpsock:receive|receive]]). @@ -6234,7 +6400,7 @@ This API function was first added to the v0.10.1 release. '''syntax:''' ''tcpsock = ngx.socket.tcp()'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Creates and returns a TCP or stream-oriented unix domain socket object (also known as one type of the "cosocket" objects). The following methods are supported on this object: @@ -6280,7 +6446,7 @@ See also [[#ngx.socket.udp|ngx.socket.udp]]. '''syntax:''' ''ok, err = tcpsock:connect("unix:/path/to/unix-domain.socket", options_table?)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Attempts to connect a TCP socket object to a remote server or to a stream unix domain socket file without blocking. @@ -6393,7 +6559,7 @@ This method was first introduced in the v0.5.0rc1 release. '''syntax:''' ''session, err = tcpsock:sslhandshake(reused_session?, server_name?, ssl_verify?, send_status_req?)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Does SSL/TLS handshake on the currently established connection. @@ -6436,7 +6602,7 @@ This method was first introduced in the v0.9.11 release. '''syntax:''' ''bytes, err = tcpsock:send(data)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Sends data without blocking on the current TCP or Unix Domain Socket connection. @@ -6465,7 +6631,7 @@ This feature was first introduced in the v0.5.0rc1 release. '''syntax:''' ''data, err, partial = tcpsock:receive(pattern?)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Receives data from the connected socket according to the reading pattern or size. @@ -6504,7 +6670,7 @@ This feature was first introduced in the v0.5.0rc1 release. '''syntax:''' ''data, err = tcpsock:receiveany(max)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Returns any data received by the connected socket, at most max bytes. @@ -6535,7 +6701,7 @@ This feature was first introduced in the v0.10.14 release. '''syntax:''' ''iterator = tcpsock:receiveuntil(pattern, options?)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' This method returns an iterator Lua function that can be called to read the data stream until it sees the specified pattern or an error occurs. @@ -6628,7 +6794,7 @@ This method was first introduced in the v0.5.0rc1 release. '''syntax:''' ''ok, err = tcpsock:close()'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Closes the current TCP or stream unix domain socket. It returns the 1 in case of success and returns nil with a string describing the error otherwise. @@ -6642,7 +6808,7 @@ This feature was first introduced in the v0.5.0rc1 release. '''syntax:''' ''tcpsock:settimeout(time)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Set the timeout value in milliseconds for subsequent socket operations ([[#tcpsock:connect|connect]], [[#tcpsock:receive|receive]], and iterators returned from [[#tcpsock:receiveuntil|receiveuntil]]). @@ -6656,7 +6822,7 @@ This feature was first introduced in the v0.5.0rc1 release. '''syntax:''' ''tcpsock:settimeouts(connect_timeout, send_timeout, read_timeout)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Respectively sets the connect, send, and read timeout thresholds (in milliseconds) for subsequent socket operations ([[#tcpsock:connect|connect]], [[#tcpsock:send|send]], [[#tcpsock:receive|receive]], and iterators returned from [[#tcpsock:receiveuntil|receiveuntil]]). @@ -6673,7 +6839,7 @@ This feature was first introduced in the v0.10.7 release. '''syntax:''' ''ok, err = tcpsock:setoption(option, value?)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' This function is added for [http://w3.impa.br/~diego/software/luasocket/tcp.html LuaSocket] API compatibility and does nothing for now. Its functionality is implemented v0.10.18. @@ -6767,7 +6933,7 @@ These options described above are supported in v0.10.18, and more o '''syntax:''' ''ok, err = tcpsock:setkeepalive(timeout?, size?)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Puts the current socket's connection immediately into the cosocket built-in connection pool and keep it alive until other [[#tcpsock:connect|connect]] method calls request it or the associated maximal idle timeout is expired. @@ -6811,7 +6977,7 @@ This feature was first introduced in the v0.5.0rc1 release. '''syntax:''' ''count, err = tcpsock:getreusedtimes()'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' This method returns the (successfully) reused times for the current connection. In case of error, it returns nil and a string describing the error. @@ -6846,7 +7012,7 @@ This feature was first introduced in the v0.5.0rc1 release. '''syntax:''' ''str = ngx.get_phase()'' -'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_by_lua*, init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Retrieves the current running phase name. Possible return values are @@ -6860,6 +7026,8 @@ Retrieves the current running phase name. Possible return values are : for the context of [[#ssl_session_fetch_by_lua_block|ssl_session_fetch_by_lua*]]. * ssl_session_store : for the context of [[#ssl_session_store_by_lua_block|ssl_session_store_by_lua*]]. +* ssl_client_hello +: for the context of [[#ssl_client_hello_by_lua_block|ssl_client_hello_by_lua*]]. * set : for the context of [[#set_by_lua|set_by_lua*]]. * rewrite @@ -6887,7 +7055,7 @@ This API was first introduced in the v0.5.10 release. '''syntax:''' ''co = ngx.thread.spawn(func, arg1, arg2, ...)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Spawns a new user "light thread" with the Lua function func as well as those optional arguments arg1, arg2, and etc. Returns a Lua thread (or Lua coroutine) object represents this "light thread". @@ -7021,7 +7189,7 @@ This API was first enabled in the v0.7.0 release. '''syntax:''' ''ok, res1, res2, ... = ngx.thread.wait(thread1, thread2, ...)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Waits on one or more child "light threads" and returns the results of the first "light thread" that terminates (either successfully or with an error). @@ -7120,7 +7288,7 @@ This API was first enabled in the v0.7.0 release. '''syntax:''' ''ok, err = ngx.thread.kill(thread)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua*'' Kills a running "light thread" created by [[#ngx.thread.spawn|ngx.thread.spawn]]. Returns a true value when successful or nil and a string describing the error otherwise. @@ -7169,7 +7337,7 @@ See also [[#lua_check_client_abort|lua_check_client_abort]]. '''syntax:''' ''hdl, err = ngx.timer.at(delay, callback, user_arg1, user_arg2, ...)'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Creates an Nginx timer with a user callback function as well as optional user arguments. @@ -7307,7 +7475,7 @@ This API was first introduced in the v0.8.0 release. '''syntax:''' ''hdl, err = ngx.timer.every(delay, callback, user_arg1, user_arg2, ...)'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Similar to the [[#ngx.timer.at|ngx.timer.at]] API function, but @@ -7327,7 +7495,7 @@ This API was first introduced in the v0.10.9 release. '''syntax:''' ''count = ngx.timer.running_count()'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Returns the number of timers currently running. @@ -7337,7 +7505,7 @@ This directive was first introduced in the v0.9.20 release. '''syntax:''' ''count = ngx.timer.pending_count()'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' Returns the number of pending timers. @@ -7530,7 +7698,7 @@ This feature requires at least ngx_lua v0.10.0. '''syntax:''' ''res = ndk.set_var.DIRECTIVE_NAME'' -'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*'' +'''context:''' ''init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, exit_worker_by_lua*, ssl_client_hello_by_lua*'' This mechanism allows calling other Nginx C modules' directives that are implemented by [https://github.com/simplresty/ngx_devel_kit Nginx Devel Kit] (NDK)'s set_var submodule's ndk_set_var_value. @@ -7568,7 +7736,7 @@ This feature requires the [https://github.com/simplresty/ngx_devel_kit ngx_devel '''syntax:''' ''co = coroutine.create(f)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Creates a user Lua coroutines with a Lua function, and returns a coroutine object. @@ -7582,9 +7750,9 @@ This API was first introduced in the v0.6.0 release. '''syntax:''' ''ok, ... = coroutine.resume(co, ...)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' -Resumes the executation of a user Lua coroutine object previously yielded or just created. +Resumes the execution of a user Lua coroutine object previously yielded or just created. Similar to the standard Lua [https://www.lua.org/manual/5.1/manual.html#pdf-coroutine.resume coroutine.resume] API, but works in the context of the Lua coroutines created by ngx_lua. @@ -7596,7 +7764,7 @@ This API was first introduced in the v0.6.0 release. '''syntax:''' ''... = coroutine.yield(...)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Yields the execution of the current user Lua coroutine. @@ -7610,7 +7778,7 @@ This API was first introduced in the v0.6.0 release. '''syntax:''' ''co = coroutine.wrap(f)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Similar to the standard Lua [https://www.lua.org/manual/5.1/manual.html#pdf-coroutine.wrap coroutine.wrap] API, but works in the context of the Lua coroutines created by ngx_lua. @@ -7622,7 +7790,7 @@ This API was first introduced in the v0.6.0 release. '''syntax:''' ''co = coroutine.running()'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Identical to the standard Lua [https://www.lua.org/manual/5.1/manual.html#pdf-coroutine.running coroutine.running] API. @@ -7634,7 +7802,7 @@ This API was first enabled in the v0.6.0 release. '''syntax:''' ''status = coroutine.status(co)'' -'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*'' +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*, init_by_lua*, ngx.timer.*, header_filter_by_lua*, body_filter_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*'' Identical to the standard Lua [https://www.lua.org/manual/5.1/manual.html#pdf-coroutine.status coroutine.status] API. @@ -7642,6 +7810,133 @@ This API was first usable in the context of [[#init_by_lua|init_by_lua*]] since This API was first enabled in the v0.6.0 release. +== ngx.run_worker_thread == + +'''syntax:''' ''ok, res1, res2, ... = ngx.run_worker_thread(threadpool, module_name, func_name, arg1, arg2, ...)'' + +'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*'' + +'''This API is still experimental and may change in the future without notice.''' + +'''This API is available only for Linux.''' + +Wrap the [http://nginx.org/en/docs/dev/development_guide.html#threads nginx worker thread] to execute lua function. The caller coroutine would yield until the function returns. + +Only the following ngx_lua APIs could be used in `function_name` function of the `module` module: + +* `ngx.encode_base64` +* `ngx.decode_base64` + +* `ngx.hmac_sha1` +* `ngx.encode_args` +* `ngx.decode_args` +* `ngx.quote_sql_str` + +* `ngx.re.match` +* `ngx.re.find` +* `ngx.re.gmatch` +* `ngx.re.sub` +* `ngx.re.gsub` + +* `ngx.crc32_short` +* `ngx.crc32_long` +* `ngx.hmac_sha1` +* `ngx.md5_bin` +* `ngx.md5` + +* `ngx.config.subsystem` +* `ngx.config.debug` +* `ngx.config.prefix` +* `ngx.config.nginx_version` +* `ngx.config.nginx_configure` +* `ngx.config.ngx_lua_version` + + +The first argument `threadpool` specifies the Nginx thread pool name defined by [thread_pool](https://nginx.org/en/docs/ngx_core_module.html#thread_pool). + +The second argument module_name specifies the lua module name to execute in the worker thread, which would return a lua table. The module must be inside the package path, e.g. + + +lua_package_path '/opt/openresty/?.lua;;'; + + +The third argument func_name specifies the function field in the module table as the second argument. + +The type of args must be one of type below: + +* boolean +* number +* string +* nil +* table (the table may be recursive, and contains members of types above.) + +The ok is in boolean type, which indicate the C land error (failed to get thread from thread pool, pcall the module function failed, .etc). If ok is false, the res1 is the error string. + +The return values (res1, ...) are returned by invocation of the module function. Normally, the res1 should be in boolean type, so that the caller could inspect the error. + +This API is useful when you need to execute the below types of tasks: + +* CPU bound task, e.g. do md5 calculation +* File I/O task +* Call os.execute() or blocking C API via ffi +* Call external Lua library not based on cosocket or nginx + +Example1: do md5 calculation. + + +location /calc_md5 { + default_type 'text/plain'; + + content_by_lua_block { + local ok, md5_or_err = ngx.run_worker_thread("testpool", "md5", "md5") + ngx.say(ok, " : ", md5_or_err) + } +} + + + +md5.lua + + +local function md5() + return ngx.md5("hello") +end +return {md5=md5} + + +Example2: write logs into the log file. + + +location /write_log_file { + default_type 'text/plain'; + + content_by_lua_block { + local ok, err = ngx.run_worker_thread("testpool", "write_log_file", "log", ngx.var.arg_str) + if not ok then + ngx.say(ok, " : ", err) + return + end + ngx.say(ok) + } +} + + +write_log_file.lua + + +local function log(str) + local file, err = io.open("/tmp/tmp.log", "a") + if not file then + return false, err + end + file:write(str) + file:flush() + file:close() + return true +end +return {log=log} + + = Obsolete Sections = This section is just holding obsolete documentation sections that have been either renamed or removed so that existing links over the web are still valid. diff --git a/src/deps/src/lua-nginx-module/src/api/ngx_http_lua_api.h b/src/deps/src/lua-nginx-module/src/api/ngx_http_lua_api.h index 43f90bd0b..a1ef1f7cb 100644 --- a/src/deps/src/lua-nginx-module/src/api/ngx_http_lua_api.h +++ b/src/deps/src/lua-nginx-module/src/api/ngx_http_lua_api.h @@ -19,7 +19,7 @@ /* Public API for other Nginx modules */ -#define ngx_http_lua_version 10020 +#define ngx_http_lua_version 10022 typedef struct { diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_bodyfilterby.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_bodyfilterby.c index 75608695e..902488911 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_bodyfilterby.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_bodyfilterby.c @@ -235,18 +235,15 @@ ngx_http_lua_body_filter(ngx_http_request_t *r, ngx_chain_t *in) uint16_t old_context; ngx_http_cleanup_t *cln; ngx_chain_t *out; + ngx_chain_t *cl, *ln; ngx_http_lua_main_conf_t *lmcf; ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "lua body filter for user lua code, uri \"%V\"", &r->uri); - if (in == NULL) { - return ngx_http_next_body_filter(r, in); - } - llcf = ngx_http_get_module_loc_conf(r, ngx_http_lua_module); - if (llcf->body_filter_handler == NULL) { + if (llcf->body_filter_handler == NULL || r->header_only) { dd("no body filter handler found"); return ngx_http_next_body_filter(r, in); } @@ -269,7 +266,50 @@ ngx_http_lua_body_filter(ngx_http_request_t *r, ngx_chain_t *in) in->buf->file_pos = in->buf->file_last; } - return NGX_OK; + in = NULL; + + /* continue to call ngx_http_next_body_filter to process cached data */ + } + + if (in != NULL + && ngx_chain_add_copy(r->pool, &ctx->filter_in_bufs, in) != NGX_OK) + { + return NGX_ERROR; + } + + if (ctx->filter_busy_bufs != NULL + && (r->connection->buffered + & (NGX_HTTP_LOWLEVEL_BUFFERED | NGX_LOWLEVEL_BUFFERED))) + { + /* Socket write buffer was full on last write. + * Try to write the remain data, if still can not write + * do not execute body_filter_by_lua otherwise the `in` chain will be + * replaced by new content from lua and buf of `in` mark as consumed. + * And then ngx_output_chain will call the filter chain again which + * make all the data cached in the memory and long ngx_chain_t link + * cause CPU 100%. + */ + rc = ngx_http_next_body_filter(r, NULL); + + if (rc == NGX_ERROR) { + return rc; + } + + out = NULL; + ngx_chain_update_chains(r->pool, + &ctx->free_bufs, &ctx->filter_busy_bufs, &out, + (ngx_buf_tag_t) &ngx_http_lua_module); + if (rc != NGX_OK + && ctx->filter_busy_bufs != NULL + && (r->connection->buffered + & (NGX_HTTP_LOWLEVEL_BUFFERED | NGX_LOWLEVEL_BUFFERED))) + { + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "waiting body filter busy buffer to be sent"); + return NGX_AGAIN; + } + + /* continue to process bufs in ctx->filter_in_bufs */ } if (ctx->cleanup == NULL) { @@ -286,38 +326,57 @@ ngx_http_lua_body_filter(ngx_http_request_t *r, ngx_chain_t *in) old_context = ctx->context; ctx->context = NGX_HTTP_LUA_CONTEXT_BODY_FILTER; - dd("calling body filter handler"); - rc = llcf->body_filter_handler(r, in); + in = ctx->filter_in_bufs; + ctx->filter_in_bufs = NULL; - dd("calling body filter handler returned %d", (int) rc); + if (in != NULL) { + dd("calling body filter handler"); + rc = llcf->body_filter_handler(r, in); - ctx->context = old_context; + dd("calling body filter handler returned %d", (int) rc); - if (rc != NGX_OK) { - return NGX_ERROR; + ctx->context = old_context; + + if (rc != NGX_OK) { + return NGX_ERROR; + } + + lmcf = ngx_http_get_module_main_conf(r, ngx_http_lua_module); + + /* lmcf->body_filter_chain is the new buffer chain if + * body_filter_by_lua set new body content via ngx.arg[1] = new_content + * otherwise it is the original `in` buffer chain. + */ + out = lmcf->body_filter_chain; + + if (in != out) { + /* content of body was replaced in + * ngx_http_lua_body_filter_param_set and the buffers was marked + * as consumed. + */ + for (cl = in; cl != NULL; cl = ln) { + ln = cl->next; + ngx_free_chain(r->pool, cl); + } + + if (out == NULL) { + /* do not forward NULL to the next filters because the input is + * not NULL */ + return NGX_OK; + } + } + + } else { + out = NULL; } - lmcf = ngx_http_get_module_main_conf(r, ngx_http_lua_module); - out = lmcf->body_filter_chain; - - if (in == out) { - return ngx_http_next_body_filter(r, in); - } - - if (out == NULL) { - /* do not forward NULL to the next filters because the input is - * not NULL */ - return NGX_OK; - } - - /* in != out */ rc = ngx_http_next_body_filter(r, out); if (rc == NGX_ERROR) { return NGX_ERROR; } ngx_chain_update_chains(r->pool, - &ctx->free_bufs, &ctx->busy_bufs, &out, + &ctx->free_bufs, &ctx->filter_busy_bufs, &out, (ngx_buf_tag_t) &ngx_http_lua_module); return rc; diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_cache.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_cache.c index 30f29fc4a..0b1b8ecda 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_cache.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_cache.c @@ -120,7 +120,7 @@ not_found: dd("Value associated with given key in code cache table is not code " "chunk: stack top=%d, top value type=%s\n", - lua_gettop(L), lua_typename(L, -1)); + lua_gettop(L), luaL_typename(L, -1)); /* remove cache table and value from stack */ lua_pop(L, 2); /* sp-=2 */ diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_clfactory.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_clfactory.c index e8a8a0e1f..c13fd14dc 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_clfactory.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_clfactory.c @@ -126,7 +126,7 @@ * | at [p[i]] | * --------------------- * | Vector | Debug lineinfo vector - * | [lineinfo] | Empty vector here if dubug info is stripped + * | [lineinfo] | Empty vector here if debug info is stripped * --------------------- * | Int | Number of local variable in this function * | [sizelocvars] | 0 if debug info is stripped @@ -136,7 +136,7 @@ * | .varname] | | * --------------------- | * | Int | instruction counter | - * | [locvars[i]] | where lcoal var i start to be |-> repeat for i in + * | [locvars[i]] | where local var i start to be |-> repeat for i in * | .startpc] | referenced | [0..sizelocvars] * --------------------- | * | Int | instruction counter, where local | diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_common.h b/src/deps/src/lua-nginx-module/src/ngx_http_lua_common.h index 0751a1123..9f991d1aa 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_common.h +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_common.h @@ -125,20 +125,21 @@ typedef struct { /* must be within 16 bit */ -#define NGX_HTTP_LUA_CONTEXT_SET 0x0001 -#define NGX_HTTP_LUA_CONTEXT_REWRITE 0x0002 -#define NGX_HTTP_LUA_CONTEXT_ACCESS 0x0004 -#define NGX_HTTP_LUA_CONTEXT_CONTENT 0x0008 -#define NGX_HTTP_LUA_CONTEXT_LOG 0x0010 -#define NGX_HTTP_LUA_CONTEXT_HEADER_FILTER 0x0020 -#define NGX_HTTP_LUA_CONTEXT_BODY_FILTER 0x0040 -#define NGX_HTTP_LUA_CONTEXT_TIMER 0x0080 -#define NGX_HTTP_LUA_CONTEXT_INIT_WORKER 0x0100 -#define NGX_HTTP_LUA_CONTEXT_BALANCER 0x0200 -#define NGX_HTTP_LUA_CONTEXT_SSL_CERT 0x0400 -#define NGX_HTTP_LUA_CONTEXT_SSL_SESS_STORE 0x0800 -#define NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH 0x1000 -#define NGX_HTTP_LUA_CONTEXT_EXIT_WORKER 0x2000 +#define NGX_HTTP_LUA_CONTEXT_SET 0x0001 +#define NGX_HTTP_LUA_CONTEXT_REWRITE 0x0002 +#define NGX_HTTP_LUA_CONTEXT_ACCESS 0x0004 +#define NGX_HTTP_LUA_CONTEXT_CONTENT 0x0008 +#define NGX_HTTP_LUA_CONTEXT_LOG 0x0010 +#define NGX_HTTP_LUA_CONTEXT_HEADER_FILTER 0x0020 +#define NGX_HTTP_LUA_CONTEXT_BODY_FILTER 0x0040 +#define NGX_HTTP_LUA_CONTEXT_TIMER 0x0080 +#define NGX_HTTP_LUA_CONTEXT_INIT_WORKER 0x0100 +#define NGX_HTTP_LUA_CONTEXT_BALANCER 0x0200 +#define NGX_HTTP_LUA_CONTEXT_SSL_CERT 0x0400 +#define NGX_HTTP_LUA_CONTEXT_SSL_SESS_STORE 0x0800 +#define NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH 0x1000 +#define NGX_HTTP_LUA_CONTEXT_EXIT_WORKER 0x2000 +#define NGX_HTTP_LUA_CONTEXT_SSL_CLIENT_HELLO 0x4000 #define NGX_HTTP_LUA_FFI_NO_REQ_CTX -100 @@ -272,7 +273,7 @@ struct ngx_http_lua_main_conf_s { ngx_http_lua_sema_mm_t *sema_mm; ngx_uint_t malloc_trim_cycle; /* a cycle is defined as the number - of reqeusts */ + of requests */ ngx_uint_t malloc_trim_req_count; #if (nginx_version >= 1011011) @@ -288,6 +289,8 @@ struct ngx_http_lua_main_conf_s { ngx_queue_t free_lua_threads; /* of ngx_http_lua_thread_ref_t */ ngx_queue_t cached_lua_threads; /* of ngx_http_lua_thread_ref_t */ + ngx_uint_t worker_thread_vm_pool_size; + unsigned requires_header_filter:1; unsigned requires_body_filter:1; unsigned requires_capture_filter:1; @@ -316,6 +319,11 @@ union ngx_http_lua_srv_conf_u { ngx_str_t ssl_sess_fetch_src; u_char *ssl_sess_fetch_src_key; int ssl_sess_fetch_src_ref; + + ngx_http_lua_srv_conf_handler_pt ssl_client_hello_handler; + ngx_str_t ssl_client_hello_src; + u_char *ssl_client_hello_src_key; + int ssl_client_hello_src_ref; } srv; #endif @@ -336,6 +344,9 @@ typedef struct { ngx_uint_t ssl_verify_depth; ngx_str_t ssl_trusted_certificate; ngx_str_t ssl_crl; +#if (nginx_version >= 1019004) + ngx_array_t *ssl_conf_commands; +#endif #endif ngx_flag_t force_read_body; /* whether force request body to @@ -458,6 +469,10 @@ struct ngx_http_lua_co_ctx_s { uint8_t *sr_flags; + unsigned nresults_from_worker_thread; /* number of results + * from worker + * thread callback */ + unsigned nsubreqs; /* number of subrequests of the * current request */ @@ -543,6 +558,9 @@ typedef struct ngx_http_lua_ctx_s { ngx_chain_t *busy_bufs; ngx_chain_t *free_recv_bufs; + ngx_chain_t *filter_in_bufs; /* for the body filter */ + ngx_chain_t *filter_busy_bufs; /* for the body filter */ + ngx_http_cleanup_pt *cleanup; ngx_http_cleanup_t *free_cleanup; /* free list of cleanup records */ diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_control.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_control.c index 9b51c4af3..bb18d8f5d 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_control.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_control.c @@ -370,6 +370,7 @@ ngx_http_lua_ffi_exit(ngx_http_request_t *r, int status, u_char *err, | NGX_HTTP_LUA_CONTEXT_TIMER | NGX_HTTP_LUA_CONTEXT_HEADER_FILTER | NGX_HTTP_LUA_CONTEXT_BALANCER + | NGX_HTTP_LUA_CONTEXT_SSL_CLIENT_HELLO | NGX_HTTP_LUA_CONTEXT_SSL_CERT | NGX_HTTP_LUA_CONTEXT_SSL_SESS_STORE | NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH, @@ -380,6 +381,7 @@ ngx_http_lua_ffi_exit(ngx_http_request_t *r, int status, u_char *err, } if (ctx->context & (NGX_HTTP_LUA_CONTEXT_SSL_CERT + | NGX_HTTP_LUA_CONTEXT_SSL_CLIENT_HELLO | NGX_HTTP_LUA_CONTEXT_SSL_SESS_STORE | NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH)) { diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ctx.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ctx.c index dc8401349..d5431be72 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ctx.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ctx.c @@ -88,6 +88,7 @@ ngx_http_lua_ffi_get_ctx_ref(ngx_http_request_t *r, int *in_ssl_phase, } *in_ssl_phase = ctx->context & (NGX_HTTP_LUA_CONTEXT_SSL_CERT + | NGX_HTTP_LUA_CONTEXT_SSL_CLIENT_HELLO | NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH | NGX_HTTP_LUA_CONTEXT_SSL_SESS_STORE); *ssl_ctx_ref = LUA_NOREF; @@ -123,6 +124,7 @@ ngx_http_lua_ffi_set_ctx_ref(ngx_http_request_t *r, int ref) #if (NGX_HTTP_SSL) if (ctx->context & (NGX_HTTP_LUA_CONTEXT_SSL_CERT + | NGX_HTTP_LUA_CONTEXT_SSL_CLIENT_HELLO | NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH | NGX_HTTP_LUA_CONTEXT_SSL_SESS_STORE)) { diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_directive.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_directive.c index 1ec641e07..831132f12 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_directive.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_directive.c @@ -1537,7 +1537,7 @@ ngx_http_lua_conf_read_lua_token(ngx_conf_t *cf, for ( ;; ) { if (b->pos >= b->last - || (b->last - b->pos < (b->end - b->start) / 3 + || (b->last - b->pos < (b->end - b->start) / 2 && cf->conf_file->file.offset < file_size)) { @@ -1632,7 +1632,7 @@ ngx_http_lua_conf_read_lua_token(ngx_conf_t *cf, } if (len) { - ngx_memcpy(b->start, b->pos, len); + ngx_memmove(b->start, b->pos, len); } size = (ssize_t) (file_size - cf->conf_file->file.offset); @@ -1709,7 +1709,8 @@ ngx_http_lua_conf_read_lua_token(ngx_conf_t *cf, if (q == NULL) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "Lua code block missing the closing " - "long bracket \"%*s\"", + "long bracket \"%*s\", " + "the inlined Lua code may be too long", b->pos + ovec[1] - p, p); return NGX_ERROR; } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_exitworkerby.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_exitworkerby.c index cd59dc4be..f1329566b 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_exitworkerby.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_exitworkerby.c @@ -13,6 +13,10 @@ #include "ngx_http_lua_exitworkerby.h" #include "ngx_http_lua_util.h" +#if (NGX_THREADS) +#include "ngx_http_lua_worker_thread.h" +#endif + void ngx_http_lua_exit_worker(ngx_cycle_t *cycle) @@ -23,6 +27,10 @@ ngx_http_lua_exit_worker(ngx_cycle_t *cycle) ngx_http_lua_ctx_t *ctx; ngx_http_conf_ctx_t *conf_ctx; +#if (NGX_THREADS) + ngx_http_lua_thread_exit_process(); +#endif + lmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_lua_module); if (lmcf == NULL || lmcf->exit_worker_handler == NULL diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_headers.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_headers.c index d8d5edc8b..a376a0eac 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_headers.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_headers.c @@ -677,7 +677,7 @@ ngx_http_lua_ngx_req_header_set_helper(lua_State *L) p = (u_char *) luaL_checklstring(L, -1, &len); /* - * we also copy the trailling '\0' char here because nginx + * we also copy the trailing '\0' char here because nginx * header values must be null-terminated * */ @@ -705,7 +705,7 @@ ngx_http_lua_ngx_req_header_set_helper(lua_State *L) } else { /* - * we also copy the trailling '\0' char here because nginx + * we also copy the trailing '\0' char here because nginx * header values must be null-terminated * */ diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_lex.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_lex.c index 45cf7540e..c9064030c 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_lex.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_lex.c @@ -3,8 +3,7 @@ * * WARNING: DO NOT EVER EDIT THIS FILE!! * - * This file was automatically generated by the re.pl script of sregex's - * "dfa-multi-re" git branch. + * This file was automatically generated by the OpenResty Regex compiler. */ diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_module.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_module.c index 7358a9563..fbeba12a7 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_module.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_module.c @@ -26,6 +26,7 @@ #include "ngx_http_lua_probe.h" #include "ngx_http_lua_semaphore.h" #include "ngx_http_lua_balancer.h" +#include "ngx_http_lua_ssl_client_helloby.h" #include "ngx_http_lua_ssl_certby.h" #include "ngx_http_lua_ssl_session_storeby.h" #include "ngx_http_lua_ssl_session_fetchby.h" @@ -47,6 +48,10 @@ static char *ngx_http_lua_lowat_check(ngx_conf_t *cf, void *post, void *data); #if (NGX_HTTP_SSL) static ngx_int_t ngx_http_lua_set_ssl(ngx_conf_t *cf, ngx_http_lua_loc_conf_t *llcf); +#if (nginx_version >= 1019004) +static char *ngx_http_lua_ssl_conf_command_check(ngx_conf_t *cf, void *post, + void *data); +#endif #endif static char *ngx_http_lua_malloc_trim(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); @@ -73,6 +78,11 @@ static ngx_conf_bitmask_t ngx_http_lua_ssl_protocols[] = { { ngx_null_string, 0 } }; +#if (nginx_version >= 1019004) +static ngx_conf_post_t ngx_http_lua_ssl_conf_command_post = + { ngx_http_lua_ssl_conf_command_check }; +#endif + #endif @@ -557,6 +567,20 @@ static ngx_command_t ngx_http_lua_cmds[] = { offsetof(ngx_http_lua_loc_conf_t, ssl_ciphers), NULL }, + { ngx_string("ssl_client_hello_by_lua_block"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, + ngx_http_lua_ssl_client_hello_by_lua_block, + NGX_HTTP_SRV_CONF_OFFSET, + 0, + (void *) ngx_http_lua_ssl_client_hello_handler_inline }, + + { ngx_string("ssl_client_hello_by_lua_file"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, + ngx_http_lua_ssl_client_hello_by_lua, + NGX_HTTP_SRV_CONF_OFFSET, + 0, + (void *) ngx_http_lua_ssl_client_hello_handler_file }, + { ngx_string("ssl_certificate_by_lua_block"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, ngx_http_lua_ssl_cert_by_lua_block, @@ -620,6 +644,14 @@ static ngx_command_t ngx_http_lua_cmds[] = { offsetof(ngx_http_lua_loc_conf_t, ssl_crl), NULL }, +#if (nginx_version >= 1019004) + { ngx_string("lua_ssl_conf_command"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, + ngx_conf_set_keyval_slot, + NGX_HTTP_LOC_CONF_OFFSET, + offsetof(ngx_http_lua_loc_conf_t, ssl_conf_commands), + &ngx_http_lua_ssl_conf_command_post }, +#endif #endif /* NGX_HTTP_SSL */ { ngx_string("lua_malloc_trim"), @@ -629,6 +661,13 @@ static ngx_command_t ngx_http_lua_cmds[] = { 0, NULL }, + { ngx_string("lua_worker_thread_vm_pool_size"), + NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, + ngx_conf_set_num_slot, + NGX_HTTP_MAIN_CONF_OFFSET, + offsetof(ngx_http_lua_main_conf_t, worker_thread_vm_pool_size), + NULL }, + ngx_null_command }; @@ -958,6 +997,8 @@ ngx_http_lua_create_main_conf(ngx_conf_t *cf) return NULL; } + lmcf->worker_thread_vm_pool_size = NGX_CONF_UNSET; + dd("nginx Lua module main config structure initialized!"); return lmcf; @@ -1041,6 +1082,10 @@ ngx_http_lua_init_main_conf(ngx_conf_t *cf, void *conf) } #endif + if (lmcf->worker_thread_vm_pool_size == NGX_CONF_UNSET_UINT) { + lmcf->worker_thread_vm_pool_size = 100; + } + return NGX_CONF_OK; } @@ -1056,6 +1101,10 @@ ngx_http_lua_create_srv_conf(ngx_conf_t *cf) } /* set by ngx_pcalloc: + * lscf->srv.ssl_client_hello_handler = NULL; + * lscf->srv.ssl_client_hello_src = { 0, NULL }; + * lscf->srv.ssl_client_hello_src_key = NULL; + * * lscf->srv.ssl_cert_handler = NULL; * lscf->srv.ssl_cert_src = { 0, NULL }; * lscf->srv.ssl_cert_src_key = NULL; @@ -1074,6 +1123,7 @@ ngx_http_lua_create_srv_conf(ngx_conf_t *cf) */ #if (NGX_HTTP_SSL) + lscf->srv.ssl_client_hello_src_ref = LUA_REFNIL; lscf->srv.ssl_cert_src_ref = LUA_REFNIL; lscf->srv.ssl_sess_store_src_ref = LUA_REFNIL; lscf->srv.ssl_sess_fetch_src_ref = LUA_REFNIL; @@ -1096,6 +1146,45 @@ ngx_http_lua_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) dd("merge srv conf"); + if (conf->srv.ssl_client_hello_src.len == 0) { + conf->srv.ssl_client_hello_src = prev->srv.ssl_client_hello_src; + conf->srv.ssl_client_hello_src_ref = prev->srv.ssl_client_hello_src_ref; + conf->srv.ssl_client_hello_src_key = prev->srv.ssl_client_hello_src_key; + conf->srv.ssl_client_hello_handler = prev->srv.ssl_client_hello_handler; + } + + if (conf->srv.ssl_client_hello_src.len) { + sscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_ssl_module); + if (sscf == NULL || sscf->ssl.ctx == NULL) { + ngx_log_error(NGX_LOG_EMERG, cf->log, 0, + "no ssl configured for the server"); + + return NGX_CONF_ERROR; + } +#ifdef LIBRESSL_VERSION_NUMBER + ngx_log_error(NGX_LOG_EMERG, cf->log, 0, + "LibreSSL does not support by ssl_client_hello_by_lua*"); + return NGX_CONF_ERROR; + +#else + +#ifdef SSL_ERROR_WANT_CLIENT_HELLO_CB + + SSL_CTX_set_client_hello_cb(sscf->ssl.ctx, + ngx_http_lua_ssl_client_hello_handler, + NULL); + +#else + + ngx_log_error(NGX_LOG_EMERG, cf->log, 0, + "OpenSSL too old to support " + "ssl_client_hello_by_lua*"); + return NGX_CONF_ERROR; + +#endif +#endif + } + if (conf->srv.ssl_cert_src.len == 0) { conf->srv.ssl_cert_src = prev->srv.ssl_cert_src; conf->srv.ssl_cert_src_ref = prev->srv.ssl_cert_src_ref; @@ -1252,6 +1341,9 @@ ngx_http_lua_create_loc_conf(ngx_conf_t *cf) #if (NGX_HTTP_SSL) conf->ssl_verify_depth = NGX_CONF_UNSET_UINT; +#if (nginx_version >= 1019004) + conf->ssl_conf_commands = NGX_CONF_UNSET_PTR; +#endif #endif return conf; @@ -1326,6 +1418,11 @@ ngx_http_lua_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) prev->ssl_trusted_certificate, ""); ngx_conf_merge_str_value(conf->ssl_crl, prev->ssl_crl, ""); +#if (nginx_version >= 1019004) + ngx_conf_merge_ptr_value(conf->ssl_conf_commands, prev->ssl_conf_commands, + NULL); +#endif + if (ngx_http_lua_set_ssl(cf, conf) != NGX_OK) { return NGX_CONF_ERROR; } @@ -1388,6 +1485,7 @@ ngx_http_lua_set_ssl(ngx_conf_t *cf, ngx_http_lua_loc_conf_t *llcf) cln = ngx_pool_cleanup_add(cf->pool, 0); if (cln == NULL) { + ngx_ssl_cleanup_ctx(llcf->ssl); return NGX_ERROR; } @@ -1419,9 +1517,29 @@ ngx_http_lua_set_ssl(ngx_conf_t *cf, ngx_http_lua_loc_conf_t *llcf) return NGX_ERROR; } +#if (nginx_version >= 1019004) + if (ngx_ssl_conf_commands(cf, llcf->ssl, llcf->ssl_conf_commands) + != NGX_OK) + { + return NGX_ERROR; + } +#endif + return NGX_OK; } +#if (nginx_version >= 1019004) +static char * +ngx_http_lua_ssl_conf_command_check(ngx_conf_t *cf, void *post, void *data) +{ +#ifndef SSL_CONF_FLAG_FILE + return "is not supported on this platform"; +#endif + + return NGX_CONF_OK; +} +#endif + #endif /* NGX_HTTP_SSL */ diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_output.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_output.c index c0aadffb4..8d8c71d89 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_output.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_output.c @@ -244,6 +244,11 @@ ngx_http_lua_ngx_echo(lua_State *L, unsigned newline) return 2; } + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "%s has %sbusy bufs", + newline ? "lua say response" : "lua print response", + ctx->busy_bufs != NULL ? "" : "no "); + dd("downstream write: %d, buf len: %d", (int) rc, (int) (b->last - b->pos)); diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_pipe.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_pipe.c index c555d7bc9..93dc7d5bc 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_pipe.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_pipe.c @@ -545,6 +545,22 @@ ngx_http_lua_pipe_fd_write(ngx_connection_t *c, u_char *buf, size_t size) } +#if !(NGX_HTTP_LUA_HAVE_EXECVPE) +static int +ngx_http_lua_execvpe(const char *program, char * const argv[], + char * const envp[]) +{ + int rc; + char **saved = environ; + + environ = (char **) envp; + rc = execvp(program, argv); + environ = saved; + return rc; +} +#endif + + int ngx_http_lua_ffi_pipe_spawn(ngx_http_lua_ffi_pipe_proc_t *proc, const char *file, const char **argv, int merge_stderr, size_t buffer_size, @@ -568,15 +584,6 @@ ngx_http_lua_ffi_pipe_spawn(ngx_http_lua_ffi_pipe_proc_t *proc, ngx_http_lua_pipe_signal_t *sig; sigset_t set; -#if !(NGX_HTTP_LUA_HAVE_EXECVPE) - if (environ != NULL) { - *errbuf_size = ngx_snprintf(errbuf, *errbuf_size, - "environ option not supported") - - errbuf; - return NGX_ERROR; - } -#endif - pool_size = ngx_align(NGX_MIN_POOL_SIZE + buffer_size * 2, NGX_POOL_ALIGNMENT); @@ -766,9 +773,19 @@ ngx_http_lua_ffi_pipe_spawn(ngx_http_lua_ffi_pipe_proc_t *proc, } } -#if (NGX_HTTP_LUA_HAVE_EXECVPE) + close(in[0]); + close(out[1]); + if (!merge_stderr) { + close(err[1]); + } + if (environ != NULL) { +#if (NGX_HTTP_LUA_HAVE_EXECVPE) if (execvpe(file, (char * const *) argv, (char * const *) environ) +#else + if (ngx_http_lua_execvpe(file, (char * const *) argv, + (char * const *) environ) +#endif == -1) { ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_errno, @@ -784,14 +801,6 @@ ngx_http_lua_ffi_pipe_spawn(ngx_http_lua_ffi_pipe_proc_t *proc, } } -#else - if (execvp(file, (char * const *) argv) == -1) { - ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_errno, - "lua pipe child execvp() failed while executing %s", - file); - } -#endif - exit(EXIT_FAILURE); } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_regex.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_regex.c index e4f36bc44..03d1a4d32 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_regex.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_regex.c @@ -311,7 +311,10 @@ ngx_http_lua_ffi_compile_regex(const unsigned char *pat, size_t pat_len, #endif /* LUA_HAVE_PCRE_JIT */ - if (sd && lmcf && lmcf->regex_match_limit > 0) { + if (sd + && lmcf && lmcf->regex_match_limit > 0 + && !(flags & NGX_LUA_RE_MODE_DFA)) + { sd->flags |= PCRE_EXTRA_MATCH_LIMIT; sd->match_limit = lmcf->regex_match_limit; } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_semaphore.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_semaphore.c index 8ca6efb34..435beaa29 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_semaphore.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_semaphore.c @@ -343,7 +343,7 @@ ngx_http_lua_ffi_sema_post(ngx_http_lua_sema_t *sem, int n) sem->resource_count += n; if (!ngx_queue_empty(&sem->wait_queue)) { - /* we need the extra paranthese around the first argument of + /* we need the extra parentheses around the first argument of * ngx_post_event() just to work around macro issues in nginx * cores older than nginx 1.7.12 (exclusive). */ @@ -466,8 +466,11 @@ ngx_http_lua_sema_handler(ngx_event_t *ev) sem = ev->data; + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0, + "semaphore handler: wait queue: %sempty, resource count: %d", + ngx_queue_empty(&sem->wait_queue) ? "" : "not ", + sem->resource_count); while (!ngx_queue_empty(&sem->wait_queue) && sem->resource_count > 0) { - q = ngx_queue_head(&sem->wait_queue); ngx_queue_remove(q); @@ -566,6 +569,10 @@ ngx_http_lua_ffi_sema_gc(ngx_http_lua_sema_t *sem) "destroyed", sem); } + if (sem->sem_event.posted) { + ngx_delete_posted_event(&sem->sem_event); + } + ngx_http_lua_free_sema(sem); } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_shdict.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_shdict.c index 07effa88e..d841eb95e 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_shdict.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_shdict.c @@ -815,7 +815,7 @@ ngx_http_lua_shdict_push_helper(lua_State *L, int flags) "type matched, reusing it"); sd->expires = 0; - + sd->value_len = 0; /* free list nodes */ queue = ngx_http_lua_shdict_get_list_head(sd, key.len); @@ -1426,8 +1426,6 @@ replace: ngx_queue_remove(&sd->queue); ngx_queue_insert_head(&ctx->sh->lru_queue, &sd->queue); - sd->key_len = (u_short) key_len; - if (exptime > 0) { tp = ngx_timeofday(); sd->expires = (uint64_t) tp->sec * 1000 + tp->msec @@ -1439,14 +1437,11 @@ replace: sd->user_flags = user_flags; - sd->value_len = (uint32_t) str_value_len; - dd("setting value type to %d", value_type); sd->value_type = (uint8_t) value_type; - p = ngx_copy(sd->data, key, key_len); - ngx_memcpy(p, str_value_buf, str_value_len); + ngx_memcpy(sd->data + key_len, str_value_buf, str_value_len); ngx_shmtx_unlock(&ctx->shpool->mutex); diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_socket_tcp.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_socket_tcp.c index 55bd203d9..26467fddb 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_socket_tcp.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_socket_tcp.c @@ -147,8 +147,6 @@ static void ngx_http_lua_socket_free_pool(ngx_log_t *log, static int ngx_http_lua_socket_shutdown_pool(lua_State *L); static void ngx_http_lua_socket_shutdown_pool_helper( ngx_http_lua_socket_pool_t *spool); -static void - ngx_http_lua_socket_empty_resolve_handler(ngx_resolver_ctx_t *ctx); static int ngx_http_lua_socket_prepare_error_retvals(ngx_http_request_t *r, ngx_http_lua_socket_tcp_upstream_t *u, lua_State *L, ngx_uint_t ft_type); #if (NGX_HTTP_SSL) @@ -1151,13 +1149,6 @@ ngx_http_lua_socket_tcp_connect(lua_State *L) } -static void -ngx_http_lua_socket_empty_resolve_handler(ngx_resolver_ctx_t *ctx) -{ - /* do nothing */ -} - - static void ngx_http_lua_socket_resolve_handler(ngx_resolver_ctx_t *ctx) { @@ -2834,7 +2825,7 @@ ngx_http_lua_socket_tcp_send(lua_State *L) switch (type) { case LUA_TNUMBER: - b->last = ngx_http_lua_write_num(L, 2, b->last); + b->last = ngx_http_lua_write_num(L, 2, b->last); break; case LUA_TSTRING: @@ -3121,7 +3112,7 @@ ngx_http_lua_socket_tcp_settimeout(lua_State *L) n = lua_gettop(L); if (n != 2) { - return luaL_error(L, "ngx.socket settimout: expecting 2 arguments " + return luaL_error(L, "ngx.socket settimeout: expecting 2 arguments " "(including the object) but seen %d", lua_gettop(L)); } @@ -3168,7 +3159,7 @@ ngx_http_lua_socket_tcp_settimeouts(lua_State *L) n = lua_gettop(L); if (n != 4) { - return luaL_error(L, "ngx.socket settimout: expecting 4 arguments " + return luaL_error(L, "ngx.socket settimeout: expecting 4 arguments " "(including the object) but seen %d", lua_gettop(L)); } @@ -6084,10 +6075,8 @@ ngx_http_lua_tcp_resolve_cleanup(void *data) return; } - /* just to be safer */ - rctx->handler = ngx_http_lua_socket_empty_resolve_handler; - - ngx_resolve_name_done(rctx); + /* postpone free the rctx in the handler */ + rctx->handler = ngx_resolve_name_done; } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_socket_udp.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_socket_udp.c index fd3e07427..4f970e6cc 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_socket_udp.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_socket_udp.c @@ -1044,7 +1044,7 @@ ngx_http_lua_socket_udp_settimeout(lua_State *L) n = lua_gettop(L); if (n != 2) { - return luaL_error(L, "ngx.socket settimout: expecting at least 2 " + return luaL_error(L, "ngx.socket settimeout: expecting at least 2 " "arguments (including the object) but seen %d", lua_gettop(L)); } @@ -1584,7 +1584,8 @@ ngx_http_lua_udp_resolve_cleanup(void *data) return; } - ngx_resolve_name_done(rctx); + /* postpone free the rctx in the handler */ + rctx->handler = ngx_resolve_name_done; } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl.h b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl.h index f50ecc519..3d577c61f 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl.h +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl.h @@ -19,12 +19,13 @@ typedef struct { ngx_http_request_t *request; /* fake request */ ngx_pool_cleanup_pt *cleanup; - ngx_ssl_session_t *session; /* retrurn value for openssl's + ngx_ssl_session_t *session; /* return value for openssl's * session_get_cb */ ngx_str_t session_id; int exit_code; /* exit code for openssl's + set_client_hello_cb or set_cert_cb callback */ int ctx_ref; /* reference to anchor @@ -34,6 +35,7 @@ typedef struct { unsigned done:1; unsigned aborted:1; + unsigned entered_client_hello_handler:1; unsigned entered_cert_handler:1; unsigned entered_sess_fetch_handler:1; } ngx_http_lua_ssl_ctx_t; diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_certby.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_certby.c index 6ed2f3f1c..b561122b1 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_certby.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_certby.c @@ -1333,6 +1333,7 @@ failed: } +#ifndef LIBRESSL_VERSION_NUMBER static int ngx_http_lua_ssl_verify_callback(int ok, X509_STORE_CTX *x509_store) { @@ -1344,12 +1345,20 @@ ngx_http_lua_ssl_verify_callback(int ok, X509_STORE_CTX *x509_store) */ return 1; } +#endif int ngx_http_lua_ffi_ssl_verify_client(ngx_http_request_t *r, void *ca_certs, int depth, char **err) { +#ifdef LIBRESSL_VERSION_NUMBER + + *err = "LibreSSL not supported"; + return NGX_ERROR; + +#else + ngx_http_lua_ctx_t *ctx; ngx_ssl_conn_t *ssl_conn; ngx_http_ssl_srv_conf_t *sscf; @@ -1466,6 +1475,7 @@ failed: X509_STORE_free(ca_store); return NGX_ERROR; +#endif } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_client_helloby.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_client_helloby.c new file mode 100644 index 000000000..a65b6e88f --- /dev/null +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_client_helloby.c @@ -0,0 +1,705 @@ +/* + * Copyright (C) Yichun Zhang (agentzh) + */ + +#ifndef DDEBUG +#define DDEBUG 0 +#endif +#include "ddebug.h" + + +#if (NGX_HTTP_SSL) + + +#include "ngx_http_lua_cache.h" +#include "ngx_http_lua_initworkerby.h" +#include "ngx_http_lua_util.h" +#include "ngx_http_ssl_module.h" +#include "ngx_http_lua_contentby.h" +#include "ngx_http_lua_ssl_client_helloby.h" +#include "ngx_http_lua_directive.h" +#include "ngx_http_lua_ssl.h" + + +static void ngx_http_lua_ssl_client_hello_done(void *data); +static void ngx_http_lua_ssl_client_hello_aborted(void *data); +static u_char *ngx_http_lua_log_ssl_client_hello_error(ngx_log_t *log, + u_char *buf, size_t len); +static ngx_int_t ngx_http_lua_ssl_client_hello_by_chunk(lua_State *L, + ngx_http_request_t *r); + + +ngx_int_t +ngx_http_lua_ssl_client_hello_handler_file(ngx_http_request_t *r, + ngx_http_lua_srv_conf_t *lscf, lua_State *L) +{ + ngx_int_t rc; + + rc = ngx_http_lua_cache_loadfile(r->connection->log, L, + lscf->srv.ssl_client_hello_src.data, + &lscf->srv.ssl_client_hello_src_ref, + lscf->srv.ssl_client_hello_src_key); + if (rc != NGX_OK) { + return rc; + } + + /* make sure we have a valid code chunk */ + ngx_http_lua_assert(lua_isfunction(L, -1)); + + return ngx_http_lua_ssl_client_hello_by_chunk(L, r); +} + + +ngx_int_t +ngx_http_lua_ssl_client_hello_handler_inline(ngx_http_request_t *r, + ngx_http_lua_srv_conf_t *lscf, lua_State *L) +{ + ngx_int_t rc; + + rc = ngx_http_lua_cache_loadbuffer(r->connection->log, L, + lscf->srv.ssl_client_hello_src.data, + lscf->srv.ssl_client_hello_src.len, + &lscf->srv.ssl_client_hello_src_ref, + lscf->srv.ssl_client_hello_src_key, + "=ssl_client_hello_by_lua"); + if (rc != NGX_OK) { + return rc; + } + + /* make sure we have a valid code chunk */ + ngx_http_lua_assert(lua_isfunction(L, -1)); + + return ngx_http_lua_ssl_client_hello_by_chunk(L, r); +} + + +char * +ngx_http_lua_ssl_client_hello_by_lua_block(ngx_conf_t *cf, ngx_command_t *cmd, + void *conf) +{ + char *rv; + ngx_conf_t save; + + save = *cf; + cf->handler = ngx_http_lua_ssl_client_hello_by_lua; + cf->handler_conf = conf; + + rv = ngx_http_lua_conf_lua_block_parse(cf, cmd); + + *cf = save; + + return rv; +} + + +char * +ngx_http_lua_ssl_client_hello_by_lua(ngx_conf_t *cf, ngx_command_t *cmd, + void *conf) +{ +#ifndef SSL_ERROR_WANT_CLIENT_HELLO_CB + + ngx_log_error(NGX_LOG_EMERG, cf->log, 0, + "at least OpenSSL 1.1.1 required but found " + OPENSSL_VERSION_TEXT); + + return NGX_CONF_ERROR; + +#else + + u_char *cache_key = NULL; + u_char *name; + ngx_str_t *value; + ngx_http_lua_srv_conf_t *lscf = conf; + + /* must specify a concrete handler */ + if (cmd->post == NULL) { + return NGX_CONF_ERROR; + } + + if (lscf->srv.ssl_client_hello_handler) { + return "is duplicate"; + } + + if (ngx_http_lua_ssl_init(cf->log) != NGX_OK) { + return NGX_CONF_ERROR; + } + + value = cf->args->elts; + + lscf->srv.ssl_client_hello_handler = + (ngx_http_lua_srv_conf_handler_pt) cmd->post; + + if (cmd->post == ngx_http_lua_ssl_client_hello_handler_file) { + /* Lua code in an external file */ + + name = ngx_http_lua_rebase_path(cf->pool, value[1].data, + value[1].len); + if (name == NULL) { + return NGX_CONF_ERROR; + } + + cache_key = ngx_http_lua_gen_file_cache_key(cf, value[1].data, + value[1].len); + if (cache_key == NULL) { + return NGX_CONF_ERROR; + } + + lscf->srv.ssl_client_hello_src.data = name; + lscf->srv.ssl_client_hello_src.len = ngx_strlen(name); + + } else { + cache_key = ngx_http_lua_gen_file_cache_key(cf, value[1].data, + value[1].len); + if (cache_key == NULL) { + return NGX_CONF_ERROR; + } + + /* Don't eval nginx variables for inline lua code */ + lscf->srv.ssl_client_hello_src = value[1]; + + } + + lscf->srv.ssl_client_hello_src_key = cache_key; + + return NGX_CONF_OK; + +#endif /* NO SSL_ERROR_WANT_CLIENT_HELLO_CB */ +} + + +int +ngx_http_lua_ssl_client_hello_handler(ngx_ssl_conn_t *ssl_conn, + int *al, void *arg) +{ + lua_State *L; + ngx_int_t rc; + ngx_connection_t *c, *fc; + ngx_http_request_t *r = NULL; + ngx_pool_cleanup_t *cln; + ngx_http_connection_t *hc; + ngx_http_lua_srv_conf_t *lscf; + ngx_http_core_loc_conf_t *clcf; + ngx_http_lua_ssl_ctx_t *cctx; + ngx_http_core_srv_conf_t *cscf; + + c = ngx_ssl_get_connection(ssl_conn); + + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, + "ssl client hello: connection reusable: %ud", c->reusable); + + cctx = ngx_http_lua_ssl_get_ctx(c->ssl->connection); + + dd("ssl client hello handler, client-hello-ctx=%p", cctx); + + if (cctx && cctx->entered_client_hello_handler) { + /* not the first time */ + + if (cctx->done) { + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, + "lua_client_hello_by_lua: " + "client hello cb exit code: %d", + cctx->exit_code); + + dd("lua ssl client hello done, finally"); + return cctx->exit_code; + } + + return -1; + } + + dd("first time"); + +#if (nginx_version < 1017009) + ngx_reusable_connection(c, 0); +#endif + + hc = c->data; + + fc = ngx_http_lua_create_fake_connection(NULL); + if (fc == NULL) { + goto failed; + } + + fc->log->handler = ngx_http_lua_log_ssl_client_hello_error; + fc->log->data = fc; + + fc->addr_text = c->addr_text; + fc->listening = c->listening; + + r = ngx_http_lua_create_fake_request(fc); + if (r == NULL) { + goto failed; + } + + r->main_conf = hc->conf_ctx->main_conf; + r->srv_conf = hc->conf_ctx->srv_conf; + r->loc_conf = hc->conf_ctx->loc_conf; + + fc->log->file = c->log->file; + fc->log->log_level = c->log->log_level; + fc->ssl = c->ssl; + + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + + +#if nginx_version >= 1009000 + ngx_set_connection_log(fc, clcf->error_log); +#else + ngx_http_set_connection_log(fc, clcf->error_log); +#endif + + if (cctx == NULL) { + cctx = ngx_pcalloc(c->pool, sizeof(ngx_http_lua_ssl_ctx_t)); + if (cctx == NULL) { + goto failed; /* error */ + } + + cctx->ctx_ref = LUA_NOREF; + } + + cctx->exit_code = 1; /* successful by default */ + cctx->connection = c; + cctx->request = r; + cctx->entered_client_hello_handler = 1; + cctx->done = 0; + + dd("setting cctx"); + + if (SSL_set_ex_data(c->ssl->connection, ngx_http_lua_ssl_ctx_index, cctx) + == 0) + { + ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, "SSL_set_ex_data() failed"); + goto failed; + } + + lscf = ngx_http_get_module_srv_conf(r, ngx_http_lua_module); + + /* TODO honor lua_code_cache off */ + L = ngx_http_lua_get_lua_vm(r, NULL); + + c->log->action = "loading SSL client hello by lua"; + + if (lscf->srv.ssl_client_hello_handler == NULL) { + cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); + + ngx_log_error(NGX_LOG_ALERT, c->log, 0, + "no ssl_client_hello_by_lua* defined in " + "server %V", &cscf->server_name); + + goto failed; + } + + rc = lscf->srv.ssl_client_hello_handler(r, lscf, L); + + if (rc >= NGX_OK || rc == NGX_ERROR) { + cctx->done = 1; + + if (cctx->cleanup) { + *cctx->cleanup = NULL; + } + + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, + "lua_client_hello_by_lua: handler return value: %i, " + "client hello cb exit code: %d", rc, cctx->exit_code); + + c->log->action = "SSL handshaking"; + return cctx->exit_code; + } + + /* rc == NGX_DONE */ + + cln = ngx_pool_cleanup_add(fc->pool, 0); + if (cln == NULL) { + goto failed; + } + + cln->handler = ngx_http_lua_ssl_client_hello_done; + cln->data = cctx; + + if (cctx->cleanup == NULL) { + cln = ngx_pool_cleanup_add(c->pool, 0); + if (cln == NULL) { + goto failed; + } + + cln->data = cctx; + cctx->cleanup = &cln->handler; + } + + *cctx->cleanup = ngx_http_lua_ssl_client_hello_aborted; + + return -1; + +#if 1 +failed: + + if (r && r->pool) { + ngx_http_lua_free_fake_request(r); + } + + if (fc) { + ngx_http_lua_close_fake_connection(fc); + } + + return 0; +#endif +} + + +static void +ngx_http_lua_ssl_client_hello_done(void *data) +{ + ngx_connection_t *c; + ngx_http_lua_ssl_ctx_t *cctx = data; + + dd("lua ssl client hello done"); + + if (cctx->aborted) { + return; + } + + ngx_http_lua_assert(cctx->done == 0); + + cctx->done = 1; + + if (cctx->cleanup) { + *cctx->cleanup = NULL; + } + + c = cctx->connection; + + c->log->action = "SSL handshaking"; + + ngx_post_event(c->write, &ngx_posted_events); +} + + +static void +ngx_http_lua_ssl_client_hello_aborted(void *data) +{ + ngx_http_lua_ssl_ctx_t *cctx = data; + + dd("lua ssl client hello done"); + + if (cctx->done) { + /* completed successfully already */ + return; + } + + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cctx->connection->log, 0, + "lua_client_hello_by_lua: client hello cb aborted"); + + cctx->aborted = 1; + cctx->request->connection->ssl = NULL; + + ngx_http_lua_finalize_fake_request(cctx->request, NGX_ERROR); +} + + +static u_char * +ngx_http_lua_log_ssl_client_hello_error(ngx_log_t *log, + u_char *buf, size_t len) +{ + u_char *p; + ngx_connection_t *c; + + if (log->action) { + p = ngx_snprintf(buf, len, " while %s", log->action); + len -= p - buf; + buf = p; + } + + p = ngx_snprintf(buf, len, ", context: ssl_client_hello_by_lua*"); + len -= p - buf; + buf = p; + + c = log->data; + + if (c && c->addr_text.len) { + p = ngx_snprintf(buf, len, ", client: %V", &c->addr_text); + len -= p - buf; + buf = p; + } + + if (c && c->listening && c->listening->addr_text.len) { + p = ngx_snprintf(buf, len, ", server: %V", &c->listening->addr_text); + /* len -= p - buf; */ + buf = p; + } + + return buf; +} + + +static ngx_int_t +ngx_http_lua_ssl_client_hello_by_chunk(lua_State *L, ngx_http_request_t *r) +{ + int co_ref; + ngx_int_t rc; + lua_State *co; + ngx_http_lua_ctx_t *ctx; + ngx_http_cleanup_t *cln; + + ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); + + if (ctx == NULL) { + ctx = ngx_http_lua_create_ctx(r); + if (ctx == NULL) { + rc = NGX_ERROR; + ngx_http_lua_finalize_request(r, rc); + return rc; + } + + } else { + dd("reset ctx"); + ngx_http_lua_reset_ctx(r, L, ctx); + } + + ctx->entered_content_phase = 1; + + /* {{{ new coroutine to handle request */ + co = ngx_http_lua_new_thread(r, L, &co_ref); + + if (co == NULL) { + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "lua: failed to create new coroutine to handle request"); + + rc = NGX_ERROR; + ngx_http_lua_finalize_request(r, rc); + return rc; + } + + /* move code closure to new coroutine */ + lua_xmove(L, co, 1); + +#ifndef OPENRESTY_LUAJIT + /* set closure's env table to new coroutine's globals table */ + ngx_http_lua_get_globals_table(co); + lua_setfenv(co, -2); +#endif + + /* save nginx request in coroutine globals table */ + ngx_http_lua_set_req(co, r); + + ctx->cur_co_ctx = &ctx->entry_co_ctx; + ctx->cur_co_ctx->co = co; + ctx->cur_co_ctx->co_ref = co_ref; +#ifdef NGX_LUA_USE_ASSERT + ctx->cur_co_ctx->co_top = 1; +#endif + + ngx_http_lua_attach_co_ctx_to_L(co, ctx->cur_co_ctx); + + /* register request cleanup hooks */ + if (ctx->cleanup == NULL) { + cln = ngx_http_cleanup_add(r, 0); + if (cln == NULL) { + rc = NGX_ERROR; + ngx_http_lua_finalize_request(r, rc); + return rc; + } + + cln->handler = ngx_http_lua_request_cleanup_handler; + cln->data = ctx; + ctx->cleanup = &cln->handler; + } + + ctx->context = NGX_HTTP_LUA_CONTEXT_SSL_CLIENT_HELLO; + + rc = ngx_http_lua_run_thread(L, r, ctx, 0); + + if (rc == NGX_ERROR || rc >= NGX_OK) { + /* do nothing */ + + } else if (rc == NGX_AGAIN) { + rc = ngx_http_lua_content_run_posted_threads(L, r, ctx, 0); + + } else if (rc == NGX_DONE) { + rc = ngx_http_lua_content_run_posted_threads(L, r, ctx, 1); + + } else { + rc = NGX_OK; + } + + ngx_http_lua_finalize_request(r, rc); + return rc; +} + + +int +ngx_http_lua_ffi_ssl_get_client_hello_server_name(ngx_http_request_t *r, + const char **name, size_t *namelen, char **err) +{ + ngx_ssl_conn_t *ssl_conn; +#ifdef SSL_ERROR_WANT_CLIENT_HELLO_CB + const unsigned char *p; + size_t remaining, len; +#endif + + if (r->connection == NULL || r->connection->ssl == NULL) { + *err = "bad request"; + return NGX_ERROR; + } + + ssl_conn = r->connection->ssl->connection; + if (ssl_conn == NULL) { + *err = "bad ssl conn"; + return NGX_ERROR; + } + +#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME + +#ifdef SSL_ERROR_WANT_CLIENT_HELLO_CB + remaining = 0; + + /* This code block is taken from OpenSSL's client_hello_select_server_ctx() + * */ + if (!SSL_client_hello_get0_ext(ssl_conn, TLSEXT_TYPE_server_name, &p, + &remaining)) + { + return NGX_DECLINED; + } + + if (remaining <= 2) { + *err = "Bad SSL Client Hello Extension"; + return NGX_ERROR; + } + + len = (*(p++) << 8); + len += *(p++); + if (len + 2 != remaining) { + *err = "Bad SSL Client Hello Extension"; + return NGX_ERROR; + } + + remaining = len; + if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) { + *err = "Bad SSL Client Hello Extension"; + return NGX_ERROR; + } + + remaining--; + if (remaining <= 2) { + *err = "Bad SSL Client Hello Extension"; + return NGX_ERROR; + } + + len = (*(p++) << 8); + len += *(p++); + if (len + 2 > remaining) { + *err = "Bad SSL Client Hello Extension"; + return NGX_ERROR; + } + + remaining = len; + *name = (const char *) p; + *namelen = len; + + return NGX_OK; + +#else + *err = "OpenSSL too old to support this function"; + return NGX_ERROR; + +#endif + +#else + + *err = "no TLS extension support"; + return NGX_ERROR; +#endif +} + + +int +ngx_http_lua_ffi_ssl_get_client_hello_ext(ngx_http_request_t *r, + unsigned int type, const unsigned char **out, size_t *outlen, char **err) +{ + ngx_ssl_conn_t *ssl_conn; + + if (r->connection == NULL || r->connection->ssl == NULL) { + *err = "bad request"; + return NGX_ERROR; + } + + ssl_conn = r->connection->ssl->connection; + if (ssl_conn == NULL) { + *err = "bad ssl conn"; + return NGX_ERROR; + } + +#ifdef SSL_ERROR_WANT_CLIENT_HELLO_CB + if (SSL_client_hello_get0_ext(ssl_conn, type, out, outlen) == 0) { + return NGX_DECLINED; + } + + return NGX_OK; +#else + *err = "OpenSSL too old to support this function"; + return NGX_ERROR; +#endif + +} + + +int +ngx_http_lua_ffi_ssl_set_protocols(ngx_http_request_t *r, + int protocols, char **err) +{ + + ngx_ssl_conn_t *ssl_conn; + + if (r->connection == NULL || r->connection->ssl == NULL) { + *err = "bad request"; + return NGX_ERROR; + } + + ssl_conn = r->connection->ssl->connection; + if (ssl_conn == NULL) { + *err = "bad ssl conn"; + return NGX_ERROR; + } + +#if OPENSSL_VERSION_NUMBER >= 0x009080dfL + /* only in 0.9.8m+ */ + SSL_clear_options(ssl_conn, + SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1); +#endif + + if (!(protocols & NGX_SSL_SSLv2)) { + SSL_set_options(ssl_conn, SSL_OP_NO_SSLv2); + } + + if (!(protocols & NGX_SSL_SSLv3)) { + SSL_set_options(ssl_conn, SSL_OP_NO_SSLv3); + } + + if (!(protocols & NGX_SSL_TLSv1)) { + SSL_set_options(ssl_conn, SSL_OP_NO_TLSv1); + } + +#ifdef SSL_OP_NO_TLSv1_1 + SSL_clear_options(ssl_conn, SSL_OP_NO_TLSv1_1); + if (!(protocols & NGX_SSL_TLSv1_1)) { + SSL_set_options(ssl_conn, SSL_OP_NO_TLSv1_1); + } +#endif + +#ifdef SSL_OP_NO_TLSv1_2 + SSL_clear_options(ssl_conn, SSL_OP_NO_TLSv1_2); + if (!(protocols & NGX_SSL_TLSv1_2)) { + SSL_set_options(ssl_conn, SSL_OP_NO_TLSv1_2); + } +#endif + +#ifdef SSL_OP_NO_TLSv1_3 + SSL_clear_options(ssl_conn, SSL_OP_NO_TLSv1_3); + if (!(protocols & NGX_SSL_TLSv1_3)) { + SSL_set_options(ssl_conn, SSL_OP_NO_TLSv1_3); + } +#endif + + return NGX_OK; +} + +#endif /* NGX_HTTP_SSL */ diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_client_helloby.h b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_client_helloby.h new file mode 100644 index 000000000..682a7cf29 --- /dev/null +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_client_helloby.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) Yichun Zhang (agentzh) + */ + +#ifndef _NGX_HTTP_LUA_SSL_CLIENT_HELLOBY_H_INCLUDED_ +#define _NGX_HTTP_LUA_SSL_CLIENT_HELLOBY_H_INCLUDED_ + + +#include "ngx_http_lua_common.h" + + +#if (NGX_HTTP_SSL) + +ngx_int_t ngx_http_lua_ssl_client_hello_handler_inline(ngx_http_request_t *r, + ngx_http_lua_srv_conf_t *lscf, lua_State *L); + +ngx_int_t ngx_http_lua_ssl_client_hello_handler_file(ngx_http_request_t *r, + ngx_http_lua_srv_conf_t *lscf, lua_State *L); + +char *ngx_http_lua_ssl_client_hello_by_lua_block(ngx_conf_t *cf, + ngx_command_t *cmd, void *conf); + +char *ngx_http_lua_ssl_client_hello_by_lua(ngx_conf_t *cf, ngx_command_t *cmd, + void *conf); + +int ngx_http_lua_ssl_client_hello_handler(ngx_ssl_conn_t *ssl_conn, + int *al, void *arg); + + +#endif /* NGX_HTTP_SSL */ + + +#endif /* _NGX_HTTP_LUA_SSL_CLIENT_HELLOBY_H_INCLUDED_ */ + +/* vi:set ft=c ts=4 sw=4 et fdm=marker: */ diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_session_fetchby.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_session_fetchby.c index 8d8c42b21..6584e6ab5 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_session_fetchby.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_session_fetchby.c @@ -450,7 +450,7 @@ ngx_http_lua_log_ssl_sess_fetch_error(ngx_log_t *log, u_char *buf, size_t len) } if (c->listening && c->listening->addr_text.len) { - p = ngx_snprintf(buf, len, ", server: %V", \ + p = ngx_snprintf(buf, len, ", server: %V", &c->listening->addr_text); buf = p; } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_session_storeby.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_session_storeby.c index 2cfc8f655..0654d9371 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_session_storeby.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_ssl_session_storeby.c @@ -336,7 +336,7 @@ ngx_http_lua_log_ssl_sess_store_error(ngx_log_t *log, u_char *buf, size_t len) } if (c->listening && c->listening->addr_text.len) { - p = ngx_snprintf(buf, len, ", server: %V", \ + p = ngx_snprintf(buf, len, ", server: %V", &c->listening->addr_text); buf = p; } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_subrequest.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_subrequest.c index a798f9bda..f6638c299 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_subrequest.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_subrequest.c @@ -734,7 +734,7 @@ ngx_http_lua_adjust_subrequest(ngx_http_request_t *sr, ngx_uint_t method, default: ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unsupported HTTP method: %u", (unsigned) method); + "unsupported HTTP method: %ui", method); return NGX_ERROR; } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_timer.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_timer.c index 353007def..e82e3406c 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_timer.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_timer.c @@ -173,6 +173,16 @@ ngx_http_lua_ngx_timer_helper(lua_State *L, int every) } ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); + ngx_http_lua_assert(ctx != NULL); + + /* + * Since nginx has been confirmed that all timers have been cleaned up when + * exit worker is executed, all timers will no longer be executed in exit + * worker phase. + * Reference https://github.com/nginx/nginx/blob/f02e2a734ef472f0dcf83ab2 + * e8ce96d1acead8a5/src/os/unix/ngx_process_cycle.c#L715 + */ + ngx_http_lua_check_context(L, ctx, ~NGX_HTTP_LUA_CONTEXT_EXIT_WORKER); if (ngx_exiting && delay > 0) { lua_pushnil(L); @@ -314,7 +324,7 @@ ngx_http_lua_ngx_timer_helper(lua_State *L, int every) tctx->client_addr_text.data = NULL; } - if (ctx && ctx->vm_state) { + if (ctx->vm_state) { tctx->vm_state = ctx->vm_state; tctx->vm_state->count++; @@ -741,7 +751,7 @@ ngx_http_lua_log_timer_error(ngx_log_t *log, u_char *buf, size_t len) } if (c->listening && c->listening->addr_text.len) { - p = ngx_snprintf(buf, len, ", server: %V", + p = ngx_snprintf(buf, len, ", server: %V", &c->listening->addr_text); /* len -= p - buf; */ buf = p; @@ -865,7 +875,7 @@ ngx_http_lua_abort_pending_timers(ngx_event_t *ev) next = cur->parent; } else { - /* not reacheable */ + /* not reachable */ next = NULL; } diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_uthread.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_uthread.c index 5ed534c7f..d30ffb404 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_uthread.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_uthread.c @@ -268,7 +268,7 @@ ngx_http_lua_uthread_kill(lua_State *L) return 1; } - /* not reacheable */ + /* not reachable */ } /* vi:set ft=c ts=4 sw=4 et fdm=marker: */ diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_util.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_util.c index 5fe9b5063..bae59daf3 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_util.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_util.c @@ -46,6 +46,9 @@ #include "ngx_http_lua_ssl_certby.h" #include "ngx_http_lua_ssl.h" #include "ngx_http_lua_log_ringbuf.h" +#if (NGX_THREADS) +#include "ngx_http_lua_worker_thread.h" +#endif #if 1 @@ -373,8 +376,10 @@ ngx_http_lua_new_thread(ngx_http_request_t *r, lua_State *L, int *ref) if (!lua_isnil(L, -1) && !lua_isnil(L, -2)) { n++; } + lua_pop(L, 1); } + lua_pop(L, 1); ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, @@ -383,10 +388,9 @@ ngx_http_lua_new_thread(ngx_http_request_t *r, lua_State *L, int *ref) } #endif - } else { -#else - { + } else #endif + { base = lua_gettop(L); lua_pushlightuserdata(L, ngx_http_lua_lightudata_mask( @@ -715,6 +719,10 @@ ngx_http_lua_output_filter(ngx_http_request_t *r, ngx_chain_t *in) ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); + if (ctx == NULL) { + return rc; + } + ngx_chain_update_chains(r->pool, &ctx->free_bufs, &ctx->busy_bufs, &in, (ngx_buf_tag_t) &ngx_http_lua_module); @@ -776,10 +784,13 @@ ngx_http_lua_init_registry(lua_State *L, ngx_log_t *log) lua_rawset(L, LUA_REGISTRYINDEX); /* }}} */ - /* create the registry entry for the Lua request ctx data table */ - lua_pushliteral(L, ngx_http_lua_ctx_tables_key); - lua_createtable(L, 0, 32 /* nrec */); - lua_rawset(L, LUA_REGISTRYINDEX); + /* + * the the Lua request ctx data table will create in resty.core.ctx, + * just equivalent to the following code: + * lua_pushliteral(L, ngx_http_lua_ctx_tables_key); + * lua_createtable(L, 0, 0); + * lua_rawset(L, LUA_REGISTRYINDEX); + */ /* create the registry entry for the Lua socket connection pool table */ lua_pushlightuserdata(L, ngx_http_lua_lightudata_mask( @@ -842,6 +853,9 @@ ngx_http_lua_inject_ngx_api(lua_State *L, ngx_http_lua_main_conf_t *lmcf, ngx_http_lua_inject_uthread_api(log, L); ngx_http_lua_inject_timer_api(L); ngx_http_lua_inject_config_api(L); +#if (NGX_THREADS) + ngx_http_lua_inject_worker_thread_api(log, L); +#endif lua_getglobal(L, "package"); /* ngx package */ lua_getfield(L, -1, "loaded"); /* ngx package loaded */ @@ -1017,10 +1031,14 @@ ngx_http_lua_generic_phase_post_read(ngx_http_request_t *r) ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); - ctx->read_body_done = 1; - r->main->count--; + if (ctx == NULL) { + return; + } + + ctx->read_body_done = 1; + if (ctx->waiting_more_body) { ctx->waiting_more_body = 0; ngx_http_core_run_phases(r); @@ -2193,6 +2211,7 @@ ngx_http_lua_escape_uri(u_char *dst, u_char *src, size_t size, ngx_uint_t type) return (uintptr_t) dst; } + static int ngx_http_lua_util_hex2int(char xdigit) { @@ -2204,18 +2223,19 @@ ngx_http_lua_util_hex2int(char xdigit) if (xdigit <= 'f' && xdigit >= 'a') { return xdigit - 'a' + 10; } - + return -1; } + /* XXX we also decode '+' to ' ' */ void ngx_http_lua_unescape_uri(u_char **dst, u_char **src, size_t size, ngx_uint_t type) { - u_char *d = *dst, *s = *src, *de = (*dst+size); - int isuri = type & NGX_UNESCAPE_URI; - int isredirect = type & NGX_UNESCAPE_REDIRECT; + u_char *d = *dst, *s = *src, *de = (*dst + size); + int isuri = type & NGX_UNESCAPE_URI; + int isredirect = type & NGX_UNESCAPE_REDIRECT; while (size--) { u_char curr = *s++; @@ -2235,14 +2255,16 @@ ngx_http_lua_unescape_uri(u_char **dst, u_char **src, size_t size, /* we can be sure here they must be hex digits */ ch = ngx_http_lua_util_hex2int(s[0]) * 16 + ngx_http_lua_util_hex2int(s[1]); - + if ((isuri || isredirect) && ch == '?') { *d++ = ch; break; + } else if (isredirect && (ch <= '%' || ch >= 0x7f)) { *d++ = '%'; continue; } + *d++ = ch; s += 2; size -= 2; @@ -2255,7 +2277,7 @@ ngx_http_lua_unescape_uri(u_char **dst, u_char **src, size_t size, *d++ = curr; } } - + /* a safe guard if dst need to be null-terminated */ if (d != de) { *d = '\0'; @@ -4391,7 +4413,7 @@ ngx_http_lua_copy_escaped_header(ngx_http_request_t *r, escape = ngx_http_lua_escape_uri(NULL, data, len, type); if (escape > 0) { /* - * we allocate space for the trailling '\0' char here because nginx + * we allocate space for the trailing '\0' char here because nginx * header values must be null-terminated */ dst->data = ngx_palloc(r->pool, len + 2 * escape + 1); diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_util.h b/src/deps/src/lua-nginx-module/src/ngx_http_lua_util.h index 1768e5e28..348a8666a 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_util.h +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_util.h @@ -33,11 +33,12 @@ #define NGX_HTTP_LUA_ESCAPE_HEADER_VALUE 8 #define NGX_HTTP_LUA_CONTEXT_YIELDABLE (NGX_HTTP_LUA_CONTEXT_REWRITE \ - | NGX_HTTP_LUA_CONTEXT_ACCESS \ - | NGX_HTTP_LUA_CONTEXT_CONTENT \ - | NGX_HTTP_LUA_CONTEXT_TIMER \ - | NGX_HTTP_LUA_CONTEXT_SSL_CERT \ - | NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH) + | NGX_HTTP_LUA_CONTEXT_ACCESS \ + | NGX_HTTP_LUA_CONTEXT_CONTENT \ + | NGX_HTTP_LUA_CONTEXT_TIMER \ + | NGX_HTTP_LUA_CONTEXT_SSL_CLIENT_HELLO \ + | NGX_HTTP_LUA_CONTEXT_SSL_CERT \ + | NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH) /* key in Lua vm registry for all the "ngx.ctx" tables */ @@ -56,6 +57,8 @@ : (c) == NGX_HTTP_LUA_CONTEXT_INIT_WORKER ? "init_worker_by_lua*" \ : (c) == NGX_HTTP_LUA_CONTEXT_EXIT_WORKER ? "exit_worker_by_lua*" \ : (c) == NGX_HTTP_LUA_CONTEXT_BALANCER ? "balancer_by_lua*" \ + : (c) == NGX_HTTP_LUA_CONTEXT_SSL_CLIENT_HELLO ? \ + "ssl_client_hello_by_lua*" \ : (c) == NGX_HTTP_LUA_CONTEXT_SSL_CERT ? "ssl_certificate_by_lua*" \ : (c) == NGX_HTTP_LUA_CONTEXT_SSL_SESS_STORE ? \ "ssl_session_store_by_lua*" \ @@ -162,7 +165,7 @@ void ngx_http_lua_reset_ctx(ngx_http_request_t *r, lua_State *L, void ngx_http_lua_generic_phase_post_read(ngx_http_request_t *r); -void ngx_http_lua_request_cleanup(ngx_http_lua_ctx_t *ctx, int foricible); +void ngx_http_lua_request_cleanup(ngx_http_lua_ctx_t *ctx, int forcible); void ngx_http_lua_request_cleanup_handler(void *data); @@ -645,10 +648,9 @@ ngx_http_lua_new_cached_thread(lua_State *L, lua_State **out_co, lua_rawget(L, LUA_REGISTRYINDEX); lua_rawgeti(L, -1, co_ref); - } else { -#else - { + } else #endif + { lua_pushlightuserdata(L, ngx_http_lua_lightudata_mask( coroutines_key)); lua_rawget(L, LUA_REGISTRYINDEX); diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker.c index 8389dbeae..0ca2d414e 100644 --- a/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker.c +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker.c @@ -96,9 +96,13 @@ ngx_http_lua_ffi_get_process_type(void) return ngx_process; } - +#if defined(nginx_version) && nginx_version >= 1019003 +int +ngx_http_lua_ffi_enable_privileged_agent(char **err, unsigned int connections) +#else int ngx_http_lua_ffi_enable_privileged_agent(char **err) +#endif { #ifdef HAVE_PRIVILEGED_PROCESS_PATCH ngx_core_conf_t *ccf; @@ -107,6 +111,9 @@ ngx_http_lua_ffi_enable_privileged_agent(char **err) ngx_core_module); ccf->privileged_agent = 1; +#if defined(nginx_version) && nginx_version >= 1019003 + ccf->privileged_agent_connections = connections; +#endif return NGX_OK; diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker_thread.c b/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker_thread.c new file mode 100644 index 000000000..5f785ffb2 --- /dev/null +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker_thread.c @@ -0,0 +1,605 @@ +/* + * Copyright (C) Yichun Zhang (agentzh) + * Copyright (C) Jinhua Luo (kingluo) + * I hereby assign copyright in this code to the lua-nginx-module project, + * to be licensed under the same terms as the rest of the code. + */ + + +#ifndef DDEBUG +#define DDEBUG 0 +#endif +#include "ddebug.h" + + +#include "ngx_http_lua_worker_thread.h" +#include "ngx_http_lua_util.h" +#include "ngx_http_lua_string.h" +#include "ngx_http_lua_config.h" + + +#if (NGX_THREADS) + + +#include +#include + + +typedef struct ngx_http_lua_task_ctx_s { + lua_State *vm; + struct ngx_http_lua_task_ctx_s *next; +} ngx_http_lua_task_ctx_t; + + +typedef struct { + ngx_http_lua_task_ctx_t *ctx; + ngx_http_lua_co_ctx_t *wait_co_ctx; + int n_args; + int rc; + int is_abort:1; +} ngx_http_lua_worker_thread_ctx_t; + + +static ngx_http_lua_task_ctx_t dummy_ctx; +static ngx_http_lua_task_ctx_t *ctxpool = &dummy_ctx; +static ngx_uint_t worker_thread_vm_count; + + +void +ngx_http_lua_thread_exit_process(void) +{ + ngx_http_lua_task_ctx_t *ctx; + + while (ctxpool->next != NULL) { + ctx = ctxpool->next; + ctxpool->next = ctx->next; + lua_close(ctx->vm); + ngx_free(ctx); + } +} + + +/* + * Re-implement ngx_thread_task_alloc to avoid alloc from request pool + * since the request may exit before worker thread finish. + * And we may implement a memory pool for this allocation in the future + * to avoid memory fragmentation. + */ +static ngx_thread_task_t * +ngx_http_lua_thread_task_alloc(size_t size) +{ + ngx_thread_task_t *task; + + task = ngx_calloc(sizeof(ngx_thread_task_t) + size, ngx_cycle->log); + if (task == NULL) { + return NULL; + } + + task->ctx = task + 1; + + return task; +} + + +static void +ngx_http_lua_thread_task_free(void *ctx) +{ + ngx_thread_task_t *task = ctx; + ngx_free(task - 1); +} + + +static ngx_http_lua_task_ctx_t * +ngx_http_lua_get_task_ctx(lua_State *L, ngx_http_request_t *r) +{ + ngx_http_lua_task_ctx_t *ctx = NULL; + + size_t path_len; + const char *path; + size_t cpath_len; + const char *cpath; + lua_State *vm; + + ngx_http_lua_main_conf_t *lmcf; + + lmcf = ngx_http_get_module_main_conf(r, ngx_http_lua_module); + + if (ctxpool->next == NULL) { + if (worker_thread_vm_count >= lmcf->worker_thread_vm_pool_size) { + return NULL; + } + + ctx = ngx_calloc(sizeof(ngx_http_lua_task_ctx_t), ngx_cycle->log); + if (ctx == NULL) { + return NULL; + } + + vm = luaL_newstate(); + + if (vm == NULL) { + ngx_free(ctx); + return NULL; + } + + worker_thread_vm_count++; + + ctx->vm = vm; + + luaL_openlibs(vm); + + /* copy package.path and package.cpath */ + lua_getglobal(L, "package"); + lua_getfield(L, -1, "path"); + path = lua_tolstring(L, -1, &path_len); + lua_getfield(L, -2, "cpath"); + cpath = lua_tolstring(L, -1, &cpath_len); + + lua_getglobal(vm, "package"); + lua_pushlstring(vm, path, path_len); + lua_setfield(vm, -2, "path"); + lua_pushlstring(vm, cpath, cpath_len); + lua_setfield(vm, -2, "cpath"); + + /* pop path, cpath and "package" table from L */ + lua_pop(L, 3); + + /* inject API from C */ + lua_newtable(L); /* ngx.* */ + ngx_http_lua_inject_string_api(vm); + ngx_http_lua_inject_config_api(vm); + lua_setglobal(vm, "ngx"); + + /* inject API via ffi */ + lua_getglobal(vm, "require"); + lua_pushstring(vm, "resty.core.regex"); + if (lua_pcall(vm, 1, 0, 0) != 0) { + lua_close(vm); + ngx_free(ctx); + return NULL; + } + + lua_getglobal(vm, "require"); + lua_pushstring(vm, "resty.core.hash"); + if (lua_pcall(vm, 1, 0, 0) != 0) { + lua_close(vm); + ngx_free(ctx); + return NULL; + } + + lua_getglobal(vm, "require"); + lua_pushstring(vm, "resty.core.base64"); + if (lua_pcall(vm, 1, 0, 0) != 0) { + lua_close(vm); + ngx_free(ctx); + return NULL; + } + + } else { + ctx = ctxpool->next; + ctxpool->next = ctx->next; + ctx->next = NULL; + } + + return ctx; +} + + +static void +ngx_http_lua_free_task_ctx(ngx_http_lua_task_ctx_t *ctx) +{ + ctx->next = ctxpool->next; + ctxpool->next = ctx; + + /* clean Lua stack */ + lua_settop(ctx->vm, 0); +} + + +static int +ngx_http_lua_xcopy(lua_State *from, lua_State *to, int idx, + const int allow_nil) +{ + size_t len = 0; + const char *str; + int typ; + int top_from, top_to; + + typ = lua_type(from, idx); + switch (typ) { + case LUA_TBOOLEAN: + lua_pushboolean(to, lua_toboolean(from, idx)); + return LUA_TBOOLEAN; + + case LUA_TLIGHTUSERDATA: + lua_pushlightuserdata(to, lua_touserdata(from, idx)); + return LUA_TLIGHTUSERDATA; + + case LUA_TNUMBER: + lua_pushnumber(to, lua_tonumber(from, idx)); + return LUA_TNUMBER; + + case LUA_TSTRING: + str = lua_tolstring(from, idx, &len); + lua_pushlstring(to, str, len); + return LUA_TSTRING; + + case LUA_TTABLE: + top_from = lua_gettop(from); + top_to = lua_gettop(to); + + lua_newtable(to); + + /* to positive number */ + if (idx < 0) { + idx = lua_gettop(from) + idx + 1; + } + + lua_pushnil(from); + + while (lua_next(from, idx) != 0) { + if (ngx_http_lua_xcopy(from, to, -2, 0) != LUA_TNONE + && ngx_http_lua_xcopy(from, to, -1, 0) != LUA_TNONE) + { + lua_rawset(to, -3); + + } else { + lua_settop(from, top_from); + lua_settop(to, top_to); + return LUA_TNONE; + } + + lua_pop(from, 1); + } + + return LUA_TTABLE; + + case LUA_TNIL: + if (allow_nil) { + lua_pushnil(to); + return LUA_TNIL; + } + /* fall through */ + + /* + * ignore unsupported values: + * LUA_TNONE + * LUA_TFUNCTION + * LUA_TUSERDATA + * LUA_TTHREAD + */ + default: + return LUA_TNONE; + } +} + + +/* executed in a separate thread */ +static void +ngx_http_lua_worker_thread_handler(void *data, ngx_log_t *log) +{ + ngx_http_lua_worker_thread_ctx_t *ctx = data; + lua_State *vm = ctx->ctx->vm; + + /* function + args in the lua stack */ + ngx_http_lua_assert(lua_gettop(vm) == ctx->n_args + 1); + + ctx->rc = lua_pcall(vm, ctx->n_args, LUA_MULTRET, 0); +} + + +static ngx_int_t +ngx_http_lua_worker_thread_resume(ngx_http_request_t *r) +{ + lua_State *vm; + ngx_connection_t *c; + ngx_int_t rc; + ngx_uint_t nreqs; + ngx_http_lua_ctx_t *ctx; + + ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); + if (ctx == NULL) { + return NGX_ERROR; + } + + ctx->resume_handler = ngx_http_lua_wev_handler; + + c = r->connection; + vm = ngx_http_lua_get_lua_vm(r, ctx); + nreqs = c->requests; + + rc = ngx_http_lua_run_thread(vm, r, ctx, + ctx->cur_co_ctx->nresults_from_worker_thread); + + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "lua run thread returned %d", rc); + + if (rc == NGX_AGAIN) { + return ngx_http_lua_run_posted_threads(c, vm, r, ctx, nreqs); + } + + if (rc == NGX_DONE) { + ngx_http_lua_finalize_request(r, NGX_DONE); + return ngx_http_lua_run_posted_threads(c, vm, r, ctx, nreqs); + } + + if (ctx->entered_content_phase) { + ngx_http_lua_finalize_request(r, rc); + return NGX_DONE; + } + + return rc; +} + + +/* executed in nginx event loop */ +static void +ngx_http_lua_worker_thread_event_handler(ngx_event_t *ev) +{ + ngx_http_lua_worker_thread_ctx_t *worker_thread_ctx; + lua_State *L; + ngx_http_request_t *r; + ngx_connection_t *c; + int nresults; + size_t len; + const char *str; + int i; + ngx_http_lua_ctx_t *ctx; + lua_State *vm; + int saved_top; + + worker_thread_ctx = ev->data; + + if (worker_thread_ctx->is_abort) { + goto failed; + } + + L = worker_thread_ctx->wait_co_ctx->co; + + r = ngx_http_lua_get_req(L); + if (r == NULL) { + goto failed; + } + + c = r->connection; + + ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); + if (ctx == NULL) { + goto failed; + } + + vm = worker_thread_ctx->ctx->vm; + + if (worker_thread_ctx->rc != 0) { + str = lua_tolstring(vm, 1, &len); + lua_pushboolean(L, 0); + lua_pushlstring(L, str, len); + nresults = 2; + + } else { + /* copying return values */ + saved_top = lua_gettop(L); + lua_pushboolean(L, 1); + nresults = lua_gettop(vm) + 1; + for (i = 1; i < nresults; i++) { + if (ngx_http_lua_xcopy(vm, L, i, 1) == LUA_TNONE) { + lua_settop(L, saved_top); + lua_pushboolean(L, 0); + lua_pushstring(L, "unsupported return value"); + nresults = 2; + break; + } + } + } + + ctx->cur_co_ctx = worker_thread_ctx->wait_co_ctx; + ctx->cur_co_ctx->nresults_from_worker_thread = nresults; + ctx->cur_co_ctx->cleanup = NULL; + + ngx_http_lua_free_task_ctx(worker_thread_ctx->ctx); + ngx_http_lua_thread_task_free(worker_thread_ctx); + + /* resume the caller coroutine */ + + if (ctx->entered_content_phase) { + (void) ngx_http_lua_worker_thread_resume(r); + + } else { + ctx->resume_handler = ngx_http_lua_worker_thread_resume; + ngx_http_core_run_phases(r); + } + + ngx_http_run_posted_requests(c); + + return; + +failed: + + ngx_http_lua_free_task_ctx(worker_thread_ctx->ctx); + ngx_http_lua_thread_task_free(worker_thread_ctx); + return; +} + + +static void +ngx_http_lua_worker_thread_cleanup(void *data) +{ + ngx_http_lua_co_ctx_t *ctx = data; + ngx_http_lua_worker_thread_ctx_t *worker_thread_ctx = ctx->data; + worker_thread_ctx->is_abort = 1; +} + + +/* It's not easy to use pure ffi here, using the Lua C API for now. */ +static int +ngx_http_lua_run_worker_thread(lua_State *L) +{ + ngx_http_request_t *r; + ngx_http_lua_ctx_t *ctx; + int n_args; + ngx_str_t thread_pool_name; + ngx_thread_pool_t *thread_pool; + ngx_http_lua_task_ctx_t *tctx; + lua_State *vm; + size_t len; + const char *mod_name; + const char *func_name; + int rc; + const char *err; + int i; + ngx_thread_task_t *task; + ngx_http_lua_worker_thread_ctx_t *worker_thread_ctx; + + r = ngx_http_lua_get_req(L); + if (r == NULL) { + return luaL_error(L, "no request found"); + } + + ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); + if (ctx == NULL) { + return luaL_error(L, "no ctx found"); + } + + ngx_http_lua_check_context(L, ctx, NGX_HTTP_LUA_CONTEXT_YIELDABLE); + + n_args = lua_gettop(L); + + if (n_args < 3) { + lua_pushboolean(L, 0); + lua_pushstring(L, "expecting at least 3 arguments"); + return 2; + } + + thread_pool_name.data = (u_char *) + lua_tolstring(L, 1, &thread_pool_name.len); + + if (thread_pool_name.data == NULL) { + lua_pushboolean(L, 0); + lua_pushstring(L, "threadpool should be a string"); + return 2; + } + + thread_pool = ngx_thread_pool_get((ngx_cycle_t *) ngx_cycle, + &thread_pool_name); + + if (thread_pool == NULL) { + lua_pushboolean(L, 0); + lua_pushfstring(L, "thread pool %s not found", thread_pool_name.data); + return 2; + } + + mod_name = lua_tolstring(L, 2, &len); + if (mod_name == NULL) { + lua_pushboolean(L, 0); + lua_pushstring(L, "module name should be a string"); + return 2; + } + + func_name = lua_tolstring(L, 3, NULL); + if (func_name == NULL) { + lua_pushboolean(L, 0); + lua_pushstring(L, "function name should be a string"); + return 2; + } + + /* get vm */ + tctx = ngx_http_lua_get_task_ctx(L, r); + if (tctx == NULL) { + lua_pushboolean(L, 0); + lua_pushstring(L, "no available Lua vm"); + return 2; + } + + vm = tctx->vm; + + ngx_http_lua_assert(lua_gettop(vm) == 0); + + /* push function from module require */ + lua_getfield(vm, LUA_GLOBALSINDEX, "require"); + lua_pushlstring(vm, mod_name, len); + rc = lua_pcall(vm, 1, 1, 0); + + if (rc != 0) { + err = lua_tolstring(vm, 1, &len); + lua_pushboolean(L, 0); + lua_pushlstring(L, err, len); + ngx_http_lua_free_task_ctx(tctx); + return 2; + } + + if (!lua_istable(vm, -1)) { + lua_pushboolean(L, 0); + lua_pushstring(L, "invalid lua module"); + ngx_http_lua_free_task_ctx(tctx); + return 2; + } + + lua_getfield(vm, -1, func_name); + if (!lua_isfunction(vm, -1)) { + lua_pushboolean(L, 0); + lua_pushstring(L, "invalid function"); + ngx_http_lua_free_task_ctx(tctx); + return 2; + } + + /* remove the table returned by require */ + lua_remove(vm, 1); + + /* copying passed arguments */ + for (i = 4; i <= n_args; i++) { + if (ngx_http_lua_xcopy(L, vm, i, 1) == LUA_TNONE) { + lua_pushboolean(L, 0); + lua_pushstring(L, "unsupported argument type"); + ngx_http_lua_free_task_ctx(tctx); + return 2; + } + } + + /* post task */ + task = ngx_http_lua_thread_task_alloc( + sizeof(ngx_http_lua_worker_thread_ctx_t)); + + if (task == NULL) { + ngx_http_lua_free_task_ctx(tctx); + lua_pushboolean(L, 0); + lua_pushstring(L, "no memory"); + return 2; + } + + worker_thread_ctx = task->ctx; + + worker_thread_ctx->ctx = tctx; + worker_thread_ctx->wait_co_ctx = ctx->cur_co_ctx; + + ctx->cur_co_ctx->cleanup = ngx_http_lua_worker_thread_cleanup; + ctx->cur_co_ctx->data = worker_thread_ctx; + + worker_thread_ctx->n_args = n_args - 3; + worker_thread_ctx->rc = 0; + worker_thread_ctx->is_abort = 0; + + task->handler = ngx_http_lua_worker_thread_handler; + task->event.handler = ngx_http_lua_worker_thread_event_handler; + task->event.data = worker_thread_ctx; + + if (ngx_thread_task_post(thread_pool, task) != NGX_OK) { + ngx_http_lua_free_task_ctx(tctx); + ngx_http_lua_thread_task_free(task); + lua_pushboolean(L, 0); + lua_pushstring(L, "ngx_thread_task_post failed"); + return 2; + } + + return lua_yield(L, 0); +} + + +void +ngx_http_lua_inject_worker_thread_api(ngx_log_t *log, lua_State *L) +{ + lua_pushcfunction(L, ngx_http_lua_run_worker_thread); + lua_setfield(L, -2, "run_worker_thread"); +} + +#endif + +/* vi:set ft=c ts=4 sw=4 et fdm=marker: */ diff --git a/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker_thread.h b/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker_thread.h new file mode 100644 index 000000000..2daa520a5 --- /dev/null +++ b/src/deps/src/lua-nginx-module/src/ngx_http_lua_worker_thread.h @@ -0,0 +1,21 @@ +/* + * Copyright (C) Yichun Zhang (agentzh) + * Copyright (C) Jinhua Luo (kingluo) + * I hereby assign copyright in this code to the lua-nginx-module project, + * to be licensed under the same terms as the rest of the code. + */ + +#ifndef _NGX_HTTP_LUA_WORKER_THREAD_H_INCLUDED_ +#define _NGX_HTTP_LUA_WORKER_THREAD_H_INCLUDED_ + + +#include "ngx_http_lua_common.h" + + +void ngx_http_lua_inject_worker_thread_api(ngx_log_t *log, lua_State *L); +void ngx_http_lua_thread_exit_process(void); + + +#endif /* _NGX_HTTP_LUA_WORKER_THREAD_H_INCLUDED_ */ + +/* vi:set ft=c ts=4 sw=4 et fdm=marker: */ diff --git a/src/deps/src/lua-nginx-module/t/006-escape.t b/src/deps/src/lua-nginx-module/t/006-escape.t index 266b23516..28714ab89 100644 --- a/src/deps/src/lua-nginx-module/t/006-escape.t +++ b/src/deps/src/lua-nginx-module/t/006-escape.t @@ -315,8 +315,8 @@ GET /lua --- config location /lua { content_by_lua_block { - ngx.say(ngx.unescape_uri("%a")) -- first charactor is good - ngx.say(ngx.unescape_uri("%u")) -- first charactor is bad + ngx.say(ngx.unescape_uri("%a")) -- first character is good + ngx.say(ngx.unescape_uri("%u")) -- first character is bad ngx.say(ngx.unescape_uri("%")) ngx.say(ngx.unescape_uri("good%20job%")) } diff --git a/src/deps/src/lua-nginx-module/t/014-bugs.t b/src/deps/src/lua-nginx-module/t/014-bugs.t index dad084ec4..8c93920bc 100644 --- a/src/deps/src/lua-nginx-module/t/014-bugs.t +++ b/src/deps/src/lua-nginx-module/t/014-bugs.t @@ -8,7 +8,7 @@ log_level('debug'); repeat_each(3); -plan tests => repeat_each() * (blocks() * 2 + 30); +plan tests => repeat_each() * (blocks() * 2 + 33); our $HtmlDir = html_dir; #warn $html_dir; @@ -1019,3 +1019,223 @@ write timer set: 1 --- no_error_log [error] [alert] + + + +=== TEST 42: tcp: nginx crash when resolve an not exist domain in ngx.thread.spawn +https://github.com/openresty/lua-nginx-module/issues/1915 +--- config + resolver $TEST_NGINX_RESOLVER ipv6=off; + location = /t { + content_by_lua_block { + local function tcp(host, port) + local sock = ngx.socket.tcp() + local ok,err = sock:connect(host, port) + if not ok then + ngx.log(ngx.WARN, "failed: ", err) + sock:close() + return false + end + + sock:close() + return true + end + + local host = "nonexistent.openresty.org" + local port = 80 + + local threads = {} + for i = 1, 3 do + threads[i] = ngx.thread.spawn(tcp, host, port) + end + + local ok, res = ngx.thread.wait(threads[1],threads[2],threads[3]) + if not ok then + ngx.say("failed to wait thread") + return + end + + ngx.say("res: ", res) + + for i = 1, 3 do + ngx.thread.kill(threads[i]) + end + } + } + +--- request +GET /t +--- response_body +res: false +--- error_log +nonexistent.openresty.org could not be resolved + + + +=== TEST 43: domain exists with tcp socket +https://github.com/openresty/lua-nginx-module/issues/1915 +--- config + resolver $TEST_NGINX_RESOLVER ipv6=off; + location = /t { + content_by_lua_block { + local function tcp(host, port) + local sock = ngx.socket.tcp() + local ok,err = sock:connect(host, port) + if not ok then + ngx.log(ngx.WARN, "failed: ", err) + sock:close() + return false + end + + sock:close() + return true + end + + local host = "www.openresty.org" + local port = 80 + + local threads = {} + for i = 1, 3 do + threads[i] = ngx.thread.spawn(tcp, host, port) + end + + local ok, res = ngx.thread.wait(threads[1],threads[2],threads[3]) + if not ok then + ngx.say("failed to wait thread") + return + end + + ngx.say("res: ", res) + + for i = 1, 3 do + ngx.thread.kill(threads[i]) + end + } + } + +--- request +GET /t +--- response_body +res: true + + + +=== TEST 44: domain exists with udp socket +https://github.com/openresty/lua-nginx-module/issues/1915 +--- config + resolver $TEST_NGINX_RESOLVER ipv6=off; + location = /t { + content_by_lua_block { + local function udp(host, port) + local sock = ngx.socket.udp() + local ok,err = sock:setpeername(host, port) + if not ok then + ngx.log(ngx.WARN, "failed: ", err) + sock:close() + return false + end + + sock:close() + return true + end + + local host = "nonexistent.openresty.org" + local port = 80 + + local threads = {} + for i = 1, 3 do + threads[i] = ngx.thread.spawn(udp, host, port) + end + + local ok, res = ngx.thread.wait(threads[1],threads[2],threads[3]) + if not ok then + ngx.say("failed to wait thread") + return + end + + ngx.say("res: ", res) + + for i = 1, 3 do + ngx.thread.kill(threads[i]) + end + } + } + +--- request +GET /t +--- response_body +res: false +--- error_log +nonexistent.openresty.org could not be resolved + + + +=== TEST 45: udp: nginx crash when resolve an not exist domain in ngx.thread.spawn +https://github.com/openresty/lua-nginx-module/issues/1915 +--- config + resolver $TEST_NGINX_RESOLVER ipv6=off; + location = /t { + content_by_lua_block { + local function udp(host, port) + local sock = ngx.socket.udp() + local ok,err = sock:setpeername(host, port) + if not ok then + ngx.log(ngx.WARN, "failed: ", err) + sock:close() + return false + end + + sock:close() + return true + end + + local host = "www.openresty.org" + local port = 80 + + local threads = {} + for i = 1, 3 do + threads[i] = ngx.thread.spawn(udp, host, port) + end + + local ok, res = ngx.thread.wait(threads[1],threads[2],threads[3]) + if not ok then + ngx.say("failed to wait thread") + return + end + + ngx.say("res: ", res) + + for i = 1, 3 do + ngx.thread.kill(threads[i]) + end + } + } + +--- request +GET /t +--- response_body +res: true + + + +=== TEST 46: nginx crash when parsing a word or a single configuration item that is too long +https://github.com/openresty/lua-nginx-module/issues/1938 +--- http_config + init_worker_by_lua ' + err_big_str = 'A NA' + '; +--- config + location /t { + content_by_lua ' + ngx.say("hello world") + '; + } +--- request +GET /t +--- response_body +res: true +--- no_error_log +[error] +--- must_die +--- error_log eval +qr/\[emerg\] \d+#\d+: unexpected "A" in/ diff --git a/src/deps/src/lua-nginx-module/t/015-status.t b/src/deps/src/lua-nginx-module/t/015-status.t index 666dae727..a69c59377 100644 --- a/src/deps/src/lua-nginx-module/t/015-status.t +++ b/src/deps/src/lua-nginx-module/t/015-status.t @@ -272,7 +272,7 @@ ngx.status = 502 -=== TEST 16: ngx.status assignmnt should clear r->err_status +=== TEST 16: ngx.status assignment should clear r->err_status --- config location = /t { return 502; diff --git a/src/deps/src/lua-nginx-module/t/016-resp-header.t b/src/deps/src/lua-nginx-module/t/016-resp-header.t index c7b5addee..b558415b2 100644 --- a/src/deps/src/lua-nginx-module/t/016-resp-header.t +++ b/src/deps/src/lua-nginx-module/t/016-resp-header.t @@ -931,7 +931,7 @@ Hello local results = {} results.something = "hello" results.content_type = "anything" - results.somehing_else = "hi" + results.something_else = "hi" local arr = {} for k in pairs(results) do table.insert(arr, k) end @@ -948,8 +948,8 @@ Content-Type: text/my-plain --- response_body content_type: anything -somehing_else: hi something: hello +something_else: hi --- no_error_log [error] diff --git a/src/deps/src/lua-nginx-module/t/020-subrequest.t b/src/deps/src/lua-nginx-module/t/020-subrequest.t index 18befbd76..844b64794 100644 --- a/src/deps/src/lua-nginx-module/t/020-subrequest.t +++ b/src/deps/src/lua-nginx-module/t/020-subrequest.t @@ -3000,6 +3000,8 @@ method: GET, uri: /foo, X: GET /bar HTTP/1.0 0 --- no_error_log [error] +--- skip_nginx +3: >= 1.21.1 @@ -3128,6 +3130,8 @@ method: POST, uri: /foo 0 --- no_error_log [error] +--- skip_nginx +3: >= 1.21.1 @@ -3259,6 +3263,8 @@ method: POST, uri: /foo 0 --- no_error_log [error] +--- skip_nginx +3: >= 1.21.1 @@ -3391,3 +3397,128 @@ method: POST, uri: /foo 0 --- no_error_log [error] +--- skip_nginx +3: >= 1.21.1 + + + +=== TEST 81: bad HTTP method +--- config + location /other { } + + location /lua { + content_by_lua_block { + local res = ngx.location.capture("/other", + { method = 10240 }); + } + } +--- request +GET /lua +--- response_body_like: 500 Internal Server Error +--- error_code: 500 +--- error_log +unsupported HTTP method: 10240 + + + +=== TEST 82: bad requests with both Content-Length and Transfer-Encoding (nginx >= 1.21.1) +--- http_config + upstream backend { + server unix:$TEST_NGINX_HTML_DIR/nginx.sock; + keepalive 32; + } + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock; + + location / { + content_by_lua_block { + ngx.say("method: ", ngx.var.request_method, + ", uri: ", ngx.var.uri, + ", X: ", ngx.var.http_x) + } + } + } +--- config + location /proxy { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://backend/foo; + } + + location /capture { + server_tokens off; + more_clear_headers Date; + + content_by_lua_block { + local res = ngx.location.capture("/proxy") + ngx.print(res.body) + } + } + + location /t { + content_by_lua_block { + local req = [[ +GET /capture HTTP/1.1 +Host: test.com +Content-Length: 37 +Transfer-Encoding: chunked + +0 + +GET /capture HTTP/1.1 +Host: test.com +X: GET /bar HTTP/1.0 + +]] + + local sock = ngx.socket.tcp() + sock:settimeout(1000) + + local ok, err = sock:connect("127.0.0.1", $TEST_NGINX_SERVER_PORT) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send req: ", err) + return + end + + ngx.say("req bytes: ", bytes) + + local n_resp = 0 + + local reader = sock:receiveuntil("\r\n") + while true do + local line, err = reader() + if line then + ngx.say(line) + if line == "0" then + n_resp = n_resp + 1 + end + + if n_resp >= 2 then + break + end + + else + ngx.say("err: ", err) + break + end + end + + sock:close() + } + } +--- request +GET /t +--- response_body_like +req bytes: 146 +HTTP/1.1 400 Bad Request +--- no_error_log +[error] +--- skip_nginx +3: < 1.21.1 diff --git a/src/deps/src/lua-nginx-module/t/023-rewrite/on-abort.t b/src/deps/src/lua-nginx-module/t/023-rewrite/on-abort.t index 336b7ce4b..59c5df116 100644 --- a/src/deps/src/lua-nginx-module/t/023-rewrite/on-abort.t +++ b/src/deps/src/lua-nginx-module/t/023-rewrite/on-abort.t @@ -419,7 +419,7 @@ main handler done -=== TEST 9: regsiter on_abort callback but no client abortion +=== TEST 9: register on_abort callback but no client abortion --- config location /t { lua_check_client_abort on; @@ -560,7 +560,7 @@ on abort called -=== TEST 12: regsiter on_abort callback but no client abortion (uthread) +=== TEST 12: register on_abort callback but no client abortion (uthread) --- config location /t { lua_check_client_abort on; @@ -607,7 +607,7 @@ main handler done -=== TEST 13: regsiter on_abort callback multiple times +=== TEST 13: register on_abort callback multiple times --- config location /t { lua_check_client_abort on; diff --git a/src/deps/src/lua-nginx-module/t/023-rewrite/socket-keepalive.t b/src/deps/src/lua-nginx-module/t/023-rewrite/socket-keepalive.t index 8b532ead6..c943e4461 100644 --- a/src/deps/src/lua-nginx-module/t/023-rewrite/socket-keepalive.t +++ b/src/deps/src/lua-nginx-module/t/023-rewrite/socket-keepalive.t @@ -903,7 +903,7 @@ lua tcp socket get keepalive peer: using connection -=== TEST 12: github issue #108: ngx.locaiton.capture + redis.set_keepalive +=== TEST 12: github issue #108: ngx.location.capture + redis.set_keepalive --- http_config eval qq{ lua_package_path "$::HtmlDir/?.lua;;"; diff --git a/src/deps/src/lua-nginx-module/t/024-access/on-abort.t b/src/deps/src/lua-nginx-module/t/024-access/on-abort.t index 5bb948bb6..b9532aea3 100644 --- a/src/deps/src/lua-nginx-module/t/024-access/on-abort.t +++ b/src/deps/src/lua-nginx-module/t/024-access/on-abort.t @@ -417,7 +417,7 @@ main handler done -=== TEST 9: regsiter on_abort callback but no client abortion +=== TEST 9: register on_abort callback but no client abortion --- config location /t { lua_check_client_abort on; @@ -558,7 +558,7 @@ on abort called -=== TEST 12: regsiter on_abort callback but no client abortion (uthread) +=== TEST 12: register on_abort callback but no client abortion (uthread) --- config location /t { lua_check_client_abort on; @@ -603,7 +603,7 @@ main handler done -=== TEST 13: regsiter on_abort callback multiple times +=== TEST 13: register on_abort callback multiple times --- config location /t { lua_check_client_abort on; diff --git a/src/deps/src/lua-nginx-module/t/025-codecache.t b/src/deps/src/lua-nginx-module/t/025-codecache.t index 3e01bb88c..cf62ff018 100644 --- a/src/deps/src/lua-nginx-module/t/025-codecache.t +++ b/src/deps/src/lua-nginx-module/t/025-codecache.t @@ -1096,7 +1096,7 @@ function go(port) ngx.say("failed to receive a line: ", err, " [", part, "]") end - local ok, err = sock:setkeepalive(1) + local ok, err = sock:setkeepalive(10) if not ok then ngx.say("failed to set reusable: ", err) end diff --git a/src/deps/src/lua-nginx-module/t/028-req-header.t b/src/deps/src/lua-nginx-module/t/028-req-header.t index c2c58eb52..8c8ff83fd 100644 --- a/src/deps/src/lua-nginx-module/t/028-req-header.t +++ b/src/deps/src/lua-nginx-module/t/028-req-header.t @@ -539,7 +539,7 @@ lua exceeding request header limit -=== TEST 21: execeeding custom max 102 header limit +=== TEST 21: exceeding custom max 102 header limit --- config location /lua { content_by_lua ' @@ -591,7 +591,7 @@ lua exceeding request header limit 103 > 102 -=== TEST 22: NOT execeeding custom max 102 header limit +=== TEST 22: NOT exceeding custom max 102 header limit --- config location /lua { content_by_lua ' @@ -1863,7 +1863,7 @@ ok -=== TEST 57: execeeding custom 3 header limit +=== TEST 57: exceeding custom 3 header limit --- config location /lua { content_by_lua ' @@ -1901,7 +1901,7 @@ lua exceeding request header limit 4 > 3 -=== TEST 58: NOT execeeding custom 3 header limit +=== TEST 58: NOT exceeding custom 3 header limit --- config location /lua { content_by_lua ' @@ -1937,7 +1937,7 @@ lua exceeding request header limit -=== TEST 59: execeeding custom 3 header limit (raw) +=== TEST 59: exceeding custom 3 header limit (raw) --- config location /lua { content_by_lua ' @@ -1975,7 +1975,7 @@ lua exceeding request header limit 4 > 3 -=== TEST 60: NOT execeeding custom 3 header limit (raw) +=== TEST 60: NOT exceeding custom 3 header limit (raw) --- config location /lua { content_by_lua ' diff --git a/src/deps/src/lua-nginx-module/t/044-req-body.t b/src/deps/src/lua-nginx-module/t/044-req-body.t index e645eeefe..2ef7e1d29 100644 --- a/src/deps/src/lua-nginx-module/t/044-req-body.t +++ b/src/deps/src/lua-nginx-module/t/044-req-body.t @@ -440,7 +440,7 @@ b.txt exists: yes -=== TEST 17: read buffered body to memoary and reset it to a new file (auto-clean) +=== TEST 17: read buffered body to memory and reset it to a new file (auto-clean) --- config client_body_in_file_only off; @@ -476,7 +476,7 @@ qr/500 Internal Server Error/] -=== TEST 18: read buffered body to memoary and reset it to a new file (no auto-clean) +=== TEST 18: read buffered body to memory and reset it to a new file (no auto-clean) --- config client_body_in_file_only off; diff --git a/src/deps/src/lua-nginx-module/t/062-count.t b/src/deps/src/lua-nginx-module/t/062-count.t index 807e618e2..598441c51 100644 --- a/src/deps/src/lua-nginx-module/t/062-count.t +++ b/src/deps/src/lua-nginx-module/t/062-count.t @@ -34,7 +34,7 @@ __DATA__ --- request GET /test --- response_body -ngx: 113 +ngx: 114 --- no_error_log [error] @@ -55,7 +55,7 @@ ngx: 113 --- request GET /test --- response_body -113 +114 --- no_error_log [error] @@ -83,7 +83,7 @@ GET /test --- request GET /test --- response_body -n = 113 +n = 114 --- no_error_log [error] @@ -305,7 +305,7 @@ GET /t --- response_body_like: 404 Not Found --- error_code: 404 --- error_log -ngx. entry count: 113 +ngx. entry count: 114 diff --git a/src/deps/src/lua-nginx-module/t/068-socket-keepalive.t b/src/deps/src/lua-nginx-module/t/068-socket-keepalive.t index d67da3bd1..cf8bc25ac 100644 --- a/src/deps/src/lua-nginx-module/t/068-socket-keepalive.t +++ b/src/deps/src/lua-nginx-module/t/068-socket-keepalive.t @@ -887,7 +887,7 @@ received response of 119 bytes -=== TEST 13: github issue #108: ngx.locaiton.capture + redis.set_keepalive +=== TEST 13: github issue #108: ngx.location.capture + redis.set_keepalive --- http_config eval qq{ lua_package_path "$::HtmlDir/?.lua;;"; diff --git a/src/deps/src/lua-nginx-module/t/082-body-filter-2.t b/src/deps/src/lua-nginx-module/t/082-body-filter-2.t new file mode 100644 index 000000000..eafe7cf26 --- /dev/null +++ b/src/deps/src/lua-nginx-module/t/082-body-filter-2.t @@ -0,0 +1,62 @@ +# vim:set ft= ts=4 sw=4 et fdm=marker: + +our $SkipReason; + +BEGIN { + if ($ENV{TEST_NGINX_EVENT_TYPE} && $ENV{TEST_NGINX_EVENT_TYPE} ne 'poll') { + $SkipReason = "unavailable for the event type '$ENV{TEST_NGINX_EVENT_TYPE}'"; + + } else { + $ENV{TEST_NGINX_POSTPONE_OUTPUT} = 1; + $ENV{TEST_NGINX_EVENT_TYPE} = 'poll'; + $ENV{MOCKEAGAIN}='w' + } +} + +use Test::Nginx::Socket::Lua $SkipReason ? (skip_all => $SkipReason) : (); + +#worker_connections(1014); +#master_process_enabled(1); +#log_level('warn'); + +log_level('debug'); + +repeat_each(2); + +plan tests => repeat_each() * (blocks() * 5); + +#no_diff(); +no_long_string(); + +run_tests(); + +__DATA__ + +=== TEST 1: check ctx->busy_bufs +--- config + location /t { + postpone_output 1; + content_by_lua_block { + for i = 1, 5 do + ngx.say(i, ": Hello World!") + end + } + + body_filter_by_lua_block { + ngx.arg[1] = ngx.arg[1] + } + } +--- request +GET /t +--- response_body +1: Hello World! +2: Hello World! +3: Hello World! +4: Hello World! +5: Hello World! + +--- error_log +waiting body filter busy buffer to be sent +lua say response has busy bufs +--- no_error_log +[error] diff --git a/src/deps/src/lua-nginx-module/t/087-udp-socket.t b/src/deps/src/lua-nginx-module/t/087-udp-socket.t index fc467d769..80c5e3651 100644 --- a/src/deps/src/lua-nginx-module/t/087-udp-socket.t +++ b/src/deps/src/lua-nginx-module/t/087-udp-socket.t @@ -1171,7 +1171,7 @@ send: fd:\d+ 15 of 15/ -=== TEST 22: send tables of string framents (with numbers too) +=== TEST 22: send tables of string fragments (with numbers too) the maximum number of significant digits is 14 in lua --- config server_tokens off; diff --git a/src/deps/src/lua-nginx-module/t/101-on-abort.t b/src/deps/src/lua-nginx-module/t/101-on-abort.t index 182d12c54..ee1e41e3a 100644 --- a/src/deps/src/lua-nginx-module/t/101-on-abort.t +++ b/src/deps/src/lua-nginx-module/t/101-on-abort.t @@ -408,7 +408,7 @@ main handler done -=== TEST 9: regsiter on_abort callback but no client abortion +=== TEST 9: register on_abort callback but no client abortion --- config location /t { lua_check_client_abort on; @@ -546,7 +546,7 @@ on abort called -=== TEST 12: regsiter on_abort callback but no client abortion (uthread) +=== TEST 12: register on_abort callback but no client abortion (uthread) --- config location /t { lua_check_client_abort on; @@ -591,7 +591,7 @@ main handler done -=== TEST 13: regsiter on_abort callback multiple times +=== TEST 13: register on_abort callback multiple times --- config location /t { lua_check_client_abort on; @@ -794,7 +794,7 @@ on abort called -=== TEST 18: regsiter on_abort callback but no client abortion (2 uthreads and 1 pending) +=== TEST 18: register on_abort callback but no client abortion (2 uthreads and 1 pending) --- config location /t { lua_check_client_abort on; diff --git a/src/deps/src/lua-nginx-module/t/104-req-raw-header.t b/src/deps/src/lua-nginx-module/t/104-req-raw-header.t index ac1f89e1b..f147b2bcf 100644 --- a/src/deps/src/lua-nginx-module/t/104-req-raw-header.t +++ b/src/deps/src/lua-nginx-module/t/104-req-raw-header.t @@ -331,6 +331,8 @@ Foo: bar baz\r } --- no_error_log [error] +--- skip_nginx +3: >= 1.21.1 @@ -362,6 +364,8 @@ Connection: close\r --- no_error_log [error] --- timeout: 5 +--- skip_nginx +3: >= 1.21.1 @@ -988,3 +992,28 @@ Connection: close --- no_error_log [error] --- timeout: 5 + + + +=== TEST 34: multi-line header is invalid (nginx >= 1.21.1) +--- config + location /t { + content_by_lua ' + ngx.print(ngx.req.raw_header()) + '; + } +--- raw_request eval +"GET /t HTTP/1.1\r +Host: localhost\r +Connection: close\r +Foo: bar baz\r + blah\r +\r +" +--- error_code: 400 +--- error_log +client sent invalid header line: "\x20..." while reading client request headers +--- no_error_log +[error] +--- skip_nginx +3: < 1.21.1 diff --git a/src/deps/src/lua-nginx-module/t/106-timer.t b/src/deps/src/lua-nginx-module/t/106-timer.t index 2996762ad..acd6e4c80 100644 --- a/src/deps/src/lua-nginx-module/t/106-timer.t +++ b/src/deps/src/lua-nginx-module/t/106-timer.t @@ -118,7 +118,7 @@ F(ngx_http_lua_timer_handler) { registered timer foo = 3 ---- wait: 0.1 +--- wait: 0.2 --- no_error_log [error] [alert] @@ -603,7 +603,7 @@ delete thread 2 --- response_body hello world ---- wait: 0.12 +--- wait: 0.3 --- no_error_log [error] [alert] @@ -613,7 +613,7 @@ hello world [ "registered timer", qr/\[lua\] .*? my lua timer handler/, -qr/\[lua\] log_by_lua\(nginx\.conf:\d+\):\d+: elapsed: 0\.0(?:6[4-9]|7[0-6])/, +qr/\[lua\] log_by_lua\(nginx\.conf:\d+\):\d+: elapsed: 0\.0(?:6[4-9]|7[0-9]|8[1-3])/, "lua ngx.timer expired", "http lua close fake http connection" ] diff --git a/src/deps/src/lua-nginx-module/t/114-config.t b/src/deps/src/lua-nginx-module/t/114-config.t index 9d6680dda..46d98de2f 100644 --- a/src/deps/src/lua-nginx-module/t/114-config.t +++ b/src/deps/src/lua-nginx-module/t/114-config.t @@ -33,7 +33,7 @@ GET /t -=== TEST 2: ngx.config.subystem +=== TEST 2: ngx.config.subsystem --- config location /t { content_by_lua ' diff --git a/src/deps/src/lua-nginx-module/t/120-re-find.t b/src/deps/src/lua-nginx-module/t/120-re-find.t index f80ca4f57..ddf24a98e 100644 --- a/src/deps/src/lua-nginx-module/t/120-re-find.t +++ b/src/deps/src/lua-nginx-module/t/120-re-find.t @@ -917,3 +917,35 @@ to: 4 pos: 5 --- no_error_log [error] + + + +=== TEST 32: ignore match limit in DFA mode +--- http_config + lua_regex_match_limit 1; +--- config + location /re { + content_by_lua_block { + local s = "This is no more" + local from, to, err = ngx.re.find(s, "<.*>", "d") + if from then + ngx.say("from: ", from) + ngx.say("to: ", to) + ngx.say("matched: ", string.sub(s, from, to)) + else + if err then + ngx.say("error: ", err) + return + end + ngx.say("not matched!") + end + } + } +--- request + GET /re +--- response_body +from: 9 +to: 56 +matched: +--- no_error_log +[error] diff --git a/src/deps/src/lua-nginx-module/t/127-uthread-kill.t b/src/deps/src/lua-nginx-module/t/127-uthread-kill.t index 5542153cf..11caee582 100644 --- a/src/deps/src/lua-nginx-module/t/127-uthread-kill.t +++ b/src/deps/src/lua-nginx-module/t/127-uthread-kill.t @@ -8,7 +8,7 @@ our $StapScript = $t::StapThread::StapScript; repeat_each(2); -plan tests => repeat_each() * (blocks() * 5 + 2); +plan tests => repeat_each() * (blocks() * 5 + 1); $ENV{TEST_NGINX_RESOLVER} ||= '8.8.8.8'; $ENV{TEST_NGINX_MEMCACHED_PORT} ||= '11211'; @@ -139,6 +139,7 @@ lua clean up the timer for pending ngx.sleep === TEST 3: kill pending resolver --- config resolver 127.0.0.2:12345; + resolver_timeout 5ms; location /lua { content_by_lua ' local function f() @@ -184,7 +185,6 @@ killed [error] --- error_log lua tcp socket abort resolver -resolve name done: -2 diff --git a/src/deps/src/lua-nginx-module/t/129-ssl-socket.t b/src/deps/src/lua-nginx-module/t/129-ssl-socket.t index fc2cc31f0..c26f0cec5 100644 --- a/src/deps/src/lua-nginx-module/t/129-ssl-socket.t +++ b/src/deps/src/lua-nginx-module/t/129-ssl-socket.t @@ -6,7 +6,7 @@ use File::Basename; repeat_each(2); -plan tests => repeat_each() * 211; +plan tests => repeat_each() * (blocks() * 7 - 3); $ENV{TEST_NGINX_HTML_DIR} ||= html_dir(); $ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; @@ -2561,3 +2561,276 @@ qr/\[error\] .* ngx.socket sslhandshake: expecting 1 ~ 5 arguments \(including t --- no_error_log [alert] --- timeout: 10 + + + +=== TEST 32: default cipher -TLSv1.3 +--- skip_openssl: 8: < 1.1.1 +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_certificate $TEST_NGINX_CERT_DIR/cert/test.crt; + ssl_certificate_key $TEST_NGINX_CERT_DIR/cert/test.key; + ssl_protocols TLSv1.3; + + location / { + content_by_lua_block { + ngx.exit(200) + } + } + } +--- config + server_tokens off; + lua_ssl_protocols TLSv1.3; + + location /t { + content_by_lua_block { + local sock = ngx.socket.tcp() + sock:settimeout(2000) + + do + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local session, err = sock:sslhandshake(nil, "test.com") + if not session then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(session)) + + local req = "GET / HTTP/1.1\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + local line, err = sock:receive() + if not line then + ngx.say("failed to receive response status line: ", err) + return + end + + ngx.say("received: ", line) + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + collectgarbage() + } + } +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 53 bytes. +received: HTTP/1.1 200 OK +close: 1 nil + +--- log_level: debug +--- grep_error_log eval: qr/lua ssl (?:set|save|free) session: [0-9A-F]+/ +--- grep_error_log_out eval +qr/^lua ssl save session: ([0-9A-F]+) +lua ssl free session: ([0-9A-F]+) +$/ +--- error_log eval +['lua ssl server name: "test.com"', +qr/SSL: TLSv1.3, cipher: "TLS_AES_256_GCM_SHA384 TLSv1.3/] +--- no_error_log +SSL reused session +[error] +[alert] +--- timeout: 10 + + + +=== TEST 33: explicit cipher configuration - TLSv1.3 +--- skip_openssl: 8: < 1.1.1 +--- skip_nginx: 8: < 1.19.4 +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_certificate $TEST_NGINX_CERT_DIR/cert/test.crt; + ssl_certificate_key $TEST_NGINX_CERT_DIR/cert/test.key; + ssl_protocols TLSv1.3; + + location / { + content_by_lua_block { + ngx.exit(200) + } + } + } +--- config + server_tokens off; + lua_ssl_protocols TLSv1.3; + lua_ssl_conf_command Ciphersuites TLS_AES_128_GCM_SHA256; + + location /t { + content_by_lua_block { + local sock = ngx.socket.tcp() + sock:settimeout(2000) + + do + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local session, err = sock:sslhandshake(nil, "test.com") + if not session then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(session)) + + local req = "GET / HTTP/1.1\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + local line, err = sock:receive() + if not line then + ngx.say("failed to receive response status line: ", err) + return + end + + ngx.say("received: ", line) + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + collectgarbage() + } + } +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 53 bytes. +received: HTTP/1.1 200 OK +close: 1 nil + +--- log_level: debug +--- grep_error_log eval: qr/lua ssl (?:set|save|free) session: [0-9A-F]+/ +--- grep_error_log_out eval +qr/^lua ssl save session: ([0-9A-F]+) +lua ssl free session: ([0-9A-F]+) +$/ +--- error_log eval +['lua ssl server name: "test.com"', +qr/SSL: TLSv1.3, cipher: "TLS_AES_128_GCM_SHA256 TLSv1.3/] +--- no_error_log +SSL reused session +[error] +[alert] +--- timeout: 10 + + + +=== TEST 34: explicit cipher configuration not in the default list - TLSv1.3 +--- skip_openssl: 8: < 1.1.1 +--- skip_nginx: 8: < 1.19.4 +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_certificate $TEST_NGINX_CERT_DIR/cert/test.crt; + ssl_certificate_key $TEST_NGINX_CERT_DIR/cert/test.key; + ssl_protocols TLSv1.3; + + location / { + content_by_lua_block { + ngx.exit(200) + } + } + } +--- config + server_tokens off; + lua_ssl_protocols TLSv1.3; + lua_ssl_conf_command Ciphersuites TLS_AES_128_CCM_SHA256; + + location /t { + content_by_lua_block { + local sock = ngx.socket.tcp() + sock:settimeout(2000) + + do + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local session, err = sock:sslhandshake(nil, "test.com") + if not session then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(session)) + + local req = "GET / HTTP/1.1\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + local line, err = sock:receive() + if not line then + ngx.say("failed to receive response status line: ", err) + return + end + + ngx.say("received: ", line) + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + collectgarbage() + } + } +--- request +GET /t +--- response_body +connected: 1 +failed to do SSL handshake: handshake failed + +--- log_level: debug +--- grep_error_log eval: qr/lua ssl (?:set|save|free) session: [0-9A-F]+/ +--- grep_error_log_out +--- error_log eval +[ +qr/\[info\] .*?SSL_do_handshake\(\) failed .*?no shared cipher/, +'lua ssl server name: "test.com"', +] +--- no_error_log +SSL reused session +[alert] +[emerg] +--- timeout: 10 diff --git a/src/deps/src/lua-nginx-module/t/132-lua-blocks.t b/src/deps/src/lua-nginx-module/t/132-lua-blocks.t index 76f4a6184..2a1644e53 100644 --- a/src/deps/src/lua-nginx-module/t/132-lua-blocks.t +++ b/src/deps/src/lua-nginx-module/t/132-lua-blocks.t @@ -312,7 +312,7 @@ hello, world [error] --- must_die --- error_log eval -qr/\[emerg\] .*? Lua code block missing the closing long bracket "]]" in .*?\bnginx\.conf:41/ +qr/\[emerg\] .*? Lua code block missing the closing long bracket "]]", the inlined Lua code may be too long in .*?\bnginx\.conf:\d+/ @@ -331,7 +331,7 @@ hello, world [error] --- must_die --- error_log eval -qr/\[emerg\] .*? Lua code block missing the closing long bracket "]==]" in .*?\bnginx\.conf:41/ +qr/\[emerg\] .*? Lua code block missing the closing long bracket "]==]", the inlined Lua code may be too long in .*?\bnginx.conf:\d+/ @@ -350,7 +350,7 @@ hello, world [error] --- must_die --- error_log eval -qr/\[emerg\] .*? Lua code block missing the closing long bracket "]]" in .*?\bnginx\.conf:41/ +qr/\[emerg\] .*? Lua code block missing the closing long bracket "]]", the inlined Lua code may be too long in .*?\bnginx\.conf:\d+/ @@ -369,7 +369,7 @@ hello, world [error] --- must_die --- error_log eval -qr/\[emerg\] .*? Lua code block missing the closing long bracket "]=]" in .*?\bnginx\.conf:41/ +qr/\[emerg\] .*? Lua code block missing the closing long bracket "]=]", the inlined Lua code may be too long in .*?\bnginx\.conf:\d+/ @@ -606,3 +606,38 @@ GET /t --- response_body_like: } --- no_error_log [error] + + + +=== TEST 24: too long bracket +--- config + location = /t { + content_by_lua_block { + local foo = [[ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ]] + ngx.say(foo) + } + } +--- request +GET /t +--- response_body +hello, world +--- no_error_log +[error] +--- must_die +--- error_log eval +qr/\[emerg\] .*? Lua code block missing the closing long bracket "]]", the inlined Lua code may be too long in .*?\bnginx\.conf:\d+/ diff --git a/src/deps/src/lua-nginx-module/t/138-balancer.t b/src/deps/src/lua-nginx-module/t/138-balancer.t index 238dea8fa..dca178467 100644 --- a/src/deps/src/lua-nginx-module/t/138-balancer.t +++ b/src/deps/src/lua-nginx-module/t/138-balancer.t @@ -7,6 +7,9 @@ use Test::Nginx::Socket::Lua; #workers(2); #log_level('warn'); +#connect 0.0.0.1 on newer kernel won't return EINVAL +#so add an route with cmd: sudo ip route add prohibit 0.0.0.1/32 + repeat_each(2); plan tests => repeat_each() * (blocks() * 4 + 9); @@ -432,7 +435,7 @@ qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\ -=== TEST 15: test if execeed proxy_next_upstream_limit +=== TEST 15: test if exceed proxy_next_upstream_limit --- http_config lua_package_path "../lua-resty-core/lib/?.lua;;"; diff --git a/src/deps/src/lua-nginx-module/t/145-shdict-list.t b/src/deps/src/lua-nginx-module/t/145-shdict-list.t index 9bb159260..6a4759cd0 100644 --- a/src/deps/src/lua-nginx-module/t/145-shdict-list.t +++ b/src/deps/src/lua-nginx-module/t/145-shdict-list.t @@ -743,3 +743,87 @@ GET /test done --- no_error_log [error] + + + +=== TEST 20: push to an expired list +--- http_config + lua_shared_dict dogs 1m; +--- config + location = /test { + content_by_lua_block { + local dogs = ngx.shared.dogs + local len, err = dogs:lpush("cc", "1") --add another list to avoid key"aa" be cleaned (run ‘ngx_http_lua_shdict_expire(ctx, 1)’ may clean key ,ensure key'aa' not clean ,just expired)) + if not len then + ngx.say("push cc err: ", err) + end + local len, err = dogs:lpush("aa", "1") + if not len then + ngx.say("push1 err: ", err) + end + local succ, err = dogs:expire("aa", 0.2) + if not succ then + ngx.say("expire err: ",err) + end + ngx.sleep(0.3) -- list aa expired + local len, err = dogs:lpush("aa", "2") --push to an expired list may set as a new list + if not len then + ngx.say("push2 err: ", err) + end + local len, err = dogs:llen("aa") -- new list len is 1 + if not len then + ngx.say("llen err: ", err) + else + ngx.say("aa:len :", dogs:llen("aa")) + end + } + } + +--- request +GET /test +--- response_body +aa:len :1 +--- no_error_log +[error] + + + +=== TEST 21: push to an expired list then pop many time (more then list len ) +--- http_config + lua_shared_dict dogs 1m; +--- config + location = /test { + content_by_lua_block { + local dogs = ngx.shared.dogs + local len, err = dogs:lpush("cc", "1") --add another list to avoid key"aa" be cleaned (run ‘ngx_http_lua_shdict_expire(ctx, 1)’ may clean key ,ensure key'aa' not clean ,just expired)) + if not len then + ngx.say("push cc err: ", err) + end + local len, err = dogs:lpush("aa", "1") + if not len then + ngx.say("push1 err: ", err) + end + local succ, err = dogs:expire("aa", 0.2) + if not succ then + ngx.say("expire err: ",err) + end + ngx.sleep(0.3) -- list aa expired + local len, err = dogs:lpush("aa", "2") --push to an expired list may set as a new list + if not len then + ngx.say("push2 err: ", err) + end + local val, err = dogs:lpop("aa") + if not val then + ngx.say("llen err: ", err) + end + local val, err = dogs:lpop("aa") -- val == nil + ngx.say("aa list value: ", val) + } + } + +--- request +GET /test +--- response_body +aa list value: nil +--- no_error_log +[error] diff --git a/src/deps/src/lua-nginx-module/t/154-semaphore.t b/src/deps/src/lua-nginx-module/t/154-semaphore.t index c7b00e03f..5bb2b937a 100644 --- a/src/deps/src/lua-nginx-module/t/154-semaphore.t +++ b/src/deps/src/lua-nginx-module/t/154-semaphore.t @@ -118,3 +118,53 @@ hello, world --- no_shutdown_error_log semaphore gc wait queue is not empty --- SKIP + + + +=== TEST 3: exit before post_handler was called +If gc is called before the ngx_http_lua_sema_handler and free the sema memory +ngx_http_lua_sema_handler would use the freed memory. +--- config + location /up { + content_by_lua_block { + local semaphore = require "ngx.semaphore" + local sem = semaphore.new() + + local function sem_wait() + ngx.log(ngx.ERR, "ngx.sem wait start") + local ok, err = sem:wait(10) + if not ok then + ngx.log(ngx.ERR, "ngx.sem wait err: ", err) + else + ngx.log(ngx.ERR, "ngx.sem wait success") + end + end + local co = ngx.thread.spawn(sem_wait) + ngx.log(ngx.ERR, "ngx.sem post start") + sem:post() + ngx.log(ngx.ERR, "ngx.sem post end") + ngx.say("hello") + ngx.exit(200) + ngx.say("not reach here") + } + } + + location /t { + content_by_lua_block { + local res = ngx.location.capture("/up") + collectgarbage() + ngx.print(res.body) + } + } + +--- request +GET /t +--- response_body +hello +--- grep_error_log eval: qr/(ngx.sem .*?,|http close request|semaphore handler: wait queue: empty, resource count: 1|in lua gc, semaphore)/ +--- grep_error_log_out +ngx.sem wait start, +ngx.sem post start, +ngx.sem post end, +in lua gc, semaphore +http close request diff --git a/src/deps/src/lua-nginx-module/t/157-socket-keepalive-hup.t b/src/deps/src/lua-nginx-module/t/157-socket-keepalive-hup.t index 357bb5968..d9436b3b7 100644 --- a/src/deps/src/lua-nginx-module/t/157-socket-keepalive-hup.t +++ b/src/deps/src/lua-nginx-module/t/157-socket-keepalive-hup.t @@ -32,7 +32,8 @@ __DATA__ set $port $TEST_NGINX_SERVER_PORT; content_by_lua_block { - local f, err = io.open("$TEST_NGINX_SERVER_ROOT/logs/nginx.pid", "r") + local pidfile = ngx.config.prefix() .. "/logs/nginx.pid" + local f, err = io.open(pidfile, "r") if not f then ngx.say("failed to open nginx.pid: ", err) return diff --git a/src/deps/src/lua-nginx-module/t/158-global-var.t b/src/deps/src/lua-nginx-module/t/158-global-var.t index 258ccdbce..def3b7418 100644 --- a/src/deps/src/lua-nginx-module/t/158-global-var.t +++ b/src/deps/src/lua-nginx-module/t/158-global-var.t @@ -86,7 +86,7 @@ set_by_lua:3: in main chunk, \n\z/, "old foo: 1\n"] qr/(old foo: \d+|\[\w+\].*?writing a global Lua variable \('[^'\s]+'\)|\w+_by_lua\(.*?\):\d+: in main chunk, )/ --- grep_error_log_out eval [qr/\A\[warn\] .*?writing a global Lua variable \('foo'\) -rewrite_by_lua\(nginx\.conf:48\):3: in main chunk, \n\z/, "old foo: 1\n"] +rewrite_by_lua\(nginx\.conf:\d+\):\d+: in main chunk, \n\z/, "old foo: 1\n"] @@ -109,7 +109,7 @@ rewrite_by_lua\(nginx\.conf:48\):3: in main chunk, \n\z/, "old foo: 1\n"] qr/(old foo: \d+|\[\w+\].*?writing a global Lua variable \('[^'\s]+'\)|\w+_by_lua\(.*?\):\d+: in main chunk, )/ --- grep_error_log_out eval [qr/\A\[warn\] .*?writing a global Lua variable \('foo'\) -access_by_lua\(nginx\.conf:48\):3: in main chunk, \n\z/, "old foo: 1\n"] +access_by_lua\(nginx\.conf:\d+\):\d+: in main chunk, \n\z/, "old foo: 1\n"] @@ -132,7 +132,7 @@ access_by_lua\(nginx\.conf:48\):3: in main chunk, \n\z/, "old foo: 1\n"] qr/(old foo: \d+|\[\w+\].*?writing a global Lua variable \('[^'\s]+'\)|\w+_by_lua\(.*?\):\d+: in main chunk, )/ --- grep_error_log_out eval [qr/\A\[warn\] .*?writing a global Lua variable \('foo'\) -content_by_lua\(nginx\.conf:48\):3: in main chunk, \n\z/, "old foo: 1\n"] +content_by_lua\(nginx\.conf:\d+\):\d+: in main chunk, \n\z/, "old foo: 1\n"] @@ -179,10 +179,10 @@ header_filter_by_lua:3: in main chunk, \n\z/, "old foo: 1\n"] --- response_body_like chomp \A(?:nil|2)\n\z --- grep_error_log eval -qr/(old foo: \d+|\[\w+\].*?writing a global Lua variable \('[^'\s]+'\)|\w+_by_lua:\d+: in main chunk, )/ +qr/(old foo: \d+|\[\w+\].*?writing a global Lua variable \('[^'\s]+'\)|\w+_by_lua:\d+: in main chunk,)/ --- grep_error_log_out eval [qr/\[warn\] .*?writing a global Lua variable \('foo'\) -body_filter_by_lua:3: in main chunk, +body_filter_by_lua:3: in main chunk, old foo: 1\n\z/, "old foo: 2\nold foo: 3\n"] @@ -208,7 +208,7 @@ old foo: 1\n\z/, "old foo: 2\nold foo: 3\n"] qr/(old foo: \d+|\[\w+\].*?writing a global Lua variable \('[^'\s]+'\)|\w+_by_lua\(.*?\):\d+: in main chunk)/ --- grep_error_log_out eval [qr/\A\[warn\] .*?writing a global Lua variable \('foo'\) -log_by_lua\(nginx\.conf:50\):3: in main chunk\n\z/, "old foo: 1\n"] +log_by_lua\(nginx\.conf:\d+\):\d+: in main chunk\n\z/, "old foo: 1\n"] @@ -331,7 +331,7 @@ ssl_certificate_by_lua:3: in main chunk\n\z/, "old foo: 1\n"] qr/(old foo: \d+|\[\w+\].*?writing a global Lua variable \('[^'\s]+'\)|\w+_by_lua\(.*?\):\d+: in\b)/ --- grep_error_log_out eval [qr/\A\[warn\] .*?writing a global Lua variable \('foo'\) -content_by_lua\(nginx\.conf:56\):4: in\n\z/, "old foo: 1\n"] +content_by_lua\(nginx\.conf:\d+\):\d+: in\n\z/, "old foo: 1\n"] diff --git a/src/deps/src/lua-nginx-module/t/162-exit-worker.t b/src/deps/src/lua-nginx-module/t/162-exit-worker.t index 8f2efc21e..313861761 100644 --- a/src/deps/src/lua-nginx-module/t/162-exit-worker.t +++ b/src/deps/src/lua-nginx-module/t/162-exit-worker.t @@ -5,7 +5,8 @@ use Test::Nginx::Socket::Lua; master_on(); repeat_each(2); -plan tests => repeat_each() * (blocks() * 2 + 2) + 12; +# NB: the shutdown_error_log block is independent from repeat times +plan tests => repeat_each() * (blocks() * 2 + 1) + 13; #log_level("warn"); no_long_string(); @@ -79,7 +80,7 @@ hello, world -=== TEST 4: exit_worker_by_lua single process ngx.timer not work +=== TEST 4: ngx.timer is not allow --- http_config exit_worker_by_lua_block { local function bar() @@ -101,8 +102,8 @@ hello, world GET /t --- response_body ok ---- no_error_log -[error] +--- shutdown_error_log +API disabled in the context of exit_worker_by_lua* diff --git a/src/deps/src/lua-nginx-module/t/162-static-module-location.t b/src/deps/src/lua-nginx-module/t/162-static-module-location.t index 222760c18..fde93c71b 100644 --- a/src/deps/src/lua-nginx-module/t/162-static-module-location.t +++ b/src/deps/src/lua-nginx-module/t/162-static-module-location.t @@ -41,8 +41,8 @@ Hello, world --- request GET /t/中文 --- error_code: 301 ---- response_headers -Location: http://localhost:1984/t/%E4%B8%AD%E6%96%87/ +--- response_headers_like +Location: http:\/\/localhost:\d+\/t\/%E4%B8%AD%E6%96%87\/ --- response_body_like .*301 Moved Permanently.* @@ -57,8 +57,8 @@ Hello, world --- request GET /t/中文?q=name --- error_code: 301 ---- response_headers -Location: http://localhost:1984/t/%E4%B8%AD%E6%96%87/?q=name +--- response_headers_like +Location: http:\/\/localhost:\d+\/t\/%E4%B8%AD%E6%96%87\/\?q=name --- response_body_like .*301 Moved Permanently.* @@ -73,8 +73,8 @@ Hello, world --- request GET /t/%E4%B8%AD%E6%96%87 --- error_code: 301 ---- response_headers -Location: http://localhost:1984/t/%E4%B8%AD%E6%96%87/ +--- response_headers_like +Location: http:\/\/localhost:\d+\/t\/%E4%B8%AD%E6%96%87\/ --- response_body_like .*301 Moved Permanently.* @@ -89,7 +89,7 @@ Hello, world --- request GET /t/%E4%B8%AD%E6%96%87?q=name --- error_code: 301 ---- response_headers -Location: http://localhost:1984/t/%E4%B8%AD%E6%96%87/?q=name +--- response_headers_like +Location: http://localhost:\d+\/t\/%E4%B8%AD%E6%96%87\/\?q=name --- response_body_like .*301 Moved Permanently.* diff --git a/src/deps/src/lua-nginx-module/t/166-ssl-client-hello.t b/src/deps/src/lua-nginx-module/t/166-ssl-client-hello.t new file mode 100644 index 000000000..79787f63a --- /dev/null +++ b/src/deps/src/lua-nginx-module/t/166-ssl-client-hello.t @@ -0,0 +1,2567 @@ +# vim:set ft= ts=4 sw=4 et fdm=marker: + +use Test::Nginx::Socket::Lua; + +repeat_each(3); + +# All these tests need to have new openssl +my $NginxBinary = $ENV{'TEST_NGINX_BINARY'} || 'nginx'; +my $openssl_version = eval { `$NginxBinary -V 2>&1` }; + +if ($openssl_version =~ m/built with OpenSSL (0\S*|1\.0\S*|1\.1\.0\S*)/) { + plan(skip_all => "too old OpenSSL, need 1.1.1, was $1"); +} else { + plan tests => repeat_each() * (blocks() * 6 + 6); +} + +$ENV{TEST_NGINX_HTML_DIR} ||= html_dir(); +$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; + +#log_level 'warn'; +log_level 'debug'; + +no_long_string(); +#no_diff(); + +run_tests(); + +__DATA__ + +=== TEST 1: simple logging +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { print("ssl client hello by lua is running!") } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +lua ssl server name: "test.com" + +--- no_error_log +[error] +[alert] +--- grep_error_log eval: qr/ssl_client_hello_by_lua:.*?,|\bssl client hello: connection reusable: \d+|\breusable connection: \d+/ +--- grep_error_log_out eval +# Since nginx version 1.17.9, nginx call ngx_reusable_connection(c, 0) +# before call ssl callback function +$Test::Nginx::Util::NginxVersion >= 1.017009 ? +qr/reusable connection: 0 +ssl client hello: connection reusable: 0 +ssl_client_hello_by_lua:1: ssl client hello by lua is running!,/ +: qr /reusable connection: 1 +ssl client hello: connection reusable: 1 +reusable connection: 0 +ssl_client_hello_by_lua:1: ssl client hello by lua is running!,/ + + + +=== TEST 2: sleep +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local begin = ngx.now() + ngx.sleep(0.1) + print("elapsed in ssl client hello by lua: ", ngx.now() - begin) + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log eval +[ +'lua ssl server name: "test.com"', +qr/elapsed in ssl client hello by lua: 0.(?:09|1\d)\d+,/, +] + +--- no_error_log +[error] +[alert] + + + +=== TEST 3: timer +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local function f() + print("my timer run!") + end + local ok, err = ngx.timer.at(0, f) + if not ok then + ngx.log(ngx.ERR, "failed to create timer: ", err) + return + end + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +lua ssl server name: "test.com" +my timer run! + +--- no_error_log +[error] +[alert] + + + +=== TEST 4: cosocket +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("127.0.0.1", $TEST_NGINX_MEMCACHED_PORT) + if not ok then + ngx.log(ngx.ERR, "failed to connect to memc: ", err) + return + end + + local bytes, err = sock:send("flush_all\r\n") + if not bytes then + ngx.log(ngx.ERR, "failed to send flush_all command: ", err) + return + end + + local res, err = sock:receive() + if not res then + ngx.log(ngx.ERR, "failed to receive memc reply: ", err) + return + end + + print("received memc reply: ", res) + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +lua ssl server name: "test.com" +received memc reply: OK + +--- no_error_log +[error] +[alert] + + + +=== TEST 5: ngx.exit(0) - no yield +--- http_config + server { + listen 127.0.0.2:8080 ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + ngx.exit(0) + ngx.log(ngx.ERR, "should never reached here...") + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_verify_depth 3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("127.0.0.2", 8080) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(false, nil, true, false) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: boolean + +--- error_log +lua exit with code 0 + +--- no_error_log +should never reached here +[error] +[alert] +[emerg] + + + +=== TEST 6: ngx.exit(ngx.ERROR) - no yield +--- http_config + server { + listen 127.0.0.2:8080 ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + ngx.exit(ngx.ERROR) + ngx.log(ngx.ERR, "should never reached here...") + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_verify_depth 3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("127.0.0.2", 8080) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(false, nil, true, false) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + } + } + +--- request +GET /t +--- response_body +connected: 1 +failed to do SSL handshake: handshake failed + +--- error_log eval +[ +'lua_client_hello_by_lua: handler return value: -1, client hello cb exit code: 0', +qr/\[info\] .*? SSL_do_handshake\(\) failed .*?callback failed/, +'lua exit with code -1', +] + +--- no_error_log +should never reached here +[alert] +[emerg] + + + +=== TEST 7: ngx.exit(0) - yield +--- http_config + server { + listen 127.0.0.2:8080 ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + ngx.sleep(0.001) + ngx.exit(0) + + ngx.log(ngx.ERR, "should never reached here...") + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_verify_depth 3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("127.0.0.2", 8080) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(false, nil, true, false) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: boolean + +--- error_log +lua exit with code 0 + +--- no_error_log +should never reached here +[error] +[alert] +[emerg] + + + +=== TEST 8: ngx.exit(ngx.ERROR) - yield +--- http_config + server { + listen 127.0.0.2:8080 ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + ngx.sleep(0.001) + ngx.exit(ngx.ERROR) + + ngx.log(ngx.ERR, "should never reached here...") + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_verify_depth 3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("127.0.0.2", 8080) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(false, nil, true, false) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + } + } + +--- request +GET /t +--- response_body +connected: 1 +failed to do SSL handshake: handshake failed + +--- error_log eval +[ +'lua_client_hello_by_lua: client hello cb exit code: 0', +qr/\[info\] .*? SSL_do_handshake\(\) failed .*?callback failed/, +'lua exit with code -1', +] + +--- no_error_log +should never reached here +[alert] +[emerg] + + + +=== TEST 9: lua exception - no yield +--- http_config + server { + listen 127.0.0.2:8080 ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + error("bad bad bad") + ngx.log(ngx.ERR, "should never reached here...") + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_verify_depth 3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("127.0.0.2", 8080) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(false, nil, true, false) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + } + } + +--- request +GET /t +--- response_body +connected: 1 +failed to do SSL handshake: handshake failed + +--- error_log eval +[ +'runtime error: ssl_client_hello_by_lua:2: bad bad bad', +'lua_client_hello_by_lua: handler return value: 500, client hello cb exit code: 0', +qr/\[info\] .*? SSL_do_handshake\(\) failed .*?callback failed/, +qr/context: ssl_client_hello_by_lua\*, client: \d+\.\d+\.\d+\.\d+, server: \d+\.\d+\.\d+\.\d+:\d+/, +] + +--- no_error_log +should never reached here +[alert] +[emerg] + + + +=== TEST 10: lua exception - yield +--- http_config + server { + listen 127.0.0.2:8080 ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + ngx.sleep(0.001) + error("bad bad bad") + ngx.log(ngx.ERR, "should never reached here...") + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_verify_depth 3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("127.0.0.2", 8080) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(false, nil, true, false) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + } + } + +--- request +GET /t +--- response_body +connected: 1 +failed to do SSL handshake: handshake failed + +--- error_log eval +[ +'runtime error: ssl_client_hello_by_lua:3: bad bad bad', +'lua_client_hello_by_lua: client hello cb exit code: 0', +qr/\[info\] .*? SSL_do_handshake\(\) failed .*?callback failed/, +] + +--- no_error_log +should never reached here +[alert] +[emerg] + + + +=== TEST 11: get phase +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block {print("get_phase: ", ngx.get_phase())} + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end + collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata + +--- error_log +lua ssl server name: "test.com" +get_phase: ssl_client_hello + +--- no_error_log +[error] +[alert] + + + +=== TEST 12: connection aborted prematurely +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + ngx.sleep(0.3) + print("ssl-client-hello-by-lua: after sleeping") + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(150) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(false, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t + +--- response_body +connected: 1 +failed to do SSL handshake: timeout + +--- error_log +lua ssl server name: "test.com" +ssl-client-hello-by-lua: after sleeping + +--- no_error_log +[error] +[alert] +--- wait: 0.6 + + + +=== TEST 13: subrequests disabled +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block {ngx.location.capture("/foo")} + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +failed to do SSL handshake: handshake failed + +--- error_log eval +[ +'lua ssl server name: "test.com"', +'ssl_client_hello_by_lua:1: API disabled in the context of ssl_client_hello_by_lua*', +qr/\[info\] .*?callback failed/, +] + +--- no_error_log +[alert] + + + +=== TEST 14: simple logging (by_lua_file) +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_file html/a.lua; + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } + +--- user_files +>>> a.lua +print("ssl client hello by lua is running!") + +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +lua ssl server name: "test.com" +a.lua:1: ssl client hello by lua is running! + +--- no_error_log +[error] +[alert] + + + +=== TEST 15: coroutine API +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local cc, cr, cy = coroutine.create, coroutine.resume, coroutine.yield + + local function f() + local cnt = 0 + for i = 1, 20 do + print("co yield: ", cnt) + cy() + cnt = cnt + 1 + end + end + + local c = cc(f) + for i = 1, 3 do + print("co resume, status: ", coroutine.status(c)) + cr(c) + end + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- grep_error_log eval: qr/co (?:yield: \d+|resume, status: \w+)/ +--- grep_error_log_out +co resume, status: suspended +co yield: 0 +co resume, status: suspended +co yield: 1 +co resume, status: suspended +co yield: 2 + +--- error_log +lua ssl server name: "test.com" + +--- no_error_log +[error] +[alert] + + + +=== TEST 16: simple user thread wait with yielding +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local function f() + ngx.sleep(0.01) + print("uthread: hello in thread") + return "done" + end + + local t, err = ngx.thread.spawn(f) + if not t then + ngx.log(ngx.ERR, "uthread: failed to spawn thread: ", err) + return ngx.exit(ngx.ERROR) + end + + print("uthread: thread created: ", coroutine.status(t)) + + local ok, res = ngx.thread.wait(t) + if not ok then + print("uthread: failed to wait thread: ", res) + return + end + + print("uthread: ", res) + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- no_error_log +[error] +[alert] +--- grep_error_log eval: qr/uthread: [^.,]+/ +--- grep_error_log_out +uthread: thread created: running +uthread: hello in thread +uthread: done + + + +=== TEST 17: simple logging - use ssl_client_hello_by_lua* on the http {} level +GitHub openresty/lua-resty-core#42 +--- http_config + ssl_client_hello_by_lua_block { print("ssl client hello by lua is running!") } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +lua ssl server name: "test.com" +ssl_client_hello_by_lua:1: ssl client hello by lua is running! + +--- no_error_log +[error] +[alert] + + + +=== TEST 18: simple logging - use ssl_client_hello_by_lua* on the http {} level and server {} level +--- http_config + ssl_client_hello_by_lua_block { print("ssl client hello by lua on the http level is running!") } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + ssl_client_hello_by_lua_block { print("ssl client hello by lua on the server level is running!") } + server_name test.com; + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +lua ssl server name: "test.com" +ssl_client_hello_by_lua:1: ssl client hello by lua on the server level is running! + +--- no_error_log +[error] +[alert] + + + +=== TEST 19: use ssl_client_hello_by_lua* on the server {} level with non-ssl server +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock; + ssl_client_hello_by_lua_block { print("ssl client hello by lua is running!") } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + server_name test.com; + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- no_error_log +ssl_client_hello_by_lua:1: ssl client hello by lua is running! +[error] +[alert] + + + +=== TEST 20: use ssl_client_hello_by_lua* on the http {} level with non-ssl server +--- http_config + ssl_client_hello_by_lua_block { print("ssl client hello by lua is running!") } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock; + server_name test.com; + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- no_error_log +ssl_client_hello_by_lua:1: ssl client hello by lua is running! +[error] +[alert] + + + +=== TEST 21: listen two ports (one for ssl and one for non-ssl) in one server - connect ssl port +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + listen unix:$TEST_NGINX_HTML_DIR/nginx2.sock; + ssl_client_hello_by_lua_block { print("ssl client hello by lua is running!") } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + server_name test.com; + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +lua ssl server name: "test.com" +ssl_client_hello_by_lua:1: ssl client hello by lua is running! + +--- no_error_log +[error] +[alert] + + + +=== TEST 22: listen two ports (one for ssl and one for non-ssl) in one server - connect non-ssl port +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + listen unix:$TEST_NGINX_HTML_DIR/nginx2.sock; + ssl_client_hello_by_lua_block { print("ssl client hello by lua is running!") } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + server_name test.com; + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx2.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + + +--- no_error_log +ssl_client_hello_by_lua:1: ssl client hello by lua is running! +[error] +[alert] + + + +=== TEST 23: simple logging - use ssl_client_hello_by_lua* in multiple virtual servers +--- http_config + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + ssl_client_hello_by_lua_block { print("ssl client hello by lua in server1 is running!") } + server_name test.com; + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + ssl_client_hello_by_lua_block { print("ssl client hello by lua in server2 is running!") } + server_name test2.com; + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo2") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test2.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 57 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 5 +received: Connection: close +received: +received: foo2 +close: 1 nil + +--- error_log +lua ssl server name: "test.com" +ssl_client_hello_by_lua:1: ssl client hello by lua in server1 is running! + +--- no_error_log +ssl_client_hello_by_lua:1: ssl client hello by lua in server2 is running! +[error] +[alert] + + + +=== TEST 24: simple logging (syslog) +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + + error_log syslog:server=127.0.0.1:12345 debug; + + ssl_client_hello_by_lua_block { print("ssl client hello by lua is running!") } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log eval +[ +qr/\[error\] .*? send\(\) failed/, +'lua ssl server name: "test.com"', +] +--- no_error_log +[alert] +ssl_client_hello_by_lua:1: ssl client hello by lua is running! + + + +=== TEST 25: get raw_client_addr - IPv4 +--- http_config + lua_package_path "../lua-resty-core/lib/?.lua;;"; + + server { + listen 127.0.0.1:12345 ssl; + server_name test.com; + + ssl_client_hello_by_lua_block { + local ssl = require "ngx.ssl" + local byte = string.byte + local addr, addrtype, err = ssl.raw_client_addr() + local ip = string.format("%d.%d.%d.%d", byte(addr, 1), byte(addr, 2), + byte(addr, 3), byte(addr, 4)) + print("client ip: ", ip) + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("127.0.0.1", 12345) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +client ip: 127.0.0.1 + +--- no_error_log +[error] +[alert] + + + +=== TEST 26: get raw_client_addr - unix domain socket +--- http_config + lua_package_path "../lua-resty-core/lib/?.lua;;"; + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + + ssl_client_hello_by_lua_block { + local ssl = require "ngx.ssl" + local addr, addrtyp, err = ssl.raw_client_addr() + print("client socket file: ", addr) + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block { ngx.status = 201 ngx.say("foo") ngx.exit(201) } + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +client socket file: + +--- no_error_log +[error] +[alert] + + + +=== TEST 27: ssl_client_hello_by_lua* can yield when reading early data +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + ssl_early_data on; + server_tokens off; + + ssl_client_hello_by_lua_block { + local begin = ngx.now() + ngx.sleep(0.1) + print("elapsed in ssl_client_hello_by_lua*: ", ngx.now() - begin) + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_verify_depth 3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(false, nil, true, false) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + } + } +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: boolean +--- grep_error_log eval +qr/elapsed in ssl_client_hello_by_lua\*: 0\.(?:09|1\d)\d+,/, +--- grep_error_log_out eval +[ +qr/elapsed in ssl_client_hello_by_lua\*: 0\.(?:09|1\d)\d+,/, +qr/elapsed in ssl_client_hello_by_lua\*: 0\.(?:09|1\d)\d+,/, +qr/elapsed in ssl_client_hello_by_lua\*: 0\.(?:09|1\d)\d+,/, +] +--- no_error_log +[error] +[alert] +[emerg] + + + +=== TEST 28: cosocket (UDP) +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + server_tokens off; + + ssl_client_hello_by_lua_block { + local sock = ngx.socket.udp() + + sock:settimeout(1000) + + local ok, err = sock:setpeername("127.0.0.1", $TEST_NGINX_MEMCACHED_PORT) + if not ok then + ngx.log(ngx.ERR, "failed to connect to memc: ", err) + return + end + + local req = "\0\1\0\0\0\1\0\0flush_all\r\n" + local ok, err = sock:send(req) + if not ok then + ngx.log(ngx.ERR, "failed to send flush_all to memc: ", err) + return + end + + local res, err = sock:receive() + if not res then + ngx.log(ngx.ERR, "failed to receive memc reply: ", err) + return + end + + ngx.log(ngx.INFO, "received memc reply of ", #res, " bytes") + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_verify_depth 3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + -- collectgarbage() + } + } +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +--- no_error_log +[error] +[alert] +[emerg] +--- grep_error_log eval: qr/received memc reply of \d+ bytes/ +--- grep_error_log_out eval +[ +'received memc reply of 12 bytes +', +'received memc reply of 12 bytes +', +'received memc reply of 12 bytes +', +'received memc reply of 12 bytes +', +] + + + +=== TEST 29: uthread (kill) +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + server_tokens off; + + ssl_client_hello_by_lua_block { + local function f() + ngx.log(ngx.INFO, "uthread: hello from f()") + ngx.sleep(1) + end + + local t, err = ngx.thread.spawn(f) + if not t then + ngx.log(ngx.ERR, "failed to spawn thread: ", err) + return ngx.exit(ngx.ERROR) + end + + local ok, res = ngx.thread.kill(t) + if not ok then + ngx.log(ngx.ERR, "failed to kill thread: ", res) + return + end + + ngx.log(ngx.INFO, "uthread: killed") + + local ok, err = ngx.thread.kill(t) + if not ok then + ngx.log(ngx.INFO, "uthread: failed to kill: ", err) + end + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_verify_depth 3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(2000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + end -- do + -- collectgarbage() + } + } +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +--- no_error_log +[error] +[alert] +[emerg] +--- grep_error_log eval: qr/uthread: [^.,]+/ +--- grep_error_log_out +uthread: hello from f() +uthread: killed +uthread: failed to kill: already waited or killed diff --git a/src/deps/src/lua-nginx-module/t/166-worker-thread.t b/src/deps/src/lua-nginx-module/t/166-worker-thread.t new file mode 100644 index 000000000..3288f3a15 --- /dev/null +++ b/src/deps/src/lua-nginx-module/t/166-worker-thread.t @@ -0,0 +1,1248 @@ +# vim:set ft= ts=4 sw=4 et fdm=marker: + +our $SkipReason; + +BEGIN { + if ($ENV{TEST_NGINX_EVENT_TYPE} + && $ENV{TEST_NGINX_EVENT_TYPE} !~ /^kqueue|epoll|eventport$/) + { + $SkipReason = "unavailable for the event type '$ENV{TEST_NGINX_EVENT_TYPE}'"; + } +} + +use Test::Nginx::Socket::Lua $SkipReason ? (skip_all => $SkipReason) : (); + +#worker_connections(1014); +#master_on(); +#workers(2); +#log_level('warn'); + +repeat_each(1); + +plan tests => repeat_each() * (blocks() * 2); + +our $HtmlDir = html_dir; + +our $HttpConfig = qq{ + lua_package_path "$::HtmlDir/?.lua;./?.lua;;"; + lua_worker_thread_vm_pool_size 1; +}; + +#no_diff(); +#no_long_string(); +run_tests(); + +__DATA__ + +=== TEST 1: hello from worker thread +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return "hello" +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : hello + + + +=== TEST 2: thread_pool not found +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return "hello" +end +return {hello=hello} +--- request +GET /hello +--- response_body +false : thread pool testpool not found + + + +=== TEST 3: pass table +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, ok_or_err = ngx.run_worker_thread("testpool", "hello", "hello", {["hello"]="world", [1]={["embed"]=1}}) + ngx.say(ok, " , ", ok_or_err) + } +} +--- user_files +>>> hello.lua +local function hello(arg1) + if arg1.hello == "world" and arg1[1].embed == 1 then + return true + end + return false +end +return {hello=hello} +--- request +GET /hello +--- response_body +true , true + + + +=== TEST 4: expecting at least 3 arguments +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, err = ngx.run_worker_thread("testpool") + ngx.say(ok, " : ", err) + } +} +--- request +GET /hello +--- response_body +false : expecting at least 3 arguments + + + +=== TEST 5: base64 +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, base64 = ngx.run_worker_thread("testpool", "hello", "enc", "hello") + ngx.say(ok, " , ", base64 == "aGVsbG8=") + } +} +--- user_files +>>> hello.lua +local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' + +local function enc(data) + return ((data:gsub('.', function(x) + local r,b='',x:byte() + for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end + return r; + end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) + if (#x < 6) then return '' end + local c=0 + for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end + return b:sub(c+1,c+1) + end)..({ '', '==', '=' })[#data%3+1]) +end + +return {enc=enc} +--- request +GET /hello +--- response_body +true , true + + + +=== TEST 6: return table +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, ret = ngx.run_worker_thread("testpool", "hello", "hello") + if ret.hello == "world" and ret[1].embed == 1 then + ngx.say(ok, " , ", true) + end + } +} +--- user_files +>>> hello.lua +local function hello() + return {["hello"]="world", [1]={["embed"]=1}} +end +return {hello=hello} +--- request +GET /hello +--- response_body +true , true + + + +=== TEST 7: unsupported argument type +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local function dummy() end + local ok, err = ngx.run_worker_thread("testpool", "hello", "hello", dummy) + ngx.say(ok, " : ", err) + } +} +--- user_files +>>> hello.lua +local function hello() + return "hello" +end +return {hello=hello} +--- request +GET /hello +--- response_body +false : unsupported argument type + + + +=== TEST 8: multiple return values +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, res1, res2 = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", res1, " , ", res2) + } +} +--- user_files +>>> hello.lua +local function hello() + return "hello", 200 +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : hello , 200 + + + +=== TEST 9: module not found +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", err) + } +} +--- request +GET /hello +--- response_body_like +false : module 'hello' not found.* + + + +=== TEST 10: the number of Lua VM exceeds the pool size +--- main_config + thread_pool testpool threads=100; +--- http_config eval: $::HttpConfig +--- config +location /foo { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} + +location /bar { + default_type 'text/plain'; + + content_by_lua_block { + local ok, foobar_or_err = ngx.run_worker_thread("testpool", "foobar", "foobar") + ngx.say(ok, " : ", foobar_or_err) + } +} + +location /t { + set $port $TEST_NGINX_SERVER_PORT; + + content_by_lua_block { + local function t(path) + local sock = ngx.socket.tcp() + local port = ngx.var.port + local ok, err = sock:connect("127.0.0.1", port) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + local req = "GET " .. path .. " HTTP/1.0\r\nHost: localhost\r\nConnection: close\r\n\r\n" + + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send request: ", err) + return + end + + local ret, err, part = sock:receive("*a") + local _, idx = string.find(ret, "\r\n\r\n"); + idx = idx + 1 + ngx.print(string.sub(ret, idx)) + ok, err = sock:close() + end + + local t1 = ngx.thread.spawn(t, "/foo") + local t2 = ngx.thread.spawn(t, "/bar") + ngx.thread.wait(t1) + ngx.thread.wait(t2) + } +} +--- user_files +>>> hello.lua +local function hello() + os.execute("sleep 3") + return "hello" +end +return {hello=hello} +>>> foobar.lua +local function foobar() + return "foobar" +end +return {foobar=foobar} +--- request +GET /t +--- response_body eval +"false : no available Lua vm\ntrue : hello\n" +--- timeout: 10 + + + +=== TEST 11: kill uthread before worker thread callback +--- main_config + thread_pool testpool threads=100; +--- http_config eval: $::HttpConfig +--- config +location /foo { + default_type 'text/plain'; + + content_by_lua_block { + local function t() + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + end + local t1 = ngx.thread.spawn(t) + if ngx.var.arg_kill == "kill" then + ngx.thread.kill(t1) + ngx.say("killed") + end + } +} + +location /t { + set $port $TEST_NGINX_SERVER_PORT; + + content_by_lua_block { + local function t(path) + local sock = ngx.socket.tcp() + local port = ngx.var.port + local ok, err = sock:connect("127.0.0.1", port) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + local req = "GET " .. path .. " HTTP/1.0\r\nHost: localhost\r\nConnection: close\r\n\r\n" + + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send request: ", err) + return + end + + local ret, err, part = sock:receive("*a") + local _, idx = string.find(ret, "\r\n\r\n"); + idx = idx + 1 + ngx.print(string.sub(ret, idx)) + ok, err = sock:close() + end + + local t1 = ngx.thread.spawn(t, "/foo?kill=kill") + ngx.thread.wait(t1) + ngx.sleep(4) + local t2 = ngx.thread.spawn(t, "/foo") + ngx.thread.wait(t2) + } +} +--- user_files +>>> hello.lua +local function hello() + os.execute("sleep 1") + return "hello" +end +return {hello=hello} +>>> foobar.lua +local function foobar() + return "foobar" +end +return {foobar=foobar} +--- request +GET /t +--- response_body eval +"killed\ntrue : hello\n" +--- timeout: 10 + + + +=== TEST 12: exit before worker thread callback +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local function t() + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + end + ngx.thread.spawn(t) + ngx.exit(200) + } +} +--- user_files +>>> hello.lua +local function hello() + os.execute("sleep 3") + return "hello" +end +return {hello=hello} +--- request +GET /hello +--- response_body +--- timeout: 10 + + + +=== TEST 13: unsupported argument type in nested table +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local function dummy() end + local ok, err = ngx.run_worker_thread("testpool", "hello", "hello", + {["hello"]="world", [1]={["embed"]=1, ["dummy"]=dummy}}) + ngx.say(ok, " : ", err) + } +} +--- user_files +>>> hello.lua +local function hello() + return "hello" +end +return {hello=hello} +--- request +GET /hello +--- response_body +false : unsupported argument type + + + +=== TEST 14: return table with unsupported type +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, ret = ngx.run_worker_thread("testpool", "hello", "hello") + if ok == false then + ngx.say("false", " , ", ret) + end + if ret.hello == "world" and ret[1].embed == 1 then + ngx.say(ok, " , ", true) + end + } +} +--- user_files +>>> hello.lua +local function hello() + local function dummy() end + return {["hello"]="world", [1]={["embed"]=1, ["dummy"]=dummy}} +end +return {hello=hello} +--- request +GET /hello +--- response_body +false , unsupported return value + + + +=== TEST 15: the type of module name is not string +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local function dummy() end + local ok, err = ngx.run_worker_thread("testpool", dummy, "hello") + ngx.say(ok, " : ", err) + } +} +--- user_files +>>> hello.lua +local function hello() + return "hello" +end +return {hello=hello} +--- request +GET /hello +--- response_body +false : module name should be a string + + + +=== TEST 16: the type of function name is not string +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local function dummy() end + local ok, err = ngx.run_worker_thread("testpool", "hello", dummy) + ngx.say(ok, " : ", err) + } +} +--- user_files +>>> hello.lua +local function hello() + return "hello" +end +return {hello=hello} +--- request +GET /hello +--- response_body +false : function name should be a string + + + +=== TEST 17: the type of thread pool name is not string +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local function dummy() end + local ok, err = ngx.run_worker_thread(dummy, "hello", "hello") + ngx.say(ok, " : ", err) + } +} +--- user_files +>>> hello.lua +local function hello() + return "hello" +end +return {hello=hello} +--- request +GET /hello +--- response_body +false : threadpool should be a string + + + +=== TEST 18: ngx.encode_base64 +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.encode_base64("hello") +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : aGVsbG8= + + + +=== TEST 19: ngx.config.subsystem +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.config.subsystem +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : http + + + +=== TEST 20: ngx.hmac_sha1 +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + local key = "thisisverysecretstuff" + local src = "some string we want to sign" + local digest = ngx.hmac_sha1(key, src) + return ngx.encode_base64(digest) +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : R/pvxzHC4NLtj7S+kXFg/NePTmk= + + + +=== TEST 21: ngx.encode_args +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.encode_args({foo = 3, ["b r"] = "hello world"}) +end +return {hello=hello} +--- request +GET /hello +--- response_body eval +qr/foo=3&b%20r=hello%20world|b%20r=hello%20world&foo=3/ + + + +=== TEST 22: ngx.decode_args +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, ret = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", ret.a, " : ", ret.b) + } +} +--- user_files +>>> hello.lua +local function hello() + local args = "a=bar&b=foo" + args = ngx.decode_args(args) + return args +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : bar : foo + + + +=== TEST 23: ngx.quote_sql_str +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config + location /hello { + content_by_lua ' + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello", "a\\026b\\026") + ngx.say(ok, " : ", hello_or_err) + '; + } +--- user_files +>>> hello.lua +local function hello(str) + return ngx.quote_sql_str(str) +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : 'a\Zb\Z' + + + +=== TEST 24: ngx.re.match +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, a, b = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", a, " : ", b) + } +} +--- user_files +>>> hello.lua +local function hello() + local m, err = ngx.re.match("hello, 1234", "([0-9])[0-9]+") + return m[0], m[1] +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : 1234 : 1 + + + +=== TEST 25: ngx.re.find +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, a = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", a) + } +} +--- user_files +>>> hello.lua +local function hello() + local str = "hello, 1234" + local from, to = ngx.re.find(str, "([0-9])([0-9]+)", "jo", nil, 2) + if from then + return string.sub(str, from, to) + end +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : 234 + + + +=== TEST 26: ngx.re.gmatch +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, ret = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok) + ngx.say(ret[1]) + ngx.say(ret[2]) + } +} +--- user_files +>>> hello.lua +local function hello() + local ret = {} + for m in ngx.re.gmatch("hello, world", "[a-z]+", "j") do + if m then + table.insert(ret, m[0]) + end + end + return ret +end +return {hello=hello} +--- request +GET /hello +--- response_body +true +hello +world + + + +=== TEST 27: ngx.re.sub +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, a, b = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok) + ngx.say(a) + ngx.say(b) + } +} +--- user_files +>>> hello.lua +local function hello() + local newstr, n = ngx.re.sub("hello, 1234", "[0-9]", "$$") + return newstr, n +end +return {hello=hello} +--- request +GET /hello +--- response_body +true +hello, $234 +1 + + + +=== TEST 28: ngx.re.gsub +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, a, b = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok) + ngx.say(a) + ngx.say(b) + } +} +--- user_files +>>> hello.lua +local function hello() + local newstr, n, err = ngx.re.gsub("hello, world", "([a-z])[a-z]+", "[$0,$1]", "i") + return newstr, n +end +return {hello=hello} +--- request +GET /hello +--- response_body +true +[hello,h], [world,w] +2 + + + +=== TEST 29: ngx.decode_base64 +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.decode_base64("aGVsbG8=") +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : hello + + + +=== TEST 30: ngx.crc32_short +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.crc32_short("hello, world") +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : 4289425978 + + + +=== TEST 31: ngx.crc32_long +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.crc32_long("hello, world") +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : 4289425978 + + + +=== TEST 32: ngx.md5_bin +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + local s = ngx.md5_bin(45) + s = string.gsub(s, ".", function (c) + return string.format("%02x", string.byte(c)) + end) + return s +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : 6c8349cc7260ae62e3b1396831a8398f + + + +=== TEST 33: ngx.md5 +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.md5("hello") +end +return {hello=hello} +--- request +GET /hello +--- response_body +true : 5d41402abc4b2a76b9719d911017c592 + + + +=== TEST 34: ngx.config.debug +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.config.debug +end +return {hello=hello} +--- request +GET /hello +--- response_body_like chop +^true : (?:true|false)$ + + + +=== TEST 35: ngx.config.prefix +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.config.prefix() +end +return {hello=hello} +--- request +GET /hello +--- response_body_like chop +^true : \/\S+$ + + + +=== TEST 36: ngx.config.nginx_version +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.config.nginx_version +end +return {hello=hello} +--- request +GET /hello +--- response_body_like chop +^true : \d+$ + + + +=== TEST 37: ngx.config.nginx_configure +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.config.nginx_configure() +end +return {hello=hello} +--- request +GET /hello +--- response_body_like chop +^\s*\-\-[^-]+ + + + +=== TEST 38: ngx.config.ngx_lua_version +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /hello { + default_type 'text/plain'; + + content_by_lua_block { + local ok, hello_or_err = ngx.run_worker_thread("testpool", "hello", "hello") + ngx.say(ok, " : ", hello_or_err) + } +} +--- user_files +>>> hello.lua +local function hello() + return ngx.config.ngx_lua_version +end +return {hello=hello} +--- request +GET /hello +--- response_body_like chop +^true : \d+$ + + + +=== TEST 39: write_log_file +--- main_config + thread_pool testpool threads=100; +--- http_config eval + "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" +--- config +location /write_log_file { + default_type 'text/plain'; + + content_by_lua_block { + local ok, err = ngx.run_worker_thread("testpool", "write_log_file", "log", ngx.var.arg_str) + if not ok then + ngx.say(ok, " : ", err) + return + end + ngx.say(ok) + } +} +--- user_files +>>> write_log_file.lua +local function log(str) + local file, err = io.open("/tmp/tmp.log", "w") + if not file then + return false, err + end + file:write(str) + file:flush() + file:close() + return true +end +return {log=log} +--- request +GET /write_log_file?str=hello +--- response_body +true diff --git a/src/deps/src/lua-nginx-module/t/cert/dst-ca.crt b/src/deps/src/lua-nginx-module/t/cert/dst-ca.crt index 738121f63..7b714c60a 100644 --- a/src/deps/src/lua-nginx-module/t/cert/dst-ca.crt +++ b/src/deps/src/lua-nginx-module/t/cert/dst-ca.crt @@ -1,63 +1,26 @@ -subject=/C=US/O=Digital Signature Trust Co./OU=TrustID Server/CN=TrustID Server CA A5 -issuer=/O=Digital Signature Trust Co./CN=DST Root CA X3 +# Comodo AAA Services root -----BEGIN CERTIFICATE----- -MIIGiTCCBXGgAwIBAgIRALCqqJD4YLUEJLy76IZcvf8wDQYJKoZIhvcNAQEFBQAw -PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD -Ew5EU1QgUm9vdCBDQSBYMzAeFw0wNzA4MjQxNzU0MTlaFw0xNDA4MjQxNDEzMzVa -MGsxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVz -dCBDby4xFzAVBgNVBAsTDlRydXN0SUQgU2VydmVyMR0wGwYDVQQDExRUcnVzdElE -IFNlcnZlciBDQSBBNTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOae -jyufM+mrKgTCpPm9ha5UBAORNLhAv3PFlmzA8n6lnEvBTJfeG5vUZYQrlZMMKmZl -F1D3mYRFAhT/qFbBsTMlF9XsDNF40NB21ABTquuEB3Ji8mmC1Z2cZjwa4VeKxGIq -kTdBypQgWekopNVvoOGLPbRXgYKW4UCc6pt7Q+We+eUuonp2XIRIOvmJQtXb/rNz -4B1ahu3QB4HnystmQ9dW8BySSGDhZ/kzIcSU8GuHcL58SHsei07gjFzXRhMkkbJH -MT8zS/hrjNsB8Z5kamI4QL7nLVNuCF1Sg9zgB1POdMPLEnm4uDx+BRLwVMGZMwza -MNfEATnWTvLazzIDarMCAwEAAaOCA1IwggNOMA8GA1UdEwEB/wQFMAMBAf8wDgYD -VR0PAQH/BAQDAgHGMEcGA1UdJQRAMD4GCCsGAQUFBwMBBggrBgEFBQcDAwYIKwYB -BQUHAwUGCCsGAQUFBwMGBggrBgEFBQcDBwYKKwYBBAGCNwoDATCCATIGA1UdIASC -ASkwggElMIIBIQYKYIZIAYb5LwAGAzCCAREwSgYIKwYBBQUHAgEWPmh0dHBzOi8v -c2VjdXJlLmlkZW50cnVzdC5jb20vY2VydGlmaWNhdGVzL3BvbGljeS90cy9pbmRl -eC5odG1sMIHCBggrBgEFBQcCAjCBtRqBslRoaXMgVHJ1c3RJRCBTZXJ2ZXIgQ2Vy -dGlmaWNhdGUgaGFzIGJlZW4gaXNzdWVkIGluIGFjY29yZGFuY2Ugd2l0aCBJZGVu -VHJ1c3QncyBUcnVzdElEIENlcnRpZmljYXRlIFBvbGljeSBmb3VuZCBhdCBodHRw -czovL3NlY3VyZS5pZGVudHJ1c3QuY29tLyBjZXJ0aWZpY2F0ZXMvcG9saWN5L3Rz -L2luZGV4Lmh0bWwwgbkGA1UdHwSBsTCBrjAuoCygKoYoaHR0cDovL2NybC5pZGVu -dHJ1c3QuY29tL0RTVFJPT1RDQVgzLmNybDB8oHqgeIZ2bGRhcDovL2xkYXAuaWRl -bnRydXN0LmNvbS9jbj1EU1QlMjBSb290JTIwQ0ElMjBYMyxvPURpZ2l0YWwlMjBT -aWduYXR1cmUlMjBUcnVzdCUyMENvLj9jZXJ0aWZpY2F0ZVJldm9jYXRpb25MaXN0 -O2JpbmFyeTCBrwYIKwYBBQUHAQEEgaIwgZ8wJQYIKwYBBQUHMAGGGWh0dHA6Ly9v -Y3NwLmlkZW50cnVzdC5jb20wdgYIKwYBBQUHMAKGamxkYXA6Ly9sZGFwLmlkZW50 -cnVzdC5jb20vY249RFNUJTIwUm9vdCUyMENBJTIwWDMsbz1EaWdpdGFsJTIwU2ln -bmF0dXJlJTIwVHJ1c3QlMjBDby4/Y0FDZXJ0aWZpY2F0ZTtiaW5hcnkwHwYDVR0j -BBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAwHQYDVR0OBBYEFLeoy2iu3EVD0tyJ -EamBZhn5+3XpMA0GCSqGSIb3DQEBBQUAA4IBAQAtreoVqLQx+G35L8byM/IvGqNa -MzbWYzGIidH3+hT8B2e0duWfZCDazgu272ErWL/T4HL5psUEOIHfzNxEWHA24XhY -zBFsYR64vaTRV7T+iYKv5Nxptidk26zOZ2/F+TKZvOfhPg5IqnH3FyXHEcRDWm1/ -QJsZ4mqgUFx38pc50i1ed6XUdvBObMnGJc1fGdfVqcNqbvHACNrw+WJE9PIeMKJQ -HC/NkE87xFP/Q1OW7hPmqQvmIIbm6BLZ7U0kxqNL3HmegxkJ2yJQntsX+5BooJqj -/uVpwzAEei7IjKsdtomxkHCDPFGEJYBldDLBH0ScSlngQZ6V5HNM473l8bWs +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj +YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM +GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua +BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe +3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 +YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR +rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm +ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU +oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v +QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t +b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF +AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q +GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 +G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi +l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 +smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== -----END CERTIFICATE----- - -subject=/O=Digital Signature Trust Co./CN=DST Root CA X3 -issuer=/O=Digital Signature Trust Co./CN=DST Root CA X3 ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ -MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT -DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow -PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD -Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O -rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq -OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b -xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw -7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD -aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG -SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 -ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr -AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz -R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 -JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo -Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ ------END CERTIFICATE----- - diff --git a/src/deps/src/lua-nginx-module/t/lib/CRC32.lua b/src/deps/src/lua-nginx-module/t/lib/CRC32.lua index fcf260cd4..8ca0d5634 100755 --- a/src/deps/src/lua-nginx-module/t/lib/CRC32.lua +++ b/src/deps/src/lua-nginx-module/t/lib/CRC32.lua @@ -156,7 +156,7 @@ end -- -- CRC32.lua -- --- A pure Lua implementation of a CRC32 hashing algorithm. Slower than using a C implemtation, +-- A pure Lua implementation of a CRC32 hashing algorithm. Slower than using a C implementation, -- but useful having no other dependencies. -- -- diff --git a/src/deps/src/lua-nginx-module/t/lib/Memcached.lua b/src/deps/src/lua-nginx-module/t/lib/Memcached.lua index e3288ac4f..1f8c7f957 100755 --- a/src/deps/src/lua-nginx-module/t/lib/Memcached.lua +++ b/src/deps/src/lua-nginx-module/t/lib/Memcached.lua @@ -541,7 +541,7 @@ end -- -- memcache:set_hash(hashfunc) -- Sets a custom hash function for key values. The default is a CRC32 hashing function. --- 'hashfunc' should be defined receiving a single string parameter and returing a single integer value. +-- 'hashfunc' should be defined receiving a single string parameter and returning a single integer value. -- -- memcache:set_encode(func) -- Sets a custom encode function for serialising table values. 'func' should be defined receiving a single diff --git a/src/deps/src/lua-nginx-module/util/build.sh b/src/deps/src/lua-nginx-module/util/build.sh index 14e9fd46d..713b8482d 100755 --- a/src/deps/src/lua-nginx-module/util/build.sh +++ b/src/deps/src/lua-nginx-module/util/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # this script is for developers only. -# dependent on the ngx-build script from the nginx-devel-utils repostory: +# dependent on the ngx-build script from the nginx-devel-utils repository: # https://github.com/openresty/nginx-devel-utils/blob/master/ngx-build # the resulting nginx is located at ./work/nginx/sbin/nginx @@ -25,9 +25,10 @@ force=$2 add_fake_shm_module="--add-module=$root/t/data/fake-shm-module" time ngx-build $force $version \ + --with-threads \ --with-pcre-jit \ --with-ipv6 \ - --with-cc-opt="-I$PCRE_INC -I$OPENSSL_INC" \ + --with-cc-opt="-DNGX_LUA_USE_ASSERT -I$PCRE_INC -I$OPENSSL_INC" \ --with-http_v2_module \ --with-http_realip_module \ --with-http_ssl_module \ diff --git a/src/deps/src/lua-resty-core/.travis.yml b/src/deps/src/lua-resty-core/.travis.yml index 793eccc07..2d1a3b91a 100644 --- a/src/deps/src/lua-resty-core/.travis.yml +++ b/src/deps/src/lua-resty-core/.travis.yml @@ -1,5 +1,9 @@ sudo: required -dist: trusty +dist: bionic + +branches: + only: + - "master" os: linux @@ -7,7 +11,6 @@ language: c compiler: - gcc - - clang addons: apt: @@ -41,9 +44,7 @@ env: - TEST_NGINX_RANDOMIZE=1 - LUACHECK_VER=0.21.1 matrix: - - NGINX_VERSION=1.19.9 OPENSSL_VER=1.0.2u OPENSSL_PATCH_VER=1.0.2h - - NGINX_VERSION=1.19.9 OPENSSL_VER=1.1.0l OPENSSL_PATCH_VER=1.1.0d - - NGINX_VERSION=1.19.9 OPENSSL_VER=1.1.1g OPENSSL_PATCH_VER=1.1.1f + - NGINX_VERSION=1.21.4 OPENSSL_VER=1.1.1l OPENSSL_PATCH_VER=1.1.1f services: - memcache @@ -75,7 +76,7 @@ install: script: - cd luajit2/ - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT -msse4.2' > build.log 2>&1 || (cat build.log && exit 1) + - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT -msse4.2 -O1 -DLUAJIT_SECURITY_STRID=0 -DLUAJIT_SECURITY_STRHASH=0 -DLUAJIT_SECURITY_PRNG=0 -DLUAJIT_SECURITY_MCODE=0 -DLUAJIT_TEST_FIXED_ORDER' > build.log 2>&1 || (cat build.log && exit 1) - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - cd .. - cd lua-resty-lrucache && sudo make DESTDIR=$LUAJIT_PREFIX LUA_LIB_DIR=/share/lua/5.1 install && cd .. @@ -100,4 +101,4 @@ script: - ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --with-pcre-jit --with-cc-opt="-I$OPENSSL_INC -I$PCRE_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB -L$PCRE_LIB -Wl,-rpath,$PCRE_LIB" --add-module=../ndk-nginx-module --add-module=../echo-nginx-module --add-module=../set-misc-nginx-module --add-module=../headers-more-nginx-module --add-module=../lua-nginx-module --with-debug --with-stream_ssl_module --with-stream --with-ipv6 --add-module=../stream-lua-nginx-module > build.log 2>&1 || (cat build.log && exit 1) - nginx -V - ldd `which nginx`|grep -E 'luajit|ssl|pcre' - - prove -Itest-nginx/lib -j$JOBS -r t + - prove -I. -Itest-nginx/lib -j$JOBS -r t diff --git a/src/deps/src/lua-resty-core/README.markdown b/src/deps/src/lua-resty-core/README.markdown index 5e3c535ab..acc0c761b 100644 --- a/src/deps/src/lua-resty-core/README.markdown +++ b/src/deps/src/lua-resty-core/README.markdown @@ -110,8 +110,8 @@ of this library in the particular OpenResty release you are using. Otherwise you into serious compatibility issues. * LuaJIT 2.1 (for now, it is the v2.1 git branch in the official luajit-2.0 git repository: http://luajit.org/download.html ) -* [ngx_http_lua_module](https://github.com/openresty/lua-nginx-module) v0.10.20. -* [ngx_stream_lua_module](https://github.com/openresty/stream-lua-nginx-module) v0.0.10. +* [ngx_http_lua_module](https://github.com/openresty/lua-nginx-module) v0.10.21. +* [ngx_stream_lua_module](https://github.com/openresty/stream-lua-nginx-module) v0.0.11. * [lua-resty-lrucache](https://github.com/openresty/lua-resty-lrucache) [Back to TOC](#table-of-contents) diff --git a/src/deps/src/lua-resty-core/lib/ngx/process.lua b/src/deps/src/lua-resty-core/lib/ngx/process.lua index 95d5c53a4..fbf4bd9b5 100644 --- a/src/deps/src/lua-resty-core/lib/ngx/process.lua +++ b/src/deps/src/lua-resty-core/lib/ngx/process.lua @@ -37,7 +37,8 @@ local ngx_lua_ffi_master_pid if subsystem == 'http' then ffi.cdef[[ - int ngx_http_lua_ffi_enable_privileged_agent(char **err); + int ngx_http_lua_ffi_enable_privileged_agent(char **err, + unsigned int connections); int ngx_http_lua_ffi_get_process_type(void); void ngx_http_lua_ffi_process_signal_graceful_exit(void); int ngx_http_lua_ffi_master_pid(void); @@ -52,7 +53,8 @@ if subsystem == 'http' then else ffi.cdef[[ - int ngx_stream_lua_ffi_enable_privileged_agent(char **err); + int ngx_stream_lua_ffi_enable_privileged_agent(char **err, + unsigned int connections); int ngx_stream_lua_ffi_get_process_type(void); void ngx_stream_lua_ffi_process_signal_graceful_exit(void); int ngx_stream_lua_ffi_master_pid(void); @@ -73,12 +75,19 @@ function _M.type() end -function _M.enable_privileged_agent() +function _M.enable_privileged_agent(connections) if ngx_phase() ~= "init" then return nil, "API disabled in the current context" end - local rc = ngx_lua_ffi_enable_privileged_agent(errmsg) + connections = connections or 512 + + if type(connections) ~= "number" or connections < 0 then + return nil, "bad 'connections' argument: " .. + "number expected and greater than 0" + end + + local rc = ngx_lua_ffi_enable_privileged_agent(errmsg, connections) if rc == FFI_ERROR then return nil, ffi_str(errmsg[0]) diff --git a/src/deps/src/lua-resty-core/lib/ngx/process.md b/src/deps/src/lua-resty-core/lib/ngx/process.md index c81ae43b3..250356bc6 100644 --- a/src/deps/src/lua-resty-core/lib/ngx/process.md +++ b/src/deps/src/lua-resty-core/lib/ngx/process.md @@ -115,7 +115,7 @@ ngx.say("process type:", process.type()) -- RESPONSE: worker enable_privileged_agent ----------------------- -**syntax:** *ok, err = process_module.enable_privileged_agent()* +**syntax:** *ok, err = process_module.enable_privileged_agent(connections)* **context:** *init_by_lua** @@ -129,6 +129,8 @@ The `init_worker_by_lua*` directive handler still runs in the privileged agent p use the [type](#type) function provided by this module to check if the current process is a privileged agent. +The argument connections sets the maximum number of simultaneous connections that can be opened by privileged agent process. + In case of failures, returns `nil` and a string describing the error. [Back to TOC](#table-of-contents) diff --git a/src/deps/src/lua-resty-core/lib/ngx/ssl/clienthello.lua b/src/deps/src/lua-resty-core/lib/ngx/ssl/clienthello.lua new file mode 100644 index 000000000..ed68f9b61 --- /dev/null +++ b/src/deps/src/lua-resty-core/lib/ngx/ssl/clienthello.lua @@ -0,0 +1,167 @@ +-- Copyright (C) Yichun Zhang (agentzh) + + +local base = require "resty.core.base" +base.allows_subsystem('http', 'stream') + + +local ffi = require "ffi" +local bit = require "bit" +local C = ffi.C +local ffi_str = ffi.string +local get_request = base.get_request +local error = error +local errmsg = base.get_errmsg_ptr() +local get_size_ptr = base.get_size_ptr +local FFI_OK = base.FFI_OK +local subsystem = ngx.config.subsystem +local ngx_phase = ngx.get_phase + + +local ngx_lua_ffi_ssl_get_client_hello_server_name +local ngx_lua_ffi_ssl_get_client_hello_ext +local ngx_lua_ffi_ssl_set_protocols + + +if subsystem == 'http' then + ffi.cdef[[ + int ngx_http_lua_ffi_ssl_get_client_hello_server_name(ngx_http_request_t *r, + const char **name, size_t *namelen, char **err); + + int ngx_http_lua_ffi_ssl_get_client_hello_ext(ngx_http_request_t *r, + unsigned int type, const unsigned char **out, size_t *outlen, + char **err); + + int ngx_http_lua_ffi_ssl_set_protocols(ngx_http_request_t *r, + int protocols, char **err); + ]] + + ngx_lua_ffi_ssl_get_client_hello_server_name = + C.ngx_http_lua_ffi_ssl_get_client_hello_server_name + ngx_lua_ffi_ssl_get_client_hello_ext = + C.ngx_http_lua_ffi_ssl_get_client_hello_ext + ngx_lua_ffi_ssl_set_protocols = C.ngx_http_lua_ffi_ssl_set_protocols + +elseif subsystem == 'stream' then + ffi.cdef[[ + int ngx_stream_lua_ffi_ssl_get_client_hello_server_name( + ngx_stream_lua_request_t *r, const char **name, size_t *namelen, + char **err); + + int ngx_stream_lua_ffi_ssl_get_client_hello_ext( + ngx_stream_lua_request_t *r, unsigned int type, + const unsigned char **out, size_t *outlen, char **err); + + int ngx_stream_lua_ffi_ssl_set_protocols(ngx_stream_lua_request_t *r, + int protocols, char **err); + ]] + + ngx_lua_ffi_ssl_get_client_hello_server_name = + C.ngx_stream_lua_ffi_ssl_get_client_hello_server_name + ngx_lua_ffi_ssl_get_client_hello_ext = + C.ngx_stream_lua_ffi_ssl_get_client_hello_ext + ngx_lua_ffi_ssl_set_protocols = C.ngx_stream_lua_ffi_ssl_set_protocols +end + + +local _M = { version = base.version } + + +local ccharpp = ffi.new("const char*[1]") +local cucharpp = ffi.new("const unsigned char*[1]") + + +-- return server_name, err +function _M.get_client_hello_server_name() + local r = get_request() + if not r then + error("no request found") + end + + if ngx_phase() ~= "ssl_client_hello" then + error("API disabled in the current context", 2) + end + + local sizep = get_size_ptr() + + local rc = ngx_lua_ffi_ssl_get_client_hello_server_name(r, ccharpp, sizep, + errmsg) + if rc == FFI_OK then + return ffi_str(ccharpp[0], sizep[0]) + end + + -- NGX_DECLINED: no sni extension + if rc == -5 then + return nil + end + + return nil, ffi_str(errmsg[0]) +end + + +-- return ext, err +function _M.get_client_hello_ext(ext_type) + local r = get_request() + if not r then + error("no request found") + end + + if ngx_phase() ~= "ssl_client_hello" then + error("API disabled in the current context", 2) + end + + local sizep = get_size_ptr() + + local rc = ngx_lua_ffi_ssl_get_client_hello_ext(r, ext_type, cucharpp, + sizep, errmsg) + if rc == FFI_OK then + return ffi_str(cucharpp[0], sizep[0]) + end + + -- NGX_DECLINED: no extension + if rc == -5 then + return nil + end + + return nil, ffi_str(errmsg[0]) +end + + +local prot_map = { + ["SSLv2"] = 0x0002, + ["SSLv3"] = 0x0004, + ["TLSv1"] = 0x0008, + ["TLSv1.1"] = 0x0010, + ["TLSv1.2"] = 0x0020, + ["TLSv1.3"] = 0x0040 +} + + +-- return ok, err +function _M.set_protocols(protocols) + local r = get_request() + if not r then + error("no request found") + end + + if ngx_phase() ~= "ssl_client_hello" then + error("API disabled in the current context" .. ngx_phase(), 2) + end + + local prots = 0 + for _, v in ipairs(protocols) do + if not prot_map[v] then + return nil, "invalid protocols failed" + end + prots = bit.bor(prots, prot_map[v]) + end + + local rc = ngx_lua_ffi_ssl_set_protocols(r, prots, errmsg) + if rc == FFI_OK then + return true + end + + return nil, ffi_str(errmsg[0]) +end + +return _M diff --git a/src/deps/src/lua-resty-core/lib/ngx/ssl/clienthello.md b/src/deps/src/lua-resty-core/lib/ngx/ssl/clienthello.md new file mode 100644 index 000000000..bc70b4cf9 --- /dev/null +++ b/src/deps/src/lua-resty-core/lib/ngx/ssl/clienthello.md @@ -0,0 +1,255 @@ +Name +==== + +ngx.ssl.clienthello - Lua API for post-processing SSL client hello message for NGINX downstream SSL connections. + +Table of Contents +================= + +* [Name](#name) +* [Status](#status) +* [Synopsis](#synopsis) +* [Description](#description) +* [Methods](#methods) + * [get_client_hello_server_name](#get_client_hello_server_name) + * [get_client_hello_ext](#get_client_hello_ext) + * [set_protocols](#set_protocols) +* [Community](#community) + * [English Mailing List](#english-mailing-list) + * [Chinese Mailing List](#chinese-mailing-list) +* [Bugs and Patches](#bugs-and-patches) +* [Author](#author) +* [Copyright and License](#copyright-and-license) +* [See Also](#see-also) + +Status +====== + +This Lua module is currently considered experimental. + +Synopsis +======== + +```nginx +# nginx.conf + +server { + listen 443 ssl; + server_name test.com; + ssl_certificate /path/to/cert.crt; + ssl_certificate_key /path/to/key.key; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local host, err = ssl_clt.get_client_hello_server_name() + if host == "test.com" then + ssl_clt.set_protocols({"TLSv1", "TLSv1.1"}) + elseif host == "test2.com" then + ssl_clt.set_protocols({"TLSv1.2", "TLSv1.3"}) + elseif not host then + ngx.log(ngx.ERR, "failed to get the SNI name: ", err) + ngx.exit(ngx.ERROR) + else + ngx.log(ngx.ERR, "unknown SNI name: ", host) + ngx.exit(ngx.ERROR) + end + } + ... +} +server { + listen 443 ssl; + server_name test2.com; + ssl_certificate /path/to/cert.crt; + ssl_certificate_key /path/to/key.key; + ... +} +``` + +Description +=========== + +This Lua module provides API functions for post-processing SSL client hello message for NGINX downstream connections. + +It must to be used in the contexts [ssl_client_hello_by_lua*](https://github.com/openresty/lua-nginx-module/#ssl_client_hello_by_lua_block). + +This Lua API is particularly useful for dynamically setting the SSL protocols according to the SNI. + +It is also useful to do some custom operations according to the per-connection information in the client hello message. + +For example, one can parse the custom client hello extension and do the corresponding handling in pure Lua. + +To load the `ngx.ssl.clienthello` module in Lua, just write + +```lua +local ssl_clt = require "ngx.ssl.clienthello" +``` + +[Back to TOC](#table-of-contents) + +Methods +======= + +get_client_hello_server_name +-------------- +**syntax:** *host, err = ssl_clt.get_client_hello_server_name()* + +**context:** *ssl_client_hello_by_lua** + +Returns the TLS SNI (Server Name Indication) name set by the client. + +Return `nil` when then the extension does not exist. + +In case of errors, it returns `nil` and a string describing the error. + +Note that the SNI name is gotten from the raw extensions of the client hello message associated with the current downstream SSL connection. + +So this function can only be called in the context of [ssl_client_hello_by_lua*](https://github.com/openresty/lua-nginx-module/#ssl_client_hello_by_lua_block). + +[Back to TOC](#table-of-contents) + +get_client_hello_ext +---------------------- +**syntax:** *ext, err = ssl_clt.get_client_hello_ext(ext_type)* + +**context:** *ssl_client_hello_by_lua** + +Returns raw data of arbitrary SSL client hello extension including custom extensions. + +Returns `nil` if the specified extension type does not exist. + +In case of errors, it returns `nil` and a string describing the error. + +Note that the ext is gotten from the raw extensions of the client hello message associated with the current downstream SSL connection. + +So this function can only be called in the context of [ssl_client_hello_by_lua*](https://github.com/openresty/lua-nginx-module/#ssl_client_hello_by_lua_block). + +Example: + +Gets server name from raw extension data. The `0` in `ssl_clt.get_client_hello_ext(0)` denotes `TLSEXT_TYPE_server_name`, and the `0` in `byte(ext, 3) ~= 0` denotes `TLSEXT_NAMETYPE_host_name`. + +```nginx +# nginx.conf +server { + listen 443 ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local byte = string.byte + local ext = ssl_clt.get_client_hello_ext(0) + if not ext then + print("failed to get_client_hello_ext(0)") + ngx.exit(ngx.ERROR) + end + local total_len = string.len(ext) + if total_len <= 2 then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + local len = byte(ext, 1) * 256 + byte(ext, 2) + if len + 2 ~= total_len then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + if byte(ext, 3) ~= 0 then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + if total_len <= 5 then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + len = byte(ext, 4) * 256 + byte(ext, 5) + if len + 5 > total_len then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + local name = string.sub(ext, 6, 6 + len -1) + + print("read SNI name from Lua: ", name) + } + ssl_certificate test.crt; + ssl_certificate_key test.key; +} +``` + +[Back to TOC](#table-of-contents) + +set_protocols +---------------------- +**syntax:** *ok, err = ssl_clt.set_protocols(protocols)* + +**context:** *ssl_client_hello_by_lua** + +Sets the SSL protocols supported by the current downstream SSL connection. + +Returns `true` on success, or a `nil` value and a string describing the error otherwise. + +Considering it is meaningless to set ssl protocols after the protocol is determined, +so this function may only be called in the context of [ssl_client_hello_by_lua*](https://github.com/openresty/lua-nginx-module/#ssl_client_hello_by_lua_block). + +Example: `ssl_clt.set_protocols({"TLSv1.1", "TLSv1.2", "TLSv1.3"})` + +[Back to TOC](#table-of-contents) + +Community +========= + +[Back to TOC](#table-of-contents) + +English Mailing List +-------------------- + +The [openresty-en](https://groups.google.com/group/openresty-en) mailing list is for English speakers. + +[Back to TOC](#table-of-contents) + +Chinese Mailing List +-------------------- + +The [openresty](https://groups.google.com/group/openresty) mailing list is for Chinese speakers. + +[Back to TOC](#table-of-contents) + +Bugs and Patches +================ + +Please report bugs or submit patches by + +1. creating a ticket on the [GitHub Issue Tracker](https://github.com/openresty/lua-resty-core/issues), +1. or posting to the [OpenResty community](#community). + +[Back to TOC](#table-of-contents) + +Author +====== + +Zhefeng Chen <chzf\_zju@163.com> (catbro666) + +[Back to TOC](#table-of-contents) + +Copyright and License +===================== + +This module is licensed under the BSD license. + +Copyright (C) 2016-2017, by Yichun "agentzh" Zhang, OpenResty Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +[Back to TOC](#table-of-contents) + +See Also +======== +* the ngx_lua module: https://github.com/openresty/lua-nginx-module +* the [ssl_client_hello_by_lua*](https://github.com/openresty/lua-nginx-module/#ssl_client_hello_by_lua_block) directive. +* the [lua-resty-core](https://github.com/openresty/lua-resty-core) library. +* OpenResty: https://openresty.org + +[Back to TOC](#table-of-contents) diff --git a/src/deps/src/lua-resty-core/lib/resty/core/base.lua b/src/deps/src/lua-resty-core/lib/resty/core/base.lua index 608e1101a..d1dff96a4 100644 --- a/src/deps/src/lua-resty-core/lib/resty/core/base.lua +++ b/src/deps/src/lua-resty-core/lib/resty/core/base.lua @@ -16,25 +16,24 @@ local FREE_LIST_REF = 0 if subsystem == 'http' then - local ngx_lua_v = ngx.config.ngx_lua_version if not ngx.config or not ngx.config.ngx_lua_version - or (ngx_lua_v ~= 10019 and ngx_lua_v ~= 10020) + or ngx.config.ngx_lua_version ~= 10022 then - error("ngx_http_lua_module 0.10.19 or 0.10.20 required") + error("ngx_http_lua_module 0.10.22 required") end elseif subsystem == 'stream' then if not ngx.config or not ngx.config.ngx_lua_version - or ngx.config.ngx_lua_version ~= 10 + or ngx.config.ngx_lua_version ~= 11 then - error("ngx_stream_lua_module 0.0.10 required") + error("ngx_stream_lua_module 0.0.11 required") end else - error("ngx_http_lua_module 0.10.20 or " - .. "ngx_stream_lua_module 0.0.10 required") + error("ngx_http_lua_module 0.10.22 or " + .. "ngx_stream_lua_module 0.0.11 required") end @@ -133,7 +132,7 @@ local c_buf_type = ffi.typeof("char[?]") local _M = new_tab(0, 18) -_M.version = "0.1.22" +_M.version = "0.1.24" _M.new_tab = new_tab _M.clear_tab = clear_tab diff --git a/src/deps/src/lua-resty-core/lib/resty/core/ctx.lua b/src/deps/src/lua-resty-core/lib/resty/core/ctx.lua index 1495c603e..3e558cae5 100644 --- a/src/deps/src/lua-resty-core/lib/resty/core/ctx.lua +++ b/src/deps/src/lua-resty-core/lib/resty/core/ctx.lua @@ -53,6 +53,12 @@ local _M = { } +-- use a new ctxs table to make LuaJIT JIT compiler happy to generate more +-- efficient machine code. +local ctxs = {} +registry.ngx_lua_ctx_tables = ctxs + + local get_ctx_table do local in_ssl_phase = ffi.new("int[1]") @@ -70,7 +76,6 @@ do error("no request ctx found") end - local ctxs = registry.ngx_lua_ctx_tables if ctx_ref < 0 then ctx_ref = ssl_ctx_ref[0] if ctx_ref > 0 and ctxs[ctx_ref] then @@ -129,7 +134,6 @@ local function set_ctx_table(ctx) error("no request ctx found") end - local ctxs = registry.ngx_lua_ctx_tables if ctx_ref < 0 then ctx_ref = ref_in_table(ctxs, ctx) ngx_lua_ffi_set_ctx_ref(r, ctx_ref) diff --git a/src/deps/src/lua-resty-core/lib/resty/core/phase.lua b/src/deps/src/lua-resty-core/lib/resty/core/phase.lua index 331752a75..6eaad4c8b 100644 --- a/src/deps/src/lua-resty-core/lib/resty/core/phase.lua +++ b/src/deps/src/lua-resty-core/lib/resty/core/phase.lua @@ -29,6 +29,7 @@ local context_names = { [0x0800] = "ssl_session_store", [0x1000] = "ssl_session_fetch", [0x2000] = "exit_worker", + [0x4000] = "ssl_client_hello", } diff --git a/src/deps/src/lua-resty-core/lib/resty/core/regex.lua b/src/deps/src/lua-resty-core/lib/resty/core/regex.lua index 6a14416f7..90fd835e9 100644 --- a/src/deps/src/lua-resty-core/lib/resty/core/regex.lua +++ b/src/deps/src/lua-resty-core/lib/resty/core/regex.lua @@ -1038,7 +1038,7 @@ local function re_sub_func_helper(subj, regex, replace, opts, global) end if count > 0 then - if pos < subj_len then + if cp_pos < subj_len then local suffix_len = subj_len - cp_pos local new_dst_len = dst_len + suffix_len @@ -1167,7 +1167,7 @@ local function re_sub_str_helper(subj, regex, replace, opts, global) end if count > 0 then - if pos < subj_len then + if cp_pos < subj_len then local suffix_len = subj_len - cp_pos local new_dst_len = dst_len + suffix_len diff --git a/src/deps/src/lua-resty-core/t/balancer.t b/src/deps/src/lua-resty-core/t/balancer.t index 5d8b377b0..8c97227ce 100644 --- a/src/deps/src/lua-resty-core/t/balancer.t +++ b/src/deps/src/lua-resty-core/t/balancer.t @@ -830,8 +830,8 @@ hello from balancer by lua! GET /t --- response_body_like: 502 Bad Gateway --- error_code: 502 ---- error_log -[lua] log_by_lua(nginx.conf:59):2: ngx.var.upstream_addr is 127.0.0.3:12345, 127.0.0.3:12346 +--- error_log eval +qr/log_by_lua\(nginx.conf:\d+\):\d+: ngx.var.upstream_addr is 127.0.0.3:12345, 127.0.0.3:12346/ --- no_error_log [alert] diff --git a/src/deps/src/lua-resty-core/t/ctx.t b/src/deps/src/lua-resty-core/t/ctx.t index e6b93e00e..893efc471 100644 --- a/src/deps/src/lua-resty-core/t/ctx.t +++ b/src/deps/src/lua-resty-core/t/ctx.t @@ -10,7 +10,7 @@ log_level('debug'); #repeat_each(120); repeat_each(2); -plan tests => repeat_each() * (blocks() * 3 + 11); +plan tests => repeat_each() * (blocks() * 3 + 13); #no_diff(); #no_long_string(); @@ -929,3 +929,112 @@ reused reused again --- no_error_log [error] + + + +=== TEST 14: ngx.ctx in ssl_client_hello_by_lua +--- http_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + ngx.ctx.answer = 42 + ngx.log(ngx.WARN, "ngx.ctx.answer = ", ngx.ctx.answer) + + ngx.ctx.count = 0 + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + content_by_lua_block { + ngx.say(ngx.ctx.answer) + ngx.ctx.count = ngx.ctx.count + 1 + ngx.say(ngx.ctx.count) + } + } + } +--- config + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + for i = 1, 2 do + local req = "GET /foo HTTP/1.1\r\nHost: test.com\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + local body_seen = false + while true do + local line, err = sock:receive() + if not line then + break + end + + if body_seen then + if line == "0" then + assert(sock:receive()) + break + end + local line, err = sock:receive(line) + ngx.print("received: ", line) + assert(sock:receive()) + + elseif line == "" then + body_seen = true + end + end + end + + sock:close() + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +received: 42 +received: 1 +received: 42 +received: 1 +--- error_log +ngx.ctx.answer = 42 +--- grep_error_log eval +qr/lua release ngx.ctx at ref \d+/ +--- grep_error_log_out eval +["lua release ngx.ctx at ref 2 +lua release ngx.ctx at ref 2 +lua release ngx.ctx at ref 1 +", +"lua release ngx.ctx at ref 2 +lua release ngx.ctx at ref 2 +lua release ngx.ctx at ref 1 +lua release ngx.ctx at ref 2 +lua release ngx.ctx at ref 2 +lua release ngx.ctx at ref 1 +"] +--- no_error_log +[error] diff --git a/src/deps/src/lua-resty-core/t/process-type-privileged-agent-connections.t b/src/deps/src/lua-resty-core/t/process-type-privileged-agent-connections.t new file mode 100644 index 000000000..42592e907 --- /dev/null +++ b/src/deps/src/lua-resty-core/t/process-type-privileged-agent-connections.t @@ -0,0 +1,301 @@ +# vim:set ft= ts=4 sw=4 et fdm=marker: + +use lib '.'; +use t::TestCore; + +master_process_enabled(1); + +repeat_each(1); + +plan tests => repeat_each() * (blocks() * 5); + + +$ENV{TEST_NGINX_LUA_PACKAGE_PATH} = $t::TestCore::lua_package_path; +$ENV{TEST_NGINX_RANDOM_PORT} = Test::Nginx::Util::server_port(); + +run_tests(); + +__DATA__ + +=== TEST 1: specify connections to enable_privileged_agent +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + init_by_lua_block { + local process = require "ngx.process" + local ok, err = process.enable_privileged_agent(10) + if not ok then + ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err) + end + } + + init_worker_by_lua_block { + local base = require "resty.core.base" + local typ = (require "ngx.process").type() + + if typ == "privileged agent" then + ngx.log(ngx.WARN, "process type: ", typ) + ngx.timer.at(0, function() + local tcpsock = ngx.socket.tcp() + local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT) + + if ok then + ngx.log(ngx.INFO, "connect ok ") + else + ngx.log(ngx.INFO, "connect failed " .. tostring(err)) + end + end) + end + } +--- config + location = /t { + content_by_lua_block { + ngx.sleep(0.1) + local typ = require "ngx.process".type() + ngx.say("type: ", typ) + } + } +--- request +GET /t +--- response_body +type: worker +--- error_log +connect ok +--- no_error_log +connect failed +enable_privileged_agent failed +--- skip_nginx: 5: < 1.11.2 +--- wait: 0.2 + + + +=== TEST 2: connections exceed limit +the real connections you can create is always less than you set. +timer will take fake connections. +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + init_by_lua_block { + local process = require "ngx.process" + local ok, err = process.enable_privileged_agent(10) + if not ok then + ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err) + end + } + + init_worker_by_lua_block { + local base = require "resty.core.base" + local typ = (require "ngx.process").type() + + if typ == "privileged agent" then + ngx.log(ngx.WARN, "process type: ", typ) + + ngx.timer.at(0, function() + + for i = 1, 10 do + local tcpsock = ngx.socket.tcp() + local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT) + + if ok then + ngx.log(ngx.INFO, "connect ok ") + else + ngx.log(ngx.INFO, "connect failed " .. tostring(err)) + end + end + + end) + end + } +--- config + location = /t { + content_by_lua_block { + ngx.sleep(0.1) + local typ = require "ngx.process".type() + ngx.say("type: ", typ) + } + } +--- request +GET /t +--- response_body +type: worker +--- error_log +connect failed +worker_connections are not enough +--- no_error_log +enable_privileged_agent failed +--- skip_nginx: 5: < 1.11.2 +--- wait: 0.2 + + + +=== TEST 3: enable_privileged_agent with bad connections +connections < 0 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + init_by_lua_block { + local process = require "ngx.process" + local ok, err = process.enable_privileged_agent(-1) + if not ok then + ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err) + end + } + + init_worker_by_lua_block { + local base = require "resty.core.base" + local typ = (require "ngx.process").type() + + if typ == "privileged agent" then + ngx.log(ngx.WARN, "process type: ", typ) + + ngx.timer.at(0, function() + + for i = 1, 10 do + local tcpsock = ngx.socket.tcp() + local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT) + + if ok then + ngx.log(ngx.INFO, "connect ok ") + else + ngx.log(ngx.INFO, "connect failed " .. tostring(err)) + end + end + + end) + end + } +--- config + location = /t { + content_by_lua_block { + ngx.sleep(0.1) + local typ = require "ngx.process".type() + ngx.say("type: ", typ) + } + } +--- request +GET /t +--- response_body +type: worker +--- error_log +enable_privileged_agent failed: bad 'connections' argument +--- no_error_log +connect ok +connect failed +--- skip_nginx: 5: < 1.11.2 +--- wait: 0.2 + + + +=== TEST 4: enable_privileged_agent with bad connections +connections is not a number +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + init_by_lua_block { + local process = require "ngx.process" + local ok, err = process.enable_privileged_agent("10") + if not ok then + ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err) + end + } + + init_worker_by_lua_block { + local base = require "resty.core.base" + local typ = (require "ngx.process").type() + + if typ == "privileged agent" then + ngx.log(ngx.WARN, "process type: ", typ) + + ngx.timer.at(0, function() + + for i = 1, 10 do + local tcpsock = ngx.socket.tcp() + local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT) + + if ok then + ngx.log(ngx.INFO, "connect ok ") + else + ngx.log(ngx.INFO, "connect failed " .. tostring(err)) + end + end + + end) + end + } +--- config + location = /t { + content_by_lua_block { + ngx.sleep(0.1) + local typ = require "ngx.process".type() + ngx.say("type: ", typ) + } + } +--- request +GET /t +--- response_body +type: worker +--- error_log +enable_privileged_agent failed: bad 'connections' argument +--- no_error_log +connect ok +connect failed +--- skip_nginx: 5: < 1.11.2 +--- wait: 0.2 + + + +=== TEST 5: enable_privileged_agent with bad connections +connections = 0 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + init_by_lua_block { + local process = require "ngx.process" + local ok, err = process.enable_privileged_agent(0) + if not ok then + ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err) + end + } + + init_worker_by_lua_block { + local base = require "resty.core.base" + local typ = (require "ngx.process").type() + + if typ == "privileged agent" then + ngx.log(ngx.WARN, "process type: ", typ) + + ngx.timer.at(0, function() + + for i = 1, 10 do + local tcpsock = ngx.socket.tcp() + local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT) + + if ok then + ngx.log(ngx.INFO, "connect ok ") + else + ngx.log(ngx.INFO, "connect failed " .. tostring(err)) + end + end + + end) + end + } +--- config + location = /t { + content_by_lua_block { + ngx.sleep(0.1) + local typ = require "ngx.process".type() + ngx.say("type: ", typ) + } + } +--- request +GET /t +--- response_body +type: worker +--- error_log +0 worker_connection is not enough, privileged agent process cannot be spawned +--- no_error_log +process type: privileged agent +connect ok +--- skip_nginx: 5: < 1.11.2 +--- wait: 0.2 diff --git a/src/deps/src/lua-resty-core/t/process-type-privileged-agent.t b/src/deps/src/lua-resty-core/t/process-type-privileged-agent.t index 76bd1e19e..52f4d21bd 100644 --- a/src/deps/src/lua-resty-core/t/process-type-privileged-agent.t +++ b/src/deps/src/lua-resty-core/t/process-type-privileged-agent.t @@ -7,13 +7,15 @@ BEGIN { use lib '.'; use t::TestCore; +$ENV{TEST_NGINX_RANDOM_PORT} = Test::Nginx::Util::server_port(); + #worker_connections(1014); master_process_enabled(1); #log_level('error'); repeat_each(2); -plan tests => repeat_each() * (blocks() * 5 - 3); +plan tests => repeat_each() * (blocks() * 5 - 5); add_block_preprocessor(sub { my $block = shift; @@ -27,7 +29,7 @@ add_block_preprocessor(sub { $t::TestCore::init_by_lua_block local process = require "ngx.process" - local ok, err = process.enable_privileged_agent() + local ok, err = process.enable_privileged_agent(8) if not ok then ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err) end @@ -43,6 +45,19 @@ add_block_preprocessor(sub { if v == "privileged agent" then ngx.log(ngx.WARN, "process type: ", v) + + ngx.timer.at(0, function() + for i = 1, 4 do + local tcpsock = ngx.socket.tcp() + local ok, err = tcpsock:connect("127.0.0.1", $ENV{TEST_NGINX_RANDOM_PORT}) + + if ok then + ngx.log(ngx.INFO, "connect ok ") + else + ngx.log(ngx.INFO, "connect not ok " .. tostring(err)) + end + end + end) end } _EOC_ @@ -138,3 +153,24 @@ GET /t missing privileged agent process patch in the nginx core API disabled in the current context --- skip_nginx: 4: >= 1.11.2 + + + +=== TEST 4: connections exceed limits +--- config + location = /t { + content_by_lua_block { + local process = require "ngx.process" + local ok, err = process.enable_privileged_agent() + if not ok then + error(err) + end + } + } +--- request +GET /t +--- response_body_like: 500 Internal Server Error +--- error_code: 500 +--- error_log +worker_connections are not enough +--- skip_nginx: 3: < 1.11.2 diff --git a/src/deps/src/lua-resty-core/t/re-bugs.t b/src/deps/src/lua-resty-core/t/re-bugs.t index 926b14584..eefca2804 100644 --- a/src/deps/src/lua-resty-core/t/re-bugs.t +++ b/src/deps/src/lua-resty-core/t/re-bugs.t @@ -4,7 +4,7 @@ use t::TestCore; repeat_each(2); -plan tests => repeat_each() * (blocks() * 4); +plan tests => repeat_each() * (blocks() * 4 - 4); add_block_preprocessor(sub { my $block = shift; @@ -137,3 +137,40 @@ c0 disabled in init phase under macOS --- skip_eval 4: $^O ne 'linux' + + + +=== TEST 5: bug: sub incorrectly dropped the last character +--- config + location /re { + content_by_lua_block { + local s, n = ngx.re.sub("abcd", "(?<=c)", ".") + ngx.say(s) + ngx.say(n) + } + } +--- request + GET /re +--- response_body +abc.d +1 + + + +=== TEST 6: bug: sub incorrectly dropped the last character(replace function) +--- config + location /re { + content_by_lua_block { + local function repl(m) + return "[" .. m[0] .. "]" + end + local s, n = ngx.re.sub("abcd", "(?<=c)", repl) + ngx.say(s) + ngx.say(n) + } + } +--- request + GET /re +--- response_body +abc[]d +1 diff --git a/src/deps/src/lua-resty-core/t/request.t b/src/deps/src/lua-resty-core/t/request.t index 7ee9f8201..80e866b2f 100644 --- a/src/deps/src/lua-resty-core/t/request.t +++ b/src/deps/src/lua-resty-core/t/request.t @@ -8,7 +8,7 @@ use t::TestCore; repeat_each(2); -plan tests => repeat_each() * (blocks() * 5 + 5); +plan tests => repeat_each() * (blocks() * 5 + 2); #no_diff(); #no_long_string(); @@ -439,6 +439,8 @@ qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/ [error] bad argument type stitch +--- skip_nginx +6: >= 1.21.1 @@ -586,3 +588,27 @@ Foo: baz, 123 --- http09 --- response_body table,table + + + +=== TEST 19: CONNECT method is considered invalid since nginx 1.21.1 +--- config + location = /t { + access_log off; + content_by_lua_block { + local t + for i = 1, 500 do + t = ngx.req.get_method() + end + ngx.say("method: ", t) + ngx.req.discard_body() + } + } +--- request +CONNECT /t +hello +--- error_code: 405 +--- no_error_log +[error] +--- skip_nginx +2: < 1.21.1 diff --git a/src/deps/src/lua-resty-core/t/ssl-client-hello.t b/src/deps/src/lua-resty-core/t/ssl-client-hello.t new file mode 100644 index 000000000..7dcf9e74c --- /dev/null +++ b/src/deps/src/lua-resty-core/t/ssl-client-hello.t @@ -0,0 +1,866 @@ +# vim:set ft= ts=4 sw=4 et fdm=marker: +use lib '.'; +use t::TestCore; + +#worker_connections(10140); +#workers(1); +#log_level('warn'); + +repeat_each(2); + +# All these tests need to have new openssl +my $NginxBinary = $ENV{'TEST_NGINX_BINARY'} || 'nginx'; +my $openssl_version = eval { `$NginxBinary -V 2>&1` }; + +if ($openssl_version =~ m/built with OpenSSL (0\S*|1\.0\S*|1\.1\.0\S*)/) { + plan(skip_all => "too old OpenSSL, need 1.1.1, was $1"); +} else { + plan tests => repeat_each() * (blocks() * 6 - 2); +} + +no_long_string(); +#no_diff(); + +env_to_nginx("PATH=" . $ENV{'PATH'}); +$ENV{TEST_NGINX_LUA_PACKAGE_PATH} = "$t::TestCore::lua_package_path"; +$ENV{TEST_NGINX_HTML_DIR} ||= html_dir(); + +run_tests(); + +__DATA__ + +=== TEST 1: read SNI name via ssl.clienthello.get_client_hello_server_name() +--- skip_nginx: 6: < 1.19.9 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + print("read SNI name from Lua: ", ssl_clt.get_client_hello_server_name()) + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +lua ssl server name: "test.com" +read SNI name from Lua: test.com + +--- no_error_log +[error] +[alert] + + + +=== TEST 2: read SNI name via ssl.clienthello.get_client_hello_server_name() when no SNI name specified +--- skip_nginx: 6: < 1.19.9 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + server { + listen 127.0.0.2:$TEST_NGINX_RAND_PORT_1 ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local name = ssl_clt.get_client_hello_server_name() + print("read SNI name from Lua: ", name, ", type: ", type(name)) + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local ok, err = sock:connect("127.0.0.2", $TEST_NGINX_RAND_PORT_1) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, nil, true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +read SNI name from Lua: nil, type: nil + +--- no_error_log +[error] +[alert] +[emerg] + + + +=== TEST 3: read SNI name via ssl.clienthello.get_client_hello_ext() +--- skip_nginx: 6: < 1.19.9 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local byte = string.byte + local ext = ssl_clt.get_client_hello_ext(0) + if not ext then + print("failed to get_client_hello_ext(0)") + ngx.exit(ngx.ERROR) + end + local total_len = string.len(ext) + if total_len <= 2 then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + local len = byte(ext, 1) * 256 + byte(ext, 2) + if len + 2 ~= total_len then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + if byte(ext, 3) ~= 0 then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + if total_len <= 5 then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + len = byte(ext, 4) * 256 + byte(ext, 5) + if len + 5 > total_len then + print("bad SSL Client Hello Extension") + ngx.exit(ngx.ERROR) + end + local name = string.sub(ext, 6, 6 + len -1) + + print("read SNI name from Lua: ", name) + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +lua ssl server name: "test.com" +read SNI name from Lua: test.com + +--- no_error_log +[error] +[alert] + + + +=== TEST 4: read SNI name via ssl.clienthello.get_client_hello_ext() when no SNI name specified +--- skip_nginx: 6: < 1.19.9 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + server { + listen 127.0.0.2:$TEST_NGINX_RAND_PORT_1 ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local ext = ssl_clt.get_client_hello_ext(0) + print("read SNI name from Lua: ", ext, ", type: ", type(ext)) + } + + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local ok, err = sock:connect("127.0.0.2", $TEST_NGINX_RAND_PORT_1) + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, nil, true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log +read SNI name from Lua: nil, type: nil + +--- no_error_log +[error] +[alert] +[emerg] + + + +=== TEST 5: dynamically set ssl protocol - allow TLSv1.2 +--- skip_nginx: 6: < 1.19.9 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local ok = ssl_clt.set_protocols({"TLSv1.2", "TLSv1.3"}) + if not ok then + print("failed to set_protocols") + ngx.exit(ngx.ERROR) + end + } + ssl_protocols TLSv1 TLSv1.1; + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_protocols TLSv1.2; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, nil, true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log eval +[qr/SSL: TLSv1.2, cipher:/] + +--- no_error_log +[error] +[alert] +[emerg] + + + +=== TEST 6: dynamically set ssl protocol - allow TLSv1.3 +--- skip_nginx: 6: < 1.19.9 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local ok = ssl_clt.set_protocols({"TLSv1.2", "TLSv1.3"}) + if not ok then + print("failed to set_protocols") + ngx.exit(ngx.ERROR) + end + } + ssl_protocols TLSv1 TLSv1.1; + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_protocols TLSv1.3; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, nil, true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +ssl handshake: userdata +sent http request: 56 bytes. +received: HTTP/1.1 201 Created +received: Server: nginx +received: Content-Type: text/plain +received: Content-Length: 4 +received: Connection: close +received: +received: foo +close: 1 nil + +--- error_log eval +[qr/SSL: TLSv1.3, cipher:/] + +--- no_error_log +[error] +[alert] +[emerg] + + + +=== TEST 7: dynamically set ssl protocol - deny TLSv1.1 +--- skip_nginx: 5: < 1.19.9 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local ok = ssl_clt.set_protocols({"TLSv1.2", "TLSv1.3"}) + if not ok then + print("failed to set_protocols") + ngx.exit(ngx.ERROR) + end + } + ssl_protocols TLSv1 TLSv1.1; + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_protocols TLSv1.1; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, nil, true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +failed to do SSL handshake: handshake failed + +--- error_log eval +[qr/SSL_do_handshake\(\) failed .*?tls_early_post_process_client_hello:unsupported protocol/] + +--- no_error_log +[alert] +[emerg] + + + +=== TEST 8: dynamically set ssl protocol - deny TLSv1 +--- skip_nginx: 5: < 1.19.9 +--- http_config + lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH"; + + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + server_name test.com; + ssl_client_hello_by_lua_block { + local ssl_clt = require "ngx.ssl.clienthello" + local ok = ssl_clt.set_protocols({"TLSv1.2", "TLSv1.3"}) + if not ok then + print("failed to set_protocols") + ngx.exit(ngx.ERROR) + end + } + ssl_protocols TLSv1 TLSv1.1; + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + server_tokens off; + location /foo { + default_type 'text/plain'; + content_by_lua_block {ngx.status = 201 ngx.say("foo") ngx.exit(201)} + more_clear_headers Date; + } + } +--- config + server_tokens off; + lua_ssl_trusted_certificate ../../cert/test.crt; + lua_ssl_protocols TLSv1; + + location /t { + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + ngx.say("connected: ", ok) + + local sess, err = sock:sslhandshake(nil, nil, true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + ngx.say("ssl handshake: ", type(sess)) + + local req = "GET /foo HTTP/1.0\r\nHost: test.com\r\nConnection: close\r\n\r\n" + local bytes, err = sock:send(req) + if not bytes then + ngx.say("failed to send http request: ", err) + return + end + + ngx.say("sent http request: ", bytes, " bytes.") + + while true do + local line, err = sock:receive() + if not line then + -- ngx.say("failed to receive response status line: ", err) + break + end + + ngx.say("received: ", line) + end + + local ok, err = sock:close() + ngx.say("close: ", ok, " ", err) + end -- do + -- collectgarbage() + } + } + +--- request +GET /t +--- response_body +connected: 1 +failed to do SSL handshake: handshake failed + +--- error_log eval +[qr/SSL_do_handshake\(\) failed .*?tls_early_post_process_client_hello:unsupported protocol/] + +--- no_error_log +[alert] +[emerg] diff --git a/src/deps/src/lua-resty-core/t/ssl-session-fetch.t b/src/deps/src/lua-resty-core/t/ssl-session-fetch.t index 60cbf753c..515b151a3 100644 --- a/src/deps/src/lua-resty-core/t/ssl-session-fetch.t +++ b/src/deps/src/lua-resty-core/t/ssl-session-fetch.t @@ -492,12 +492,15 @@ qr/content_by_lua\(nginx\.conf:\d+\):\d+: CONNECTED/ qr/failed to resume session: failed to de-serialize session|ssl_session_(fetch|store)_by_lua_block:\d+: session id: [a-fA-F\d]+/s --- grep_error_log_out eval [ -qr/^ssl_session_store_by_lua_block:\d+: session id: [a-fA-F\d]+$/s, qr/^ssl_session_fetch_by_lua_block:\d+: session id: [a-fA-F\d]+ failed to resume session: failed to de-serialize session ssl_session_store_by_lua_block:\d+: session id: [a-fA-F\d]+ $/s, -qr/ssl_session_fetch_by_lua_block:\d+: session id: [a-fA-F\d]+ +qr/^ssl_session_fetch_by_lua_block:\d+: session id: [a-fA-F\d]+ +failed to resume session: failed to de-serialize session +ssl_session_store_by_lua_block:\d+: session id: [a-fA-F\d]+ +$/s, +qr/^ssl_session_fetch_by_lua_block:\d+: session id: [a-fA-F\d]+ failed to resume session: failed to de-serialize session ssl_session_store_by_lua_block:\d+: session id: [a-fA-F\d]+ $/s, @@ -507,6 +510,7 @@ $/s, [alert] [emerg] [error] +--- timeout: 5 diff --git a/src/deps/src/lua-resty-core/t/ssl.t b/src/deps/src/lua-resty-core/t/ssl.t index 6f82928ed..e7e612e21 100644 --- a/src/deps/src/lua-resty-core/t/ssl.t +++ b/src/deps/src/lua-resty-core/t/ssl.t @@ -2261,6 +2261,8 @@ qr/subject=\/?C(?\s?=\s?)US(?\/|,\s)ST\kCalifornia\kL\kSan [error] [alert] +--- timeout: 4 + === TEST 22: tls version - TLSv1.3 diff --git a/src/deps/src/lua-resty-core/t/stream/ctx.t b/src/deps/src/lua-resty-core/t/stream/ctx.t index d7f529569..61bae8282 100644 --- a/src/deps/src/lua-resty-core/t/stream/ctx.t +++ b/src/deps/src/lua-resty-core/t/stream/ctx.t @@ -4,7 +4,7 @@ use t::TestCore::Stream; repeat_each(2); -plan tests => repeat_each() * (blocks() * 3 + 2); +plan tests => repeat_each() * (blocks() * 3 + 4); $ENV{TEST_NGINX_HTML_DIR} ||= html_dir(); no_long_string(); @@ -201,3 +201,82 @@ qr/lua release ngx.ctx at ref \d+/ "lua release ngx.ctx at ref 1 lua release ngx.ctx at ref 1 "] + + + +=== TEST 4: ngx.ctx in ssl_client_hello_by_lua +--- stream_config + server { + listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl; + ssl_client_hello_by_lua_block { + ngx.ctx.answer = 42 + ngx.log(ngx.WARN, "ngx.ctx.answer = ", ngx.ctx.answer) + + ngx.ctx.count = 0 + } + ssl_certificate ../../cert/test.crt; + ssl_certificate_key ../../cert/test.key; + + content_by_lua_block { + ngx.say(ngx.ctx.answer) + ngx.ctx.count = ngx.ctx.count + 1 + ngx.say(ngx.ctx.count) + } + } +--- stream_server_config + lua_ssl_trusted_certificate ../../cert/test.crt; + + content_by_lua_block { + do + local sock = ngx.socket.tcp() + + sock:settimeout(3000) + + local function run() + local ok, err = sock:connect("unix:$TEST_NGINX_HTML_DIR/nginx.sock") + if not ok then + ngx.say("failed to connect: ", err) + return + end + + local sess, err = sock:sslhandshake(nil, "test.com", true) + if not sess then + ngx.say("failed to do SSL handshake: ", err) + return + end + + while true do + local line, err = sock:receive() + if not line then + break + end + + ngx.say("received: ", line) + end + + sock:close() + end + + run() + end -- do + -- collectgarbage() + } + +--- stream_response +received: 42 +received: 1 +--- error_log +ngx.ctx.answer = 42 +--- grep_error_log eval +qr/lua release ngx.ctx at ref \d+/ +--- grep_error_log_out eval +["lua release ngx.ctx at ref 2 +lua release ngx.ctx at ref 1 +", +"lua release ngx.ctx at ref 2 +lua release ngx.ctx at ref 1 +lua release ngx.ctx at ref 2 +lua release ngx.ctx at ref 1 +"] +--- no_error_log +[error] diff --git a/src/deps/src/lua-resty-core/t/stream/ssl.t b/src/deps/src/lua-resty-core/t/stream/ssl.t index 033a552d8..10cb6c9cb 100644 --- a/src/deps/src/lua-resty-core/t/stream/ssl.t +++ b/src/deps/src/lua-resty-core/t/stream/ssl.t @@ -1821,6 +1821,7 @@ qr/subject=\/?C(?\s?=\s?)US(?\/|,\s)ST\kCalifornia\kL\kSan --- no_error_log [error] [alert] +--- timeout: 5 diff --git a/src/deps/src/lua-resty-ipmatcher/resty/ipmatcher.lua b/src/deps/src/lua-resty-ipmatcher/resty/ipmatcher.lua index 821f2d4e4..73907a356 100644 --- a/src/deps/src/lua-resty-ipmatcher/resty/ipmatcher.lua +++ b/src/deps/src/lua-resty-ipmatcher/resty/ipmatcher.lua @@ -27,6 +27,10 @@ local AF_INET = 2 local AF_INET6 = 10 if ffi.os == "OSX" then AF_INET6 = 30 +elseif ffi.os == "BSD" then + AF_INET6 = 28 +elseif ffi.os == "Windows" then + AF_INET6 = 23 end diff --git a/src/deps/src/lua-resty-lrucache/.travis.yml b/src/deps/src/lua-resty-lrucache/.travis.yml index 0a4e79630..4b4f0fef6 100644 --- a/src/deps/src/lua-resty-lrucache/.travis.yml +++ b/src/deps/src/lua-resty-lrucache/.travis.yml @@ -1,7 +1,7 @@ # vim:st=2 sts=2 sw=2 et: os: linux -dist: trusty +dist: bionic sudo: false language: c @@ -18,7 +18,7 @@ env: - TEST_NGINX_SLEEP=0.006 - TEST_NGINX_RANDOMIZE=1 matrix: - - NGINX_VERSION=1.19.3 + - NGINX_VERSION=1.19.9 install: - export NGX_BUILD_CC=$CC @@ -42,4 +42,4 @@ install: script: - make lint - - prove -j$JOBS -r t/ + - prove -j$JOBS -I. -r t/ diff --git a/src/deps/src/lua-resty-lrucache/lib/resty/lrucache.lua b/src/deps/src/lua-resty-lrucache/lib/resty/lrucache.lua index e52a6e378..c8f8bdf1d 100644 --- a/src/deps/src/lua-resty-lrucache/lib/resty/lrucache.lua +++ b/src/deps/src/lua-resty-lrucache/lib/resty/lrucache.lua @@ -147,7 +147,8 @@ local mt = { __index = _M } local function ptr2num(ptr) - return tonumber(ffi_cast(uintptr_t, ptr)) + local v = tonumber(ffi_cast(uintptr_t, ptr)) + return v end @@ -165,7 +166,8 @@ function _M.new(size) num_items = 0, max_items = size, } - return setmetatable(self, mt) + setmetatable(self, mt) + return self end diff --git a/src/deps/src/lua-resty-upload/.travis.yml b/src/deps/src/lua-resty-upload/.travis.yml index 2019eca8b..7fcd5f7b6 100644 --- a/src/deps/src/lua-resty-upload/.travis.yml +++ b/src/deps/src/lua-resty-upload/.travis.yml @@ -1,5 +1,5 @@ sudo: required -dist: trusty +dist: bionic os: linux @@ -7,7 +7,6 @@ language: c compiler: - gcc - - clang cache: directories: @@ -25,12 +24,11 @@ env: - OPENSSL_PREFIX=/opt/ssl - OPENSSL_LIB=$OPENSSL_PREFIX/lib - OPENSSL_INC=$OPENSSL_PREFIX/include - - OPENSSL_VER=1.0.2h - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - TEST_NGINX_SLEEP=0.006 matrix: - - NGINX_VERSION=1.9.15 - - NGINX_VERSION=1.11.2 + - NGINX_VERSION=1.17.8 OPENSSL_VER=1.1.0l + - NGINX_VERSION=1.19.9 OPENSSL_VER=1.1.1k install: - if [ ! -d download-cache ]; then mkdir download-cache; fi @@ -42,6 +40,8 @@ install: - git clone https://github.com/openresty/nginx-devel-utils.git - git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module + - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core + - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git - git clone https://github.com/openresty/mockeagain.git @@ -65,4 +65,4 @@ script: - ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --with-cc-opt="-I$OPENSSL_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB" --add-module=../ndk-nginx-module --add-module=../lua-nginx-module --with-debug > build.log 2>&1 || (cat build.log && exit 1) - nginx -V - ldd `which nginx`|grep -E 'luajit|ssl|pcre' - - prove -r t + - prove -I. -r t diff --git a/src/deps/src/lua-resty-upload/README.markdown b/src/deps/src/lua-resty-upload/README.markdown index dcd1ba2eb..0fb69b457 100644 --- a/src/deps/src/lua-resty-upload/README.markdown +++ b/src/deps/src/lua-resty-upload/README.markdown @@ -41,7 +41,7 @@ Synopsis ======== ```lua - lua_package_path "/path/to/lua-resty-redis/lib/?.lua;;"; + lua_package_path "/path/to/lua-resty-upload/lib/?.lua;;"; server { location /test { @@ -161,10 +161,23 @@ not want to save the data on local file systems. [Back to TOC](#table-of-contents) +Usage +===== + +```lua +local upload = require "resty.upload" +local form, err = upload:new(self, chunk_size, max_line_size, preserve_body) +``` +`chunk_size` defaults to 4096. It is the size used to read data from the socket. + +`max_line_size` defaults to 512. It is the size limit to read the chunked body header. + +By Default, `lua-resty-upload` will consume the request body. For proxy mode this means upstream will not see the body. When `preserve_body` is set to true, the request body will be preserved. Note that this option is not free. When enabled, it will double the memory usage of `resty.upload`. + Author ====== -Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. +Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. [Back to TOC](#table-of-contents) @@ -173,7 +186,7 @@ Copyright and License This module is licensed under the BSD license. -Copyright (C) 2012-2016, by Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. +Copyright (C) 2012-2017, by Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. All rights reserved. diff --git a/src/deps/src/lua-resty-upload/lib/resty/upload.lua b/src/deps/src/lua-resty-upload/lib/resty/upload.lua index 37da961dc..7a6c80567 100644 --- a/src/deps/src/lua-resty-upload/lib/resty/upload.lua +++ b/src/deps/src/lua-resty-upload/lib/resty/upload.lua @@ -7,6 +7,9 @@ local match = string.match local setmetatable = setmetatable local type = type local ngx_var = ngx.var +local ngx_init_body = ngx.req.init_body +local ngx_finish_body = ngx.req.finish_body +local ngx_append_body = ngx.req.append_body -- local print = print @@ -21,11 +24,57 @@ local STATE_READING_HEADER = 2 local STATE_READING_BODY = 3 local STATE_EOF = 4 - local mt = { __index = _M } local state_handlers +local function wrapped_receiveuntil(self, until_str) + local iter, err_outer = self:old_receiveuntil(until_str) + if iter == nil then + ngx_finish_body() + end + + local function wrapped(size) + local ret, err = iter(size) + if ret then + ngx_append_body(ret) + end + + -- non-nil ret for call with no size or successful size call and nil ret + if (not size and ret) or (size and not ret and not err) then + ngx_append_body(until_str) + end + return ret, err + end + + return wrapped, err_outer +end + + +local function wrapped_receive(self, arg) + local ret, err, partial = self:old_receive(arg) + if ret then + ngx_append_body(ret) + + elseif partial then + ngx_append_body(partial) + end + + if ret == nil then + ngx_finish_body() + end + + return ret, err +end + + +local function req_socket_body_collector(sock) + sock.old_receiveuntil = sock.receiveuntil + sock.old_receive = sock.receive + sock.receiveuntil = wrapped_receiveuntil + sock.receive = wrapped_receive +end + local function get_boundary() local header = ngx_var.content_type @@ -46,7 +95,7 @@ local function get_boundary() end -function _M.new(self, chunk_size, max_line_size) +function _M.new(self, chunk_size, max_line_size, preserve_body) local boundary = get_boundary() -- print("boundary: ", boundary) @@ -62,6 +111,11 @@ function _M.new(self, chunk_size, max_line_size) return nil, err end + if preserve_body then + ngx_init_body(chunk_size) + req_socket_body_collector(sock) + end + local read2boundary, err = sock:receiveuntil("--" .. boundary) if not read2boundary then return nil, err @@ -79,7 +133,8 @@ function _M.new(self, chunk_size, max_line_size) read2boundary = read2boundary, read_line = read_line, boundary = boundary, - state = STATE_BEGIN + state = STATE_BEGIN, + preserve_body = preserve_body }, mt) end @@ -104,6 +159,10 @@ local function discard_line(self) local dummy, err = read_line(1) if dummy then + if self.preserve_body then + ngx_finish_body() + end + return nil, "line too long: " .. line .. dummy .. "..." end @@ -179,6 +238,10 @@ local function read_header(self) local dummy, err = read_line(1) if dummy then + if self.preserve_body then + ngx_finish_body() + end + return nil, nil, "line too long: " .. line .. dummy .. "..." end diff --git a/src/deps/src/lua-resty-upload/t/sanity.t b/src/deps/src/lua-resty-upload/t/sanity.t index 6521a92d9..9fac009b0 100644 --- a/src/deps/src/lua-resty-upload/t/sanity.t +++ b/src/deps/src/lua-resty-upload/t/sanity.t @@ -648,3 +648,125 @@ read: ["eof"] --- no_error_log [error] + + +=== TEST 11: body preserve off +--- http_config eval: $::HttpConfig +--- config + location /t { + content_by_lua ' + local upload = require "resty.upload" + local ljson = require "ljson" + + local form = upload:new(5) + + form:set_timeout(1000) -- 1 sec + + while true do + local typ, res, err = form:read() + if not typ then + ngx.say("failed to read: ", err) + return + end + + ngx.say("read: ", ljson.encode({typ, res})) + + if typ == "eof" then + break + end + end + + local typ, res, err = form:read() + ngx.say("read: ", ljson.encode({typ, res})) + + ngx.say("remain body: ", ngx.req.get_body_data(), ",", ngx.req.get_body_file()) + '; + } +--- more_headers +Content-Type: multipart/form-data; boundary=---------------------------820127721219505131303151179 +--- request eval +qq{POST /t\n-----------------------------820127721219505131303151179\r +Content-Disposition: form-data; name="file1"; filename="a.txt"\r +Content-Type: text/plain\r +\r +Hello, world\r\n-----------------------------820127721219505131303151179\r +Content-Disposition: form-data; name="test"\r +\r +value\r +\r\n-----------------------------820127721219505131303151179--\r +} +--- response_body +read: ["header",["Content-Disposition","form-data; name=\"file1\"; filename=\"a.txt\"","Content-Disposition: form-data; name=\"file1\"; filename=\"a.txt\""]] +read: ["header",["Content-Type","text/plain","Content-Type: text/plain"]] +read: ["body","Hello"] +read: ["body",", wor"] +read: ["body","ld"] +read: ["part_end"] +read: ["header",["Content-Disposition","form-data; name=\"test\"","Content-Disposition: form-data; name=\"test\""]] +read: ["body","value"] +read: ["body","\r\n"] +read: ["part_end"] +read: ["eof"] +read: ["eof"] +remain body: nil,nil +--- no_error_log +[error] + + + +=== TEST 12: body preserve on +--- http_config eval: $::HttpConfig +--- config + location /t { + content_by_lua ' + local original_len = ngx.req.get_headers()["Content-Length"] + local upload = require "resty.upload" + + local form = upload:new(5, nil, true) + + form:set_timeout(1000) -- 1 sec + + while true do + local typ, res, err = form:read() + if not typ then + ngx.say("failed to read: ", err) + return + end + + if typ == "eof" then + break + end + end + + local typ, res, err = form:read() + + local body = ngx.req.get_body_data() + local new_len + if body then + new_len = #body + else + new_len = io.open(ngx.req.get_body_file(), "r"):seek("end") + end + ngx.say("content_length: ", original_len) + ngx.say("remain body length: ", new_len) + '; + } +--- more_headers +Content-Type: multipart/form-data; boundary=---------------------------820127721219505131303151179 +--- request eval +qq{POST /t\n-----------------------------820127721219505131303151179\r +Content-Disposition: form-data; name="file1"; filename="a.txt"\r +Content-Type: text/plain\r +\r +Hello, world\r\n-----------------------------820127721219505131303151179\r +Content-Disposition: form-data; name="test"\r +\r +value\r +\r\n-----------------------------820127721219505131303151179--\r +} +--- response_body +content_length: 336 +remain body length: 336 + +--- no_error_log +[error] diff --git a/src/deps/src/lua-resty-upload/valgrind.suppress b/src/deps/src/lua-resty-upload/valgrind.suppress index 14d92de0f..5ead2a60e 100644 --- a/src/deps/src/lua-resty-upload/valgrind.suppress +++ b/src/deps/src/lua-resty-upload/valgrind.suppress @@ -87,21 +87,6 @@ fun:ngx_calloc fun:ngx_event_process_init } -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_malloc - fun:ngx_pcalloc -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:(below main) -} { Memcheck:Param @@ -129,14 +114,6 @@ fun:ngx_log_error_core fun:ngx_http_charset_header_filter } -{ - - Memcheck:Leak - fun:memalign - fun:posix_memalign - fun:ngx_memalign - fun:ngx_pcalloc -} { Memcheck:Param @@ -144,13 +121,6 @@ fun:setsockopt fun:drizzle_state_connect } -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_palloc_large -} { Memcheck:Leak @@ -158,13 +128,6 @@ fun:ngx_alloc fun:ngx_pool_cleanup_add } -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_pnalloc -} { Memcheck:Cond @@ -172,53 +135,6 @@ fun:ngx_single_process_cycle fun:main } - -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_palloc -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_pcalloc -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_malloc - fun:ngx_palloc_large -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_create_pool -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_malloc - fun:ngx_palloc -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_malloc - fun:ngx_pnalloc -} - { Memcheck:Leak @@ -235,7 +151,6 @@ fun:ngx_init_cycle fun:main } - { Memcheck:Leak @@ -430,23 +345,6 @@ fun:ngx_init_cycle fun:main } -{ - - Memcheck:Leak - fun:memalign - fun:posix_memalign - fun:ngx_memalign - fun:ngx_create_pool -} -{ - - Memcheck:Leak - fun:memalign - fun:posix_memalign - fun:ngx_memalign - fun:ngx_palloc_block - fun:ngx_palloc -} { Memcheck:Cond @@ -460,3 +358,22 @@ fun:_dl_sysdep_start fun:_dl_start } +{ + + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:ngx_alloc + fun:ngx_set_environment + fun:ngx_single_process_cycle +} +{ + + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:ngx_alloc + fun:ngx_set_environment + fun:ngx_worker_process_init + fun:ngx_worker_process_cycle +} diff --git a/src/deps/src/luajit2/COPYRIGHT b/src/deps/src/luajit2/COPYRIGHT index 14f5df255..463e59777 100644 --- a/src/deps/src/luajit2/COPYRIGHT +++ b/src/deps/src/luajit2/COPYRIGHT @@ -1,7 +1,7 @@ =============================================================================== LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/ -Copyright (C) 2005-2021 Mike Pall. All rights reserved. +Copyright (C) 2005-2022 Mike Pall. All rights reserved. Copyright (C) 2017-2018 Yichun Zhang. All rights reserved. diff --git a/src/deps/src/luajit2/Makefile b/src/deps/src/luajit2/Makefile index 2b445a78a..e3e368ea9 100644 --- a/src/deps/src/luajit2/Makefile +++ b/src/deps/src/luajit2/Makefile @@ -10,7 +10,7 @@ # For MSVC, please follow the instructions given in src/msvcbuild.bat. # For MinGW and Cygwin, cd to src and run make with the Makefile there. # -# Copyright (C) 2005-2021 Mike Pall. See Copyright Notice in luajit.h +# Copyright (C) 2005-2022 Mike Pall. See Copyright Notice in luajit.h ############################################################################## MAJVER= 2 @@ -33,7 +33,8 @@ DPREFIX= $(DESTDIR)$(PREFIX) INSTALL_BIN= $(DPREFIX)/bin INSTALL_LIB= $(DPREFIX)/$(MULTILIB) INSTALL_SHARE= $(DPREFIX)/share -INSTALL_INC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER) +INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER) +INSTALL_INC= $(INSTALL_DEFINC) INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(VERSION) INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit @@ -78,6 +79,9 @@ UNINSTALL= $(RM) LDCONFIG= ldconfig -n 2>/dev/null SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \ -e "s|^multilib=.*|multilib=$(MULTILIB)|" +ifneq ($(INSTALL_DEFINC),$(INSTALL_INC)) + SED_PC+= -e "s|^includedir=.*|includedir=$(INSTALL_INC)|" +endif FILE_T= luajit FILE_A= libluajit.a diff --git a/src/deps/src/luajit2/README b/src/deps/src/luajit2/README index c9f7d9ad9..1faef2559 100644 --- a/src/deps/src/luajit2/README +++ b/src/deps/src/luajit2/README @@ -5,7 +5,7 @@ LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. Project Homepage: https://luajit.org/ -LuaJIT is Copyright (C) 2005-2021 Mike Pall. +LuaJIT is Copyright (C) 2005-2022 Mike Pall. LuaJIT is free software, released under the MIT license. See full Copyright Notice in the COPYRIGHT file or in luajit.h. diff --git a/src/deps/src/luajit2/doc/bluequad-print.css b/src/deps/src/luajit2/doc/bluequad-print.css index 0b385cee4..a49d309ff 100644 --- a/src/deps/src/luajit2/doc/bluequad-print.css +++ b/src/deps/src/luajit2/doc/bluequad-print.css @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2021 Mike Pall. +/* Copyright (C) 2004-2022 Mike Pall. * * You are welcome to use the general ideas of this design for your own sites. * But please do not steal the stylesheet, the layout or the color scheme. diff --git a/src/deps/src/luajit2/doc/bluequad.css b/src/deps/src/luajit2/doc/bluequad.css index 86cd9ac0d..4c1a9082e 100644 --- a/src/deps/src/luajit2/doc/bluequad.css +++ b/src/deps/src/luajit2/doc/bluequad.css @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2021 Mike Pall. +/* Copyright (C) 2004-2022 Mike Pall. * * You are welcome to use the general ideas of this design for your own sites. * But please do not steal the stylesheet, the layout or the color scheme. diff --git a/src/deps/src/luajit2/doc/contact.html b/src/deps/src/luajit2/doc/contact.html index c253a08be..19f7d2943 100644 --- a/src/deps/src/luajit2/doc/contact.html +++ b/src/deps/src/luajit2/doc/contact.html @@ -3,7 +3,7 @@ Contact - + @@ -50,8 +50,6 @@
  • FAQ
  • -Wiki » -
  • Mailing List »
  • @@ -89,7 +87,7 @@ xD("fyZKB8xv\"FJytmz8.KAB0u52D")

    Copyright

    All documentation is -Copyright © 2005-2021 Mike Pall. +Copyright © 2005-2022 Mike Pall.

    @@ -97,7 +95,7 @@ Copyright © 2005-2021 Mike Pall. @@ -86,7 +84,7 @@ overhead. In conjunction with the FFI library, they allow zero-copy operations.

    -The string buffer libary also includes a high-performance +The string buffer library also includes a high-performance serializer for Lua objects.

    @@ -434,8 +432,8 @@ unsupported object types, circular references or deeply nested tables.

    obj = buffer.decode(str)
    obj = buf:decode()

    -The stand-alone function de-serializes (decodes) the string -str, the buffer method de-serializes one object from the +The stand-alone function deserializes (decodes) the string +str, the buffer method deserializes one object from the buffer. Both return a Lua object obj.

    @@ -448,6 +446,10 @@ encoded data. The stand-alone function throws when there's left-over data after decoding a single top-level object. The buffer method leaves any left-over data in the buffer.

    +

    +Attempting to deserialize an FFI type will throw an error, if the FFI +library is not built-in or has not been loaded, yet. +

    Serialization Options

    @@ -458,7 +460,7 @@ the following members (all optional):

  • dict is a Lua table holding a dictionary of strings that commonly occur as table keys of objects you are serializing. These keys -are compactly encoded as indexes during serialization. A well chosen +are compactly encoded as indexes during serialization. A well-chosen dictionary saves space and improves serialization performance.
  • @@ -469,7 +471,7 @@ for the table objects you are serializing.

    dict needs to be an array of strings and metatable needs to be an array of tables. Both starting at index 1 and without holes (no -nil inbetween). The tables are anchored in the buffer object and +nil in between). The tables are anchored in the buffer object and internally modified into a two-way index (don't do this yourself, just pass a plain array). The tables must not be modified after they have been passed to buffer.new(). @@ -620,7 +622,7 @@ errors are best caught with an outer wrapper for larger parts of code. There's not much one can do after that, anyway.

    -OTOH you may want to catch some errors individually. Buffer methods need +OTOH, you may want to catch some errors individually. Buffer methods need to receive the buffer object as the first argument. The Lua colon-syntax obj:method() does that implicitly. But to wrap a method with pcall(), the arguments need to be passed like this: @@ -683,7 +685,7 @@ mappings of files are OK, but only if the file does not change.

  • FAQ
  • -Wiki » -
  • Mailing List »
  • @@ -107,7 +105,7 @@ Turn the whole JIT compiler on or off or flush the whole cache of compiled code. This sets the mode for the function at the stack index idx or the parent of the calling function (idx = 0). It either enables JIT compilation for a function, disables it and flushes any -already compiled code or only flushes already compiled code. This +already compiled code, or only flushes already compiled code. This applies recursively to all sub-functions of the function with LUAJIT_MODE_ALLFUNC or only to the sub-functions with LUAJIT_MODE_ALLSUBFUNC. @@ -126,7 +124,7 @@ traces which link to it. This mode defines a wrapper function for calls to C functions. If called with LUAJIT_MODE_ON, the stack index at idx must be a lightuserdata object holding a pointer to the wrapper -function. From now on all C functions are called through the wrapper +function. From now on, all C functions are called through the wrapper function. If called with LUAJIT_MODE_OFF this mode is turned off and all C functions are directly called.

    @@ -175,7 +173,7 @@ Also note that this mechanism is not without overhead. @@ -157,7 +155,7 @@ call the binding function. Phew!

    Motivating Example: Using C Data Structures

    The FFI library allows you to create and access C data -structures. Of course the main use for this is for interfacing with +structures. Of course, the main use for this is for interfacing with C functions. But they can be used stand-alone, too.

    @@ -169,7 +167,7 @@ implemented with a big table holding lots of tiny tables. This imposes both a substantial memory overhead as well as a performance overhead.

    -Here's a sketch of a library that operates on color images plus a +Here's a sketch of a library that operates on color images, plus a simple benchmark. First, the plain Lua version:

    @@ -184,7 +182,7 @@ local function image_ramp_green(n)
       return img
     end
     
    -local function image_to_grey(img, n)
    +local function image_to_gray(img, n)
       for i=1,n do
         local y = floor(0.3*img[i].red + 0.59*img[i].green + 0.11*img[i].blue)
         img[i].red = y; img[i].green = y; img[i].blue = y
    @@ -194,14 +192,14 @@ end
     local N = 400*400
     local img = image_ramp_green(N)
     for i=1,1000 do
    -  image_to_grey(img, N)
    +  image_to_gray(img, N)
     end
     

    This creates a table with 160.000 pixels, each of which is a table -holding four number values in the range of 0-255. First an image with +holding four number values in the range of 0-255. First, an image with a green ramp is created (1D for simplicity), then the image is -converted to greyscale 1000 times. Yes, that's silly, but I was in +converted to grayscale 1000 times. Yes, that's silly, but I was in need of a simple example ...

    @@ -308,7 +306,7 @@ be more compact and faster. This is certainly true (by a factor of ~1.7x). Switching to a struct-of-arrays would help, too.

    -However the resulting code would be less idiomatic and rather +However, the resulting code would be less idiomatic and rather error-prone. And it still doesn't get even close to the performance of the FFI version of the code. Also, high-level data structures cannot be easily passed to other C functions, especially I/O functions, @@ -318,7 +316,7 @@ without undue conversion penalties.

    @@ -121,7 +119,7 @@ separated by semicolons. The trailing semicolon for a single declaration may be omitted.

    -Please note that external symbols are only declared, but they +Please note, that external symbols are only declared, but they are not bound to any specific address, yet. Binding is achieved with C library namespaces (see below).

    @@ -209,7 +207,7 @@ parse the cdecl only once and get its ctype with ffi.typeof(). Then use the ctype as a constructor repeatedly.

    -Please note that an anonymous struct declaration implicitly +Please note, that an anonymous struct declaration implicitly creates a new and distinguished ctype every time you use it for ffi.new(). This is probably not what you want, especially if you create more than one cdata object. Different anonymous @@ -256,12 +254,12 @@ afterwards. Neither the contents of the metatable nor the contents of an __index table (if any) may be modified afterwards. The associated metatable automatically applies to all uses of this type, no matter how the objects are created or where they -originate from. Note that pre-defined operations on types have +originate from. Note that predefined operations on types have precedence (e.g. declared field names cannot be overridden).

    All standard Lua metamethods are implemented. These are called directly, -without shortcuts and on any mix of types. For binary operations, the +without shortcuts, and on any mix of types. For binary operations, the left operand is checked first for a valid ctype metamethod. The __gc metamethod only applies to struct/union types and performs an implicit ffi.gc() @@ -492,7 +490,7 @@ have some extra methods:

    Free the resources associated with a callback. The associated Lua function is unanchored and may be garbage collected. The callback -function pointer is no longer valid and must not be called anymore +function pointer is no longer valid and must not be called again (it may be reused by a subsequently created callback).

    @@ -558,7 +556,7 @@ named i. @@ -88,7 +86,7 @@ footprint. It's used by the ffi.* library functions to declare C types or external symbols.

    -It's only purpose is to parse C declarations, as found e.g. in +Its only purpose is to parse C declarations, as found e.g. in C header files. Although it does evaluate constant expressions, it's not a C compiler. The body of inline C function definitions is simply ignored. @@ -165,7 +163,7 @@ function declarations.

    -The following C types are pre-defined by the C parser (like +The following C types are predefined by the C parser (like a typedef, except re-declarations will be ignored):

      @@ -583,9 +581,9 @@ ffi.new("struct nested", {x=1,y={2,3}}) --> x = 1, y.a = 2, y.b = 3

      Operations on cdata Objects

      -All of the standard Lua operators can be applied to cdata objects or a +All standard Lua operators can be applied to cdata objects or a mix of a cdata object and another Lua object. The following list shows -the pre-defined operations. +the predefined operations.

      Reference types are dereferenced before performing each of @@ -593,7 +591,7 @@ the operations below — the operation is applied to the C type pointed to by the reference.

      -The pre-defined operations are always tried first before deferring to a +The predefined operations are always tried first before deferring to a metamethod or index table (if any) for the corresponding ctype (except for __new). An error is raised if the metamethod lookup or index table lookup fails. @@ -643,7 +641,7 @@ assigning to an index of a vector raises an error.

    A ctype object can be indexed with a string key, too. The only -pre-defined operation is reading scoped constants of +predefined operation is reading scoped constants of struct/union types. All other accesses defer to the corresponding metamethods or index tables (if any).

    @@ -656,7 +654,7 @@ certain optimizations.

    As a consequence, the elements of complex numbers and vectors are immutable. But the elements of an aggregate holding these -types may be modified of course. I.e. you cannot assign to +types may be modified, of course. I.e. you cannot assign to foo.c.im, but you can assign a (newly created) complex number to foo.c.

    @@ -675,8 +673,8 @@ through unions is explicitly detected and allowed. to ffi.new(ct, ...), unless a __new metamethod is defined. The __new metamethod is called with the ctype object plus any other arguments passed to the constructor. Note that you have to -use ffi.new inside of it, since calling ct(...) would -cause infinite recursion. +use ffi.new inside the metamethod, since calling ct(...) +would cause infinite recursion.
  • C function call: a cdata function or cdata function pointer can be called. The passed arguments are @@ -687,7 +685,7 @@ variable argument part of vararg C function use C function is called and the return value (if any) is converted to a Lua object.
    On Windows/x86 systems, __stdcall functions are automatically -detected and a function declared as __cdecl (the default) is +detected, and a function declared as __cdecl (the default) is silently fixed up after the first call.
  • @@ -697,7 +695,7 @@ silently fixed up after the first call.
  • Pointer arithmetic: a cdata pointer/array and a cdata number or a Lua number can be added or subtracted. The number must be -on the right hand side for a subtraction. The result is a pointer of +on the right-hand side for a subtraction. The result is a pointer of the same type with an address plus or minus the number value multiplied by the element size in bytes. An error is raised if the element size is undefined.
  • @@ -712,7 +710,7 @@ operators (+ - * / % ^ and unary minus) can be applied to two cdata numbers, or a cdata number and a Lua number. If one of them is an uint64_t, the other side is converted to an uint64_t and an unsigned arithmetic operation -is performed. Otherwise both sides are converted to an +is performed. Otherwise, both sides are converted to an int64_t and a signed arithmetic operation is performed. The result is a boxed 64 bit cdata object.
    @@ -759,7 +757,7 @@ which is compatible with any other pointer type.
  • 64 bit integer comparison: two cdata numbers, or a cdata number and a Lua number can be compared with each other. If one of them is an uint64_t, the other side is converted to an -uint64_t and an unsigned comparison is performed. Otherwise +uint64_t and an unsigned comparison is performed. Otherwise, both sides are converted to an int64_t and a signed comparison is performed.
    @@ -784,9 +782,9 @@ keys! A cdata object is treated like any other garbage-collected object and is hashed and compared by its address for table indexing. Since there's no interning for cdata value types, the same value may be -boxed in different cdata objects with different addresses. Thus +boxed in different cdata objects with different addresses. Thus, t[1LL+1LL] and t[2LL] usually do not point to -the same hash slot and they certainly do not point to the same +the same hash slot, and they certainly do not point to the same hash slot as t[2].

    @@ -808,7 +806,7 @@ the resulting Lua number as a key when indexing tables.
    One obvious benefit: t[tonumber(2LL)] does point to the same slot as t[2].

  • -
  • Otherwise use either tostring() on 64 bit integers +
  • Otherwise, use either tostring() on 64 bit integers or complex numbers or combine multiple fields of a cdata aggregate to a Lua string (e.g. with ffi.string()). Then @@ -816,7 +814,7 @@ use the resulting Lua string as a key when indexing tables.
  • Create your own specialized hash table implementation using the C types provided by the FFI library, just like you would in -C code. Ultimately this may give much better performance than the +C code. Ultimately, this may give much better performance than the other alternatives or what a generic by-value hash table could possibly provide.
  • @@ -882,7 +880,7 @@ garbage collector will automatically free the memory used by it (at the end of the next GC cycle).

    -Please note that pointers themselves are cdata objects, however they +Please note, that pointers themselves are cdata objects, however they are not followed by the garbage collector. So e.g. if you assign a cdata array to a pointer, you must keep the cdata object holding the array alive as long as the pointer is still in use: @@ -931,18 +929,18 @@ of the function pointer and the Lua function object (closure).

    This can happen implicitly due to the usual conversions, e.g. when -passing a Lua function to a function pointer argument. Or you can use +passing a Lua function to a function pointer argument. Or, you can use ffi.cast() to explicitly cast a Lua function to a C function pointer.

    -Currently only certain C function types can be used as callback +Currently, only certain C function types can be used as callback functions. Neither C vararg functions nor functions with pass-by-value aggregate argument or result types are supported. There -are no restrictions for the kind of Lua functions that can be called +are no restrictions on the kind of Lua functions that can be called from the callback — no checks for the proper number of arguments are made. The return value of the Lua function will be converted to the -result type and an error will be thrown for invalid conversions. +result type, and an error will be thrown for invalid conversions.

    It's allowed to throw errors across a callback invocation, but it's not @@ -1003,7 +1001,7 @@ convention cannot be automatically detected, unlike for __stdcall calls to Windows functions.

    -For some use cases it's necessary to free up the resources or to +For some use cases, it's necessary to free up the resources or to dynamically redirect callbacks. Use an explicit cast to a C function pointer and keep the resulting cdata object. Then use the cb:free() @@ -1056,7 +1054,7 @@ GUI application, which waits for user input most of the time, anyway.

    For new designs avoid push-style APIs: a C function repeatedly -calling a callback for each result. Instead use pull-style APIs: +calling a callback for each result. Instead, use pull-style APIs: call a C function repeatedly to get a new result. Calls from Lua to C via the FFI are much faster than the other way round. Most well-designed libraries already use pull-style APIs (read/write, get/put). @@ -1075,7 +1073,7 @@ function.

    Indexing a C library namespace object with a symbol name (a Lua -string) automatically binds it to the library. First the symbol type +string) automatically binds it to the library. First, the symbol type is resolved — it must have been declared with ffi.cdef. Then the symbol address is resolved by searching for the symbol name in the @@ -1130,7 +1128,7 @@ Performance notice: the JIT compiler specializes to the identity of namespace objects and to the strings used to index it. This effectively turns function cdata objects into constants. It's not useful and actually counter-productive to explicitly cache these -function objects, e.g. local strlen = ffi.C.strlen. OTOH it +function objects, e.g. local strlen = ffi.C.strlen. OTOH, it is useful to cache the namespace itself, e.g. local C = ffi.C.

    @@ -1155,14 +1153,14 @@ This behavior is inevitable, since the goal is to provide full interoperability with C code. Adding extra safety measures, like bounds checks, would be futile. There's no way to detect misdeclarations of C functions, since shared libraries only -provide symbol names, but no type information. Likewise there's no way +provide symbol names, but no type information. Likewise, there's no way to infer the valid range of indexes for a returned pointer.

    Again: the FFI library is a low-level library. This implies it needs to be used with care, but it's flexibility and performance often outweigh this concern. If you're a C or C++ developer, it'll be easy -to apply your existing knowledge. OTOH writing code for the FFI +to apply your existing knowledge. OTOH, writing code for the FFI library is not for the faint of heart and probably shouldn't be the first exercise for someone with little experience in Lua, C or C++.

    @@ -1190,7 +1188,7 @@ currently incomplete:
  • C declarations are not passed through a C pre-processor, yet.
  • The C parser is able to evaluate most constant expressions -commonly found in C header files. However it doesn't handle the +commonly found in C header files. However, it doesn't handle the full range of C expression semantics and may fail for some obscure constructs.
  • static const declarations only work for integer types @@ -1248,7 +1246,7 @@ compiled.
  • @@ -85,7 +83,7 @@ of its functions: local ffi = require("ffi")

    -Please note this doesn't define an ffi variable in the table +Please note, this doesn't define an ffi variable in the table of globals — you really need to use the local variable. The require function ensures the library is only loaded once.

    @@ -194,7 +192,7 @@ don't need to declare them as such. The poll() function takes a couple more arguments we're not going to use. You can simply use nil to pass a NULL pointer and 0 -for the nfds parameter. Please note that the +for the nfds parameter. Please note, that the number 0 does not convert to a pointer value, unlike in C++. You really have to pass pointers to pointer arguments and numbers to number arguments. @@ -291,12 +289,12 @@ Here's the step-by-step explanation:

    This defines some of the C functions provided by zlib. For the sake of this example, some -type indirections have been reduced and it uses the pre-defined +type indirections have been reduced and it uses the predefined fixed-size integer types, while still adhering to the zlib API/ABI.

    This loads the zlib shared -library. On POSIX systems it's named libz.so and usually +library. On POSIX systems, it's named libz.so and usually comes pre-installed. Since ffi.load() automatically adds any missing standard prefixes/suffixes, we can simply load the "z" library. On Windows it's named zlib1.dll and @@ -324,7 +322,7 @@ actual length that was used.

    In C you'd pass in the address of a local variable (&buflen). But since there's no address-of operator in -Lua, we'll just pass in a one-element array. Conveniently it can be +Lua, we'll just pass in a one-element array. Conveniently, it can be initialized with the maximum buffer size in one step. Calling the actual zlib.compress2 function is then straightforward.

    @@ -348,7 +346,7 @@ for garbage collection and string interning. The uncompress functions does the exact opposite of the compress function. The compressed data doesn't include the size of the original string, -so this needs to be passed in. Otherwise no surprises here. +so this needs to be passed in. Otherwise, no surprises here.

    The code, that makes use @@ -382,7 +380,7 @@ Ok, so the ffi.* functions generally accept cdata objects wherever you'd want to use a number. That's why we get a away with passing n to ffi.string() above. But other Lua library functions or modules don't know how to deal with this. So for -maximum portability one needs to use tonumber() on returned +maximum portability, one needs to use tonumber() on returned long results before passing them on. Otherwise the application might work on some systems, but would fail in a POSIX/x64 environment. @@ -454,7 +452,7 @@ the origin.

    If we run out of operators, we can -define named methods, too. Here the __index table defines an +define named methods, too. Here, the __index table defines an area function. For custom indexing needs, one might want to define __index and __newindex functions instead.

    @@ -468,13 +466,13 @@ be used e.g. to create an array of points. The metamethods automatically apply to any and all uses of this type.

    -Please note that the association with a metatable is permanent and +Please note, that the association with a metatable is permanent and the metatable must not be modified afterwards! Ditto for the __index table.

    Here are some simple usage examples -for the point type and their expected results. The pre-defined +for the point type and their expected results. The predefined operations (such as a.x) can be freely mixed with the newly defined metamethods. Note that area is a method and must be called with the Lua syntax for methods: a:area(), not @@ -483,7 +481,7 @@ called with the Lua syntax for methods: a:area(), not

    The C type metamethod mechanism is most useful when used in conjunction with C libraries that are written in an object-oriented -style. Creators return a pointer to a new instance and methods take an +style. Creators return a pointer to a new instance, and methods take an instance pointer as the first argument. Sometimes you can just point __index to the library namespace and __gc to the destructor and you're done. But often enough you'll want to add @@ -569,7 +567,7 @@ end

    This turns them into indirect calls and generates bigger and slower -machine code. Instead you'll want to cache the namespace itself and +machine code. Instead, you'll want to cache the namespace itself and rely on the JIT compiler to eliminate the lookups:

    @@ -589,7 +587,7 @@ it to a local variable in the function scope is unnecessary.
     
     
    @@ -154,7 +152,7 @@ Contains the target architecture name:
     
     

    jit.opt.* — JIT compiler optimization control

    -This sub-module provides the backend for the -O command line +This submodule provides the backend for the -O command line option.

    @@ -174,7 +172,7 @@ which was one of the ways to enable optimization.

    jit.util.* — JIT compiler introspection

    -This sub-module holds functions to introspect the bytecode, generated +This submodule holds functions to introspect the bytecode, generated traces, the IR and the generated machine code. The functionality provided by this module is still in flux and therefore undocumented.

    @@ -187,7 +185,7 @@ if you want to know more. @@ -158,7 +156,7 @@ To see how much time is spent in different VM states or Combinations of v/z with f/F/l produce two-level views, e.g. -jp=vf or -jp=fv. This shows the time spent in a VM state or zone vs. hotspots. This can be used to answer -questions like "Which time consuming functions are only interpreted?" or +questions like "Which time-consuming functions are only interpreted?" or "What's the garbage collector overhead for a specific function?".

    @@ -217,7 +215,7 @@ local profile = require("jit.profile") This module can be used to implement your own higher-level profiler. A typical profiling run starts the profiler, captures stack dumps in the profiler callback, adds them to a hash table to aggregate the number -of samples, stops the profiler and then analyzes all of the captured +of samples, stops the profiler and then analyzes all captured stack dumps. Other parameters can be sampled in the profiler callback, too. But it's important not to spend too much time in the callback, since this may skew the statistics. @@ -271,9 +269,9 @@ returns a string with a stack dump for the thread (coroutine), formatted according to the fmt argument:

      -
    • p — Preserve the full path for module names. Otherwise +
    • p — Preserve the full path for module names. Otherwise, only the file name is used.
    • -
    • f — Dump the function name if it can be derived. Otherwise +
    • f — Dump the function name if it can be derived. Otherwise, use module:line.
    • F — Ditto, but dump module:name.
    • l — Dump module:line.
    • @@ -351,7 +349,7 @@ use.
    @@ -88,7 +86,7 @@ or LuaJIT.

    LuaJIT extends the standard Lua VM with new functionality and adds -several extension modules. Please note this page is only about +several extension modules. Please note, this page is only about functional enhancements and not about performance enhancements, such as the optimized VM, the faster interpreter or the JIT compiler.

    @@ -197,7 +195,7 @@ usage. See also the

    The generated bytecode is portable and can be loaded on any architecture -that LuaJIT supports, independent of word size or endianess. However the +that LuaJIT supports, independent of word size or endianess. However, the bytecode compatibility versions must match. Bytecode stays compatible for dot releases (x.y.0 → x.y.1), but may change with major or minor releases (2.0 → 2.1) or between any beta release. Foreign @@ -229,7 +227,7 @@ avoids managing backlinks, saves an allocation and the overhead of incremental array/hash part growth.

    -Please note this function is meant for very specific situations. In most +Please note, this function is meant for very specific situations. In most cases it's better to replace the (usually single) link with a new table and let the GC do its work.

    @@ -239,7 +237,7 @@ and let the GC do its work. LuaJIT uses a Tausworthe PRNG with period 2^223 to implement math.random() and math.randomseed(). The quality of the PRNG results is much superior compared to the standard Lua -implementation which uses the platform-specific ANSI rand(). +implementation, which uses the platform-specific ANSI rand().

    The PRNG generates the same sequences from the same seeds on all @@ -257,7 +255,7 @@ Important: Neither this nor any other PRNG based on the simplistic

    io.* functions handle 64 bit file offsets

    The file I/O functions in the standard io.* library handle -64 bit file offsets. In particular this means it's possible +64 bit file offsets. In particular, this means it's possible to open files larger than 2 Gigabytes and to reposition or obtain the current file position for offsets beyond 2 GB (fp:seek() method). @@ -464,7 +462,7 @@ C++ destructors.

    @@ -65,8 +63,6 @@ dd { margin-left: 1.5em; }
    • The » LuaJIT mailing list focuses on topics related to LuaJIT.
    • -
    • The » LuaJIT wiki gathers community -resources about LuaJIT.
    • News about Lua itself can be found at the » Lua mailing list. The mailing list archives are worth checking out for older postings @@ -120,7 +116,7 @@ Direct3D version 10 or higher do not show this behavior anymore. Consider testing your application with older versions, too.
      Similarly, the Borland/Delphi runtime modifies the FPU control word and -enables FP exceptions. Of course this violates the Windows ABI, too. +enables FP exceptions. Of course, this violates the Windows ABI, too. Please check the Delphi docs for the Set8087CW method. @@ -130,7 +126,7 @@ Please check the Delphi docs for the Set8087CW method. ignored by compiled code. If your program is running in a tight loop and never falls back to the interpreter, the debug hook never runs and can't throw the "interrupted!" error.
      -You have to press Ctrl-C twice to get stop your program. That's similar +You have to press Ctrl-C twice to stop your program. That's similar to when it's stuck running inside a C function under the Lua interpreter. @@ -150,7 +146,7 @@ so it doesn't rely on the key order. Or sort the table keys, if you must.
      Q: Can Lua code be safely sandboxed?
      -Maybe for an extremly restricted subset of Lua and if you relentlessly +Maybe for an extremely restricted subset of Lua and if you relentlessly scrutinize every single interface function you offer to the untrusted code.
      Although Lua provides some sandboxing functionality (setfenv(), hooks), @@ -189,7 +185,7 @@ actively developed branches.
    • FAQ
    • -Wiki » -
    • Mailing List »
    @@ -95,62 +88,204 @@ For the impatient (on POSIX systems):
     make && sudo make install
     
    + +

    Requirements

    +

    Systems

    -LuaJIT currently builds out-of-the box on most systems. -Here's the compatibility matrix for the supported combinations of -operating systems, CPUs and compilers: +LuaJIT currently builds out-of-the box on most systems:

    - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CPU / OSLinux or
    Android
    *BSD, OthermacOS 10.4+ or
    iOS 3.0+
    Windows 7
    or later
    OSMin. VersionRequirementsLuaJIT Versions
    x86 (32 bit)GCC 4.2+GCC 4.2+XCode 5.0+
    Clang
    MSVC
    MinGW, Cygwin
    Windows7x86 or x64, ARM64: TBAv2.0 –
    x64 (64 bit)GCC 4.2+GCC 4.2+
    ORBIS (PS4)
    XCode 5.0+
    Clang
    MSVC
    Durango (Xbox One)
    Linux  v2.0 –
    ARMv5+
    ARM9E+
    GCC 4.2+GCC 4.2+
    PSP2 (PS VITA)
    XCode 5.0+
    Clang
     *BSD  v2.0 –
    ARM64
    ARM64be
    GCC 4.8+ XCode 6.0+
    Clang 3.5+
     macOS (OSX)10.4 v2.1 –
    PPCGCC 4.3+GCC 4.3+
    GCC 4.1 (PS3)
     XEDK (Xbox 360)POSIX mmap, dlopenv2.0 –
    Android4.0Recent Android NDKv2.0 –
    iOS3.0Xcode iOS SDKv2.1 –
    PS3 PS3 SDKv2.0 – v2.1 EOL
    PS4 PS4 SDK (ORBIS)v2.0 –
    MIPS32
    MIPS64
    MIPS64r6
    GCC 4.3+GCC 4.3+  PS5 PS5 SDK (PROSPERO)v2.1 –
    PS Vita PS Vita SDK (PSP2)v2.0 – v2.1 EOL
    Xbox 360 Xbox 360 SDK (XEDK)v2.0 – v2.1 EOL
    Xbox One Xbox One SDK (DURANGO)v2.1 –
    Nintendo Switch NintendoSDK + NX Addonv2.1 –
    +

    +The codebase has compatibility defines for some more systems, but +without official support. +

    +

    Toolchains

    +

    +Building LuaJIT requires a recent toolchain based on GCC, Clang/LLVM or +MSVC++. +

    +

    +The Makefile-based build system requires GNU Make and supports +cross-builds. Batch files are provided for MSVC++ builds and console +cross-builds. +

    +

    CPU Architectures

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CPUBitsRequirementsVariantsLuaJIT Versions
    x8632v2.1+: SSE2 v2.0 –
    x6464  v2.0 –
    ARM32ARMv5+, ARM9E+hard-fp + soft-fpv2.0 –
    ARM6464 ARM64le + ARM64bev2.1 –
    PPC3232 hard-fp + soft-fpv2.0 – v2.1 EOL
    PPC/e50032e500v2 v2.0 EOL
    MIPS3232MIPS32r1 – r5hard-fp + soft-fpv2.0 –
    MIPS6464MIPS64r1 – r5hard-fp + soft-fpv2.1 –
    MIPS6464MIPS64r6hard-fp + soft-fpv2.1 EOL
    RISC-V64RVA22+ TBA
    +

    +There are no plans to add historic architectures or to continue support +for end-of-life (EOL) architectures, for which no new CPUs are commonly +available anymore. Likewise, there are no plans to support marginal +and/or de-facto-dead architectures. +

    Configuring LuaJIT

    @@ -191,7 +326,7 @@ The recommended way to fetch the latest version is to do a pull from the git repository.

    -Alternatively download the latest source package of LuaJIT (pick the .tar.gz). +Alternatively, download the latest source package of LuaJIT (pick the .tar.gz). Move it to a directory of your choice, open a terminal window and change to this directory. Now unpack the archive and change to the newly created directory (replace XX.YY.ZZ with the version you downloaded): @@ -411,7 +546,8 @@ NDKCROSS=$NDKBIN/aarch64-linux-android- NDKCC=$NDKBIN/aarch64-linux-android21-clang make CROSS=$NDKCROSS \ STATIC_CC=$NDKCC DYNAMIC_CC="$NDKCC -fPIC" \ - TARGET_LD=$NDKCC + TARGET_LD=$NDKCC TARGET_AR="$NDKBIN/llvm-ar rcus" \ + TARGET_STRIP=$NDKBIN/llvm-strip # Android/ARM, armeabi-v7a (ARMv7 VFP), Android 4.1+ (JB) NDKDIR=/opt/android/ndk @@ -420,7 +556,8 @@ NDKCROSS=$NDKBIN/arm-linux-androideabi- NDKCC=$NDKBIN/armv7a-linux-androideabi16-clang make HOST_CC="gcc -m32" CROSS=$NDKCROSS \ STATIC_CC=$NDKCC DYNAMIC_CC="$NDKCC -fPIC" \ - TARGET_LD=$NDKCC + TARGET_LD=$NDKCC TARGET_AR="$NDKBIN/llvm-ar rcus" \ + TARGET_STRIP=$NDKBIN/llvm-strip

    You can cross-compile for iOS 3.0+ (iPhone/iPad) using the » iOS SDK: @@ -444,8 +581,7 @@ make DEFAULT_CC=clang CROSS="$(dirname $ICC)/" \

    Cross-compiling for consoles

    Building LuaJIT for consoles requires both a supported host compiler -(x86 or x64) and a cross-compiler (to PPC or ARM) from the official -console SDK. +(x86 or x64) and a cross-compiler from the official console SDK.

    Due to restrictions on consoles, the JIT compiler is disabled and only @@ -466,45 +602,58 @@ To cross-compile for PS3 from a Linux host (requires make HOST_CC="gcc -m32" CROSS=ppu-lv2-

    -To cross-compile for PS4 from a Windows host, -open a "Visual Studio .NET Command Prompt" (64 bit host compiler), -cd to the directory where you've unpacked the sources and -run the following commands: +To cross-compile for the other consoles from a Windows host, open a +"Native Tools Command Prompt for VS". You need to choose either the 32 +or the 64 bit version of the host compiler to match the target. +Then cd to the src directory below where you've +unpacked the sources and run the build command given in the table:

    -
    -cd src
    -ps4build
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ConsoleBitsBuild Command
    PS464ps4build
    PS564ps5build
    PS Vita32psvitabuild
    Xbox 36032xedkbuild
    Xbox One64xb1build
    Nintendo Switch NX3232nxbuild
    Nintendo Switch NX6464nxbuild

    -To cross-compile for PS Vita from a Windows host, -open a "Visual Studio .NET Command Prompt" (32 bit host compiler), -cd to the directory where you've unpacked the sources and -run the following commands: +Please check out the comments in the corresponding *.bat +file for more options.

    -
    -cd src
    -psvitabuild
    -
    -

    -To cross-compile for Xbox 360 from a Windows host, -open a "Visual Studio .NET Command Prompt" (32 bit host compiler), -cd to the directory where you've unpacked the sources and run -the following commands: -

    -
    -cd src
    -xedkbuild
    -
    -

    -To cross-compile for Xbox One from a Windows host, -open a "Visual Studio .NET Command Prompt" (64 bit host compiler), -cd to the directory where you've unpacked the sources and run -the following commands: -

    -
    -cd src
    -xb1build
    -

    Embedding LuaJIT

    @@ -546,7 +695,7 @@ allocator from your system (no support for this on 64 bit architectures).luaopen_base etc. directly.

  • To change or extend the list of standard libraries to load, copy src/lib_init.c to your project and modify it accordingly. -Make sure the jit library is loaded or the JIT compiler +Make sure the jit library is loaded, or the JIT compiler will not be activated.
  • The bit.* module for bitwise operations is already built-in. There's no need to statically link @@ -565,7 +714,7 @@ in unspeakable ways. There should be absolutely no need to patch luaconf.h or any of the Makefiles. And please do not hand-pick files for your packages — simply use whatever make install creates. There's a reason -for all of the files and directories it creates. +for all the files and directories it creates.

    The build system uses GNU make and auto-detects most settings based on @@ -617,7 +766,7 @@ to me (the upstream) and not you (the package maintainer), anyway.

  • FAQ
  • -Wiki » -
  • Mailing List »
  • @@ -148,7 +146,7 @@ Lua is a powerful, dynamic and light-weight programming language. It may be embedded or used as a general-purpose, stand-alone language.

    -LuaJIT is Copyright © 2005-2021 Mike Pall, released under the +LuaJIT is Copyright © 2005-2022 Mike Pall, released under the » MIT open source license.

    @@ -162,7 +160,7 @@ LuaJIT is Copyright © 2005-2021 Mike Pall, released under the EmbeddedAndroidiOS - +
    PS3PS4PS VitaXbox 360Xbox One
    PS3PS4
    PS5
    PS VitaXbox 360Xbox OneNintendo
    Switch
    @@ -222,7 +220,7 @@ Please select a sub-topic in the navigation bar to learn more about LuaJIT. @@ -111,6 +109,7 @@ are accepted:
  • -t type — Set output file type (default: auto-detect from output name).
  • -a arch — Override architecture for object files (default: native).
  • -o os — Override OS for object files (default: native).
  • +
  • -F name — Override filename (default: input filename).
  • -e chunk — Use chunk string as input.
  • - (a single minus sign) — Use stdin as input and/or stdout as output.
  • @@ -184,7 +183,7 @@ written in Lua. They are mainly used for debugging the JIT compiler itself. For a description of their options and output format, please read the comment block at the start of their source. They can be found in the lib directory of the source -distribution or installed under the jit directory. By default +distribution or installed under the jit directory. By default, this is /usr/local/share/luajit-XX.YY.ZZ>/jit on POSIX systems (replace XX.YY.ZZ by the installed version).

    @@ -216,7 +215,7 @@ to a specific value. You can either use this option multiple times (like -Ocse -O-dce -Ohotloop=10) or separate several settings with a comma (like -O+cse,-dce,hotloop=10). The settings are applied from -left to right and later settings override earlier ones. You can freely +left to right, and later settings override earlier ones. You can freely mix the three forms, but note that setting an optimization level overrides all earlier flags.

    @@ -295,7 +294,7 @@ Here are the parameters and their default settings: @@ -83,7 +81,7 @@ Known incompatibilities and issues in LuaJIT 2.0:
    • There are some differences in implementation-defined behavior. -These either have a good reason, are arbitrary design choices +These either have a good reason, are arbitrary design choices, or are due to quirks in the VM. The latter cases may get fixed if a demonstrable need is shown.
    • @@ -97,7 +95,7 @@ in LuaJIT (no per-coroutine hooks, no tail call counting).
    diff --git a/src/deps/src/lualogging/docs/nginx.html b/src/deps/src/lualogging/docs/nginx.html index 236724129..f90872aa6 100644 --- a/src/deps/src/lualogging/docs/nginx.html +++ b/src/deps/src/lualogging/docs/nginx.html @@ -23,14 +23,7 @@ diff --git a/src/deps/src/lualogging/docs/rolling_file.html b/src/deps/src/lualogging/docs/rolling_file.html index d171b7790..b3d85a86b 100644 --- a/src/deps/src/lualogging/docs/rolling_file.html +++ b/src/deps/src/lualogging/docs/rolling_file.html @@ -23,14 +23,7 @@ @@ -121,7 +111,9 @@ function logging.rolling_file {
  • timestampPattern:
    This is an optional parameter that can be used to specify a date/time formatting - in the log message. The default is taken from logging.defaultTimestampPattern().
  • + in the log message. + See logging.date for the format. + The default is taken from logging.defaultTimestampPattern().
  • logLevel:
    The initial log-level to set for the created logger.
  • diff --git a/src/deps/src/lualogging/docs/rsyslog.html b/src/deps/src/lualogging/docs/rsyslog.html new file mode 100644 index 000000000..3787597fb --- /dev/null +++ b/src/deps/src/lualogging/docs/rsyslog.html @@ -0,0 +1,239 @@ + + + + LuaLogging: A simple API to use logging features in Lua + + + + + +
    + +
    + +
    LuaLogging
    +
    A simple API to use logging features in Lua.
    +
    + +
    + + + +
    + +

    Remote syslog appender

    + +

    This appender can be used to send syslog formatted log requests to a remote syslog server. +This appender relies on LuaSocket +to do its job. Optionally Copas can be +used for async sending of log messages over TCP.

    + +

    If you want to log to the local syslog daemon, then please use +luasyslog.

    + +

    The LuaLogging log-levels will be mapped to the syslog levels by their name, where +logging.FATAL maps to syslog ALERT. Since LuaLogging only has 5 +levels, the syslog levels EMERG, CRIT, and NOTICE +remain unused.

    + +
    +function logging.rsyslog {
    +    hostname = string,
    +    [port = number,]
    +    [protocol = "udp" | "tcp",]
    +    [rfc = "rfc5424" | "rfc3164",]
    +    [maxsize = number,]
    +    [facility = facility-constant,]
    +    [ident = string,]
    +    [procid = string,]
    +    [msgid = string,]
    +
    +    [logPattern = string,]
    +    [logPatterns = {
    +      [logging.DEBUG = string,]
    +      [logging.INFO  = string,]
    +      [logging.WARN  = string,]
    +      [logging.ERROR = string,]
    +      [logging.FATAL = string,]
    +    },]
    +    [logLevel = log-level-constant,]
    +}
    +
    + +
      +
    • hostname:
      + Hostname can be an IP address or a host name of the server where the log + message will be sent. +
    • + +
    • port:
      + The port must be an integer number in the range [1..64K). The default is + 514. +
    • + +
    • protocol:
      + The network protocol to use, either "udp" or "tcp". + The default is "tcp". +

      + Note: TCP sending is a blocking operation. For non-blocking use + Copas + is supported, see the example below. +
    • + +
    • rfc:
      + The message format. 2 options: +
        +
      • for the old BSD style use "rfc3164" (the default)
      • +
      • for the IETF standard use "rfc5424".
      • +
      +
    • + +
    • maxsize:
      + The maximum message size. Longer messages will be truncated. The minimum value is 480. + The defaults are 1024 for "rfc3164", and 2048 for "rfc5424". +
    • + +
    • facility:
      + The syslog facility to use, use one of the constants. The default value + is the "user" facility. +
      +  rsyslog.FACILITY_KERN
      +  rsyslog.FACILITY_USER
      +  rsyslog.FACILITY_MAIL
      +  rsyslog.FACILITY_DAEMON
      +  rsyslog.FACILITY_AUTH
      +  rsyslog.FACILITY_SYSLOG
      +  rsyslog.FACILITY_LPR
      +  rsyslog.FACILITY_NEWS
      +  rsyslog.FACILITY_UUCP
      +  rsyslog.FACILITY_CRON
      +  rsyslog.FACILITY_AUTHPRIV
      +  rsyslog.FACILITY_FTP
      +  rsyslog.FACILITY_NTP
      +  rsyslog.FACILITY_SECURITY
      +  rsyslog.FACILITY_CONSOLE
      +  rsyslog.FACILITY_NETINFO
      +  rsyslog.FACILITY_REMOTEAUTH
      +  rsyslog.FACILITY_INSTALL
      +  rsyslog.FACILITY_RAS
      +  rsyslog.FACILITY_LOCAL0
      +  rsyslog.FACILITY_LOCAL1
      +  rsyslog.FACILITY_LOCAL2
      +  rsyslog.FACILITY_LOCAL3
      +  rsyslog.FACILITY_LOCAL4
      +  rsyslog.FACILITY_LOCAL5
      +  rsyslog.FACILITY_LOCAL6
      +  rsyslog.FACILITY_LOCAL7
      +      
      +
    • + +
    • ident:
      + The value for the APP-NAME field (rfc5424, called TAG field in rfc3164). + Default value is "lua". +
    • + +
    • procid:
      + The process id value (only applicable for rfc5424 format). + Default value is "-" (absent). +
    • + +
    • msgid:
      + The message id value (only applicable for rfc5424 format). + Default value is "-" (absent). +
    • + +
    • logPattern:
      + This value will be used as the default value for each log-level that was + omitted in logPatterns, this defaults to "%message". + The default pattern deviates from standard LuaLogging defaults since those + do not make sense for syslog. +
    • + +
    • logPatterns:
      + A table with logPattern strings indexed by the log-levels. + A logPattern specifies how the message is written.
      + If this parameter is omitted, a patterns table will be created with the + parameter logPattern as the default value for each log-level. +
    • + +
    • logLevel:
      + The initial log-level to set for the created logger. +
    • +
    + +

    Example

    + +
    +local rsyslog = require "logging.rsyslog"
    +
    +rsyslog.copas() -- switch to using non-blocking Copas sockets
    +
    +local logger = rsyslog {
    +  hostname = "syslog.mycompany.com",
    +  port = 514,
    +  protocol = "tcp",
    +  rfc = "rfc5424",
    +  maxsize = 8000,
    +  facility = rsyslog.FACILITY_LOCAL2,
    +  ident = "my_lua_app",
    +  procid = "socket_mod",
    +  logPattern = "%message %source",
    +}
    +
    +copas.loop(function()
    +  logger:info("logging.rsyslog test")
    +  logger:debug("debugging...")
    +  logger:error("error!")
    +
    +  -- destroy to ensure threads are shutdown (only for Copas)
    +  logger:destroy()
    +end)
    +
    + +

     

    +

     

    +

     

    +

     

    + +
    + +
    + +
    +

    + XHTML 1.0 válido!

    +
    + +
    + + + diff --git a/src/deps/src/lualogging/docs/socket.html b/src/deps/src/lualogging/docs/socket.html index e1783414a..3c52672dd 100644 --- a/src/deps/src/lualogging/docs/socket.html +++ b/src/deps/src/lualogging/docs/socket.html @@ -23,14 +23,7 @@ @@ -111,7 +101,9 @@ function logging.socket {
  • timestampPattern:
    This is an optional parameter that can be used to specify a date/time formatting - in the log message. The default is taken from logging.defaultTimestampPattern().
  • + in the log message. + See logging.date for the format. + The default is taken from logging.defaultTimestampPattern().
  • logLevel:
    The initial log-level to set for the created logger.
  • diff --git a/src/deps/src/lualogging/docs/sql.html b/src/deps/src/lualogging/docs/sql.html index 43d758895..1f218d244 100644 --- a/src/deps/src/lualogging/docs/sql.html +++ b/src/deps/src/lualogging/docs/sql.html @@ -23,14 +23,7 @@ diff --git a/src/deps/src/lualogging/lualogging-dev-2.rockspec b/src/deps/src/lualogging/lualogging-dev-2.rockspec index b70c79414..77edfd8f0 100644 --- a/src/deps/src/lualogging/lualogging-dev-2.rockspec +++ b/src/deps/src/lualogging/lualogging-dev-2.rockspec @@ -9,7 +9,8 @@ package = package_name version = package_version.."-"..rockspec_revision source = { url = "git://github.com/"..github_account_name.."/"..github_repo_name..".git", - branch = "master" + branch = (package_version == "dev") and "master" or nil, + tag = (package_version ~= "dev") and ("v"..package_version) or nil, } description = { summary = "A simple API to use logging features", @@ -35,7 +36,9 @@ build = { ['logging.email'] = "src/logging/email.lua", ['logging.sql'] = "src/logging/sql.lua", ['logging.socket'] = "src/logging/socket.lua", - ['logging.nginx'] = "src/logging/nginx.lua", + ['logging.nginx'] = "src/logging/nginx.lua", + ['logging.rsyslog'] = "src/logging/rsyslog.lua", + ['logging.envconfig'] = "src/logging/envconfig.lua", } }, copy_directories = { diff --git a/src/deps/src/lualogging/rockspecs/lualogging-1.6.0-2.rockspec b/src/deps/src/lualogging/rockspecs/lualogging-1.6.0-2.rockspec new file mode 100644 index 000000000..85c045e45 --- /dev/null +++ b/src/deps/src/lualogging/rockspecs/lualogging-1.6.0-2.rockspec @@ -0,0 +1,45 @@ +local package_name = "lualogging" +local package_version = "1.6.0" +local rockspec_revision = "2" +local github_account_name = "lunarmodules" +local github_repo_name = package_name + + +package = package_name +version = package_version.."-"..rockspec_revision +source = { + url = "git://github.com/"..github_account_name.."/"..github_repo_name..".git", + branch = (package_version == "dev") and "master" or nil, + tag = (package_version ~= "dev") and ("v"..package_version) or nil, +} +description = { + summary = "A simple API to use logging features", + detailed = [[ + LuaLogging provides a simple API to use logging features in Lua. Its design was + based on log4j. LuaLogging currently supports, through the use of appenders, + console, file, rolling file, email, socket and SQL outputs. + ]], + homepage = "https://github.com/"..github_account_name.."/"..github_repo_name, + license = "MIT/X11", +} +dependencies = { + "luasocket" +} +build = { + type = "none", + install = { + lua = { + ['logging'] = "src/logging.lua", + ['logging.console'] = "src/logging/console.lua", + ['logging.file'] = "src/logging/file.lua", + ['logging.rolling_file'] = "src/logging/rolling_file.lua", + ['logging.email'] = "src/logging/email.lua", + ['logging.sql'] = "src/logging/sql.lua", + ['logging.socket'] = "src/logging/socket.lua", + ['logging.nginx'] = "src/logging/nginx.lua", + } + }, + copy_directories = { + "docs", + }, +} diff --git a/src/deps/src/lualogging/rockspecs/lualogging-1.7.0-1.rockspec b/src/deps/src/lualogging/rockspecs/lualogging-1.7.0-1.rockspec new file mode 100644 index 000000000..59750d2c8 --- /dev/null +++ b/src/deps/src/lualogging/rockspecs/lualogging-1.7.0-1.rockspec @@ -0,0 +1,46 @@ +local package_name = "lualogging" +local package_version = "1.7.0" +local rockspec_revision = "1" +local github_account_name = "lunarmodules" +local github_repo_name = package_name + + +package = package_name +version = package_version.."-"..rockspec_revision +source = { + url = "git://github.com/"..github_account_name.."/"..github_repo_name..".git", + branch = (package_version == "dev") and "master" or nil, + tag = (package_version ~= "dev") and ("v"..package_version) or nil, +} +description = { + summary = "A simple API to use logging features", + detailed = [[ + LuaLogging provides a simple API to use logging features in Lua. Its design was + based on log4j. LuaLogging currently supports, through the use of appenders, + console, file, rolling file, email, socket and SQL outputs. + ]], + homepage = "https://github.com/"..github_account_name.."/"..github_repo_name, + license = "MIT/X11", +} +dependencies = { + "luasocket" +} +build = { + type = "none", + install = { + lua = { + ['logging'] = "src/logging.lua", + ['logging.console'] = "src/logging/console.lua", + ['logging.file'] = "src/logging/file.lua", + ['logging.rolling_file'] = "src/logging/rolling_file.lua", + ['logging.email'] = "src/logging/email.lua", + ['logging.sql'] = "src/logging/sql.lua", + ['logging.socket'] = "src/logging/socket.lua", + ['logging.nginx'] = "src/logging/nginx.lua", + ['logging.rsyslog'] = "src/logging/rsyslog.lua", + } + }, + copy_directories = { + "docs", + }, +} diff --git a/src/deps/src/lualogging/rockspecs/lualogging-1.8.0-1.rockspec b/src/deps/src/lualogging/rockspecs/lualogging-1.8.0-1.rockspec new file mode 100644 index 000000000..36186f08a --- /dev/null +++ b/src/deps/src/lualogging/rockspecs/lualogging-1.8.0-1.rockspec @@ -0,0 +1,47 @@ +local package_name = "lualogging" +local package_version = "1.8.0" +local rockspec_revision = "1" +local github_account_name = "lunarmodules" +local github_repo_name = package_name + + +package = package_name +version = package_version.."-"..rockspec_revision +source = { + url = "git://github.com/"..github_account_name.."/"..github_repo_name..".git", + branch = (package_version == "dev") and "master" or nil, + tag = (package_version ~= "dev") and ("v"..package_version) or nil, +} +description = { + summary = "A simple API to use logging features", + detailed = [[ + LuaLogging provides a simple API to use logging features in Lua. Its design was + based on log4j. LuaLogging currently supports, through the use of appenders, + console, file, rolling file, email, socket and SQL outputs. + ]], + homepage = "https://github.com/"..github_account_name.."/"..github_repo_name, + license = "MIT/X11", +} +dependencies = { + "luasocket" +} +build = { + type = "none", + install = { + lua = { + ['logging'] = "src/logging.lua", + ['logging.console'] = "src/logging/console.lua", + ['logging.file'] = "src/logging/file.lua", + ['logging.rolling_file'] = "src/logging/rolling_file.lua", + ['logging.email'] = "src/logging/email.lua", + ['logging.sql'] = "src/logging/sql.lua", + ['logging.socket'] = "src/logging/socket.lua", + ['logging.nginx'] = "src/logging/nginx.lua", + ['logging.rsyslog'] = "src/logging/rsyslog.lua", + ['logging.envconfig'] = "src/logging/envconfig.lua", + } + }, + copy_directories = { + "docs", + }, +} diff --git a/src/deps/src/lualogging/src/logging.lua b/src/deps/src/lualogging/src/logging.lua index 5ef2db0a7..64bd6a5df 100644 --- a/src/deps/src/lualogging/src/logging.lua +++ b/src/deps/src/lualogging/src/logging.lua @@ -5,21 +5,22 @@ -- @author Andre Carregal (info@keplerproject.org) -- @author Thiago Costa Ponte (thiago@ideais.com.br) -- --- @copyright 2004-2021 Kepler Project +-- @copyright 2004-2022 Kepler Project ------------------------------------------------------------------------------- local type, table, string, _tostring, tonumber = type, table, string, tostring, tonumber local select = select local error = error local format = string.format +local floor = math.floor local pairs = pairs local ipairs = ipairs local logging = { -- Meta information - _COPYRIGHT = "Copyright (C) 2004-2021 Kepler Project", + _COPYRIGHT = "Copyright (C) 2004-2022 Kepler Project", _DESCRIPTION = "A simple API to use logging features in Lua", - _VERSION = "LuaLogging 1.6.0", + _VERSION = "LuaLogging 1.8.0", } local LEVELS = { "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "OFF" } @@ -239,6 +240,58 @@ do end end + +------------------------------------------------------------------------------- +-- os.date replacement with milliseconds if supported +-- ms placeholder = %q or %xq (where x is number of decimals) +------------------------------------------------------------------------------- + + +do + local gettime = os.time + local ok, socket = pcall(require, "socket") -- load luasocket if available + if ok then + gettime = socket.gettime + end + + -- use a pattern cache to know if we even need ms to format + local patternCache = setmetatable({}, { + __index = function(self, patt) + local placeholder = patt:match("(%%%d*q)") + if not placeholder then + self[patt] = false + return false + end + + local size = tonumber(placeholder:sub(2,-2)) or 3 + assert(size >= 1 and size <= 6, "millisecond format %q quantifier range is 1 to 6") + self[patt] = ("0"):rep(size) -- a string to grab trailing "0"'s from + return self[patt] + end + }) + function logging.date(fmt, t) + fmt = fmt or "%c" + t = t or gettime() + local pad = patternCache[fmt] + local ms + if pad then + -- ms required + ms = math.fmod(t,1) + local mss = (tostring(ms) .. pad):sub(3, -1) + + fmt = fmt:gsub("(%%%d*q)", function(placeholder) + return mss:sub(1, #pad) + end) + end + + local res, err = os.date(fmt, floor(t)) -- 5.3+ requires t to be an integer + if type(res) == "table" then + res.secf = ms or math.fmod(t,1) + end + return res, err + end +end + ------------------------------------------------------------------------------- -- Converts a Lua value to a string -- diff --git a/src/deps/src/lualogging/src/logging/console.lua b/src/deps/src/lualogging/src/logging/console.lua index 696d72554..03c7d44d9 100644 --- a/src/deps/src/lualogging/src/logging/console.lua +++ b/src/deps/src/lualogging/src/logging/console.lua @@ -3,7 +3,7 @@ -- -- @author Thiago Costa Ponte (thiago@ideais.com.br) -- --- @copyright 2004-2021 Kepler Project +-- @copyright 2004-2022 Kepler Project -- ------------------------------------------------------------------------------- @@ -11,20 +11,30 @@ local io = require"io" local logging = require"logging" local prepareLogMsg = logging.prepareLogMsg -local destinations = setmetatable({ - stdout = "stdout", - stderr = "stderr", - }, - { - __index = function(self, key) - if not key then - return "stdout" -- default value - end - error("destination parameter must be either 'stderr' or 'stdout', got: "..tostring(key), 3) - end - }) -function logging.console(params, ...) +local destinations = setmetatable({ + stdout = "stdout", + stderr = "stderr", +}, +{ + __index = function(self, key) + if not key then + return "stdout" -- default value + end + error("destination parameter must be either 'stderr' or 'stdout', got: "..tostring(key), 3) + end +}) + + +local M = setmetatable({}, { + __call = function(self, ...) + -- calling on the module instantiates a new logger + return self.new(...) + end, +}) + + +function M.new(params, ...) params = logging.getDeprecatedParams({ "logPattern" }, params, ...) local startLevel = params.logLevel or logging.defaultLevel() local timestampPattern = params.timestampPattern or logging.defaultTimestampPattern() @@ -32,10 +42,12 @@ function logging.console(params, ...) local logPatterns = logging.buildLogPatterns(params.logPatterns, params.logPattern) return logging.new( function(self, level, message) - io[destination]:write(prepareLogMsg(logPatterns[level], os.date(timestampPattern), level, message)) + io[destination]:write(prepareLogMsg(logPatterns[level], logging.date(timestampPattern), level, message)) return true end, startLevel) end -return logging.console + +logging.console = M +return M diff --git a/src/deps/src/lualogging/src/logging/email.lua b/src/deps/src/lualogging/src/logging/email.lua index 0a7aa3e05..f24bcb248 100644 --- a/src/deps/src/lualogging/src/logging/email.lua +++ b/src/deps/src/lualogging/src/logging/email.lua @@ -3,14 +3,23 @@ -- -- @author Thiago Costa Ponte (thiago@ideais.com.br) -- --- @copyright 2004-2021 Kepler Project +-- @copyright 2004-2022 Kepler Project -- ------------------------------------------------------------------------------- local logging = require"logging" local smtp = require"socket.smtp" -function logging.email(params) + +local M = setmetatable({}, { + __call = function(self, ...) + -- calling on the module instantiates a new logger + return self.new(...) + end, +}) + + +function M.new(params) params = params or {} params.headers = params.headers or {} @@ -26,7 +35,7 @@ function logging.email(params) local startLevel = params.logLevel or logging.defaultLevel() return logging.new( function(self, level, message) - local dt = os.date(timestampPattern) + local dt = logging.date(timestampPattern) local s = logging.prepareLogMsg(logPatterns[level], dt, level, message) if params.headers.subject then params.headers.subject = @@ -44,5 +53,6 @@ function logging.email(params) end, startLevel) end -return logging.email +logging.email = M +return M diff --git a/src/deps/src/lualogging/src/logging/envconfig.lua b/src/deps/src/lualogging/src/logging/envconfig.lua new file mode 100644 index 000000000..31acfa6c5 --- /dev/null +++ b/src/deps/src/lualogging/src/logging/envconfig.lua @@ -0,0 +1,194 @@ +------------------------------------------------------------------------------- +-- Configures LuaLogging from the environment +-- +-- @author Thijs Schreijer +-- +-- @copyright 2004-2022 Kepler Project +-- +------------------------------------------------------------------------------- + +local ll = require "logging" + +local levels = { "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "OFF" } +local default_logger_name = "console" +local default_logger_opts = { destination = "stderr" } +local default_log_level = ll.defaultLevel() +local default_timestamp_pattern = ll.defaultTimestampPattern() +local default_prefix = "LL" + + +-- -- Debug code to display environment variable access +-- local getenv = os.getenv +-- os.getenv = function(key) +-- print(key.."="..tostring(getenv(key))) +-- return getenv(key) +-- end + +local M = {} + +local function validate_prefix(prefix) + if type(prefix) ~= "string" then + return nil, "expected prefix to be a string" + end + if prefix ~= prefix:gsub("[^0-9a-zA-Z_]", "") then + return nil, "prefix can contain only A-Z, 0-9, and _" + end + if not prefix:match("^[a-zA-Z]") then + return nil, "prefix must start with A-Z" + end + return true +end + + +--- table that dynamically looks up environment variables. +-- Keys must be strings "A-Z0-9_", and start with "A-Z". The lookup +-- is case-insensitive, the environment variable MUST be in ALL CAPS. +-- Values will be converted to boolean if "true"/"false" (case-insensitive), or +-- to a number if a valid number. +-- @tparam string prefix for the environment variables +-- @return table +local function envloader(prefix) + assert(validate_prefix(prefix)) + prefix = prefix .. "_" + + -- looking up in this table will fetch from the environment with the proper prefix + -- will convert bools, numbers, "logLevel" and "logPatterns" to proper format + -- + -- NOTE: its a meta-method; so cannot return nil+err, must throw errors! + local env = setmetatable({}, { + __index = function(self, key) + if type(key) ~= "string" or + key ~= key:gsub("[^0-9a-zA-Z_]", "") or + #key == 0 then + return nil + end + + local envvar = (prefix..key):upper() + + -- log patterns table (special case) + if key:lower() == "logpatterns" then + local patt = {} + for _, l in ipairs(levels) do + local level = ll[l] -- the numeric constant for the level + patt[level] = os.getenv(envvar.."_"..l) + end + + if not next(patt) then + return nil -- none set, so return nil instead of empty table + end + return patt + end + + -- read the value + local value = os.getenv(envvar) + if value == nil then + return value + end + + -- logLevel constants + if key:lower() == "loglevel" then + for _, l in ipairs(levels) do + if value:upper() == l then + return ll[value:upper()] + end + end + error(("not a proper loglevel set in env var %s: '%s' (use one of: %s"): + format(envvar, value, '"DEBUG", "INFO", "WARN", "ERROR", "FATAL", "OFF"')) + end + + -- check for boolean + if value:lower() == "true" or value:lower() == "false" then + return value:lower() == "true" + end + + -- check for number + if value:gsub("[1-9%.%-]", "") == "" and + #value - #value:gsub("[%.]", "") <= 1 and -- zero or 1 "." character + (#value - #value:gsub("[%-]", "") == 0 or -- zero "-" characters + #value - #value:gsub("[%-]", "") == 1 and value:match("^%-")) and -- 1 "-" character, at first pos + #value - #value:gsub("[1-9]", "") >= 1 then -- at least 1 digit + return tonumber(value) + end + + -- return as string + return value + end + }) + + return env +end + +do + local base_set = false + local base_name + local base_opts + + --- Collects and sets the default logger and its option (does not create the logger). + -- From an application, this is the first call to make, to set the "prefix" for the + -- environment variables to use. + -- @tparam prefix the prefix for env vars to use. + -- @return true, or nil + err on failure + function M.set_default_settings(prefix) + if base_set then + return nil, "already set a default" + end + local ok, err = validate_prefix(prefix) + if not ok then + return ok, err + end + base_opts = envloader(prefix) + base_name = base_opts.logger + if not base_name then + -- no logger specified, so load options for default, and send defaults if absent + base_name = default_logger_name + for k, v in pairs(default_logger_opts) do + local ev = base_opts[k] + if ev == nil then -- false is a valid value, so check against nil + ev = v + end + base_opts[k] = ev + end + end + -- load additional standard options + base_opts.logLevel = base_opts.logLevel or default_log_level + base_opts.timestampPattern = base_opts.timestampPattern or default_timestamp_pattern + base_opts.logPatterns = ll.buildLogPatterns(base_opts.logPatterns or {}, base_opts.logPattern) + + base_set = true + return true + end + + -- returns the loggername, and the options table for it + function M.get_default_settings() + if not base_set then + assert(M.set_default_settings(default_prefix)) + end + return base_name, base_opts + end +end + + +--- Gets default logger options and then creates and sets the LuaLogging +-- default logger. Should be called once, at application start. Not to be called by +-- libraries, since this is an application global setting. +-- @tparam[opt] string prefix if provided, then the default settings will be set +-- using this prefix. If they were already set, it will return nil+err in that case. +-- return default logger as set +function M.set_default_logger(prefix) + if prefix then + local ok, err = M.set_default_settings(prefix) + if not ok then + return nil, err + end + end + local name, opts = M.get_default_settings() + + -- create the logger + local logger = assert(require("logging."..name)(opts)) + -- set default and return it + return ll.defaultLogger(logger) +end + + + +return M diff --git a/src/deps/src/lualogging/src/logging/file.lua b/src/deps/src/lualogging/src/logging/file.lua index db49aa0b0..b6ce0e2f2 100644 --- a/src/deps/src/lualogging/src/logging/file.lua +++ b/src/deps/src/lualogging/src/logging/file.lua @@ -3,7 +3,7 @@ -- -- @author Thiago Costa Ponte (thiago@ideais.com.br) -- --- @copyright 2004-2021 Kepler Project +-- @copyright 2004-2022 Kepler Project -- ------------------------------------------------------------------------------- @@ -12,6 +12,7 @@ local logging = require"logging" local lastFileNameDatePattern local lastFileHandler + local buffer_mode do local dir_separator = _G.package.config:sub(1,1) local is_windows = dir_separator == '\\' @@ -24,8 +25,9 @@ local buffer_mode do end end + local openFileLogger = function (filename, datePattern) - local filename = string.format(filename, os.date(datePattern)) + local filename = string.format(filename, logging.date(datePattern)) if (lastFileNameDatePattern ~= filename) then local f = io.open(filename, "a") if (f) then @@ -41,7 +43,16 @@ local openFileLogger = function (filename, datePattern) end end -function logging.file(params, ...) + +local M = setmetatable({}, { + __call = function(self, ...) + -- calling on the module instantiates a new logger + return self.new(...) + end, +}) + + +function M.new(params, ...) params = logging.getDeprecatedParams({ "filename", "datePattern", "logPattern" }, params, ...) local filename = params.filename local datePattern = params.datePattern @@ -58,11 +69,12 @@ function logging.file(params, ...) if not f then return nil, msg end - local s = logging.prepareLogMsg(logPatterns[level], os.date(timestampPattern), level, message) + local s = logging.prepareLogMsg(logPatterns[level], logging.date(timestampPattern), level, message) f:write(s) return true end, startLevel) end -return logging.file +logging.file = M +return M diff --git a/src/deps/src/lualogging/src/logging/nginx.lua b/src/deps/src/lualogging/src/logging/nginx.lua index d8ca775ba..97473e0c3 100644 --- a/src/deps/src/lualogging/src/logging/nginx.lua +++ b/src/deps/src/lualogging/src/logging/nginx.lua @@ -3,7 +3,7 @@ -- -- @author Thijs Schreijer -- --- @copyright 2004-2021 Kepler Project +-- @copyright 2004-2022 Kepler Project -- ------------------------------------------------------------------------------- @@ -12,6 +12,7 @@ local prepareLogMsg = logging.prepareLogMsg local ngx_log = assert((ngx or {}).log, "this logger can only be used with OpenResty") + local levels = { [logging.FATAL] = ngx.EMERG, [logging.ERROR] = ngx.ERR, @@ -35,11 +36,20 @@ local target_level do end -function logging.nginx(params) +local M = setmetatable({}, { + __call = function(self, ...) + -- calling on the module instantiates a new logger + return self.new(...) + end, +}) + + +function M.new(params) return logging.new(function(self, level, message) return ngx_log(levels[level], prepareLogMsg("%message", "", level, message)) end, target_level) end -return logging.nginx +logging.nginx = M +return M diff --git a/src/deps/src/lualogging/src/logging/rolling_file.lua b/src/deps/src/lualogging/src/logging/rolling_file.lua index a35f2d0e9..e4e27ea60 100644 --- a/src/deps/src/lualogging/src/logging/rolling_file.lua +++ b/src/deps/src/lualogging/src/logging/rolling_file.lua @@ -5,11 +5,12 @@ -- -- @author Tiago Cesar Katcipis (tiagokatcipis@gmail.com) -- --- @copyright 2004-2021 Kepler Project +-- @copyright 2004-2022 Kepler Project --------------------------------------------------------------------------- local logging = require"logging" + local buffer_mode do local dir_separator = _G.package.config:sub(1,1) local is_windows = dir_separator == '\\' @@ -22,6 +23,7 @@ local buffer_mode do end end + local function openFile(self) self.file = io.open(self.filename, "a") if not self.file then @@ -31,6 +33,7 @@ local function openFile(self) return self.file end + local rollOver = function (self) for i = self.maxIndex - 1, 1, -1 do -- files may not exist yet, lets ignore the possible errors. @@ -70,7 +73,15 @@ local openRollingFileLogger = function (self) end -function logging.rolling_file(params, ...) +local M = setmetatable({}, { + __call = function(self, ...) + -- calling on the module instantiates a new logger + return self.new(...) + end, +}) + + +function M.new(params, ...) params = logging.getDeprecatedParams({ "filename", "maxFileSize", "maxBackupIndex", "logPattern" }, params, ...) local logPatterns = logging.buildLogPatterns(params.logPatterns, params.logPattern) local timestampPattern = params.timestampPattern or logging.defaultTimestampPattern() @@ -87,11 +98,12 @@ function logging.rolling_file(params, ...) if not f then return nil, msg end - local s = logging.prepareLogMsg(logPatterns[level], os.date(timestampPattern), level, message) + local s = logging.prepareLogMsg(logPatterns[level], logging.date(timestampPattern), level, message) f:write(s) return true end, startLevel) end -return logging.rolling_file +logging.rolling_file = M +return M diff --git a/src/deps/src/lualogging/src/logging/rsyslog.lua b/src/deps/src/lualogging/src/logging/rsyslog.lua new file mode 100644 index 000000000..acf05d3be --- /dev/null +++ b/src/deps/src/lualogging/src/logging/rsyslog.lua @@ -0,0 +1,376 @@ +------------------------------------------------------------------------------- +-- Syslog for LuaLogging to a remote server using UDP/TCP +-- +-- @author Thijs Schreijer +-- +-- @copyright 2004-2022 Kepler Project +-- +------------------------------------------------------------------------------- + +-- This module differs from [`LuaSyslog`](https://github.com/lunarmodules/luasyslog) +-- in that it will log to a remote server, where `LuaSyslog` will log to the local +-- syslog daemon. + + +local socket = require "socket" +local logging = require "logging" +local prepareLogMsg = logging.prepareLogMsg +local pcall = pcall + + +local M = setmetatable({}, { + __call = function(self, ...) + -- calling on the module instantiates a new logger + return self.new(...) + end, +}) + + +-- set on module table to be able to override it. For example with a Copas +-- socket. No need for UDP, since UDP sending is non-blocking. +M.tcp = socket.tcp + + +local NILVALUE = "-" +local MONTHS = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } + + +-- determine the local machine hostname, once at startup +local HOSTNAME do + if _G.package.config:sub(1,1) == "\\" then + -- Windows + HOSTNAME = os.getenv("COMPUTERNAME") + else + -- Unix like + local f = io.popen ("/bin/hostname") + HOSTNAME = f:read("*a") + f:close() + end + + HOSTNAME = (HOSTNAME or ""):gsub("[^\33-\126]", "") + + if HOSTNAME == "" then + local s = socket.udp() + s:setpeername("1.1.1.1",80) -- ip for cloudflare dns + HOSTNAME = s:getsockname() + end + + HOSTNAME = (HOSTNAME or ""):gsub("[^\33-\126]", "") + + if HOSTNAME == "" then + HOSTNAME = NILVALUE + end +end + + + +-- the syslog constants +local syslog_facilities = { + FACILITY_KERN = 0 * 8, + FACILITY_USER = 1 * 8, + FACILITY_MAIL = 2 * 8, + FACILITY_DAEMON = 3 * 8, + FACILITY_AUTH = 4 * 8, + FACILITY_SYSLOG = 5 * 8, + FACILITY_LPR = 6 * 8, + FACILITY_NEWS = 7 * 8, + FACILITY_UUCP = 8 * 8, + FACILITY_CRON = 9 * 8, + FACILITY_AUTHPRIV = 10 * 8, + FACILITY_FTP = 11 * 8, + FACILITY_NTP = 12 * 8, + FACILITY_SECURITY = 13 * 8, + FACILITY_CONSOLE = 14 * 8, + FACILITY_NETINFO = 12 * 8, + FACILITY_REMOTEAUTH = 13 * 8, + FACILITY_INSTALL = 14 * 8, + FACILITY_RAS = 15 * 8, + FACILITY_LOCAL0 = 16 * 8, + FACILITY_LOCAL1 = 17 * 8, + FACILITY_LOCAL2 = 18 * 8, + FACILITY_LOCAL3 = 19 * 8, + FACILITY_LOCAL4 = 20 * 8, + FACILITY_LOCAL5 = 21 * 8, + FACILITY_LOCAL6 = 22 * 8, + FACILITY_LOCAL7 = 23 * 8, +} +for k,v in pairs(syslog_facilities) do + M[k] = v +end + + + +local syslog_levels = { + LOG_EMERG = 0, + LOG_ALERT = 1, + LOG_CRIT = 2, + LOG_ERR = 3, + LOG_WARNING = 4, + LOG_NOTICE = 5, + LOG_INFO = 6, + LOG_DEBUG = 7, +} + + +-- lookup table: convert lualogging level constant to syslog level constant +local convert = { + [logging.DEBUG] = syslog_levels.LOG_DEBUG, + [logging.INFO] = syslog_levels.LOG_INFO, + [logging.WARN] = syslog_levels.LOG_WARNING, + [logging.ERROR] = syslog_levels.LOG_ERR, + [logging.FATAL] = syslog_levels.LOG_ALERT, +} + + +-- --------------------------------------------------------------------------- +-- Writer functions for both RFC's +-- --------------------------------------------------------------------------- +M.writers = {} + + +function M.writers.rfc3164(prio, facility, ident, _, _, msg) + local d = os.date("!*t") + msg = msg:gsub("\n", "\\n"):gsub("\t", " "):gsub("\0-\31", "") -- higher bytes allowed, for UTF8... not according to spec + return ("<%d>%s %2d %02d:%02d:%02d %s %s %s\n"):format(facility + prio, MONTHS[d.month], d.day, d.hour, d.min, d.sec, HOSTNAME, ident, msg) +end + + +function M.writers.rfc5424(prio, facility, ident, procid, msgid, msg) + local timestamp = logging.date("!%Y-%m-%dT%H:%M:%S.%qZ") + return ("<%d>1 %s %s %s %s %s - %s"):format(facility + prio, timestamp, HOSTNAME, ident, procid, msgid, msg) +end + + +-- --------------------------------------------------------------------------- +-- sender functions for UDP and TCP +-- --------------------------------------------------------------------------- + +M.senders = {} + +-- sockets indexed by cache-key. +-- NOTE: sockets should be anchored on the logger object to prevent GC +-- of active ones. +local socket_cache = setmetatable({}, { __mode = "v" }) + + + +local function socket_error(self, err) + io.stderr:write(err.."\n") + return nil, err +end + + + +function M.senders.udp(self, msg, is_retry) + local sock = self.socket + if not sock then + local cache_key = self.socket_cache_key + sock = socket_cache[cache_key] + if not sock then + -- create a new socket + local host, port = cache_key:match("^udp://(.+):(%d+)$") + sock = assert(socket.udp()) + assert(sock:settimeout(5)) + local ok, err = sock:setpeername(host, tonumber(port)) + if not ok then + return socket_error(self, "failed to connect to "..cache_key..": ".. tostring(err).."\n"..tostring(msg)) + end + -- cache it + socket_cache[cache_key] = sock + end + -- anchor it + self.socket = sock + end + + local ok, err = sock:send(msg) + if not ok then + sock:close() + self.sock = nil + socket_cache[self.socket_cache_key] = nil + -- recurse once; will recreate the socket and retry + if not is_retry then + return M.senders.udp(self, msg, true) + else + return socket_error(self, "failed to send msg (after retry) to "..self.socket_cache_key..": ".. tostring(err).."\n"..tostring(msg)) + end + end + return true +end + + + +function M.senders.tcp(self, msg, is_retry) + local sock = self.socket + if not sock then + local cache_key = self.socket_cache_key + sock = socket_cache[cache_key] + if not sock then + -- create a new socket + local host, port = cache_key:match("^tcp://(.+):(%d+)$") + sock = assert(M.tcp()) + assert(sock:settimeout(5)) + local ok, err = sock:connect(host, tonumber(port)) + if not ok then + return socket_error(self, "failed to connect to "..cache_key..": ".. tostring(err).."\n"..tostring(msg)) + end + ok, err = sock:setoption("keepalive", true) + if not ok then + return socket_error(self, "failed to set keepalive for "..cache_key..": ".. tostring(err).."\n"..tostring(msg)) + end + -- cache it + socket_cache[cache_key] = sock + end + -- anchor it + self.socket = sock + end + + local payload + if self.send_msg_size then + payload = ("%d %s"):format(#msg, msg) + else + payload = msg.."\n" -- old RFC, terminate by LF + end + local last_byte_send = 0 + local size = #payload + local err, last_send_error + while last_byte_send < size do + last_byte_send, err, last_send_error = sock:send(payload, last_byte_send + 1, size) + if not last_byte_send then + sock:close() + self.sock = nil + socket_cache[self.socket_cache_key] = nil + -- recurse once; will recreate the socket and retry + if not is_retry then + return M.senders.tcp(self, msg, true) + else + return socket_error(self, "failed to send msg (after retry) to "..self.socket_cache_key.." ("..tostring(last_send_error).." bytes sent): ".. tostring(err).."\n"..tostring(msg)) + end + end + end + return true +end + + + +function M.senders.copas(self, msg) + local q = self.queue + q:push(msg) + if q:get_size() >= 1000 then + -- queue is running full, drop an old message + q:pop() + end +end + + + +-- --------------------------------------------------------------------------- +-- instantiation +-- --------------------------------------------------------------------------- + + +local function validate_facility(f) + for k, v in pairs(syslog_facilities) do + if v == f then + if tostring(k):find("FACILITY_") then + return f + end + end + end + return nil, "bad facility; " .. tostring(f) +end + + +local function copas_tcp() + local copas = require("copas") + return copas.wrap(socket.tcp()) +end + + +function M.new(params, ...) + params = logging.getDeprecatedParams({ "ident", "facility" }, params, ...) + local logPatterns = logging.buildLogPatterns(params.logPatterns, params.logPattern or "%message") + local startLevel = params.logLevel or logging.defaultLevel() + local ident = (params.ident or "lua"):gsub("[^\33-\126]", "") + assert(#ident > 0 and ident == (params.ident or "lua"), "invalid ident; invalid characters or empty") + local procid = (params.procid or NILVALUE):gsub("[^\33-\126]", "") + assert(#procid > 0 and procid == (params.procid or NILVALUE), "invalid procid; invalid characters or empty") + local msgid = (params.msgid or NILVALUE):gsub("[^\33-\126]", "") + assert(#msgid > 0 and msgid == (params.msgid or NILVALUE), "invalid msgid invalid characters or empty") + local facility = assert(validate_facility(params.facility or syslog_facilities.FACILITY_USER)) + local maxsize = tonumber(params.maxsize) + local write = assert(M.writers[params.rfc or "rfc3164"], "unsupported format: "..tostring(params.rfc)) + + if not maxsize then + maxsize = 2048 + if params.rfc == "rfc3164" then + maxsize = 1024 + end + end + assert(maxsize > 480, "expected maxsize to be a number > 480") + + -- if send_msg_size is truthy then the message will be prefixed by the length. Otherwise + -- an "\n" will be appended as separator. Only applies to TCP. + local send_msg_size = false + if params.rfc == "rfc5424" then + send_msg_size = true + end + + local port = params.port or 514 + assert(type(port) == "number" and port > 0 and port < 65535, "not a valid port number: " .. tostring(params.port)) + local hostname = params.hostname + assert(type(hostname) == "string", "expected 'hostname' to be a string") + + local protocol = params.protocol + local send = assert(M.senders[protocol or "tcp"], "unsupported protocol: "..tostring(protocol)) + if protocol == "tcp" and M.tcp == copas_tcp then + -- copas was enabled, so use copas instead of tcp + send = M.senders.copas + end + + local new_logger = logging.new(function(self, level, message) + message = prepareLogMsg(logPatterns[level], "", level, message) + message = write(convert[level], facility, ident, procid, msgid, message) + + send(self, message:sub(1, maxsize)) + return true + end, startLevel) + + -- set some logger properties + new_logger.socket_cache_key = ("%s://%s:%d"):format(protocol, hostname, port) + new_logger.send_msg_size = send_msg_size + + if protocol == "tcp" and M.tcp == copas_tcp then + -- a copas sender, needs an async queue, and a worker to process the messages + local queue = require("copas.queue").new { + name = "lualogging-rsyslog" + } + local tcp_sender = M.senders.tcp + queue:add_worker(function(msg) + local ok, err = pcall(tcp_sender, new_logger, msg) + if not ok then + socket_error(new_logger, "lualogging rsyslog failed logging through Copas socket: "..tostring(err).."\n"..tostring(msg)) + end + end) + new_logger.queue = queue + function new_logger:destroy() + if self.queue then + self.queue:stop() + self.queue = nil + end + end + end + + return new_logger +end + +function M.copas() + if _VERSION=="Lua 5.1" and not jit then -- prevent yield across c-boundary + pcall = require("coxpcall").pcall + end + + M.tcp = copas_tcp +end + +logging.rsyslog = M +return M diff --git a/src/deps/src/lualogging/src/logging/socket.lua b/src/deps/src/lualogging/src/logging/socket.lua index 260b3d841..d96682409 100644 --- a/src/deps/src/lualogging/src/logging/socket.lua +++ b/src/deps/src/lualogging/src/logging/socket.lua @@ -3,14 +3,23 @@ -- -- @author Thiago Costa Ponte (thiago@ideais.com.br) -- --- @copyright 2004-2021 Kepler Project +-- @copyright 2004-2022 Kepler Project -- ------------------------------------------------------------------------------- local logging = require"logging" local socket = require"socket" -function logging.socket(params, ...) + +local M = setmetatable({}, { + __call = function(self, ...) + -- calling on the module instantiates a new logger + return self.new(...) + end, +}) + + +function M.new(params, ...) params = logging.getDeprecatedParams({ "hostname", "port", "logPattern" }, params, ...) local hostname = params.hostname local port = params.port @@ -19,7 +28,7 @@ function logging.socket(params, ...) local startLevel = params.logLevel or logging.defaultLevel() return logging.new( function(self, level, message) - local s = logging.prepareLogMsg(logPatterns[level], os.date(timestampPattern), level, message) + local s = logging.prepareLogMsg(logPatterns[level], logging.date(timestampPattern), level, message) local socket, err = socket.connect(hostname, port) if not socket then @@ -36,5 +45,6 @@ function logging.socket(params, ...) end, startLevel) end -return logging.socket +logging.socket = M +return M diff --git a/src/deps/src/lualogging/src/logging/sql.lua b/src/deps/src/lualogging/src/logging/sql.lua index 290703be9..2a6ab628a 100644 --- a/src/deps/src/lualogging/src/logging/sql.lua +++ b/src/deps/src/lualogging/src/logging/sql.lua @@ -3,13 +3,22 @@ -- -- @author Thiago Costa Ponte (thiago@ideais.com.br) -- --- @copyright 2004-2021 Kepler Project +-- @copyright 2004-2022 Kepler Project -- ------------------------------------------------------------------------------- local logging = require"logging" -function logging.sql(params) + +local M = setmetatable({}, { + __call = function(self, ...) + -- calling on the module instantiates a new logger + return self.new(...) + end, +}) + + +function M.new(params) params = params or {} params.tablename = params.tablename or "LogTable" params.logdatefield = params.logdatefield or "LogDate" @@ -60,5 +69,7 @@ function logging.sql(params) end, startLevel) end -return logging.sql + +logging.sql = M +return M diff --git a/src/deps/src/lualogging/tests/test.lua b/src/deps/src/lualogging/tests/test.lua index 491458aa8..2d7313328 100644 --- a/src/deps/src/lualogging/tests/test.lua +++ b/src/deps/src/lualogging/tests/test.lua @@ -1,6 +1,7 @@ local test = { "generic.lua", + "testEnv.lua", "testConsole.lua", "testFile.lua", "testMail.lua", diff --git a/src/deps/src/lualogging/tests/testEnv.lua b/src/deps/src/lualogging/tests/testEnv.lua new file mode 100644 index 000000000..ed62b03f4 --- /dev/null +++ b/src/deps/src/lualogging/tests/testEnv.lua @@ -0,0 +1,145 @@ +local logging +local logenv +local env + +local old_getenv = os.getenv +function os.getenv(key) -- luacheck: ignore + assert(type(key) == "string", "expected env variable name to be a string") + return env[key] +end + +local function reset() + env = {} + package.loaded["logging"] = nil + package.loaded["logging.envconfig"] = nil + logging = require "logging" + logenv = require "logging.envconfig" +end + + +local tests = {} + +tests.returns_defaults = function() + local name, opts = logenv.get_default_settings() + -- print("title: ", require("pl.pretty").write(opts)) + assert(name == "console", "expected 'console' to be the default logger") + assert(type(opts) == "table", "expected 'opts' to be a table") + assert(opts.destination == "stderr", "expected 'destination' to be 'stderr'") + assert(opts.logLevel == "DEBUG", "expected 'logLevel' to be 'DEBUG'") + assert(opts.logPatterns.DEBUG == "%date %level %message\n") + assert(opts.logPatterns.INFO == "%date %level %message\n") + assert(opts.logPatterns.WARN == "%date %level %message\n") + assert(opts.logPatterns.ERROR == "%date %level %message\n") + assert(opts.logPatterns.FATAL == "%date %level %message\n") +end + +tests.returns_defaults_if_prefix_not_found = function() + assert(logenv.set_default_settings("not_a_real_prefix")) + local name, opts = logenv.get_default_settings() + -- print("title: ", require("pl.pretty").write(opts)) + assert(name == "console", "expected 'console' to be the default logger") + assert(type(opts) == "table", "expected 'opts' to be a table") + assert(opts.destination == "stderr", "expected 'destination' to be 'stderr'") + assert(opts.logLevel == "DEBUG", "expected 'logLevel' to be 'DEBUG'") + assert(opts.logPatterns.DEBUG == "%date %level %message\n") + assert(opts.logPatterns.INFO == "%date %level %message\n") + assert(opts.logPatterns.WARN == "%date %level %message\n") + assert(opts.logPatterns.ERROR == "%date %level %message\n") + assert(opts.logPatterns.FATAL == "%date %level %message\n") +end + +tests.fails_if_default_already_set = function() + assert(logenv.set_default_settings("prefix")) + local ok, err = logenv.set_default_settings("prefix") + assert(err == "already set a default") + assert(ok == nil) +end + +tests.prefix_defaults_to_LL = function() + env.LL_LOGLEVEL = assert(logging.ERROR) + local _, opts = logenv.get_default_settings() + -- print("title: ", require("pl.pretty").write(opts)) + assert(opts.logLevel == "ERROR", "expected 'logLevel' to be 'ERROR'") +end + +tests.loads_patterns_object = function() + env.LL_LOGPATTERN = "not used" + env.LL_LOGPATTERNS_DEBUG = "debug" + env.LL_LOGPATTERNS_INFO = "info" + env.LL_LOGPATTERNS_WARN = "warn" + env.LL_LOGPATTERNS_ERROR = "error" + env.LL_LOGPATTERNS_FATAL = "fatal" + local _, opts = logenv.get_default_settings() + -- print("title: ", require("pl.pretty").write(opts)) + assert(opts.logPattern == "not used") + assert(opts.logPatterns.DEBUG == "debug") + assert(opts.logPatterns.INFO == "info") + assert(opts.logPatterns.WARN == "warn") + assert(opts.logPatterns.ERROR == "error") + assert(opts.logPatterns.FATAL == "fatal") +end + +tests.fills_patterns_object_from_logpattern = function() + env.LL_LOGPATTERN = "this one" + local _, opts = logenv.get_default_settings() + -- print("title: ", require("pl.pretty").write(opts)) + assert(opts.logPattern == "this one") + assert(opts.logPatterns.DEBUG == "this one") + assert(opts.logPatterns.INFO == "this one") + assert(opts.logPatterns.WARN == "this one") + assert(opts.logPatterns.ERROR == "this one") + assert(opts.logPatterns.FATAL == "this one") +end + +tests.bad_loglevel_not_accepted = function() + env.LL_LOGLEVEL = "something bad" + local ok, loggername, opts = pcall(logenv.get_default_settings) + -- print("title: ", require("pl.pretty").write(opts)) + assert(not ok) + assert(opts == nil) + assert(type(loggername) == "string") +end + +tests.does_dynamic_lookups_of_vars = function() + local _, opts = logenv.get_default_settings() -- "LL" is now prefix + -- print("title: ", require("pl.pretty").write(opts)) + env.LL_SOME_VALUE = "hello" + assert(opts.some_value == "hello") +end + +tests.converts_booleans = function() + local _, opts = logenv.get_default_settings() -- "LL" is now prefix + -- print("title: ", require("pl.pretty").write(opts)) + env.LL_ONE = "TRUE" + env.LL_TWO = "true" + env.LL_THREE = "false" + env.LL_FOUR = "FALSE" + assert(opts.one == true) + assert(opts.two == true) + assert(opts.three == false) + assert(opts.four == false) +end + +tests.converts_numbers = function() + local _, opts = logenv.get_default_settings() -- "LL" is now prefix + env.LL_ONE = "1" + env.LL_TWO = "-2" + env.LL_THREE = ".2" + env.LL_FOUR = "1.2" + assert(opts.one == 1, "got: "..tostring(opts.one).." ("..type(opts.one)..")") + assert(opts.two == -2, "got: "..tostring(opts.two).." ("..type(opts.two)..")") + assert(opts.three == .2, "got: "..tostring(opts.three).." ("..type(opts.three)..")") + assert(opts.four == 1.2, "got: "..tostring(opts.four).." ("..type(opts.four)..")") +end + + + + +for name, func in pairs(tests) do + reset() + print("env-config test: " .. name) + func() +end + +print("[v] all env-config tests succesful") +os.getenv = old_getenv -- luacheck: ignore diff --git a/src/deps/src/luasec/CHANGELOG b/src/deps/src/luasec/CHANGELOG index cecd17963..b94f4ae20 100644 --- a/src/deps/src/luasec/CHANGELOG +++ b/src/deps/src/luasec/CHANGELOG @@ -1,3 +1,19 @@ +-------------------------------------------------------------------------------- +LuaSec 1.2.0 +--------------- +This version includes: + +* Add key material export method +* Backguard compat for openssl on providers, like LTS linuxes + +-------------------------------------------------------------------------------- +LuaSec 1.1.0 +--------------- +This version includes: + +* Fix missing DANE flag +* Remove unused parameter in https.lua + -------------------------------------------------------------------------------- LuaSec 1.0.2 --------------- diff --git a/src/deps/src/luasec/INSTALL b/src/deps/src/luasec/INSTALL index da421df6d..7dfbe5281 100644 --- a/src/deps/src/luasec/INSTALL +++ b/src/deps/src/luasec/INSTALL @@ -1,4 +1,4 @@ -LuaSec 1.0.2 +LuaSec 1.2.0 ------------ * OpenSSL options: diff --git a/src/deps/src/luasec/LICENSE b/src/deps/src/luasec/LICENSE index 41d08fdeb..96c5ce6eb 100644 --- a/src/deps/src/luasec/LICENSE +++ b/src/deps/src/luasec/LICENSE @@ -1,5 +1,5 @@ -LuaSec 1.0.2 license -Copyright (C) 2006-2021 Bruno Silvestre, UFG +LuaSec 1.2.0 license +Copyright (C) 2006-2022 Bruno Silvestre, UFG Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/src/deps/src/luasec/README.md b/src/deps/src/luasec/README.md index 352ed1859..e8da71adc 100644 --- a/src/deps/src/luasec/README.md +++ b/src/deps/src/luasec/README.md @@ -1,4 +1,4 @@ -LuaSec 1.0.2 +LuaSec 1.2.0 =============== LuaSec depends on OpenSSL, and integrates with LuaSocket to make it easy to add secure connections to any Lua applications or scripts. diff --git a/src/deps/src/luasec/luasec-1.0.2-1.rockspec b/src/deps/src/luasec/luasec-1.2.0-1.rockspec similarity index 97% rename from src/deps/src/luasec/luasec-1.0.2-1.rockspec rename to src/deps/src/luasec/luasec-1.2.0-1.rockspec index b59a77eaa..584e985b9 100644 --- a/src/deps/src/luasec/luasec-1.0.2-1.rockspec +++ b/src/deps/src/luasec/luasec-1.2.0-1.rockspec @@ -1,8 +1,8 @@ package = "LuaSec" -version = "1.0.2-1" +version = "1.2.0-1" source = { - url = "git://github.com/brunoos/luasec", - tag = "v1.0.2", + url = "git+https://github.com/brunoos/luasec", + tag = "v1.2.0", } description = { summary = "A binding for OpenSSL library to provide TLS/SSL communication over LuaSocket.", diff --git a/src/deps/src/luasec/src/compat.h b/src/deps/src/luasec/src/compat.h index 1c88de918..cb3ac8ee3 100644 --- a/src/deps/src/luasec/src/compat.h +++ b/src/deps/src/luasec/src/compat.h @@ -1,7 +1,7 @@ /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2006-2021 Bruno Silvestre + * Copyright (C) 2006-2022 Bruno Silvestre * *--------------------------------------------------------------------------*/ diff --git a/src/deps/src/luasec/src/config.c b/src/deps/src/luasec/src/config.c index f693c2076..ef1c04f67 100644 --- a/src/deps/src/luasec/src/config.c +++ b/src/deps/src/luasec/src/config.c @@ -1,7 +1,7 @@ /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2006-2021 Bruno Silvestre. + * Copyright (C) 2006-2022 Bruno Silvestre. * *--------------------------------------------------------------------------*/ @@ -77,8 +77,15 @@ LSEC_API int luaopen_ssl_config(lua_State *L) #ifdef LSEC_ENABLE_DANE // DANE lua_pushstring(L, "dane"); +#ifdef DANE_FLAG_NO_DANE_EE_NAMECHECKS + lua_createtable(L, 0, 1); + lua_pushstring(L, "no_ee_namechecks"); lua_pushboolean(L, 1); lua_rawset(L, -3); +#else + lua_pushboolean(L, 1); +#endif + lua_rawset(L, -3); #endif #ifndef OPENSSL_NO_EC diff --git a/src/deps/src/luasec/src/context.c b/src/deps/src/luasec/src/context.c index 170acfde6..0bb482686 100644 --- a/src/deps/src/luasec/src/context.c +++ b/src/deps/src/luasec/src/context.c @@ -1,9 +1,9 @@ /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2014-2021 Kim Alvefur, Paul Aurich, Tobias Markmann, + * Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann, * Matthew Wild. - * Copyright (C) 2006-2021 Bruno Silvestre. + * Copyright (C) 2006-2022 Bruno Silvestre. * *--------------------------------------------------------------------------*/ @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -711,11 +712,31 @@ static int set_alpn_cb(lua_State *L) /* * DANE */ +static int dane_options[] = { + /* TODO move into options.c + * however this symbol is not from openssl/ssl.h but rather from + * openssl/x509_vfy.h + * */ +#ifdef DANE_FLAG_NO_DANE_EE_NAMECHECKS + DANE_FLAG_NO_DANE_EE_NAMECHECKS, +#endif + 0 +}; +static const char *dane_option_names[] = { +#ifdef DANE_FLAG_NO_DANE_EE_NAMECHECKS + "no_ee_namechecks", +#endif + NULL +}; + static int set_dane(lua_State *L) { - int ret; + int ret, i; SSL_CTX *ctx = lsec_checkcontext(L, 1); ret = SSL_CTX_dane_enable(ctx); + for (i = 2; ret > 0 && i <= lua_gettop(L); i++) { + ret = SSL_CTX_dane_set_flags(ctx, dane_options[luaL_checkoption(L, i, NULL, dane_option_names)]); + } lua_pushboolean(L, (ret > 0)); return 1; } diff --git a/src/deps/src/luasec/src/context.h b/src/deps/src/luasec/src/context.h index ae746e804..a2dd7dbf9 100644 --- a/src/deps/src/luasec/src/context.h +++ b/src/deps/src/luasec/src/context.h @@ -2,9 +2,9 @@ #define LSEC_CONTEXT_H /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2006-2021 Bruno Silvestre + * Copyright (C) 2006-2022 Bruno Silvestre * *--------------------------------------------------------------------------*/ diff --git a/src/deps/src/luasec/src/ec.h b/src/deps/src/luasec/src/ec.h index 39717ab8a..7bf700d09 100644 --- a/src/deps/src/luasec/src/ec.h +++ b/src/deps/src/luasec/src/ec.h @@ -1,7 +1,7 @@ /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2006-2021 Bruno Silvestre + * Copyright (C) 2006-2022 Bruno Silvestre * *--------------------------------------------------------------------------*/ diff --git a/src/deps/src/luasec/src/https.lua b/src/deps/src/luasec/src/https.lua index 21bf530bf..1d7ec7b66 100644 --- a/src/deps/src/luasec/src/https.lua +++ b/src/deps/src/luasec/src/https.lua @@ -1,6 +1,6 @@ ---------------------------------------------------------------------------- --- LuaSec 1.0.2 --- Copyright (C) 2009-2021 PUC-Rio +-- LuaSec 1.2.0 +-- Copyright (C) 2009-2022 PUC-Rio -- -- Author: Pablo Musa -- Author: Tomas Guisasola @@ -18,8 +18,8 @@ local try = socket.try -- Module -- local _M = { - _VERSION = "1.0.2", - _COPYRIGHT = "LuaSec 1.0.2 - Copyright (C) 2009-2021 PUC-Rio", + _VERSION = "1.2.0", + _COPYRIGHT = "LuaSec 1.2.0 - Copyright (C) 2009-2022 PUC-Rio", PORT = 443, TIMEOUT = 60 } @@ -93,7 +93,7 @@ local function tcp(params) self.sock:sni(host) self.sock:settimeout(_M.TIMEOUT) try(self.sock:dohandshake()) - reg(self, getmetatable(self.sock)) + reg(self) return 1 end return conn diff --git a/src/deps/src/luasec/src/options.c b/src/deps/src/luasec/src/options.c index d636f7d56..2037c2e81 100644 --- a/src/deps/src/luasec/src/options.c +++ b/src/deps/src/luasec/src/options.c @@ -1,7 +1,7 @@ /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2006-2021 Bruno Silvestre + * Copyright (C) 2006-2022 Bruno Silvestre * *--------------------------------------------------------------------------*/ diff --git a/src/deps/src/luasec/src/options.h b/src/deps/src/luasec/src/options.h index cd8bceae6..7f4ce0a30 100644 --- a/src/deps/src/luasec/src/options.h +++ b/src/deps/src/luasec/src/options.h @@ -2,9 +2,9 @@ #define LSEC_OPTIONS_H /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2006-2021 Bruno Silvestre + * Copyright (C) 2006-2022 Bruno Silvestre * *--------------------------------------------------------------------------*/ diff --git a/src/deps/src/luasec/src/options.lua b/src/deps/src/luasec/src/options.lua index d9a880171..8899ed2de 100644 --- a/src/deps/src/luasec/src/options.lua +++ b/src/deps/src/luasec/src/options.lua @@ -18,9 +18,9 @@ end local function generate(options, version) print([[ /*-------------------------------------------------------------------------- - * LuaSec 1.1.1 + * LuaSec 1.2.0 * - * Copyright (C) 2006-2021 Bruno Silvestre + * Copyright (C) 2006-2022 Bruno Silvestre * *--------------------------------------------------------------------------*/ diff --git a/src/deps/src/luasec/src/ssl.c b/src/deps/src/luasec/src/ssl.c index 598c37cbb..c546a8705 100644 --- a/src/deps/src/luasec/src/ssl.c +++ b/src/deps/src/luasec/src/ssl.c @@ -1,9 +1,9 @@ /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2014-2021 Kim Alvefur, Paul Aurich, Tobias Markmann, + * Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann, * Matthew Wild. - * Copyright (C) 2006-2021 Bruno Silvestre. + * Copyright (C) 2006-2022 Bruno Silvestre. * *--------------------------------------------------------------------------*/ @@ -671,6 +671,41 @@ static int meth_getpeerfinished(lua_State *L) return 1; } +/** + * Get some shared keying material + */ +static int meth_exportkeyingmaterial(lua_State *L) +{ + p_ssl ssl = (p_ssl)luaL_checkudata(L, 1, "SSL:Connection"); + + if(ssl->state != LSEC_STATE_CONNECTED) { + lua_pushnil(L); + lua_pushstring(L, "closed"); + return 0; + } + + size_t llen = 0; + size_t contextlen = 0; + const unsigned char *context = NULL; + const char *label = (const char*)luaL_checklstring(L, 2, &llen); + size_t olen = (size_t)luaL_checkinteger(L, 3); + + if (!lua_isnoneornil(L, 4)) + context = (const unsigned char*)luaL_checklstring(L, 4, &contextlen); + + /* Temporary buffer memory-managed by Lua itself */ + unsigned char *out = (unsigned char*)lua_newuserdata(L, olen); + + if(SSL_export_keying_material(ssl->ssl, out, olen, label, llen, context, contextlen, context != NULL) != 1) { + lua_pushnil(L); + lua_pushstring(L, "error exporting keying material"); + return 2; + } + + lua_pushlstring(L, (char*)out, olen); + return 1; +} + /** * Object information -- tostring metamethod */ @@ -826,7 +861,7 @@ static int meth_getalpn(lua_State *L) static int meth_copyright(lua_State *L) { - lua_pushstring(L, "LuaSec 1.0.2 - Copyright (C) 2006-2021 Bruno Silvestre, UFG" + lua_pushstring(L, "LuaSec 1.2.0 - Copyright (C) 2006-2022 Bruno Silvestre, UFG" #if defined(WITH_LUASOCKET) "\nLuaSocket 3.0-RC1 - Copyright (C) 2004-2013 Diego Nehab" #endif @@ -876,6 +911,7 @@ static luaL_Reg methods[] = { {"getpeerchain", meth_getpeerchain}, {"getpeerverification", meth_getpeerverification}, {"getpeerfinished", meth_getpeerfinished}, + {"exportkeyingmaterial",meth_exportkeyingmaterial}, {"getsniname", meth_getsniname}, {"getstats", meth_getstats}, {"setstats", meth_setstats}, diff --git a/src/deps/src/luasec/src/ssl.h b/src/deps/src/luasec/src/ssl.h index 3ee343549..69b010fe7 100644 --- a/src/deps/src/luasec/src/ssl.h +++ b/src/deps/src/luasec/src/ssl.h @@ -2,9 +2,9 @@ #define LSEC_SSL_H /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2006-2021 Bruno Silvestre + * Copyright (C) 2006-2022 Bruno Silvestre * *--------------------------------------------------------------------------*/ diff --git a/src/deps/src/luasec/src/ssl.lua b/src/deps/src/luasec/src/ssl.lua index 72a4e5cfd..f49b172e4 100644 --- a/src/deps/src/luasec/src/ssl.lua +++ b/src/deps/src/luasec/src/ssl.lua @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ --- LuaSec 1.0.2 +-- LuaSec 1.2.0 -- --- Copyright (C) 2006-2021 Bruno Silvestre +-- Copyright (C) 2006-2022 Bruno Silvestre -- ------------------------------------------------------------------------------ @@ -202,7 +202,11 @@ local function newcontext(cfg) end if config.capabilities.dane and cfg.dane then - context.setdane(ctx) + if type(cfg.dane) == "table" then + context.setdane(ctx, unpack(cfg.dane)) + else + context.setdane(ctx) + end end return ctx @@ -271,7 +275,7 @@ core.setmethod("info", info) -- local _M = { - _VERSION = "1.0.2", + _VERSION = "1.2.0", _COPYRIGHT = core.copyright(), config = config, loadcertificate = x509.load, diff --git a/src/deps/src/luasec/src/x509.c b/src/deps/src/luasec/src/x509.c index 0b05c6584..9bb5e5785 100644 --- a/src/deps/src/luasec/src/x509.c +++ b/src/deps/src/luasec/src/x509.c @@ -1,7 +1,7 @@ /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2014-2021 Kim Alvefur, Paul Aurich, Tobias Markmann + * Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann * Matthew Wild, Bruno Silvestre. * *--------------------------------------------------------------------------*/ @@ -655,6 +655,7 @@ static int meth_set_encode(lua_State* L) return 1; } +#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) /** * Get signature name. */ @@ -669,6 +670,7 @@ static int meth_get_signature_name(lua_State* L) lua_pushstring(L, name); return 1; } +#endif /*---------------------------------------------------------------------------*/ @@ -698,7 +700,9 @@ static luaL_Reg methods[] = { {"digest", meth_digest}, {"setencode", meth_set_encode}, {"extensions", meth_extensions}, +#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) {"getsignaturename", meth_get_signature_name}, +#endif {"issuer", meth_issuer}, {"notbefore", meth_notbefore}, {"notafter", meth_notafter}, diff --git a/src/deps/src/luasec/src/x509.h b/src/deps/src/luasec/src/x509.h index ec903d5da..f47b87e71 100644 --- a/src/deps/src/luasec/src/x509.h +++ b/src/deps/src/luasec/src/x509.h @@ -1,7 +1,7 @@ /*-------------------------------------------------------------------------- - * LuaSec 1.0.2 + * LuaSec 1.2.0 * - * Copyright (C) 2014-2021 Kim Alvefur, Paul Aurich, Tobias Markmann + * Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann * Matthew Wild, Bruno Silvestre. * *--------------------------------------------------------------------------*/ diff --git a/src/deps/src/luasocket/.editorconfig b/src/deps/src/luasocket/.editorconfig new file mode 100644 index 000000000..56ad87df5 --- /dev/null +++ b/src/deps/src/luasocket/.editorconfig @@ -0,0 +1,23 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +[{*.lua,*.rockspec,.luacheckrc}] +indent_style = space +indent_size = 4 + +[Makefile] +indent_style = tab +indent_size = 4 + +[*.html] +indent_style = space +indent_size = 4 + +[*.{c,h}] +indent_style = space +indent_size = 4 diff --git a/src/deps/src/luasocket/.github/workflows/build.yml b/src/deps/src/luasocket/.github/workflows/build.yml new file mode 100644 index 000000000..ee6e1d4cd --- /dev/null +++ b/src/deps/src/luasocket/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: Build + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + name: Test build on ${{ matrix.platform }} + strategy: + fail-fast: false + matrix: + luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ] + platform: [ "ubuntu-20.04", "macos-11" ] # "windows-2022" not supported by gh-actions-lua + runs-on: ${{ matrix.platform }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup ‘lua’ + uses: leafo/gh-actions-lua@v9 + with: + luaVersion: ${{ matrix.luaVersion }} + - name: Setup ‘luarocks’ + uses: leafo/gh-actions-luarocks@v4 + - name: Make and install + run: | + export DEBUG=DEBUG + luarocks make -- luasocket-scm-3.rockspec + - name: Run regression tests + run: | + cd test + lua hello.lua + lua testsrvr.lua > /dev/null & + lua testclnt.lua + lua stufftest.lua + lua excepttest.lua + lua test_bind.lua + lua test_getaddrinfo.lua + lua ltn12test.lua + lua mimetest.lua + lua urltest.lua + lua test_socket_error.lua + kill %1 diff --git a/src/deps/src/luasocket/.github/workflows/deploy.yml b/src/deps/src/luasocket/.github/workflows/deploy.yml new file mode 100644 index 000000000..acd66ea1a --- /dev/null +++ b/src/deps/src/luasocket/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Deploy + +on: [ push, workflow_dispatch ] + +jobs: + + affected: + uses: lunarmodules/.github/.github/workflows/list_affected_rockspecs.yml@main + + build: + needs: affected + if: ${{ needs.affected.outputs.rockspecs }} + uses: lunarmodules/.github/.github/workflows/test_build_rock.yml@main + with: + rockspecs: ${{ needs.affected.outputs.rockspecs }} + + upload: + needs: [ affected, build ] + # Only run upload if: + # 1. We are on the canonical repository (no uploads from forks) + # 2. The current commit is either tagged or on the default branch (the workflow will upload dev/scm rockspecs any + # time they are touched, tagged ones whenever the edited rockspec and tag match) + # 3. Some rockspecs were changed — this implies the commit changing the rockspec is the same one that gets tagged + if: >- + ${{ + github.repository == 'lunarmodules/luasocket' && + ( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) && + needs.affected.outputs.rockspecs + }} + uses: lunarmodules/.github/.github/workflows/upload_to_luarocks.yml@main + with: + rockspecs: ${{ needs.affected.outputs.rockspecs }} + secrets: + apikey: ${{ secrets.LUAROCKS_APIKEY }} diff --git a/src/deps/src/luasocket/.github/workflows/luacheck.yml b/src/deps/src/luasocket/.github/workflows/luacheck.yml new file mode 100644 index 000000000..2f20456a5 --- /dev/null +++ b/src/deps/src/luasocket/.github/workflows/luacheck.yml @@ -0,0 +1,13 @@ +name: Luacheck + +on: [push, pull_request] + +jobs: + + luacheck: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Luacheck + uses: lunarmodules/luacheck@v0 diff --git a/src/deps/src/luasocket/.luacheckrc b/src/deps/src/luasocket/.luacheckrc new file mode 100644 index 000000000..8b25dd7a4 --- /dev/null +++ b/src/deps/src/luasocket/.luacheckrc @@ -0,0 +1,31 @@ +unused_args = false +redefined = false +max_line_length = false + +not_globals = { + "string.len", + "table.getn", +} + +include_files = { + "**/*.lua", + "**/*.rockspec", + ".busted", + ".luacheckrc", +} + +exclude_files = { + "etc/*.lua", + "etc/**/*.lua", + "test/*.lua", + "test/**/*.lua", + "samples/*.lua", + "samples/**/*.lua", + "gem/*.lua", + "gem/**/*.lua", + -- GH Actions Lua Environment + ".lua", + ".luarocks", + ".install", +} + diff --git a/src/deps/src/luasocket/.travis.yml b/src/deps/src/luasocket/.travis.yml deleted file mode 100644 index fce8a965f..000000000 --- a/src/deps/src/luasocket/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -language: erlang - -env: - global: - - LUAROCKS_BASE=luarocks-2.0.13 - matrix: - - LUA=lua5.1 LUA_DEV=liblua5.1-dev LUA_VER=5.1 LUA_SFX=5.1 LUA_INCDIR=/usr/include/lua5.1 - - LUA=lua5.2 LUA_DEV=liblua5.2-dev LUA_VER=5.2 LUA_SFX=5.2 LUA_INCDIR=/usr/include/lua5.2 - - LUA=luajit LUA_DEV=libluajit-5.1-dev LUA_VER=5.1 LUA_SFX=jit LUA_INCDIR=/usr/include/luajit-2.0 - -branches: - only: - - master - -before_install: - - if [ $LUA = "luajit" ]; then - sudo add-apt-repository ppa:mwild1/ppa -y && sudo apt-get update -y; - fi - - sudo apt-get install $LUA - - sudo apt-get install $LUA_DEV - - lua$LUA_SFX -v - # Install a recent luarocks release - - wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz - - tar zxvpf $LUAROCKS_BASE.tar.gz - - cd $LUAROCKS_BASE - - ./configure - --lua-version=$LUA_VER --lua-suffix=$LUA_SFX --with-lua-include="$LUA_INCDIR" - - sudo make - - sudo make install - - cd $TRAVIS_BUILD_DIR - - -install: - - export DEBUG=DEBUG - - sudo -E luarocks make luasocket-scm-0.rockspec - -script: - - cd test - - lua$LUA_SFX hello.lua - - lua$LUA_SFX testsrvr.lua > /dev/null & - - lua$LUA_SFX testclnt.lua - - lua$LUA_SFX stufftest.lua - - lua$LUA_SFX excepttest.lua - - lua$LUA_SFX test_bind.lua - - lua$LUA_SFX test_getaddrinfo.lua - - lua$LUA_SFX ltn12test.lua - - lua$LUA_SFX mimetest.lua - - lua$LUA_SFX urltest.lua - - lua$LUA_SFX test_socket_error.lua - -notifications: - email: - on_success: change - on_failure: always diff --git a/src/deps/src/luasocket/CHANGELOG.md b/src/deps/src/luasocket/CHANGELOG.md new file mode 100644 index 000000000..3a25186b9 --- /dev/null +++ b/src/deps/src/luasocket/CHANGELOG.md @@ -0,0 +1,65 @@ +# Changelog + +## [v3.1.0](https://github.com/lunarmodules/luasocket/releases/v3.1.0) — 2022-07-27 + +* Add support for TCP Defer Accept – @Zash +* Add support for TCP Fast Open – @Zash +* Fix Windows (mingw32) builds – @goldenstein64 +* Avoid build warnings on 64-bit Windows – @rpatters1 + +## [v3.0.0](https://github.com/lunarmodules/luasocket/releases/v3.0.0) — 2022-03-25 + +The last time LuaSocket had a stable release tag was 14 years ago when 2.0.2 was tagged. +A v3 release candidate was tagged 9 years ago. +Since then it has been downloaded over 3 million times. +Additionally the Git repository regularly gets several hundred clones a day. +But 9 years is a long time and even the release candidate has grown a bit long in the tooth. +Many Linux distros have packaged the current Git HEAD or some specific tested point as dated or otherwise labeled releases. +256 commits later and having been migrated to the @lunarmodules org namespace on GitHub, please welcome v3. + +This release is a "safe-harbor" tag that represents a minimal amount of changes to get a release tagged. +Beyond some CI tooling, very little code has changed since migration to @lunarmodules ([5b18e47..e47d98f](https://github.com/lunarmodules/luasocket/compare/5b18e47..e47d98f?w=1)): + +* Lua 5.4.3+ support – @pkulchenko, @Zash +* Cleanup minor issues to get a code linter to pass – @Tieske, @jyoui, @alerque +* Update Visual Studio build rules for Lua 5.1 – @ewestbrook +* Set http transfer-encoding even without content-length – @tokenrove + +Prior to migration to @lunarmodules ([v3.0-rc1..5b18e47](https://github.com/lunarmodules/luasocket/compare/v3.0-rc1..5b18e47?w=1)) many things happened of which the author of this changelog is not fully apprised. +Your best bet if it affects your project somehow is to read the commit log & diffs yourself. + +## [v3.0-rc1](https://github.com/lunarmodules/luasocket/releases/v3.0-rc1) — 2013-06-14 + +Main changes for LuaSocket 3.0-rc1 are IPv6 support and Lua 5.2 compatibility. + +* Added: Compatible with Lua 5.2 + - Note that unless you define LUA_COMPAT_MODULE, package tables will not be exported as globals! +* Added: IPv6 support; + - Socket.connect and socket.bind support IPv6 addresses; + - Getpeername and getsockname support IPv6 addresses, and return the socket family as a third value; + - URL module updated to support IPv6 host names; + - New socket.tcp6 and socket.udp6 functions; + - New socket.dns.getaddrinfo and socket.dns.getnameinfo functions; +* Added: getoption method; +* Fixed: url.unescape was returning additional values; +* Fixed: mime.qp, mime.unqp, mime.b64, and mime.unb64 could mistaking their own stack slots for functions arguments; +* Fixed: Receiving zero-length datagram is now possible; +* Improved: Hidden all internal library symbols; +* Improved: Better error messages; +* Improved: Better documentation of socket options. +* Fixed: manual sample of HTTP authentication now uses correct "authorization" header (Alexandre Ittner); +* Fixed: failure on bind() was destroying the socket (Sam Roberts); +* Fixed: receive() returns immediatelly if prefix can satisfy bytes requested (M Joonas Pihlaja); +* Fixed: multicast didn't work on Windows, or anywhere else for that matter (Herbert Leuwer, Adrian Sietsma); +* Fixed: select() now reports an error when called with more sockets than FD_SETSIZE (Lorenzo Leonini); +* Fixed: manual links to home.html changed to index.html (Robert Hahn); +* Fixed: mime.unb64() would return an empty string on results that started with a null character (Robert Raschke); +* Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray); +* Fixed: calling sleep() with negative numbers could block forever, wasting CPU. Now it returns immediately (MPB); +* Improved: FTP commands are now sent in upper case to help buggy servers (Anders Eurenius); +* Improved: known headers now sent in canonic capitalization to help buggy servers (Joseph Stewart); +* Improved: Clarified tcp:receive() in the manual (MPB); +* Improved: Decent makefiles (LHF). +* Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei). + +## [v2.0.2](https://github.com/lunarmodules/luasocket/releases/v2.0.2) — 2007-09-11 diff --git a/src/deps/src/luasocket/LICENSE b/src/deps/src/luasocket/LICENSE index b63545107..a8ed03ea2 100644 --- a/src/deps/src/luasocket/LICENSE +++ b/src/deps/src/luasocket/LICENSE @@ -1,5 +1,4 @@ -LuaSocket 3.0 license -Copyright 2004-2013 Diego Nehab +Copyright (C) 2004-2022 Diego Nehab Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/src/deps/src/luasocket/NEW b/src/deps/src/luasocket/NEW deleted file mode 100644 index 0bff64c1d..000000000 --- a/src/deps/src/luasocket/NEW +++ /dev/null @@ -1,44 +0,0 @@ -What's New - -Main changes for LuaSocket 3.0-rc1 are IPv6 support and Lua 5.2 compatibility. - - * Added: Compatible with Lua 5.2 - - Note that unless you define LUA_COMPAT_MODULE, package - tables will not be exported as globals! - * Added: IPv6 support; - - Socket.connect and socket.bind support IPv6 addresses; - - Getpeername and getsockname support IPv6 addresses, and - return the socket family as a third value; - - URL module updated to support IPv6 host names; - - New socket.tcp6 and socket.udp6 functions; - - New socket.dns.getaddrinfo and socket.dns.getnameinfo functions; - * Added: getoption method; - * Fixed: url.unescape was returning additional values; - * Fixed: mime.qp, mime.unqp, mime.b64, and mime.unb64 could - mistaking their own stack slots for functions arguments; - * Fixed: Receiving zero-length datagram is now possible; - * Improved: Hidden all internal library symbols; - * Improved: Better error messages; - * Improved: Better documentation of socket options. - * Fixed: manual sample of HTTP authentication now uses correct - "authorization" header (Alexandre Ittner); - * Fixed: failure on bind() was destroying the socket (Sam Roberts); - * Fixed: receive() returns immediatelly if prefix can satisfy - bytes requested (M Joonas Pihlaja); - * Fixed: multicast didn't work on Windows, or anywhere - else for that matter (Herbert Leuwer, Adrian Sietsma); - * Fixed: select() now reports an error when called with more - sockets than FD_SETSIZE (Lorenzo Leonini); - * Fixed: manual links to home.html changed to index.html (Robert Hahn); - * Fixed: mime.unb64() would return an empty string on results that started - with a null character (Robert Raschke); - * Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray); - * Fixed: calling sleep() with negative numbers could - block forever, wasting CPU. Now it returns immediately (MPB); - * Improved: FTP commands are now sent in upper case to - help buggy servers (Anders Eurenius); - * Improved: known headers now sent in canonic - capitalization to help buggy servers (Joseph Stewart); - * Improved: Clarified tcp:receive() in the manual (MPB); - * Improved: Decent makefiles (LHF). - * Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei). diff --git a/src/deps/src/luasocket/README b/src/deps/src/luasocket/README deleted file mode 100644 index cd8ee59d1..000000000 --- a/src/deps/src/luasocket/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the LuaSocket 3.0-rc1. It has been tested on Windows 7, Mac OS X, -and Linux. - -Please use the project page at GitHub - - https://github.com/diegonehab/luasocket - -to file bug reports or propose changes. - -Have fun, -Diego Nehab. diff --git a/src/deps/src/luasocket/README.md b/src/deps/src/luasocket/README.md new file mode 100644 index 000000000..af722be68 --- /dev/null +++ b/src/deps/src/luasocket/README.md @@ -0,0 +1,12 @@ +# LuaSocket + + +[![Build](https://img.shields.io/github/workflow/status/lunarmodules/luasocket/Build?label=Build=Lua)](https://github.com/lunarmodules/luasocket/actions?workflow=Build) +[![Luacheck](https://img.shields.io/github/workflow/status/lunarmodules/luasocket/Luacheck?label=Luacheck&logo=Lua)](https://github.com/lunarmodules/luasocket/actions?workflow=Luacheck) +[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/lunarmodules/luasocket?label=Tag&logo=GitHub)](https://github.com/lunarmodules/luasocket/releases) +[![Luarocks](https://img.shields.io/luarocks/v/lunarmodules/luasocket?label=Luarocks&logo=Lua)](https://luarocks.org/modules/lunarmodules/luasocket) + +LuaSocket is a Lua extension library composed of two parts: + +1. a set of C modules that provide support for the TCP and UDP transport layers, and +2. a set of Lua modules that provide functions commonly needed by applications that deal with the Internet. diff --git a/src/deps/src/luasocket/doc/index.html b/src/deps/src/luasocket/doc/index.html deleted file mode 100644 index 7d81b411d..000000000 --- a/src/deps/src/luasocket/doc/index.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - -LuaSocket: Network support for the Lua language - - - - - - - -
    -
    -
    -
    GCCClang
    LLVM
    MSVC
    - - -
    -LuaSocket -
    Network support for the Lua language -
    -

    -home · -download · -installation · -introduction · -reference -

    - -
    - - - - -

    What is LuaSocket?

    - -

    -LuaSocket is a Lua extension library -that is composed by two parts: a C core that provides support for the TCP -and UDP transport layers, and a set of Lua modules that add support for -functionality commonly needed by applications that deal with the Internet. -

    - -

    -The core support has been implemented so that it is both efficient and -simple to use. It is available to any Lua application once it has been -properly initialized by the interpreter in use. The code has been tested -and runs well on several Windows and UNIX platforms.

    - -

    -Among the support modules, the most commonly used implement the -SMTP -(sending e-mails), -HTTP -(WWW access) and -FTP -(uploading and downloading files) client -protocols. These provide a very natural and generic interface to the -functionality defined by each protocol. -In addition, you will find that the -MIME (common encodings), -URL -(anything you could possible want to do with one) and -LTN12 -(filters, sinks, sources and pumps) modules can be very handy. -

    - -

    -The library is available under the same - -terms and conditions as the Lua language, the MIT license. The idea is -that if you can use Lua in a project, you should also be able to use -LuaSocket. -

    - -

    -Copyright © 1999-2013 Diego Nehab. All rights reserved.
    -Author: Diego Nehab -

    - - - -

    Download

    - -

    -LuaSocket version 3.0-rc1 is now available for download! -It is compatible with Lua 5.1 and 5.2, and has -been tested on Windows XP, Linux, and Mac OS X. Chances -are it works well on most UNIX distributions and Windows flavors. -

    - -

    -The current version of the library can be found at -the LuaSocket -project page on GitHub. Besides the full C and Lua source code -for the library, the distribution contains several examples, -this user's manual and basic test procedures. -

    - -

    Take a look at the installation section of the -manual to find out how to properly install the library. -

    - - - -

    Special thanks

    - -

    -This marks the first release of LuaSocket that -wholeheartedly embraces the open-source development -philosophy. After a long hiatus, Matthew Wild finally -convinced me it was time for a release including IPv6 and -Lua 5.2 support. It was more work than we anticipated. -Special thanks to Sam Roberts, Florian Zeitz, and Paul -Aurich, Liam Devine, Alexey Melnichuk, and everybody else -that has helped bring this library back to life. -

    - - - -

    What's New

    - -

    -Main changes for LuaSocket 3.0-rc1 are IPv6 support -and Lua 5.2 compatibility. -

    - -
      -
    • Added: Compatible with Lua 5.2 -
        -
      • Note that unless you define LUA_COMPAT_MODULE, -package tables will not be exported as globals! -
      -
    • Added: IPv6 support; -
        -
      • Socket.connect and socket.bind support IPv6 addresses; -
      • Getpeername and getsockname support -IPv6 addresses, and return the socket family as a third value; -
      • URL module updated to support IPv6 host names; -
      • New socket.tcp6 and socket.udp6 functions; -
      • New socket.dns.getaddrinfo and - socket.dns.getnameinfo functions; -
      -
    • Added: getoption method; -
    • Fixed: url.unescape was returning additional values; -
    • Fixed: mime.qp, mime.unqp, - mime.b64, and mime.unb64 could - mistaking their own stack slots for functions arguments; -
    • Fixed: Receiving zero-length datagram is now possible; -
    • Improved: Hidden all internal library symbols; -
    • Improved: Better error messages; -
    • Improved: Better documentation of socket options. -
    • Fixed: manual sample of HTTP authentication now uses correct - "authorization" header (Alexandre Ittner); -
    • Fixed: failure on bind() was destroying the socket (Sam Roberts); -
    • Fixed: receive() returns immediatelly if prefix can satisfy - bytes requested (M Joonas Pihlaja); -
    • Fixed: multicast didn't work on Windows, or anywhere - else for that matter (Herbert Leuwer, Adrian Sietsma); -
    • Fixed: select() now reports an error when called with more - sockets than FD_SETSIZE (Lorenzo Leonini); -
    • Fixed: manual links to home.html changed to index.html -(Robert Hahn); -
    • Fixed: mime.unb64() would return an empty string on results that started - with a null character (Robert Raschke); -
    • Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray); -
    • Fixed: calling sleep() with negative numbers could - block forever, wasting CPU. Now it returns immediately (MPB); -
    • Improved: FTP commands are now sent in upper case to - help buggy servers (Anders Eurenius); -
    • Improved: known headers now sent in canonic - capitalization to help buggy servers (Joseph Stewart); -
    • Improved: Clarified tcp:receive() in the manual (MPB); -
    • Improved: Decent makefiles (LHF). -
    • Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei). -
    - - - -

    Old Versions

    - -

    -All previous versions of the LuaSocket library can be downloaded -here. Although these versions are no longer supported, they are -still available for those that have compatibility issues. -

    - - - - - - - diff --git a/src/deps/src/luasocket/doc/dns.html b/src/deps/src/luasocket/docs/dns.html similarity index 70% rename from src/deps/src/luasocket/doc/dns.html rename to src/deps/src/luasocket/docs/dns.html index c4a0472e2..56ce3ba40 100644 --- a/src/deps/src/luasocket/doc/dns.html +++ b/src/deps/src/luasocket/docs/dns.html @@ -1,4 +1,4 @@ - @@ -13,22 +13,22 @@ -
    +

    - -
    -LuaSocket +
    +LuaSocket
    Network support for the Lua language +
    Network support for the Lua language
    -

    +

    home · download · installation · introduction · -reference +reference


    @@ -36,14 +36,14 @@ -

    DNS

    +

    DNS

    -IPv4 name resolution functions -dns.toip +IPv4 name resolution functions +dns.toip and -dns.tohostname -return all information obtained from +dns.tohostname +return all information obtained from the resolver in a table of the form:

    @@ -60,10 +60,10 @@ Note that the alias list can be empty.

    -The more general name resolution function -dns.getaddrinfo, which +The more general name resolution function +dns.getaddrinfo, which supports both IPv6 and IPv4, -returns all information obtained from +returns all information obtained from the resolver in a table of the form:

    @@ -88,82 +88,82 @@ addresses, and "inet6" for IPv6 addresses. -

    +

    socket.dns.getaddrinfo(address)

    -

    -Converts from host name to address. +

    +Converts from host name to address.

    -

    -Address can be an IPv4 or IPv6 address or host name. +

    +Address can be an IPv4 or IPv6 address or host name.

    -

    +

    The function returns a table with all information returned by the resolver. In case of error, the function returns nil -followed by an error message. +followed by an error message.

    -

    +

    socket.dns.gethostname()

    -

    -Returns the standard host name for the machine as a string. +

    +Returns the standard host name for the machine as a string.

    -

    +

    socket.dns.tohostname(address)

    -

    +

    Converts from IPv4 address to host name.

    -

    -Address can be an IP address or host name. +

    +Address can be an IP address or host name.

    -

    +

    The function returns a string with the canonic host name of the given address, followed by a table with all information returned by the resolver. In case of error, the function returns nil -followed by an error message. +followed by an error message.

    -

    +

    socket.dns.toip(address)

    -

    +

    Converts from host name to IPv4 address.

    -

    -Address can be an IP address or host name. +

    +Address can be an IP address or host name.

    -

    +

    Returns a string with the first IP address found for address, followed by a table with all information returned by the resolver. In case of error, the function returns nil followed by an error -message. +message.

    -