Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite131e22

Browse files
author
Felipe Zimmerle
committed
Adds support to status engine on IIS version
Fixes on the windows versions: build, mac address and machine name retrieval
1 parentf86a71f commite131e22

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

‎apache2/Makefile.win‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ LIBS = $(APACHE)\lib\libhttpd.lib \
1212
$(APACHE)\lib\libaprutil-1.lib \
1313
$(PCRE)\pcre.lib \
1414
$(LIBXML2)\win32\bin.msvc\libxml2.lib \
15-
Ws2_32.lib
15+
Ws2_32.lib \
16+
"iphlpapi.lib"
1617

1718
###########################################################################
1819
###########################################################################
@@ -46,7 +47,8 @@ OBJS = mod_security2.obj apache2_config.obj apache2_io.obj apache2_util.obj \
4647
msc_logging.obj msc_xml.obj msc_multipart.obj modsecurity.obj \
4748
msc_parsers.obj msc_util.obj msc_pcre.obj persist_dbm.obj \
4849
msc_reqbody.obj msc_geo.obj msc_gsb.obj msc_crypt.obj msc_tree.obj msc_unicode.obj acmp.obj msc_lua.obj \
49-
msc_release.obj libinjection\libinjection_sqli.obj
50+
msc_release.obj libinjection\libinjection_sqli.obj \
51+
msc_status_engine.obj
5052

5153
all: $(DLL)
5254

‎apache2/apache2_config.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2083,7 +2083,7 @@ static const char *cmd_rule_engine(cmd_parms *cmd, void *_dcfg, const char *p1)
20832083
returnNULL;
20842084
}
20852085

