From: Christophe Jaillet Date: Sun, 24 Nov 2019 06:46:13 +0000 (+0000) Subject: Synch 2.4.x and trunk: X-Git-Tag: 2.4.42~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3c3f6806f926c5fd7b6ae9b7c97187c1253f1c3;p=thirdparty%2Fapache%2Fhttpd.git Synch 2.4.x and trunk: Merge r1787229 from trunk - core: print r->uri during failure Merge r1842919 from trunk - core: Call va_end before returning in the error case Merge r1842926 from trunk - mod_cache_disk: fix a Coverity warning Merge r1856490 from trunk - core: Provide TEST_CHAR macro in test_char.h Merge r1862051 from trunk - tag some pools Merge r1864865 from trunk - core: Fix a signed/unsigned comparison that can never match Merge r1865871 from trunk - mod_session: leave a hint about session expiration at TRACE2 Merge r1867256 from trunk - mod_ssl: Fix a typo Submitted by: covener,jorton,jorton,ylavic,jorton,jailletc36,covener,jailletc36 Reviewed by: jailletc36, jim, ylavic Backported by: jailletc36 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1870261 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/mod_cache_disk.c b/modules/cache/mod_cache_disk.c index 52d5dba0b12..ddf16f9c037 100644 --- a/modules/cache/mod_cache_disk.c +++ b/modules/cache/mod_cache_disk.c @@ -994,10 +994,11 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r) } rv = mkdir_structure(conf, dobj->hdrs.file, r->pool); - - rv = apr_file_mktemp(&dobj->vary.tempfd, dobj->vary.tempfile, - APR_CREATE | APR_WRITE | APR_BINARY | APR_EXCL, - dobj->vary.pool); + if (rv == APR_SUCCESS) { + rv = apr_file_mktemp(&dobj->vary.tempfd, dobj->vary.tempfile, + APR_CREATE | APR_WRITE | APR_BINARY | APR_EXCL, + dobj->vary.pool); + } if (rv != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, APLOGNO(00721) diff --git a/modules/loggers/mod_log_forensic.c b/modules/loggers/mod_log_forensic.c index bb808e88887..03c97bbc810 100644 --- a/modules/loggers/mod_log_forensic.c +++ b/modules/loggers/mod_log_forensic.c @@ -123,7 +123,7 @@ static char *log_escape(char *q, const char *e, const char *p) { for ( ; *p ; ++p) { ap_assert(q < e); - if (test_char_table[*(unsigned char *)p]&T_ESCAPE_FORENSIC) { + if (TEST_CHAR(*p, T_ESCAPE_FORENSIC)) { ap_assert(q+2 < e); *q++ = '%'; ap_bin2hex(p, 1, q); diff --git a/modules/lua/mod_lua.c b/modules/lua/mod_lua.c index 6d791995953..05f1e449eb3 100644 --- a/modules/lua/mod_lua.c +++ b/modules/lua/mod_lua.c @@ -216,6 +216,7 @@ static ap_lua_vm_spec *create_vm_spec(apr_pool_t **lifecycle_pool, case AP_LUA_SCOPE_ONCE: case AP_LUA_SCOPE_UNSET: apr_pool_create(&pool, r->pool); + apr_pool_tag(pool, "mod_lua-vm"); break; case AP_LUA_SCOPE_REQUEST: pool = r->pool; @@ -2032,6 +2033,7 @@ static int lua_post_config(apr_pool_t *pconf, apr_pool_t *plog, } pool = (apr_pool_t **)apr_shm_baseaddr_get(lua_ivm_shm); apr_pool_create(pool, pconf); + apr_pool_tag(*pool, "mod_lua-shared"); apr_pool_cleanup_register(pconf, NULL, shm_cleanup_wrapper, apr_pool_cleanup_null); return OK; diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 899a8277377..5a487e7286b 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -1374,6 +1374,7 @@ static void * create_proxy_config(apr_pool_t *p, server_rec *s) ps->source_address = NULL; ps->source_address_set = 0; apr_pool_create_ex(&ps->pool, p, NULL, NULL); + apr_pool_tag(ps->pool, "proxy_server_conf"); return ps; } diff --git a/modules/session/mod_session.c b/modules/session/mod_session.c index 7ee477ce1dd..e62069ae531 100644 --- a/modules/session/mod_session.c +++ b/modules/session/mod_session.c @@ -142,6 +142,7 @@ static apr_status_t ap_session_load(request_rec * r, session_rec ** z) /* invalidate session if session is expired */ if (zz && zz->expiry && zz->expiry < now) { + ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, "session is expired"); zz = NULL; } } diff --git a/modules/ssl/mod_ssl.c b/modules/ssl/mod_ssl.c index 41029e29a24..dc5130648cd 100644 --- a/modules/ssl/mod_ssl.c +++ b/modules/ssl/mod_ssl.c @@ -94,7 +94,7 @@ static const command_rec ssl_config_cmds[] = { "Enable FIPS-140 mode " "(`on', `off')") SSL_CMD_ALL(CipherSuite, TAKE12, - "Colon-delimited list of permitted SSL Ciphers, optional preceeded " + "Colon-delimited list of permitted SSL Ciphers, optional preceded " "by protocol identifier ('XXX:...:XXX' - see manual)") SSL_CMD_SRV(CertificateFile, TAKE1, "SSL Server Certificate file " @@ -187,7 +187,7 @@ static const command_rec ssl_config_cmds[] = { "('[+-][" SSL_PROTOCOLS "] ...' - see manual)") SSL_CMD_PXY(ProxyCipherSuite, TAKE12, "SSL Proxy: colon-delimited list of permitted SSL ciphers " - ", optionally preceeded by protocol specifier ('XXX:...:XXX' - see manual)") + ", optionally preceded by protocol specifier ('XXX:...:XXX' - see manual)") SSL_CMD_PXY(ProxyVerify, TAKE1, "SSL Proxy: whether to verify the remote certificate " "('on' or 'off')") diff --git a/server/core.c b/server/core.c index 48a65ea6c5f..7449d5e39d8 100644 --- a/server/core.c +++ b/server/core.c @@ -4603,7 +4603,7 @@ AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r) } if (!r->uri || ((r->uri[0] != '/') && strcmp(r->uri, "*"))) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00126) - "Invalid URI in request %s", r->the_request); + "Invalid URI in request '%s' '%s'", r->uri, r->the_request); return HTTP_BAD_REQUEST; } diff --git a/server/gen_test_char.c b/server/gen_test_char.c index 48ae6f47d02..cd20577e6aa 100644 --- a/server/gen_test_char.c +++ b/server/gen_test_char.c @@ -167,7 +167,16 @@ int main(int argc, char *argv[]) printf("0x%03x%c", flags, (c < 255) ? ',' : ' '); } - printf("\n};\n"); + printf("\n};\n\n"); + + printf( + "/* we assume the folks using this ensure 0 <= c < 256... which means\n" + " * you need a cast to (unsigned char) first, you can't just plug a\n" + " * char in here and get it to work, because if char is signed then it\n" + " * will first be sign extended.\n" + " */\n" + "#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))\n" + ); return 0; } diff --git a/server/protocol.c b/server/protocol.c index 8d1fdd29219..6864ed0d0a7 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -2036,7 +2036,7 @@ static int r_flush(apr_vformatter_buff_t *buff) AP_DECLARE(int) ap_vrprintf(request_rec *r, const char *fmt, va_list va) { - apr_size_t written; + int written; struct ap_vrprintf_data vd; char vrprintf_buf[AP_IOBUFSIZE]; @@ -2054,7 +2054,7 @@ AP_DECLARE(int) ap_vrprintf(request_rec *r, const char *fmt, va_list va) int n = vd.vbuff.curpos - vrprintf_buf; /* last call to buffer_output, to finish clearing the buffer */ - if (buffer_output(r, vrprintf_buf,n) != APR_SUCCESS) + if (buffer_output(r, vrprintf_buf, n) != APR_SUCCESS) return -1; written += n; @@ -2100,6 +2100,7 @@ AP_DECLARE_NONSTD(int) ap_rvputs(request_rec *r, ...) len = strlen(s); if (buffer_output(r, s, len) != APR_SUCCESS) { + va_end(va); return -1; } diff --git a/server/util.c b/server/util.c index 59027917c0c..d1f3c626514 100644 --- a/server/util.c +++ b/server/util.c @@ -75,13 +75,6 @@ */ #include "test_char.h" -/* we assume the folks using this ensure 0 <= c < 256... which means - * you need a cast to (unsigned char) first, you can't just plug a - * char in here and get it to work, because if char is signed then it - * will first be sign extended. - */ -#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f)) - /* Win32/NetWare/OS2 need to check for both forward and back slashes * in ap_getparents() and ap_escape_url. */