1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00

Merge r1822857, r1876815, r1893499, r1900024, r1900152, r1900306, r1900559, r1900564, r1900691, r1900694 from trunk:

* Makefile.in (build/config_vars.out): Rebuild if build/config_vars.sh
  has changed.


sort safe_env_lst 
bz 64371


mod_optional_hook_import: debug message at APLOG_DEBUG level.



  *) de-duplicate ALOGNO from code copy.



ab: apr_base64_encode already NUL-terminate the output.

And returns the length including the trailing \0, so setting it at that
length is off by +1.



* Avoid an overflow on large inputs

PR: 66033


dav_get_liveprop_info() returns a long not an int.

Update the type of global_ns accordingly and update the format specifier when this variable is used in printf like functions.

This also aligns code with dav_core_insert_prop() in modules/dav/main/std_liveprop.c

Length computed by count_string() are accumulated in an apr_size_t, so be more consistent and use this data type also in this function.

Fix some typo

[skip ci]

Fix some typos

[skip ci]
Submitted by: jorton, gbechis, ylavic, icing, ylavic, rpluem, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed by: jailletc36, rpluem, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1903618 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Jagielski
2022-08-21 20:26:51 +00:00
parent 9b620d646c
commit 4d37880753
13 changed files with 22 additions and 50 deletions

View File

@@ -128,7 +128,7 @@ install-conf:
fi
# Create a sanitized config_vars.mk
build/config_vars.out: build/config_vars.mk
build/config_vars.out: build/config_vars.mk build/config_vars.sh
@$(SHELL) build/config_vars.sh < build/config_vars.mk > build/config_vars.out
install-build: build/config_vars.out

25
STATUS
View File

@@ -149,31 +149,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
- Makefile.in (build/config_vars.out): Rebuild if build/config_vars.sh has changed
- suexec: sort the 'safe_env_lst' array
- mod_optional_hook_import: debug message at APLOG_DEBUG level
- worker: de-duplicate ALOGNO from code copy
- ab: tweak usage of apr_base64_encode()
- core: Avoid an overflow on large inputs in ap_is_matchexp()
- mod_dav: be more consistent with datatypes
- mod_log_forensic: be more consistent with datatypes
- mod_ssl: fix some typo
- mod_ssl: fix some typo
trunk patch:
https://svn.apache.org/r1822857
https://svn.apache.org/r1876815
https://svn.apache.org/r1893499
https://svn.apache.org/r1900024
https://svn.apache.org/r1900152
https://svn.apache.org/r1900306
https://svn.apache.org/r1900559
https://svn.apache.org/r1900564
https://svn.apache.org/r1900691
https://svn.apache.org/r1900694
2.4.x patch: svn merge -c 1822857,1876815,1893499,1900024,1900152,1900306,1900559,1900564,1900691,1900694 ^/httpd/httpd/trunk .
+1: jailletc36, rpluem, jim
*) mod_heartmonitor: Allow "HeartbeatMaxServers 0"
to use file based storage instead of slotmem.
Needed after setting HeartbeatMaxServers default

View File

@@ -0,0 +1,2 @@
*) core: Avoid an overflow on large inputs in ap_is_matchexp. PR 66033
[Ruediger Pluem]

View File

