NetBSD Problem Report #52375

From www@NetBSD.org  Fri Jul  7 01:07:01 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9F15B7A1FA
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  7 Jul 2017 01:07:01 +0000 (UTC)
Message-Id: <20170707010700.724037A288@mollari.NetBSD.org>
Date: Fri,  7 Jul 2017 01:07:00 +0000 (UTC)
From: edgar@pettijohn-web.com
Reply-To: edgar@pettijohn-web.com
To: gnats-bugs@NetBSD.org
Subject: typo in bozohttpd.8
X-Send-Pr-Version: www-1.0

>Number:         52375
>Category:       misc
>Synopsis:       typo in bozohttpd.8
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 07 01:10:00 +0000 2017
>Closed-Date:    Fri Jul 07 07:06:09 +0000 2017
>Last-Modified:  Sat Nov 24 17:25:05 +0000 2018
>Originator:     Edgar Pettijohn
>Release:        7.1 Thu Jul  6 20:05:27 CDT 2017
>Organization:
>Environment:
NetBSD 7.1 (GENERIC.201703111743Z) amd64
>Description:
typo in bozohttpd.8
>How-To-Repeat:
man httpd
>Fix:
Index: bozohttpd.8
===================================================================
RCS file: /cvsroot/src/libexec/httpd/bozohttpd.8,v
retrieving revision 1.66
diff -u -r1.66 bozohttpd.8
--- bozohttpd.8 3 Jul 2017 21:35:48 -0000       1.66
+++ bozohttpd.8 7 Jul 2017 01:01:44 -0000
@@ -488,7 +488,7 @@
 .Em http://NetBSD.org/
 Otherwise provided schema will be used i.e. symbolic link to
 .Em ftp://NetBSD.org/
-will redirect to provided the URL.
+will redirect to the provided URL.
 .Sh EXAMPLES
 To configure set of virtual hosts, one would use an
 .Xr inetd.conf 5

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Fri, 07 Jul 2017 07:06:09 +0000
State-Changed-Why:
change applied, thanks!


