Module Name: src Committed By: mrg Date: Thu Jan 2 08:21:39 UTC 2014
Modified Files: src/libexec/httpd: CHANGES auth-bozo.c bozohttpd.c bozohttpd.h cgi-bozo.c content-bozo.c daemon-bozo.c dir-index-bozo.c lua-bozo.c main.c printenv.lua ssl-bozo.c tilde-luzah-bozo.c src/libexec/httpd/small: Makefile Log Message: - update CHANGES with recent changes - update version to 20140102 - update copyrights - use getcwd() over getwd() - fix lean build (don't include lua) To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/libexec/httpd/CHANGES cvs rdiff -u -r1.11 -r1.12 src/libexec/httpd/auth-bozo.c cvs rdiff -u -r1.44 -r1.45 src/libexec/httpd/bozohttpd.c cvs rdiff -u -r1.30 -r1.31 src/libexec/httpd/bozohttpd.h cvs rdiff -u -r1.23 -r1.24 src/libexec/httpd/cgi-bozo.c cvs rdiff -u -r1.8 -r1.9 src/libexec/httpd/content-bozo.c \ src/libexec/httpd/lua-bozo.c cvs rdiff -u -r1.15 -r1.16 src/libexec/httpd/daemon-bozo.c \ src/libexec/httpd/ssl-bozo.c cvs rdiff -u -r1.18 -r1.19 src/libexec/httpd/dir-index-bozo.c cvs rdiff -u -r1.6 -r1.7 src/libexec/httpd/main.c cvs rdiff -u -r1.1 -r1.2 src/libexec/httpd/printenv.lua cvs rdiff -u -r1.9 -r1.10 src/libexec/httpd/tilde-luzah-bozo.c cvs rdiff -u -r1.1.1.1 -r1.2 src/libexec/httpd/small/Makefile 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.13 src/libexec/httpd/CHANGES:1.14 --- src/libexec/httpd/CHANGES:1.13 Thu Jul 11 07:44:19 2013 +++ src/libexec/httpd/CHANGES Thu Jan 2 08:21:38 2014 @@ -1,6 +1,9 @@ $eterna: CHANGES,v 1.78 2011/11/18 01:25:11 mrg Exp $ changes since bozohttpd 20111118: + o update a few content types + o add support for directly calling lua scripts to handle + processes, from mbal...@netbsd.org o properly escape generated HTML o add authentication for redirections, from mar...@netbsd.org o handle chained ssl certifications, from el...@netbsd.org Index: src/libexec/httpd/auth-bozo.c diff -u src/libexec/httpd/auth-bozo.c:1.11 src/libexec/httpd/auth-bozo.c:1.12 --- src/libexec/httpd/auth-bozo.c:1.11 Sat Oct 12 18:46:12 2013 +++ src/libexec/httpd/auth-bozo.c Thu Jan 2 08:21:38 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: auth-bozo.c,v 1.11 2013/10/12 18:46:12 mbalmer Exp $ */ +/* $NetBSD: auth-bozo.c,v 1.12 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: auth-bozo.c,v 1.17 2011/11/18 09:21:15 mrg Exp $ */ /* - * Copyright (c) 1997-2011 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: src/libexec/httpd/bozohttpd.c diff -u src/libexec/httpd/bozohttpd.c:1.44 src/libexec/httpd/bozohttpd.c:1.45 --- src/libexec/httpd/bozohttpd.c:1.44 Sat Oct 12 18:46:12 2013 +++ src/libexec/httpd/bozohttpd.c Thu Jan 2 08:21:38 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: bozohttpd.c,v 1.44 2013/10/12 18:46:12 mbalmer Exp $ */ +/* $NetBSD: bozohttpd.c,v 1.45 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */ /* - * Copyright (c) 1997-2013 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -109,7 +109,7 @@ #define INDEX_HTML "index.html" #endif #ifndef SERVER_SOFTWARE -#define SERVER_SOFTWARE "bozohttpd/20130711" +#define SERVER_SOFTWARE "bozohttpd/20140102" #endif #ifndef DIRECT_ACCESS_FILE #define DIRECT_ACCESS_FILE ".bzdirect" Index: src/libexec/httpd/bozohttpd.h diff -u src/libexec/httpd/bozohttpd.h:1.30 src/libexec/httpd/bozohttpd.h:1.31 --- src/libexec/httpd/bozohttpd.h:1.30 Sat Oct 12 17:24:07 2013 +++ src/libexec/httpd/bozohttpd.h Thu Jan 2 08:21:38 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: bozohttpd.h,v 1.30 2013/10/12 17:24:07 mbalmer Exp $ */ +/* $NetBSD: bozohttpd.h,v 1.31 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $ */ /* - * Copyright (c) 1997-2013 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: src/libexec/httpd/cgi-bozo.c diff -u src/libexec/httpd/cgi-bozo.c:1.23 src/libexec/httpd/cgi-bozo.c:1.24 --- src/libexec/httpd/cgi-bozo.c:1.23 Sat Oct 12 18:46:12 2013 +++ src/libexec/httpd/cgi-bozo.c Thu Jan 2 08:21:38 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: cgi-bozo.c,v 1.23 2013/10/12 18:46:12 mbalmer Exp $ */ +/* $NetBSD: cgi-bozo.c,v 1.24 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $ */ /* - * Copyright (c) 1997-2013 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: src/libexec/httpd/content-bozo.c diff -u src/libexec/httpd/content-bozo.c:1.8 src/libexec/httpd/content-bozo.c:1.9 --- src/libexec/httpd/content-bozo.c:1.8 Thu Jul 11 07:44:19 2013 +++ src/libexec/httpd/content-bozo.c Thu Jan 2 08:21:38 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: content-bozo.c,v 1.8 2013/07/11 07:44:19 mrg Exp $ */ +/* $NetBSD: content-bozo.c,v 1.9 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: content-bozo.c,v 1.17 2011/11/18 09:21:15 mrg Exp $ */ /* - * Copyright (c) 1997-2013 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: src/libexec/httpd/lua-bozo.c diff -u src/libexec/httpd/lua-bozo.c:1.8 src/libexec/httpd/lua-bozo.c:1.9 --- src/libexec/httpd/lua-bozo.c:1.8 Tue Nov 19 07:51:56 2013 +++ src/libexec/httpd/lua-bozo.c Thu Jan 2 08:21:38 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: lua-bozo.c,v 1.8 2013/11/19 07:51:56 mbalmer Exp $ */ +/* $NetBSD: lua-bozo.c,v 1.9 2014/01/02 08:21:38 mrg Exp $ */ /* * Copyright (c) 2013 Marc Balmer <m...@msys.ch> @@ -32,6 +32,8 @@ #ifndef NO_LUA_SUPPORT +#include <sys/param.h> + #include <lua.h> #include <lauxlib.h> #include <lualib.h> @@ -180,17 +182,17 @@ void bozo_add_lua_map(bozohttpd_t *httpd, const char *prefix, const char *script) { lua_state_map_t *map; - char *cwd, *path; map = bozomalloc(httpd, sizeof(lua_state_map_t)); map->prefix = bozostrdup(httpd, prefix); if (*script == '/') map->script = bozostrdup(httpd, script); else { - cwd = getwd(NULL); + char cwd[MAXPATHLEN], *path; + + getcwd(cwd, sizeof(cwd) - 1); asprintf(&path, "%s/%s", cwd, script); map->script = path; - free(cwd); } map->L = luaL_newstate(); if (map->L == NULL) Index: src/libexec/httpd/daemon-bozo.c diff -u src/libexec/httpd/daemon-bozo.c:1.15 src/libexec/httpd/daemon-bozo.c:1.16 --- src/libexec/httpd/daemon-bozo.c:1.15 Fri Nov 18 09:51:31 2011 +++ src/libexec/httpd/daemon-bozo.c Thu Jan 2 08:21:38 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: daemon-bozo.c,v 1.15 2011/11/18 09:51:31 mrg Exp $ */ +/* $NetBSD: daemon-bozo.c,v 1.16 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: daemon-bozo.c,v 1.24 2011/11/18 09:21:15 mrg Exp $ */ /* - * Copyright (c) 1997-2011 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: src/libexec/httpd/ssl-bozo.c diff -u src/libexec/httpd/ssl-bozo.c:1.15 src/libexec/httpd/ssl-bozo.c:1.16 --- src/libexec/httpd/ssl-bozo.c:1.15 Wed Mar 14 23:47:19 2012 +++ src/libexec/httpd/ssl-bozo.c Thu Jan 2 08:21:38 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: ssl-bozo.c,v 1.15 2012/03/14 23:47:19 joerg Exp $ */ +/* $NetBSD: ssl-bozo.c,v 1.16 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: ssl-bozo.c,v 1.15 2011/11/18 09:21:15 mrg Exp $ */ /* - * Copyright (c) 1997-2011 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: src/libexec/httpd/dir-index-bozo.c diff -u src/libexec/httpd/dir-index-bozo.c:1.18 src/libexec/httpd/dir-index-bozo.c:1.19 --- src/libexec/httpd/dir-index-bozo.c:1.18 Sat Oct 12 18:46:12 2013 +++ src/libexec/httpd/dir-index-bozo.c Thu Jan 2 08:21:38 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: dir-index-bozo.c,v 1.18 2013/10/12 18:46:12 mbalmer Exp $ */ +/* $NetBSD: dir-index-bozo.c,v 1.19 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: dir-index-bozo.c,v 1.20 2011/11/18 09:21:15 mrg Exp $ */ /* - * Copyright (c) 1997-2013 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: src/libexec/httpd/main.c diff -u src/libexec/httpd/main.c:1.6 src/libexec/httpd/main.c:1.7 --- src/libexec/httpd/main.c:1.6 Sat Oct 12 17:24:07 2013 +++ src/libexec/httpd/main.c Thu Jan 2 08:21:38 2014 @@ -1,10 +1,10 @@ -/* $NetBSD: main.c,v 1.6 2013/10/12 17:24:07 mbalmer Exp $ */ +/* $NetBSD: main.c,v 1.7 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: main.c,v 1.6 2011/11/18 09:21:15 mrg Exp $ */ /* from: eterna: bozohttpd.c,v 1.159 2009/05/23 02:14:30 mrg Exp */ /* - * Copyright (c) 1997-2011 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: src/libexec/httpd/printenv.lua diff -u src/libexec/httpd/printenv.lua:1.1 src/libexec/httpd/printenv.lua:1.2 --- src/libexec/httpd/printenv.lua:1.1 Sat Oct 12 17:24:07 2013 +++ src/libexec/httpd/printenv.lua Thu Jan 2 08:21:38 2014 @@ -1,3 +1,5 @@ +-- $NetBSD: printenv.lua,v 1.2 2014/01/02 08:21:38 mrg Exp $ + -- this small Lua script demonstrates the use of Lua in (bozo)httpd -- it will simply output the "environment" Index: src/libexec/httpd/tilde-luzah-bozo.c diff -u src/libexec/httpd/tilde-luzah-bozo.c:1.9 src/libexec/httpd/tilde-luzah-bozo.c:1.10 --- src/libexec/httpd/tilde-luzah-bozo.c:1.9 Fri Nov 18 09:51:31 2011 +++ src/libexec/httpd/tilde-luzah-bozo.c Thu Jan 2 08:21:38 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: tilde-luzah-bozo.c,v 1.9 2011/11/18 09:51:31 mrg Exp $ */ +/* $NetBSD: tilde-luzah-bozo.c,v 1.10 2014/01/02 08:21:38 mrg Exp $ */ /* $eterna: tilde-luzah-bozo.c,v 1.16 2011/11/18 09:21:15 mrg Exp $ */ /* - * Copyright (c) 1997-2011 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without Index: src/libexec/httpd/small/Makefile diff -u src/libexec/httpd/small/Makefile:1.1.1.1 src/libexec/httpd/small/Makefile:1.2 --- src/libexec/httpd/small/Makefile:1.1.1.1 Sat May 23 02:21:19 2009 +++ src/libexec/httpd/small/Makefile Thu Jan 2 08:21:39 2014 @@ -8,7 +8,8 @@ SRCS= bozohttpd-small.c content-bozo-sma LEAN_IFDEF_FLAGS= -UDEBUG -DNO_USER_SUPPORT \ -DNO_CGIBIN_SUPPORT -DNO_DIRINDEX_SUPPORT \ -DNO_DAEMON_MODE -DNO_DYNAMIC_CONTENT \ - -DNO_SSL_SUPPORT -UDO_HTPASSWD + -DNO_SSL_SUPPORT -UDO_HTPASSWD \ + -DNO_LUA_SUPPORT CFLAGS= -I$(.CURDIR)/.. ${LEAN_IFDEF_FLAGS}