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.