diff --git a/standalone/.gitignore b/standalone/.gitignore new file mode 100644 index 00000000..948bb450 --- /dev/null +++ b/standalone/.gitignore @@ -0,0 +1,9 @@ +*.sdf +*.log +*.tlog +*.exe +*.ilk +*.pdb +*.lib +*.obj +*.idb diff --git a/standalone/Debug/CL.read.1.tlog b/standalone/Debug/CL.read.1.tlog deleted file mode 100644 index dcbd85a2..00000000 Binary files a/standalone/Debug/CL.read.1.tlog and /dev/null differ diff --git a/standalone/Debug/CL.write.1.tlog b/standalone/Debug/CL.write.1.tlog deleted file mode 100644 index 1b4de762..00000000 Binary files a/standalone/Debug/CL.write.1.tlog and /dev/null differ diff --git a/standalone/Debug/acmp.obj b/standalone/Debug/acmp.obj deleted file mode 100644 index 7359facb..00000000 Binary files a/standalone/Debug/acmp.obj and /dev/null differ diff --git a/standalone/Debug/apache2_config.obj b/standalone/Debug/apache2_config.obj deleted file mode 100644 index 03495b35..00000000 Binary files a/standalone/Debug/apache2_config.obj and /dev/null differ diff --git a/standalone/Debug/apache2_io.obj b/standalone/Debug/apache2_io.obj deleted file mode 100644 index 9d1c7ca8..00000000 Binary files a/standalone/Debug/apache2_io.obj and /dev/null differ diff --git a/standalone/Debug/apache2_util.obj b/standalone/Debug/apache2_util.obj deleted file mode 100644 index c99bd971..00000000 Binary files a/standalone/Debug/apache2_util.obj and /dev/null differ diff --git a/standalone/Debug/api.obj b/standalone/Debug/api.obj deleted file mode 100644 index 39a46517..00000000 Binary files a/standalone/Debug/api.obj and /dev/null differ diff --git a/standalone/Debug/buckets.obj b/standalone/Debug/buckets.obj deleted file mode 100644 index 0adf5471..00000000 Binary files a/standalone/Debug/buckets.obj and /dev/null differ diff --git a/standalone/Debug/cl.command.1.tlog b/standalone/Debug/cl.command.1.tlog deleted file mode 100644 index 5f23464a..00000000 Binary files a/standalone/Debug/cl.command.1.tlog and /dev/null differ diff --git a/standalone/Debug/config.obj b/standalone/Debug/config.obj deleted file mode 100644 index ab8038c3..00000000 Binary files a/standalone/Debug/config.obj and /dev/null differ diff --git a/standalone/Debug/filters.obj b/standalone/Debug/filters.obj deleted file mode 100644 index af72ce7d..00000000 Binary files a/standalone/Debug/filters.obj and /dev/null differ diff --git a/standalone/Debug/hooks.obj b/standalone/Debug/hooks.obj deleted file mode 100644 index bb853418..00000000 Binary files a/standalone/Debug/hooks.obj and /dev/null differ diff --git a/standalone/Debug/link-cvtres.read.1.tlog b/standalone/Debug/link-cvtres.read.1.tlog deleted file mode 100644 index 46b134b1..00000000 --- a/standalone/Debug/link-cvtres.read.1.tlog +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git a/standalone/Debug/link-cvtres.write.1.tlog b/standalone/Debug/link-cvtres.write.1.tlog deleted file mode 100644 index 46b134b1..00000000 --- a/standalone/Debug/link-cvtres.write.1.tlog +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git a/standalone/Debug/link-rc.read.1.tlog b/standalone/Debug/link-rc.read.1.tlog deleted file mode 100644 index 46b134b1..00000000 --- a/standalone/Debug/link-rc.read.1.tlog +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git a/standalone/Debug/link-rc.write.1.tlog b/standalone/Debug/link-rc.write.1.tlog deleted file mode 100644 index 46b134b1..00000000 --- a/standalone/Debug/link-rc.write.1.tlog +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git a/standalone/Debug/link.command.1.tlog b/standalone/Debug/link.command.1.tlog deleted file mode 100644 index 423e997a..00000000 Binary files a/standalone/Debug/link.command.1.tlog and /dev/null differ diff --git a/standalone/Debug/link.read.1.tlog b/standalone/Debug/link.read.1.tlog deleted file mode 100644 index b83fd548..00000000 Binary files a/standalone/Debug/link.read.1.tlog and /dev/null differ diff --git a/standalone/Debug/link.write.1.tlog b/standalone/Debug/link.write.1.tlog deleted file mode 100644 index d749813a..00000000 Binary files a/standalone/Debug/link.write.1.tlog and /dev/null differ diff --git a/standalone/Debug/main.obj b/standalone/Debug/main.obj deleted file mode 100644 index 87d74576..00000000 Binary files a/standalone/Debug/main.obj and /dev/null differ diff --git a/standalone/Debug/mlogc.exe b/standalone/Debug/mlogc.exe deleted file mode 100644 index 267b367f..00000000 Binary files a/standalone/Debug/mlogc.exe and /dev/null differ diff --git a/standalone/Debug/mod_security2.obj b/standalone/Debug/mod_security2.obj deleted file mode 100644 index f3a0608c..00000000 Binary files a/standalone/Debug/mod_security2.obj and /dev/null differ diff --git a/standalone/Debug/modsecurity.obj b/standalone/Debug/modsecurity.obj deleted file mode 100644 index d40ebb80..00000000 Binary files a/standalone/Debug/modsecurity.obj and /dev/null differ diff --git a/standalone/Debug/msc_crypt.obj b/standalone/Debug/msc_crypt.obj deleted file mode 100644 index b3439999..00000000 Binary files a/standalone/Debug/msc_crypt.obj and /dev/null differ diff --git a/standalone/Debug/msc_geo.obj b/standalone/Debug/msc_geo.obj deleted file mode 100644 index c201ad73..00000000 Binary files a/standalone/Debug/msc_geo.obj and /dev/null differ diff --git a/standalone/Debug/msc_gsb.obj b/standalone/Debug/msc_gsb.obj deleted file mode 100644 index 63b01b66..00000000 Binary files a/standalone/Debug/msc_gsb.obj and /dev/null differ diff --git a/standalone/Debug/msc_logging.obj b/standalone/Debug/msc_logging.obj deleted file mode 100644 index 88e676bd..00000000 Binary files a/standalone/Debug/msc_logging.obj and /dev/null differ diff --git a/standalone/Debug/msc_lua.obj b/standalone/Debug/msc_lua.obj deleted file mode 100644 index 6fa91e9d..00000000 Binary files a/standalone/Debug/msc_lua.obj and /dev/null differ diff --git a/standalone/Debug/msc_multipart.obj b/standalone/Debug/msc_multipart.obj deleted file mode 100644 index f225589f..00000000 Binary files a/standalone/Debug/msc_multipart.obj and /dev/null differ diff --git a/standalone/Debug/msc_parsers.obj b/standalone/Debug/msc_parsers.obj deleted file mode 100644 index 8a15ec35..00000000 Binary files a/standalone/Debug/msc_parsers.obj and /dev/null differ diff --git a/standalone/Debug/msc_pcre.obj b/standalone/Debug/msc_pcre.obj deleted file mode 100644 index c04a88ae..00000000 Binary files a/standalone/Debug/msc_pcre.obj and /dev/null differ diff --git a/standalone/Debug/msc_release.obj b/standalone/Debug/msc_release.obj deleted file mode 100644 index 5e882aa5..00000000 Binary files a/standalone/Debug/msc_release.obj and /dev/null differ diff --git a/standalone/Debug/msc_reqbody.obj b/standalone/Debug/msc_reqbody.obj deleted file mode 100644 index b1ba06c6..00000000 Binary files a/standalone/Debug/msc_reqbody.obj and /dev/null differ diff --git a/standalone/Debug/msc_tree.obj b/standalone/Debug/msc_tree.obj deleted file mode 100644 index 8e89132a..00000000 Binary files a/standalone/Debug/msc_tree.obj and /dev/null differ diff --git a/standalone/Debug/msc_unicode.obj b/standalone/Debug/msc_unicode.obj deleted file mode 100644 index 46bc367a..00000000 Binary files a/standalone/Debug/msc_unicode.obj and /dev/null differ diff --git a/standalone/Debug/msc_util.obj b/standalone/Debug/msc_util.obj deleted file mode 100644 index abc25a88..00000000 Binary files a/standalone/Debug/msc_util.obj and /dev/null differ diff --git a/standalone/Debug/msc_xml.obj b/standalone/Debug/msc_xml.obj deleted file mode 100644 index f8770887..00000000 Binary files a/standalone/Debug/msc_xml.obj and /dev/null differ diff --git a/standalone/Debug/persist_dbm.obj b/standalone/Debug/persist_dbm.obj deleted file mode 100644 index 02985f35..00000000 Binary files a/standalone/Debug/persist_dbm.obj and /dev/null differ diff --git a/standalone/Debug/re.obj b/standalone/Debug/re.obj deleted file mode 100644 index 0b0acdf6..00000000 Binary files a/standalone/Debug/re.obj and /dev/null differ diff --git a/standalone/Debug/re_actions.obj b/standalone/Debug/re_actions.obj deleted file mode 100644 index 80e3a7e3..00000000 Binary files a/standalone/Debug/re_actions.obj and /dev/null differ diff --git a/standalone/Debug/re_operators.obj b/standalone/Debug/re_operators.obj deleted file mode 100644 index 2b063c06..00000000 Binary files a/standalone/Debug/re_operators.obj and /dev/null differ diff --git a/standalone/Debug/re_tfns.obj b/standalone/Debug/re_tfns.obj deleted file mode 100644 index 1c026b2c..00000000 Binary files a/standalone/Debug/re_tfns.obj and /dev/null differ diff --git a/standalone/Debug/re_variables.obj b/standalone/Debug/re_variables.obj deleted file mode 100644 index 01ab5978..00000000 Binary files a/standalone/Debug/re_variables.obj and /dev/null differ diff --git a/standalone/Debug/regex.obj b/standalone/Debug/regex.obj deleted file mode 100644 index 330534b5..00000000 Binary files a/standalone/Debug/regex.obj and /dev/null differ diff --git a/standalone/Debug/server.obj b/standalone/Debug/server.obj deleted file mode 100644 index 73b40959..00000000 Binary files a/standalone/Debug/server.obj and /dev/null differ diff --git a/standalone/Debug/standalone.Build.CppClean.log b/standalone/Debug/standalone.Build.CppClean.log deleted file mode 100644 index 9d272720..00000000 --- a/standalone/Debug/standalone.Build.CppClean.log +++ /dev/null @@ -1,93 +0,0 @@ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_RELEASE.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_LUA.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\VC110.PDB -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\FILTERS.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_PARSERS.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_PCRE.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_REQBODY.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_TREE.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_UNICODE.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_UTIL.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_XML.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\PERSIST_DBM.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\RE.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\RE_ACTIONS.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\RE_OPERATORS.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\RE_TFNS.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\RE_VARIABLES.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\API.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\BUCKETS.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\CONFIG.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\HOOKS.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\REGEX.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\SERVER.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\ACMP.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\APACHE2_CONFIG.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\APACHE2_IO.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\APACHE2_UTIL.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MOD_SECURITY2.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MODSECURITY.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_CRYPT.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_GEO.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_GSB.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_LOGGING.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MSC_MULTIPART.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\MAIN.OBJ -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\STANDALONE.ILK -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\STANDALONE.EXE -C:\WORK\MOD_SECURITY\STANDALONE\DEBUG\STANDALONE.PDB -C:\work\mod_security\standalone\Debug\standalone.lib -C:\work\mod_security\standalone\Debug\standalone.exp -c:\work\mod_security\standalone\Debug\acmp.obj -c:\work\mod_security\standalone\Debug\apache2_config.obj -c:\work\mod_security\standalone\Debug\apache2_io.obj -c:\work\mod_security\standalone\Debug\apache2_util.obj -c:\work\mod_security\standalone\Debug\api.obj -c:\work\mod_security\standalone\Debug\buckets.obj -c:\work\mod_security\standalone\Debug\config.obj -c:\work\mod_security\standalone\Debug\filters.obj -c:\work\mod_security\standalone\Debug\hooks.obj -c:\work\mod_security\standalone\Debug\main.obj -c:\work\mod_security\standalone\Debug\modsecurity.obj -c:\work\mod_security\standalone\Debug\mod_security2.obj -c:\work\mod_security\standalone\Debug\msc_crypt.obj -c:\work\mod_security\standalone\Debug\msc_geo.obj -c:\work\mod_security\standalone\Debug\msc_gsb.obj -c:\work\mod_security\standalone\Debug\msc_logging.obj -c:\work\mod_security\standalone\Debug\msc_lua.obj -c:\work\mod_security\standalone\Debug\msc_multipart.obj -c:\work\mod_security\standalone\Debug\msc_parsers.obj -c:\work\mod_security\standalone\Debug\msc_pcre.obj -c:\work\mod_security\standalone\Debug\msc_release.obj -c:\work\mod_security\standalone\Debug\msc_reqbody.obj -c:\work\mod_security\standalone\Debug\msc_tree.obj -c:\work\mod_security\standalone\Debug\msc_unicode.obj -c:\work\mod_security\standalone\Debug\msc_util.obj -c:\work\mod_security\standalone\Debug\msc_xml.obj -c:\work\mod_security\standalone\Debug\persist_dbm.obj -c:\work\mod_security\standalone\Debug\re.obj -c:\work\mod_security\standalone\Debug\regex.obj -c:\work\mod_security\standalone\Debug\re_actions.obj -c:\work\mod_security\standalone\Debug\re_operators.obj -c:\work\mod_security\standalone\Debug\re_tfns.obj -c:\work\mod_security\standalone\Debug\re_variables.obj -c:\work\mod_security\standalone\Debug\server.obj -c:\work\mod_security\standalone\Debug\standalone.ilk -c:\work\mod_security\standalone\Debug\cl.command.1.tlog -c:\work\mod_security\standalone\Debug\CL.read.1.tlog -c:\work\mod_security\standalone\Debug\CL.write.1.tlog -c:\work\mod_security\standalone\Debug\link-cvtres.read.1.tlog -c:\work\mod_security\standalone\Debug\link-cvtres.write.1.tlog -c:\work\mod_security\standalone\Debug\link-rc.read.1.tlog -c:\work\mod_security\standalone\Debug\link-rc.write.1.tlog -c:\work\mod_security\standalone\Debug\link.command.1.tlog -c:\work\mod_security\standalone\Debug\link.read.1.tlog -c:\work\mod_security\standalone\Debug\link.write.1.tlog -c:\work\mod_security\standalone\Debug\standalone.write.1.tlog -c:\work\mod_security\standalone\Debug\standalone.exp -c:\work\mod_security\standalone\Debug\vc110.idb -c:\work\mod_security\standalone\Debug\standalone.pdb -c:\work\mod_security\standalone\Debug\vc110.pdb -C:\work\mod_security\standalone\Debug\standalone.pdb -C:\work\mod_security\standalone\Debug\standalone.exe -C:\work\mod_security\standalone\Debug\standalone.ilk diff --git a/standalone/Debug/standalone.exe b/standalone/Debug/standalone.exe deleted file mode 100644 index 562d7556..00000000 Binary files a/standalone/Debug/standalone.exe and /dev/null differ diff --git a/standalone/Debug/standalone.exp b/standalone/Debug/standalone.exp deleted file mode 100644 index fe2da923..00000000 Binary files a/standalone/Debug/standalone.exp and /dev/null differ diff --git a/standalone/Debug/standalone.ilk b/standalone/Debug/standalone.ilk deleted file mode 100644 index 2d5f2ae8..00000000 Binary files a/standalone/Debug/standalone.ilk and /dev/null differ diff --git a/standalone/Debug/standalone.lastbuildstate b/standalone/Debug/standalone.lastbuildstate deleted file mode 100644 index 725999d5..00000000 --- a/standalone/Debug/standalone.lastbuildstate +++ /dev/null @@ -1,2 +0,0 @@ -#v4.0:v110:false -Debug|Win32|C:\work\mod_security\standalone\| diff --git a/standalone/Debug/standalone.lib b/standalone/Debug/standalone.lib deleted file mode 100644 index 7f845298..00000000 Binary files a/standalone/Debug/standalone.lib and /dev/null differ diff --git a/standalone/Debug/standalone.log b/standalone/Debug/standalone.log deleted file mode 100644 index c9824cec..00000000 --- a/standalone/Debug/standalone.log +++ /dev/null @@ -1,86 +0,0 @@ -Build started 4/12/2013 4:24:02 PM. - 1>Project "c:\work\mod_security\standalone\standalone.vcxproj" on node 2 (Build target(s)). - 1>ClCompile: - C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /I"C:\work\pcre-8.30\include" /I"C:\work\pcre-8.30" /I"C:\work\libxml2-2.7.7\include" /IC:\apache22\include /I..\apache2 /I"c:\work\httpd-2.2.24\include" /ZI /nologo /W3 /WX- /Od /Oy- /D _MBCS /D _MBCS /D WIN32 /D WINNT /D inline=APR_INLINE /D AP_DECLARE_STATIC /D VERSION_STANDALONE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc110.pdb" /Gd /TC /wd4244 /wd4018 /analyze- /errorReport:prompt ..\apache2\acmp.c ..\apache2\apache2_config.c ..\apache2\apache2_io.c ..\apache2\apache2_util.c ..\apache2\modsecurity.c ..\apache2\mod_security2.c ..\apache2\msc_crypt.c ..\apache2\msc_geo.c ..\apache2\msc_gsb.c ..\apache2\msc_logging.c ..\apache2\msc_lua.c ..\apache2\msc_multipart.c ..\apache2\msc_parsers.c ..\apache2\msc_pcre.c ..\apache2\msc_release.c ..\apache2\msc_reqbody.c ..\apache2\msc_tree.c ..\apache2\msc_unicode.c ..\apache2\msc_util.c ..\apache2\msc_xml.c ..\apache2\persist_dbm.c ..\apache2\re.c ..\apache2\re_actions.c ..\apache2\re_operators.c ..\apache2\re_tfns.c ..\apache2\re_variables.c api.c buckets.c config.c filters.c hooks.c regex.c server.c - server.c - regex.c - hooks.c - filters.c - config.c - buckets.c - api.c - re_variables.c - re_tfns.c - re_operators.c - re_actions.c - re.c - persist_dbm.c - msc_xml.c - msc_util.c - msc_unicode.c - msc_tree.c - msc_reqbody.c - msc_release.c - msc_pcre.c - Generating Code... - Compiling... - msc_parsers.c - msc_multipart.c - msc_lua.c - msc_logging.c - msc_gsb.c - msc_geo.c - msc_crypt.c - mod_security2.c - modsecurity.c - apache2_util.c - apache2_io.c - apache2_config.c - acmp.c - Generating Code... - C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /I"C:\work\pcre-8.30\include" /I"C:\work\pcre-8.30" /I"C:\work\libxml2-2.7.7\include" /IC:\apache22\include /I..\apache2 /I"c:\work\httpd-2.2.24\include" /ZI /nologo /W3 /WX- /Od /Oy- /D _MBCS /D _MBCS /D WIN32 /D WINNT /D inline=APR_INLINE /D AP_DECLARE_STATIC /D VERSION_STANDALONE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc110.pdb" /Gd /TP /wd4244 /wd4018 /analyze- /errorReport:prompt main.cpp - main.cpp - 1>c:\work\mod_security\standalone\main.cpp(16): warning C4005: 'inline' : macro redefinition - command-line arguments : see previous definition of 'inline' - Link: - C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\work\mod_security\standalone\Debug\standalone.exe" /INCREMENTAL /NOLOGO /LIBPATH:c:\drop\x86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "libapr-1.lib" "libaprutil-1.lib" pcre.lib libxml2.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\work\mod_security\standalone\Debug\standalone.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\work\mod_security\standalone\Debug\standalone.lib" /MACHINE:X86 Debug\acmp.obj - Debug\apache2_config.obj - Debug\apache2_io.obj - Debug\apache2_util.obj - Debug\modsecurity.obj - Debug\mod_security2.obj - Debug\msc_crypt.obj - Debug\msc_geo.obj - Debug\msc_gsb.obj - Debug\msc_logging.obj - Debug\msc_lua.obj - Debug\msc_multipart.obj - Debug\msc_parsers.obj - Debug\msc_pcre.obj - Debug\msc_release.obj - Debug\msc_reqbody.obj - Debug\msc_tree.obj - Debug\msc_unicode.obj - Debug\msc_util.obj - Debug\msc_xml.obj - Debug\persist_dbm.obj - Debug\re.obj - Debug\re_actions.obj - Debug\re_operators.obj - Debug\re_tfns.obj - Debug\re_variables.obj - Debug\api.obj - Debug\buckets.obj - Debug\config.obj - Debug\filters.obj - Debug\hooks.obj - Debug\main.obj - Debug\regex.obj - Debug\server.obj - Creating library C:\work\mod_security\standalone\Debug\standalone.lib and object C:\work\mod_security\standalone\Debug\standalone.exp - standalone.vcxproj -> C:\work\mod_security\standalone\Debug\standalone.exe - 1>Done Building Project "c:\work\mod_security\standalone\standalone.vcxproj" (Build target(s)). - -Build succeeded. - -Time Elapsed 00:00:16.08 diff --git a/standalone/Debug/standalone.pdb b/standalone/Debug/standalone.pdb deleted file mode 100644 index 2b92ab6e..00000000 Binary files a/standalone/Debug/standalone.pdb and /dev/null differ diff --git a/standalone/Debug/standalone.write.1.tlog b/standalone/Debug/standalone.write.1.tlog deleted file mode 100644 index f2ec64c4..00000000 --- a/standalone/Debug/standalone.write.1.tlog +++ /dev/null @@ -1,5 +0,0 @@ -^c:\work\mod_security\standalone\standalone.vcxproj -C:\work\mod_security\standalone\Debug\standalone.lib -C:\work\mod_security\standalone\Debug\standalone.lib -C:\work\mod_security\standalone\Debug\standalone.exp -C:\work\mod_security\standalone\Debug\standalone.exp diff --git a/standalone/Debug/vc110.idb b/standalone/Debug/vc110.idb deleted file mode 100644 index 0a300da7..00000000 Binary files a/standalone/Debug/vc110.idb and /dev/null differ diff --git a/standalone/Debug/vc110.pdb b/standalone/Debug/vc110.pdb deleted file mode 100644 index 364bbb47..00000000 Binary files a/standalone/Debug/vc110.pdb and /dev/null differ diff --git a/standalone/Makefile.am b/standalone/Makefile.am index d6dd02f8..0edfd1f5 100644 --- a/standalone/Makefile.am +++ b/standalone/Makefile.am @@ -1,90 +1,90 @@ -pkglibdir = $(prefix)/lib -pkglib_LTLIBRARIES = standalone.la -#include_HEADERS = re.h modsecurity.h msc_logging.h msc_multipart.h \ -# msc_parsers.h msc_pcre.h msc_util.h msc_xml.h \ -# persist_dbm.h apache2.h msc_geo.h acmp.h utf8tables.h \ -# msc_lua.h msc_release.h - -standalone_la_SOURCES = ../apache2/mod_security2.c \ - ../apache2/apache2_config.c ../apache2/apache2_io.c ../apache2/apache2_util.c \ - ../apache2/re.c ../apache2/re_operators.c ../apache2/re_actions.c ../apache2/re_tfns.c \ - ../apache2/re_variables.c ../apache2/msc_logging.c ../apache2/msc_xml.c \ - ../apache2/msc_multipart.c ../apache2/modsecurity.c ../apache2/msc_parsers.c \ - ../apache2/msc_util.c ../apache2/msc_pcre.c ../apache2/persist_dbm.c ../apache2/msc_reqbody.c \ - ../apache2/msc_geo.c ../apache2/msc_gsb.c ../apache2/msc_unicode.c \ - ../apache2/acmp.c ../apache2/msc_lua.c ../apache2/msc_release.c \ - ../apache2/msc_crypt.c ../apache2/msc_tree.c \ - api.c buckets.c \ - config.c filters.c \ - hooks.c \ - regex.c server.c - -standalone_la_CFLAGS = @APXS_CFLAGS@ @APR_CFLAGS@ @APU_CFLAGS@ \ - @PCRE_CFLAGS@ @LIBXML2_CFLAGS@ @LUA_CFLAGS@ @MODSEC_EXTRA_CFLAGS@ @CURL_CFLAGS@ -DVERSION_NGINX -standalone_la_CPPFLAGS = @APR_CPPFLAGS@ @PCRE_CPPFLAGS@ @LIBXML2_CPPFLAGS@ -standalone_la_LIBADD = @APR_LDADD@ @APU_LDADD@ @PCRE_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@ - -if AIX -standalone_la_LDFLAGS = -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ -endif - -if HPUX -standalone_la_LDFLAGS = -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ -endif - -if MACOSX -standalone_la_LDFLAGS = -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ -endif - -if SOLARIS -standalone_la_LDFLAGS = -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ -endif - -if LINUX -standalone_la_LDFLAGS = -no-undefined -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ -endif - -if FREEBSD -standalone_la_LDFLAGS = -no-undefined -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ -endif - -if OPENBSD -standalone_la_LDFLAGS = -no-undefined -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ -endif - -if NETBSD -standalone_la_LDFLAGS = -no-undefined -module -avoid-version \ - @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ - @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ -endif - -install-exec-hook: $(pkglib_LTLIBRARIES) - @echo "Creating Nginx config file..."; \ - rm -f ../nginx/modsecurity/config; \ - echo "ngx_addon_name=ngx_http_modsecurity" >> ../nginx/modsecurity/config; \ - echo "CORE_MODULES=\"\$$CORE_MODULES ngx_pool_context_module\"" >> ../nginx/modsecurity/config; \ - echo "HTTP_AUX_FILTER_MODULES=\"ngx_http_modsecurity \$$HTTP_AUX_FILTER_MODULES\"" >> ../nginx/modsecurity/config; \ - echo "NGX_ADDON_SRCS=\"\$$NGX_ADDON_SRCS \$$ngx_addon_dir/ngx_http_modsecurity.c \$$ngx_addon_dir/apr_bucket_nginx.c \$$ngx_addon_dir/ngx_pool_context.c\"" >> ../nginx/modsecurity/config;\ - echo "NGX_ADDON_DEPS=\"\$$NGX_ADDON_DEPS \$$ngx_addon_dir/apr_bucket_nginx.h \$$ngx_addon_dir/ngx_pool_context.h\"" >> ../nginx/modsecurity/config; \ - echo "CORE_LIBS=\"\$$CORE_LIBS \$$ngx_addon_dir/../../standalone/.libs/standalone.a -lapr-1 -laprutil-1 -lxml2 -lm @LUA_LDADD@\"" >> ../nginx/modsecurity/config; \ - echo "CORE_INCS=\"\$$CORE_INCS /usr/include/apache2 /usr/include/apr-1.0 /usr/include/httpd /usr/include/apr-1 \$$ngx_addon_dir \$$ngx_addon_dir/../../standalone \$$ngx_addon_dir/../../apache2 /usr/include/libxml2 `echo @LUA_CFLAGS@ | cut -d "I" -f3`\"" >> ../nginx/modsecurity/config; \ - echo "Removing unused static libraries..."; \ - for m in $(pkglib_LTLIBRARIES); do \ - base=`echo $$m | sed 's/\..*//'`; \ - rm -f $(DESTDIR)$(pkglibdir)/$$base.*a; \ - cp -p $(DESTDIR)$(pkglibdir)/$$base.so $(APXS_MODULES); \ - done +pkglibdir = $(prefix)/lib +pkglib_LTLIBRARIES = standalone.la +#include_HEADERS = re.h modsecurity.h msc_logging.h msc_multipart.h \ +# msc_parsers.h msc_pcre.h msc_util.h msc_xml.h \ +# persist_dbm.h apache2.h msc_geo.h acmp.h utf8tables.h \ +# msc_lua.h msc_release.h + +standalone_la_SOURCES = ../apache2/mod_security2.c \ + ../apache2/apache2_config.c ../apache2/apache2_io.c ../apache2/apache2_util.c \ + ../apache2/re.c ../apache2/re_operators.c ../apache2/re_actions.c ../apache2/re_tfns.c \ + ../apache2/re_variables.c ../apache2/msc_logging.c ../apache2/msc_xml.c \ + ../apache2/msc_multipart.c ../apache2/modsecurity.c ../apache2/msc_parsers.c \ + ../apache2/msc_util.c ../apache2/msc_pcre.c ../apache2/persist_dbm.c ../apache2/msc_reqbody.c \ + ../apache2/msc_geo.c ../apache2/msc_gsb.c ../apache2/msc_unicode.c \ + ../apache2/acmp.c ../apache2/msc_lua.c ../apache2/msc_release.c \ + ../apache2/msc_crypt.c ../apache2/msc_tree.c \ + api.c buckets.c \ + config.c filters.c \ + hooks.c \ + regex.c server.c + +standalone_la_CFLAGS = @APXS_CFLAGS@ @APR_CFLAGS@ @APU_CFLAGS@ \ + @PCRE_CFLAGS@ @LIBXML2_CFLAGS@ @LUA_CFLAGS@ @MODSEC_EXTRA_CFLAGS@ @CURL_CFLAGS@ -DVERSION_NGINX +standalone_la_CPPFLAGS = @APR_CPPFLAGS@ @PCRE_CPPFLAGS@ @LIBXML2_CPPFLAGS@ +standalone_la_LIBADD = @APR_LDADD@ @APU_LDADD@ @PCRE_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@ + +if AIX +standalone_la_LDFLAGS = -module -avoid-version \ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ +endif + +if HPUX +standalone_la_LDFLAGS = -module -avoid-version \ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ +endif + +if MACOSX +standalone_la_LDFLAGS = -module -avoid-version \ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ +endif + +if SOLARIS +standalone_la_LDFLAGS = -module -avoid-version \ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ +endif + +if LINUX +standalone_la_LDFLAGS = -no-undefined -module -avoid-version \ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ +endif + +if FREEBSD +standalone_la_LDFLAGS = -no-undefined -module -avoid-version \ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ +endif + +if OPENBSD +standalone_la_LDFLAGS = -no-undefined -module -avoid-version \ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ +endif + +if NETBSD +standalone_la_LDFLAGS = -no-undefined -module -avoid-version \ + @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \ + @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ +endif + +install-exec-hook: $(pkglib_LTLIBRARIES) + @echo "Creating Nginx config file..."; \ + rm -f ../nginx/modsecurity/config; \ + echo "ngx_addon_name=ngx_http_modsecurity" >> ../nginx/modsecurity/config; \ + echo "CORE_MODULES=\"\$$CORE_MODULES ngx_pool_context_module\"" >> ../nginx/modsecurity/config; \ + echo "HTTP_AUX_FILTER_MODULES=\"ngx_http_modsecurity \$$HTTP_AUX_FILTER_MODULES\"" >> ../nginx/modsecurity/config; \ + echo "NGX_ADDON_SRCS=\"\$$NGX_ADDON_SRCS \$$ngx_addon_dir/ngx_http_modsecurity.c \$$ngx_addon_dir/apr_bucket_nginx.c \$$ngx_addon_dir/ngx_pool_context.c\"" >> ../nginx/modsecurity/config;\ + echo "NGX_ADDON_DEPS=\"\$$NGX_ADDON_DEPS \$$ngx_addon_dir/apr_bucket_nginx.h \$$ngx_addon_dir/ngx_pool_context.h\"" >> ../nginx/modsecurity/config; \ + echo "CORE_LIBS=\"\$$CORE_LIBS \$$ngx_addon_dir/../../standalone/.libs/standalone.a -lapr-1 -laprutil-1 -lxml2 -lm @LUA_LDADD@\"" >> ../nginx/modsecurity/config; \ + echo "CORE_INCS=\"\$$CORE_INCS /usr/include/apache2 /usr/include/apr-1.0 /usr/include/httpd /usr/include/apr-1 \$$ngx_addon_dir \$$ngx_addon_dir/../../standalone \$$ngx_addon_dir/../../apache2 /usr/include/libxml2 `echo @LUA_CFLAGS@ | cut -d "I" -f3`\"" >> ../nginx/modsecurity/config; \ + echo "Removing unused static libraries..."; \ + for m in $(pkglib_LTLIBRARIES); do \ + base=`echo $$m | sed 's/\..*//'`; \ + rm -f $(DESTDIR)$(pkglibdir)/$$base.*a; \ + cp -p $(DESTDIR)$(pkglibdir)/$$base.so $(APXS_MODULES); \ + done diff --git a/standalone/api.h b/standalone/api.h index 15c326c6..55f9eef9 100644 --- a/standalone/api.h +++ b/standalone/api.h @@ -1,119 +1,119 @@ -/* -* ModSecurity for Apache 2.x, http://www.modsecurity.org/ -* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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. -*/ - - -#pragma once - -#include - -#include "http_core.h" -#include "http_request.h" - -#include "modsecurity.h" -#include "apache2.h" -#include "http_main.h" -#include "http_connection.h" - -#include "apr_optional.h" -#include "mod_log_config.h" - -#include "msc_logging.h" -#include "msc_util.h" - -#include "ap_mpm.h" -#include "scoreboard.h" - -#include "apr_version.h" - -#include "apr_lib.h" -#include "ap_config.h" -#include "http_config.h" - - -#ifdef __cplusplus -extern "C" -{ -#endif - -server_rec *modsecInit(); -void modsecTerminate(); - -void modsecStartConfig(); -directory_config *modsecGetDefaultConfig(); -const char *modsecProcessConfig(directory_config *config, const char *file, const char *dir); -void modsecFinalizeConfig(); - -void modsecInitProcess(); - -conn_rec *modsecNewConnection(); -void modsecProcessConnection(conn_rec *c); - -request_rec *modsecNewRequest(conn_rec *connection, directory_config *config); - -int modsecProcessRequestBody(request_rec *r); -int modsecProcessRequestHeaders(request_rec *r); - -static inline int modsecProcessRequest(request_rec *r) { - int status; - status = modsecProcessRequestHeaders(r); - if (status != DECLINED) { - return status; - } - - return modsecProcessRequestBody(r); -} - - -int modsecProcessResponse(request_rec *r); -int modsecFinishRequest(request_rec *r); - -void modsecSetLogHook(void *obj, void (*hook)(void *obj, int level, char *str)); - -#define NOTE_MSR_BRIGADE_REQUEST "modsecurity-brigade-request" -#define NOTE_MSR_BRIGADE_RESPONSE "modsecurity-brigade-response" - -static inline void -modsecSetBodyBrigade(request_rec *r, apr_bucket_brigade *b) { - apr_table_setn(r->notes, NOTE_MSR_BRIGADE_REQUEST, (char *)b); -}; - -static inline apr_bucket_brigade * -modsecGetBodyBrigade(request_rec *r) { - return (apr_bucket_brigade *)apr_table_get(r->notes, NOTE_MSR_BRIGADE_REQUEST); -}; - -static inline void -modsecSetResponseBrigade(request_rec *r, apr_bucket_brigade *b) { - apr_table_setn(r->notes, NOTE_MSR_BRIGADE_RESPONSE, (char *)b); -}; - -static inline apr_bucket_brigade * -modsecGetResponseBrigade(request_rec *r) { - return (apr_bucket_brigade *)apr_table_get(r->notes, NOTE_MSR_BRIGADE_RESPONSE); -}; - -void modsecSetReadBody(apr_status_t (*func)(request_rec *r, char *buf, unsigned int length, unsigned int *readcnt, int *is_eos)); -void modsecSetReadResponse(apr_status_t (*func)(request_rec *r, char *buf, unsigned int length, unsigned int *readcnt, int *is_eos)); -void modsecSetWriteBody(apr_status_t (*func)(request_rec *r, char *buf, unsigned int length)); -void modsecSetWriteResponse(apr_status_t (*func)(request_rec *r, char *buf, unsigned int length)); -void modsecSetDropAction(int (*func)(request_rec *r)); - -int modsecIsResponseBodyAccessEnabled(request_rec *r); -int modsecIsRequestBodyAccessEnabled(request_rec *r); - -void modsecSetConfigForIISRequestBody(request_rec *r); - -#ifdef __cplusplus -} -#endif +/* +* ModSecurity for Apache 2.x, http://www.modsecurity.org/ +* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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. +*/ + + +#pragma once + +#include + +#include "http_core.h" +#include "http_request.h" + +#include "modsecurity.h" +#include "apache2.h" +#include "http_main.h" +#include "http_connection.h" + +#include "apr_optional.h" +#include "mod_log_config.h" + +#include "msc_logging.h" +#include "msc_util.h" + +#include "ap_mpm.h" +#include "scoreboard.h" + +#include "apr_version.h" + +#include "apr_lib.h" +#include "ap_config.h" +#include "http_config.h" + + +#ifdef __cplusplus +extern "C" +{ +#endif + +server_rec *modsecInit(); +void modsecTerminate(); + +void modsecStartConfig(); +directory_config *modsecGetDefaultConfig(); +const char *modsecProcessConfig(directory_config *config, const char *file, const char *dir); +void modsecFinalizeConfig(); + +void modsecInitProcess(); + +conn_rec *modsecNewConnection(); +void modsecProcessConnection(conn_rec *c); + +request_rec *modsecNewRequest(conn_rec *connection, directory_config *config); + +int modsecProcessRequestBody(request_rec *r); +int modsecProcessRequestHeaders(request_rec *r); + +static inline int modsecProcessRequest(request_rec *r) { + int status; + status = modsecProcessRequestHeaders(r); + if (status != DECLINED) { + return status; + } + + return modsecProcessRequestBody(r); +} + + +int modsecProcessResponse(request_rec *r); +int modsecFinishRequest(request_rec *r); + +void modsecSetLogHook(void *obj, void (*hook)(void *obj, int level, char *str)); + +#define NOTE_MSR_BRIGADE_REQUEST "modsecurity-brigade-request" +#define NOTE_MSR_BRIGADE_RESPONSE "modsecurity-brigade-response" + +static inline void +modsecSetBodyBrigade(request_rec *r, apr_bucket_brigade *b) { + apr_table_setn(r->notes, NOTE_MSR_BRIGADE_REQUEST, (char *)b); +}; + +static inline apr_bucket_brigade * +modsecGetBodyBrigade(request_rec *r) { + return (apr_bucket_brigade *)apr_table_get(r->notes, NOTE_MSR_BRIGADE_REQUEST); +}; + +static inline void +modsecSetResponseBrigade(request_rec *r, apr_bucket_brigade *b) { + apr_table_setn(r->notes, NOTE_MSR_BRIGADE_RESPONSE, (char *)b); +}; + +static inline apr_bucket_brigade * +modsecGetResponseBrigade(request_rec *r) { + return (apr_bucket_brigade *)apr_table_get(r->notes, NOTE_MSR_BRIGADE_RESPONSE); +}; + +void modsecSetReadBody(apr_status_t (*func)(request_rec *r, char *buf, unsigned int length, unsigned int *readcnt, int *is_eos)); +void modsecSetReadResponse(apr_status_t (*func)(request_rec *r, char *buf, unsigned int length, unsigned int *readcnt, int *is_eos)); +void modsecSetWriteBody(apr_status_t (*func)(request_rec *r, char *buf, unsigned int length)); +void modsecSetWriteResponse(apr_status_t (*func)(request_rec *r, char *buf, unsigned int length)); +void modsecSetDropAction(int (*func)(request_rec *r)); + +int modsecIsResponseBodyAccessEnabled(request_rec *r); +int modsecIsRequestBodyAccessEnabled(request_rec *r); + +void modsecSetConfigForIISRequestBody(request_rec *r); + +#ifdef __cplusplus +} +#endif diff --git a/standalone/buckets.c b/standalone/buckets.c index 7beb6918..09e8ffb1 100644 --- a/standalone/buckets.c +++ b/standalone/buckets.c @@ -1,184 +1,184 @@ -/* -* ModSecurity for Apache 2.x, http://www.modsecurity.org/ -* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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 "http_core.h" -#include "http_request.h" - -#include "modsecurity.h" -#include "apache2.h" -#include "http_main.h" -#include "http_connection.h" - -#include "apr_optional.h" -#include "mod_log_config.h" - -#include "msc_logging.h" -#include "msc_util.h" - -#include "ap_mpm.h" -#include "scoreboard.h" - -#include "apr_version.h" - -#include "apr_lib.h" -#include "ap_config.h" -#include "http_config.h" -#include "apr_buckets.h" - - -AP_DECLARE(apr_status_t) ap_get_brigade(ap_filter_t *next, - apr_bucket_brigade *bb, - ap_input_mode_t mode, - apr_read_type_e block, - apr_off_t readbytes) -{ - if (next) { - return next->frec->filter_func.in_func(next, bb, mode, block, - readbytes); - } - - return AP_NOBODY_READ; -} - -AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *next, - apr_bucket_brigade *bb) -{ - if (next) { - apr_bucket *e; - if ((e = APR_BRIGADE_LAST(bb)) && APR_BUCKET_IS_EOS(e) && next->r) { - /* This is only safe because HTTP_HEADER filter is always in - * the filter stack. This ensures that there is ALWAYS a - * request-based filter that we can attach this to. If the - * HTTP_FILTER is removed, and another filter is not put in its - * place, then handlers like mod_cgi, which attach their own - * EOS bucket to the brigade will be broken, because we will - * get two EOS buckets on the same request. - */ - next->r->eos_sent = 1; - - /* remember the eos for internal redirects, too */ - if (next->r->prev) { - request_rec *prev = next->r->prev; - - while (prev) { - prev->eos_sent = 1; - prev = prev->prev; - } - } - } - return next->frec->filter_func.out_func(next, bb); - } - return AP_NOBODY_WROTE; -} - -AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f, - apr_bucket_brigade **saveto, - apr_bucket_brigade **b, apr_pool_t *p) -{ - apr_bucket *e; - apr_status_t rv, srv = APR_SUCCESS; - - /* If have never stored any data in the filter, then we had better - * create an empty bucket brigade so that we can concat. - */ - if (!(*saveto)) { - *saveto = apr_brigade_create(p, f->c->bucket_alloc); - } - - for (e = APR_BRIGADE_FIRST(*b); - e != APR_BRIGADE_SENTINEL(*b); - e = APR_BUCKET_NEXT(e)) - { - rv = apr_bucket_setaside(e, p); - - /* If the bucket type does not implement setaside, then - * (hopefully) morph it into a bucket type which does, and set - * *that* aside... */ - if (rv == APR_ENOTIMPL) { - const char *s; - apr_size_t n; - - rv = apr_bucket_read(e, &s, &n, APR_BLOCK_READ); - if (rv == APR_SUCCESS) { - rv = apr_bucket_setaside(e, p); - } - } - - if (rv != APR_SUCCESS) { - srv = rv; - /* Return an error but still save the brigade if - * ->setaside() is really not implemented. */ - if (rv != APR_ENOTIMPL) { - return rv; - } - } - } - APR_BRIGADE_CONCAT(*saveto, *b); - return srv; -} - -static apr_status_t error_bucket_read(apr_bucket *b, const char **str, - apr_size_t *len, apr_read_type_e block) -{ - *str = "Unknown error."; - *len = strlen(*str); - return APR_SUCCESS; -} - -static void error_bucket_destroy(void *data) -{ - ap_bucket_error *h = data; - - if (apr_bucket_shared_destroy(h)) { - apr_bucket_free(h); - } -} - -AP_DECLARE_DATA const apr_bucket_type_t ap_bucket_type_error = { - "ERROR", 5, APR_BUCKET_METADATA, - error_bucket_destroy, - error_bucket_read, - apr_bucket_setaside_notimpl, - apr_bucket_split_notimpl, - apr_bucket_shared_copy -}; - -AP_DECLARE(apr_bucket *) ap_bucket_error_make(apr_bucket *b, int error, - const char *buf, apr_pool_t *p) -{ - ap_bucket_error *h; - - h = apr_bucket_alloc(sizeof(*h), b->list); - h->status = error; - h->data = (buf) ? apr_pstrdup(p, buf) : NULL; - - b = apr_bucket_shared_make(b, h, 0, 0); - b->type = &ap_bucket_type_error; - return b; -} - -AP_DECLARE(apr_bucket *) ap_bucket_error_create(int error, const char *buf, - apr_pool_t *p, - apr_bucket_alloc_t *list) -{ - apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); - - APR_BUCKET_INIT(b); - b->free = apr_bucket_free; - b->list = list; - return ap_bucket_error_make(b, error, buf, p); -} - +/* +* ModSecurity for Apache 2.x, http://www.modsecurity.org/ +* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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 "http_core.h" +#include "http_request.h" + +#include "modsecurity.h" +#include "apache2.h" +#include "http_main.h" +#include "http_connection.h" + +#include "apr_optional.h" +#include "mod_log_config.h" + +#include "msc_logging.h" +#include "msc_util.h" + +#include "ap_mpm.h" +#include "scoreboard.h" + +#include "apr_version.h" + +#include "apr_lib.h" +#include "ap_config.h" +#include "http_config.h" +#include "apr_buckets.h" + + +AP_DECLARE(apr_status_t) ap_get_brigade(ap_filter_t *next, + apr_bucket_brigade *bb, + ap_input_mode_t mode, + apr_read_type_e block, + apr_off_t readbytes) +{ + if (next) { + return next->frec->filter_func.in_func(next, bb, mode, block, + readbytes); + } + + return AP_NOBODY_READ; +} + +AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *next, + apr_bucket_brigade *bb) +{ + if (next) { + apr_bucket *e; + if ((e = APR_BRIGADE_LAST(bb)) && APR_BUCKET_IS_EOS(e) && next->r) { + /* This is only safe because HTTP_HEADER filter is always in + * the filter stack. This ensures that there is ALWAYS a + * request-based filter that we can attach this to. If the + * HTTP_FILTER is removed, and another filter is not put in its + * place, then handlers like mod_cgi, which attach their own + * EOS bucket to the brigade will be broken, because we will + * get two EOS buckets on the same request. + */ + next->r->eos_sent = 1; + + /* remember the eos for internal redirects, too */ + if (next->r->prev) { + request_rec *prev = next->r->prev; + + while (prev) { + prev->eos_sent = 1; + prev = prev->prev; + } + } + } + return next->frec->filter_func.out_func(next, bb); + } + return AP_NOBODY_WROTE; +} + +AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f, + apr_bucket_brigade **saveto, + apr_bucket_brigade **b, apr_pool_t *p) +{ + apr_bucket *e; + apr_status_t rv, srv = APR_SUCCESS; + + /* If have never stored any data in the filter, then we had better + * create an empty bucket brigade so that we can concat. + */ + if (!(*saveto)) { + *saveto = apr_brigade_create(p, f->c->bucket_alloc); + } + + for (e = APR_BRIGADE_FIRST(*b); + e != APR_BRIGADE_SENTINEL(*b); + e = APR_BUCKET_NEXT(e)) + { + rv = apr_bucket_setaside(e, p); + + /* If the bucket type does not implement setaside, then + * (hopefully) morph it into a bucket type which does, and set + * *that* aside... */ + if (rv == APR_ENOTIMPL) { + const char *s; + apr_size_t n; + + rv = apr_bucket_read(e, &s, &n, APR_BLOCK_READ); + if (rv == APR_SUCCESS) { + rv = apr_bucket_setaside(e, p); + } + } + + if (rv != APR_SUCCESS) { + srv = rv; + /* Return an error but still save the brigade if + * ->setaside() is really not implemented. */ + if (rv != APR_ENOTIMPL) { + return rv; + } + } + } + APR_BRIGADE_CONCAT(*saveto, *b); + return srv; +} + +static apr_status_t error_bucket_read(apr_bucket *b, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + *str = "Unknown error."; + *len = strlen(*str); + return APR_SUCCESS; +} + +static void error_bucket_destroy(void *data) +{ + ap_bucket_error *h = data; + + if (apr_bucket_shared_destroy(h)) { + apr_bucket_free(h); + } +} + +AP_DECLARE_DATA const apr_bucket_type_t ap_bucket_type_error = { + "ERROR", 5, APR_BUCKET_METADATA, + error_bucket_destroy, + error_bucket_read, + apr_bucket_setaside_notimpl, + apr_bucket_split_notimpl, + apr_bucket_shared_copy +}; + +AP_DECLARE(apr_bucket *) ap_bucket_error_make(apr_bucket *b, int error, + const char *buf, apr_pool_t *p) +{ + ap_bucket_error *h; + + h = apr_bucket_alloc(sizeof(*h), b->list); + h->status = error; + h->data = (buf) ? apr_pstrdup(p, buf) : NULL; + + b = apr_bucket_shared_make(b, h, 0, 0); + b->type = &ap_bucket_type_error; + return b; +} + +AP_DECLARE(apr_bucket *) ap_bucket_error_create(int error, const char *buf, + apr_pool_t *p, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return ap_bucket_error_make(b, error, buf, p); +} + diff --git a/standalone/filters.c b/standalone/filters.c index fb8c2b1c..4520cba6 100644 --- a/standalone/filters.c +++ b/standalone/filters.c @@ -1,248 +1,248 @@ -/* -* ModSecurity for Apache 2.x, http://www.modsecurity.org/ -* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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 "http_core.h" -#include "http_request.h" - -#include "modsecurity.h" -#include "apache2.h" -#include "http_main.h" -#include "http_connection.h" - -#include "apr_optional.h" -#include "mod_log_config.h" - -#include "msc_logging.h" -#include "msc_util.h" - -#include "ap_mpm.h" -#include "scoreboard.h" - -#include "apr_version.h" - -#include "apr_lib.h" -#include "ap_config.h" -#include "http_config.h" - -#define FILTER_POOL apr_hook_global_pool -#include "apr_hooks.h" - -/* -** This macro returns true/false if a given filter should be inserted BEFORE -** another filter. This will happen when one of: 1) there isn't another -** filter; 2) that filter has a higher filter type (class); 3) that filter -** corresponds to a different request. -*/ -#define INSERT_BEFORE(f, before_this) ((before_this) == NULL \ - || (before_this)->frec->ftype > (f)->frec->ftype \ - || (before_this)->r != (f)->r) - - -apr_table_t *ms_input_filters = NULL; -apr_table_t *ms_output_filters = NULL; - -void init_filter_tables() -{ - if(ms_input_filters == NULL) - { - ms_input_filters = apr_table_make(FILTER_POOL, 10); - ms_output_filters = apr_table_make(FILTER_POOL, 10); - } -} - -AP_DECLARE(ap_filter_rec_t *) ap_register_input_filter(const char *name, - ap_in_filter_func filter_func, - ap_init_filter_func filter_init, - ap_filter_type ftype) -{ - ap_filter_rec_t *f; - - init_filter_tables(); - - f = apr_palloc(FILTER_POOL, sizeof(ap_filter_rec_t)); - - f->filter_func.in_func = filter_func; - f->filter_init_func = filter_init; - f->ftype = ftype; - f->name = name; - - apr_table_setn(ms_input_filters, name, (const char *)f); - - return f; -} - -AP_DECLARE(ap_filter_rec_t *) ap_register_output_filter(const char *name, - ap_out_filter_func filter_func, - ap_init_filter_func filter_init, - ap_filter_type ftype) -{ - ap_filter_rec_t *f; - - init_filter_tables(); - - f = apr_palloc(FILTER_POOL, sizeof(ap_filter_rec_t)); - - f->filter_func.out_func = filter_func; - f->filter_init_func = filter_init; - f->ftype = ftype; - f->name = name; - - apr_table_setn(ms_output_filters, name, (const char *)f); - - return f; -} - -static ap_filter_t *add_any_filter_handle(ap_filter_rec_t *frec, void *ctx, - request_rec *r, conn_rec *c, - ap_filter_t **r_filters, - ap_filter_t **p_filters, - ap_filter_t **c_filters) -{ - apr_pool_t* p = r ? r->pool : c->pool; - ap_filter_t *f = apr_palloc(p, sizeof(*f)); - ap_filter_t **outf; - - if (frec->ftype < AP_FTYPE_PROTOCOL) { - if (r) { - outf = r_filters; - } - else { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "a content filter was added without a request: %s", frec->name); - return NULL; - } - } - else if (frec->ftype < AP_FTYPE_CONNECTION) { - if (r) { - outf = p_filters; - } - else { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "a protocol filter was added without a request: %s", frec->name); - return NULL; - } - } - else { - outf = c_filters; - } - - f->frec = frec; - f->ctx = ctx; - f->r = r; - f->c = c; - f->next = NULL; - - if (INSERT_BEFORE(f, *outf)) { - f->next = *outf; - - if (*outf) { - ap_filter_t *first = NULL; - - if (r) { - /* If we are adding our first non-connection filter, - * Then don't try to find the right location, it is - * automatically first. - */ - if (*r_filters != *c_filters) { - first = *r_filters; - while (first && (first->next != (*outf))) { - first = first->next; - } - } - } - if (first && first != (*outf)) { - first->next = f; - } - } - *outf = f; - } - else { - ap_filter_t *fscan = *outf; - while (!INSERT_BEFORE(f, fscan->next)) - fscan = fscan->next; - - f->next = fscan->next; - fscan->next = f; - } - - if (frec->ftype < AP_FTYPE_CONNECTION && (*r_filters == *c_filters)) { - *r_filters = *p_filters; - } - return f; -} - -AP_DECLARE(ap_filter_t *) ap_add_input_filter(const char *name, void *ctx, - request_rec *r, conn_rec *c) -{ - ap_filter_rec_t *f = (ap_filter_rec_t *)apr_table_get(ms_input_filters, name); - - if(f == NULL) - return NULL; - - return add_any_filter_handle(f, ctx, r, c, - r ? &r->input_filters : NULL, - r ? &r->proto_input_filters : NULL, &c->input_filters); -} - -AP_DECLARE(ap_filter_t *) ap_add_output_filter(const char *name, void *ctx, - request_rec *r, conn_rec *c) -{ - ap_filter_rec_t *f = (ap_filter_rec_t *)apr_table_get(ms_output_filters, name); - - if(f == NULL) - return NULL; - - return add_any_filter_handle(f, ctx, r, c, - r ? &r->output_filters : NULL, - r ? &r->proto_output_filters : NULL, &c->output_filters); -} - -static void remove_any_filter(ap_filter_t *f, ap_filter_t **r_filt, ap_filter_t **p_filt, - ap_filter_t **c_filt) -{ - ap_filter_t **curr = r_filt ? r_filt : c_filt; - ap_filter_t *fscan = *curr; - - if (p_filt && *p_filt == f) - *p_filt = (*p_filt)->next; - - if (*curr == f) { - *curr = (*curr)->next; - return; - } - - while (fscan->next != f) { - if (!(fscan = fscan->next)) { - return; - } - } - - fscan->next = f->next; -} - -AP_DECLARE(void) ap_remove_input_filter(ap_filter_t *f) -{ - remove_any_filter(f, f->r ? &f->r->input_filters : NULL, - f->r ? &f->r->proto_input_filters : NULL, - &f->c->input_filters); -} - -AP_DECLARE(void) ap_remove_output_filter(ap_filter_t *f) -{ - remove_any_filter(f, f->r ? &f->r->output_filters : NULL, - f->r ? &f->r->proto_output_filters : NULL, - &f->c->output_filters); -} +/* +* ModSecurity for Apache 2.x, http://www.modsecurity.org/ +* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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 "http_core.h" +#include "http_request.h" + +#include "modsecurity.h" +#include "apache2.h" +#include "http_main.h" +#include "http_connection.h" + +#include "apr_optional.h" +#include "mod_log_config.h" + +#include "msc_logging.h" +#include "msc_util.h" + +#include "ap_mpm.h" +#include "scoreboard.h" + +#include "apr_version.h" + +#include "apr_lib.h" +#include "ap_config.h" +#include "http_config.h" + +#define FILTER_POOL apr_hook_global_pool +#include "apr_hooks.h" + +/* +** This macro returns true/false if a given filter should be inserted BEFORE +** another filter. This will happen when one of: 1) there isn't another +** filter; 2) that filter has a higher filter type (class); 3) that filter +** corresponds to a different request. +*/ +#define INSERT_BEFORE(f, before_this) ((before_this) == NULL \ + || (before_this)->frec->ftype > (f)->frec->ftype \ + || (before_this)->r != (f)->r) + + +apr_table_t *ms_input_filters = NULL; +apr_table_t *ms_output_filters = NULL; + +void init_filter_tables() +{ + if(ms_input_filters == NULL) + { + ms_input_filters = apr_table_make(FILTER_POOL, 10); + ms_output_filters = apr_table_make(FILTER_POOL, 10); + } +} + +AP_DECLARE(ap_filter_rec_t *) ap_register_input_filter(const char *name, + ap_in_filter_func filter_func, + ap_init_filter_func filter_init, + ap_filter_type ftype) +{ + ap_filter_rec_t *f; + + init_filter_tables(); + + f = apr_palloc(FILTER_POOL, sizeof(ap_filter_rec_t)); + + f->filter_func.in_func = filter_func; + f->filter_init_func = filter_init; + f->ftype = ftype; + f->name = name; + + apr_table_setn(ms_input_filters, name, (const char *)f); + + return f; +} + +AP_DECLARE(ap_filter_rec_t *) ap_register_output_filter(const char *name, + ap_out_filter_func filter_func, + ap_init_filter_func filter_init, + ap_filter_type ftype) +{ + ap_filter_rec_t *f; + + init_filter_tables(); + + f = apr_palloc(FILTER_POOL, sizeof(ap_filter_rec_t)); + + f->filter_func.out_func = filter_func; + f->filter_init_func = filter_init; + f->ftype = ftype; + f->name = name; + + apr_table_setn(ms_output_filters, name, (const char *)f); + + return f; +} + +static ap_filter_t *add_any_filter_handle(ap_filter_rec_t *frec, void *ctx, + request_rec *r, conn_rec *c, + ap_filter_t **r_filters, + ap_filter_t **p_filters, + ap_filter_t **c_filters) +{ + apr_pool_t* p = r ? r->pool : c->pool; + ap_filter_t *f = apr_palloc(p, sizeof(*f)); + ap_filter_t **outf; + + if (frec->ftype < AP_FTYPE_PROTOCOL) { + if (r) { + outf = r_filters; + } + else { + ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, + "a content filter was added without a request: %s", frec->name); + return NULL; + } + } + else if (frec->ftype < AP_FTYPE_CONNECTION) { + if (r) { + outf = p_filters; + } + else { + ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, + "a protocol filter was added without a request: %s", frec->name); + return NULL; + } + } + else { + outf = c_filters; + } + + f->frec = frec; + f->ctx = ctx; + f->r = r; + f->c = c; + f->next = NULL; + + if (INSERT_BEFORE(f, *outf)) { + f->next = *outf; + + if (*outf) { + ap_filter_t *first = NULL; + + if (r) { + /* If we are adding our first non-connection filter, + * Then don't try to find the right location, it is + * automatically first. + */ + if (*r_filters != *c_filters) { + first = *r_filters; + while (first && (first->next != (*outf))) { + first = first->next; + } + } + } + if (first && first != (*outf)) { + first->next = f; + } + } + *outf = f; + } + else { + ap_filter_t *fscan = *outf; + while (!INSERT_BEFORE(f, fscan->next)) + fscan = fscan->next; + + f->next = fscan->next; + fscan->next = f; + } + + if (frec->ftype < AP_FTYPE_CONNECTION && (*r_filters == *c_filters)) { + *r_filters = *p_filters; + } + return f; +} + +AP_DECLARE(ap_filter_t *) ap_add_input_filter(const char *name, void *ctx, + request_rec *r, conn_rec *c) +{ + ap_filter_rec_t *f = (ap_filter_rec_t *)apr_table_get(ms_input_filters, name); + + if(f == NULL) + return NULL; + + return add_any_filter_handle(f, ctx, r, c, + r ? &r->input_filters : NULL, + r ? &r->proto_input_filters : NULL, &c->input_filters); +} + +AP_DECLARE(ap_filter_t *) ap_add_output_filter(const char *name, void *ctx, + request_rec *r, conn_rec *c) +{ + ap_filter_rec_t *f = (ap_filter_rec_t *)apr_table_get(ms_output_filters, name); + + if(f == NULL) + return NULL; + + return add_any_filter_handle(f, ctx, r, c, + r ? &r->output_filters : NULL, + r ? &r->proto_output_filters : NULL, &c->output_filters); +} + +static void remove_any_filter(ap_filter_t *f, ap_filter_t **r_filt, ap_filter_t **p_filt, + ap_filter_t **c_filt) +{ + ap_filter_t **curr = r_filt ? r_filt : c_filt; + ap_filter_t *fscan = *curr; + + if (p_filt && *p_filt == f) + *p_filt = (*p_filt)->next; + + if (*curr == f) { + *curr = (*curr)->next; + return; + } + + while (fscan->next != f) { + if (!(fscan = fscan->next)) { + return; + } + } + + fscan->next = f->next; +} + +AP_DECLARE(void) ap_remove_input_filter(ap_filter_t *f) +{ + remove_any_filter(f, f->r ? &f->r->input_filters : NULL, + f->r ? &f->r->proto_input_filters : NULL, + &f->c->input_filters); +} + +AP_DECLARE(void) ap_remove_output_filter(ap_filter_t *f) +{ + remove_any_filter(f, f->r ? &f->r->output_filters : NULL, + f->r ? &f->r->proto_output_filters : NULL, + &f->c->output_filters); +} diff --git a/standalone/hooks.c b/standalone/hooks.c index dbb4b967..aff3dca6 100644 --- a/standalone/hooks.c +++ b/standalone/hooks.c @@ -1,65 +1,65 @@ -/* -* ModSecurity for Apache 2.x, http://www.modsecurity.org/ -* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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 "http_core.h" -#include "http_request.h" - -#include "modsecurity.h" -#include "apache2.h" -#include "http_main.h" -#include "http_connection.h" - -#include "apr_optional.h" -#include "mod_log_config.h" - -#include "msc_logging.h" -#include "msc_util.h" - -#include "ap_mpm.h" -#include "scoreboard.h" - -#include "apr_version.h" - -#include "apr_lib.h" -#include "ap_config.h" -#include "http_config.h" - - -#define DECLARE_EXTERNAL_HOOK(ns,link,ret,name,args) \ -ns##_HOOK_##name##_t *hookfn_##name = NULL; \ -link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf, \ - const char * const *aszPre, \ - const char * const *aszSucc, int nOrder) \ -{ \ - hookfn_##name = pf; \ -} - -#define DECLARE_HOOK(ret,name,args) \ - DECLARE_EXTERNAL_HOOK(ap,AP,ret,name,args) - -DECLARE_HOOK(int,pre_config,(apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp)) -DECLARE_HOOK(int,post_config,(apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp,server_rec *s)) -DECLARE_HOOK(void,child_init,(apr_pool_t *pchild, server_rec *s)) -DECLARE_HOOK(int,process_connection,(conn_rec *c)) -DECLARE_HOOK(int,post_read_request,(request_rec *r)) -DECLARE_HOOK(int,fixups,(request_rec *r)) -DECLARE_HOOK(void, error_log, (const char *file, int line, int level, - apr_status_t status, const server_rec *s, - const request_rec *r, apr_pool_t *pool, - const char *errstr)) -DECLARE_HOOK(int,log_transaction,(request_rec *r)) -DECLARE_HOOK(void,insert_filter,(request_rec *r)) -DECLARE_HOOK(void,insert_error_filter,(request_rec *r)) +/* +* ModSecurity for Apache 2.x, http://www.modsecurity.org/ +* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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 "http_core.h" +#include "http_request.h" + +#include "modsecurity.h" +#include "apache2.h" +#include "http_main.h" +#include "http_connection.h" + +#include "apr_optional.h" +#include "mod_log_config.h" + +#include "msc_logging.h" +#include "msc_util.h" + +#include "ap_mpm.h" +#include "scoreboard.h" + +#include "apr_version.h" + +#include "apr_lib.h" +#include "ap_config.h" +#include "http_config.h" + + +#define DECLARE_EXTERNAL_HOOK(ns,link,ret,name,args) \ +ns##_HOOK_##name##_t *hookfn_##name = NULL; \ +link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf, \ + const char * const *aszPre, \ + const char * const *aszSucc, int nOrder) \ +{ \ + hookfn_##name = pf; \ +} + +#define DECLARE_HOOK(ret,name,args) \ + DECLARE_EXTERNAL_HOOK(ap,AP,ret,name,args) + +DECLARE_HOOK(int,pre_config,(apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp)) +DECLARE_HOOK(int,post_config,(apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp,server_rec *s)) +DECLARE_HOOK(void,child_init,(apr_pool_t *pchild, server_rec *s)) +DECLARE_HOOK(int,process_connection,(conn_rec *c)) +DECLARE_HOOK(int,post_read_request,(request_rec *r)) +DECLARE_HOOK(int,fixups,(request_rec *r)) +DECLARE_HOOK(void, error_log, (const char *file, int line, int level, + apr_status_t status, const server_rec *s, + const request_rec *r, apr_pool_t *pool, + const char *errstr)) +DECLARE_HOOK(int,log_transaction,(request_rec *r)) +DECLARE_HOOK(void,insert_filter,(request_rec *r)) +DECLARE_HOOK(void,insert_error_filter,(request_rec *r)) diff --git a/standalone/libapr-1.lib b/standalone/libapr-1.lib deleted file mode 100644 index 01b91dd0..00000000 Binary files a/standalone/libapr-1.lib and /dev/null differ diff --git a/standalone/libaprutil-1.lib b/standalone/libaprutil-1.lib deleted file mode 100644 index 799ec37a..00000000 Binary files a/standalone/libaprutil-1.lib and /dev/null differ diff --git a/standalone/libxml2.lib b/standalone/libxml2.lib deleted file mode 100644 index 485869d1..00000000 Binary files a/standalone/libxml2.lib and /dev/null differ diff --git a/standalone/main.cpp b/standalone/main.cpp index 912b96f9..94a5b24d 100644 --- a/standalone/main.cpp +++ b/standalone/main.cpp @@ -1,434 +1,434 @@ -/* -* ModSecurity for Apache 2.x, http://www.modsecurity.org/ -* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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. -*/ - -//#undef inline -#define inline inline - -#include -#include -#include "api.h" - - -char *config_file = NULL; -char *url_file = NULL; -char *event_files[1024]; -int event_file_cnt; -char *event_file = NULL; -int event_file_len = 0; -char **event_file_lines; -int event_line_cnt = 0; -int event_file_blocks[256]; - -#define EVENT_FILE_MAX_SIZE (16*1024*1024) - -#define MAX_URLS 4096 - -char urls[MAX_URLS][4096]; -int url_cnt = 0; - -void readeventfile(char *name) -{ - if(event_file == NULL) - { - event_file = (char *)malloc(EVENT_FILE_MAX_SIZE); - event_file_lines = (char **)malloc(EVENT_FILE_MAX_SIZE); - } - - event_file_len = 0; - event_line_cnt = 0; - memset(event_file_blocks, -1, sizeof(int) * 256); - - FILE *fr = fopen(name, "rb"); - - if(fr == NULL) - return; - - event_file_len = fread(event_file, 1, EVENT_FILE_MAX_SIZE - 1, fr); - - fclose(fr); - - event_file[event_file_len] = 0; -} - -void parseeventfile() -{ - if(event_file_len == 0 || event_file == NULL) - return; - - char *t = event_file; - char *e = event_file + event_file_len; - int nocrlf = 1; - - while(t < e) - { - event_file_lines[event_line_cnt++] = t; - - while(t < e && *t != 10 && *t != 13) - t++; - - char ct = *t; - *t = 0; - int i = event_line_cnt - 1; - - int l = strlen(event_file_lines[i]); - - if(l == 14 && event_file_lines[i][0] == '-' && event_file_lines[i][1] == '-' && event_file_lines[i][l-2] == '-' && event_file_lines[i][l-1] == '-') - { - char blk = event_file_lines[i][l-3]; - - event_file_blocks[blk] = i; - - if(blk == 'C' || blk == 'G') - { - nocrlf = 0; - } - else - { - nocrlf = 1; - } - } - *t = ct; - - if(nocrlf) - while(t < e && (*t == 10 || *t == 13)) - *t++ = 0; - else - while(t < e && (*t == 10 || *t == 13)) - t++; - } -} - -void parseargs(int argc, char *argv[]) -{ - int i = 1; - - event_file_cnt = 0; - - while(i < argc) - { - if(argv[i][0] == '-') - { - if(argv[i][1] == 'c' && i < argc - 1) - { - config_file = argv[i + 1]; - i += 2; - continue; - } - if(argv[i][1] == 'u' && i < argc - 1) - { - url_file = argv[i + 1]; - i += 2; - continue; - } - i++; - continue; - } - if(event_file_cnt == 1024) - { - fprintf(stderr, "Too many input files! (limit 1024)\n"); - break; - } - - event_files[event_file_cnt++] = argv[i++]; - } -} - -void log(void *obj, int level, char *str) -{ - printf("%s\n", str); -} - -unsigned int bodypos = 0; - -apr_status_t readbody(request_rec *r, char *buf, unsigned int length, unsigned int *readcnt, int *is_eos) -{ - int j = event_file_blocks['C']; - - if(j < 0) - { - *is_eos = 1; - return APR_SUCCESS; - } - - j++; - - if(event_file_lines[j][0] == 0) - { - *is_eos = 1; - return APR_SUCCESS; - } - - unsigned int l = strlen(event_file_lines[j]); - unsigned int size = length; - - if(bodypos + size > l) - size = l - bodypos; - - memcpy(buf, &event_file_lines[j][bodypos], size); - - bodypos += size; - *readcnt = size; - - if(bodypos == l) - { - *is_eos = 1; - } - - return APR_SUCCESS; -} - -unsigned int responsepos = 0; - -apr_status_t readresponse(request_rec *r, char *buf, unsigned int length, unsigned int *readcnt, int *is_eos) -{ - int j = event_file_blocks['G']; - - if(j < 0) - { - *is_eos = 1; - return APR_SUCCESS; - } - - j++; - - if(event_file_lines[j][0] == 0) - { - *is_eos = 1; - return APR_SUCCESS; - } - - unsigned int l = strlen(event_file_lines[j]); - unsigned int size = length; - - if(responsepos + size > l) - size = l - responsepos; - - memcpy(buf, &event_file_lines[j][responsepos], size); - - responsepos += size; - *readcnt = size; - - if(responsepos == l) - *is_eos = 1; - - return APR_SUCCESS; -} - -void main(int argc, char *argv[]) -{ - directory_config *config; - conn_rec *c; - request_rec *r; - - parseargs(argc, argv); - - if(config_file == NULL || argc < 3) - { - printf("Usage:\n"); - printf("standalone.exe -c [-u ] [ ...]\n"); - return; - } - - modsecSetLogHook(NULL, log); - - modsecSetReadBody(readbody); - modsecSetReadResponse(readresponse); - - modsecInit(); - - modsecStartConfig(); - - config = modsecGetDefaultConfig(); - - const char * err = modsecProcessConfig(config, config_file, "c:\\inetpub\\wwwroot"); - - if(err != NULL) - { - printf("%s\n", err); - } - - modsecFinalizeConfig(); - - modsecInitProcess(); - - if(url_file != NULL) - { - FILE *fr = fopen(url_file, "rb"); - int i = 0; - - while(fgets(urls[i],4096,fr) != NULL) - { - urls[i][4095] = 0; - - int l = strlen(urls[i]) - 1; - - if(l < 8) - continue; - - while(urls[i][l] == 10 || urls[i][l] == 13) - l--; - - urls[i++][l + 1] = 0; - } - - url_cnt = i; - fclose(fr); - } - - for(int i = 0; i < event_file_cnt; i++) - { - if(url_cnt == 0) - { - urls[0][0] = 0; - url_cnt = 1; - } - - for(int ui = 0; ui < url_cnt; ui++) - { - readeventfile(event_files[i]); - parseeventfile(); - - bodypos = 0; - responsepos = 0; - - c = modsecNewConnection(); - - modsecProcessConnection(c); - - r = modsecNewRequest(c, config); - - int j = event_file_blocks['B']; - - if(j < 0) - continue; - - j++; - - if(event_file_lines[j][0] == 0) - continue; - - char *method = event_file_lines[j]; - char *url = strchr(method, 32); - char *proto = strchr(url + 1, 32); - - if(url == NULL || proto == NULL) - continue; - - *url++=0; - *proto++=0; - - if(urls[ui][0] != 0) - { - url = urls[ui]; - } - -#define SETMETHOD(m) if(strcmp(method,#m) == 0){ r->method = method; r->method_number = M_##m; } - - r->method = "INVALID"; - r->method_number = M_INVALID; - - SETMETHOD(OPTIONS) - SETMETHOD(GET) - SETMETHOD(POST) - SETMETHOD(PUT) - SETMETHOD(DELETE) - SETMETHOD(TRACE) - SETMETHOD(CONNECT) - SETMETHOD(MOVE) - SETMETHOD(COPY) - SETMETHOD(PROPFIND) - SETMETHOD(PROPPATCH) - SETMETHOD(MKCOL) - SETMETHOD(LOCK) - SETMETHOD(UNLOCK) - - r->protocol = proto; - - while(event_file_lines[++j][0] != 0) - { - char *value = strchr(event_file_lines[j], ':'); - - if(value == NULL) - break; - - *value++ = 0; - - while(*value <=32 && *value != 0) - value++; - - apr_table_setn(r->headers_in, event_file_lines[j], value); - } - - r->content_encoding = apr_table_get(r->headers_in, "Content-Encoding"); - r->content_type = apr_table_get(r->headers_in, "Content-Type"); - r->hostname = apr_table_get(r->headers_in, "Host"); - r->path_info = url; - - char *query = strchr(url, '?'); - char *rawurl = url; - - if(query != NULL) - { - rawurl = (char *)apr_palloc(r->pool, strlen(url) + 1); - strcpy(rawurl, url); - *query++ = 0; - r->args = query; - } - - const char *lng = apr_table_get(r->headers_in, "Content-Languages"); - - if(lng != NULL) - { - r->content_languages = apr_array_make(r->pool, 1, sizeof(const char *)); - - *(const char **)apr_array_push(r->content_languages) = lng; - } - - r->request_time = apr_time_now(); - - r->parsed_uri.scheme = "http"; - r->parsed_uri.path = r->path_info; - r->parsed_uri.hostname = (char *)r->hostname; - r->parsed_uri.is_initialized = 1; - r->parsed_uri.port = 80; - r->parsed_uri.port_str = "80"; - r->parsed_uri.query = r->args; - r->parsed_uri.dns_looked_up = 0; - r->parsed_uri.dns_resolved = 0; - r->parsed_uri.password = NULL; - r->parsed_uri.user = NULL; - r->parsed_uri.fragment = NULL; - - r->unparsed_uri = rawurl; - r->uri = r->unparsed_uri; - - r->the_request = (char *)apr_palloc(r->pool, strlen(r->method) + 1 + strlen(r->uri) + 1 + strlen(r->protocol) + 1); - - strcpy(r->the_request, r->method); - strcat(r->the_request, " "); - strcat(r->the_request, r->uri); - strcat(r->the_request, " "); - strcat(r->the_request, r->protocol); - - apr_table_setn(r->subprocess_env, "UNIQUE_ID", "1"); - - modsecProcessRequest(r); - modsecProcessResponse(r); - modsecFinishRequest(r); - } - } - - modsecTerminate(); - getch(); -} +/* +* ModSecurity for Apache 2.x, http://www.modsecurity.org/ +* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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. +*/ + +//#undef inline +#define inline inline + +#include +#include +#include "api.h" + + +char *config_file = NULL; +char *url_file = NULL; +char *event_files[1024]; +int event_file_cnt; +char *event_file = NULL; +int event_file_len = 0; +char **event_file_lines; +int event_line_cnt = 0; +int event_file_blocks[256]; + +#define EVENT_FILE_MAX_SIZE (16*1024*1024) + +#define MAX_URLS 4096 + +char urls[MAX_URLS][4096]; +int url_cnt = 0; + +void readeventfile(char *name) +{ + if(event_file == NULL) + { + event_file = (char *)malloc(EVENT_FILE_MAX_SIZE); + event_file_lines = (char **)malloc(EVENT_FILE_MAX_SIZE); + } + + event_file_len = 0; + event_line_cnt = 0; + memset(event_file_blocks, -1, sizeof(int) * 256); + + FILE *fr = fopen(name, "rb"); + + if(fr == NULL) + return; + + event_file_len = fread(event_file, 1, EVENT_FILE_MAX_SIZE - 1, fr); + + fclose(fr); + + event_file[event_file_len] = 0; +} + +void parseeventfile() +{ + if(event_file_len == 0 || event_file == NULL) + return; + + char *t = event_file; + char *e = event_file + event_file_len; + int nocrlf = 1; + + while(t < e) + { + event_file_lines[event_line_cnt++] = t; + + while(t < e && *t != 10 && *t != 13) + t++; + + char ct = *t; + *t = 0; + int i = event_line_cnt - 1; + + int l = strlen(event_file_lines[i]); + + if(l == 14 && event_file_lines[i][0] == '-' && event_file_lines[i][1] == '-' && event_file_lines[i][l-2] == '-' && event_file_lines[i][l-1] == '-') + { + char blk = event_file_lines[i][l-3]; + + event_file_blocks[blk] = i; + + if(blk == 'C' || blk == 'G') + { + nocrlf = 0; + } + else + { + nocrlf = 1; + } + } + *t = ct; + + if(nocrlf) + while(t < e && (*t == 10 || *t == 13)) + *t++ = 0; + else + while(t < e && (*t == 10 || *t == 13)) + t++; + } +} + +void parseargs(int argc, char *argv[]) +{ + int i = 1; + + event_file_cnt = 0; + + while(i < argc) + { + if(argv[i][0] == '-') + { + if(argv[i][1] == 'c' && i < argc - 1) + { + config_file = argv[i + 1]; + i += 2; + continue; + } + if(argv[i][1] == 'u' && i < argc - 1) + { + url_file = argv[i + 1]; + i += 2; + continue; + } + i++; + continue; + } + if(event_file_cnt == 1024) + { + fprintf(stderr, "Too many input files! (limit 1024)\n"); + break; + } + + event_files[event_file_cnt++] = argv[i++]; + } +} + +void log(void *obj, int level, char *str) +{ + printf("%s\n", str); +} + +unsigned int bodypos = 0; + +apr_status_t readbody(request_rec *r, char *buf, unsigned int length, unsigned int *readcnt, int *is_eos) +{ + int j = event_file_blocks['C']; + + if(j < 0) + { + *is_eos = 1; + return APR_SUCCESS; + } + + j++; + + if(event_file_lines[j][0] == 0) + { + *is_eos = 1; + return APR_SUCCESS; + } + + unsigned int l = strlen(event_file_lines[j]); + unsigned int size = length; + + if(bodypos + size > l) + size = l - bodypos; + + memcpy(buf, &event_file_lines[j][bodypos], size); + + bodypos += size; + *readcnt = size; + + if(bodypos == l) + { + *is_eos = 1; + } + + return APR_SUCCESS; +} + +unsigned int responsepos = 0; + +apr_status_t readresponse(request_rec *r, char *buf, unsigned int length, unsigned int *readcnt, int *is_eos) +{ + int j = event_file_blocks['G']; + + if(j < 0) + { + *is_eos = 1; + return APR_SUCCESS; + } + + j++; + + if(event_file_lines[j][0] == 0) + { + *is_eos = 1; + return APR_SUCCESS; + } + + unsigned int l = strlen(event_file_lines[j]); + unsigned int size = length; + + if(responsepos + size > l) + size = l - responsepos; + + memcpy(buf, &event_file_lines[j][responsepos], size); + + responsepos += size; + *readcnt = size; + + if(responsepos == l) + *is_eos = 1; + + return APR_SUCCESS; +} + +void main(int argc, char *argv[]) +{ + directory_config *config; + conn_rec *c; + request_rec *r; + + parseargs(argc, argv); + + if(config_file == NULL || argc < 3) + { + printf("Usage:\n"); + printf("standalone.exe -c [-u ] [ ...]\n"); + return; + } + + modsecSetLogHook(NULL, log); + + modsecSetReadBody(readbody); + modsecSetReadResponse(readresponse); + + modsecInit(); + + modsecStartConfig(); + + config = modsecGetDefaultConfig(); + + const char * err = modsecProcessConfig(config, config_file, "c:\\inetpub\\wwwroot"); + + if(err != NULL) + { + printf("%s\n", err); + } + + modsecFinalizeConfig(); + + modsecInitProcess(); + + if(url_file != NULL) + { + FILE *fr = fopen(url_file, "rb"); + int i = 0; + + while(fgets(urls[i],4096,fr) != NULL) + { + urls[i][4095] = 0; + + int l = strlen(urls[i]) - 1; + + if(l < 8) + continue; + + while(urls[i][l] == 10 || urls[i][l] == 13) + l--; + + urls[i++][l + 1] = 0; + } + + url_cnt = i; + fclose(fr); + } + + for(int i = 0; i < event_file_cnt; i++) + { + if(url_cnt == 0) + { + urls[0][0] = 0; + url_cnt = 1; + } + + for(int ui = 0; ui < url_cnt; ui++) + { + readeventfile(event_files[i]); + parseeventfile(); + + bodypos = 0; + responsepos = 0; + + c = modsecNewConnection(); + + modsecProcessConnection(c); + + r = modsecNewRequest(c, config); + + int j = event_file_blocks['B']; + + if(j < 0) + continue; + + j++; + + if(event_file_lines[j][0] == 0) + continue; + + char *method = event_file_lines[j]; + char *url = strchr(method, 32); + char *proto = strchr(url + 1, 32); + + if(url == NULL || proto == NULL) + continue; + + *url++=0; + *proto++=0; + + if(urls[ui][0] != 0) + { + url = urls[ui]; + } + +#define SETMETHOD(m) if(strcmp(method,#m) == 0){ r->method = method; r->method_number = M_##m; } + + r->method = "INVALID"; + r->method_number = M_INVALID; + + SETMETHOD(OPTIONS) + SETMETHOD(GET) + SETMETHOD(POST) + SETMETHOD(PUT) + SETMETHOD(DELETE) + SETMETHOD(TRACE) + SETMETHOD(CONNECT) + SETMETHOD(MOVE) + SETMETHOD(COPY) + SETMETHOD(PROPFIND) + SETMETHOD(PROPPATCH) + SETMETHOD(MKCOL) + SETMETHOD(LOCK) + SETMETHOD(UNLOCK) + + r->protocol = proto; + + while(event_file_lines[++j][0] != 0) + { + char *value = strchr(event_file_lines[j], ':'); + + if(value == NULL) + break; + + *value++ = 0; + + while(*value <=32 && *value != 0) + value++; + + apr_table_setn(r->headers_in, event_file_lines[j], value); + } + + r->content_encoding = apr_table_get(r->headers_in, "Content-Encoding"); + r->content_type = apr_table_get(r->headers_in, "Content-Type"); + r->hostname = apr_table_get(r->headers_in, "Host"); + r->path_info = url; + + char *query = strchr(url, '?'); + char *rawurl = url; + + if(query != NULL) + { + rawurl = (char *)apr_palloc(r->pool, strlen(url) + 1); + strcpy(rawurl, url); + *query++ = 0; + r->args = query; + } + + const char *lng = apr_table_get(r->headers_in, "Content-Languages"); + + if(lng != NULL) + { + r->content_languages = apr_array_make(r->pool, 1, sizeof(const char *)); + + *(const char **)apr_array_push(r->content_languages) = lng; + } + + r->request_time = apr_time_now(); + + r->parsed_uri.scheme = "http"; + r->parsed_uri.path = r->path_info; + r->parsed_uri.hostname = (char *)r->hostname; + r->parsed_uri.is_initialized = 1; + r->parsed_uri.port = 80; + r->parsed_uri.port_str = "80"; + r->parsed_uri.query = r->args; + r->parsed_uri.dns_looked_up = 0; + r->parsed_uri.dns_resolved = 0; + r->parsed_uri.password = NULL; + r->parsed_uri.user = NULL; + r->parsed_uri.fragment = NULL; + + r->unparsed_uri = rawurl; + r->uri = r->unparsed_uri; + + r->the_request = (char *)apr_palloc(r->pool, strlen(r->method) + 1 + strlen(r->uri) + 1 + strlen(r->protocol) + 1); + + strcpy(r->the_request, r->method); + strcat(r->the_request, " "); + strcat(r->the_request, r->uri); + strcat(r->the_request, " "); + strcat(r->the_request, r->protocol); + + apr_table_setn(r->subprocess_env, "UNIQUE_ID", "1"); + + modsecProcessRequest(r); + modsecProcessResponse(r); + modsecFinishRequest(r); + } + } + + modsecTerminate(); + getch(); +} diff --git a/standalone/mlogc.exe b/standalone/mlogc.exe deleted file mode 100644 index 267b367f..00000000 Binary files a/standalone/mlogc.exe and /dev/null differ diff --git a/standalone/pcre.lib b/standalone/pcre.lib deleted file mode 100644 index 17270cee..00000000 Binary files a/standalone/pcre.lib and /dev/null differ diff --git a/standalone/regex.c b/standalone/regex.c index e356144e..3f50e18d 100644 --- a/standalone/regex.c +++ b/standalone/regex.c @@ -1,162 +1,162 @@ -/* -* ModSecurity for Apache 2.x, http://www.modsecurity.org/ -* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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 "http_core.h" -#include "http_request.h" - -#include "modsecurity.h" -#include "apache2.h" -#include "http_main.h" -#include "http_connection.h" - -#include "apr_optional.h" -#include "mod_log_config.h" - -#include "msc_logging.h" -#include "msc_util.h" - -#include "ap_mpm.h" -#include "scoreboard.h" - -#include "apr_version.h" - -#include "apr_lib.h" -#include "ap_config.h" -#include "http_config.h" - - -static apr_status_t regex_cleanup(void *preg) -{ - ap_regfree((ap_regex_t *) preg); - return APR_SUCCESS; -} - -AP_DECLARE(ap_regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern, - int cflags) -{ - ap_regex_t *preg = apr_palloc(p, sizeof *preg); - - if (ap_regcomp(preg, pattern, cflags)) { - return NULL; - } - - apr_pool_cleanup_register(p, (void *) preg, regex_cleanup, - apr_pool_cleanup_null); - - return preg; -} - -AP_DECLARE(void) ap_regfree(ap_regex_t *preg) -{ -(pcre_free)(preg->re_pcre); -} - -AP_DECLARE(int) ap_regcomp(ap_regex_t *preg, const char *pattern, int cflags) -{ -const char *errorptr; -int erroffset; -int options = 0; -int nsub = 0; - -if ((cflags & AP_REG_ICASE) != 0) options |= PCRE_CASELESS; -if ((cflags & AP_REG_NEWLINE) != 0) options |= PCRE_MULTILINE; - -preg->re_pcre = pcre_compile(pattern, options, &errorptr, &erroffset, NULL); -preg->re_erroffset = erroffset; - -if (preg->re_pcre == NULL) return AP_REG_INVARG; - -pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT, &nsub); -preg->re_nsub = nsub; -return 0; -} - -#ifndef POSIX_MALLOC_THRESHOLD -#define POSIX_MALLOC_THRESHOLD (10) -#endif - -AP_DECLARE(int) ap_regexec(const ap_regex_t *preg, const char *string, - apr_size_t nmatch, ap_regmatch_t pmatch[], - int eflags) -{ -int rc; -int options = 0; -int *ovector = NULL; -int small_ovector[POSIX_MALLOC_THRESHOLD * 3]; -int allocated_ovector = 0; - -if ((eflags & AP_REG_NOTBOL) != 0) options |= PCRE_NOTBOL; -if ((eflags & AP_REG_NOTEOL) != 0) options |= PCRE_NOTEOL; - -((ap_regex_t *)preg)->re_erroffset = (apr_size_t)(-1); /* Only has meaning after compile */ - -if (nmatch > 0) - { - if (nmatch <= POSIX_MALLOC_THRESHOLD) - { - ovector = &(small_ovector[0]); - } - else - { - ovector = (int *)malloc(sizeof(int) * nmatch * 3); - if (ovector == NULL) return AP_REG_ESPACE; - allocated_ovector = 1; - } - } - -rc = pcre_exec((const pcre *)preg->re_pcre, NULL, string, (int)strlen(string), - 0, options, ovector, nmatch * 3); - -if (rc == 0) rc = nmatch; /* All captured slots were filled in */ - -if (rc >= 0) - { - apr_size_t i; - for (i = 0; i < (apr_size_t)rc; i++) - { - pmatch[i].rm_so = ovector[i*2]; - pmatch[i].rm_eo = ovector[i*2+1]; - } - if (allocated_ovector) free(ovector); - for (; i < nmatch; i++) pmatch[i].rm_so = pmatch[i].rm_eo = -1; - return 0; - } - -else - { - if (allocated_ovector) free(ovector); - switch(rc) - { - case PCRE_ERROR_NOMATCH: return AP_REG_NOMATCH; - case PCRE_ERROR_NULL: return AP_REG_INVARG; - case PCRE_ERROR_BADOPTION: return AP_REG_INVARG; - case PCRE_ERROR_BADMAGIC: return AP_REG_INVARG; - case PCRE_ERROR_UNKNOWN_NODE: return AP_REG_ASSERT; - case PCRE_ERROR_NOMEMORY: return AP_REG_ESPACE; -#ifdef PCRE_ERROR_MATCHLIMIT - case PCRE_ERROR_MATCHLIMIT: return AP_REG_ESPACE; -#endif -#ifdef PCRE_ERROR_BADUTF8 - case PCRE_ERROR_BADUTF8: return AP_REG_INVARG; -#endif -#ifdef PCRE_ERROR_BADUTF8_OFFSET - case PCRE_ERROR_BADUTF8_OFFSET: return AP_REG_INVARG; -#endif - default: return AP_REG_ASSERT; - } - } -} - +/* +* ModSecurity for Apache 2.x, http://www.modsecurity.org/ +* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://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 "http_core.h" +#include "http_request.h" + +#include "modsecurity.h" +#include "apache2.h" +#include "http_main.h" +#include "http_connection.h" + +#include "apr_optional.h" +#include "mod_log_config.h" + +#include "msc_logging.h" +#include "msc_util.h" + +#include "ap_mpm.h" +#include "scoreboard.h" + +#include "apr_version.h" + +#include "apr_lib.h" +#include "ap_config.h" +#include "http_config.h" + + +static apr_status_t regex_cleanup(void *preg) +{ + ap_regfree((ap_regex_t *) preg); + return APR_SUCCESS; +} + +AP_DECLARE(ap_regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern, + int cflags) +{ + ap_regex_t *preg = apr_palloc(p, sizeof *preg); + + if (ap_regcomp(preg, pattern, cflags)) { + return NULL; + } + + apr_pool_cleanup_register(p, (void *) preg, regex_cleanup, + apr_pool_cleanup_null); + + return preg; +} + +AP_DECLARE(void) ap_regfree(ap_regex_t *preg) +{ +(pcre_free)(preg->re_pcre); +} + +AP_DECLARE(int) ap_regcomp(ap_regex_t *preg, const char *pattern, int cflags) +{ +const char *errorptr; +int erroffset; +int options = 0; +int nsub = 0; + +if ((cflags & AP_REG_ICASE) != 0) options |= PCRE_CASELESS; +if ((cflags & AP_REG_NEWLINE) != 0) options |= PCRE_MULTILINE; + +preg->re_pcre = pcre_compile(pattern, options, &errorptr, &erroffset, NULL); +preg->re_erroffset = erroffset; + +if (preg->re_pcre == NULL) return AP_REG_INVARG; + +pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT, &nsub); +preg->re_nsub = nsub; +return 0; +} + +#ifndef POSIX_MALLOC_THRESHOLD +#define POSIX_MALLOC_THRESHOLD (10) +#endif + +AP_DECLARE(int) ap_regexec(const ap_regex_t *preg, const char *string, + apr_size_t nmatch, ap_regmatch_t pmatch[], + int eflags) +{ +int rc; +int options = 0; +int *ovector = NULL; +int small_ovector[POSIX_MALLOC_THRESHOLD * 3]; +int allocated_ovector = 0; + +if ((eflags & AP_REG_NOTBOL) != 0) options |= PCRE_NOTBOL; +if ((eflags & AP_REG_NOTEOL) != 0) options |= PCRE_NOTEOL; + +((ap_regex_t *)preg)->re_erroffset = (apr_size_t)(-1); /* Only has meaning after compile */ + +if (nmatch > 0) + { + if (nmatch <= POSIX_MALLOC_THRESHOLD) + { + ovector = &(small_ovector[0]); + } + else + { + ovector = (int *)malloc(sizeof(int) * nmatch * 3); + if (ovector == NULL) return AP_REG_ESPACE; + allocated_ovector = 1; + } + } + +rc = pcre_exec((const pcre *)preg->re_pcre, NULL, string, (int)strlen(string), + 0, options, ovector, nmatch * 3); + +if (rc == 0) rc = nmatch; /* All captured slots were filled in */ + +if (rc >= 0) + { + apr_size_t i; + for (i = 0; i < (apr_size_t)rc; i++) + { + pmatch[i].rm_so = ovector[i*2]; + pmatch[i].rm_eo = ovector[i*2+1]; + } + if (allocated_ovector) free(ovector); + for (; i < nmatch; i++) pmatch[i].rm_so = pmatch[i].rm_eo = -1; + return 0; + } + +else + { + if (allocated_ovector) free(ovector); + switch(rc) + { + case PCRE_ERROR_NOMATCH: return AP_REG_NOMATCH; + case PCRE_ERROR_NULL: return AP_REG_INVARG; + case PCRE_ERROR_BADOPTION: return AP_REG_INVARG; + case PCRE_ERROR_BADMAGIC: return AP_REG_INVARG; + case PCRE_ERROR_UNKNOWN_NODE: return AP_REG_ASSERT; + case PCRE_ERROR_NOMEMORY: return AP_REG_ESPACE; +#ifdef PCRE_ERROR_MATCHLIMIT + case PCRE_ERROR_MATCHLIMIT: return AP_REG_ESPACE; +#endif +#ifdef PCRE_ERROR_BADUTF8 + case PCRE_ERROR_BADUTF8: return AP_REG_INVARG; +#endif +#ifdef PCRE_ERROR_BADUTF8_OFFSET + case PCRE_ERROR_BADUTF8_OFFSET: return AP_REG_INVARG; +#endif + default: return AP_REG_ASSERT; + } + } +} + diff --git a/standalone/standalone.sln b/standalone/standalone.sln index e582ba06..56adec80 100644 --- a/standalone/standalone.sln +++ b/standalone/standalone.sln @@ -1,26 +1,26 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "standalone", "standalone.vcxproj", "{20EC871F-B6A0-4398-9B67-A33598A796E8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {20EC871F-B6A0-4398-9B67-A33598A796E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {20EC871F-B6A0-4398-9B67-A33598A796E8}.Debug|Win32.Build.0 = Debug|Win32 - {20EC871F-B6A0-4398-9B67-A33598A796E8}.Debug|x64.ActiveCfg = Debug|x64 - {20EC871F-B6A0-4398-9B67-A33598A796E8}.Debug|x64.Build.0 = Debug|x64 - {20EC871F-B6A0-4398-9B67-A33598A796E8}.Release|Win32.ActiveCfg = Release|Win32 - {20EC871F-B6A0-4398-9B67-A33598A796E8}.Release|Win32.Build.0 = Release|Win32 - {20EC871F-B6A0-4398-9B67-A33598A796E8}.Release|x64.ActiveCfg = Release|x64 - {20EC871F-B6A0-4398-9B67-A33598A796E8}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "standalone", "standalone.vcxproj", "{20EC871F-B6A0-4398-9B67-A33598A796E8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {20EC871F-B6A0-4398-9B67-A33598A796E8}.Debug|Win32.ActiveCfg = Debug|Win32 + {20EC871F-B6A0-4398-9B67-A33598A796E8}.Debug|Win32.Build.0 = Debug|Win32 + {20EC871F-B6A0-4398-9B67-A33598A796E8}.Debug|x64.ActiveCfg = Debug|x64 + {20EC871F-B6A0-4398-9B67-A33598A796E8}.Debug|x64.Build.0 = Debug|x64 + {20EC871F-B6A0-4398-9B67-A33598A796E8}.Release|Win32.ActiveCfg = Release|Win32 + {20EC871F-B6A0-4398-9B67-A33598A796E8}.Release|Win32.Build.0 = Release|Win32 + {20EC871F-B6A0-4398-9B67-A33598A796E8}.Release|x64.ActiveCfg = Release|x64 + {20EC871F-B6A0-4398-9B67-A33598A796E8}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/standalone/standalone.v11.suo b/standalone/standalone.v11.suo deleted file mode 100644 index c815b911..00000000 Binary files a/standalone/standalone.v11.suo and /dev/null differ diff --git a/standalone/standalone.vcxproj b/standalone/standalone.vcxproj index 02f9aa2e..5e4bd8ef 100644 --- a/standalone/standalone.vcxproj +++ b/standalone/standalone.vcxproj @@ -1,216 +1,216 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {20EC871F-B6A0-4398-9B67-A33598A796E8} - standalone - - - - Application - true - MultiByte - v110 - - - Application - true - MultiByte - v110 - - - Application - false - true - MultiByte - v110 - - - Application - false - true - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - Level3 - Disabled - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2;c:\work\httpd-2.2.24\include - _MBCS;%(PreprocessorDefinitions);WIN32;WINNT;inline=APR_INLINE;AP_DECLARE_STATIC;VERSION_STANDALONE - 4244;4018 - - - true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies);libapr-1.lib;libaprutil-1.lib;pcre.lib;libxml2.lib - c:\drop\x86 - - - - - Level3 - Disabled - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - _MBCS;%(PreprocessorDefinitions);WIN32;WINNT;inline=APR_INLINE;AP_DECLARE_STATIC - 4244;4018 - - - true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies);libapr-1.lib;libaprutil-1.lib;pcre.lib;libxml2.lib - c:\drop\amd64 - - - - - Level3 - MaxSpeed - true - true - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - - - true - true - true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies);libapr-1.lib;libaprutil-1.lib;pcre.lib;libxml2.lib - c:\drop\x86 - - - - - Level3 - MaxSpeed - true - true - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - - - true - true - true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies);libapr-1.lib;libaprutil-1.lib;pcre.lib;libxml2.lib - c:\drop\amd64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;;..\apache2 - - - - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - - - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - - - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - - - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - - - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {20EC871F-B6A0-4398-9B67-A33598A796E8} + standalone + + + + Application + true + MultiByte + v110 + + + Application + true + MultiByte + v110 + + + Application + false + true + MultiByte + v110 + + + Application + false + true + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + Level3 + Disabled + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2;c:\work\httpd-2.2.24\include + _MBCS;%(PreprocessorDefinitions);WIN32;WINNT;inline=APR_INLINE;AP_DECLARE_STATIC;VERSION_STANDALONE + 4244;4018 + + + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies);libapr-1.lib;libaprutil-1.lib;pcre.lib;libxml2.lib + c:\drop\x86 + + + + + Level3 + Disabled + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + _MBCS;%(PreprocessorDefinitions);WIN32;WINNT;inline=APR_INLINE;AP_DECLARE_STATIC + 4244;4018 + + + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies);libapr-1.lib;libaprutil-1.lib;pcre.lib;libxml2.lib + c:\drop\amd64 + + + + + Level3 + MaxSpeed + true + true + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + + + true + true + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies);libapr-1.lib;libaprutil-1.lib;pcre.lib;libxml2.lib + c:\drop\x86 + + + + + Level3 + MaxSpeed + true + true + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + + + true + true + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies);libapr-1.lib;libaprutil-1.lib;pcre.lib;libxml2.lib + c:\drop\amd64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;;..\apache2 + + + + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + + + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + + + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + + + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + + + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/standalone/standalone.vcxproj.filters b/standalone/standalone.vcxproj.filters index f51478e8..d0a61197 100644 --- a/standalone/standalone.vcxproj.filters +++ b/standalone/standalone.vcxproj.filters @@ -1,192 +1,192 @@ - - - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {2d4a2f57-e994-4dad-888a-e61a65029abf} - - - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - Standalone Sources - - - Standalone Sources - - - Standalone Sources - - - Standalone Sources - - - Standalone Sources - - - Standalone Sources - - - Standalone Sources - - - Standalone Sources - - - ModSecurity Sources - - - ModSecurity Sources - - - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - ModSecurity Headers - - - Standalone Sources - - - ModSecurity Headers - - - ModSecurity Headers - - + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {2d4a2f57-e994-4dad-888a-e61a65029abf} + + + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + Standalone Sources + + + Standalone Sources + + + Standalone Sources + + + Standalone Sources + + + Standalone Sources + + + Standalone Sources + + + Standalone Sources + + + Standalone Sources + + + ModSecurity Sources + + + ModSecurity Sources + + + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + ModSecurity Headers + + + Standalone Sources + + + ModSecurity Headers + + + ModSecurity Headers + + \ No newline at end of file diff --git a/standalone/standalone.vcxproj.user b/standalone/standalone.vcxproj.user index deb3e354..48c0f715 100644 --- a/standalone/standalone.vcxproj.user +++ b/standalone/standalone.vcxproj.user @@ -1,14 +1,14 @@ - - - - -c d:\temp\antixss.conf -u d:\temp\modsec_urls.txt d:\temp\test1.dat - WindowsLocalDebugger - $(TargetPath) - false - NativeOnly - - - -c d:\xss.conf d:\test.dat - WindowsLocalDebugger - + + + + -c d:\temp\antixss.conf -u d:\temp\modsec_urls.txt d:\temp\test1.dat + WindowsLocalDebugger + $(TargetPath) + false + NativeOnly + + + -c d:\xss.conf d:\test.dat + WindowsLocalDebugger + \ No newline at end of file diff --git a/v3wkqlls.fht.txt b/v3wkqlls.fht.txt new file mode 100644 index 00000000..9e38566d --- /dev/null +++ b/v3wkqlls.fht.txt @@ -0,0 +1,12 @@ + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# On branch master +# Your branch is ahead of 'origin/master' by 1 commit. +# +# Changes to be committed: +# (use "git reset HEAD ..." to unstage) +# +# deleted: standalone/standalone.sdf +# +