@@ -104,7 +104,7 @@ AP_DECLARE_HOOK(const char *,ssl_var_lookup,
/**
* Lookup an SSL related variable for the server/connection/request or a global
* value when all those parameters are set to NULL. Pool and name must always be
* provided and the returned value (if not NULL) will be allocated fromt he pool.
* provided and the returned value (if not NULL) will be allocated from the pool.
* @param p The pool to allocate a returned value in, MUST be provided
* @param s The server to inquire a value for, maybe NULL
* @param c The current connection, maybe NULL
@@ -118,7 +118,7 @@ AP_DECLARE(const char *) ap_ssl_var_lookup(apr_pool_t *p, server_rec *s,
/**
* Register to provide certificate/key files for servers. Certificate files are
* exepcted to contain the certificate chain, beginning with the server's certificate,
* expected to contain the certificate chain, beginning with the server's certificate,
* excluding the trust anchor, in PEM format.
* They must be accompanied by a private key file, also in PEM format.
*

View File

@@ -1926,7 +1926,7 @@ static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource,
const char *s;
apr_pool_t *p = resource->info->pool;
const dav_liveprop_spec *info;
int global_ns;
long global_ns;
/* an HTTP-date can be 29 chars plus a null term */
/* a 64-bit size can be 20 chars plus a null term */
@@ -2007,11 +2007,11 @@ static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource,
/* DBG3("FS: inserting lp%d:%s (local %d)", ns, scan->name, scan->ns); */
if (what == DAV_PROP_INSERT_VALUE) {
s = apr_psprintf(p, "<lp%d:%s>%s</lp%d:%s>" DEBUG_CR,
s = apr_psprintf(p, "<lp%ld:%s>%s</lp%ld:%s>" DEBUG_CR,
global_ns, info->name, value, global_ns, info->name);
}
else if (what == DAV_PROP_INSERT_NAME) {
s = apr_psprintf(p, "<lp%d:%s/>" DEBUG_CR, global_ns, info->name);
s = apr_psprintf(p, "<lp%ld:%s/>" DEBUG_CR, global_ns, info->name);
}
else {
/* assert: what == DAV_PROP_INSERT_SUPPORTED */

View File

@@ -146,9 +146,9 @@ typedef struct hlog {
apr_size_t count;
} hlog;
static int count_string(const char *p)
static apr_size_t count_string(const char *p)
{
int n;
apr_size_t n;
for (n = 0 ; *p ; ++p, ++n)
if (TEST_CHAR(*p, T_ESCAPE_FORENSIC))

View File

@@ -798,7 +798,7 @@ const char *ssl_cmd_SSLCipherSuite(cmd_parms *cmd,
return NULL;
}
#endif
return apr_pstrcat(cmd->pool, "procotol '", arg1, "' not supported", NULL);
return apr_pstrcat(cmd->pool, "protocol '", arg1, "' not supported", NULL);
}
#define SSL_FLAGS_CHECK_FILE \
@@ -1556,7 +1556,7 @@ const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *cmd,
return NULL;
}
#endif
return apr_pstrcat(cmd->pool, "procotol '", arg1, "' not supported", NULL);
return apr_pstrcat(cmd->pool, "protocol '", arg1, "' not supported", NULL);
}
const char *ssl_cmd_SSLProxyVerify(cmd_parms *cmd,

View File

@@ -471,7 +471,7 @@ apr_status_t ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
/*
* Support for external a Crypto Device ("engine"), usually
* a hardware accellerator card for crypto operations.
* a hardware accelerator card for crypto operations.
*/
#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
apr_status_t ssl_init_Engine(server_rec *s, apr_pool_t *p)

View File

@@ -21,8 +21,8 @@
static int ImportOptionalHookTestHook(const char *szStr)
{
ap_log_error(APLOG_MARK,APLOG_ERR,OK,NULL, APLOGNO(01866)"Optional hook test said: %s",
szStr);
ap_log_error(APLOG_MARK,APLOG_DEBUG,OK,NULL, APLOGNO(01866)
"Optional hook test said: %s", szStr);
return OK;
}

View File

@@ -1697,7 +1697,7 @@ static void server_main_loop(int remaining_children_to_start)
if (++successive_kills >= 3) {
if (successive_kills % 10 == 3) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0,
ap_server_conf, APLOGNO(10392)
ap_server_conf, APLOGNO(10393)
"children are killed successively!");
}
continue;

View File

@@ -250,10 +250,8 @@ AP_DECLARE(int) ap_os_is_path_absolute(apr_pool_t *p, const char *dir)
AP_DECLARE(int) ap_is_matchexp(const char *str)
{
int x;
for (x = 0; str[x]; x++)
if ((str[x] == '*') || (str[x] == '?'))
for (; *str; str++)
if ((*str == '*') || (*str == '?'))
return 1;
return 0;
}

View File

@@ -2306,7 +2306,6 @@ static apr_status_t open_postfile(const char *pfile)
/* sort out command-line args and call test */
int main(int argc, const char * const argv[])
{
int l;
char tmp[1024];
apr_status_t status;
apr_getopt_t *opt;
@@ -2447,8 +2446,7 @@ int main(int argc, const char * const argv[])
if (apr_base64_encode_len(strlen(opt_arg)) > sizeof(tmp)) {
err("Authentication credentials too long\n");
}
l = apr_base64_encode(tmp, opt_arg, strlen(opt_arg));
tmp[l] = '\0';
apr_base64_encode(tmp, opt_arg, strlen(opt_arg));
auth = apr_pstrcat(cntxt, auth, "Authorization: Basic ", tmp,
"\r\n", NULL);
@@ -2462,8 +2460,7 @@ int main(int argc, const char * const argv[])
if (apr_base64_encode_len(strlen(opt_arg)) > sizeof(tmp)) {
err("Proxy credentials too long\n");
}
l = apr_base64_encode(tmp, opt_arg, strlen(opt_arg));
tmp[l] = '\0';
apr_base64_encode(tmp, opt_arg, strlen(opt_arg));
auth = apr_pstrcat(cntxt, auth, "Proxy-Authorization: Basic ",
tmp, "\r\n", NULL);

View File

@@ -127,15 +127,15 @@ static const char *const safe_env_lst[] =
"REDIRECT_STATUS=",
"REDIRECT_URL=",
"REQUEST_METHOD=",
"REQUEST_URI=",
"REQUEST_SCHEME=",
"REQUEST_URI=",
"SCRIPT_FILENAME=",
"SCRIPT_NAME=",
"SCRIPT_URI=",
"SCRIPT_URL=",
"SERVER_ADDR=",
"SERVER_ADMIN=",
"SERVER_NAME=",
"SERVER_ADDR=",
"SERVER_PORT=",
"SERVER_PROTOCOL=",
"SERVER_SIGNATURE=",