Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/88f61eced593
branches:  netbsd-6-0
changeset: 775181:88f61eced593
user:      snj <snj%NetBSD.org@localhost>
date:      Tue Mar 07 07:16:08 2017 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1437):
        libexec/httpd/CHANGES: up to 1.25
        libexec/httpd/bozohttpd.8: up to 1.65
        libexec/httpd/bozohttpd.c: up to 1.86
        libexec/httpd/bozohttpd.h: up to 1.47
        libexec/httpd/cgi-bozo.c: up to 1.37
        libexec/httpd/content-bozo.c: up to 1.14
        libexec/httpd/libbozohttpd/libbozohttpd.3: up to 1.4
        libexec/httpd/main.c: up to 1.16
        libexec/httpd/small/Makefile: up to 1.3
        libexec/httpd/testsuite/Makefile: up to 1.7
        libexec/httpd/testsuite/cgi-bin/empty: up to 1.1
        libexec/httpd/testsuite/html_cmp: up to 1.5
        libexec/httpd/testsuite/t11.in: up to 1.1
        libexec/httpd/testsuite/t11.out: up to 1.1
        libexec/httpd/testsuite/test-bigfile: up to 1.4
        libexec/httpd/testsuite/test-simple: up to 1.4
Update bozohttpd to 20170201.  Changes:
- fix an infinite loop in cgi processing
- fixes and clean up for the testsuite
- no longer sends encoding header for compressed formats
- add a bozo_get_version() function which returns the version number

diffstat:

 libexec/httpd/CHANGES                     |  10 ++++++++-
 libexec/httpd/bozohttpd.8                 |  29 +++++++++++++++++---------
 libexec/httpd/bozohttpd.c                 |  19 +++++++++++++----
 libexec/httpd/bozohttpd.h                 |   6 +++-
 libexec/httpd/cgi-bozo.c                  |  13 ++++++-----
 libexec/httpd/content-bozo.c              |  22 ++++++++++----------
 libexec/httpd/libbozohttpd/libbozohttpd.3 |   6 ++--
 libexec/httpd/main.c                      |  17 +++++++++++++--
 libexec/httpd/small/Makefile              |   2 +-
 libexec/httpd/testsuite/Makefile          |  27 +++++++++++++++++-------
 libexec/httpd/testsuite/html_cmp          |  24 +++++++++++++++-------
 libexec/httpd/testsuite/t11.in            |   3 ++
 libexec/httpd/testsuite/t11.out           |   1 +
 libexec/httpd/testsuite/test-bigfile      |  22 ++++++++++++++++---
 libexec/httpd/testsuite/test-simple       |  33 +++++++++++++++++++++++++++++++
 15 files changed, 172 insertions(+), 62 deletions(-)

diffs (truncated from 579 to 300 lines):

diff -r bcebde988700 -r 88f61eced593 libexec/httpd/CHANGES
--- a/libexec/httpd/CHANGES     Mon Mar 06 08:17:49 2017 +0000
+++ b/libexec/httpd/CHANGES     Tue Mar 07 07:16:08 2017 +0000
@@ -1,4 +1,12 @@
-$eterna: CHANGES,v 1.78 2011/11/18 01:25:11 mrg Exp $
+$NetBSD: CHANGES,v 1.11.6.3 2017/03/07 07:16:08 snj Exp $
+
+changes in bozohttpd 20170201:
+       o  fix an infinite loop in cgi processing
+       o  fixes and clean up for the testsuite
+       o  no longer sends encoding header for compressed formats
+
+changes in bozohttpd 20160517:
+       o  add a bozo_get_version() function which returns the version number
 
 changes in bozohttpd 20160415:
        o  add search-word support for CGI
