merge bozohttpd 20100621
This commit is contained in:
parent
c063f898e1
commit
30539536b5
@ -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:
|
changes since bozohttpd 20100509:
|
||||||
o fix some compile issues
|
o fix some compile issues
|
||||||
|
@ -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
|
.\" Copyright (c) 1997-2010 Matthew R. Green
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
@ -66,6 +66,12 @@ as its name, which defaults to the local hostname, obtained from
|
|||||||
.Fl v
|
.Fl v
|
||||||
option for virtual hosting.)
|
option for virtual hosting.)
|
||||||
.Nm
|
.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,
|
is designed to be small, simple and relatively featureless,
|
||||||
hopefully increasing its security.
|
hopefully increasing its security.
|
||||||
.Ss OPTIONS
|
.Ss OPTIONS
|
||||||
@ -458,7 +464,7 @@ The focus has always been simplicity and security, with minimal features
|
|||||||
and regular code audits.
|
and regular code audits.
|
||||||
This manual documents
|
This manual documents
|
||||||
.Nm
|
.Nm
|
||||||
version 20100617.
|
version 20100621.
|
||||||
.Sh AUTHORS
|
.Sh AUTHORS
|
||||||
.Nm
|
.Nm
|
||||||
was written by Matthew R. Green
|
was written by Matthew R. Green
|
||||||
|
@ -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
|
* Copyright (c) 1997-2010 Matthew R. Green
|
||||||
@ -109,7 +109,7 @@
|
|||||||
#define INDEX_HTML "index.html"
|
#define INDEX_HTML "index.html"
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERVER_SOFTWARE
|
#ifndef SERVER_SOFTWARE
|
||||||
#define SERVER_SOFTWARE "bozohttpd/20100617"
|
#define SERVER_SOFTWARE "bozohttpd/20100621"
|
||||||
#endif
|
#endif
|
||||||
#ifndef DIRECT_ACCESS_FILE
|
#ifndef DIRECT_ACCESS_FILE
|
||||||
#define DIRECT_ACCESS_FILE ".bzdirect"
|
#define DIRECT_ACCESS_FILE ".bzdirect"
|
||||||
@ -329,10 +329,14 @@ void
|
|||||||
bozo_clean_request(bozo_httpreq_t *request)
|
bozo_clean_request(bozo_httpreq_t *request)
|
||||||
{
|
{
|
||||||
struct bozoheaders *hdr, *ohdr = NULL;
|
struct bozoheaders *hdr, *ohdr = NULL;
|
||||||
|
bozohttpd_t *httpd = request->hr_httpd;
|
||||||
|
|
||||||
if (request == NULL)
|
if (request == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* If SSL enabled cleanup SSL structure. */
|
||||||
|
bozo_ssl_destroy(httpd);
|
||||||
|
|
||||||
/* clean up request */
|
/* clean up request */
|
||||||
#define MF(x) if (request->x) free(request->x)
|
#define MF(x) if (request->x) free(request->x)
|
||||||
MF(hr_remotehost);
|
MF(hr_remotehost);
|
||||||
@ -752,9 +756,6 @@ next_header:
|
|||||||
cleanup:
|
cleanup:
|
||||||
bozo_clean_request(request);
|
bozo_clean_request(request);
|
||||||
|
|
||||||
/* If SSL enabled cleanup SSL structure. */
|
|
||||||
bozo_ssl_destroy(httpd);
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1940,8 +1941,8 @@ bozo_setup(bozohttpd_t *httpd, bozoprefs_t *prefs, const char *vhost,
|
|||||||
{
|
{
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
|
static char *cleanenv[1] = { NULL };
|
||||||
uid_t uid;
|
uid_t uid;
|
||||||
char *cleanenv[1];
|
|
||||||
char *chrootdir;
|
char *chrootdir;
|
||||||
char *username;
|
char *username;
|
||||||
char *portnum;
|
char *portnum;
|
||||||
@ -2063,10 +2064,9 @@ bozo_setup(bozohttpd_t *httpd, bozoprefs_t *prefs, const char *vhost,
|
|||||||
* by chroot. cross-user settings might result in undesirable
|
* by chroot. cross-user settings might result in undesirable
|
||||||
* effects.
|
* effects.
|
||||||
*/
|
*/
|
||||||
if ((chrootdir != NULL || username != NULL) && !dirtyenv) {
|
if ((chrootdir != NULL || username != NULL) && !dirtyenv)
|
||||||
cleanenv[0] = NULL;
|
|
||||||
environ = cleanenv;
|
environ = cleanenv;
|
||||||
}
|
|
||||||
#ifdef _SC_PAGESIZE
|
#ifdef _SC_PAGESIZE
|
||||||
httpd->page_size = (long)sysconf(_SC_PAGESIZE);
|
httpd->page_size = (long)sysconf(_SC_PAGESIZE);
|
||||||
#else
|
#else
|
||||||
|
@ -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
|
* Copyright (c) 1997-2010 Matthew R. Green
|
||||||
@ -187,7 +187,12 @@ bozo_daemon_fork(bozohttpd_t *httpd)
|
|||||||
/* if we've handled 5 files, exit and let someone else work */
|
/* if we've handled 5 files, exit and let someone else work */
|
||||||
if (httpd->request_times > 5 ||
|
if (httpd->request_times > 5 ||
|
||||||
(httpd->background == 2 && httpd->request_times > 0))
|
(httpd->background == 2 && httpd->request_times > 0))
|
||||||
exit(0);
|
_exit(0);
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
if (httpd->request_times > 0)
|
||||||
|
_exit(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
while (httpd->background) {
|
while (httpd->background) {
|
||||||
struct sockaddr_storage ss;
|
struct sockaddr_storage ss;
|
||||||
|
Loading…
Reference in New Issue
Block a user