merge upstream & update configs

This commit is contained in:
Mihai Pitu
2013-08-23 13:54:30 +03:00
parent 107ff9af8f
commit 9651da3d4c
192 changed files with 14497 additions and 439 deletions

Binary file not shown.

Binary file not shown.

BIN
standalone/Debug/acmp.obj Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
standalone/Debug/api.obj Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
standalone/Debug/config.obj Normal file

Binary file not shown.

Binary file not shown.

BIN
standalone/Debug/hooks.obj Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD>

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD>

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD>

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD>

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD>

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD>

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD>

BIN
standalone/Debug/main.obj Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
standalone/Debug/re.obj Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
standalone/Debug/regex.obj Normal file

Binary file not shown.

BIN
standalone/Debug/server.obj Normal file

Binary file not shown.

View File

@@ -0,0 +1,84 @@
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_PCRE.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_RELEASE.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_REQBODY.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_TREE.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_UNICODE.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_UTIL.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_XML.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\PERSIST_DBM.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\RE.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\RE_ACTIONS.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\RE_OPERATORS.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\RE_TFNS.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\RE_VARIABLES.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\API.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\BUCKETS.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\CONFIG.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\FILTERS.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\HOOKS.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\REGEX.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\SERVER.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\ACMP.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\APACHE2_CONFIG.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\APACHE2_IO.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\APACHE2_UTIL.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MODSECURITY.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MOD_SECURITY2.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_CRYPT.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_GEO.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_GSB.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_LOGGING.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_LUA.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_MULTIPART.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MSC_PARSERS.OBJ
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\VC110.PDB
C:\WORK\MOD_SECURITY2\STANDALONE\DEBUG\MAIN.OBJ
c:\work\mod_security2\standalone\Debug\acmp.obj
c:\work\mod_security2\standalone\Debug\apache2_config.obj
c:\work\mod_security2\standalone\Debug\apache2_io.obj
c:\work\mod_security2\standalone\Debug\apache2_util.obj
c:\work\mod_security2\standalone\Debug\api.obj
c:\work\mod_security2\standalone\Debug\buckets.obj
c:\work\mod_security2\standalone\Debug\config.obj
c:\work\mod_security2\standalone\Debug\filters.obj
c:\work\mod_security2\standalone\Debug\hooks.obj
c:\work\mod_security2\standalone\Debug\main.obj
c:\work\mod_security2\standalone\Debug\modsecurity.obj
c:\work\mod_security2\standalone\Debug\mod_security2.obj
c:\work\mod_security2\standalone\Debug\msc_crypt.obj
c:\work\mod_security2\standalone\Debug\msc_geo.obj
c:\work\mod_security2\standalone\Debug\msc_gsb.obj
c:\work\mod_security2\standalone\Debug\msc_logging.obj
c:\work\mod_security2\standalone\Debug\msc_lua.obj
c:\work\mod_security2\standalone\Debug\msc_multipart.obj
c:\work\mod_security2\standalone\Debug\msc_parsers.obj
c:\work\mod_security2\standalone\Debug\msc_pcre.obj
c:\work\mod_security2\standalone\Debug\msc_release.obj
c:\work\mod_security2\standalone\Debug\msc_reqbody.obj
c:\work\mod_security2\standalone\Debug\msc_tree.obj
c:\work\mod_security2\standalone\Debug\msc_unicode.obj
c:\work\mod_security2\standalone\Debug\msc_util.obj
c:\work\mod_security2\standalone\Debug\msc_xml.obj
c:\work\mod_security2\standalone\Debug\persist_dbm.obj
c:\work\mod_security2\standalone\Debug\re.obj
c:\work\mod_security2\standalone\Debug\regex.obj
c:\work\mod_security2\standalone\Debug\re_actions.obj
c:\work\mod_security2\standalone\Debug\re_operators.obj
c:\work\mod_security2\standalone\Debug\re_tfns.obj
c:\work\mod_security2\standalone\Debug\re_variables.obj
c:\work\mod_security2\standalone\Debug\server.obj
c:\work\mod_security2\standalone\Debug\cl.command.1.tlog
c:\work\mod_security2\standalone\Debug\CL.read.1.tlog
c:\work\mod_security2\standalone\Debug\CL.write.1.tlog
c:\work\mod_security2\standalone\Debug\link-cvtres.read.1.tlog
c:\work\mod_security2\standalone\Debug\link-cvtres.write.1.tlog
c:\work\mod_security2\standalone\Debug\link-rc.read.1.tlog
c:\work\mod_security2\standalone\Debug\link-rc.write.1.tlog
c:\work\mod_security2\standalone\Debug\link.command.1.tlog
c:\work\mod_security2\standalone\Debug\link.read.1.tlog
c:\work\mod_security2\standalone\Debug\link.write.1.tlog
c:\work\mod_security2\standalone\Debug\standalone.exp
c:\work\mod_security2\standalone\Debug\vc110.idb
c:\work\mod_security2\standalone\Debug\standalone.pdb
c:\work\mod_security2\standalone\Debug\vc110.pdb
C:\work\mod_security2\standalone\Debug\standalone.pdb

