re-add a lot of the distribution files

This commit is contained in:
mrg 2009-04-18 07:48:02 +00:00
parent f32af62cb7
commit 74dbf40e6b
22 changed files with 383 additions and 0 deletions

202
libexec/httpd/CHANGES Normal file
View File

@ -0,0 +1,202 @@
$eterna: CHANGES,v 1.65 2009/04/18 05:36:04 mrg Exp $
changes since bozohttpd 20080303:
o make bozohttpd internally more modular, preparing the way
to handle more than one request per process
o fix http-auth, set $REMOTE_USER not $REMOTEUSER. also fix
cgi-bin with cvsweb, from Holger Weiss <holger@CIS.FU-Berlin.DE>
o fix an uninitialised variable use in daemon mode
o fix ssl mode with newer OpenSSL
o mmap large files in manageable sizes so we can serve any size file
o refactor url processing to handle query strings correctly for CGI
from Sergey Katsev at Coyote Point
o add If-Modified-Since support, from Joerg Sonnenberger
<joerg@netbsd.org>
o many more manual fixes, from NetBSD
changes since bozohttpd 20060710:
o fix some cgi header processing, from <thelsdj@gmail.com>
o add simple Range: header processing, from <bad@bsd.de>
o man page fixes, from NetBSD
o clean up various parts, from NetBSD
changes since bozohttpd 20060517:
o prefix some function names with "bozo"
o align directory indexing <hr> markers
o clean up some code GCC4 grumbled about
changes since bozohttpd 20050410:
o don't allow "/.." or "../" files
o don't write ":80" into urls for the http port
o fix a fd leak when fork() fails
o make directory indexing mode not look so ugly
o build a text version of the manual page
o make "make clean" work properly
changes since bozohttpd 20040808:
o fix some off-by-one errors from <roland.illig@gmx.de>
o properly support nph- CGI
o make content maps case insensitive
o fix proto header merging to include the missing comma
o major source reorganisation; most features are in separate files now
o new -V flag that makes unknown virtualhosts use slashdir
from <rumble@ephemeral.org>
o HTTP/1.x protocol headers are now properly merged for CGI
changes since bozohttpd 20040218:
o CGI status is now properly handled (-a flag has been removed)
o CGI file upload support works
o %xy translations are no longer ever applied after the first '?',
ala RFC2396. from lukem
o daemon mode (-b) should no longer hang spinning forever if it
sees no children. from lukem
o new .bzabsredirect file support. from <martin@netbsd.org>
o return a 404 error if we see %00 or %2f (/)
o don't print 2 "200" headers for CGI
o support .torrent files
changes since bozohttpd 20031005:
o new .bzredirect file support for sane directory redirection
o new -Z option that enables SSL mode, from <rtr@eterna.com.au>
o the -C option has been changed to take two explicit options, rather
than a single option with a space separating the suffix and the
interpreter. ``-C ".foo /path/to/bar"'' should now be written
as ``-C .foo /path/to/bar''
o the -M option has been changed like -C and no longer requires or
supports a single argument with space-separated options
o with -a, still print the 200 OK. from <rtr@eterna.com.au>
o with -r, if a .bzdirect file appears in a directory, allow direct
access to this directory
changes since bozohttpd 20030626:
o fixes for basic authorisation. from <ecu@ipv42.net>
o always display file size in directory index mode
o add .xbel, .xml & .xsl -> text/xml mappings. from
<wiz@danbala.ifoer.tuwien.ac.at>
changes since bozohttpd 20030409:
o fix a recent core dump when given no input
o add new -r flag that ensures referrer is set to this host
o fix several compile time errors with -DNO_CGIBIN_SUPPORT
o fix some man page details. from lukem@wasabisystems.com
o re-add a missing memset(), fixing a core dump. from lukem
o support HTTP basic authorisation, disabled by default. from lukem
o print the port number in redirects and errors. from lukem
o only syslog the basename of the program. from lukem
o add __attribute__() format checking. from lukem
o fix cgibin SCRIPT_NAME to have a leading /. from zakj@nox.cx
o simplify some code in -C to avoid a core dump. from lukem
o add a .css -> css/text entry to the content_map[]. from zakj@nox.cx
changes since bozohttpd 20030313:
o -d without DEBUG enabled only prints one warning and continues
o one can now define the C macro SERVER_SOFTWARE when building to
change the Server: header and CGI variable of the same name
o add new -s flag the force logging output to stderr. from zakj@nox.cx
o add new -a flag for CGI bin that stops bozohttpd from outputting
any HTTP reply, the CGI program must output these. from zakj@nox.cx
o new REQUEST_URI and DATE_GMT environment variables for CGI. from
zakj@nox.cx
o add a "Makefile.boot" that should work with any make program
o build on linux again
o fix core dumps when using -C
changes since bozohttpd 20021106:
o deprecate -r flag; make this the default and silently ignore -r now
o add support for file extentions to call CGI programs (from lukem)
o add dynamic support to add new content map entries, allowing both
new file types and non /cgi-bin CGI programs to be run with the
new -C "suffix cgihandler" and -M "suffix type encoding encoding11"
options
o in -b mode, set the http date after accept() returns, not before we
call accept()
o in -b mode, bind all addresses found not just the first one
o unsupport old hostname API
o in -b mode, set the SO_REUSEADDR socket option (lukem)
o allow -x (index.html) mode to work with CGI handlers
changes since bozohttpd 5.15 (20020913):
o add .bz2 support
o properly escape <, > and & in error messages, partly from
Nicolas Jombart <ecu@mariejeanne.net>
o new -H flag to hide .* files in directory index mode
o fix buffer reallocation when parsing a request, to avoid
overflowing the buffer with carriage returns (\r)
o do not decode "%XY"-style cgi-bin data beyond the "?"
changes since bozohttpd 5.14 (20020823):
o add .ogg support -> `application/x-ogg'
o fix CGI requests with "/" in the query part
changes since bozohttpd 5.13 (20020804):
o allow -X mode to work for "/"
o work on systems without MADV_SEQUENTIAL
o make a local cut-down copy of "queue.h" (fixes linux & solaris
support at the very least)
o portability fixes for pre-ipv6 socket api systems (eg, solaris 7)
o portability fixes for missing _PATH_DEFPATH, LOG_FTP and __progname
o better documentation on virtual host support
changes since bozohttpd 5.12 (20020803):
o support .mp3 files (type audio/mpeg)
o use stat() to find out if something is a directory, for -X mode
changes since bozohttpd 5.11 (20020730):
o constification
o fixes & enhancements for directory index mode (-X)
changes since bozohttpd 5.10 (20020710):
o more man page fixes from Thomas Klausner
<wiz@danbala.ifoer.tuwien.ac.at>
o de-K&R C-ification
o fix Date: header for daemon mode
o fix core dump when asking for /cgi-bin/ when CGI isn't configured
o use a valid Server: header
changes since bozohttpd 5.09 (20010922):
- add freebsd support
- fix a couple of header typos
- many cgi-bin fixes from lukem@netbsd.org
- add -T chrootdir and -U user, plus several minor other cleanups
with signals and return values. from xs@kittenz.org
- add -e that does not clear the environment for -T/-U
- fix a formatting error noticed by ISIHARA Takanori <ishit@oak.dti.ne.jp>
changes since bozohttpd 5.08 (20010812):
- add a daemon mode
- document how to use bozohttpd in netbsd inetd with more than 40
connections per minute and also with cgibin
- man page fixes from wiz@netbsd.org
changes since bozohttpd 5.07 (20010610):
- add directory index generation support (-X) from ad@netbsd.org
- add .pa as an alias for .pac
- make server software version configurable (RFC)
changes since bozohttpd 5.06 (20000825):
- add .png support
- new "-x index.html" flag to change default file
- new "-p public_html" flag to change default ~user directory
- fixes cgi-bin support and more from chuck@research.att.com
- add many new content-types, now support most common ones
changes since bozohttpd 5.05 (20000815):
- add IPv6 suppor from itojun@iijlab.net
- man page fixes from jlam@netbsd.org
changes since bozohttpd 5.04 (20000427):
- fix a virtual host bug, from kleink@netbsd.org
changes since bozohttpd 5.03 (20000427):
- fix virtual host support; URI takes precedence over Host:
changes since bozohttpd 5.02 (20000426):
- fix a bug with chdir()
changes since bozohttpd 5.01 (20000421):
- .pac spport from simonb
changes since bozohttpd 5.00 (19990519):
- .swf support
- virtual hosting support

View File

@ -0,0 +1,23 @@
# $eterna: Makefile.boot,v 1.7 2005/09/27 20:09:20 mrg Exp $
#
# very simple makefile to compile bozohttpd, should work with every make.
# see Makefile for a list of compile options that may be placed in CFLAGS.
CC= cc
CFLAGS= -O
GROFF= groff -Tascii
CRYPTOLIBDIR= # -L/usr/local/lib
CRYPTOLIBS= $(CRYPTOLIBDIR) -lcrypto -lssl
FILES= bozohttpd.c auth-bozo.c cgi-bozo.c content-bozo.c daemon-bozo.c \
dir-index-bozo.c ssl-bozo.c tilde-luzah-bozo.c
all:
$(CC) $(CFLAGS) -o bozohttpd $(FILES) $(CRYPTOLIBS)
man:
$(GROFF) -mandoc bozohttpd.8 > bozohttpd.cat8
clean:
rm -f bozohttpd bozohttpd.cat8 *.o

View File

@ -0,0 +1,20 @@
# $eterna: Makefile,v 1.13 2008/03/04 04:46:38 mrg Exp $
SIMPLETESTS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
BOZOHTTPD?= ../bozohttpd
all:
clean:
for a in $(SIMPLETESTS); do \
rm -f tmp.$$a.out; \
done
check:
.for a in $(SIMPLETESTS)
echo "Running test $a"
$(BOZOHTTPD) ./data < $(.CURDIR)/$a.in > tmp.$a.out || true
$(.CURDIR)/html_cmp $(.CURDIR)/$a.out tmp.$a.out
.endfor
.include <bsd.obj.mk>

View File

@ -0,0 +1,27 @@
#! /bin/sh
#
# $eterna: html_cmp,v 1.8 2003/02/06 09:40:39 mrg Exp $
#
# like cmp(1) but compares to files after making their `Date: ' headers
# the same, to allow `now' and `then' to work properly. it also tries
# to find servername's that might be the local host and converts those
# as well..
#
# it must be called like `cmp file1 file1' *only*.
h=`hostname || uname -n`
sedcmd="s/^Date: .*/Date: nowish/;
s/^Last-Modified: .*/Last-Modified: nowish/;
s/[a-zA-Z0-9-]*\.eterna\.com\.au/$h/g;
s/^Server: .*/^Server: bozotic HTTP server version 5.08/;
s/^Content-Length: .*/Content-Length: 223/;"
sed -e "$sedcmd" < $1 > f1.tmp.$$
sed -e "$sedcmd" < $2 > f2.tmp.$$
cmp -s f1.tmp.$$ f2.tmp.$$
rv=$?
rm -f f1.tmp.$$ f2.tmp.$$
exit $rv

