Module Name:    src
Committed By:   snj
Date:           Thu Apr 23 19:38:11 UTC 2015

Modified Files:
        src/distrib/sets/lists/base [netbsd-7]: mi
        src/distrib/sets/lists/man [netbsd-7]: mi
        src/libexec/httpd [netbsd-7]: Makefile bozohttpd.8 cgi-bozo.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #715):
        distrib/sets/lists/base/mi: revision 1.1100
        distrib/sets/lists/man/mi: revision 1.1499 via patch
        libexec/httpd/Makefile: revision 1.23
        libexec/httpd/bozohttpd.8: revision 1.50
        libexec/httpd/cgi-bozo.c: revision 1.26
install as bozohttpd/bozohttpd.8 as well as httpd.
--
Fix deref "command" after "free(file)", from KIYOHARA Takashi


To generate a diff of this commit:
cvs rdiff -u -r1.1087.2.4 -r1.1087.2.5 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1485.2.7 -r1.1485.2.8 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.22 -r1.22.2.1 src/libexec/httpd/Makefile
cvs rdiff -u -r1.46.4.2 -r1.46.4.3 src/libexec/httpd/bozohttpd.8
cvs rdiff -u -r1.25 -r1.25.2.1 src/libexec/httpd/cgi-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/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1087.2.4 src/distrib/sets/lists/base/mi:1.1087.2.5
--- src/distrib/sets/lists/base/mi:1.1087.2.4	Tue Apr 21 05:22:58 2015
+++ src/distrib/sets/lists/base/mi	Thu Apr 23 19:38:11 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1087.2.4 2015/04/21 05:22:58 snj Exp $
+# $NetBSD: mi,v 1.1087.2.5 2015/04/23 19:38:11 snj Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -1239,6 +1239,7 @@
 ./usr/libexec/atf-format			base-obsolete		obsolete
 ./usr/libexec/atf-killpg			base-obsolete		obsolete
 ./usr/libexec/atrun				base-cron-bin
+./usr/libexec/bozohttpd				base-netutil-bin
 ./usr/libexec/ching				base-games-usr
 ./usr/libexec/comsat				base-mail-bin
 ./usr/libexec/cpp0				base-obsolete		obsolete

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1485.2.7 src/distrib/sets/lists/man/mi:1.1485.2.8
--- src/distrib/sets/lists/man/mi:1.1485.2.7	Tue Apr 21 05:22:58 2015
+++ src/distrib/sets/lists/man/mi	Thu Apr 23 19:38:11 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1485.2.7 2015/04/21 05:22:58 snj Exp $
+# $NetBSD: mi,v 1.1485.2.8 2015/04/23 19:38:11 snj Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2326,6 +2326,7 @@
 ./usr/share/man/cat8/bootptest.0		man-bootserver-catman	.cat
 ./usr/share/man/cat8/bootselect.0		man-obsolete		obsolete
 ./usr/share/man/cat8/bounce.0			man-postfix-catman	postfix,.cat
+./usr/share/man/cat8/bozohttpd.0		man-netutil-catman	.cat
 ./usr/share/man/cat8/brconfig.0			man-netutil-catman	.cat
 ./usr/share/man/cat8/btattach.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/btconfig.0			man-sysutil-catman	.cat
@@ -5248,6 +5249,7 @@
 ./usr/share/man/html8/bootpgw.html		man-bootserver-htmlman	html
 ./usr/share/man/html8/bootptest.html		man-bootserver-htmlman	html
 ./usr/share/man/html8/bounce.html		man-postfix-htmlman	postfix,html
+./usr/share/man/html8/bozohttpd.html		man-netutil-htmlman	html
 ./usr/share/man/html8/brconfig.html		man-netutil-htmlman	html
 ./usr/share/man/html8/btattach.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/btconfig.html		man-sysutil-htmlman	html
@@ -8204,6 +8206,7 @@
 ./usr/share/man/man8/bootptest.8		man-bootserver-man	.man
 ./usr/share/man/man8/bootselect.8		man-obsolete		obsolete
 ./usr/share/man/man8/bounce.8			man-postfix-man		postfix,.man
+./usr/share/man/man8/bozohttpd.8		man-netutil-man		.man
 ./usr/share/man/man8/brconfig.8			man-netutil-man		.man
 ./usr/share/man/man8/btattach.8			man-sysutil-man		.man
 ./usr/share/man/man8/btconfig.8			man-sysutil-man		.man

Index: src/libexec/httpd/Makefile
diff -u src/libexec/httpd/Makefile:1.22 src/libexec/httpd/Makefile:1.22.2.1
--- src/libexec/httpd/Makefile:1.22	Tue Jul  8 13:59:39 2014
+++ src/libexec/httpd/Makefile	Thu Apr 23 19:38:11 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2014/07/08 13:59:39 mrg Exp $
+#	$NetBSD: Makefile,v 1.22.2.1 2015/04/23 19:38:11 snj Exp $
 #
 #	$eterna: Makefile,v 1.30 2010/07/11 00:34:27 mrg Exp $
 #
