Bug 480932

Summary: mod_cgi: error pages have wrong headers
Product: Red Hat Enterprise Linux 5 Reporter: Tomas Smetana <tsmetana>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.1CC: cward, ohudlick, ralph, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 11:50:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch (backported) none

Description Tomas Smetana 2009-01-21 13:10:48 UTC
Description of problem:
The "500 Internal Server Error" page is not correctly displayed in case of invalid cgi script.

Version-Release number of selected component (if applicable):
httpd-2.2.3-11.el5_1.3

How reproducible:
always

Steps to Reproduce:
1. yum install httpd
2. service httpd start (i.e., use default configuration)
3. echo "foo" > /var/www/cgi-bin/script.cgi
4. chmod a+x /var/www/cgi-bin/script.cgi
5. curl -is http://localhost/cgi-bin/script.cgi
6. Examine the response
  
Actual results:
The header looks like this (wrong Content-Length and Content-Type)

HTTP/1.1 500 Internal Server Error
Date: Wed, 21 Jan 2009 12:02:35 GMT
Server: Apache/2.2.3 (Red Hat)
Content-Length: 0
Connection: close
Content-Type: text/plain; charset=UTF-8

(and nothing else is printed by curl)

Expected results:
Something like this

HTTP/1.1 500 Internal Server Error
Date: Wed, 21 Jan 2009 12:01:18 GMT
Server: Apache/2.2.3 (Red Hat)
Content-Length: 609
Connection: close
Content-Type: text/html; charset=iso-8859-1

(and the html error document is printed)

Additional info:
This is a known problem solved in newer releases.
Upstream bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=39710
Fedora bug #209605

Comment 1 Tomas Smetana 2009-01-21 13:13:18 UTC
Created attachment 329600 [details]
Proposed patch (backported)

Comment 5 Chris Ward 2009-07-03 18:21:36 UTC
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.

Comment 9 errata-xmlrpc 2009-09-02 11:50:08 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1380.html