View File

@ -0,0 +1 @@
get /

View File

@ -0,0 +1,2 @@
HTTP/0.9 200 OK
this is the bozohttpd testsuite ./data/index.html file

View File

@ -0,0 +1 @@
GET / HTTP/1.0

View File

@ -0,0 +1,9 @@
HTTP/1.0 200 OK
Date: Tue, 10 Jul 2001 15:45:36 GMT
Server: bozotic HTTP server version 5.08
Accept-Ranges: bytes
Last-Modified: Tue, 10 Jul 2001 15:50:43 GMT
Content-Type: text/html
Content-Length: 55
this is the bozohttpd testsuite ./data/index.html file

View File

@ -0,0 +1 @@
GET / HTTP/1.1

View File

@ -0,0 +1,11 @@
HTTP/1.1 400 Bad Request
Content-Type: text/html
Content-Length: 229
Server: bozotic HTTP server version 5.08
Allow: GET, HEAD, POST
<html><head><title>400 Bad Request</title></head>
<body><h1>400 Bad Request</h1>
/: <pre>The request was not valid</pre>
<hr><address><a href="http://madrugada.eterna.com.au/">madrugada.eterna.com.au</a></address>
</body></html>

View File

@ -0,0 +1,2 @@
GET / HTTP/1.1
Host:

