You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Darcy Buskermolen <da...@wavefire.com> on 2001/02/23 19:44:14 UTC

mod_cgi/7304: non standard conforming

>Number:         7304
>Category:       mod_cgi
>Synopsis:       non standard conforming
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Feb 23 10:50:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     darcy@wavefire.com
>Release:        1.3.x
>Organization:
apache
>Environment:
All/Any
>Description:
According to the CGI 1.1 specification, the server should parse the following 3 server headers,

Content-type:
Location:
Status:

Status apears not to be parsed in the correct manor.
If the cgi sends a printf("Status: 404 Not Found\n\n");
the server should treat it as a 404, and call the ErrorDocument 404 handler.
This however does not happen.
>How-To-Repeat:
Use the following C source:
#include <stdlib.h>
#include <stdio.h>

int main()
{

  printf("Status: 404 Not Found\n\n");
  exit(1);
};

compile and place in a "cgi directory"

telnet server port
GET /cgi-bin/test HTTP/1.0

you will see a 0 lengthe document with a Content-type: plain/html
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <ap...@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]