From: "matthew green" <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52375 CVS commit: src/libexec/httpd
Date: Fri, 7 Jul 2017 07:05:49 +0000

 Module Name:	src
 Committed By:	mrg
 Date:		Fri Jul  7 07:05:49 UTC 2017

 Modified Files:
 	src/libexec/httpd: bozohttpd.8

 Log Message:
 fix ordering of a couple of words.  from Edgar Pettijohn in PR#52375.
 thanks!


 To generate a diff of this commit:
 cvs rdiff -u -r1.66 -r1.67 src/libexec/httpd/bozohttpd.8

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52375 CVS commit: [netbsd-8] src/libexec/httpd
Date: Sat, 24 Nov 2018 17:13:51 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Nov 24 17:13:51 UTC 2018

 Modified Files:
 	src/libexec/httpd [netbsd-8]: CHANGES auth-bozo.c bozohttpd.8
 	    bozohttpd.c bozohttpd.h cgi-bozo.c content-bozo.c daemon-bozo.c
 	    dir-index-bozo.c main.c ssl-bozo.c tilde-luzah-bozo.c
 	src/libexec/httpd/lua [netbsd-8]: bozo.lua glue.c optparse.lua
 	src/libexec/httpd/testsuite [netbsd-8]: Makefile html_cmp t3.out t5.out
 	    t6.out test-bigfile test-simple
 Added Files:
 	src/libexec/httpd/testsuite [netbsd-8]: t12.in t12.out t13.in t13.out
 	    t14.in t14.out t15.in t15.out
 	src/libexec/httpd/testsuite/data [netbsd-8]: .bzremap

 Log Message:
 Sync to HEAD (requested by mrg in ticket #1104)

 	libexec/httpd/testsuite/data/.bzremap           up to 1.1
 	libexec/httpd/testsuite/t12.out                 up to 1.1
 	libexec/httpd/testsuite/t12.in                  up to 1.1
 	libexec/httpd/testsuite/t13.out                 up to 1.1
 	libexec/httpd/testsuite/t13.in                  up to 1.1
 	libexec/httpd/testsuite/t14.out                 up to 1.1
 	libexec/httpd/testsuite/t14.in                  up to 1.1
 	libexec/httpd/testsuite/t15.out                 up to 1.1
 	libexec/httpd/testsuite/t15.in                  up to 1.1
 	libexec/httpd/CHANGES                           up to 1.28
 	libexec/httpd/auth-bozo.c                       up to 1.22
 	libexec/httpd/bozohttpd.8                       up to 1.74
 	libexec/httpd/bozohttpd.c                       up to 1.96
 	libexec/httpd/bozohttpd.h                       up to 1.56
 	libexec/httpd/cgi-bozo.c                        up to 1.44
 	libexec/httpd/content-bozo.c                    up to 1.16
 	libexec/httpd/daemon-bozo.c                     up to 1.19
 	libexec/httpd/dir-index-bozo.c                  up to 1.28
 	libexec/httpd/main.c                            up to 1.21
 	libexec/httpd/ssl-bozo.c                        up to 1.25
 	libexec/httpd/tilde-luzah-bozo.c                up to 1.16
 	libexec/httpd/lua/bozo.lua                      up to 1.3
 	libexec/httpd/lua/glue.c                        up to 1.5
 	libexec/httpd/lua/optparse.lua                  up to 1.2
 	libexec/httpd/testsuite/Makefile                up to 1.11
 	libexec/httpd/testsuite/html_cmp                up to 1.6
 	libexec/httpd/testsuite/t3.out                  up to 1.4
 	libexec/httpd/testsuite/t5.out                  up to 1.4
 	libexec/httpd/testsuite/t6.out                  up to 1.4
 	libexec/httpd/testsuite/test-bigfile            up to 1.5
 	libexec/httpd/testsuite/test-simple             up to 1.5

 Cosmetic changes to Lua binding in bozohttpd.

 - Don't use negative indicies to read arguments of Lua functions.
 - On error, return nil, "error string".
 - Use ssize_t for return values from bozo_read() and bozo_write().
 - Prefer lstring especially when if saves you from appending NUL and
   doing len + 1 which can potentially wraparound.
 - Don't mix C allocations with Lua functions marked with "m" in the Lua
   manual. Those functions may throw (longjump) and leak data allocated
   by C function. In one case, I use luaL_Buffer, in the other case,
   I rearranged calls a bit.

 fix ordering of a couple of words.  from Edgar Pettijohn in PR#52375.
 thanks!

 s/u_int/unsigned/.

 from Jan Danielsson.  increases/fixes portability.

 PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
 sometimes with EFAULT due to not NULL terminated environment.

 Document script handler issues with httpd(8).
 From martin@, addressing PR 52194.

 While here, use American spelling consistently and upper-case some
 abbreviations.

 Bump date.

 fix output since protocol agnostic change went in.

 XXX: i thought someone hooked this into atf already, please do :)

 Add support for remapping requested paths via a .bzredirect file.
 Fixes PR 52772. Ok: mrg@

 Bump date

 Remove trailing whitespace.

 use __func__ in debug().

 fix a denial of service attack against header contents, which
 is now bounded at 16KiB.  reported by JP.

 avoid memory leak in sending multiple auth headers.
 mostly mitigated by previous patch to limit total header size,
 but still a real problem here.

 note the changes present in bozohttpd 20181118:

 o  add url remap support via .bzremap file, from martin%netbsd.org@localhost
 o  handle redirections for any protocol, not just http:
 o  fix a denial of service attack against header contents, which
    is now bounded at 16KiB.  reported by JP.

 from CHANGES:

 o  reduce default timeouts, and add expand timeouts to handle the
    initial line, each header, and the total time spent
 o  add -T option to expose new timeout settings
 o  minor RFC fixes related to timeout handling responses

 old timeouts:
 60 seconds for initial request like, 60 seconds per header line,
 and no whole timeout (though the recent total header size changes
 do introduce one that would be about 11 hours.)
 new timeouts:
 30 seconds for initial request like, 10 seconds per header line,
 and a total request time of 600 seconds.

 the new global timeout is implemented using CLOCK_MONOTONIC, with
 a fallback to CLOCK_REALTIME if monotonic time is unavailable.

 reject multiple Host: headers.  besides being protocol standard,
 this closes one additional memory leak found by JP.  add a simple
 test to check this.

 clean up option and usage handling some.

 move some #if support into bozohttpd.h.

 fix previous: have_debug was reversed.

 also fix have_dynamic_content from the previous previous.  re-order
 the debug and dynamic content to match the same pattern as everything
 else so similar problems are less likely in the future.

 - move special files defines into bozohttpd.h, so we can ...
 - consolidate all the special file checks into
   bozo_check_special_files() so that all builds check the same
   list of special files, regardless of build options.
 - convert "(void)bozo_http_error(...); return -1;" into plain
   "return bozo_http_error(...);"
 - fix the call to bozo_check_special_files() to be used on all
   input types.  part of the fixes for failure to reject access
   to /.htpasswd as reported by JP on tech-security.
 - use warn_unused_result attribute on bozo_check_special_files(),
   and fix the failures to return failure.  second part of the
   htpasswd access fix.
 - update testsuite to use a fixed fake hostname.

 call this bozohttpd 20181121.

 two fixes reported by mouse:
 - don't check contents of 'st' if stat(2) failed.
 - round up instead of truncate.  now 10000 byte files say 10kB not 9kB.

 use MAP_SHARED for the bzremap file.  avoids netbsd kernel complaining:

 WARNING: defaulted mmap() share type to MAP_PRIVATE (pid 15478 command bozohttpd)

 many clean ups:
 - keep a list of special files and their human names
 - remove (void) casts on bozo_http_error()
 - fix a few more misuses of bozo_http_error()
 - rename check_mapping() to check_remap() and perform some CSE
 - switch away from ``%s'' to '%s'
 - remove a bunch of #ifdef using new have_feature defines

 alpha sort the option switch.

 add an assert() check on array bounds.

 minor style fixes.  simplify bozo_match_content_map().


 To generate a diff of this commit:
 cvs rdiff -u -r1.25 -r1.25.4.1 src/libexec/httpd/CHANGES
 cvs rdiff -u -r1.18 -r1.18.8.1 src/libexec/httpd/auth-bozo.c
 cvs rdiff -u -r1.65 -r1.65.4.1 src/libexec/httpd/bozohttpd.8
 cvs rdiff -u -r1.86.4.1 -r1.86.4.2 src/libexec/httpd/bozohttpd.c
 cvs rdiff -u -r1.47 -r1.47.4.1 src/libexec/httpd/bozohttpd.h
 cvs rdiff -u -r1.37.4.1 -r1.37.4.2 src/libexec/httpd/cgi-bozo.c
 cvs rdiff -u -r1.14 -r1.14.6.1 src/libexec/httpd/content-bozo.c
 cvs rdiff -u -r1.17 -r1.17.8.1 src/libexec/httpd/daemon-bozo.c
 cvs rdiff -u -r1.25 -r1.25.8.1 src/libexec/httpd/dir-index-bozo.c
 cvs rdiff -u -r1.16 -r1.16.6.1 src/libexec/httpd/main.c
 cvs rdiff -u -r1.22 -r1.22.8.1 src/libexec/httpd/ssl-bozo.c
 cvs rdiff -u -r1.14 -r1.14.8.1 src/libexec/httpd/tilde-luzah-bozo.c
 cvs rdiff -u -r1.2 -r1.2.8.1 src/libexec/httpd/lua/bozo.lua \
     src/libexec/httpd/lua/glue.c
 cvs rdiff -u -r1.1.1.1 -r1.1.1.1.44.1 src/libexec/httpd/lua/optparse.lua
 cvs rdiff -u -r1.7 -r1.7.4.1 src/libexec/httpd/testsuite/Makefile
 cvs rdiff -u -r1.5 -r1.5.6.1 src/libexec/httpd/testsuite/html_cmp
 cvs rdiff -u -r0 -r1.1.4.2 src/libexec/httpd/testsuite/t12.in \
     src/libexec/httpd/testsuite/t12.out src/libexec/httpd/testsuite/t13.in \
     src/libexec/httpd/testsuite/t13.out
 cvs rdiff -u -r0 -r1.1.2.2 src/libexec/httpd/testsuite/t14.in \
     src/libexec/httpd/testsuite/t14.out src/libexec/httpd/testsuite/t15.in \
     src/libexec/httpd/testsuite/t15.out
 cvs rdiff -u -r1.3 -r1.3.38.1 src/libexec/httpd/testsuite/t3.out \
     src/libexec/httpd/testsuite/t5.out src/libexec/httpd/testsuite/t6.out
 cvs rdiff -u -r1.4 -r1.4.4.1 src/libexec/httpd/testsuite/test-bigfile
 cvs rdiff -u -r1.4 -r1.4.10.1 src/libexec/httpd/testsuite/test-simple
 cvs rdiff -u -r0 -r1.1.4.2 src/libexec/httpd/testsuite/data/.bzremap

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52375 CVS commit: [netbsd-7] src/libexec/httpd
Date: Sat, 24 Nov 2018 17:22:59 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Nov 24 17:22:58 UTC 2018

 Modified Files:
 	src/libexec/httpd [netbsd-7]: CHANGES Makefile auth-bozo.c bozohttpd.8
 	    bozohttpd.c bozohttpd.h cgi-bozo.c content-bozo.c daemon-bozo.c
 	    dir-index-bozo.c lua-bozo.c main.c ssl-bozo.c tilde-luzah-bozo.c
 	src/libexec/httpd/libbozohttpd [netbsd-7]: Makefile
 	src/libexec/httpd/lua [netbsd-7]: bozo.lua glue.c optparse.lua
 	src/libexec/httpd/testsuite [netbsd-7]: Makefile html_cmp t3.out t5.out
 	    t6.out test-bigfile test-simple
 Added Files:
 	src/libexec/httpd/testsuite [netbsd-7]: t12.in t12.out t13.in t13.out
 	    t14.in t14.out t15.in t15.out
 	src/libexec/httpd/testsuite/data [netbsd-7]: .bzremap

 Log Message:
 Sync to HEAD (requested by mrg in ticket #1655):

 	libexec/httpd/testsuite/data/.bzremap           up to 1.1
 	libexec/httpd/testsuite/t12.out                 up to 1.1
 	libexec/httpd/testsuite/t12.in                  up to 1.1
 	libexec/httpd/testsuite/t13.out                 up to 1.1
 	libexec/httpd/testsuite/t13.in                  up to 1.1
 	libexec/httpd/testsuite/t14.out                 up to 1.1
 	libexec/httpd/testsuite/t14.in                  up to 1.1
 	libexec/httpd/testsuite/t15.out                 up to 1.1
 	libexec/httpd/testsuite/t15.in                  up to 1.1
 	libexec/httpd/CHANGES                           up to 1.28
 	libexec/httpd/Makefile                          up to 1.27
 	libexec/httpd/auth-bozo.c                       up to 1.22
 	libexec/httpd/bozohttpd.8                       up to 1.74
 	libexec/httpd/bozohttpd.c                       up to 1.96
 	libexec/httpd/bozohttpd.h                       up to 1.56
 	libexec/httpd/cgi-bozo.c                        up to 1.44
 	libexec/httpd/content-bozo.c                    up to 1.16
 	libexec/httpd/daemon-bozo.c                     up to 1.19
 	libexec/httpd/dir-index-bozo.c                  up to 1.28
 	libexec/httpd/lua-bozo.c                        up to 1.15
 	libexec/httpd/main.c                            up to 1.21
 	libexec/httpd/ssl-bozo.c                        up to 1.25
 	libexec/httpd/tilde-luzah-bozo.c                up to 1.16
 	libexec/httpd/libbozohttpd/Makefile             up to 1.3
 	libexec/httpd/lua/bozo.lua                      up to 1.3
 	libexec/httpd/lua/glue.c                        up to 1.5
 	libexec/httpd/lua/optparse.lua                  up to 1.2
 	libexec/httpd/testsuite/Makefile                up to 1.11
 	libexec/httpd/testsuite/html_cmp                up to 1.6
 	libexec/httpd/testsuite/t3.out                  up to 1.4
 	libexec/httpd/testsuite/t5.out                  up to 1.4
 	libexec/httpd/testsuite/t6.out                  up to 1.4
 	libexec/httpd/testsuite/test-bigfile            up to 1.5
 	libexec/httpd/testsuite/test-simple             up to 1.5

 Cosmetic changes to Lua binding in bozohttpd.

 - Don't use negative indicies to read arguments of Lua functions.
 - On error, return nil, "error string".
 - Use ssize_t for return values from bozo_read() and bozo_write().
 - Prefer lstring especially when if saves you from appending NUL and
   doing len + 1 which can potentially wraparound.
 - Don't mix C allocations with Lua functions marked with "m" in the Lua
   manual. Those functions may throw (longjump) and leak data allocated
   by C function. In one case, I use luaL_Buffer, in the other case,
   I rearranged calls a bit.

 fix ordering of a couple of words.  from Edgar Pettijohn in PR#52375.
 thanks!

 s/u_int/unsigned/.

 from Jan Danielsson.  increases/fixes portability.

 PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
 sometimes with EFAULT due to not NULL terminated environment.

 Document script handler issues with httpd(8).
 From martin@, addressing PR 52194.

 While here, use American spelling consistently and upper-case some
 abbreviations.

 Bump date.

 fix output since protocol agnostic change went in.

 XXX: i thought someone hooked this into atf already, please do :)

 Add support for remapping requested paths via a .bzredirect file.
 Fixes PR 52772. Ok: mrg@

 Bump date

 Remove trailing whitespace.

 use __func__ in debug().

 fix a denial of service attack against header contents, which
 is now bounded at 16KiB.  reported by JP.

 avoid memory leak in sending multiple auth headers.
 mostly mitigated by previous patch to limit total header size,
 but still a real problem here.

 note the changes present in bozohttpd 20181118:

 o  add url remap support via .bzremap file, from martin%netbsd.org@localhost
 o  handle redirections for any protocol, not just http:
 o  fix a denial of service attack against header contents, which
    is now bounded at 16KiB.  reported by JP.

 from CHANGES:

 o  reduce default timeouts, and add expand timeouts to handle the
    initial line, each header, and the total time spent
 o  add -T option to expose new timeout settings
 o  minor RFC fixes related to timeout handling responses

 old timeouts:
 60 seconds for initial request like, 60 seconds per header line,
 and no whole timeout (though the recent total header size changes
 do introduce one that would be about 11 hours.)
 new timeouts:
 30 seconds for initial request like, 10 seconds per header line,
 and a total request time of 600 seconds.

 the new global timeout is implemented using CLOCK_MONOTONIC, with
 a fallback to CLOCK_REALTIME if monotonic time is unavailable.

 reject multiple Host: headers.  besides being protocol standard,
 this closes one additional memory leak found by JP.  add a simple
 test to check this.

 clean up option and usage handling some.

 move some #if support into bozohttpd.h.

 fix previous: have_debug was reversed.

 also fix have_dynamic_content from the previous previous.  re-order
 the debug and dynamic content to match the same pattern as everything
 else so similar problems are less likely in the future.

 - move special files defines into bozohttpd.h, so we can ...
 - consolidate all the special file checks into
   bozo_check_special_files() so that all builds check the same
   list of special files, regardless of build options.
 - convert "(void)bozo_http_error(...); return -1;" into plain
   "return bozo_http_error(...);"
 - fix the call to bozo_check_special_files() to be used on all
   input types.  part of the fixes for failure to reject access
   to /.htpasswd as reported by JP on tech-security.
 - use warn_unused_result attribute on bozo_check_special_files(),
   and fix the failures to return failure.  second part of the
   htpasswd access fix.
 - update testsuite to use a fixed fake hostname.

 call this bozohttpd 20181121.

 two fixes reported by mouse:
 - don't check contents of 'st' if stat(2) failed.
 - round up instead of truncate.  now 10000 byte files say 10kB not 9kB.

 use MAP_SHARED for the bzremap file.  avoids netbsd kernel complaining:

 WARNING: defaulted mmap() share type to MAP_PRIVATE (pid 15478 command bozohttpd)

 many clean ups:
 - keep a list of special files and their human names
 - remove (void) casts on bozo_http_error()
 - fix a few more misuses of bozo_http_error()
 - rename check_mapping() to check_remap() and perform some CSE
 - switch away from ``%s'' to '%s'
 - remove a bunch of #ifdef using new have_feature defines

 alpha sort the option switch.

 add an assert() check on array bounds.

 minor style fixes.  simplify bozo_match_content_map().


 To generate a diff of this commit:
 cvs rdiff -u -r1.19.2.5 -r1.19.2.6 src/libexec/httpd/CHANGES
 cvs rdiff -u -r1.22.2.2 -r1.22.2.3 src/libexec/httpd/Makefile
 cvs rdiff -u -r1.13.2.2 -r1.13.2.3 src/libexec/httpd/auth-bozo.c
 cvs rdiff -u -r1.46.4.8 -r1.46.4.9 src/libexec/httpd/bozohttpd.8
 cvs rdiff -u -r1.56.2.9 -r1.56.2.10 src/libexec/httpd/bozohttpd.c
 cvs rdiff -u -r1.33.2.6 -r1.33.2.7 src/libexec/httpd/bozohttpd.h
 cvs rdiff -u -r1.25.2.8 -r1.25.2.9 src/libexec/httpd/cgi-bozo.c
 cvs rdiff -u -r1.10.2.4 -r1.10.2.5 src/libexec/httpd/content-bozo.c
 cvs rdiff -u -r1.16.4.1 -r1.16.4.2 src/libexec/httpd/daemon-bozo.c
 cvs rdiff -u -r1.19.4.2 -r1.19.4.3 src/libexec/httpd/dir-index-bozo.c
 cvs rdiff -u -r1.10.2.2 -r1.10.2.3 src/libexec/httpd/lua-bozo.c
 cvs rdiff -u -r1.8.2.2 -r1.8.2.3 src/libexec/httpd/main.c
 cvs rdiff -u -r1.18.2.1 -r1.18.2.2 src/libexec/httpd/ssl-bozo.c
 cvs rdiff -u -r1.10.4.1 -r1.10.4.2 src/libexec/httpd/tilde-luzah-bozo.c
 cvs rdiff -u -r1.2 -r1.2.10.1 src/libexec/httpd/libbozohttpd/Makefile
 cvs rdiff -u -r1.1.1.1.30.1 -r1.1.1.1.30.2 src/libexec/httpd/lua/bozo.lua \
     src/libexec/httpd/lua/glue.c
 cvs rdiff -u -r1.1.1.1 -r1.1.1.1.30.1 src/libexec/httpd/lua/optparse.lua
 cvs rdiff -u -r1.4.24.3 -r1.4.24.4 src/libexec/httpd/testsuite/Makefile
 cvs rdiff -u -r1.4.18.1 -r1.4.18.2 src/libexec/httpd/testsuite/html_cmp
 cvs rdiff -u -r0 -r1.1.6.2 src/libexec/httpd/testsuite/t12.in \
     src/libexec/httpd/testsuite/t12.out src/libexec/httpd/testsuite/t13.in \
     src/libexec/httpd/testsuite/t13.out
 cvs rdiff -u -r0 -r1.1.4.2 src/libexec/httpd/testsuite/t14.in \
     src/libexec/httpd/testsuite/t14.out src/libexec/httpd/testsuite/t15.in \
     src/libexec/httpd/testsuite/t15.out
 cvs rdiff -u -r1.3 -r1.3.24.1 src/libexec/httpd/testsuite/t3.out \
     src/libexec/httpd/testsuite/t5.out src/libexec/httpd/testsuite/t6.out
 cvs rdiff -u -r1.1.1.1.30.3 -r1.1.1.1.30.4 \
     src/libexec/httpd/testsuite/test-bigfile
 cvs rdiff -u -r1.2.4.3 -r1.2.4.4 src/libexec/httpd/testsuite/test-simple
 cvs rdiff -u -r0 -r1.1.6.2 src/libexec/httpd/testsuite/data/.bzremap

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52375 CVS commit: [netbsd-7-1] src/libexec/httpd
Date: Sat, 24 Nov 2018 17:23:21 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Nov 24 17:23:21 UTC 2018

 Modified Files:
 	src/libexec/httpd [netbsd-7-1]: CHANGES Makefile auth-bozo.c
 	    bozohttpd.8 bozohttpd.c bozohttpd.h cgi-bozo.c content-bozo.c
 	    daemon-bozo.c dir-index-bozo.c lua-bozo.c main.c ssl-bozo.c
 	    tilde-luzah-bozo.c
 	src/libexec/httpd/libbozohttpd [netbsd-7-1]: Makefile
 	src/libexec/httpd/lua [netbsd-7-1]: bozo.lua glue.c optparse.lua
 	src/libexec/httpd/testsuite [netbsd-7-1]: Makefile html_cmp t3.out
 	    t5.out t6.out test-bigfile test-simple
 Added Files:
 	src/libexec/httpd/testsuite [netbsd-7-1]: t12.in t12.out t13.in t13.out
 	    t14.in t14.out t15.in t15.out
 	src/libexec/httpd/testsuite/data [netbsd-7-1]: .bzremap

 Log Message:
 Sync to HEAD (requested by mrg in ticket #1655):

 	libexec/httpd/testsuite/data/.bzremap           up to 1.1
 	libexec/httpd/testsuite/t12.out                 up to 1.1
 	libexec/httpd/testsuite/t12.in                  up to 1.1
 	libexec/httpd/testsuite/t13.out                 up to 1.1
 	libexec/httpd/testsuite/t13.in                  up to 1.1
 	libexec/httpd/testsuite/t14.out                 up to 1.1
 	libexec/httpd/testsuite/t14.in                  up to 1.1
 	libexec/httpd/testsuite/t15.out                 up to 1.1
 	libexec/httpd/testsuite/t15.in                  up to 1.1
 	libexec/httpd/CHANGES                           up to 1.28
 	libexec/httpd/Makefile                          up to 1.27
 	libexec/httpd/auth-bozo.c                       up to 1.22
 	libexec/httpd/bozohttpd.8                       up to 1.74
 	libexec/httpd/bozohttpd.c                       up to 1.96
 	libexec/httpd/bozohttpd.h                       up to 1.56
 	libexec/httpd/cgi-bozo.c                        up to 1.44
 	libexec/httpd/content-bozo.c                    up to 1.16
 	libexec/httpd/daemon-bozo.c                     up to 1.19
 	libexec/httpd/dir-index-bozo.c                  up to 1.28
 	libexec/httpd/lua-bozo.c                        up to 1.15
 	libexec/httpd/main.c                            up to 1.21
 	libexec/httpd/ssl-bozo.c                        up to 1.25
 	libexec/httpd/tilde-luzah-bozo.c                up to 1.16
 	libexec/httpd/libbozohttpd/Makefile             up to 1.3
 	libexec/httpd/lua/bozo.lua                      up to 1.3
 	libexec/httpd/lua/glue.c                        up to 1.5
 	libexec/httpd/lua/optparse.lua                  up to 1.2
 	libexec/httpd/testsuite/Makefile                up to 1.11
 	libexec/httpd/testsuite/html_cmp                up to 1.6
 	libexec/httpd/testsuite/t3.out                  up to 1.4
 	libexec/httpd/testsuite/t5.out                  up to 1.4
 	libexec/httpd/testsuite/t6.out                  up to 1.4
 	libexec/httpd/testsuite/test-bigfile            up to 1.5
 	libexec/httpd/testsuite/test-simple             up to 1.5

 Cosmetic changes to Lua binding in bozohttpd.

 - Don't use negative indicies to read arguments of Lua functions.
 - On error, return nil, "error string".
 - Use ssize_t for return values from bozo_read() and bozo_write().
 - Prefer lstring especially when if saves you from appending NUL and
   doing len + 1 which can potentially wraparound.
 - Don't mix C allocations with Lua functions marked with "m" in the Lua
   manual. Those functions may throw (longjump) and leak data allocated
   by C function. In one case, I use luaL_Buffer, in the other case,
   I rearranged calls a bit.

 fix ordering of a couple of words.  from Edgar Pettijohn in PR#52375.
 thanks!

 s/u_int/unsigned/.

 from Jan Danielsson.  increases/fixes portability.

 PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
 sometimes with EFAULT due to not NULL terminated environment.

 Document script handler issues with httpd(8).
 From martin@, addressing PR 52194.

 While here, use American spelling consistently and upper-case some
 abbreviations.

 Bump date.

 fix output since protocol agnostic change went in.

 XXX: i thought someone hooked this into atf already, please do :)

 Add support for remapping requested paths via a .bzredirect file.
 Fixes PR 52772. Ok: mrg@

 Bump date

 Remove trailing whitespace.

 use __func__ in debug().

 fix a denial of service attack against header contents, which
 is now bounded at 16KiB.  reported by JP.

 avoid memory leak in sending multiple auth headers.
 mostly mitigated by previous patch to limit total header size,
 but still a real problem here.

 note the changes present in bozohttpd 20181118:

 o  add url remap support via .bzremap file, from martin%netbsd.org@localhost
 o  handle redirections for any protocol, not just http:
 o  fix a denial of service attack against header contents, which
    is now bounded at 16KiB.  reported by JP.

 from CHANGES:

 o  reduce default timeouts, and add expand timeouts to handle the
    initial line, each header, and the total time spent
 o  add -T option to expose new timeout settings
 o  minor RFC fixes related to timeout handling responses

 old timeouts:
 60 seconds for initial request like, 60 seconds per header line,
 and no whole timeout (though the recent total header size changes
 do introduce one that would be about 11 hours.)
 new timeouts:
 30 seconds for initial request like, 10 seconds per header line,
 and a total request time of 600 seconds.

 the new global timeout is implemented using CLOCK_MONOTONIC, with
 a fallback to CLOCK_REALTIME if monotonic time is unavailable.

 reject multiple Host: headers.  besides being protocol standard,
 this closes one additional memory leak found by JP.  add a simple
 test to check this.

 clean up option and usage handling some.

 move some #if support into bozohttpd.h.

 fix previous: have_debug was reversed.

 also fix have_dynamic_content from the previous previous.  re-order
 the debug and dynamic content to match the same pattern as everything
 else so similar problems are less likely in the future.

 - move special files defines into bozohttpd.h, so we can ...
 - consolidate all the special file checks into
   bozo_check_special_files() so that all builds check the same
   list of special files, regardless of build options.
 - convert "(void)bozo_http_error(...); return -1;" into plain
   "return bozo_http_error(...);"
 - fix the call to bozo_check_special_files() to be used on all
   input types.  part of the fixes for failure to reject access
   to /.htpasswd as reported by JP on tech-security.
 - use warn_unused_result attribute on bozo_check_special_files(),
   and fix the failures to return failure.  second part of the
   htpasswd access fix.
 - update testsuite to use a fixed fake hostname.

 call this bozohttpd 20181121.

 two fixes reported by mouse:
 - don't check contents of 'st' if stat(2) failed.
 - round up instead of truncate.  now 10000 byte files say 10kB not 9kB.

 use MAP_SHARED for the bzremap file.  avoids netbsd kernel complaining:

 WARNING: defaulted mmap() share type to MAP_PRIVATE (pid 15478 command bozohttpd)

 many clean ups:
 - keep a list of special files and their human names
 - remove (void) casts on bozo_http_error()
 - fix a few more misuses of bozo_http_error()
 - rename check_mapping() to check_remap() and perform some CSE
 - switch away from ``%s'' to '%s'
 - remove a bunch of #ifdef using new have_feature defines

 alpha sort the option switch.

 add an assert() check on array bounds.

 minor style fixes.  simplify bozo_match_content_map().


 To generate a diff of this commit:
 cvs rdiff -u -r1.19.2.5 -r1.19.2.5.2.1 src/libexec/httpd/CHANGES
 cvs rdiff -u -r1.22.2.2 -r1.22.2.2.4.1 src/libexec/httpd/Makefile
 cvs rdiff -u -r1.13.2.2 -r1.13.2.2.4.1 src/libexec/httpd/auth-bozo.c
 cvs rdiff -u -r1.46.4.8 -r1.46.4.8.2.1 src/libexec/httpd/bozohttpd.8
 cvs rdiff -u -r1.56.2.8 -r1.56.2.8.2.1 src/libexec/httpd/bozohttpd.c
 cvs rdiff -u -r1.33.2.6 -r1.33.2.6.2.1 src/libexec/httpd/bozohttpd.h
 cvs rdiff -u -r1.25.2.7.2.1 -r1.25.2.7.2.2 src/libexec/httpd/cgi-bozo.c
 cvs rdiff -u -r1.10.2.4 -r1.10.2.4.2.1 src/libexec/httpd/content-bozo.c
 cvs rdiff -u -r1.16.4.1 -r1.16.4.1.4.1 src/libexec/httpd/daemon-bozo.c
 cvs rdiff -u -r1.19.4.2 -r1.19.4.2.4.1 src/libexec/httpd/dir-index-bozo.c
 cvs rdiff -u -r1.10.2.2 -r1.10.2.2.4.1 src/libexec/httpd/lua-bozo.c
 cvs rdiff -u -r1.8.2.2 -r1.8.2.2.2.1 src/libexec/httpd/main.c
 cvs rdiff -u -r1.18.2.1 -r1.18.2.1.4.1 src/libexec/httpd/ssl-bozo.c
 cvs rdiff -u -r1.10.4.1 -r1.10.4.1.4.1 src/libexec/httpd/tilde-luzah-bozo.c
 cvs rdiff -u -r1.2 -r1.2.20.1 src/libexec/httpd/libbozohttpd/Makefile
 cvs rdiff -u -r1.1.1.1.30.1 -r1.1.1.1.30.1.4.1 src/libexec/httpd/lua/bozo.lua \
     src/libexec/httpd/lua/glue.c
 cvs rdiff -u -r1.1.1.1 -r1.1.1.1.40.1 src/libexec/httpd/lua/optparse.lua
 cvs rdiff -u -r1.4.24.3 -r1.4.24.3.2.1 src/libexec/httpd/testsuite/Makefile
 cvs rdiff -u -r1.4.18.1 -r1.4.18.1.2.1 src/libexec/httpd/testsuite/html_cmp
 cvs rdiff -u -r0 -r1.1.8.2 src/libexec/httpd/testsuite/t12.in \
     src/libexec/httpd/testsuite/t12.out src/libexec/httpd/testsuite/t13.in \
     src/libexec/httpd/testsuite/t13.out
 cvs rdiff -u -r0 -r1.1.6.2 src/libexec/httpd/testsuite/t14.in \
     src/libexec/httpd/testsuite/t14.out src/libexec/httpd/testsuite/t15.in \
     src/libexec/httpd/testsuite/t15.out
 cvs rdiff -u -r1.3 -r1.3.34.1 src/libexec/httpd/testsuite/t3.out \
     src/libexec/httpd/testsuite/t5.out src/libexec/httpd/testsuite/t6.out
 cvs rdiff -u -r1.1.1.1.30.3 -r1.1.1.1.30.3.2.1 \
     src/libexec/httpd/testsuite/test-bigfile
 cvs rdiff -u -r1.2.4.3 -r1.2.4.3.2.1 src/libexec/httpd/testsuite/test-simple
 cvs rdiff -u -r0 -r1.1.8.2 src/libexec/httpd/testsuite/data/.bzremap

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52375 CVS commit: [netbsd-7-0] src/libexec/httpd
Date: Sat, 24 Nov 2018 17:23:48 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Nov 24 17:23:48 UTC 2018

 Modified Files:
 	src/libexec/httpd [netbsd-7-0]: CHANGES Makefile auth-bozo.c
 	    bozohttpd.8 bozohttpd.c bozohttpd.h cgi-bozo.c content-bozo.c
 	    daemon-bozo.c dir-index-bozo.c lua-bozo.c main.c ssl-bozo.c
 	    tilde-luzah-bozo.c
 	src/libexec/httpd/libbozohttpd [netbsd-7-0]: Makefile
 	src/libexec/httpd/lua [netbsd-7-0]: bozo.lua glue.c optparse.lua
 	src/libexec/httpd/testsuite [netbsd-7-0]: Makefile html_cmp t3.out
 	    t5.out t6.out test-bigfile test-simple
 Added Files:
 	src/libexec/httpd/testsuite [netbsd-7-0]: t12.in t12.out t13.in t13.out
 	    t14.in t14.out t15.in t15.out
 	src/libexec/httpd/testsuite/data [netbsd-7-0]: .bzremap

 Log Message:
 Sync to HEAD (requested by mrg in ticket #1655):

 	libexec/httpd/testsuite/data/.bzremap           up to 1.1
 	libexec/httpd/testsuite/t12.out                 up to 1.1
 	libexec/httpd/testsuite/t12.in                  up to 1.1
 	libexec/httpd/testsuite/t13.out                 up to 1.1
 	libexec/httpd/testsuite/t13.in                  up to 1.1
 	libexec/httpd/testsuite/t14.out                 up to 1.1
 	libexec/httpd/testsuite/t14.in                  up to 1.1
 	libexec/httpd/testsuite/t15.out                 up to 1.1
 	libexec/httpd/testsuite/t15.in                  up to 1.1
 	libexec/httpd/CHANGES                           up to 1.28
 	libexec/httpd/Makefile                          up to 1.27
 	libexec/httpd/auth-bozo.c                       up to 1.22
 	libexec/httpd/bozohttpd.8                       up to 1.74
 	libexec/httpd/bozohttpd.c                       up to 1.96
 	libexec/httpd/bozohttpd.h                       up to 1.56
 	libexec/httpd/cgi-bozo.c                        up to 1.44
 	libexec/httpd/content-bozo.c                    up to 1.16
 	libexec/httpd/daemon-bozo.c                     up to 1.19
 	libexec/httpd/dir-index-bozo.c                  up to 1.28
 	libexec/httpd/lua-bozo.c                        up to 1.15
 	libexec/httpd/main.c                            up to 1.21
 	libexec/httpd/ssl-bozo.c                        up to 1.25
 	libexec/httpd/tilde-luzah-bozo.c                up to 1.16
 	libexec/httpd/libbozohttpd/Makefile             up to 1.3
 	libexec/httpd/lua/bozo.lua                      up to 1.3
 	libexec/httpd/lua/glue.c                        up to 1.5
 	libexec/httpd/lua/optparse.lua                  up to 1.2
 	libexec/httpd/testsuite/Makefile                up to 1.11
 	libexec/httpd/testsuite/html_cmp                up to 1.6
 	libexec/httpd/testsuite/t3.out                  up to 1.4
 	libexec/httpd/testsuite/t5.out                  up to 1.4
 	libexec/httpd/testsuite/t6.out                  up to 1.4
 	libexec/httpd/testsuite/test-bigfile            up to 1.5
 	libexec/httpd/testsuite/test-simple             up to 1.5

 Cosmetic changes to Lua binding in bozohttpd.

 - Don't use negative indicies to read arguments of Lua functions.
 - On error, return nil, "error string".
 - Use ssize_t for return values from bozo_read() and bozo_write().
 - Prefer lstring especially when if saves you from appending NUL and
   doing len + 1 which can potentially wraparound.
 - Don't mix C allocations with Lua functions marked with "m" in the Lua
   manual. Those functions may throw (longjump) and leak data allocated
   by C function. In one case, I use luaL_Buffer, in the other case,
   I rearranged calls a bit.

 fix ordering of a couple of words.  from Edgar Pettijohn in PR#52375.
 thanks!

 s/u_int/unsigned/.

 from Jan Danielsson.  increases/fixes portability.

 PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
 sometimes with EFAULT due to not NULL terminated environment.

 Document script handler issues with httpd(8).
 From martin@, addressing PR 52194.

 While here, use American spelling consistently and upper-case some
 abbreviations.

 Bump date.

 fix output since protocol agnostic change went in.

 XXX: i thought someone hooked this into atf already, please do :)

 Add support for remapping requested paths via a .bzredirect file.
 Fixes PR 52772. Ok: mrg@

 Bump date

 Remove trailing whitespace.

 use __func__ in debug().

 fix a denial of service attack against header contents, which
 is now bounded at 16KiB.  reported by JP.

 avoid memory leak in sending multiple auth headers.
 mostly mitigated by previous patch to limit total header size,
 but still a real problem here.

 note the changes present in bozohttpd 20181118:

 o  add url remap support via .bzremap file, from martin%netbsd.org@localhost
 o  handle redirections for any protocol, not just http:
 o  fix a denial of service attack against header contents, which
    is now bounded at 16KiB.  reported by JP.

 from CHANGES:

 o  reduce default timeouts, and add expand timeouts to handle the
    initial line, each header, and the total time spent
 o  add -T option to expose new timeout settings
 o  minor RFC fixes related to timeout handling responses

 old timeouts:
 60 seconds for initial request like, 60 seconds per header line,
 and no whole timeout (though the recent total header size changes
 do introduce one that would be about 11 hours.)
 new timeouts:
 30 seconds for initial request like, 10 seconds per header line,
 and a total request time of 600 seconds.

 the new global timeout is implemented using CLOCK_MONOTONIC, with
 a fallback to CLOCK_REALTIME if monotonic time is unavailable.

 reject multiple Host: headers.  besides being protocol standard,
 this closes one additional memory leak found by JP.  add a simple
 test to check this.

 clean up option and usage handling some.

 move some #if support into bozohttpd.h.

 fix previous: have_debug was reversed.

 also fix have_dynamic_content from the previous previous.  re-order
 the debug and dynamic content to match the same pattern as everything
 else so similar problems are less likely in the future.

 - move special files defines into bozohttpd.h, so we can ...
 - consolidate all the special file checks into
   bozo_check_special_files() so that all builds check the same
   list of special files, regardless of build options.
 - convert "(void)bozo_http_error(...); return -1;" into plain
   "return bozo_http_error(...);"
 - fix the call to bozo_check_special_files() to be used on all
   input types.  part of the fixes for failure to reject access
   to /.htpasswd as reported by JP on tech-security.
 - use warn_unused_result attribute on bozo_check_special_files(),
   and fix the failures to return failure.  second part of the
   htpasswd access fix.
 - update testsuite to use a fixed fake hostname.

 call this bozohttpd 20181121.

 two fixes reported by mouse:
 - don't check contents of 'st' if stat(2) failed.
 - round up instead of truncate.  now 10000 byte files say 10kB not 9kB.

 use MAP_SHARED for the bzremap file.  avoids netbsd kernel complaining:

 WARNING: defaulted mmap() share type to MAP_PRIVATE (pid 15478 command bozohttpd)

 many clean ups:
 - keep a list of special files and their human names
 - remove (void) casts on bozo_http_error()
 - fix a few more misuses of bozo_http_error()
 - rename check_mapping() to check_remap() and perform some CSE
 - switch away from ``%s'' to '%s'
 - remove a bunch of #ifdef using new have_feature defines

 alpha sort the option switch.

 add an assert() check on array bounds.

 minor style fixes.  simplify bozo_match_content_map().


 To generate a diff of this commit:
 cvs rdiff -u -r1.19.2.1.2.3 -r1.19.2.1.2.4 src/libexec/httpd/CHANGES
 cvs rdiff -u -r1.22.2.1.2.1 -r1.22.2.1.2.2 src/libexec/httpd/Makefile
 cvs rdiff -u -r1.13.2.1.2.1 -r1.13.2.1.2.2 src/libexec/httpd/auth-bozo.c
 cvs rdiff -u -r1.46.4.4.2.3 -r1.46.4.4.2.4 src/libexec/httpd/bozohttpd.8
 cvs rdiff -u -r1.56.2.4.2.3 -r1.56.2.4.2.4 src/libexec/httpd/bozohttpd.c
 cvs rdiff -u -r1.33.2.2.2.3 -r1.33.2.2.2.4 src/libexec/httpd/bozohttpd.h
 cvs rdiff -u -r1.25.2.2.2.5 -r1.25.2.2.2.6 src/libexec/httpd/cgi-bozo.c
 cvs rdiff -u -r1.10.2.2.2.2 -r1.10.2.2.2.3 src/libexec/httpd/content-bozo.c
 cvs rdiff -u -r1.16.6.1 -r1.16.6.2 src/libexec/httpd/daemon-bozo.c
 cvs rdiff -u -r1.19.4.1.2.1 -r1.19.4.1.2.2 src/libexec/httpd/dir-index-bozo.c
 cvs rdiff -u -r1.10.2.1.2.1 -r1.10.2.1.2.2 src/libexec/httpd/lua-bozo.c
 cvs rdiff -u -r1.8.4.2 -r1.8.4.3 src/libexec/httpd/main.c
 cvs rdiff -u -r1.18.4.1 -r1.18.4.2 src/libexec/httpd/ssl-bozo.c
 cvs rdiff -u -r1.10.6.1 -r1.10.6.2 src/libexec/httpd/tilde-luzah-bozo.c
 cvs rdiff -u -r1.2 -r1.2.12.1 src/libexec/httpd/libbozohttpd/Makefile
 cvs rdiff -u -r1.1.1.1.32.1 -r1.1.1.1.32.2 src/libexec/httpd/lua/bozo.lua \
     src/libexec/httpd/lua/glue.c
 cvs rdiff -u -r1.1.1.1 -r1.1.1.1.32.1 src/libexec/httpd/lua/optparse.lua
 cvs rdiff -u -r1.4.26.3 -r1.4.26.4 src/libexec/httpd/testsuite/Makefile
 cvs rdiff -u -r1.4.20.1 -r1.4.20.2 src/libexec/httpd/testsuite/html_cmp
 cvs rdiff -u -r0 -r1.1.10.2 src/libexec/httpd/testsuite/t12.in \
     src/libexec/httpd/testsuite/t12.out src/libexec/httpd/testsuite/t13.in \
     src/libexec/httpd/testsuite/t13.out
 cvs rdiff -u -r0 -r1.1.8.2 src/libexec/httpd/testsuite/t14.in \
     src/libexec/httpd/testsuite/t14.out src/libexec/httpd/testsuite/t15.in \
     src/libexec/httpd/testsuite/t15.out
 cvs rdiff -u -r1.3 -r1.3.26.1 src/libexec/httpd/testsuite/t3.out \
     src/libexec/httpd/testsuite/t5.out src/libexec/httpd/testsuite/t6.out
 cvs rdiff -u -r1.1.1.1.32.3 -r1.1.1.1.32.4 \
     src/libexec/httpd/testsuite/test-bigfile
 cvs rdiff -u -r1.2.6.3 -r1.2.6.4 src/libexec/httpd/testsuite/test-simple
 cvs rdiff -u -r0 -r1.1.10.2 src/libexec/httpd/testsuite/data/.bzremap

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.