Commit Graph

19 Commits

Author SHA1 Message Date
tls eaa351b215 When invoking a content handler specified via -C, set the REDIRECT_STATUS
CGI variable to "200".  This approximates the Apache behavior which is
required by phpcgi in PHP 5.3 (and by some compilations of older PHP
versions).

I have a revolutionary idea.  Perhaps instead of imposing bizarre
requirements on other programs in the name of "security", the PHP
developers should make their own code compile with oh, I don't know,
maybe -Wuninitialized.  That might have an effect on the security of
systems using PHP rather than on the "security" of such systems...

...excuse me, got to go now, I think my airquotes just wore out.
2010-12-14 13:27:39 +00:00
mrg df5be5736c merge bozohttpd 20100920 2010-09-20 23:11:38 +00:00
mrg aeb27ed42c merge bozohttpd 20100617. 2010-06-17 19:43:30 +00:00
mrg a07e0db33b merge bozohttpd 20100510. 2010-05-10 14:44:19 +00:00
mrg ce2063081a merge bozohttpd 20100509. 2010-05-10 03:37:45 +00:00
mrg c6e75af28a merge bozohttpd 20090522 2009-05-23 02:26:03 +00:00
mrg bbbdac0a6f merge bozohttpd 20090418. remove a couple of minor do-nothing local
changes that don't need to cause conflicts.
2009-04-18 21:22:03 +00:00
mrg 033876329d merge bozohttpd 20090417 2009-04-18 07:28:24 +00:00
mrg 932fbc87d9 use SIMPLEQ_FOREACH_SAFE(), to avoid a use-after-free.
picked up by coverity.
2009-03-11 06:53:25 +00:00
tls 7184d23274 More CGI handling fixes from Sergey Katsev at Coyote Point.
1) Fix an issue where because of the reordering of transform_request
   and process_cgi, the cgi-script name was being cut off
   by one character (transform_request for some reason
   cuts off the leading '/' for the file name as part of its
   processing).  As an 'easy' fix, simply re-add the '/' to the
   front of the filename, which means that we don't have to
   mess with the logic that sometimes adds +1 and sometimes doesn't.

2) Work around ridiculous bug in PHP reported by lukem in 2004,
   but stubbornly never fixed by the PHP maintainers:

   Change the SCRIPT_NAME and SCRIPT_FILENAME variables
   to contain the file name only, not the query if one exists.
   Having the query in SCRIPT_FILENAME causes php-cgi to not
   work, as per the bug information here:
   	 http://bugs.php.net/bug.php?id=28227

3) Fix a memory leak because URL wasn't being freed.
2009-02-19 22:33:39 +00:00
tls f0f7a44ff5 From Sergey Katsev at Coyote Point: fix bugs in request transformation and
CGI handling, including bin/40355 .  There are two main changes here:

1) call process_cgi() after transform_request(), not before.  Now it is
   possible to have a default cgi handler catch a request for a path that
   was produced by transformation, e.g. by index generation -- so now the
   index can be "generated" by a CGI if that is what the user desires.

2) More clearly distinguish "file" from "query" portions of the request
   URL, so we do not feed ?-suffixed "arguments" to plain files, fail to
   match filename extensions due to ?-suffixes, etc.

   After this change, there are only two cases which use the "query"
   portion of the request (the portion after the ?):

     a) A redirect issued by HTTPD will redirect to the new file, but
	with the same query string.

     b) process_cgi() will, of course continue to use the query string.
2009-02-04 22:55:58 +00:00
mrg ac1ceac37d pull across the fix from my master bozohttpd cvs tree for PR 38466. 2008-11-06 06:38:43 +00:00
mrg 707281a285 merge bozohttpd 20080303 2008-03-03 22:15:08 +00:00
rtr 3aa5278c3a - remove const from h_header, this pointer is occasionally free'd
- remove unused write_str var
+ move header parsing to new function separation of parsing vs processing
+ alter some variable names to avoid confusion between header value and
  header name (caused breakage with previous rev)
2007-11-04 15:20:11 +00:00
rtr 6dc1829962 + don't free strdup()'d ptr that was manipulated.
(i.e. free(): warning: modified (chunk-) pointer))
+ don't leak memory for ptr actually returned from strdup()
+ don't strdup() if we don't have to
+ don't break without free() if we did strdup()
+ as well as freeing h_value also free the header.
2007-11-04 06:07:52 +00:00
tls 18c80b6525 RCS IDs 2007-10-17 18:47:59 +00:00
tls 13d3c473b0 Fix two memory leaks noted by Coverity (CID-4694, CIT-4695) and use
SIMPLEQ_FOREACH where possible.  Patch from Arnaud Lacombe.
2007-10-17 18:43:46 +00:00
tls 1d63366b2d Get httpd ready for inclusion in build. 2007-10-16 01:31:03 +00:00
tls 60dbe74596 Import of bozohttpd for its originally intended purpose: a small (~30k)
simple run-from-inetd httpd suitable for small systems (and some large
ones).
2007-10-16 01:14:01 +00:00