Index: build/config_vars.sh.in --- build/config_vars.sh.in.orig 2008-02-05 00:00:07.000000000 +0100 +++ build/config_vars.sh.in 2017-03-03 21:13:53.228964000 +0100 @@ -35,7 +35,7 @@ APU_CONFIG=@APU_CONFIG@ fi -APR_LIBTOOL="`${APR_CONFIG} --apr-libtool`" +APR_LIBTOOL="@prefix@/share/apache/build/libtool" APR_INCLUDEDIR="`${APR_CONFIG} --includedir`" APU_INCLUDEDIR="`${APU_CONFIG} --includedir`" Index: config.layout --- config.layout.orig 2012-02-27 23:57:18.000000000 +0100 +++ config.layout 2017-03-03 21:13:53.229125000 +0100 @@ -50,7 +50,7 @@ iconsdir: ${datadir}/icons htdocsdir: ${datadir}/htdocs manualdir: ${datadir}/manual - cgidir: ${datadir}/cgi-bin + cgidir: ${exec_prefix}/cgi includedir: ${prefix}/include+ localstatedir: ${prefix}/var+ runtimedir: ${localstatedir}/run Index: configure --- configure.orig 2017-01-09 18:36:17.000000000 +0100 +++ configure 2017-03-03 21:13:53.231018000 +0100 @@ -3891,6 +3891,11 @@ as_fn_error $? "APR not found. Please read the documentation." "$LINENO" 5 fi +if test "x${USE_BUNDLED_APR}" != "x" ; then + apr_found=reconfig + apr_config=srclib/apr/apr-1-config +fi + if test "$apr_found" = "reconfig"; then # save our work to this point; this allows the sub-package to use it @@ -4254,6 +4259,11 @@ as_fn_error $? "APR-util not found. Please read the documentation." "$LINENO" 5 fi +if test "x${USE_BUNDLED_APR}" != "x" ; then + apu_found=reconfig + apu_config=srclib/apr-util/apu-1-config +fi + # Catch some misconfigurations: case ${apr_found}.${apu_found} in reconfig.yes) Index: docs/conf/mime.types --- docs/conf/mime.types.orig 2016-06-30 19:10:32.000000000 +0200 +++ docs/conf/mime.types 2018-03-07 20:28:49.818091000 +0100 @@ -1047,14 +1047,14 @@ application/x-font-ghostscript gsf # application/x-font-libgrx application/x-font-linux-psf psf -application/x-font-otf otf +font/opentype otf application/x-font-pcf pcf application/x-font-snf snf # application/x-font-speedo # application/x-font-sunos-news application/x-font-ttf ttf ttc application/x-font-type1 pfa pfb pfm afm -application/x-font-woff woff +application/font-woff woff # application/x-font-vfont application/x-freearc arc application/x-futuresplash spl @@ -1458,6 +1458,7 @@ # text/ulpfec text/uri-list uri uris urls text/vcard vcard +text/vtt vtt # text/vnd.abc text/vnd.curl curl text/vnd.curl.dcurl dcurl @@ -1586,3 +1587,12 @@ video/x-sgi-movie movie video/x-smv smv x-conference/x-cooltalk ice + +text/cache-manifest manifest +application/x-chrome-extension crx +application/x-web-app-manifest+json webapp +text/x-component htc +text/x-markdown markdown md mkd +text/plain ini +application/wasm wasm + Index: docs/docroot/index.html --- docs/docroot/index.html.orig 2004-11-20 21:16:24.000000000 +0100 +++ docs/docroot/index.html 2017-03-03 21:13:53.231435000 +0100 @@ -1 +1,7 @@ -
\n");
- printf(" This is ApacheBench, Version %s <%s>
\n", AP_AB_BASEREVISION, "$Revision: 655654 $");
+ printf(" This is ApacheBench, Version %s <%s>
\n", AP_AB_BASEREVISION, "$Revision: 1430300 $");
printf(" Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
\n");
printf(" Licensed to The Apache Software Foundation, http://www.apache.org/
\n");
printf("
\n"); @@ -1857,12 +1885,16 @@ */ fprintf(stderr, "Options are:\n"); fprintf(stderr, " -n requests Number of requests to perform\n"); - fprintf(stderr, " -c concurrency Number of multiple requests to make\n"); - fprintf(stderr, " -t timelimit Seconds to max. wait for responses\n"); + fprintf(stderr, " -c concurrency Number of multiple requests to make at a time\n"); + fprintf(stderr, " -t timelimit Seconds to max. to spend on benchmarking\n"); + fprintf(stderr, " This implies -n 50000\n"); + fprintf(stderr, " -s timeout Seconds to max. wait for each response\n"); + fprintf(stderr, " Default is 30 seconds\n"); fprintf(stderr, " -b windowsize Size of TCP send/receive buffer, in bytes\n"); + fprintf(stderr, " -B address Address to bind to when making outgoing connections\n"); fprintf(stderr, " -p postfile File containing data to POST. Remember also to set -T\n"); fprintf(stderr, " -u putfile File containing data to PUT. Remember also to set -T\n"); - fprintf(stderr, " -T content-type Content-type header for POSTing, eg.\n"); + fprintf(stderr, " -T content-type Content-type header to use for POST/PUT data, eg.\n"); fprintf(stderr, " 'application/x-www-form-urlencoded'\n"); fprintf(stderr, " Default is 'text/plain'\n"); fprintf(stderr, " -v verbosity How much troubleshooting info to print\n"); @@ -1871,7 +1903,7 @@ fprintf(stderr, " -x attributes String to insert as table attributes\n"); fprintf(stderr, " -y attributes String to insert as tr attributes\n"); fprintf(stderr, " -z attributes String to insert as td or th attributes\n"); - fprintf(stderr, " -C attribute Add cookie, eg. 'Apache=1234. (repeatable)\n"); + fprintf(stderr, " -C attribute Add cookie, eg. 'Apache=1234'. (repeatable)\n"); fprintf(stderr, " -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'\n"); fprintf(stderr, " Inserted after all normal header lines. (repeatable)\n"); fprintf(stderr, " -A attribute Add Basic WWW Authentication, the attributes\n"); @@ -1883,6 +1915,7 @@ fprintf(stderr, " -k Use HTTP KeepAlive feature\n"); fprintf(stderr, " -d Do not show percentiles served table.\n"); fprintf(stderr, " -S Do not show confidence estimators and warnings.\n"); + fprintf(stderr, " -q Do not show progress when doing more than 150 requests\n"); fprintf(stderr, " -g filename Output collected data to gnuplot format file.\n"); fprintf(stderr, " -e filename Output CSV file with percentages served\n"); fprintf(stderr, " -r Don't exit on socket receive errors.\n"); @@ -1918,7 +1951,7 @@ /* split URL into parts */ -static int parse_url(char *url) +static int parse_url(const char *url) { char *cp; char *h; @@ -1949,9 +1982,7 @@ if ((cp = strchr(url, '/')) == NULL) return 1; - h = apr_palloc(cntxt, cp - url + 1); - memcpy(h, url, cp - url); - h[cp - url] = '\0'; + h = apr_pstrmemdup(cntxt, url, cp - url); rv = apr_parse_addr_port(&hostname, &scope_id, &port, h, cntxt); if (rv != APR_SUCCESS || !hostname || scope_id) { return 1; @@ -1988,9 +2019,9 @@ /* ------------------------------------------------------- */ -/* read data to POST from file, save contents and length */ +/* read data to POST/PUT from file, save contents and length */ -static int open_postfile(const char *pfile) +static apr_status_t open_postfile(const char *pfile) { apr_file_t *postfd; apr_finfo_t finfo; @@ -2023,7 +2054,7 @@ return rv; } apr_file_close(postfd); - return 0; + return APR_SUCCESS; } /* ------------------------------------------------------- */ @@ -2031,11 +2062,11 @@ /* sort out command-line args and call test */ int main(int argc, const char * const argv[]) { - int r, l; + int l; char tmp[1024]; apr_status_t status; apr_getopt_t *opt; - const char *optarg; + const char *opt_arg; char c; #ifdef USE_SSL AB_SSL_METHOD_CONST SSL_METHOD *meth = SSLv23_client_method(); @@ -2072,15 +2103,17 @@ } #endif + myhost = NULL; /* 0.0.0.0 or :: */ + apr_getopt_init(&opt, cntxt, argc, argv); - while ((status = apr_getopt(opt, "n:c:t:b:T:p:u:v:rkVhwix:y:z:C:H:P:A:g:X:de:Sq" + while ((status = apr_getopt(opt, "n:c:t:s:b:T:p:u:v:rkVhwix:y:z:C:H:P:A:g:X:de:SqB:" #ifdef USE_SSL "Z:f:" #endif - ,&c, &optarg)) == APR_SUCCESS) { + ,&c, &opt_arg)) == APR_SUCCESS) { switch (c) { case 'n': - requests = atoi(optarg); + requests = atoi(opt_arg); if (requests <= 0) { err("Invalid number of requests\n"); } @@ -2092,76 +2125,77 @@ heartbeatres = 0; break; case 'c': - concurrency = atoi(optarg); + concurrency = atoi(opt_arg); break; case 'b': - windowsize = atoi(optarg); + windowsize = atoi(opt_arg); break; case 'i': - if (posting > 0) - err("Cannot mix POST/PUT and HEAD\n"); - posting = -1; + if (method != NO_METH) + err("Cannot mix HEAD with other methods\n"); + method = HEAD; break; case 'g': - gnuplot = strdup(optarg); + gnuplot = strdup(opt_arg); break; case 'd': percentile = 0; break; case 'e': - csvperc = strdup(optarg); + csvperc = strdup(opt_arg); break; case 'S': confidence = 0; break; + case 's': + aprtimeout = apr_time_from_sec(atoi(opt_arg)); /* timeout value */ + break; case 'p': - if (posting != 0) - err("Cannot mix POST and HEAD\n"); - if (0 == (r = open_postfile(optarg))) { - posting = 1; - } - else if (postdata) { - exit(r); + if (method != NO_METH) + err("Cannot mix POST with other methods\n"); + if (open_postfile(opt_arg) != APR_SUCCESS) { + exit(1); } + method = POST; + send_body = 1; break; case 'u': - if (posting != 0) - err("Cannot mix PUT and HEAD\n"); - if (0 == (r = open_postfile(optarg))) { - posting = 2; - } - else if (postdata) { - exit(r); + if (method != NO_METH) + err("Cannot mix PUT with other methods\n"); + if (open_postfile(opt_arg) != APR_SUCCESS) { + exit(1); } + method = PUT; + send_body = 1; break; case 'r': recverrok = 1; break; case 'v': - verbosity = atoi(optarg); + verbosity = atoi(opt_arg); break; case 't': - tlimit = atoi(optarg); + tlimit = atoi(opt_arg); requests = MAX_REQUESTS; /* need to size data array on * something */ break; case 'T': - strcpy(content_type, optarg); + strcpy(content_type, opt_arg); break; case 'C': - cookie = apr_pstrcat(cntxt, "Cookie: ", optarg, "\r\n", NULL); + cookie = apr_pstrcat(cntxt, "Cookie: ", opt_arg, "\r\n", NULL); break; case 'A': /* * assume username passwd already to be in colon separated form. * Ready to be uu-encoded. */ - while (apr_isspace(*optarg)) - optarg++; - if (apr_base64_encode_len(strlen(optarg)) > sizeof(tmp)) { + while (apr_isspace(*opt_arg)) + opt_arg++; + if (apr_base64_encode_len(strlen(opt_arg)) > sizeof(tmp)) { err("Authentication credentials too long\n"); } - l = apr_base64_encode(tmp, optarg, strlen(optarg)); + l = apr_base64_encode(tmp, opt_arg, strlen(opt_arg)); tmp[l] = '\0'; auth = apr_pstrcat(cntxt, auth, "Authorization: Basic ", tmp, @@ -2171,27 +2205,27 @@ /* * assume username passwd already to be in colon separated form. */ - while (apr_isspace(*optarg)) - optarg++; - if (apr_base64_encode_len(strlen(optarg)) > sizeof(tmp)) { + while (apr_isspace(*opt_arg)) + opt_arg++; + if (apr_base64_encode_len(strlen(opt_arg)) > sizeof(tmp)) { err("Proxy credentials too long\n"); } - l = apr_base64_encode(tmp, optarg, strlen(optarg)); + l = apr_base64_encode(tmp, opt_arg, strlen(opt_arg)); tmp[l] = '\0'; auth = apr_pstrcat(cntxt, auth, "Proxy-Authorization: Basic ", tmp, "\r\n", NULL); break; case 'H': - hdrs = apr_pstrcat(cntxt, hdrs, optarg, "\r\n", NULL); + hdrs = apr_pstrcat(cntxt, hdrs, opt_arg, "\r\n", NULL); /* * allow override of some of the common headers that ab adds */ - if (strncasecmp(optarg, "Host:", 5) == 0) { + if (strncasecmp(opt_arg, "Host:", 5) == 0) { opt_host = 1; - } else if (strncasecmp(optarg, "Accept:", 7) == 0) { + } else if (strncasecmp(opt_arg, "Accept:", 7) == 0) { opt_accept = 1; - } else if (strncasecmp(optarg, "User-Agent:", 11) == 0) { + } else if (strncasecmp(opt_arg, "User-Agent:", 11) == 0) { opt_useragent = 1; } break; @@ -2204,7 +2238,7 @@ */ case 'x': use_html = 1; - tablestring = optarg; + tablestring = opt_arg; break; case 'X': { @@ -2212,22 +2246,22 @@ /* * assume proxy-name[:port] */ - if ((p = strchr(optarg, ':'))) { + if ((p = strchr(opt_arg, ':'))) { *p = '\0'; p++; proxyport = atoi(p); } - strcpy(proxyhost, optarg); + strcpy(proxyhost, opt_arg); isproxy = 1; } break; case 'y': use_html = 1; - trstring = optarg; + trstring = opt_arg; break; case 'z': use_html = 1; - tdstring = optarg; + tdstring = opt_arg; break; case 'h': usage(argv[0]); @@ -2235,28 +2269,31 @@ case 'V': copyright(); return 0; + case 'B': + myhost = apr_pstrdup(cntxt, opt_arg); + break; #ifdef USE_SSL case 'Z': - ssl_cipher = strdup(optarg); + ssl_cipher = strdup(opt_arg); break; case 'f': - if (strncasecmp(optarg, "ALL", 3) == 0) { + if (strncasecmp(opt_arg, "ALL", 3) == 0) { meth = SSLv23_client_method(); #ifndef OPENSSL_NO_SSL2 - } else if (strncasecmp(optarg, "SSL2", 4) == 0) { + } else if (strncasecmp(opt_arg, "SSL2", 4) == 0) { meth = SSLv2_client_method(); #endif #ifndef OPENSSL_NO_SSL3 - } else if (strncasecmp(optarg, "SSL3", 4) == 0) { + } else if (strncasecmp(opt_arg, "SSL3", 4) == 0) { meth = SSLv3_client_method(); #endif #ifdef HAVE_TLSV1_X - } else if (strncasecmp(optarg, "TLS1.1", 6) == 0) { + } else if (strncasecmp(opt_arg, "TLS1.1", 6) == 0) { meth = TLSv1_1_client_method(); - } else if (strncasecmp(optarg, "TLS1.2", 6) == 0) { + } else if (strncasecmp(opt_arg, "TLS1.2", 6) == 0) { meth = TLSv1_2_client_method(); #endif - } else if (strncasecmp(optarg, "TLS1", 4) == 0) { + } else if (strncasecmp(opt_arg, "TLS1", 4) == 0) { meth = TLSv1_client_method(); } break; @@ -2269,6 +2306,10 @@ usage(argv[0]); } + if (method == NO_METH) { + method = GET; + } + if (parse_url(apr_pstrdup(cntxt, opt->argv[opt->ind++]))) { fprintf(stderr, "%s: invalid URL\n", argv[0]); usage(argv[0]); @@ -2312,6 +2353,10 @@ exit(1); } SSL_CTX_set_options(ssl_ctx, SSL_OP_ALL); +#ifdef SSL_MODE_RELEASE_BUFFERS + /* Keep memory usage as low as possible */ + SSL_CTX_set_mode (ssl_ctx, SSL_MODE_RELEASE_BUFFERS); +#endif if (ssl_cipher != NULL) { if (!SSL_CTX_set_cipher_list(ssl_ctx, ssl_cipher)) { fprintf(stderr, "error setting cipher list [%s]\n", ssl_cipher); Index: support/apachectl.in --- support/apachectl.in.orig 2006-07-12 05:38:44.000000000 +0200 +++ support/apachectl.in 2017-03-03 21:13:53.232983000 +0100 @@ -43,11 +43,6 @@ # the path to your httpd binary, including options if necessary HTTPD='@exp_sbindir@/@progname@' # -# pick up any necessary environment variables -if test -f @exp_sbindir@/envvars; then - . @exp_sbindir@/envvars -fi -# # a command that outputs a formatted text version of the HTML at the # url given on the command line. Designed for lynx, however other # programs may work. Index: support/apxs.in --- support/apxs.in.orig 2010-05-10 22:02:56.000000000 +0200 +++ support/apxs.in 2017-03-03 21:13:53.233161000 +0100 @@ -80,6 +80,7 @@ # the "+" metacharacter at the format string to allow a list to be built by # subsequent occurrences of the same option. sub Getopts { + no warnings 'deprecated'; my ($argumentative, @ARGV) = @_; my $errs = 0; local $_; @@ -189,9 +190,6 @@ my $httpd = get_vars("sbindir") . "/" . get_vars("progname"); $httpd = eval qq("$httpd"); $httpd = eval qq("$httpd"); -my $envvars = get_vars("sbindir") . "/envvars"; -$envvars = eval qq("$envvars"); -$envvars = eval qq("$envvars"); #allow apxs to be run from the source tree, before installation if ($0 =~ m:support/apxs$:) { @@ -203,7 +201,7 @@ exit 1; } -unless (grep /mod_so/, `. $envvars && $httpd -l`) { +unless (grep /mod_so/, `$httpd -l`) { error("Sorry, no shared object support for Apache"); error("available under your platform. Make sure"); error("the Apache module mod_so is compiled into"); @@ -337,8 +335,7 @@ exit(1); } -my $libtool = `$apr_config --apr-libtool`; -chomp($libtool); +my $libtool = "$prefix/share/apache/build/libtool"; my $apr_includedir = `$apr_config --includes`; chomp($apr_includedir); Index: support/htdigest.c --- support/htdigest.c.orig 2013-04-26 16:58:20.000000000 +0200 +++ support/htdigest.c 2017-03-03 21:13:53.233337000 +0100 @@ -122,7 +122,7 @@ } -static void add_password(const char *user, const char *realm, apr_file_t *f) +static void add_password(const char *user, const char *realm, const char *pw0, apr_file_t *f) { char *pw; apr_md5_ctx_t context; @@ -133,6 +133,9 @@ unsigned int i; apr_size_t len = sizeof(pwin); + if (pw0 != NULL) + pw = pw0; + else { if (apr_password_get("New password: ", pwin, &len) != APR_SUCCESS) { apr_file_printf(errfile, "password too long"); cleanup_tempfile_and_exit(5); @@ -144,6 +147,7 @@ cleanup_tempfile_and_exit(1); } pw = pwin; + } apr_file_printf(f, "%s:%s:", user, realm); /* Do MD5 stuff */ @@ -164,7 +168,7 @@ static void usage(void) { - apr_file_printf(errfile, "Usage: htdigest [-c] passwordfile realm username\n"); + apr_file_printf(errfile, "Usage: htdigest [-c] passwordfile realm username [password]\n"); apr_file_printf(errfile, "The -c flag creates a new file.\n"); exit(1); } @@ -191,6 +195,8 @@ char *dirname; char user[MAX_STRING_LEN]; char realm[MAX_STRING_LEN]; + char *password = NULL; + char passwordb[MAX_STRING_LEN]; char line[3 * MAX_STRING_LEN]; char l[3 * MAX_STRING_LEN]; char w[MAX_STRING_LEN]; @@ -212,9 +218,7 @@ #endif apr_signal(SIGINT, (void (*)(int)) interrupted); - if (argc == 5) { - if (strcmp(argv[1], "-c")) - usage(); + if ((argc == 5 || argc == 6) && strcmp(argv[1], "-c") == 0) { rv = apr_file_open(&f, argv[2], APR_WRITE | APR_CREATE, APR_OS_DEFAULT, cntxt); if (rv != APR_SUCCESS) { @@ -225,15 +229,19 @@ apr_strerror(rv, errmsg, sizeof errmsg)); exit(1); } + if (argc == 6) { + apr_cpystrn(passwordb, argv[5], sizeof(passwordb)); + password = passwordb; + } apr_cpystrn(user, argv[4], sizeof(user)); apr_cpystrn(realm, argv[3], sizeof(realm)); apr_file_printf(errfile, "Adding password for %s in realm %s.\n", user, realm); - add_password(user, realm, f); + add_password(user, realm, password, f); apr_file_close(f); exit(0); } - else if (argc != 4) + else if (argc != 4 && argc != 5) usage(); if (apr_temp_dir_get((const char**)&dirname, cntxt) != APR_SUCCESS) { @@ -256,6 +264,10 @@ } apr_cpystrn(user, argv[3], sizeof(user)); apr_cpystrn(realm, argv[2], sizeof(realm)); + if (argc == 5) { + apr_cpystrn(passwordb, argv[4], sizeof(passwordb)); + password = passwordb; + } found = 0; while (!(get_line(line, sizeof(line), f))) { @@ -273,13 +285,13 @@ else { apr_file_printf(errfile, "Changing password for user %s in realm %s\n", user, realm); - add_password(user, realm, tfp); + add_password(user, realm, password, tfp); found = 1; } } if (!found) { apr_file_printf(errfile, "Adding user %s in realm %s\n", user, realm); - add_password(user, realm, tfp); + add_password(user, realm, password, tfp); } apr_file_close(f); Index: server/core.c --- server/core.c +++ server/core.c @@ -1809,6 +1809,12 @@ AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, /* method has not been registered yet, but resorce restriction * is always checked before method handling, so register it. */ + if (cmd->pool == cmd->temp_pool) { + /* In .htaccess, we can't globally register new methods. */ + return apr_psprintf(cmd->pool, "Could not register method '%s' " + "for %s from .htaccess configuration", + method, cmd->cmd->name); + } methnum = ap_method_register(cmd->pool, method); }