]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1851332, r1861432, r1862202, r1864759, r1867254, r1867255, r1867569, r1869512...
authorJim Jagielski <jim@apache.org>
Tue, 14 Jan 2020 17:39:25 +0000 (17:39 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 14 Jan 2020 17:39:25 +0000 (17:39 +0000)
fix a misleading comment about s->defn_name

use the provided types via the macro

* modules/metadata/mod_mime_magic.c: Constify some constant
  data, remove unused "suf_recursion" field.  No functional
  change.

Axe some dead code + slighly improve a comment

Fix a typo

Fix a typo

* modules/ssl/ssl_engine_log.c (ssl_log_cert_error): Use string
  length returned by apr_vsnprintf.  No functional change.

mod_authz_core: follow up to r1864759.

We should at least log the unexpected provider_name == NULL condition.

Submitted by: covener, jorton, jailletc36, jailletc36, jailletc36, jorton, ylavic
Reviewed by: jailletc36, jim, ylavic

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

LICENSE
STATUS
include/httpd.h
modules/aaa/mod_auth_form.c
modules/aaa/mod_authz_core.c
modules/metadata/mod_mime_magic.c
modules/metadata/mod_remoteip.c
modules/ssl/ssl_engine_log.c

diff --git a/LICENSE b/LICENSE
index 0d72de20206bdf5c169ea4453c236916ffd6c0a2..9c59479d6554b399806d96fb5e328a45777df6c8 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -516,7 +516,7 @@ This program is Copyright (C) Zeus Technology Limited 1996.
 This program may be used and copied freely providing this copyright notice
 is not removed.
 
-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, 
diff --git a/STATUS b/STATUS
index e1a1ba72316faaf1abf537a89f3ad0bac2f773c6..ff27fddaa24d282ae45570b9131eb6729b6fc32c 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -132,26 +132,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) Easy patches: synch 2.4.x and trunk
-        - core: Fix a comment
-        - mod_auth_form: use the provided types via the macro
-        - mod_mime_magic: Constify some constant data
-        - mod_authz_core: Axe some dead code + slighly improve a comment
-        - core: Fix a typo
-        - mod_remoteip: Fix a typo
-        - mod_ssl: save a few cycles
-     trunk patch:
-        - http://svn.apache.org/r1851332
-        - http://svn.apache.org/r1861432
-        - http://svn.apache.org/r1862202
-        - http://svn.apache.org/r1864759
-        - http://svn.apache.org/r1867254
-        - http://svn.apache.org/r1867255
-        - http://svn.apache.org/r1867569
-     2.4.x patch: svn merge -c  1851332,1861432,1862202,1864759,1867254,1867255,1867569 ^/httpd/httpd/trunk . 
-     +1: jailletc36, jim
-     ylavic: +1 with r1869512, follow up to r1864759
-
   *) mod_proxy: Fix crash by resolving pool concurrency problems. PR 63503
      trunk patch: http://svn.apache.org/r1822531
                   http://svn.apache.org/r1829676
index 98a410199bdf93315a32a537cd209013af7f815a..77d42c62a7cff1b026a64b3341d4ac6a66c167eb 100644 (file)
@@ -1284,7 +1284,7 @@ struct server_rec {
     /** MIME type info, etc., before we start checking per-directory info */
     struct ap_conf_vector_t *lookup_defaults;
 
-    /** The name of the server */
+    /** The path to the config file that the server was defined in */
     const char *defn_name;
     /** The line of the config file that the server was defined on */
     unsigned defn_line_number;
index bea7d512101c192842503c60d073cd9bb57e063a..ba2baa684936c5c220c67c57b920a40451ad9596 100644 (file)
 #define FORM_REDIRECT_HANDLER "form-redirect-handler"
 #define MOD_AUTH_FORM_HASH "site"
 
-static int (*ap_session_load_fn) (request_rec * r, session_rec ** z) = NULL;
-static apr_status_t (*ap_session_get_fn)(request_rec * r, session_rec * z,
-        const char *key, const char **value) = NULL;
-static apr_status_t (*ap_session_set_fn)(request_rec * r, session_rec * z,
-        const char *key, const char *value) = NULL;
+static APR_OPTIONAL_FN_TYPE(ap_session_load) *ap_session_load_fn = NULL;
+static APR_OPTIONAL_FN_TYPE(ap_session_get)  *ap_session_get_fn = NULL;
+static APR_OPTIONAL_FN_TYPE(ap_session_set)  *ap_session_set_fn = NULL;
+
 static void (*ap_request_insert_filter_fn) (request_rec * r) = NULL;
 static void (*ap_request_remove_filter_fn) (request_rec * r) = NULL;
 
index 958511446efcf187ae0e685938c0f0d7ffcf85c4..40e5fe1414abf449a4d9190d08df5e677eb52fa1 100644 (file)
@@ -193,12 +193,11 @@ static authz_status authz_alias_check_authorization(request_rec *r,
                                                     const void *parsed_require_args)
 {
     const char *provider_name;
-    authz_status ret = AUTHZ_DENIED;
 
     /* Look up the provider alias in the alias list.
-     * Get the dir_config and call ap_Merge_per_dir_configs()
+     * Get the dir_config and call ap_merge_per_dir_configs()
      * Call the real provider->check_authorization() function
-     * return the result of the above function call
+     * Return the result of the above function call
      */
 
     provider_name = apr_table_get(r->notes, AUTHZ_PROVIDER_NAME_NOTE);
@@ -217,6 +216,7 @@ static authz_status authz_alias_check_authorization(request_rec *r,
            configurations and call the real provider */
         if (prvdraliasrec) {
             ap_conf_vector_t *orig_dir_config = r->per_dir_config;
+            authz_status ret;
 
             r->per_dir_config =
                 ap_merge_per_dir_configs(r->pool, orig_dir_config,
@@ -227,18 +227,16 @@ static authz_status authz_alias_check_authorization(request_rec *r,
                                     prvdraliasrec->provider_parsed_args);
 
             r->per_dir_config = orig_dir_config;
+
+            return ret;
         }
-        else {
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02305)
-                          "no alias provider found for '%s' (BUG?)",
-                          provider_name);
-        }
-    }
-    else {
-        ap_assert(provider_name != NULL);
     }
 
-    return ret;
+    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02305)
+                  "no alias provider found for '%s' (BUG?)",
+                  provider_name ? provider_name : "n/a");
+
+    return AUTHZ_DENIED;
 }
 
 static const authz_provider authz_alias_provider =
index c12529acfa1f3f90cb05d91b3db742fa8a54159e..1c76494c48d17334d7df82b4bd962bb28d109a01 100644 (file)
@@ -257,7 +257,7 @@ static int fsmagic(request_rec *r, const char *fn);
 #define L_MAIL    8   /* Electronic mail */
 #define L_NEWS    9   /* Usenet Netnews */
 
-static const char *types[] =
+static const char *const types[] =
 {
     "text/html",             /* HTML */
     "text/plain",            /* "c program text", */
@@ -462,7 +462,6 @@ typedef struct {
 typedef struct {
     magic_rsl *head;          /* result string list */
     magic_rsl *tail;
-    unsigned suf_recursion;   /* recursion depth in suffix check */
 } magic_req_rec;
 
 /*
@@ -2044,12 +2043,12 @@ static int ascmagic(request_rec *r, unsigned char *buf, apr_size_t nbytes)
  * - uncompress old into new, using method, return sizeof new
  */
 
-static struct {
-    char *magic;
+static const struct {
+    const char *magic;
     apr_size_t maglen;
-    char *argv[3];
+    const char *argv[3];
     int silent;
-    char *encoding;  /* MUST be lowercase */
+    const char *encoding;  /* MUST be lowercase */
 } compr[] = {
 
     /* we use gzip here rather than uncompress because we have to pass
@@ -2077,7 +2076,7 @@ static struct {
     },
 };
 
-static int ncompr = sizeof(compr) / sizeof(compr[0]);
+#define ncompr (sizeof(compr) / sizeof(compr[0]))
 
 static int zmagic(request_rec *r, unsigned char *buf, apr_size_t nbytes)
 {
index a0cbc0ff77c8601b85ea8bba6c4ee97398317e87..045e9887be31d1559e4c0dafab9f579b7f73fe59 100644 (file)
@@ -393,7 +393,7 @@ static void remoteip_warn_enable_conflict(remoteip_addr_info *prev, server_rec *
 
     ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, new, APLOGNO(03491)
                  "RemoteIPProxyProtocol: previous setting for %s:%hu from virtual "
-                 "host {%s:%hu in %s} is being overriden by virtual host "
+                 "host {%s:%hu in %s} is being overridden by virtual host "
                  "{%s:%hu in %s}; new setting is '%s'",
                  buf, prev->addr->port, prev->source->server_hostname,
                  prev->source->addrs->host_port, prev->source->defn_name,
index d2f9ed0aaa82979bfc1502f613d94ee69ecafefc..7dbbbdb55e036f72005c1e33b59687a642e92e1c 100644 (file)
@@ -123,10 +123,8 @@ static void ssl_log_cert_error(const char *file, int line, int level,
     int msglen, n;
     char *name;
 
-    apr_vsnprintf(buf, sizeof buf, format, ap);
-
-    msglen = strlen(buf);
-
+    msglen = apr_vsnprintf(buf, sizeof buf, format, ap);
+    
     if (cert) {
         BIO *bio = BIO_new(BIO_s_mem());