Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st December 2008, 07:54
jegavelan jegavelan is offline
Junior Member
 
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error To Harden PHP5 With Suhosin On CentOS 5.0

I am getting this error when i try To Harden PHP5 With Suhosin On CentOS 5.0

rpmbuild -ba php.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.41518
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf php-5.1.6
+ /bin/gzip -dc /usr/src/redhat/SOURCES/php-5.1.6.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd php-5.1.6
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #0 (php-5.1.6-suhosin.patch):'
Patch #0 (php-5.1.6-suhosin.patch):
+ patch -p1 -b --suffix .suhosin -s
+ echo 'Patch #1 (php-5.1.4-gnusrc.patch):'
Patch #1 (php-5.1.4-gnusrc.patch):
+ patch -p1 -b --suffix .gnusrc -s
+ echo 'Patch #2 (php-5.1.4-warnings.patch):'
Patch #2 (php-5.1.4-warnings.patch):
+ patch -p1 -b --suffix .warnings -s
+ echo 'Patch #5 (php-4.3.3-install.patch):'
Patch #5 (php-4.3.3-install.patch):
+ patch -p1 -b --suffix .install -s
+ echo 'Patch #6 (php-5.0.4-norpath.patch):'
Patch #6 (php-5.0.4-norpath.patch):
+ patch -p1 -b --suffix .norpath -s
+ echo 'Patch #7 (php-4.3.2-libtool15.patch):'
Patch #7 (php-4.3.2-libtool15.patch):
+ patch -p1 -b --suffix .libtool15 -s
+ echo 'Patch #13 (php-5.0.2-phpize64.patch):'
Patch #13 (php-5.0.2-phpize64.patch):
+ patch -p1 -b --suffix .phpize64 -s
+ echo 'Patch #14 (php-5.1.6-ecalloc.patch):'
Patch #14 (php-5.1.6-ecalloc.patch):
+ patch -p1 -b --suffix .ecalloc -s
1 out of 2 hunks FAILED -- saving rejects to file Zend/zend_alloc.c.rej
error: Bad exit status from /var/tmp/rpm-tmp.41518 (%prep)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.41518 (%prep)
Reply With Quote
Sponsored Links
  #2  
Old 2nd December 2008, 14:42
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

Did you download the correct Suhosin patch for your PHP version?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 18th April 2009, 22:53
random.guy random.guy is offline
Junior Member
 
Join Date: May 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have this exact same problem with CentOS 5.3 now, and can't figure this out. Everything worked fine with CentOS 5.2, so something critical must have changed. This is the error I get:

