Skip to content

Commit cf619f9

Browse files
committed
fix: address copilot suggestions
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
1 parent 932c83b commit cf619f9

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

apache2/Makefile.win

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
###########################################################################
22
#
3-
# Usage: NMAKE -f Makefile.win APACHE={httpd installion dir} PCRE={pcre dir} LIBXML2={LibXML2 dir} [ LUA={Lua dir} ]
3+
# Usage: NMAKE -f Makefile.win APACHE={httpd installion dir} PCRE={pcre2 dir} LIBXML2={LibXML2 dir} [ LUA={Lua dir} ]
4+
# Note: ModSecurity v2 uses PCRE2 by default (not legacy PCRE). Set PCRE to your pcre2 build directory.
45
#
56
!IF "$(APACHE)" == "" || "$(PCRE)" == "" || "$(LIBXML2)" == "" || "$(CURL)" == ""
67
!ERROR NMAKE arguments: APACHE=dir PCRE=dir LIBXML2=dir CURL=dir are required to build mod_security2 for Windows
@@ -28,7 +29,7 @@ CC = CL
2829

2930
MT = mt
3031

31-
DEFS = /nologo /O2 /LD /W3 /wd4244 /wd4018 -DWIN32 -DWINNT -Dinline=APR_INLINE -D$(VERSION)
32+
DEFS = /nologo /O2 /LD /W3 /wd4244 /wd4018 -DWITH_PCRE_JIT -DWIN32 -DWINNT -Dinline=APR_INLINE -D$(VERSION)
3233

3334
DLL = mod_security2.so
3435

iis/installer.wxs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,31 +80,31 @@
8080
<DirectorySearch Id="CheckFileDir10" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
8181
<FileSearch Id="CheckFile10" Name="ModSecurityIIS.dll" />
8282
</DirectorySearch>
83-
<DirectorySearch Id="CheckFileDir11" Path="C:\Windows\System32\inetsrv" Depth="0">
83+
<DirectorySearch Id="CheckFileDir11" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
8484
<FileSearch Id="CheckFile11" Name="libapr-1.dll" />
8585
</DirectorySearch>
86-
<DirectorySearch Id="CheckFileDir12" Path="C:\Windows\System32\inetsrv" Depth="0">
86+
<DirectorySearch Id="CheckFileDir12" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
8787
<FileSearch Id="CheckFile12" Name="libapriconv-1.dll" />
8888
</DirectorySearch>
89-
<DirectorySearch Id="CheckFileDir13" Path="C:\Windows\System32\inetsrv" Depth="0">
89+
<DirectorySearch Id="CheckFileDir13" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
9090
<FileSearch Id="CheckFile13" Name="libaprutil-1.dll" />
9191
</DirectorySearch>
92-
<DirectorySearch Id="CheckFileDir14" Path="C:\Windows\System32\inetsrv" Depth="0">
92+
<DirectorySearch Id="CheckFileDir14" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
9393
<FileSearch Id="CheckFile14" Name="libcurl.dll" />
9494
</DirectorySearch>
95-
<DirectorySearch Id="CheckFileDir15" Path="C:\Windows\System32\inetsrv" Depth="0">
95+
<DirectorySearch Id="CheckFileDir15" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
9696
<FileSearch Id="CheckFile15" Name="libxml2.dll" />
9797
</DirectorySearch>
98-
<DirectorySearch Id="CheckFileDir16" Path="C:\Windows\System32\inetsrv" Depth="0">
98+
<DirectorySearch Id="CheckFileDir16" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
9999
<FileSearch Id="CheckFile16" Name="lua54.dll" />
100100
</DirectorySearch>
101-
<DirectorySearch Id="CheckFileDir17" Path="C:\Windows\System32\inetsrv" Depth="0">
101+
<DirectorySearch Id="CheckFileDir17" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
102102
<FileSearch Id="CheckFile17" Name="pcre2-8.dll" />
103103
</DirectorySearch>
104-
<DirectorySearch Id="CheckFileDir18" Path="C:\Windows\System32\inetsrv" Depth="0">
104+
<DirectorySearch Id="CheckFileDir18" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
105105
<FileSearch Id="CheckFile18" Name="zlib1.dll" />
106106
</DirectorySearch>
107-
<DirectorySearch Id="CheckFileDir19" Path="C:\Windows\System32\inetsrv" Depth="0">
107+
<DirectorySearch Id="CheckFileDir19" Path="C:\Windows\SysWOW64\inetsrv" Depth="0">
108108
<FileSearch Id="CheckFile19" Name="fuzzy.dll" />
109109
</DirectorySearch>
110110
</Property>