diff -r bcebde988700 -r 88f61eced593 libexec/httpd/bozohttpd.8
--- a/libexec/httpd/bozohttpd.8 Mon Mar 06 08:17:49 2017 +0000
+++ b/libexec/httpd/bozohttpd.8 Tue Mar 07 07:16:08 2017 +0000
@@ -1,8 +1,8 @@
-.\"    $NetBSD: bozohttpd.8,v 1.32.6.2 2016/04/15 19:38:13 snj Exp $
+.\"    $NetBSD: bozohttpd.8,v 1.32.6.3 2017/03/07 07:16:08 snj Exp $
 .\"
 .\"    $eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\"
-.\" Copyright (c) 1997-2015 Matthew R. Green
+.\" Copyright (c) 1997-2017 Matthew R. Green
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd December 12, 2015
+.Dd February 1, 2017
 .Dt BOZOHTTPD 8
 .Os
 .Sh NAME
@@ -34,7 +34,7 @@
 .Nd hyper text transfer protocol version 1.1 daemon
 .Sh SYNOPSIS
 .Nm
-.Op Fl EHVXefhnsu
+.Op Fl EGHVXefhnsu
 .Op Fl C Ar suffix cgihandler
 .Op Fl I Ar port
 .Op Fl L Ar prefix script
@@ -132,6 +132,10 @@
 flag from
 .Nm
 detaching from the tty and going into the background.
+.It Fl G
+Get the
+.Nm
+version string, print it on standard output, and exit.
 .It Fl H
 Causes directory index mode to hide files and directories
 that start with a period, except for
@@ -186,7 +190,7 @@
 is being accessed.
 The function is passed three tables as arguments, the server
 environment, the request headers, and the decoded query string
-plus any data that was send as application/x-www-form-urlencoded.
+plus any data that was sent as application/x-www-form-urlencoded.
 .It Fl M Ar suffix type encoding encoding11
 Adds a new entry to the table that converts file suffixes to
 content type and encoding.
@@ -272,8 +276,9 @@
 Note that enabling this support implies that users can run
 commands as web server user, this may have security implications.
 .It Fl V
-Sets the default virtual host directory to
-.Ar slashdir .
+Sets the backup virtual host directory to the
+.Ar slashdir
+argument.
 If no directory exists in
 .Ar virtualroot
 for the request, then
@@ -379,7 +384,7 @@
 directory index support (NO_DIRINDEX_SUPPORT),
 daemon mode support (NO_DAEMON_MODE),
 dynamic MIME content (NO_DYNAMIC_CONTENT),
-Lua suport (NO_LUA_SUPPORT),
+Lua support (NO_LUA_SUPPORT),
 and SSL support (NO_SSL_SUPPORT)
 by defining the listed macros when building
 .Nm .
@@ -441,7 +446,7 @@
 on the compiler command line.
 .Ss COMPRESSION
 .Nm
-supports a very basic form compression.
+supports a very basic form of compression.
 .Nm
 will serve the requested file postpended with
 .Dq Pa .gz
@@ -526,7 +531,7 @@
 and regular code audits.
 This manual documents
 .Nm
-version 20150501.
+version 20170201.
 .Sh AUTHORS
 .An -nosplit
 .Nm
@@ -626,6 +631,10 @@
 .Aq Mt jlam%NetBSD.org@localhost
 provided man page fixes
 .It
+.An Dennis Lindroos
+.Aq Mt denafcm%gmail.com@localhost
+provided a cgi-bin fix
+.It
 .An Julio Merino
 .Aq Mt jmmv%NetBSD.org@localhost
 Added the
