Need to downgrade pcre from 8.21 to 8.20

chrismfz

Well-Known Member
Jul 4, 2007
125
1
68
Greece
cPanel Access Level
DataCenter Provider
We will see soon a EasyApache 3.9.>1 (.2 maybe?)
with curl fix and pcre patch ?

It's hard to patch and keep an eye on all servers for those.
Already a mess with both of them (curl when someone uses ssl, pcre with vBulletin forums)
 

chrismfz

Well-Known Member
Jul 4, 2007
125
1
68
Greece
cPanel Access Level
DataCenter Provider
There is a patch, thanks to cPanel support (insert credits here):

cd /var/cpanel/perl/easy/Cpanel/Easy/OptLib
tar -xzvf pcre.pm.tar.gz

echo '--- pcre-8.21/pcre_compile.c 2011/12/07 16:52:34 793
+++ pcre-8.21/pcre_compile.c 2011/12/18 10:03:38 807
@@ -1655,7 +1655,8 @@
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
do cc += GET(cc, 1); while (*cc == OP_ALT);
- /* Fall through */
+ cc += _pcre_OP_lengths[*cc];
+ break;' | patch -p0

tar -czvf pcre.pm.tar.gz pcre-8.21/
rm -Rf pcre-8.21/
chattr +i pcre.pm.tar.gz
rm -Rf /opt/pcre/
/scripts/easyapache --build
chattr -i pcre.pm.tar.gz
Disclaimer:
I am not responsible for anything, dead apache servers, wrecked configurations,
thermonuclear war, or you getting fired because apache failed.
 

oldlock

Well-Known Member
Sep 19, 2008
76
0
56
How and where would one install the patch ?

Thanks
 
Last edited:

oldlock

Well-Known Member
Sep 19, 2008
76
0
56
Or did anyone find a way to downgrade the PCRE ? I've been searching for over an hour without any luck .......
 

Avensen

Member
Feb 27, 2007
17
1
153
Thanks chrismfz, your solution worked for me! Except this part:

Code:
echo '--- pcre-8.21/pcre_compile.c 2011/12/07 16:52:34 793
+++ pcre-8.21/pcre_compile.c 2011/12/18 10:03:38 807
@@ -1655,7 +1655,8 @@
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
do cc += GET(cc, 1); while (*cc == OP_ALT);
- /* Fall through */
+ cc += _pcre_OP_lengths[*cc];
+ break;' | patch -p0
which gave me an error, however, I opened the pcre-8.21/pcre_compile.c file and edited it manually.
 

chrismfz

Well-Known Member
Jul 4, 2007
125
1
68
Greece
cPanel Access Level
DataCenter Provider
What exactly didn't work with the patch ?

Third command is a large copy paste not line by line, just the whole:
echo '--- pcre-8.21/pcre_compile.c 2011/12/07 16:52:34 793
+++ pcre-8.21/pcre_compile.c 2011/12/18 10:03:38 807
@@ -1655,7 +1655,8 @@
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
do cc += GET(cc, 1); while (*cc == OP_ALT);
- /* Fall through */
+ cc += _pcre_OP_lengths[*cc];
+ break;' | patch -p0
except if the browser did something, or I misspelled a quote or something else. Maybe a cPanel staff
review it and correct/fix it if I pasted it wrong.
 

oldlock

Well-Known Member
Sep 19, 2008
76
0
56
Probably a mistake on my part there. I'm running the process from the beginning.
 

Avensen

Member
Feb 27, 2007
17
1
153
in my case the error with patch command was:

Code:
patching file pcre-8.21/pcre_compile.c
patch: **** malformed patch at line 4: case OP_ASSERTBACK:
 

oldlock

Well-Known Member
Sep 19, 2008
76
0
56
Still returns an error. Screenshot attached.

Capture.JPG

I did the commands from the beginning.
 

Worelock

Active Member
Mar 23, 2004
37
0
156
for the most part the info above worked. but I got a malformed line when I did the echo, here is what i did to make it work

cd /var/cpanel/perl/easy/Cpanel/Easy/OptLib
tar -xzvf pcre.pm.tar.gz

created a patch file called pcre_patch & added this to it.

--- pcre-8.21/pcre_compile.c 2011/12/07 16:52:34 793
+++ pcre-8.21/pcre_compile.c 2011/12/18 10:03:38 807
@@ -1655,7 +1655,8 @@
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
do cc += GET(cc, 1); while (*cc == OP_ALT);
- /* Fall through */
+ cc += _pcre_OP_lengths[*cc];
+ break;

patch -p1 < pcre_patch
it might ask for the filename to patch, I just typed pcre-8.21/pcre_compile.c
and it patched the file.

then I just ran the rest of the commands from above

tar -czvf pcre.pm.tar.gz pcre-8.21/
rm -Rf pcre-8.21/
chattr +i pcre.pm.tar.gz
rm -Rf /opt/pcre/
/scripts/easyapache --build
chattr -i pcre.pm.tar.gz

My forums are now working again...I'm a happy camper
the code for the patch came from this post http://bugs.exim.org/show_bug.cgi?id=1187
 
Last edited:

oldlock

Well-Known Member
Sep 19, 2008
76
0
56
What is the extension for the patch file you created ? Could you detail the steps involved precisely ?