Module Name: src Committed By: martin Date: Wed Nov 28 19:50:37 UTC 2018
Modified Files: src/libexec/httpd [netbsd-8]: CHANGES bozohttpd.c bozohttpd.h cgi-bozo.c main.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1109): libexec/httpd/main.c: revision 1.22 libexec/httpd/CHANGES: revision 1.29 libexec/httpd/cgi-bozo.c: revision 1.45 libexec/httpd/bozohttpd.h: revision 1.57 libexec/httpd/CHANGES: revision 1.30 libexec/httpd/bozohttpd.c: revision 1.97 libexec/httpd/bozohttpd.c: revision 1.98 libexec/httpd/bozohttpd.c: revision 1.99 one semicolon is usually enough. - appease lint - add FALLTHROUGH comment - one return is usually enough. - avoid c99ism. - fix -X option parsing. noted by Rajeev V. Pillai. - add option fixes here. - normalise some messages. To generate a diff of this commit: cvs rdiff -u -r1.25.4.1 -r1.25.4.2 src/libexec/httpd/CHANGES cvs rdiff -u -r1.86.4.2 -r1.86.4.3 src/libexec/httpd/bozohttpd.c cvs rdiff -u -r1.47.4.1 -r1.47.4.2 src/libexec/httpd/bozohttpd.h cvs rdiff -u -r1.37.4.2 -r1.37.4.3 src/libexec/httpd/cgi-bozo.c cvs rdiff -u -r1.16.6.1 -r1.16.6.2 src/libexec/httpd/main.c 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.25.4.1 src/libexec/httpd/CHANGES:1.25.4.2 --- src/libexec/httpd/CHANGES:1.25.4.1 Sat Nov 24 17:13:51 2018 +++ src/libexec/httpd/CHANGES Wed Nov 28 19:50:37 2018 @@ -1,4 +1,7 @@ -$NetBSD: CHANGES,v 1.25.4.1 2018/11/24 17:13:51 martin Exp $ +$NetBSD: CHANGES,v 1.25.4.2 2018/11/28 19:50:37 martin Exp $ + +changes in bozohttpd 20181125: + o fixes for option parsing introduced in bozohttpd 20181123 changes in bozohttpd 20181121: o add url remap support via .bzremap file, from mar...@netbsd.org @@ -9,7 +12,7 @@ changes in bozohttpd 20181121: 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 - o fix special file (.htpasswd, .bz*) bypass. reported by JP. + o fix special file (.htpasswd, .bz*) bypass. reported by JP changes in bozohttpd 20170201: o fix an infinite loop in cgi processing @@ -94,7 +97,7 @@ changes in bozohttpd 20100617: changes in bozohttpd 20100509: o major rework and clean up of internal interfaces. move the main - program into main.c, the remaining parts are useable as library. + program into main.c, the remaining parts are useable as library add bindings for lua. by Alistair G. Crooks <a...@netbsd.org> o fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566325 Index: src/libexec/httpd/bozohttpd.c diff -u src/libexec/httpd/bozohttpd.c:1.86.4.2 src/libexec/httpd/bozohttpd.c:1.86.4.3 --- src/libexec/httpd/bozohttpd.c:1.86.4.2 Sat Nov 24 17:13:51 2018 +++ src/libexec/httpd/bozohttpd.c Wed Nov 28 19:50:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: bozohttpd.c,v 1.86.4.2 2018/11/24 17:13:51 martin Exp $ */ +/* $NetBSD: bozohttpd.c,v 1.86.4.3 2018/11/28 19:50:37 martin Exp $ */ /* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */ @@ -109,7 +109,7 @@ #define INDEX_HTML "index.html" #endif #ifndef SERVER_SOFTWARE -#define SERVER_SOFTWARE "bozohttpd/20181124" +#define SERVER_SOFTWARE "bozohttpd/20181125" #endif #ifndef PUBLIC_HTML #define PUBLIC_HTML "public_html" @@ -1018,6 +1018,7 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, case '"': if (absolute) goto leave_it; + /*FALLTHROUGH*/ case '\n': case '\r': case ' ': @@ -1026,8 +1027,8 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, d += 3; len += 3; break; - leave_it: default: + leave_it: *d++ = *s++; len++; break; @@ -1477,7 +1478,6 @@ check_bzredirect(bozo_httpreq_t *request REDIRECT_FILE) >= sizeof(redir)) { return bozo_http_error(httpd, 404, request, "redirectfile path too long"); - return -1; } if (lstat(redir, &sb) == 0) { if (!S_ISLNK(sb.st_mode)) @@ -1924,8 +1924,9 @@ int bozo_check_special_files(bozo_httpreq_t *request, const char *name) { bozohttpd_t *httpd = request->hr_httpd; + size_t i; - for (size_t i = 0; specials[i].file; i++) + for (i = 0; specials[i].file; i++) if (strcmp(name, specials[i].file) == 0) return bozo_http_error(httpd, 403, request, specials[i].name); Index: src/libexec/httpd/bozohttpd.h diff -u src/libexec/httpd/bozohttpd.h:1.47.4.1 src/libexec/httpd/bozohttpd.h:1.47.4.2 --- src/libexec/httpd/bozohttpd.h:1.47.4.1 Sat Nov 24 17:13:51 2018 +++ src/libexec/httpd/bozohttpd.h Wed Nov 28 19:50:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: bozohttpd.h,v 1.47.4.1 2018/11/24 17:13:51 martin Exp $ */ +/* $NetBSD: bozohttpd.h,v 1.47.4.2 2018/11/28 19:50:37 martin Exp $ */ /* $eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $ */ @@ -407,7 +407,7 @@ void bozo_add_content_map_cgi(bozohttpd_ #endif /* I/O */ -int bozo_printf(bozohttpd_t *, const char *, ...) BOZO_PRINTFLIKE(2, 3);; +int bozo_printf(bozohttpd_t *, const char *, ...) BOZO_PRINTFLIKE(2, 3); ssize_t bozo_read(bozohttpd_t *, int, void *, size_t); ssize_t bozo_write(bozohttpd_t *, int, const void *, size_t); int bozo_flush(bozohttpd_t *, FILE *); Index: src/libexec/httpd/cgi-bozo.c diff -u src/libexec/httpd/cgi-bozo.c:1.37.4.2 src/libexec/httpd/cgi-bozo.c:1.37.4.3 --- src/libexec/httpd/cgi-bozo.c:1.37.4.2 Sat Nov 24 17:13:51 2018 +++ src/libexec/httpd/cgi-bozo.c Wed Nov 28 19:50:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cgi-bozo.c,v 1.37.4.2 2018/11/24 17:13:51 martin Exp $ */ +/* $NetBSD: cgi-bozo.c,v 1.37.4.3 2018/11/28 19:50:37 martin Exp $ */ /* $eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $ */ @@ -234,14 +234,14 @@ parse_search_string(bozo_httpreq_t *requ */ *args_len = 1; /* count '+' in str */ - for (s = str; (s = strchr(s, '+')); (*args_len)++) + for (s = str; (s = strchr(s, '+')) != NULL; (*args_len)++) s++; args = bozomalloc(httpd, sizeof(*args) * (*args_len + 1)); args[0] = str; args[*args_len] = NULL; - for (s = str, i = 0; (s = strchr(s, '+'));) { + for (s = str, i = 0; (s = strchr(s, '+')) != NULL;) { *s = '\0'; s++; args[i++] = s; Index: src/libexec/httpd/main.c diff -u src/libexec/httpd/main.c:1.16.6.1 src/libexec/httpd/main.c:1.16.6.2 --- src/libexec/httpd/main.c:1.16.6.1 Sat Nov 24 17:13:51 2018 +++ src/libexec/httpd/main.c Wed Nov 28 19:50:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.16.6.1 2018/11/24 17:13:51 martin Exp $ */ +/* $NetBSD: main.c,v 1.16.6.2 2018/11/28 19:50:37 martin 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 */ @@ -336,10 +336,6 @@ main(int argc, char **argv) bozo_set_pref(&httpd, &prefs, "enable users", "true"); break; - bozo_set_pref(&httpd, &prefs, "directory indexing", - "true"); - break; - case 'V': bozo_set_pref(&httpd, &prefs, "unknown slash", "true"); break; @@ -352,6 +348,10 @@ main(int argc, char **argv) if (!have_dirindex) goto no_dirindex_support; + bozo_set_pref(&httpd, &prefs, "directory indexing", + "true"); + break; + case 'x': bozo_set_pref(&httpd, &prefs, "index.html", optarg); break;