@@ -20,9 +20,10 @@
 #   % make COPTS="-DDO_HTPASSWD"
 
 COPTS+=	-DDO_HTPASSWD
-PROG=	httpd
-MAN=	httpd.8
-BUILDSYMLINKS+=bozohttpd.8 httpd.8
+PROG=	bozohttpd
+LINKS=	${BINDIR}/bozohttpd ${BINDIR}/httpd
+MAN=	bozohttpd.8
+MLINKS+=bozohttpd.8 httpd.8
 SRCS=	bozohttpd.c ssl-bozo.c auth-bozo.c cgi-bozo.c daemon-bozo.c \
 	tilde-luzah-bozo.c dir-index-bozo.c content-bozo.c lua-bozo.c
 SRCS+=	main.c

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.46.4.2 src/libexec/httpd/bozohttpd.8:1.46.4.3
--- src/libexec/httpd/bozohttpd.8:1.46.4.2	Sun Apr 19 04:44:03 2015
+++ src/libexec/httpd/bozohttpd.8	Thu Apr 23 19:38:11 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bozohttpd.8,v 1.46.4.2 2015/04/19 04:44:03 msaitoh Exp $
+.\"	$NetBSD: bozohttpd.8,v 1.46.4.3 2015/04/23 19:38:11 snj Exp $
 .\"
 .\"	$eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\"
@@ -26,11 +26,11 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 20, 2015
-.Dt HTTPD 8
+.Dd April 15, 2015
+.Dt BOZOHTTPD 8
 .Os
 .Sh NAME
-.Nm httpd
+.Nm bozohttpd
 .Nd hyper text transfer protocol version 1.1 daemon
 .Sh SYNOPSIS
 .Nm
@@ -497,11 +497,8 @@ httpd -C .php /usr/pkg/bin/php /var/www
 .Xr inetd.conf 5 ,
 .Xr inetd 8
 .Sh HISTORY
-The
 .Nm
-program is actually called
-.Dq bozohttpd .
-It was first written in perl, based on another perl http server
+was first written in perl, based on another perl http server
 called
 .Dq tinyhttpd .
 It was then rewritten from scratch in perl, and then once again in C.
@@ -513,7 +510,7 @@ The focus has always been simplicity and
 and regular code audits.
 This manual documents
 .Nm
-version 20141225.
+version 20150320.
 .Sh AUTHORS
 .An -nosplit
 .Nm
@@ -546,8 +543,9 @@ provided cgi-bin support fixes, and more
 .It
 .An Alistair G. Crooks
 .Aq Mt a...@netbsd.org
-cleaned up many internal interfaces, made bozohttpd linkable as a
-library and provided the Lua binding.
+cleaned up many internal interfaces, made
+.Nm
+linkable as a library and provided the Lua binding.
 .It
 .An DEGROOTE Arnaud
 .Aq Mt degro...@netbsd.org

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.25 src/libexec/httpd/cgi-bozo.c:1.25.2.1
--- src/libexec/httpd/cgi-bozo.c:1.25	Tue Jun 24 07:23:59 2014
+++ src/libexec/httpd/cgi-bozo.c	Thu Apr 23 19:38:11 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.25 2014/06/24 07:23:59 shm Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.25.2.1 2015/04/23 19:38:11 snj Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -247,7 +247,8 @@ bozo_process_cgi(bozo_httpreq_t *request
 	char	date[40];
 	bozoheaders_t *headp;
 	const char *type, *clen, *info, *cgihandler;
-	char	*query, *s, *t, *path, *env, *command, *file, *url;
+	char	*query, *s, *t, *path, *env, *file, *url;
+	char	command[MAXPATHLEN];
 	char	**envp, **curenvp, *argv[4];
 	char	*uri;
 	size_t	len;
@@ -284,7 +285,6 @@ bozo_process_cgi(bozo_httpreq_t *request
 	path = NULL;
 	envp = NULL;
 	cgihandler = NULL;
-	command = NULL;
 	info = NULL;
 
 	len = strlen(url);
@@ -309,12 +309,13 @@ bozo_process_cgi(bozo_httpreq_t *request
 
 	ix = 0;
 	if (cgihandler) {
-		command = file + 1;
+		snprintf(command, sizeof(command), "%s", file + 1);
 		path = bozostrdup(httpd, cgihandler);
 		argv[ix++] = path;
 			/* argv[] = [ path, command, query, NULL ] */
 	} else {
-		command = file + CGIBIN_PREFIX_LEN + 1;
+		snprintf(command, sizeof(command), "%s",
+		    file + CGIBIN_PREFIX_LEN + 1);
 		if ((s = strchr(command, '/')) != NULL) {
 			info = bozostrdup(httpd, s);
 			*s = '\0';

Reply via email to