From e380b3cd448d070cf1e3eb97c12584c6e233864a Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 14 Jan 2020 17:39:25 +0000 Subject: [PATCH] Merge r1851332, r1861432, r1862202, r1864759, r1867254, r1867255, r1867569, r1869512 from trunk: 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 | 2 +- STATUS | 20 -------------------- include/httpd.h | 2 +- modules/aaa/mod_auth_form.c | 9 ++++----- modules/aaa/mod_authz_core.c | 22 ++++++++++------------ modules/metadata/mod_mime_magic.c | 13 ++++++------- modules/metadata/mod_remoteip.c | 2 +- modules/ssl/ssl_engine_log.c | 6 ++---- 8 files changed, 25 insertions(+), 51 deletions(-) diff --git a/LICENSE b/LICENSE index 0d72de20206..9c59479d655 100644 --- 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 e1a1ba72316..ff27fddaa24 100644 --- 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 diff --git a/include/httpd.h b/include/httpd.h index 98a410199bd..77d42c62a7c 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -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; diff --git a/modules/aaa/mod_auth_form.c b/modules/aaa/mod_auth_form.c index bea7d512101..ba2baa68493 100644 --- a/modules/aaa/mod_auth_form.c +++ b/modules/aaa/mod_auth_form.c @@ -40,11 +40,10 @@ #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; diff --git a/modules/aaa/mod_authz_core.c b/modules/aaa/mod_authz_core.c index 958511446ef..40e5fe1414a 100644 --- a/modules/aaa/mod_authz_core.c +++ b/modules/aaa/mod_authz_core.c @@ -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 = diff --git a/modules/metadata/mod_mime_magic.c b/modules/metadata/mod_mime_magic.c index c12529acfa1..1c76494c48d 100644 --- a/modules/metadata/mod_mime_magic.c +++ b/modules/metadata/mod_mime_magic.c @@ -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) { diff --git a/modules/metadata/mod_remoteip.c b/modules/metadata/mod_remoteip.c index a0cbc0ff77c..045e9887be3 100644 --- a/modules/metadata/mod_remoteip.c +++ b/modules/metadata/mod_remoteip.c @@ -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, diff --git a/modules/ssl/ssl_engine_log.c b/modules/ssl/ssl_engine_log.c index d2f9ed0aaa8..7dbbbdb55e0 100644 --- a/modules/ssl/ssl_engine_log.c +++ b/modules/ssl/ssl_engine_log.c @@ -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()); -- 2.47.3