Binary file not shown.

View File

@@ -0,0 +1,2 @@
#v4.0:v110:false
Debug|Win32|C:\work\mod_security2\standalone\|

Binary file not shown.

View File

@@ -0,0 +1,90 @@
Build started 8/23/2013 12:59:45 PM.
1>Project "c:\work\mod_security2\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 /Ic:\work\apache24\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
1>c:\work\mod_security2\standalone\api.c(226): warning C4101: 'rc' : unreferenced local variable
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
1>c:\work\mod_security2\apache2\msc_crypt.c(70): warning C4101: 'i' : unreferenced local variable
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 /Ic:\work\apache24\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_security2\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_security2\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_security2\standalone\Debug\standalone.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\work\mod_security2\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_security2\standalone\Debug\standalone.lib and object C:\work\mod_security2\standalone\Debug\standalone.exp
1>re_operators.obj : error LNK2019: unresolved external symbol _libinjection_sqli_init referenced in function _msre_op_detectSQLi_execute
1>re_operators.obj : error LNK2019: unresolved external symbol _libinjection_is_sqli referenced in function _msre_op_detectSQLi_execute
1>C:\work\mod_security2\standalone\Debug\standalone.exe : fatal error LNK1120: 2 unresolved externals
1>Done Building Project "c:\work\mod_security2\standalone\standalone.vcxproj" (Build target(s)) -- FAILED.
Build FAILED.
Time Elapsed 00:00:15.65

Binary file not shown.

BIN
standalone/Debug/vc110.idb Normal file

Binary file not shown.

BIN
standalone/Debug/vc110.pdb Normal file

Binary file not shown.

View File

@@ -13,7 +13,7 @@ standalone_la_SOURCES = ../apache2/mod_security2.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 \
../apache2/msc_crypt.c ../apache2/msc_tree.c ../apache2/libinjection/libinjection_sqli.c \
api.c buckets.c \
config.c filters.c \
hooks.c \
@@ -72,6 +72,10 @@ standalone_la_LDFLAGS = -no-undefined -module -avoid-version \
@PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@
endif
standalone_INCS = `echo "@LIBXML2_CFLAGS@ @LUA_CFLAGS@" | sed -n 's/ *-I *\([^ ]*\) /\1 /gp'` \
@APXS_INCLUDEDIR@ @APR_INCLUDEDIR@ @APU_INCLUDEDIR@
standalone_LIBS = @APR_LINKLD@ @APU_LINKLD@ @APXS_LDFLAGS@ \
@PCRE_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@
install-exec-hook: $(pkglib_LTLIBRARIES)
@echo "Creating Nginx config file..."; \
rm -f ../nginx/modsecurity/config; \
@@ -79,9 +83,9 @@ install-exec-hook: $(pkglib_LTLIBRARIES)
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 "NGX_ADDON_DEPS=\"\$$NGX_ADDON_DEPS \$$ngx_addon_dir/apr_bucket_nginx.h \$$ngx_addon_dir/ngx_pool_context.h \$$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 "CORE_LIBS=\"\$$CORE_LIBS \$$ngx_addon_dir/../../standalone/.libs/standalone.a $(standalone_LIBS) \"" >> ../nginx/modsecurity/config; \
echo "CORE_INCS=\"\$$CORE_INCS \$$ngx_addon_dir \$$ngx_addon_dir/../../standalone \$$ngx_addon_dir/../../apache2 $(standalone_INCS)\"" >> ../nginx/modsecurity/config; \
echo "Removing unused static libraries..."; \
for m in $(pkglib_LTLIBRARIES); do \
base=`echo $$m | sed 's/\..*//'`; \