diff -r bcebde988700 -r 88f61eced593 libexec/httpd/bozohttpd.c
--- a/libexec/httpd/bozohttpd.c Mon Mar 06 08:17:49 2017 +0000
+++ b/libexec/httpd/bozohttpd.c Tue Mar 07 07:16:08 2017 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: bozohttpd.c,v 1.30.6.2 2016/04/15 19:38:13 snj Exp $   */
+/*     $NetBSD: bozohttpd.c,v 1.30.6.3 2017/03/07 07:16:08 snj Exp $   */
 
 /*     $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $      */
 
 /*
- * Copyright (c) 1997-2015 Matthew R. Green
+ * Copyright (c) 1997-2017 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -109,7 +109,7 @@
 #define INDEX_HTML             "index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE                "bozohttpd/20160415"
+#define SERVER_SOFTWARE                "bozohttpd/20170201"
 #endif
 #ifndef DIRECT_ACCESS_FILE
 #define DIRECT_ACCESS_FILE     ".bzdirect"
@@ -1590,6 +1590,7 @@
                debug((httpd, DEBUG_FAT, "open failed: %s", strerror(errno)));
                switch (errno) {
                case EPERM:
+               case EACCES:
                        (void)bozo_http_error(httpd, 403, request,
                                                "no permission to open file");
                        break;
@@ -2242,7 +2243,8 @@
        struct passwd    *pw;
        extern char     **environ;
        static char      *cleanenv[1] = { NULL };
-       uid_t             uid = 0;
+       uid_t             uid;
+       int               uidset = 0;
        char             *chrootdir;
        char             *username;
        char             *portnum;
@@ -2338,6 +2340,7 @@
                        bozoerr(httpd, 1, "setgid(%u): %s", pw->pw_gid,
                                strerror(errno));
                uid = pw->pw_uid;
+               uidset = 1;
        }
        /*
         * handle chroot.
@@ -2352,7 +2355,7 @@
                                strerror(errno));
        }
 
-       if (username != NULL && setuid(uid) == -1)
+       if (uidset && setuid(uid) == -1)
                bozoerr(httpd, 1, "setuid(%d): %s", uid, strerror(errno));
 
        /*
@@ -2374,3 +2377,9 @@
 
        return 1;
 }
+
+int
+bozo_get_version(char *buf, size_t size)
+{
+       return snprintf(buf, size, "%s", SERVER_SOFTWARE);
+}
diff -r bcebde988700 -r 88f61eced593 libexec/httpd/bozohttpd.h
--- a/libexec/httpd/bozohttpd.h Mon Mar 06 08:17:49 2017 +0000
+++ b/libexec/httpd/bozohttpd.h Tue Mar 07 07:16:08 2017 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: bozohttpd.h,v 1.20.6.2 2016/04/15 19:38:13 snj Exp $   */
+/*     $NetBSD: bozohttpd.h,v 1.20.6.3 2017/03/07 07:16:08 snj Exp $   */
 
 /*     $eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $       */
 
 /*
- * Copyright (c) 1997-2015 Matthew R. Green
+ * Copyright (c) 1997-2017 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -367,4 +367,6 @@
 int bozo_set_pref(bozohttpd_t *, bozoprefs_t *, const char *, const char *);
 char *bozo_get_pref(bozoprefs_t *, const char *);
 
+int bozo_get_version(char */*buf*/, size_t /*size*/);
+
 #endif /* BOZOHTTOPD_H_ */
diff -r bcebde988700 -r 88f61eced593 libexec/httpd/cgi-bozo.c
--- a/libexec/httpd/cgi-bozo.c  Mon Mar 06 08:17:49 2017 +0000
+++ b/libexec/httpd/cgi-bozo.c  Tue Mar 07 07:16:08 2017 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: cgi-bozo.c,v 1.20.8.3 2016/04/15 20:19:00 mrg Exp $    */
+/*     $NetBSD: cgi-bozo.c,v 1.20.8.4 2017/03/07 07:16:08 snj Exp $    */
 
 /*     $eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $        */
 
 /*
- * Copyright (c) 1997-2015 Matthew R. Green
+ * Copyright (c) 1997-2017 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -235,7 +235,8 @@
         */
        *args_len = 1;
        /* count '+' in str */
-       for (s = str; (s = strchr(s, '+')); (*args_len)++);
+       for (s = str; (s = strchr(s, '+')); (*args_len)++)
+               s++;
        
        args = bozomalloc(httpd, sizeof(*args) * (*args_len + 1));
  
@@ -333,12 +334,12 @@
 
 parse_err:
 
+       free (str);
        free (*args);
-       free (str);
-       *args = NULL;
+       free(args);
        *args_len = 0;
 
-       return 0;
+       return NULL;
 
 }
 
diff -r bcebde988700 -r 88f61eced593 libexec/httpd/content-bozo.c
--- a/libexec/httpd/content-bozo.c      Mon Mar 06 08:17:49 2017 +0000
+++ b/libexec/httpd/content-bozo.c      Tue Mar 07 07:16:08 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: content-bozo.c,v 1.7.8.2 2016/04/15 19:38:13 snj Exp $ */
+/*     $NetBSD: content-bozo.c,v 1.7.8.3 2017/03/07 07:16:08 snj Exp $ */
 
 /*     $eterna: content-bozo.c,v 1.17 2011/11/18 09:21:15 mrg Exp $    */
 
@@ -62,16 +62,16 @@
        { ".pac",       "application/x-ns-proxy-autoconfig", "",        "", NULL },
        { ".pa",        "application/x-ns-proxy-autoconfig", "",        "", NULL },
        { ".tar",       "multipart/x-tar",              "",             "", NULL },
-       { ".gtar",      "multipart/x-gtar",             "",             "", NULL },
-       { ".tar.Z",     "multipart/x-tar",              "x-compress",   "compress", NULL },
-       { ".tar.gz",    "multipart/x-tar",              "x-gzip",       "gzip", NULL },
-       { ".taz",       "multipart/x-tar",              "x-gzip",       "gzip", NULL },
-       { ".tgz",       "multipart/x-tar",              "x-gzip",       "gzip", NULL },
-       { ".tar.z",     "multipart/x-tar",              "x-pack",       "x-pack", NULL },
-       { ".Z",         "application/x-compress",       "x-compress",   "compress", NULL },
-       { ".gz",        "application/x-gzip",           "x-gzip",       "gzip", NULL },
-       { ".z",         "unknown",                      "x-pack",       "x-pack", NULL },
-       { ".bz2",       "application/x-bzip2",          "x-bzip2",      "x-bzip2", NULL },
+       { ".gtar",      "application/x-gtar-compressed", "",            "", NULL },
+       { ".tar.Z",     "application/x-gtar-compressed", "",            "", NULL },
+       { ".tar.gz",    "application/x-gtar-compressed", "",            "", NULL },
+       { ".taz",       "application/x-gtar-compressed", "",            "", NULL },
+       { ".tgz",       "application/x-gtar-compressed", "",            "", NULL },
+       { ".tar.z",     "application/x-gtar-compressed", "",            "", NULL },
+       { ".Z",         "application/x-compress",       "",             "", NULL },
+       { ".gz",        "application/x-gzip",           "",             "", NULL },
+       { ".z",         "unknown",                      "",             "", NULL },
+       { ".bz2",       "application/x-bzip2",          "",             "", NULL },
        { ".ogg",       "application/x-ogg",            "",             "", NULL },
        { ".mkv",       "video/x-matroska",             "",             "", NULL },
        { ".xbel",      "text/xml",                     "",             "", NULL },
diff -r bcebde988700 -r 88f61eced593 libexec/httpd/libbozohttpd/libbozohttpd.3
--- a/libexec/httpd/libbozohttpd/libbozohttpd.3 Mon Mar 06 08:17:49 2017 +0000
+++ b/libexec/httpd/libbozohttpd/libbozohttpd.3 Tue Mar 07 07:16:08 2017 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: libbozohttpd.3,v 1.1.1.1.14.1 2014/07/09 09:47:11 msaitoh Exp $
+.\" $NetBSD: libbozohttpd.3,v 1.1.1.1.14.2 2017/03/07 07:16:08 snj Exp $
 .\"
 .\" $eterna: libbozohttpd.3,v 1.2 2010/05/10 02:48:23 mrg Exp $
 .\"
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"



Home | Main Index | Thread Index | Old Index