How do I apply this apache patch: rewrite-windows-testchar-h.patch

13 Views Asked by At

I have Apache version 2.4.57 and the server managers are being stubborn about some low-priority security issues. They want me to upgrade to 2.4.58 or apply this patch. I don't want to have to upgrade since I don't want to run a migration.

The patch is rewrite-windows-testchar-h.patch.

--- modules/mappers/mod_rewrite.mak 2023/04/03 09:03:51 1908936
+++ modules/mappers/mod_rewrite.mak 2023/04/03 10:41:36 1908937
@@ -62,7 +62,7 @@
     if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
 
 CPP=cl.exe
-CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../include" /I "../database" /I "../ssl" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_rewrite_src" /FD /c 
+CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "../../include" /I "../database" /I "../ssl" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /I "../../server" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_rewrite_src" /FD /c 
 
 .c{$(INTDIR)}.obj::
    $(CPP) @<<
@@ -166,7 +166,7 @@
     if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
 
 CPP=cl.exe
-CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../include" /I "../database" /I "../ssl" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_rewrite_src" /FD /EHsc /c 
+CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "../../include" /I "../database" /I "../ssl" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /I "../../server" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\mod_rewrite_src" /FD /EHsc /c 
 
 .c{$(INTDIR)}.obj::
    $(CPP) @<<

When I run patch -s < rewrite-windows-testchar-h.patch the output requests that I specify which file to patch. I tried the mod_rewrite.so file under /etc/httpd/modules folder (I am using CentOS7) but it gave the following error:

File to patch: /usr/lib64/httpd/modules/mod_rewrite.so
2 out of 2 hunks FAILED -- saving rejects to file /usr/lib64/httpd/modules/mod_rewrite.so.rej

Does anyone know how to run this patch? This is my first time running a patch so I'm not sure what the issue is.

0

There are 0 best solutions below