Code:
[root@localhost SPECS]# rpmbuild -ba php.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.89704
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf php-5.1.6
+ /bin/gzip -dc /usr/src/redhat/SOURCES/php-5.1.6.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd php-5.1.6
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #0 (php-5.1.6-suhosin.patch):'
Patch #0 (php-5.1.6-suhosin.patch):
+ patch -p1 -b --suffix .suhosin -s
+ echo 'Patch #1 (php-5.1.4-gnusrc.patch):'
Patch #1 (php-5.1.4-gnusrc.patch):
+ patch -p1 -b --suffix .gnusrc -s
+ echo 'Patch #2 (php-5.1.4-warnings.patch):'
Patch #2 (php-5.1.4-warnings.patch):
+ patch -p1 -b --suffix .warnings -s
+ echo 'Patch #5 (php-4.3.3-install.patch):'
Patch #5 (php-4.3.3-install.patch):
+ patch -p1 -b --suffix .install -s
+ echo 'Patch #6 (php-5.0.4-norpath.patch):'
Patch #6 (php-5.0.4-norpath.patch):
+ patch -p1 -b --suffix .norpath -s
+ echo 'Patch #7 (php-4.3.2-libtool15.patch):'
Patch #7 (php-4.3.2-libtool15.patch):
+ patch -p1 -b --suffix .libtool15 -s
+ echo 'Patch #13 (php-5.0.2-phpize64.patch):'
Patch #13 (php-5.0.2-phpize64.patch):
+ patch -p1 -b --suffix .phpize64 -s
+ echo 'Patch #15 (php-5.2.0-includedir.patch):'
Patch #15 (php-5.2.0-includedir.patch):
+ patch -p1 -b --suffix .includedir -s
+ echo 'Patch #16 (php-5.1.6-bug38534.patch):'
Patch #16 (php-5.1.6-bug38534.patch):
+ patch -p1 -b --suffix .bug38534 -s
+ echo 'Patch #17 (php-5.1.6-umask.patch):'
Patch #17 (php-5.1.6-umask.patch):
+ patch -p1 -b --suffix .umask -s
+ echo 'Patch #18 (php-4.3.9-metaphone.patch):'
Patch #18 (php-4.3.9-metaphone.patch):
+ patch -p1 -b --suffix .metaphone -s
+ echo 'Patch #19 (php-5.1.6-zendecase.patch):'
Patch #19 (php-5.1.6-zendecase.patch):
+ patch -p1 -b --suffix .zendecase -s
+ echo 'Patch #20 (php-5.1.6-zendhash.patch):'
Patch #20 (php-5.1.6-zendhash.patch):
+ patch -p1 -b --suffix .zendhash -s
1 out of 2 hunks FAILED -- saving rejects to file Zend/zend_hash.c.rej
error: Bad exit status from /var/tmp/rpm-tmp.89704 (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.89704 (%prep)
Running CentOS 5.3, php src file is php-5.1.6-23.el5.src.rpm, downloaded suhosin-patch-5.1.6-0.9.6.patch.gz and followed these instructions which worked with 5.2. Any kind of help would be really appreciated! Thanks!
Reply With Quote
  #4  
Old 26th April 2009, 03:24
random.guy random.guy is offline
Junior Member
 
Join Date: May 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So no one is running the CentOS 5.3 PHP rpm's with the Suhosin patch?
Reply With Quote
  #5  
Old 26th April 2009, 13:33
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

I haven't treid this yet, but normally instructions for CentOS 5.x work for 5.0, 5.1, 5.2, 5.3, etc., so I'm not sure what went wrong here.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 6th May 2009, 10:57
magenbrot magenbrot is offline
Junior Member
 
Join Date: May 2009
Location: Fuerth / Bavaria / Germany
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to magenbrot
 
Default

Hi,

I just had the same problem.
My solution was to move the suhosin patch to the end of the patch process.
It seems that there are a few patches that mess around with Zend/zend_hash.c

It now looks like this:
Code:
Patch1: php-5.1.4-gnusrc.patch
Patch2: php-5.1.4-warnings.patch
Patch5: php-4.3.3-install.patch
Patch6: php-5.0.4-norpath.patch
Patch7: php-4.3.2-libtool15.patch
Patch13: php-5.0.2-phpize64.patch
#Patch14: php-5.1.6-ecalloc.patch
Patch15: php-5.2.0-includedir.patch
Patch16: php-5.1.6-bug38534.patch
[...]
Patch104: php-5.1.6-mbstring-overload-func.patch
Patch105: php-5.1.6-gdoverflow.patch
Patch106: php-5.1.6-suhosin.patch
[...]
%setup -q
%patch1 -p1 -b .gnusrc
%patch2 -p1 -b .warnings
%patch5 -p1 -b .install
%patch6 -p1 -b .norpath
%patch7 -p1 -b .libtool15
%patch13 -p1 -b .phpize64
#%patch14 -p1 -b .ecalloc
%patch15 -p1 -b .includedir
[...]
%patch103 -p1 -b .cve5814
%patch104 -p1 -b .mbstring-overload-func
%patch106 -p1 -b .suhosin
PHP builds fine now:

Code:
Wrote: /usr/src/redhat/SRPMS/php-5.1.6-23.2.src.rpm
Code:
This server is protected with the Suhosin Extension 0.9.27
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 17:26
The PHP-MSSQL Module On CentOS 5.0 codex HOWTO-Related Questions 6 31st July 2008 18:14
Problem related to harden PHP5 with suhosin Settler HOWTO-Related Questions 1 29th April 2007 20:25
CentOS 4.4 mysql5 php5 upgrade hoihtah Installation/Configuration 6 7th November 2006 16:46
eaccelerator installation - can't find php5-config tom Programming/Scripts 9 15th May 2006 15:36


All times are GMT +2. The time now is 04:01.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.