2086-
staticconstchar*cmd_STATUS_ENGINE(cmd_parms*cmd,void*_dcfg,constchar*p1)
2086+
staticconstchar*cmd_status_engine(cmd_parms*cmd,void*_dcfg,constchar*p1)
20872087
{
20882088
if (strcasecmp(p1,"on")==0) {
20892089
status_engine_state=STATUS_ENGINE_ENABLED;

‎apache2/msc_status_engine.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ void DSOLOCAL msc_status_engine_fill_with_dots(char *encoded_with_dots,
9696
// Based on:
9797
// http://stackoverflow.com/questions/16858782/how-to-obtain-almost-unique-system-identifier-in-a-cross-platform-way
9898
intDSOLOCALmsc_status_engine_machine_name(char*machine_name,size_tlen) {
99+
#ifdefWIN32
100+
DWORDlenComputerName=len;
101+
#endif
102+
99103
memset(machine_name,'\0',sizeof(char)*len);
100104

101105
#ifdefWIN32
102-
DWORDsize=1024;
103-
GetComputerName(machine_name,&size);
104-
105-
apr_snprintf(machine_name,len-1,"%s",computerName[0]);
106-
machine_name[len-1]='\0';
106+
GetComputerName(machine_name,&lenComputerName);
107107
#else
108108
staticstructutsnameu;
109109

‎iis/Makefile.win‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ LIBS = $(APACHE)\lib\libapr-1.lib \
1212
$(PCRE)\pcre.lib \
1313
$(LIBXML2)\win32\bin.msvc\libxml2.lib \
1414
"kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" \
15-
"oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "ws2_32.lib"
15+
"oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "ws2_32.lib" \
16+
"iphlpapi.lib"
1617

1718
###########################################################################
1819
###########################################################################
@@ -49,7 +50,8 @@ OBJS1 = mod_security2.obj apache2_config.obj apache2_io.obj apache2_util.obj \
4950
msc_logging.obj msc_xml.obj msc_multipart.obj modsecurity.obj \
5051
msc_parsers.obj msc_util.obj msc_pcre.obj persist_dbm.obj \
5152
msc_reqbody.obj msc_geo.obj msc_gsb.obj msc_unicode.obj acmp.obj msc_lua.obj \
52-
msc_release.obj msc_crypt.obj msc_tree.obj
53+
msc_release.obj msc_crypt.obj msc_tree.obj \
54+
msc_status_engine.obj
5355
OBJS2 = api.obj buckets.obj config.obj filters.obj hooks.obj regex.obj server.obj
5456
OBJS3 = main.obj moduleconfig.obj mymodule.obj
5557
OBJS4 = libinjection_sqli.obj

‎iis/ModSecurityIIS.vcxproj‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
<Link>
114114
<ModuleDefinitionFile>mymodule.def</ModuleDefinitionFile>
115115
<GenerateDebugInformation>true</GenerateDebugInformation>
116-
<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);dependencies\build_dir\apache24\lib\libapr-1.lib;dependencies\build_dir\apache24\lib\libaprutil-1.lib;dependencies\build_dir\pcre\pcre.lib;dependencies\build_dir\libxml2\win32\bin.msvc\libxml2.lib</AdditionalDependencies>
116+
<AdditionalDependencies>kernel32.lib;IPHLPAPI.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);dependencies\build_dir\apache24\lib\libapr-1.lib;dependencies\build_dir\apache24\lib\libaprutil-1.lib;dependencies\build_dir\pcre\pcre.lib;dependencies\build_dir\libxml2\win32\bin.msvc\libxml2.lib</AdditionalDependencies>
117117
<AdditionalLibraryDirectories>C:\core__\ModSecurity\iis\release\x64</AdditionalLibraryDirectories>
118118
<AdditionalOptions> /LIBPATH:"C:\core__\ModSecurity\iis\release\x64" %(AdditionalOptions)</AdditionalOptions>
119119
</Link>
@@ -145,7 +145,7 @@
145145
</ClCompile>
146146
<Link>
147147
<ModuleDefinitionFile>mymodule.def</ModuleDefinitionFile>
148-
<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);dependencies\build_dir\apache24\lib\libapr-1.lib;dependencies\build_dir\apache24\lib\libaprutil-1.lib;dependencies\build_dir\pcre\pcre.lib;dependencies\build_dir\libxml2\win32\bin.msvc\libxml2.lib</AdditionalDependencies>
148+
<AdditionalDependencies>kernel32.lib;IPHLPAPI.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);dependencies\build_dir\apache24\lib\libapr-1.lib;dependencies\build_dir\apache24\lib\libaprutil-1.lib;dependencies\build_dir\pcre\pcre.lib;dependencies\build_dir\libxml2\win32\bin.msvc\libxml2.lib</AdditionalDependencies>
149149
<AdditionalLibraryDirectories>
150150
</AdditionalLibraryDirectories>
151151
<GenerateDebugInformation>false</GenerateDebugInformation>
@@ -163,6 +163,7 @@
163163
<ClCompileInclude="..\apache2\libinjection\libinjection_sqli.c" />
164164
<ClCompileInclude="..\apache2\modsecurity.c" />
165165
<ClCompileInclude="..\apache2\mod_security2.c" />
166+
<ClCompileInclude="..\apache2\msc_status_engine.c" />
166167
<ClCompileInclude="..\apache2\msc_crypt.c" />
167168
<ClCompileInclude="..\apache2\msc_geo.c" />
168169
<ClCompileInclude="..\apache2\msc_gsb.c" />
@@ -211,6 +212,7 @@
211212
<ClIncludeInclude="..\apache2\modsecurity.h" />
212213
<ClIncludeInclude="..\apache2\modsecurity_config.h" />
213214
<ClIncludeInclude="..\apache2\modsecurity_config_auto.h" />
215+
<ClIncludeInclude="..\apache2\msc_status_engine.h" />
214216
<ClIncludeInclude="..\apache2\msc_crypt.h" />
215217
<ClIncludeInclude="..\apache2\msc_geo.h" />
216218
<ClIncludeInclude="..\apache2\msc_gsb.h" />
@@ -235,4 +237,4 @@
235237
<ImportProject="$(VCTargetsPath)\Microsoft.Cpp.targets" />
236238
<ImportGroupLabel="ExtensionTargets">
237239
</ImportGroup>
238-
</Project>
240+
</Project>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp