summaryrefslogtreecommitdiff
path: root/www/bozohttpd
diff options
context:
space:
mode:
authormrg <mrg@pkgsrc.org>2002-07-10 10:48:03 +0000
committermrg <mrg@pkgsrc.org>2002-07-10 10:48:03 +0000
commitff99e5db32073901eecfd58f5bd2b99b046e8250 (patch)
tree8fca211434a8c150a93c4fe2c9a62b1bccb3b2a7 /www/bozohttpd
parentcb80eb8e8b2822b1c0c03c67d332b980135d1d8a (diff)
downloadpkgsrc-ff99e5db32073901eecfd58f5bd2b99b046e8250.tar.gz
update to bozohttpd 5.10. changes include:
- many man pages and updates - freebsd support - cgi-bin fixes - improved logging - builtin chroot support
Diffstat (limited to 'www/bozohttpd')
-rw-r--r--www/bozohttpd/DESCR2
-rw-r--r--www/bozohttpd/Makefile7
-rw-r--r--www/bozohttpd/distinfo11
-rw-r--r--www/bozohttpd/patches/patch-aa14
-rw-r--r--www/bozohttpd/patches/patch-ab14
-rw-r--r--www/bozohttpd/patches/patch-ae354
6 files changed, 18 insertions, 384 deletions
diff --git a/www/bozohttpd/DESCR b/www/bozohttpd/DESCR
index 7ec406d1f08..65c7b8de34d 100644
--- a/www/bozohttpd/DESCR
+++ b/www/bozohttpd/DESCR
@@ -3,4 +3,4 @@ feature is the lack of features, reducing the code size and improving
verifiability.
It supports CGI/1.1, HTTP/1.1, HTTP/1.0, HTTP/0.9, ~user translations,
-and can run multiple IP-based http servers on single machine.
+and can run multiple IP-based or virtual http servers on single machine.
diff --git a/www/bozohttpd/Makefile b/www/bozohttpd/Makefile
index 8957046db75..13002e6cbf5 100644
--- a/www/bozohttpd/Makefile
+++ b/www/bozohttpd/Makefile
@@ -1,13 +1,12 @@
-# $NetBSD: Makefile,v 1.16 2002/06/26 10:53:32 lukem Exp $
+# $NetBSD: Makefile,v 1.17 2002/07/10 10:48:03 mrg Exp $
#
-DISTNAME= bozohttpd-5.09
-PKGREVISION= 1
+DISTNAME= bozohttpd-5.10
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_LOCAL}
EXTRACT_SUFX= .tar.bz2
-MAINTAINER= packages@netbsd.org
+MAINTAINER= mrg@eterna.com.au
HOMEPAGE= http://www.eterna.com.au/bozohttpd/
COMMENT= bozotic HTTP server; small and secure
diff --git a/www/bozohttpd/distinfo b/www/bozohttpd/distinfo
index 5fbc97800b5..ebe721c1c7a 100644
--- a/www/bozohttpd/distinfo
+++ b/www/bozohttpd/distinfo
@@ -1,7 +1,6 @@
-$NetBSD: distinfo,v 1.10 2002/06/26 10:53:33 lukem Exp $
+$NetBSD: distinfo,v 1.11 2002/07/10 10:48:03 mrg Exp $
-SHA1 (bozohttpd-5.09.tar.bz2) = 38670bf3216cf97fa2e7af1415afe0831bdd8ddc
-Size (bozohttpd-5.09.tar.bz2) = 18439 bytes
-SHA1 (patch-aa) = 3831938ead3fd2792d61878c10aa7ada431e8cd7
-SHA1 (patch-ab) = ed3d3cc3caeb47a096d01d605ea26320d837aa79
-SHA1 (patch-ae) = 13762fade36426525dbd4f93f57e521f3f8c271d
+SHA1 (bozohttpd-5.10.tar.bz2) = 854a89ff9f736969931fe86e7237b16e5e7c021f
+Size (bozohttpd-5.10.tar.bz2) = 19991 bytes
+SHA1 (patch-aa) = 65b36db037dbf40b8c9855b3ca957aa96eff064d
+SHA1 (patch-ab) = 24cc57867ecf94617a78025baf31c2f050d42470
diff --git a/www/bozohttpd/patches/patch-aa b/www/bozohttpd/patches/patch-aa
index 821cc55ed82..afe6f6978fd 100644
--- a/www/bozohttpd/patches/patch-aa
+++ b/www/bozohttpd/patches/patch-aa
@@ -1,12 +1,14 @@
-$NetBSD: patch-aa,v 1.1.1.1 1999/05/19 12:02:20 bad Exp $
+$NetBSD: patch-aa,v 1.2 2002/07/10 10:48:04 mrg Exp $
---- Makefile.orig Wed May 19 21:45:11 1999
-+++ Makefile Wed May 19 21:50:17 1999
-@@ -3,4 +3,7 @@
- PROG= bozohttpd
- MAN= bozohttpd.8
+--- Makefile.orig Wed Jul 10 20:07:09 2002
++++ Makefile Wed Jul 10 20:16:40 2002
+@@ -5,6 +5,9 @@
+
+ WARNS= 2
+BINDIR=$(PREFIX)/libexec
+MANDIR=$(PREFIX)/man
+
.include <bsd.prog.mk>
+
+ check:
diff --git a/www/bozohttpd/patches/patch-ab b/www/bozohttpd/patches/patch-ab
index 4cef3d7ce91..3a6e51eec89 100644
--- a/www/bozohttpd/patches/patch-ab
+++ b/www/bozohttpd/patches/patch-ab
@@ -1,19 +1,7 @@
-$NetBSD: patch-ab,v 1.9 2002/06/26 10:53:33 lukem Exp $
+$NetBSD: patch-ab,v 1.10 2002/07/10 10:48:04 mrg Exp $
--- bozohttpd.8.in.orig Sat Sep 22 20:10:00 2001
+++ bozohttpd.8.in
-@@ -99,10 +99,7 @@
- .Nm
- from doing IP address to name resolution of hosts for setting the
- .Ev REMOTE_HOST
--variable before running a CGI program. This option has no effect
--without the
--.Fl c
--option.
-+variable before running a CGI program.
- .It Fl r
- This option causes
- .Nm
@@ -172,8 +169,8 @@
.Xr inetd.conf 5
entry would be:
diff --git a/www/bozohttpd/patches/patch-ae b/www/bozohttpd/patches/patch-ae
deleted file mode 100644
index c4e5d01a481..00000000000
--- a/www/bozohttpd/patches/patch-ae
+++ /dev/null
@@ -1,354 +0,0 @@
-$NetBSD: patch-ae,v 1.2 2002/06/26 10:53:34 lukem Exp $
-
---- bozohttpd.c.orig Sat Sep 22 20:10:00 2001
-+++ bozohttpd.c
-@@ -189,6 +189,9 @@
- char *content_length;
- char *allow;
- char *host; /* HTTP/1.1 Host: */
-+ char *remotehost;
-+ char *remoteaddr;
-+ char *serverport;
- SIMPLEQ_HEAD(, _headers) headers;
- int nheaders;
- } http_req;
-@@ -205,6 +208,10 @@
- static char *cgibin; /* cgi-bin directory */
-
- static void process_cgi __P((http_req *));
-+
-+#define CGIBIN_PREFIX "cgi-bin/"
-+#define CGIBIN_PREFIX_LEN (sizeof(CGIBIN_PREFIX)-1)
-+
- #endif /* NO_CGIBIN_SUPPORT */
-
-
-@@ -359,6 +366,7 @@
- case 'c':
- #ifndef NO_CGIBIN_SUPPORT
- cgibin = optarg;
-+ debug((DEBUG_OBESE, "cgibin (cgi-bin directory) is %s", cgibin));
- break;
- #else
- error(1, "CGI is not enabled");
-@@ -460,7 +468,7 @@
- */
- if (bflag) {
- struct addrinfo h, *r;
-- int s, e;
-+ int e;
-
- daemon(1, 0);
-
-@@ -490,7 +498,7 @@
- * read and process the HTTP request.
- */
- do {
-- if (http_request = read_request()) {
-+ if ((http_request = read_request()) != NULL) {
- process_request(http_request);
- return (0);
- }
-@@ -558,14 +566,20 @@
- {
- struct sigaction sa;
- char *str, *val, *method, *url, *proto;
-+ char *host, *addr, *port;
-+ char hbuf[NI_MAXHOST], abuf[NI_MAXSERV], bufport[10];
- ssize_t len;
-+#ifndef SOCKOLD
-+ struct sockaddr_storage ss;
-+#else
-+ struct sockaddr ss;
-+#endif
- int line = 0;
-+ socklen_t slen;
- http_req *request;
-
- #ifndef NO_DAEMON_MODE
- if (bflag) {
-- struct sockaddr_storage ss;
-- socklen_t slen;
- int fd;
-
- /*
-@@ -603,12 +617,67 @@
-
- #endif /* NO_DAEMON_MODE */
-
-- request = malloc(sizeof *request);
-+ request = calloc(1, sizeof *request);
- if (request == NULL)
- error(1, "malloc of request descriptor");
- request->allow = request->host = request->content_type =
- request->content_length = NULL;
-
-+ slen = sizeof(ss);
-+ if (getpeername(0, (struct sockaddr *)&ss, &slen) < 0)
-+ host = addr = NULL;
-+ else {
-+#ifndef SOCKOLD
-+ addr = host = NULL;
-+ if (getnameinfo((struct sockaddr *)&ss, slen,
-+ abuf, sizeof abuf, NULL, 0, NI_NUMERICHOST) == 0)
-+ addr = abuf;
-+ if (nflag == 0 && getnameinfo((struct sockaddr *)&ss, slen,
-+ hbuf, sizeof hbuf, NULL, 0, 0) == 0)
-+ host = hbuf;
-+#else
-+ struct hostent *hp;
-+ struct sockaddr_in *sin;
-+
-+ switch (((struct sockaddr *)&ss)->sa_family) {
-+ case AF_INET:
-+ sin = (struct sockaddr_in *)&ss;
-+ addr = inet_ntoa(sin->sin_addr);
-+ if (nflag != 0 ||
-+ (hp = gethostbyaddr((char *)&sin->sin_addr,
-+ sizeof(sin->sin_addr), AF_INET)) == NULL)
-+ host = NULL;
-+ else
-+ host = hp->h_name;
-+ break;
-+ default:
-+ host = addr = NULL;
-+ break;
-+ }
-+#endif
-+ }
-+ if (host != NULL && (request->remotehost = strdup(host)) == NULL)
-+ http_error(500, request, "malloc failed");
-+ if (addr != NULL && (request->remoteaddr = strdup(addr)) == NULL)
-+ http_error(500, request, "malloc failed");
-+ slen = sizeof(ss);
-+ if (getsockname(0, (struct sockaddr *)&ss, &slen) < 0)
-+ port = NULL;
-+ else {
-+#ifndef SOCKOLD
-+ if (getnameinfo((struct sockaddr *)&ss, slen, NULL, 0,
-+ bufport, sizeof bufport, NI_NUMERICSERV) == 0)
-+ port = bufport;
-+ else
-+ port = NULL;
-+#else
-+ (void)snprintf(port = bufport, sizeof bufport, "%d",
-+ ntohs(((struct sockaddr_in *)&ss)->sin_port));
-+#endif
-+ }
-+ if (port != NULL && (request->serverport = strdup(port)) == NULL)
-+ http_error(500, request, "malloc failed");
-+
- /*
- * setup a timer to make sure the request is not hung
- */
-@@ -628,7 +697,10 @@
- if (line == 1) {
- if (len < 1)
- http_error(404, NULL, "null method");
-- warning("got request ``%s''", str);
-+ warning("got request ``%s'' from host %s to port %s",
-+ str,
-+ host ? host : addr ? addr : "<unknown>",
-+ port ? port : "<unknown>");
- debug((DEBUG_FAT, "read_req, getting request: ``%s''",
- str));
-
-@@ -980,7 +1052,7 @@
- * - ``expand'' %20 crapola
- * - punt if it doesn't start with /
- * - look for "http://myname/" and deal with it.
-- * - check if /cgi-bin/ and call process_cgi() if so
-+ * - check if "/" + CGIBIN_PREFIX and call process_cgi() if so
- * - check for ~user and call transform_user() if so
- * - if the length > 1, check for trailing slash. if so,
- * add the index.html file
-@@ -1006,7 +1078,7 @@
- if (url[0] != '/') {
- http_error(404, request, "unknown URL");
- #ifndef NO_CGIBIN_SUPPORT
-- } else if (strncmp(url + 1, "cgi-bin/", 8) == 0) {
-+ } else if (strncmp(url + 1, CGIBIN_PREFIX, CGIBIN_PREFIX_LEN) == 0) {
- debug((DEBUG_FAT, "calling process_cgi"));
- process_cgi(request);
- #endif /* NO_CGIBIN_SUPPORT */
-@@ -1234,17 +1306,16 @@
- http_req *request;
- {
- struct _headers *headp;
--#ifndef SOCKOLD
-- struct sockaddr_storage ss;
--#else
-- struct sockaddr ss;
--#endif
-- char *host, *addr, *port, *info, *type, *clen, *query, *s, *t,
-- *path, *env, *command = NULL,
-- *url = strdup(request->url + strlen("/cgi-bin"));
-+ char *info, *type, *clen, *query, *s, *t,
-+ *path, *env, *command = NULL, *fullcommand,
-+ *url = strdup(request->url + CGIBIN_PREFIX_LEN);
- char **envp, *argv[3];
-- char bufport[10];
-- int envpsize, ix, slen = sizeof(ss);
-+ int envpsize, ix;
-+
-+ if (url == NULL)
-+ http_error(500, request, "malloc failed");
-+ query = path = NULL;
-+ envp = NULL;
-
- debug((DEBUG_FAT, "process_cgi: writing HTTP header .."));
-
-@@ -1261,8 +1332,11 @@
- } else
- info = "";
-
-- if (command == NULL)
-+ if (command == NULL) {
- command = url;
-+ if (*command == '/')
-+ command++;
-+ }
-
- if ((s = strchr(url, '?')) != NULL) {
- *s++ = '\0';
-@@ -1270,71 +1344,20 @@
- } else
- query = NULL;
-
-- debug((DEBUG_FAT, "process_cgi: query %s cmd %s info %s", query,
-- command, info));
-+ debug((DEBUG_FAT, "process_cgi: cmd %s info %s query %s",
-+ command, info, query ? query : "<null>"));
-
- type = request->content_type;
- clen = request->content_length;
-
-- if (getpeername(0, (struct sockaddr *)&ss, &slen) < 0)
-- host = addr = NULL;
-- else {
--#ifndef SOCKOLD
-- char hbuf[NI_MAXHOST], abuf[NI_MAXSERV];
--
-- addr = host = NULL;
-- if (getnameinfo((struct sockaddr *)&ss, slen,
-- abuf, sizeof abuf, NULL, 0, NI_NUMERICHOST) == 0)
-- addr = abuf;
-- if (nflag != 0 && getnameinfo((struct sockaddr *)&ss, slen,
-- hbuf, sizeof hbuf, NULL, 0, 0) == 0)
-- host = hbuf;
--#else
-- struct hostent *hp;
-- struct sockaddr_in *sin;
--
-- switch (((struct sockaddr *)&ss)->sa_family) {
-- case AF_INET:
-- sin = (struct sockaddr_in *)&ss;
-- addr = inet_ntoa(sin->sin_addr);
-- if (nflag == 0 ||
-- (hp = gethostbyaddr((char *)&sin->sin_addr,
-- sizeof(sin->sin_addr), AF_INET)) == NULL)
-- host = NULL;
-- else
-- host = hp->h_name;
-- break;
-- default:
-- host = addr = NULL;
-- break;
-- }
--#endif
-- }
--
-- slen = sizeof(ss);
-- if (getsockname(0, (struct sockaddr *)&ss, &slen) < 0)
-- port = NULL;
-- else {
--#ifndef SOCKOLD
-- if (getnameinfo((struct sockaddr *)&ss, slen, NULL, 0,
-- bufport, sizeof bufport, NI_NUMERICSERV) == 0)
-- port = bufport;
-- else
-- port = NULL;
--#else
-- (void)snprintf(port = bufport, sizeof bufport, "%d",
-- ntohs(((struct sockaddr_in *)&ss)->sin_port));
--#endif
-- }
--
- envpsize = 10 + request->nheaders +
- (info && *info ? 1 : 0) +
- (query && query ? 1 : 0) +
- (type && *type ? 1 : 0) +
- (clen && *clen ? 1 : 0) +
-- (host && *host ? 1 : 0) +
-- (addr && *addr ? 1 : 0) +
-- (port && *port ? 1 : 0);
-+ (request->remotehost && *request->remotehost ? 1 : 0) +
-+ (request->remoteaddr && *request->remoteaddr ? 1 : 0) +
-+ (request->serverport && *request->serverport ? 1 : 0);
-
- envp = malloc(sizeof(*envp) * envpsize);
- if (envp == NULL)
-@@ -1368,8 +1391,11 @@
- for (s = headp->header; *s; t++, s++)
- if (islower(*s))
- *t = toupper(*s);
-+ else if (*s == '-')
-+ *t = '_';
- else
- *t = *s;
-+ *t = '\0';
- debug((DEBUG_OBESE, "setting header %s as %s = %s",
- headp->header, env, headp->value));
- spsetenv(env, headp->value);
-@@ -1382,7 +1408,12 @@
- spsetenv("GATEWAY_INTERFACE", "CGI/1.1");
- spsetenv("SERVER_PROTOCOL", request->proto);
- spsetenv("REQUEST_METHOD", request->methodstr);
-- spsetenv("SCRIPT_NAME", command);
-+ fullcommand = malloc(CGIBIN_PREFIX_LEN + strlen(command) + 1);
-+ if (fullcommand == NULL)
-+ http_error(500, request, "malloc failed");
-+ strcpy(fullcommand, CGIBIN_PREFIX);
-+ strcat(fullcommand, command);
-+ spsetenv("SCRIPT_NAME", fullcommand);
- spsetenv("SERVER_SOFTWARE", server_software);
- if (query && *query)
- spsetenv("QUERY_STRING", query);
-@@ -1392,12 +1423,12 @@
- spsetenv("CONTENT_TYPE", type);
- if (clen && *clen)
- spsetenv("CONTENT_LENGTH", clen);
-- if (port && *port)
-- spsetenv("SERVER_PORT", port);
-- if (host && *host)
-- spsetenv("REMOTE_HOST", host);
-- if (addr && *addr)
-- spsetenv("REMOTE_ADDR", addr);
-+ if (request->serverport && *request->serverport)
-+ spsetenv("SERVER_PORT", request->serverport);
-+ if (request->remotehost && *request->remotehost)
-+ spsetenv("REMOTE_HOST", request->remotehost);
-+ if (request->remoteaddr && *request->remoteaddr)
-+ spsetenv("REMOTE_ADDR", request->remoteaddr);
- #undef spsetenv
-
- path = malloc(strlen(cgibin) + 1 + strlen(command) + 1);
-@@ -1419,7 +1450,8 @@
- argv[0] = command;
- argv[1] = query;
- argv[2] = NULL;
-- debug((DEBUG_FAT, "going exec %s %s %s", path, command, query));
-+ debug((DEBUG_FAT, "going exec %s %s %s", path, command,
-+ query ? query : "<null>"));
- if (execve(path, argv, envp) < 0)
- error(1, "child exec failed");
- }
-@@ -1734,7 +1766,7 @@
- int savederrno;
-
- /* only log if the level is low enough */
-- if (level < dflag)
-+ if (dflag < level)
- return;
-
- savederrno = errno;