Module Name: src Committed By: mrg Date: Tue Jun 22 05:24:12 UTC 2010
Modified Files: src/libexec/httpd: CHANGES bozohttpd.8 bozohttpd.c daemon-bozo.c Log Message: merge bozohttpd 20100621 To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/libexec/httpd/CHANGES cvs rdiff -u -r1.20 -r1.21 src/libexec/httpd/bozohttpd.8 \ src/libexec/httpd/bozohttpd.c cvs rdiff -u -r1.10 -r1.11 src/libexec/httpd/daemon-bozo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/libexec/httpd/CHANGES diff -u src/libexec/httpd/CHANGES:1.8 src/libexec/httpd/CHANGES:1.9 --- src/libexec/httpd/CHANGES:1.8 Thu Jun 17 19:43:30 2010 +++ src/libexec/httpd/CHANGES Tue Jun 22 05:24:12 2010 @@ -1,4 +1,10 @@ -$eterna: CHANGES,v 1.75 2010/06/17 19:26:54 mrg Exp $ +$eterna: CHANGES,v 1.76 2010/06/21 06:45:45 mrg Exp $ + +changes since bozohttpd 20100617: + o properly fully disable multi-file mode for now + o fix the -t and -U options when used without the -e option, broken since + the library-ifcation + o be explicit that logs go to the FTP facility in syslog changes since bozohttpd 20100509: o fix some compile issues Index: src/libexec/httpd/bozohttpd.8 diff -u src/libexec/httpd/bozohttpd.8:1.20 src/libexec/httpd/bozohttpd.8:1.21 --- src/libexec/httpd/bozohttpd.8:1.20 Thu Jun 17 19:43:30 2010 +++ src/libexec/httpd/bozohttpd.8 Tue Jun 22 05:24:12 2010 @@ -1,6 +1,6 @@ -.\" $NetBSD: bozohttpd.8,v 1.20 2010/06/17 19:43:30 mrg Exp $ +.\" $NetBSD: bozohttpd.8,v 1.21 2010/06/22 05:24:12 mrg Exp $ .\" -.\" $eterna: bozohttpd.8,v 1.96 2010/06/17 19:27:32 mrg Exp $ +.\" $eterna: bozohttpd.8,v 1.98 2010/06/21 06:47:23 mrg Exp $ .\" .\" Copyright (c) 1997-2010 Matthew R. Green .\" All rights reserved. @@ -66,6 +66,12 @@ .Fl v option for virtual hosting.) .Nm +writes logs to +.Xr syslog 3 +using the ftp facaility (but see the +.Fl s +option for testing.) +.Nm is designed to be small, simple and relatively featureless, hopefully increasing its security. .Ss OPTIONS @@ -458,7 +464,7 @@ and regular code audits. This manual documents .Nm -version 20100617. +version 20100621. .Sh AUTHORS .Nm was written by Matthew R. Green Index: src/libexec/httpd/bozohttpd.c diff -u src/libexec/httpd/bozohttpd.c:1.20 src/libexec/httpd/bozohttpd.c:1.21 --- src/libexec/httpd/bozohttpd.c:1.20 Thu Jun 17 19:43:30 2010 +++ src/libexec/httpd/bozohttpd.c Tue Jun 22 05:24:12 2010 @@ -1,6 +1,6 @@ -/* $NetBSD: bozohttpd.c,v 1.20 2010/06/17 19:43:30 mrg Exp $ */ +/* $NetBSD: bozohttpd.c,v 1.21 2010/06/22 05:24:12 mrg Exp $ */ -/* $eterna: bozohttpd.c,v 1.172 2010/06/17 19:27:32 mrg Exp $ */ +/* $eterna: bozohttpd.c,v 1.174 2010/06/21 06:47:23 mrg Exp $ */ /* * Copyright (c) 1997-2010 Matthew R. Green @@ -109,7 +109,7 @@ #define INDEX_HTML "index.html" #endif #ifndef SERVER_SOFTWARE -#define SERVER_SOFTWARE "bozohttpd/20100617" +#define SERVER_SOFTWARE "bozohttpd/20100621" #endif #ifndef DIRECT_ACCESS_FILE #define DIRECT_ACCESS_FILE ".bzdirect" @@ -329,10 +329,14 @@ bozo_clean_request(bozo_httpreq_t *request) { struct bozoheaders *hdr, *ohdr = NULL; + bozohttpd_t *httpd = request->hr_httpd; if (request == NULL) return; + /* If SSL enabled cleanup SSL structure. */ + bozo_ssl_destroy(httpd); + /* clean up request */ #define MF(x) if (request->x) free(request->x) MF(hr_remotehost); @@ -752,9 +756,6 @@ cleanup: bozo_clean_request(request); - /* If SSL enabled cleanup SSL structure. */ - bozo_ssl_destroy(httpd); - return NULL; } @@ -1940,8 +1941,8 @@ { struct passwd *pw; extern char **environ; + static char *cleanenv[1] = { NULL }; uid_t uid; - char *cleanenv[1]; char *chrootdir; char *username; char *portnum; @@ -2063,10 +2064,9 @@ * by chroot. cross-user settings might result in undesirable * effects. */ - if ((chrootdir != NULL || username != NULL) && !dirtyenv) { - cleanenv[0] = NULL; + if ((chrootdir != NULL || username != NULL) && !dirtyenv) environ = cleanenv; - } + #ifdef _SC_PAGESIZE httpd->page_size = (long)sysconf(_SC_PAGESIZE); #else Index: src/libexec/httpd/daemon-bozo.c diff -u src/libexec/httpd/daemon-bozo.c:1.10 src/libexec/httpd/daemon-bozo.c:1.11 --- src/libexec/httpd/daemon-bozo.c:1.10 Thu Jun 17 19:43:30 2010 +++ src/libexec/httpd/daemon-bozo.c Tue Jun 22 05:24:12 2010 @@ -1,6 +1,6 @@ -/* $NetBSD: daemon-bozo.c,v 1.10 2010/06/17 19:43:30 mrg Exp $ */ +/* $NetBSD: daemon-bozo.c,v 1.11 2010/06/22 05:24:12 mrg Exp $ */ -/* $eterna: daemon-bozo.c,v 1.21 2010/06/07 21:48:51 mrg Exp $ */ +/* $eterna: daemon-bozo.c,v 1.22 2010/06/21 06:45:45 mrg Exp $ */ /* * Copyright (c) 1997-2010 Matthew R. Green @@ -187,7 +187,12 @@ /* if we've handled 5 files, exit and let someone else work */ if (httpd->request_times > 5 || (httpd->background == 2 && httpd->request_times > 0)) - exit(0); + _exit(0); + +#if 1 + if (httpd->request_times > 0) + _exit(0); +#endif while (httpd->background) { struct sockaddr_storage ss;