View File

@ -0,0 +1,10 @@
HTTP/1.1 200 OK
Date: Tue, 10 Jul 2001 15:49:21 GMT
Server: bozotic HTTP server version 5.08
Accept-Ranges: bytes
Last-Modified: Tue, 10 Jul 2001 15:34:33 GMT
Content-Type: text/html
Content-Length: 55
Connection: close
this is the bozohttpd testsuite ./data/index.html file

View File

@ -0,0 +1,2 @@
GET /cgi-bin/..M-@M-/..M-@M-/..M-@M-/..M-@M-/..M-@M-/../winnt/system32/cmd.exe?/c+dir+c:\\ HTTP/1.0

View File

@ -0,0 +1,10 @@
HTTP/1.0 403 Forbidden
Content-Type: text/html
Content-Length: 336
Server: bozohttpd/20030206
<html><head><title>403 Forbidden</title></head>
<body><h1>403 Forbidden</h1>
/cgi-bin/..M-@M-/..M-@M-/..M-@M-/..M-@M-/..M-@M-/../winnt/system32/cmd.exe: <pre>Access to this item has been denied</pre>
<hr><address><a href="http://what-time-is-love.eterna.com.au/">what-time-is-love.eterna.com.au</a></address>
</body></html>

View File

@ -0,0 +1,2 @@
GET /xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HTTP/1.0

