BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 28th, 2002, 03:57 PM
elysium elysium is offline
Gentleman of leisure
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Sweden
Posts: 44 elysium User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 31 m
Reputation Power: 7
Unified diff?

How do one install "unified diffs" [under FreeBSD 4.6]? I'm trying to apply the new patch in php regarding vulnerabilities in HTTP POST.

Reply With Quote
  #2  
Old July 28th, 2002, 06:28 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
For that patch you need to place the src for both version in same dir (i.e. /usr/local/src/php-4.2.1 and /usr/local/src/php-4.2.2). You then cd to /usr/local/src and run patch -p1 < php-4.2.1-to-4.2.2.patch

Reply With Quote
  #3  
Old July 29th, 2002, 12:39 AM
elysium elysium is offline
Gentleman of leisure
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Sweden
Posts: 44 elysium User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 31 m
Reputation Power: 7
Ah thanks man, you're a life-saver. They should give you a lifetime achievement award =)

Reply With Quote
  #4  
Old July 29th, 2002, 05:33 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Actually it's rather simple to figure out how to apply that patch.
Let's start from the top:
Code:
diff -ru php-4.2.1/NEWS php-4.2.2/NEWS
--- php-4.2.1/NEWS	Sun May 12 23:07:40 2002
+++ php-4.2.2/NEWS	Sat Jul 20 21:20:20 2002
@@ -1,5 +1,11 @@

That --- implies old or original version that you want to replace. The +++ is the new version. You should notice that php-4.2.1 doesn't begin with a slash, therefore IT'S A RELATIVE PATH to particular dir. When you look at php-4.2.2 it as well is using RELATIVE PATH. That's why you'd place them into the same dir and apply the patch from their dir (one level up).

In *BSDs when you want to apply some security patches the default location is /usr/src where you should cd'd to. Where your patch locates doesn't make any difference. Say it's in /root/security.patch just cd to /usr/src and run patch -p1 < /root/security.patch.

Reply With Quote
  #5  
Old July 29th, 2002, 07:01 AM
elysium elysium is offline
Gentleman of leisure
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Sweden
Posts: 44 elysium User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 31 m
Reputation Power: 7
Thanks for the extra info, it's always appreciated.

The script asked some questions about which files to patch.. I got them right (i think, the patch ended with "patch successful" or something like that anyway). But I thought the patch should know what files to update by itself(?).
Do I need to recompile php also? Cause phpinfo() still says 4.2.1. I thought that was the advantage of these patches that you didn't have to recompile.


EDIT: Damnit. Now I remember building apache with php4 compiled in. Was that as stupid as I think (now) it was? Is there some way to disable the builtin php-support (4.2.1) in apache (1.3.26) and run php (4.2.2) as a module?

Last edited by elysium : July 29th, 2002 at 07:06 AM.

Reply With Quote
  #6  
Old July 29th, 2002, 08:38 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
disable the builtin php-support (4.2.1) in apache (1.3.26) and run php (4.2.2) as a module?

No. BTW, I thought you are running FreeBSD. Why didn't you install Apache/mod_php4 via the ports tree?

Reply With Quote
  #7  
Old July 29th, 2002, 02:40 PM
elysium elysium is offline
Gentleman of leisure
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Sweden
Posts: 44 elysium User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 31 m
Reputation Power: 7
Yup, running FreeBSD. I did it because I thought ports didn't track the latest versions of every software in those ports. I thought they only were packaged and distributed with the official releases of the core FreeBSD. Hence anyway needing to compile it for myself when exploits are surfaced.

So you recommend un-installing (somehow?) the apache+php4 I compiled, and using the ports instead?

Reply With Quote
  #8  
Old July 29th, 2002, 04:49 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
I did it because I thought ports didn't track the latest versions of every software in those ports

Because you need to cvsup it via a cronjob.

Quote:
So you recommend un-installing (somehow?) the apache+php4 I compiled, and using the ports instead?

Yes, but maybe next time. The only difference is that, the ports tree uses DSO method, which is the recommend way these days.

So just use ports on anything when it's available.

Reply With Quote
  #9  
Old July 29th, 2002, 06:13 PM
elysium elysium is offline
Gentleman of leisure
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Sweden
Posts: 44 elysium User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 31 m
Reputation Power: 7
Ah, I actually thought about using the DSO method instead, cause of the portability, but didn't realize that things like this [the exploit] would be an issue. I'm learning as I go along. But it's a good lesson, I'll try to think outside the box next time
Thanks for all your help, expertise, and speedy responses.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > Unified diff?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway