]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1612945, r1734835, r1738875, r1833416, r1842898, r1867257, r1876745, r1876807...
authorChristophe Jaillet <jailletc36@apache.org>
Fri, 3 Jul 2020 19:53:37 +0000 (19:53 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Fri, 3 Jul 2020 19:53:37 +0000 (19:53 +0000)
Easy patches: synch 2.4.x and trunk
        - core: Re-introduce check for sufficient PCRE version.
        - core: Fix doc string for QualifyRedirectURL
        - mod_proxy: really return an error message on invalid "flusher" value.
        - mod_http2: Remove extra and un-needed ""
        - mod_ldap: fix a (unlikely) memory leak
        - ab: fix a typo
        - suexec: Report error string after failure from setgid/initgroups or setuid
        - mod_session_crypto: be less specific and don't echo passphrase
        - mod_proxy_html: Fix proxy_html_conf.bufsz to have correct type, as
                          it is used with ap_set_int_slot.
        - mod_md: update duplicated APLOGNOs.

Submitted by: fuankg, trawick, ylavic, jailletc36, jorton, jailletc36, jorton, covener, jorton, ylavic
Reviewed by: jailletc36, jim, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1879490 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_proxy_html.c
modules/http2/h2_session.c
modules/ldap/util_ldap_cache_mgr.c
modules/md/mod_md.c
modules/proxy/mod_proxy.c
modules/session/mod_session_crypto.c
server/core.c
server/util_pcre.c
support/ab.c
support/suexec.c

index 25eb3956e594cc58495d76208be836e9d886b417..bb74c0ddf11809ad1275c856bec4fecb70f12c42 100644 (file)
@@ -107,7 +107,7 @@ typedef struct {
     const char *doctype;
     const char *etag;
     unsigned int flags;
-    size_t bufsz;
+    int bufsz;
     apr_hash_t *links;
     apr_array_header_t *events;
     const char *charset_out;
index a2a71ca622097ca7d59d7bbd51da1f0d5b617c54..5a8dd5a4a9989a311c90ed36644a58dcad4f0ecd 100644 (file)
@@ -1285,7 +1285,7 @@ apr_status_t h2_session_set_prio(h2_session *session, h2_stream *stream,
 
         rv = nghttp2_session_change_stream_priority(session->ngh2, stream->id, &ps);
         ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, 
-                      ""H2_STRM_LOG(APLOGNO(03203), stream, 
+                      H2_STRM_LOG(APLOGNO(03203), stream, 
                       "PUSH %s, weight=%d, depends=%d, returned=%d"),
                       ptype, ps.weight, ps.stream_id, rv);
         status = (rv < 0)? APR_EGENERAL : APR_SUCCESS;
index 9bef3f88b4e33b2debc74eea687176d66162943b..aa822bc9b43e5bb9cb5fd77ca2f85cd65d807825 100644 (file)
@@ -280,7 +280,7 @@ void util_ald_cache_purge(util_ald_cache_t *cache)
  */
 util_url_node_t *util_ald_create_caches(util_ldap_state_t *st, const char *url)
 {
-    util_url_node_t curl, *newcurl = NULL;
+    util_url_node_t curl;
     util_ald_cache_t *search_cache;
     util_ald_cache_t *compare_cache;
     util_ald_cache_t *dn_compare_cache;
@@ -313,7 +313,6 @@ util_url_node_t *util_ald_create_caches(util_ldap_state_t *st, const char *url)
 
     /* check that all the caches initialised successfully */
     if (search_cache && compare_cache && dn_compare_cache) {
-
         /* The contents of this structure will be duplicated in shared
            memory during the insert.  So use stack memory rather than
            pool memory to avoid a memory leak. */
@@ -323,11 +322,16 @@ util_url_node_t *util_ald_create_caches(util_ldap_state_t *st, const char *url)
         curl.compare_cache = compare_cache;
         curl.dn_compare_cache = dn_compare_cache;
 
-        newcurl = util_ald_cache_insert(st->util_ldap_cache, &curl);
-
+        return util_ald_cache_insert(st->util_ldap_cache, &curl);
     }
+    else {
+        /* util_ald_destroy_cache is a noop for a NULL argument. */
+        util_ald_destroy_cache(search_cache);
+        util_ald_destroy_cache(compare_cache);
+        util_ald_destroy_cache(dn_compare_cache);
 
-    return newcurl;
+        return NULL;
+    }
 }
 
 
index eea989140af476b3e45112fe99d39e81b6f7d60d..55413f5b67c4db42743a6e4419e30692da0ef048 100644 (file)
@@ -592,7 +592,7 @@ static apr_status_t link_md_to_servers(md_mod_conf_t *mc, md_t *md, server_rec *
                     uri = md_util_schemify(p, s->server_admin, "mailto");
                     if (md_array_str_index(md->contacts, uri, 0, 0) < 0) {
                         APR_ARRAY_PUSH(md->contacts, const char *) = uri;
-                        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, base_server, APLOGNO(10044)
+                        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, base_server, APLOGNO(10237)
                                      "%s: added contact %s", md->name, uri);
                     }
                 }
@@ -1099,7 +1099,7 @@ static apr_status_t get_certificate(server_rec *s, apr_pool_t *p, int fallback,
     }
     else if (sc->assigned->nelts != 1) {
         if (!fallback) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(10042)
+            ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(10238)
                          "conflict: %d MDs match Virtualhost %s which uses SSL, however "
                          "there can be at most 1.",
                          (int)sc->assigned->nelts, s->server_hostname);
index 2521c6511bafd435ddaefb9273f7d92b51486d0c..aa62329b1b32d1a1524a9783e65bee1aed9ad21e 100644 (file)
@@ -308,10 +308,10 @@ static const char *set_worker_param(apr_pool_t *p,
         worker->s->conn_timeout_set = 1;
     }
     else if (!strcasecmp(key, "flusher")) {
-        if (strlen(val) >= sizeof(worker->s->flusher))
-            apr_psprintf(p, "flusher name length must be < %d characters",
-                    (int)sizeof(worker->s->flusher));
-        PROXY_STRNCPY(worker->s->flusher, val);
+        if (PROXY_STRNCPY(worker->s->flusher, val) != APR_SUCCESS) {
+            return apr_psprintf(p, "flusher name length must be < %d characters",
+                                (int)sizeof(worker->s->flusher));
+        }
     }
     else if (!strcasecmp(key, "upgrade")) {
         if (PROXY_STRNCPY(worker->s->upgrade, val) != APR_SUCCESS) {
index 996620d5106e29c32889dcd758c9a20ad1346d6d..1bf2b714d6e51b4db2118e8132bd72c3ea069b0e 100644 (file)
@@ -293,7 +293,7 @@ static apr_status_t encrypt_string(request_rec * r, const apr_crypto_t *f,
             *cipher, APR_MODE_CBC, 1, 4096, f, r->pool);
     if (APR_STATUS_IS_ENOKEY(res)) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01825)
-                "the passphrase '%s' was empty", passphrase);
+                "failure generating key from passphrase");
     }
     if (APR_STATUS_IS_EPADDING(res)) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01826)
@@ -415,7 +415,7 @@ static apr_status_t decrypt_string(request_rec * r, const apr_crypto_t *f,
                                     f, r->pool);
         if (APR_STATUS_IS_ENOKEY(res)) {
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01832)
-                    "the passphrase '%s' was empty", passphrase);
+                    "failure generating key from passphrase");
             continue;
         }
         else if (APR_STATUS_IS_EPADDING(res)) {
index 2ba9e1afa0b3371806214aecaebf454146d4b8d8..bbfe49f2731bef71bbdf162530eac746f0bdebcd 100644 (file)
@@ -4514,8 +4514,8 @@ AP_INIT_FLAG("CGIPassAuth", set_cgi_pass_auth, NULL, OR_AUTHCFG,
 AP_INIT_TAKE2("CGIVar", set_cgi_var, NULL, OR_FILEINFO,
               "Controls how some CGI variables are set"),
 AP_INIT_FLAG("QualifyRedirectURL", set_qualify_redirect_url, NULL, OR_FILEINFO,
-             "Controls whether HTTP authorization headers, normally hidden, will "
-             "be passed to scripts"),
+             "Controls whether the REDIRECT_URL environment variable is fully "
+             "qualified"),
 
 AP_INIT_TAKE1("ForceType", ap_set_string_slot_lower,
        (void *)APR_OFFSETOF(core_dir_config, mime_type), OR_FILEINFO,
index 881987132824456c4d54e24ed14b5b6f5ff2b080..78fc983536d4ba6733f05d20671b86ec9ec38767 100644 (file)
@@ -57,6 +57,11 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "apr_tables.h"
 #include "pcre.h"
 
+/* PCRE_DUPNAMES is only present since version 6.7 of PCRE */
+#ifndef PCRE_DUPNAMES
+#error PCRE Version 6.7 or later required!
+#else
+
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
 
@@ -342,4 +347,6 @@ AP_DECLARE(int) ap_regname(const ap_regex_t *preg,
     return namecount;
 }
 
+#endif /* PCRE_DUPNAMES defined */
+
 /* End of pcreposix.c */
index 8205620994b9d3eab6448a0693384126e8561f85..dc0dc8653bcc134b2506b67b5db3ef9d98e46c82 100644 (file)
@@ -18,7 +18,7 @@
    ** This program is based on ZeusBench V1.0 written by Adam Twiss
    ** which is Copyright (c) 1996 by Zeus Technology Ltd. http://www.zeustech.net/
    **
-   ** This software is provided "as is" and any express or implied waranties,
+   ** This software is provided "as is" and any express or implied warranties,
    ** including but not limited to, the implied warranties of merchantability and
    ** fitness for a particular purpose are disclaimed.  In no event shall
    ** Zeus Technology Ltd. be liable for any direct, indirect, incidental, special,
index ee2dd4b3ad7ebcf8e4edcb80fc6bec1046d550d4..eb2d38a4282b7a151fdd5f2d3171f45587db4e0b 100644 (file)
@@ -502,7 +502,8 @@ int main(int argc, char *argv[])
      * and setgid() to the target group. If unsuccessful, error out.
      */
     if (((setgid(gid)) != 0) || (initgroups(actual_uname, gid) != 0)) {
-        log_err("failed to setgid (%lu: %s)\n", (unsigned long)gid, cmd);
+        log_err("failed to setgid/initgroups (%lu: %s): %s\n",
+                (unsigned long)gid, cmd, strerror(errno));
         exit(109);
     }
 
@@ -510,7 +511,8 @@ int main(int argc, char *argv[])
      * setuid() to the target user.  Error out on fail.
      */
     if ((setuid(uid)) != 0) {
-        log_err("failed to setuid (%lu: %s)\n", (unsigned long)uid, cmd);
+        log_err("failed to setuid (%lu: %s): %s\n",
+                (unsigned long)uid, cmd, strerror(errno));
         exit(110);
     }