View File

@ -0,0 +1,10 @@
HTTP/1.0 404 Not Found
Content-Type: text/html
Content-Length: 335
Server: bozohttpd/5.15
<html><head><title>404 Not Found</title></head>
<body><h1>404 Not Found</h1>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: <pre>This item has not been found</pre>
<hr><address><a href="http://splode.eterna.com.au/">splode.eterna.com.au</a></address>
</body></html>

View File

@ -0,0 +1,4 @@
GET /file HTTP/1.1
Host:
Range: bytes=0-63

View File

@ -0,0 +1,14 @@
HTTP/1.1 206 Partial Content
Date: Sun, 02 Mar 2008 08:52:03 GMT
Server: bozohttpd/20060710
Accept-Ranges: bytes
Last-Modified: Sun, 02 Mar 2008 08:44:38 GMT
Content-Type: text/plain
Content-Range: bytes 0-63/64
Content-Length: 64
Connection: close
123456781234567
345678903456789
234567892345678
012345670123456

View File

@ -0,0 +1,4 @@
GET /file HTTP/1.1
Host:
Range: bytes=0-31

View File

@ -0,0 +1,12 @@
HTTP/1.1 206 Partial Content
Date: Sun, 02 Mar 2008 08:52:03 GMT
Server: bozohttpd/20060710
Accept-Ranges: bytes
Last-Modified: Sun, 02 Mar 2008 08:44:38 GMT
Content-Type: text/plain
Content-Range: bytes 0-31/64
Content-Length: 32
Connection: close
123456781234567
345678903456789

View File

@ -0,0 +1,4 @@
GET /file HTTP/1.1
Host:
Range: bytes=32-63

View File

@ -0,0 +1,12 @@
HTTP/1.1 206 Partial Content
Date: Sun, 02 Mar 2008 08:52:03 GMT
Server: bozohttpd/20060710
Accept-Ranges: bytes
Last-Modified: Sun, 02 Mar 2008 08:44:38 GMT
Content-Type: text/plain
Content-Range: bytes 32-63/64
Content-Length: 32
Connection: close
234567892345678
012345670123456