From: James G. <ja...@m5...> - 2005-01-05 22:13:21
|
Hi Ben, Thanks again for your help :) Ben Clewett wrote: > Hi James, > > I have looked through your reply and cannot see any reason for this > error. Yet! You are not the only person with this error so I would > really like to work with you and sort this out! > > I would be very interested in help from any other member who understand > the CGI and HTTP protocols. > > I suspect the code is crashing in the function scgi(char *) in cgi/cgi.c > This takes the QUERY_STRING and extracts CGI variables from it. > > Can I ask you to repeat one of your tests with a slightly different test > value: > > Can you try running the perfparse.cgi from the command line: > > $ export QUERY_STRING="show_config=1" > $ /...../perfparse.cgi > I should be glad when things don't crash, but this time I'm not.. :( It spits out the same output as with a question mark. # export QUERY_STRING="show_config=1" # ./perfparse.cgi > noquestionmark # export QUERY_STRING="?show_config=1" # ./perfparse.cgi > questionmark # diff questionmark noquestionmark # # No difference. But at least we've narrowed it down to not being there!! :) I also took the liberty of trying some of the pages that I'm trying to load in the web browser from the command line. # export QUERY_STRING="all_raw=1" # ./perfparse.cgi Expires: Sun, 02 Jan 2000 01:01:01 GMT content-type: text/html <HTML> <HEAD> <TITLE> PerfParse</TITLE> <BODY BGcolor="#EEFFFF" TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000"> <p align=center> <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> <table width="100%" border=0 cellpadding=0 cellspacing=0> <tr> <td width=60><img src="/nagios/images/perfparse-logo-sm.png" border=0></td> <td align=center><font face="Arial, Helvetica" size="2"> <b>Raw Nagios Plugin Report</b> <br> <a href="perfparse.cgi">Return to main menu</a> </font></td> <td width=60 align=right><font face="Arial, Helvetica" size="1">v0.104.6</font></td> </tr> </table> </td></tr></table> </p> <form method="get"> <input type=hidden name="all_raw" value="1"> <p align=center> <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> <table width="100%" border=0 cellpadding=0 cellspacing=0> <tr> <td align=center width="33%"><font face="Arial, Helvetica" size=2> Select Host Group: </td> <td> <select name="group_name"> <option value="">-- Select group: -- <option value="**ALL**"><All Groups> </select> <input type=submit value="Enter"> </td></form> </tr> </table> </td></tr></table></p> </body></html> # # If I save this to a file and load it in my web-browser, then it works OK. So this leads us to believe that there is something wrong with the way my webserver is interpreting the cgi doesn't it? I'm no expert on cgi stuff, I'll read up on it a bit today. :/ > Can you show me the result of this action? > > I am hoping this will crash on your system. Although it does not on > mine. If this is the case, I at least know where the problem is! > > Again to all readers: Another fix to this is to use a free CGI lib > capable of examining POST and GET methods, and replace mine. (I use > commercial ones at my place of work, cannot use them in PP.) Would any > reader be able to recommend one? > > James, to your other queries: > > Glad you have data in your system now :) > > Sorry you cannot upgrade your MySQL. This may cause some problems later > on. I will have to think of you when I code database conversions... > Hopefully I can upgrade it at some stage. I just don't want the system to fall over because I wanted some graphs. I would get a butt-kickin' > Everything else seems in order. Lets get this fix for you :) > > Ben > > > > James, > > Can you try another fix as well? > > In cgi/cgi.c, line 62, can you replace with: > > if (sStart[0] != '?' && sStart[0] != '&' && sStart + 1 != sQuery) { > > Let me know if this fixes the problem :) > > Ben > Gave it a whirl, didn't seem to change anything at first glance. Still good ol' error 500. Hope we haven't hit a dead end. Is there anyway that we can actually find out what apache thinks is the 'malformed header'? If we knew that then we should be able to fix the problem no worries right?... Thanks a lot for all your help Ben. I'm determined to get this to work now!! Kind regards, James Greenhalgh |