Bug 90079 - cgi/pl programs do not execute properly since upgrade to 9.0 from 7.2
cgi/pl programs do not execute properly since upgrade to 9.0 from 7.2
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: httpd (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-01 23:26 EDT by Thomas Salazar
Modified: 2007-04-18 12:53 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-05-13 04:08:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Thomas Salazar 2003-05-01 23:26:54 EDT
Description of problem:
Upon completing and executing the following script with the proper 
permissions, the following error occurs.  This error did not occur until after 
the upgrade from 7.2 to 9.0 took place.  Unfortunately, this part of the 
testing was overlooked or if it's safe to say, not expected.  

With php, we have no problem capturing the ip addresses (echo $REMOTE_IPADDR) 
but, the phpinfo() environment didn't provide us with any other ip information 
for capturing variables such as the host, referal, etc... which is why we are 
requiring a fix for 9.0's web server configuration from RH 7.2s OS. Here's the 
code we were using on 7.2 that will no longer work on platform 9.0 with 
failing results at the end of this message copied and pasted directly from the 
browser:  (perl was tested and seems to be working)


#!/usr/bin/perl -Tw 


$REMOTEIP= $getenv('REMOTE_ADDR'); 
$REMOTEHOST= $getenv('REMOTE_HOST'); 
$REFERAL_ADDRESS= $getenv('HTTP_REFERER'); 

@SUBNET_NUMBERS = split (/\./, $REMOTEIP); 
$PACKEDIP = pack ("C4", @SUBNET_NUMBERS); 
($REMOTEHOST) = gethostbyaddr ($PACKEDIP, 2); 

print "Content-Type: text/plain \r\n\r\n"; 
print "<pre>"; 

print "Your address is: ", $REMOTEIP, "\n"; 
print "Your hostname is: ", $REMOTEHOST, "\n"; 
print "You came from: ", $REFEREAL_ADDRESS, "\n"; 
print `date`, "\n"; 
print "This server: ", `uptime`, "\n"; 
print "</pre>"; 

exit(0); 


Here's the error message pasted from the browsers Mozilla and IE6: 

Server error! 
The server encountered an internal error and was unable to complete your 
request. 
Error message: 
Premature end of script headers: remote_addr.cgi 
If you think this is a server error, please contact the webmaster 
Error 500 
Thu 01 May 2003 06:21:51 PM PDT 
Apache/2.0.40 (Red Hat Linux) 

Is it quite possible that Apache wants to do the LF -> CRLF conversion itself, 
and therefore, considers CRLFs an error condition.


Is there a fix for this?  If so, please provide


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.cut and paste above code, save as remote_addr.cgi and .pl for testing. chmod 
x remote_addr.cgp or .pl
2.execute from a browser
3.witness error message as provided right after the code above.
    
Actual results:
Server error!
The server encountered an internal error and was unable to complete your 
request. 
Error message: 
Premature end of script headers: remote_addr.cgi 
If you think this is a server error, please contact the webmaster 
Error 500
isprofessionals.biz
Thu 01 May 2003 07:37:14 PM PDT 
Apache/2.0.40 (Red Hat Linux) 

Expected results:
Results of the remote nodes is configuration should display.  Once displayed, 
we will incorporate it into the rest of our processform (html and php) for 
email confirmations

Additional info:  Hope this information is enough to provide a solution.  
Thank you.
Comment 1 Thomas Salazar 2003-05-02 17:01:03 EDT
Close this bug report.  Converted cgi script over to PHP successfully.
Comment 2 Alex Weeks 2003-12-15 22:05:25 EST
This needs to be reopened.  I am having the same problem since I
upgraded to the latest release of perl I have had the same problem.
Comment 3 Joe Orton 2004-01-04 12:55:59 EST
Alex: can you open a separate bug, describe the problem you are having
and include any error_log messages, the script which reproduces the
error, and any other relevant details?

Note You need to log in before you can comment on or make changes to this bug.