]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Synch 2.4.x and trunk:
authorChristophe Jaillet <jailletc36@apache.org>
Sun, 24 Nov 2019 06:46:13 +0000 (06:46 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sun, 24 Nov 2019 06:46:13 +0000 (06:46 +0000)
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

modules/cache/mod_cache_disk.c
modules/loggers/mod_log_forensic.c
modules/lua/mod_lua.c
modules/proxy/mod_proxy.c
modules/session/mod_session.c
modules/ssl/mod_ssl.c
server/core.c
server/gen_test_char.c
server/protocol.c
server/util.c

index 52d5dba0b12e05a9c311b0cfd736aa46248abaa1..ddf16f9c0371dbffadbf39cd49c10e71d22b7254 100644 (file)
@@ -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)
index bb808e88887b74860b05db7621beed4c395d0d76..03c97bbc81081070cb4c3253abf7f932224250bc 100644 (file)
@@ -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);
index 6d791995953ab038d7c923763e4345c8b9fbff50..05f1e449eb38ed015a62f39cae2eeb97aedbce03 100644 (file)
@@ -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;
index 899a8277377fcb1b7ce99f131a6578e8bd304af4..5a487e7286bf919de2e90e9032c534496a78573d 100644 (file)
@@ -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;
 }
index 7ee477ce1dd38d1698ef13bcd33ba2e2e3724643..e62069ae531480417f9e53d24cbec069cdd474d5 100644 (file)
@@ -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;
         }
     }
index 41029e29a241a730ab9415fde1669fa8b095079d..dc5130648cd2766f5422d6aeef446aa775325ef0 100644 (file)
@@ -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')")
index 48a65ea6c5f60c30b968136378d543c25c3cdbbb..7449d5e39d8078548b0181136a30def836d46a29 100644 (file)
@@ -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;
     }
 
index 48ae6f47d02dfc46f4ace8c01eee2c0bf0520312..cd20577e6aaa009598779e85314e33c10021ed28 100644 (file)
@@ -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;
 }
index 8d1fdd29219e523384f8f9d6e151bdc7a7c0eac5..6864ed0d0a72c219ff2f6c77fa48fad1d775a12f 100644 (file)
@@ -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;
         }
 
index 59027917c0ce84ca7c9014652e0bae1ad95a5be6..d1f3c626514843a804cf776c357c5a8509442216 100644 (file)
  */
 #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.
  */