View File

@@ -1,9 +1,8 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -51,7 +50,8 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = standalone
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/build/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/build/find_apr.m4 \
$(top_srcdir)/build/find_apu.m4 \
@@ -149,13 +149,17 @@ AMTAR = @AMTAR@
APR_CFLAGS = @APR_CFLAGS@
APR_CONFIG = @APR_CONFIG@
APR_CPPFLAGS = @APR_CPPFLAGS@
APR_INCLUDEDIR = @APR_INCLUDEDIR@
APR_LDADD = @APR_LDADD@
APR_LDFLAGS = @APR_LDFLAGS@
APR_LINKLD = @APR_LINKLD@
APR_VERSION = @APR_VERSION@
APU_CFLAGS = @APU_CFLAGS@
APU_CONFIG = @APU_CONFIG@
APU_INCLUDEDIR = @APU_INCLUDEDIR@
APU_LDADD = @APU_LDADD@
APU_LDFLAGS = @APU_LDFLAGS@
APU_LINKLD = @APU_LINKLD@
APU_VERSION = @APU_VERSION@
APXS = @APXS@
APXS_BINDIR = @APXS_BINDIR@
@@ -381,6 +385,12 @@ standalone_la_LIBADD = @APR_LDADD@ @APU_LDADD@ @PCRE_LDADD@ @LIBXML2_LDADD@ @LUA
@SOLARIS_TRUE@ @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \
@SOLARIS_TRUE@ @PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@
standalone_INCS = `echo "@LIBXML2_CFLAGS@ @LUA_CFLAGS@" | sed -n 's/ *-I *\([^ ]*\) /\1 /gp'` \
@APXS_INCLUDEDIR@ @APR_INCLUDEDIR@ @APU_INCLUDEDIR@
standalone_LIBS = @APR_LINKLD@ @APU_LINKLD@ @APXS_LDFLAGS@ \
@PCRE_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@
all: all-am
.SUFFIXES:
@@ -441,12 +451,14 @@ uninstall-pkglibLTLIBRARIES:
clean-pkglibLTLIBRARIES:
-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
@list='$(pkglib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
standalone.la: $(standalone_la_OBJECTS) $(standalone_la_DEPENDENCIES) $(EXTRA_standalone_la_DEPENDENCIES)
$(standalone_la_LINK) -rpath $(pkglibdir) $(standalone_la_OBJECTS) $(standalone_la_LIBADD) $(LIBS)
@@ -797,6 +809,20 @@ GTAGS:
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -942,32 +968,30 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
.MAKE: install-am install-exec-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-exec-hook \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am \
install-pkglibLTLIBRARIES install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-pkglibLTLIBRARIES
clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-exec-hook install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-pkglibLTLIBRARIES install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-pkglibLTLIBRARIES
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 "# HTTP_MODULES=\"\$$HTTP_MODULES ngx_http_modsecurity\"" >> ../nginx/modsecurity/config; \
echo "HTTP_HEADERS_FILTER_MODULE=\"ngx_http_modsecurity \$$HTTP_HEADERS_FILTER_MODULE\"" >> ../nginx/modsecurity/config; \
echo "NGX_ADDON_SRCS=\"\$$NGX_ADDON_SRCS \$$ngx_addon_dir/ngx_http_modsecurity.c \$$ngx_addon_dir/apr_bucket_nginx.c\"" >> ../nginx/modsecurity/config;\
echo "NGX_ADDON_DEPS=\"\$$NGX_ADDON_DEPS\"" >> ../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 "have=REQUEST_EARLY . auto/have" >> ../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 \$$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 "CORE_LIBS=\"\$$CORE_LIBS \$$ngx_addon_dir/../../standalone/.libs/standalone.a $(standalone_LIBS) \"" >> ../nginx/modsecurity/config; \
echo "CORE_INCS=\"\$$CORE_INCS \$$ngx_addon_dir \$$ngx_addon_dir/../../standalone \$$ngx_addon_dir/../../apache2 $(standalone_INCS)\"" >> ../nginx/modsecurity/config; \
echo "Removing unused static libraries..."; \
for m in $(pkglib_LTLIBRARIES); do \
base=`echo $$m | sed 's/\..*//'`; \

