Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/libexec/httpd Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/796890e07477
branches:  netbsd-8
changeset: 446264:796890e07477
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Nov 28 19:50:37 2018 +0000

description:
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.

diffstat:

 libexec/httpd/CHANGES     |   9 ++++++---
 libexec/httpd/bozohttpd.c |  11 ++++++-----
 libexec/httpd/bozohttpd.h |   4 ++--
 libexec/httpd/cgi-bozo.c  |   6 +++---
 libexec/httpd/main.c      |  10 +++++-----
 5 files changed, 22 insertions(+), 18 deletions(-)

diffs (160 lines):

diff -r d87dd9aec2b1 -r 796890e07477 libexec/httpd/CHANGES
--- a/libexec/httpd/CHANGES     Wed Nov 28 05:10:54 2018 +0000
+++ b/libexec/httpd/CHANGES     Wed Nov 28 19:50:37 2018 +0000
@@ -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 martin%netbsd.org@localhost
@@ -9,7 +12,7 @@
           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 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 <agc%netbsd.org@localhost>
        o  fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566325
 
diff -r d87dd9aec2b1 -r 796890e07477 libexec/httpd/bozohttpd.c
--- a/libexec/httpd/bozohttpd.c Wed Nov 28 05:10:54 2018 +0000
+++ b/libexec/httpd/bozohttpd.c Wed Nov 28 19:50:37 2018 +0000
@@ -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 @@
                case '"':
                        if (absolute)
                                goto leave_it;
+                       /*FALLTHROUGH*/
                case '\n':
                case '\r':
                case ' ':
@@ -1026,8 +1027,8 @@
                        d += 3;
                        len += 3;
                        break;
+               default:
                leave_it:
-               default:
                        *d++ = *s++;
                        len++;
                        break;
@@ -1477,7 +1478,6 @@
                             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 @@
 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);
diff -r d87dd9aec2b1 -r 796890e07477 libexec/httpd/bozohttpd.h
--- a/libexec/httpd/bozohttpd.h Wed Nov 28 05:10:54 2018 +0000
+++ b/libexec/httpd/bozohttpd.h Wed Nov 28 19:50:37 2018 +0000
@@ -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 @@
 #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 *);
diff -r d87dd9aec2b1 -r 796890e07477 libexec/httpd/cgi-bozo.c
--- a/libexec/httpd/cgi-bozo.c  Wed Nov 28 05:10:54 2018 +0000
+++ b/libexec/httpd/cgi-bozo.c  Wed Nov 28 19:50:37 2018 +0000
@@ -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 @@
         */
        *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;
diff -r d87dd9aec2b1 -r 796890e07477 libexec/httpd/main.c
--- a/libexec/httpd/main.c      Wed Nov 28 05:10:54 2018 +0000
+++ b/libexec/httpd/main.c      Wed Nov 28 19:50:37 2018 +0000
@@ -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 @@
                        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 @@
                        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;



Home | Main Index | Thread Index | Old Index