iis/wix/list_dependencies.bat

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if %errorlevel% equ 0 (
3232
)
3333

3434
REM Check for Visual C++ 2019 Redistributable (x86)
35-
reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" /v Installed 2>nul | find "0x1" >nul
35+
reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" /v Installed /reg:32 2>nul | find "0x1" >nul
3636
if %errorlevel% equ 0 (
3737
echo [OK] Visual C++ 2019 Redistributable ^(x86^) is installed
3838
) else (
@@ -64,7 +64,7 @@ if %errorlevel% equ 0 (
6464
echo Download from: https://aka.ms/vs/17/release/vc_redist.x64.exe >> "%log_file%"
6565
)
6666

67-
reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" /v Installed 2>nul | find "0x1" >nul
67+
reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" /v Installed /reg:32 2>nul | find "0x1" >nul
6868
if %errorlevel% equ 0 (
6969
echo [OK] Visual C++ 2019 Redistributable (x86) is installed >> "%log_file%"
7070
) else (
@@ -125,11 +125,11 @@ if "%DUMPBIN_X86:~1,-1%" == "" (
125125
echo Using dumpbin x86: %DUMPBIN_X86%
126126
echo Using dumpbin x86: %DUMPBIN_X86% >> %log_file%
127127
echo. >> %log_file%
128-
if exist "%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll" (
128+
if exist "%SystemRoot%\SysWOW64\inetsrv\ModSecurityIIS.dll" (
129129
echo ================================================ >> %log_file%
130130
echo 32-bit ModSecurityIIS.dll dependencies: >> %log_file%
131131
echo ================================================ >> %log_file%
132-
%DUMPBIN_X86% /imports /dependents "%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll" >> %log_file% 2>&1
132+
%DUMPBIN_X86% /imports /dependents "%SystemRoot%\SysWOW64\inetsrv\ModSecurityIIS.dll" >> %log_file% 2>&1
133133
)
134134
if not "%*" == "" (
135135
echo. >> %log_file%
@@ -150,11 +150,11 @@ if "%DUMPBIN_X64:~1,-1%" == "" (
150150
echo Using dumpbin x64: %DUMPBIN_X64%
151151
echo Using dumpbin x64: %DUMPBIN_X64% >> %log_file%
152152
echo. >> %log_file%
153-
if exist "%SystemRoot%\SysWOW64\inetsrv\ModSecurityIIS.dll" (
153+
if exist "%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll" (
154154
echo ================================================ >> %log_file%
155155
echo 64-bit ModSecurityIIS.dll dependencies: >> %log_file%
156156
echo ================================================ >> %log_file%
157-
%DUMPBIN_X64% /imports /dependents "%SystemRoot%\SysWOW64\inetsrv\ModSecurityIIS.dll" >> %log_file% 2>&1
157+
%DUMPBIN_X64% /imports /dependents "%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll" >> %log_file% 2>&1
158158
)
159159
if not "%*" == "" (
160160
echo. >> %log_file%

mlogc/Makefile.win

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
### You Will need to modify the following variables for your system
33
###########################################################################
44
###########################################################################
5+
# Note: ModSecurity v2 uses PCRE2 by default (not legacy PCRE). Set PCRE to your pcre2 build directory.
56

67
# Path to Apache httpd installation
78
BASE = %APACHE%
@@ -13,8 +14,8 @@ CURL = %CURL%
1314
# Linking libraries
1415
LIBS = $(BASE)\lib\libapr-1.lib \
1516
$(BASE)\lib\libaprutil-1.lib \
16-
$(PCRE)\pcre.lib \
17-
$(CURL)\libcurl.lib \
17+
$(PCRE)\pcre2-8.lib \
18+
$(CURL)\libcurl.lib \
1819
wsock32.lib
1920

2021
###########################################################################

0 commit comments

Comments
 (0)