View File

@@ -1,6 +1,6 @@
/*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
@@ -223,40 +223,10 @@ apr_status_t ap_http_in_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
}
apr_status_t ap_http_out_filter(ap_filter_t *f, apr_bucket_brigade *b) {
modsec_rec *msr = (modsec_rec *)f->ctx;
apr_status_t rc;
apr_bucket_brigade *bb_out;
bb_out = modsecGetResponseBrigade(f->r);
if (bb_out) {
APR_BRIGADE_CONCAT(bb_out, b);
return APR_SUCCESS;
}
// is there a way to tell whether the response body was modified or not?
//
if((msr->txcfg->content_injection_enabled || msr->content_prepend_len != 0 || msr->content_append_len != 0)
&& msr->txcfg->resbody_access) {
if (modsecWriteResponse != NULL) {
char *data = NULL;
apr_size_t length;
rc = apr_brigade_pflatten(msr->of_brigade, &data, &length, msr->mp);
if (rc != APR_SUCCESS) {
msr_log(msr, 1, "Output filter: Failed to flatten brigade (%d): %s", rc,
get_apr_error(msr->mp, rc));
return -1;
}
/* TODO: return ?*/
modsecWriteResponse(msr->r, data, msr->stream_output_length);
}
}
apr_bucket_brigade *bb_out = (apr_bucket_brigade *)f->ctx;
APR_BRIGADE_CONCAT(bb_out, b);
return APR_SUCCESS;
}
@@ -551,74 +521,117 @@ int modsecIsResponseBodyAccessEnabled(request_rec *r)
}
int modsecProcessResponse(request_rec *r) {
int status = DECLINED;
int status;
modsec_rec *msr;
apr_bucket *e;
ap_filter_t *f;
apr_bucket_brigade *bb_in, *bb_out, *bb;
if(r->output_filters != NULL) {
modsec_rec *msr = (modsec_rec *)r->output_filters->ctx;
char buf[8192];
char *tmp = NULL;
apr_bucket *e = NULL;
if(r->output_filters == NULL) {
return DECLINED;
}
msr = (modsec_rec *)r->output_filters->ctx;
if (msr == NULL) {
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r->server,
"ModSecurity: Internal Error: msr is null in output filter.");
ap_remove_output_filter(r->output_filters);
return APR_EGENERAL;
}
msr->r = r;
/* create input response brigade */
bb_in = apr_brigade_create(msr->mp, r->connection->bucket_alloc);
if (bb_in == NULL) {
msr_log(msr, 1, "Process response: Failed to create brigade.");
return APR_EGENERAL;
}
/* get input response brigade */
bb = modsecGetResponseBrigade(r);
if (bb != NULL) {
APR_BRIGADE_CONCAT(bb_in, bb);
if (!APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb_in))) {
e = apr_bucket_eos_create(bb_in->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb_in, e);
}
} else if (modsecReadResponse != NULL) {
unsigned int readcnt = 0;
int is_eos = 0;
ap_filter_t *f = NULL;
apr_bucket_brigade *bb_in, *bb = NULL;
char buf[8192];
while(!is_eos) {
modsecReadResponse(r, buf, 8192, &readcnt, &is_eos);
if (msr == NULL) {
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r->server,
"ModSecurity: Internal Error: msr is null in output filter.");
ap_remove_output_filter(r->output_filters);
return send_error_bucket(msr, r->output_filters, HTTP_INTERNAL_SERVER_ERROR);
}
bb = apr_brigade_create(msr->mp, r->connection->bucket_alloc);
if (bb == NULL) {
msr_log(msr, 1, "Process response: Failed to create brigade.");
return APR_EGENERAL;
}
msr->r = r;
bb_in = modsecGetResponseBrigade(r);
if (bb_in != NULL) {
APR_BRIGADE_CONCAT(bb, bb_in);
if (!APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
e = apr_bucket_eos_create(bb->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, e);
if(readcnt > 0) {
char *tmp = (char *)apr_palloc(r->pool, readcnt);
memcpy(tmp, buf, readcnt);
e = apr_bucket_pool_create(tmp, readcnt, r->pool, r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb_in, e);
}
} else if (modsecReadResponse != NULL) {
while(!is_eos) {
modsecReadResponse(r, buf, 8192, &readcnt, &is_eos);
}
if(readcnt > 0) {
tmp = (char *)apr_palloc(r->pool, readcnt);
memcpy(tmp, buf, readcnt);
e = apr_bucket_pool_create(tmp, readcnt, r->pool, r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, e);
}
e = apr_bucket_eos_create(r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb_in, e);
} else {
/* cannot read response body process header only */
e = apr_bucket_eos_create(r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb_in, e);
}
bb_out = bb ? bb : apr_brigade_create(msr->mp, r->connection->bucket_alloc);
if (bb_out == NULL) {
msr_log(msr, 1, "Process response: Failed to create brigade.");
return APR_EGENERAL;
}
/* concat output bucket to bb_out */
f = ap_add_output_filter("HTTP_OUT", bb_out, r, r->connection);
status = ap_pass_brigade(r->output_filters, bb_in);
ap_remove_output_filter(f);
if (status == APR_EGENERAL) {
/* retrive response status from bb_out */
for(e = APR_BRIGADE_FIRST(bb_out);
e != APR_BRIGADE_SENTINEL(bb_out);
e = APR_BUCKET_NEXT(e)) {
if (AP_BUCKET_IS_ERROR(e)) {
return ((ap_bucket_error*) e->data)->status;
}
e = apr_bucket_eos_create(r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, e);
} else {
/* cannot read response body process header only */
e = apr_bucket_eos_create(r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, e);
}
f = ap_add_output_filter("HTTP_OUT", msr, r, r->connection);
status = ap_pass_brigade(r->output_filters, bb);
ap_remove_output_filter(f);
if(status > 0
&& msr->intercept_actionset->intercept_status != 0) {
status = msr->intercept_actionset->intercept_status;
}
return APR_EGENERAL;
}
if (status != DECLINED) {
return status;
}
return status;
/* copy bb_out */
// is there a way to tell whether the response body was modified or not?
if (modsecWriteResponse != NULL
&& (msr->txcfg->content_injection_enabled || msr->content_prepend_len != 0 || msr->content_append_len != 0)
&& msr->txcfg->resbody_access) {
char *data = NULL;
apr_size_t length;
status = apr_brigade_pflatten(msr->of_brigade, &data, &length, msr->mp);
if (status != APR_SUCCESS) {
msr_log(msr, 1, "Output filter: Failed to flatten brigade (%d): %s", status,
get_apr_error(msr->mp, status));
return APR_EGENERAL;
}
if ( modsecWriteResponse(msr->r, data, msr->stream_output_length) != APR_SUCCESS) {
return APR_EGENERAL;
}
}
return DECLINED;
}
int modsecFinishRequest(request_rec *r) {

View File

@@ -1,6 +1,6 @@
/*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at

View File

@@ -1,6 +1,6 @@
/*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at

View File

@@ -1,6 +1,6 @@
/*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at

View File

@@ -1,6 +1,6 @@
/*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at

View File

@@ -1,6 +1,6 @@
/*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at

BIN
standalone/libapr-1.lib Normal file

Binary file not shown.

BIN
standalone/libaprutil-1.lib Normal file

Binary file not shown.

BIN
standalone/libxml2.lib Normal file

Binary file not shown.

View File

@@ -1,6 +1,6 @@
/*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at

BIN
standalone/pcre.lib Normal file

Binary file not shown.

View File

@@ -1,6 +1,6 @@
/*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at

View File

@@ -1,6 +1,6 @@
/*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
@@ -893,7 +893,11 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
#ifndef WIN32
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER < 3
unixd_config_rec unixd_config;
#else
unixd_config_rec ap_unixd_config;
#endif
const char *ap_server_argv0 = "nginx";
#ifdef HAVE_GETPWNAM
@@ -936,13 +940,18 @@ AP_DECLARE(void) unixd_pre_config(apr_pool_t *ptemp)
{
apr_finfo_t wrapper;
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER < 3
unixd_config.user_name = DEFAULT_USER;
unixd_config.user_id = ap_uname2id(DEFAULT_USER);
unixd_config.group_id = ap_gname2id(DEFAULT_GROUP);
/* unixd_config.chroot_dir = NULL; none */
/* Check for suexec */
unixd_config.suexec_enabled = 0;
#else
ap_unixd_config.user_name = DEFAULT_USER;
ap_unixd_config.user_id = ap_uname2id(DEFAULT_USER);
ap_unixd_config.group_id = ap_gname2id(DEFAULT_GROUP);
ap_unixd_config.suexec_enabled = 0;
#endif
/* if ((apr_stat(&wrapper, SUEXEC_BIN,
APR_FINFO_NORM, ptemp)) != APR_SUCCESS) {
return;
@@ -967,6 +976,7 @@ static apr_lockmech_e proc_mutex_mech(apr_proc_mutex_t *pmutex)
return APR_LOCK_DEFAULT;
}
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER < 3
AP_DECLARE(apr_status_t) unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex)
{
////////////////
@@ -1038,5 +1048,75 @@ AP_DECLARE(apr_status_t) unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex
return unixd_set_proc_mutex_perms(gmutex);
#endif /* APR_PROC_MUTEX_IS_GLOBAL */
}
#else
AP_DECLARE(apr_status_t) ap_unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex)
{
if (ap_unixd_config.user_name == NULL)
{
unixd_pre_config(NULL);
}
if (!geteuid()) {
apr_lockmech_e mech = proc_mutex_mech(pmutex);
switch(mech) {
#if APR_HAS_SYSVSEM_SERIALIZE
case APR_LOCK_SYSVSEM:
{
apr_os_proc_mutex_t ospmutex;
#if !APR_HAVE_UNION_SEMUN
union semun {
long val;
struct semid_ds *buf;
unsigned short *array;
};
#endif
union semun ick;
struct semid_ds buf;
apr_os_proc_mutex_get(&ospmutex, pmutex);
buf.sem_perm.uid = ap_unixd_config.user_id;
buf.sem_perm.gid = ap_unixd_config.group_id;
buf.sem_perm.mode = 0600;
ick.buf = &buf;
if (semctl(ospmutex.crossproc, 0, IPC_SET, ick) < 0) {
return errno;
}
}
break;
#endif
#if APR_HAS_FLOCK_SERIALIZE
case APR_LOCK_FLOCK:
{
const char *lockfile = apr_proc_mutex_lockfile(pmutex);
if (lockfile) {
if (chown(lockfile, ap_unixd_config.user_id,
-1 /* no gid change */) < 0) {
return errno;
}
}
}
break;
#endif
default:
/* do nothing */
break;
}
}
return APR_SUCCESS;
}
AP_DECLARE(apr_status_t) ap_unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex)
{
#if !APR_PROC_MUTEX_IS_GLOBAL
apr_os_global_mutex_t osgmutex;
apr_os_global_mutex_get(&osgmutex, gmutex);
return ap_unixd_set_proc_mutex_perms(osgmutex.proc_mutex);
#else /* APR_PROC_MUTEX_IS_GLOBAL */
/* In this case, apr_proc_mutex_t and apr_global_mutex_t are the same. */
return ap_unixd_set_proc_mutex_perms(gmutex);
#endif /* APR_PROC_MUTEX_IS_GLOBAL */
}
#endif
#endif

BIN
standalone/standalone.sdf Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -70,7 +70,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>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</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>C:\work\pcre-8.30\include;C:\work\pcre-8.30;C:\work\libxml2-2.7.7\include;C:\apache22\include;..\apache2;c:\work\apache24\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);WIN32;WINNT;inline=APR_INLINE;AP_DECLARE_STATIC;VERSION_STANDALONE</PreprocessorDefinitions>
<DisableSpecificWarnings>4244;4018</DisableSpecificWarnings>
</ClCompile>
@@ -78,6 +78,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>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</AdditionalDependencies>
<AdditionalLibraryDirectories>c:\drop\x86</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">