From 16e8d752336b4300e840b50e4e8604f1fea529c5 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Mon, 23 Jul 2018 13:43:03 +0100
Subject: [PATCH 001/231] Wording updates.
---
httpd.service.xml | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/httpd.service.xml b/httpd.service.xml
index e079ca2..4a6038d 100644
--- a/httpd.service.xml
+++ b/httpd.service.xml
@@ -56,8 +56,8 @@
This manual page describes the systemd
unit files used to integrate the httpd daemon
- with systemd. Two unit files are available:
- httpd.service allows the
+ with systemd. Two main unit files are
+ available: httpd.service allows the
httpd daemon to be run as a system service, and
httpd.socket allows httpd to be started via
socket-based activation. Most systems will use
@@ -223,8 +223,9 @@ Wants=network-online.target
to which httpd can bind (using the Listen
directive), which parts of the filesystem can be accessed, and
whether outgoing TCP connections are possible. Many of these
- restrictions can be adjusted using semanage
- to change booleans or other types. See
+ restrictions can be relaxed or adjusted by using
+ semanage to change booleans or other
+ types. See
httpd_selinux8
for more information.
From 2f9bc4598d6ae6b6d700bbaf3db7b33315edb06b Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Mon, 13 Aug 2018 14:43:07 +0100
Subject: [PATCH 002/231] mod_ssl: backport TLSv1.3 support changes from
upstream (#1615059) Resolves: rhbz#1615059
---
httpd-2.4.34-layfix.patch | 24 ++
httpd-2.4.34-r1827912+.patch | 737 +++++++++++++++++++++++++++++++++++
httpd.spec | 9 +-
3 files changed, 769 insertions(+), 1 deletion(-)
create mode 100644 httpd-2.4.34-layfix.patch
create mode 100644 httpd-2.4.34-r1827912+.patch
diff --git a/httpd-2.4.34-layfix.patch b/httpd-2.4.34-layfix.patch
new file mode 100644
index 0000000..39728a1
--- /dev/null
+++ b/httpd-2.4.34-layfix.patch
@@ -0,0 +1,24 @@
+--- httpd-2.4.34/config.layout.layfix
++++ httpd-2.4.34/config.layout
+@@ -133,6 +133,7 @@
+ # Layout used in Fedora httpd packaging.
+
+ prefix: /usr
++ localstatedir: /var
+ exec_prefix: ${prefix}
+ bindir: ${prefix}/bin
+ sbindir: ${prefix}/sbin
+@@ -144,11 +145,10 @@
+ installbuilddir: ${libdir}/httpd/build
+ errordir: ${datadir}/error
+ iconsdir: ${datadir}/icons
+- htdocsdir: /var/www/html
++ htdocsdir: ${localstatedir}/www/html
+ manualdir: ${datadir}/manual
+- cgidir: /var/www/cgi-bin
++ cgidir: ${localstatedir}/www/cgi-bin
+ includedir: ${prefix}/include/httpd
+- localstatedir: /var
+ runtimedir: /run/httpd
+ logfiledir: ${localstatedir}/log/httpd
+ proxycachedir: ${localstatedir}/cache/httpd/proxy
diff --git a/httpd-2.4.34-r1827912+.patch b/httpd-2.4.34-r1827912+.patch
new file mode 100644
index 0000000..a4567a6
--- /dev/null
+++ b/httpd-2.4.34-r1827912+.patch
@@ -0,0 +1,737 @@
+# ./pullrev.sh 1827912 1827924 1827992 1828220 1828222 1828720 1828723 1828790 1828791 1828792
+http://svn.apache.org/viewvc?view=revision&revision=1827912
+http://svn.apache.org/viewvc?view=revision&revision=1827924
+http://svn.apache.org/viewvc?view=revision&revision=1827992
+http://svn.apache.org/viewvc?view=revision&revision=1828220
+http://svn.apache.org/viewvc?view=revision&revision=1828222
+http://svn.apache.org/viewvc?view=revision&revision=1828720
+http://svn.apache.org/viewvc?view=revision&revision=1828723
+http://svn.apache.org/viewvc?view=revision&revision=1828790
+http://svn.apache.org/viewvc?view=revision&revision=1828791
+http://svn.apache.org/viewvc?view=revision&revision=1828792
+
+--- httpd-2.4.34/modules/ssl/mod_ssl.c.r1827912+
++++ httpd-2.4.34/modules/ssl/mod_ssl.c
+@@ -93,9 +93,9 @@
+ SSL_CMD_SRV(FIPS, FLAG,
+ "Enable FIPS-140 mode "
+ "(`on', `off')")
+- SSL_CMD_ALL(CipherSuite, TAKE1,
+- "Colon-delimited list of permitted SSL Ciphers "
+- "('XXX:...:XXX' - see manual)")
++ SSL_CMD_ALL(CipherSuite, TAKE12,
++ "Colon-delimited list of permitted SSL Ciphers, optional preceeded "
++ "by protocol identifier ('XXX:...:XXX' - see manual)")
+ SSL_CMD_SRV(CertificateFile, TAKE1,
+ "SSL Server Certificate file "
+ "('/path/to/file' - PEM or DER encoded)")
+@@ -185,9 +185,9 @@
+ SSL_CMD_PXY(ProxyProtocol, RAW_ARGS,
+ "SSL Proxy: enable or disable SSL protocol flavors "
+ "('[+-][" SSL_PROTOCOLS "] ...' - see manual)")
+- SSL_CMD_PXY(ProxyCipherSuite, TAKE1,
++ SSL_CMD_PXY(ProxyCipherSuite, TAKE12,
+ "SSL Proxy: colon-delimited list of permitted SSL ciphers "
+- "('XXX:...:XXX' - see manual)")
++ ", optionally preceeded by protocol specifier ('XXX:...:XXX' - see manual)")
+ SSL_CMD_PXY(ProxyVerify, TAKE1,
+ "SSL Proxy: whether to verify the remote certificate "
+ "('on' or 'off')")
+@@ -398,7 +398,7 @@
+ /* We must register the library in full, to ensure our configuration
+ * code can successfully test the SSL environment.
+ */
+-#if MODSSL_USE_OPENSSL_PRE_1_1_API
++#if MODSSL_USE_OPENSSL_PRE_1_1_API || defined(LIBRESSL_VERSION_NUMBER)
+ (void)CRYPTO_malloc_init();
+ #else
+ OPENSSL_malloc_init();
+--- httpd-2.4.34/modules/ssl/ssl_engine_config.c.r1827912+
++++ httpd-2.4.34/modules/ssl/ssl_engine_config.c
+@@ -136,6 +136,7 @@
+ mctx->auth.cipher_suite = NULL;
+ mctx->auth.verify_depth = UNSET;
+ mctx->auth.verify_mode = SSL_CVERIFY_UNSET;
++ mctx->auth.tls13_ciphers = NULL;
+
+ mctx->ocsp_mask = UNSET;
+ mctx->ocsp_force_default = UNSET;
+@@ -280,6 +281,7 @@
+ cfgMergeString(auth.cipher_suite);
+ cfgMergeInt(auth.verify_depth);
+ cfgMerge(auth.verify_mode, SSL_CVERIFY_UNSET);
++ cfgMergeString(auth.tls13_ciphers);
+
+ cfgMergeInt(ocsp_mask);
+ cfgMergeBool(ocsp_force_default);
+@@ -761,24 +763,39 @@
+
+ const char *ssl_cmd_SSLCipherSuite(cmd_parms *cmd,
+ void *dcfg,
+- const char *arg)
++ const char *arg1, const char *arg2)
+ {
+ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+ SSLDirConfigRec *dc = (SSLDirConfigRec *)dcfg;
+
+- /* Disable null and export ciphers by default, except for PROFILE=
+- * configs where the parser doesn't cope. */
+- if (strncmp(arg, "PROFILE=", 8) != 0)
+- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
+-
+- if (cmd->path) {
+- dc->szCipherSuite = arg;
+- }
+- else {
+- sc->server->auth.cipher_suite = arg;
++ if (arg2 == NULL) {
++ arg2 = arg1;
++ arg1 = "SSL";
+ }
+-
+- return NULL;
++
++ if (!strcmp("SSL", arg1)) {
++ /* Disable null and export ciphers by default, except for PROFILE=
++ * configs where the parser doesn't cope. */
++ if (strncmp(arg2, "PROFILE=", 8) != 0)
++ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
++ if (cmd->path) {
++ dc->szCipherSuite = arg2;
++ }
++ else {
++ sc->server->auth.cipher_suite = arg2;
++ }
++ return NULL;
++ }
++#ifdef SSL_OP_NO_TLSv1_3
++ else if (!strcmp("TLSv1.3", arg1)) {
++ if (cmd->path) {
++ return "TLSv1.3 ciphers cannot be set inside a directory context";
++ }
++ sc->server->auth.tls13_ciphers = arg2;
++ return NULL;
++ }
++#endif
++ return apr_pstrcat(cmd->pool, "procotol '", arg1, "' not supported", NULL);
+ }
+
+ #define SSL_FLAGS_CHECK_FILE \
+@@ -1451,6 +1468,9 @@
+ else if (strcEQ(w, "TLSv1.2")) {
+ thisopt = SSL_PROTOCOL_TLSV1_2;
+ }
++ else if (SSL_HAVE_PROTOCOL_TLSV1_3 && strcEQ(w, "TLSv1.3")) {
++ thisopt = SSL_PROTOCOL_TLSV1_3;
++ }
+ #endif
+ else if (strcEQ(w, "all")) {
+ thisopt = SSL_PROTOCOL_ALL;
+@@ -1512,18 +1532,30 @@
+
+ const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *cmd,
+ void *dcfg,
+- const char *arg)
++ const char *arg1, const char *arg2)
+ {
+ SSLDirConfigRec *dc = (SSLDirConfigRec *)dcfg;
+-
+- /* Disable null and export ciphers by default, except for PROFILE=
+- * configs where the parser doesn't cope. */
+- if (strncmp(arg, "PROFILE=", 8) != 0)
+- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
+-
+- dc->proxy->auth.cipher_suite = arg;
+-
+- return NULL;
++
++ if (arg2 == NULL) {
++ arg2 = arg1;
++ arg1 = "SSL";
++ }
++
++ if (!strcmp("SSL", arg1)) {
++ /* Disable null and export ciphers by default, except for PROFILE=
++ * configs where the parser doesn't cope. */
++ if (strncmp(arg2, "PROFILE=", 8) != 0)
++ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
++ dc->proxy->auth.cipher_suite = arg2;
++ return NULL;
++ }
++#ifdef SSL_OP_NO_TLSv1_3
++ else if (!strcmp("TLSv1.3", arg1)) {
++ dc->proxy->auth.tls13_ciphers = arg2;
++ return NULL;
++ }
++#endif
++ return apr_pstrcat(cmd->pool, "procotol '", arg1, "' not supported", NULL);
+ }
+
+ const char *ssl_cmd_SSLProxyVerify(cmd_parms *cmd,
+--- httpd-2.4.34/modules/ssl/ssl_engine_init.c.r1827912+
++++ httpd-2.4.34/modules/ssl/ssl_engine_init.c
+@@ -568,6 +568,9 @@
+ #ifdef HAVE_TLSV1_X
+ (protocol & SSL_PROTOCOL_TLSV1_1 ? "TLSv1.1, " : ""),
+ (protocol & SSL_PROTOCOL_TLSV1_2 ? "TLSv1.2, " : ""),
++#if SSL_HAVE_PROTOCOL_TLSV1_3
++ (protocol & SSL_PROTOCOL_TLSV1_3 ? "TLSv1.3, " : ""),
++#endif
+ #endif
+ NULL);
+ cp[strlen(cp)-2] = NUL;
+@@ -600,6 +603,13 @@
+ TLSv1_2_client_method() : /* proxy */
+ TLSv1_2_server_method(); /* server */
+ }
++#ifdef SSL_OP_NO_TLSv1_3
++ else if (protocol == SSL_PROTOCOL_TLSV1_3) {
++ method = mctx->pkp ?
++ TLSv1_3_client_method() : /* proxy */
++ TLSv1_3_server_method(); /* server */
++ }
++#endif
+ #endif
+ else { /* For multiple protocols, we need a flexible method */
+ method = mctx->pkp ?
+@@ -617,7 +627,8 @@
+
+ SSL_CTX_set_options(ctx, SSL_OP_ALL);
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
++ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20800000L)
+ /* always disable SSLv2, as per RFC 6176 */
+ SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
+
+@@ -640,9 +651,19 @@
+ SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1_2);
+ }
+ #endif
++#ifdef SSL_OP_NO_TLSv1_3
++ if (!(protocol & SSL_PROTOCOL_TLSV1_3)) {
++ SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1_3);
++ }
++#endif
+
+ #else /* #if OPENSSL_VERSION_NUMBER < 0x10100000L */
+ /* We first determine the maximum protocol version we should provide */
++#ifdef SSL_OP_NO_TLSv1_3
++ if (SSL_HAVE_PROTOCOL_TLSV1_3 && (protocol & SSL_PROTOCOL_TLSV1_3)) {
++ prot = TLS1_3_VERSION;
++ } else
++#endif
+ if (protocol & SSL_PROTOCOL_TLSV1_2) {
+ prot = TLS1_2_VERSION;
+ } else if (protocol & SSL_PROTOCOL_TLSV1_1) {
+@@ -664,6 +685,11 @@
+
+ /* Next we scan for the minimal protocol version we should provide,
+ * but we do not allow holes between max and min */
++#ifdef SSL_OP_NO_TLSv1_3
++ if (prot == TLS1_3_VERSION && protocol & SSL_PROTOCOL_TLSV1_2) {
++ prot = TLS1_2_VERSION;
++ }
++#endif
+ if (prot == TLS1_2_VERSION && protocol & SSL_PROTOCOL_TLSV1_1) {
+ prot = TLS1_1_VERSION;
+ }
+@@ -888,7 +914,15 @@
+ ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
+ return ssl_die(s);
+ }
+-
++#ifdef SSL_OP_NO_TLSv1_3
++ if (mctx->auth.tls13_ciphers
++ && !SSL_CTX_set_ciphersuites(ctx, mctx->auth.tls13_ciphers)) {
++ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO()
++ "Unable to configure permitted TLSv1.3 ciphers");
++ ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
++ return ssl_die(s);
++ }
++#endif
+ return APR_SUCCESS;
+ }
+
+--- httpd-2.4.34/modules/ssl/ssl_engine_kernel.c.r1827912+
++++ httpd-2.4.34/modules/ssl/ssl_engine_kernel.c
+@@ -188,6 +188,12 @@
+ || strcmp(a1->cipher_suite, a2->cipher_suite))) {
+ return 0;
+ }
++ /* both have the same ca cipher suite string */
++ if ((a1->tls13_ciphers != a2->tls13_ciphers)
++ && (!a1->tls13_ciphers || !a2->tls13_ciphers
++ || strcmp(a1->tls13_ciphers, a2->tls13_ciphers))) {
++ return 0;
++ }
+ return 1;
+ }
+
+@@ -424,21 +430,55 @@
+ }
+ }
+
++static int ssl_check_post_client_verify(request_rec *r, SSLSrvConfigRec *sc,
++ SSLDirConfigRec *dc, SSL *ssl)
++{
++ /*
++ * Finally check for acceptable renegotiation results
++ */
++ if ((dc->nVerifyClient != SSL_CVERIFY_NONE) ||
++ (sc->server->auth.verify_mode != SSL_CVERIFY_NONE)) {
++ BOOL do_verify = ((dc->nVerifyClient == SSL_CVERIFY_REQUIRE) ||
++ (sc->server->auth.verify_mode == SSL_CVERIFY_REQUIRE));
++
++ if (do_verify && (SSL_get_verify_result(ssl) != X509_V_OK)) {
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02262)
++ "Re-negotiation handshake failed: "
++ "Client verification failed");
++
++ return HTTP_FORBIDDEN;
++ }
++
++ if (do_verify) {
++ X509 *peercert;
++
++ if ((peercert = SSL_get_peer_certificate(ssl)) == NULL) {
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02263)
++ "Re-negotiation handshake failed: "
++ "Client certificate missing");
++
++ return HTTP_FORBIDDEN;
++ }
++
++ X509_free(peercert);
++ }
++ }
++ return OK;
++}
++
+ /*
+- * Access Handler
++ * Access Handler, classic flavour, for SSL/TLS up to v1.2
++ * where everything can be renegotiated and no one is happy.
+ */
+-int ssl_hook_Access(request_rec *r)
++static int ssl_hook_Access_classic(request_rec *r, SSLSrvConfigRec *sc, SSLDirConfigRec *dc,
++ SSLConnRec *sslconn, SSL *ssl)
+ {
+- SSLDirConfigRec *dc = myDirConfig(r);
+- SSLSrvConfigRec *sc = mySrvConfig(r->server);
+- SSLConnRec *sslconn = myConnConfig(r->connection);
+- SSL *ssl = sslconn ? sslconn->ssl : NULL;
+ server_rec *handshakeserver = sslconn ? sslconn->server : NULL;
+ SSLSrvConfigRec *hssc = handshakeserver? mySrvConfig(handshakeserver) : NULL;
+ SSL_CTX *ctx = NULL;
+ apr_array_header_t *requires;
+ ssl_require_t *ssl_requires;
+- int ok, i;
++ int ok, i, rc;
+ BOOL renegotiate = FALSE, renegotiate_quick = FALSE;
+ X509 *cert;
+ X509 *peercert;
+@@ -446,66 +486,9 @@
+ X509_STORE_CTX *cert_store_ctx;
+ STACK_OF(SSL_CIPHER) *cipher_list_old = NULL, *cipher_list = NULL;
+ const SSL_CIPHER *cipher = NULL;
+- int depth, verify_old, verify, n, is_slave = 0;
++ int depth, verify_old, verify, n;
+ const char *ncipher_suite;
+
+- /* On a slave connection, we do not expect to have an SSLConnRec, but
+- * our master connection might have one. */
+- if (!(sslconn && ssl) && r->connection->master) {
+- sslconn = myConnConfig(r->connection->master);
+- ssl = sslconn ? sslconn->ssl : NULL;
+- handshakeserver = sslconn ? sslconn->server : NULL;
+- hssc = handshakeserver? mySrvConfig(handshakeserver) : NULL;
+- is_slave = 1;
+- }
+-
+- if (ssl) {
+- /*
+- * We should have handshaken here (on handshakeserver),
+- * otherwise we are being redirected (ErrorDocument) from
+- * a renegotiation failure below. The access is still
+- * forbidden in the latter case, let ap_die() handle
+- * this recursive (same) error.
+- */
+- if (!SSL_is_init_finished(ssl)) {
+- return HTTP_FORBIDDEN;
+- }
+- ctx = SSL_get_SSL_CTX(ssl);
+- }
+-
+- /*
+- * Support for SSLRequireSSL directive
+- */
+- if (dc->bSSLRequired && !ssl) {
+- if ((sc->enabled == SSL_ENABLED_OPTIONAL) && !is_slave) {
+- /* This vhost was configured for optional SSL, just tell the
+- * client that we need to upgrade.
+- */
+- apr_table_setn(r->err_headers_out, "Upgrade", "TLS/1.0, HTTP/1.1");
+- apr_table_setn(r->err_headers_out, "Connection", "Upgrade");
+-
+- return HTTP_UPGRADE_REQUIRED;
+- }
+-
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02219)
+- "access to %s failed, reason: %s",
+- r->filename, "SSL connection required");
+-
+- /* remember forbidden access for strict require option */
+- apr_table_setn(r->notes, "ssl-access-forbidden", "1");
+-
+- return HTTP_FORBIDDEN;
+- }
+-
+- /*
+- * Check to see whether SSL is in use; if it's not, then no
+- * further access control checks are relevant. (the test for
+- * sc->enabled is probably strictly unnecessary)
+- */
+- if (sc->enabled == SSL_ENABLED_FALSE || !ssl) {
+- return DECLINED;
+- }
+-
+ #ifdef HAVE_SRP
+ /*
+ * Support for per-directory reconfigured SSL connection parameters
+@@ -581,7 +564,7 @@
+ }
+
+ /* configure new state */
+- if (is_slave) {
++ if (r->connection->master) {
+ /* TODO: this categorically fails changed cipher suite settings
+ * on slave connections. We could do better by
+ * - create a new SSL* from our SSL_CTX and set cipher suite there,
+@@ -659,7 +642,7 @@
+ }
+
+ if (renegotiate) {
+- if (is_slave) {
++ if (r->connection->master) {
+ /* The request causes renegotiation on a slave connection.
+ * This is not allowed since we might have concurrent requests
+ * on this connection.
+@@ -732,7 +715,7 @@
+ (verify & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)))
+ {
+ renegotiate = TRUE;
+- if (is_slave) {
++ if (r->connection->master) {
+ /* The request causes renegotiation on a slave connection.
+ * This is not allowed since we might have concurrent requests
+ * on this connection.
+@@ -1050,30 +1033,8 @@
+ /*
+ * Finally check for acceptable renegotiation results
+ */
+- if ((dc->nVerifyClient != SSL_CVERIFY_NONE) ||
+- (sc->server->auth.verify_mode != SSL_CVERIFY_NONE)) {
+- BOOL do_verify = ((dc->nVerifyClient == SSL_CVERIFY_REQUIRE) ||
+- (sc->server->auth.verify_mode == SSL_CVERIFY_REQUIRE));
+-
+- if (do_verify && (SSL_get_verify_result(ssl) != X509_V_OK)) {
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02262)
+- "Re-negotiation handshake failed: "
+- "Client verification failed");
+-
+- return HTTP_FORBIDDEN;
+- }
+-
+- if (do_verify) {
+- if ((peercert = SSL_get_peer_certificate(ssl)) == NULL) {
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02263)
+- "Re-negotiation handshake failed: "
+- "Client certificate missing");
+-
+- return HTTP_FORBIDDEN;
+- }
+-
+- X509_free(peercert);
+- }
++ if (OK != (rc = ssl_check_post_client_verify(r, sc, dc, ssl))) {
++ return rc;
+ }
+
+ /*
+@@ -1167,6 +1128,195 @@
+ return DECLINED;
+ }
+
++#ifdef SSL_OP_NO_TLSv1_3
++/*
++ * Access Handler, modern flavour, for SSL/TLS v1.3 and onward.
++ * Only client certificates can be requested, everything else stays.
++ */
++static int ssl_hook_Access_modern(request_rec *r, SSLSrvConfigRec *sc, SSLDirConfigRec *dc,
++ SSLConnRec *sslconn, SSL *ssl)
++{
++ if ((dc->nVerifyClient != SSL_CVERIFY_UNSET) ||
++ (sc->server->auth.verify_mode != SSL_CVERIFY_UNSET)) {
++ int vmode_inplace, vmode_needed;
++ int change_vmode = FALSE;
++ int old_state, n, rc;
++
++ vmode_inplace = SSL_get_verify_mode(ssl);
++ vmode_needed = SSL_VERIFY_NONE;
++
++ if ((dc->nVerifyClient == SSL_CVERIFY_REQUIRE) ||
++ (sc->server->auth.verify_mode == SSL_CVERIFY_REQUIRE)) {
++ vmode_needed |= SSL_VERIFY_PEER_STRICT;
++ }
++
++ if ((dc->nVerifyClient == SSL_CVERIFY_OPTIONAL) ||
++ (dc->nVerifyClient == SSL_CVERIFY_OPTIONAL_NO_CA) ||
++ (sc->server->auth.verify_mode == SSL_CVERIFY_OPTIONAL) ||
++ (sc->server->auth.verify_mode == SSL_CVERIFY_OPTIONAL_NO_CA))
++ {
++ vmode_needed |= SSL_VERIFY_PEER;
++ }
++
++ if (vmode_needed == SSL_VERIFY_NONE) {
++ return DECLINED;
++ }
++
++ vmode_needed |= SSL_VERIFY_CLIENT_ONCE;
++ if (vmode_inplace != vmode_needed) {
++ /* Need to change, if new setting is more restrictive than existing one */
++
++ if ((vmode_inplace == SSL_VERIFY_NONE)
++ || (!(vmode_inplace & SSL_VERIFY_PEER)
++ && (vmode_needed & SSL_VERIFY_PEER))
++ || (!(vmode_inplace & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)
++ && (vmode_needed & SSL_VERIFY_FAIL_IF_NO_PEER_CERT))) {
++ /* need to change the effective verify mode */
++ change_vmode = TRUE;
++ }
++ else {
++ /* FIXME: does this work with TLSv1.3? Is this more than re-inspecting
++ * the certificate we should already have? */
++ /*
++ * override of SSLVerifyDepth
++ *
++ * The depth checks are handled by us manually inside the
++ * verify callback function and not by OpenSSL internally
++ * (and our function is aware of both the per-server and
++ * per-directory contexts). So we cannot ask OpenSSL about
++ * the currently verify depth. Instead we remember it in our
++ * SSLConnRec attached to the SSL* of OpenSSL. We've to force
++ * the renegotiation if the reconfigured/new verify depth is
++ * less than the currently active/remembered verify depth
++ * (because this means more restriction on the certificate
++ * chain).
++ */
++ n = (sslconn->verify_depth != UNSET)?
++ sslconn->verify_depth : sc->server->auth.verify_depth;
++ /* determine the new depth */
++ sslconn->verify_depth = (dc->nVerifyDepth != UNSET)
++ ? dc->nVerifyDepth
++ : sc->server->auth.verify_depth;
++ if (sslconn->verify_depth < n) {
++ change_vmode = TRUE;
++ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO()
++ "Reduced client verification depth will "
++ "force renegotiation");
++ }
++ }
++ }
++
++ if (change_vmode) {
++ char peekbuf[1];
++
++ if (r->connection->master) {
++ /* FIXME: modifying the SSL on a slave connection is no good.
++ * We would need to push this back to the master connection
++ * somehow.
++ */
++ apr_table_setn(r->notes, "ssl-renegotiate-forbidden", "verify-client");
++ return HTTP_FORBIDDEN;
++ }
++
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO() "verify client post handshake");
++
++ SSL_set_verify(ssl, vmode_needed, ssl_callback_SSLVerify);
++ SSL_verify_client_post_handshake(ssl);
++
++ old_state = sslconn->reneg_state;
++ sslconn->reneg_state = RENEG_ALLOW;
++ modssl_set_app_data2(ssl, r);
++
++ SSL_do_handshake(ssl);
++ /* Need to trigger renegotiation handshake by reading.
++ * Peeking 0 bytes actually works.
++ * See: http://marc.info/?t=145493359200002&r=1&w=2
++ */
++ SSL_peek(ssl, peekbuf, 0);
++
++ sslconn->reneg_state = old_state;
++ modssl_set_app_data2(ssl, NULL);
++
++ /*
++ * Finally check for acceptable renegotiation results
++ */
++ if (OK != (rc = ssl_check_post_client_verify(r, sc, dc, ssl))) {
++ return rc;
++ }
++ }
++ }
++
++ return DECLINED;
++}
++#endif
++
++int ssl_hook_Access(request_rec *r)
++{
++ SSLDirConfigRec *dc = myDirConfig(r);
++ SSLSrvConfigRec *sc = mySrvConfig(r->server);
++ SSLConnRec *sslconn = myConnConfig(r->connection);
++ SSL *ssl = sslconn ? sslconn->ssl : NULL;
++
++ /* On a slave connection, we do not expect to have an SSLConnRec, but
++ * our master connection might have one. */
++ if (!(sslconn && ssl) && r->connection->master) {
++ sslconn = myConnConfig(r->connection->master);
++ ssl = sslconn ? sslconn->ssl : NULL;
++ }
++
++ /*
++ * We should have handshaken here, otherwise we are being
++ * redirected (ErrorDocument) from a renegotiation failure below.
++ * The access is still forbidden in the latter case, let ap_die() handle
++ * this recursive (same) error.
++ */
++ if (ssl && !SSL_is_init_finished(ssl)) {
++ return HTTP_FORBIDDEN;
++ }
++
++ /*
++ * Support for SSLRequireSSL directive
++ */
++ if (dc->bSSLRequired && !ssl) {
++ if ((sc->enabled == SSL_ENABLED_OPTIONAL) && !r->connection->master) {
++ /* This vhost was configured for optional SSL, just tell the
++ * client that we need to upgrade.
++ */
++ apr_table_setn(r->err_headers_out, "Upgrade", "TLS/1.0, HTTP/1.1");
++ apr_table_setn(r->err_headers_out, "Connection", "Upgrade");
++
++ return HTTP_UPGRADE_REQUIRED;
++ }
++
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02219)
++ "access to %s failed, reason: %s",
++ r->filename, "SSL connection required");
++
++ /* remember forbidden access for strict require option */
++ apr_table_setn(r->notes, "ssl-access-forbidden", "1");
++
++ return HTTP_FORBIDDEN;
++ }
++
++ /*
++ * Check to see whether SSL is in use; if it's not, then no
++ * further access control checks are relevant. (the test for
++ * sc->enabled is probably strictly unnecessary)
++ */
++ if (sc->enabled == SSL_ENABLED_FALSE || !ssl) {
++ return DECLINED;
++ }
++
++#ifdef SSL_OP_NO_TLSv1_3
++ /* TLSv1.3+ is less complicated here. Branch off into a new codeline
++ * and avoid messing with the past. */
++ if (SSL_version(ssl) >= TLS1_3_VERSION) {
++ return ssl_hook_Access_modern(r, sc, dc, sslconn, ssl);
++ }
++#endif
++ return ssl_hook_Access_classic(r, sc, dc, sslconn, ssl);
++}
++
+ /*
+ * Authentication Handler:
+ * Fake a Basic authentication from the X509 client certificate.
+--- httpd-2.4.34/modules/ssl/ssl_private.h.r1827912+
++++ httpd-2.4.34/modules/ssl/ssl_private.h
+@@ -132,13 +132,14 @@
+ SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL)
+ #define SSL_CTX_set_max_proto_version(ctx, version) \
+ SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL)
+-#endif
+-/* LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not include most
+- * changes from OpenSSL >= 1.1 (new functions, macros, deprecations, ...), so
+- * we have to work around this...
++#elif LIBRESSL_VERSION_NUMBER < 0x2070000f
++/* LibreSSL before 2.7 declares OPENSSL_VERSION_NUMBER == 2.0 but does not
++ * include most changes from OpenSSL >= 1.1 (new functions, macros,
++ * deprecations, ...), so we have to work around this...
+ */
+ #define MODSSL_USE_OPENSSL_PRE_1_1_API (1)
+-#else
++#endif /* LIBRESSL_VERSION_NUMBER < 0x2060000f */
++#else /* defined(LIBRESSL_VERSION_NUMBER) */
+ #define MODSSL_USE_OPENSSL_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L)
+ #endif
+
+@@ -238,7 +239,8 @@
+ void free_bio_methods(void);
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10002000L || \
++ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000f)
+ #define X509_STORE_CTX_get0_store(x) (x->ctx)
+ #endif
+
+@@ -372,8 +374,17 @@
+ #ifdef HAVE_TLSV1_X
+ #define SSL_PROTOCOL_TLSV1_1 (1<<3)
+ #define SSL_PROTOCOL_TLSV1_2 (1<<4)
++#define SSL_PROTOCOL_TLSV1_3 (1<<5)
++
++#ifdef SSL_OP_NO_TLSv1_3
++#define SSL_HAVE_PROTOCOL_TLSV1_3 (1)
++#define SSL_PROTOCOL_ALL (SSL_PROTOCOL_BASIC| \
++ SSL_PROTOCOL_TLSV1_1|SSL_PROTOCOL_TLSV1_2|SSL_PROTOCOL_TLSV1_3)
++#else
++#define SSL_HAVE_PROTOCOL_TLSV1_3 (0)
+ #define SSL_PROTOCOL_ALL (SSL_PROTOCOL_BASIC| \
+ SSL_PROTOCOL_TLSV1_1|SSL_PROTOCOL_TLSV1_2)
++#endif
+ #else
+ #define SSL_PROTOCOL_ALL (SSL_PROTOCOL_BASIC)
+ #endif
+@@ -646,6 +657,11 @@
+ /** for client or downstream server authentication */
+ int verify_depth;
+ ssl_verify_t verify_mode;
++
++ /** TLSv1.3 has its separate cipher list, separate from the
++ settings for older TLS protocol versions. Since which one takes
++ effect is a matter of negotiation, we need separate settings */
++ const char *tls13_ciphers;
+ } modssl_auth_ctx_t;
+
+ #ifdef HAVE_TLS_SESSION_TICKETS
+@@ -801,7 +817,7 @@
+ const char *ssl_cmd_SSLCryptoDevice(cmd_parms *, void *, const char *);
+ const char *ssl_cmd_SSLRandomSeed(cmd_parms *, void *, const char *, const char *, const char *);
+ const char *ssl_cmd_SSLEngine(cmd_parms *, void *, const char *);
+-const char *ssl_cmd_SSLCipherSuite(cmd_parms *, void *, const char *);
++const char *ssl_cmd_SSLCipherSuite(cmd_parms *, void *, const char *, const char *);
+ const char *ssl_cmd_SSLCertificateFile(cmd_parms *, void *, const char *);
+ const char *ssl_cmd_SSLCertificateKeyFile(cmd_parms *, void *, const char *);
+ const char *ssl_cmd_SSLCertificateChainFile(cmd_parms *, void *, const char *);
+@@ -830,7 +846,7 @@
+
+ const char *ssl_cmd_SSLProxyEngine(cmd_parms *cmd, void *dcfg, int flag);
+ const char *ssl_cmd_SSLProxyProtocol(cmd_parms *, void *, const char *);
+-const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *, void *, const char *);
++const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *, void *, const char *, const char *);
+ const char *ssl_cmd_SSLProxyVerify(cmd_parms *, void *, const char *);
+ const char *ssl_cmd_SSLProxyVerifyDepth(cmd_parms *, void *, const char *);
+ const char *ssl_cmd_SSLProxyCACertificatePath(cmd_parms *, void *, const char *);
diff --git a/httpd.spec b/httpd.spec
index c90d5c5..d87e1c6 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.34
-Release: 3%{?dist}
+Release: 4%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -58,6 +58,7 @@ Source44: httpd@.service
Patch1: httpd-2.4.1-apctl.patch
Patch2: httpd-2.4.9-apxs.patch
Patch3: httpd-2.4.1-deplibs.patch
+Patch4: httpd-2.4.34-layfix.patch
Patch6: httpd-2.4.3-apctl-systemd.patch
# Needed for socket activation and mod_systemd patch
Patch19: httpd-2.4.25-detect-systemd.patch
@@ -74,6 +75,7 @@ Patch31: httpd-2.4.33-sslmultiproxy.patch
Patch34: httpd-2.4.17-socket-activation.patch
Patch35: httpd-2.4.33-sslciphdefault.patch
Patch36: httpd-2.4.33-r1830819+.patch
+Patch37: httpd-2.4.34-r1827912+.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -218,6 +220,7 @@ interface for storing and accessing per-user session data.
%patch1 -p1 -b .apctl
%patch2 -p1 -b .apxs
%patch3 -p1 -b .deplibs
+%patch4 -p1 -b .layfix
%patch6 -p1 -b .apctlsystemd
%patch19 -p1 -b .detectsystemd
@@ -234,6 +237,7 @@ interface for storing and accessing per-user session data.
%patch34 -p1 -b .socketactivation
%patch35 -p1 -b .sslciphdefault
%patch36 -p1 -b .r1830819+
+%patch37 -p1 -b .r1827912+
%patch58 -p1 -b .r1738878
%patch59 -p1 -b .r1555631
@@ -725,6 +729,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Mon Aug 13 2018 Joe Orton - 2.4.34-4
+- mod_ssl: backport TLSv1.3 support changes from upstream (#1615059)
+
* Fri Jul 20 2018 Joe Orton - 2.4.34-3
- mod_ssl: fix OCSP regression (upstream r1555631)
From b52ebeb33d4b79ff9ec399502499fc92b56a3ee1 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Tue, 21 Aug 2018 08:34:34 +0100
Subject: [PATCH 003/231] mod_ssl: further TLSv1.3 fix (#1619389) Resolves:
rhbz#1619389
---
httpd-2.4.34-r1827912+.patch | 61 ++++++++++++++++++++++++++++++++++++
httpd.spec | 5 ++-
2 files changed, 65 insertions(+), 1 deletion(-)
diff --git a/httpd-2.4.34-r1827912+.patch b/httpd-2.4.34-r1827912+.patch
index a4567a6..b4b2acc 100644
--- a/httpd-2.4.34-r1827912+.patch
+++ b/httpd-2.4.34-r1827912+.patch
@@ -9,6 +9,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1828723
http://svn.apache.org/viewvc?view=revision&revision=1828790
http://svn.apache.org/viewvc?view=revision&revision=1828791
http://svn.apache.org/viewvc?view=revision&revision=1828792
+http://svn.apache.org/viewvc?view=revision&revision=1833588
--- httpd-2.4.34/modules/ssl/mod_ssl.c.r1827912+
+++ httpd-2.4.34/modules/ssl/mod_ssl.c
@@ -655,6 +656,66 @@ http://svn.apache.org/viewvc?view=revision&revision=1828792
/*
* Authentication Handler:
* Fake a Basic authentication from the X509 client certificate.
+@@ -2080,31 +2230,43 @@
+ {
+ conn_rec *c;
+ server_rec *s;
+- SSLConnRec *scr;
+
+ /* Retrieve the conn_rec and the associated SSLConnRec. */
+ if ((c = (conn_rec *)SSL_get_app_data((SSL *)ssl)) == NULL) {
+ return;
+ }
+
+- if ((scr = myConnConfig(c)) == NULL) {
+- return;
+- }
++ /* With TLS 1.3 this callback may be called multiple times on the first
++ * negotiation, so the below logic to detect renegotiations can't work.
++ * Fortunately renegotiations are forbidden starting with TLS 1.3, and
++ * this is enforced by OpenSSL so there's nothing to be done here.
++ */
++#if SSL_HAVE_PROTOCOL_TLSV1_3
++ if (SSL_version(ssl) < TLS1_3_VERSION)
++#endif
++ {
++ SSLConnRec *sslconn;
+
+- /* If the reneg state is to reject renegotiations, check the SSL
+- * state machine and move to ABORT if a Client Hello is being
+- * read. */
+- if (!scr->is_proxy &&
+- (where & SSL_CB_HANDSHAKE_START) &&
+- scr->reneg_state == RENEG_REJECT) {
+- scr->reneg_state = RENEG_ABORT;
++ if ((sslconn = myConnConfig(c)) == NULL) {
++ return;
++ }
++
++ /* If the reneg state is to reject renegotiations, check the SSL
++ * state machine and move to ABORT if a Client Hello is being
++ * read. */
++ if (!sslconn->is_proxy &&
++ (where & SSL_CB_HANDSHAKE_START) &&
++ sslconn->reneg_state == RENEG_REJECT) {
++ sslconn->reneg_state = RENEG_ABORT;
+ ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02042)
+ "rejecting client initiated renegotiation");
+- }
+- /* If the first handshake is complete, change state to reject any
+- * subsequent client-initiated renegotiation. */
+- else if ((where & SSL_CB_HANDSHAKE_DONE) && scr->reneg_state == RENEG_INIT) {
+- scr->reneg_state = RENEG_REJECT;
++ }
++ /* If the first handshake is complete, change state to reject any
++ * subsequent client-initiated renegotiation. */
++ else if ((where & SSL_CB_HANDSHAKE_DONE)
++ && sslconn->reneg_state == RENEG_INIT) {
++ sslconn->reneg_state = RENEG_REJECT;
++ }
+ }
+
+ s = mySrvFromConn(c);
--- httpd-2.4.34/modules/ssl/ssl_private.h.r1827912+
+++ httpd-2.4.34/modules/ssl/ssl_private.h
@@ -132,13 +132,14 @@
diff --git a/httpd.spec b/httpd.spec
index d87e1c6..697b97e 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.34
-Release: 4%{?dist}
+Release: 5%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -729,6 +729,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Tue Aug 21 2018 Joe Orton - 2.4.34-5
+- mod_ssl: further TLSv1.3 fix (#1619389)
+
* Mon Aug 13 2018 Joe Orton - 2.4.34-4
- mod_ssl: backport TLSv1.3 support changes from upstream (#1615059)
From 5bf30dc15619f53f8d281e3a35360d9c67bf9ea2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubo=C5=A1=20Uhliarik?=
Date: Mon, 3 Sep 2018 11:29:22 +0200
Subject: [PATCH 004/231] mod_ssl: enable SSLv3 and change behavior of
"SSLProtocol All" configuration (#1624777)
Resolves: #1624777
---
httpd-2.4.34-enable-sslv3.patch | 60 +++++++++++++++++++++++++++++++++
httpd.spec | 8 ++++-
2 files changed, 67 insertions(+), 1 deletion(-)
create mode 100644 httpd-2.4.34-enable-sslv3.patch
diff --git a/httpd-2.4.34-enable-sslv3.patch b/httpd-2.4.34-enable-sslv3.patch
new file mode 100644
index 0000000..f559bf9
--- /dev/null
+++ b/httpd-2.4.34-enable-sslv3.patch
@@ -0,0 +1,60 @@
+diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c
+index 517ce30..075f7e1 100644
+--- a/modules/ssl/ssl_engine_config.c
++++ b/modules/ssl/ssl_engine_config.c
+@@ -1474,6 +1474,8 @@ static const char *ssl_cmd_protocol_parse(cmd_parms *parms,
+ #endif
+ else if (strcEQ(w, "all")) {
+ thisopt = SSL_PROTOCOL_ALL;
++ // by default, ALL kw doesn't turn on SSLv3
++ thisopt &= ~SSL_PROTOCOL_SSLV3;
+ }
+ else {
+ return apr_pstrcat(parms->temp_pool,
+diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
+index 60df45f..f6645c2 100644
+--- a/modules/ssl/ssl_engine_init.c
++++ b/modules/ssl/ssl_engine_init.c
+@@ -537,6 +537,28 @@ static apr_status_t ssl_init_ctx_tls_extensions(server_rec *s,
+ }
+ #endif
+
++/*
++ * Enable/disable SSLProtocol. If the mod_ssl enables protocol
++ * which is disabled by default by OpenSSL, show a warning.
++ * "option" is for example SSL_OP_NO_SSLv3.
++ */
++static void ssl_set_ctx_protocol_option(server_rec *s,
++ SSL_CTX *ctx,
++ long option,
++ int enabled,
++ const char *name)
++{
++ if (!enabled) {
++ SSL_CTX_set_options(ctx, option);
++ }
++ else if (SSL_CTX_get_options(ctx) & option) {
++ SSL_CTX_clear_options(ctx, option);
++ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO(02904)
++ "Allowing SSLProtocol %s even though it is disabled "
++ "by OpenSSL by default on this system", name);
++ }
++}
++
+ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
+ apr_pool_t *p,
+ apr_pool_t *ptemp,
+@@ -695,9 +719,13 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
+ }
+ if (prot == TLS1_1_VERSION && protocol & SSL_PROTOCOL_TLSV1) {
+ prot = TLS1_VERSION;
++ ssl_set_ctx_protocol_option(s, ctx, SSL_OP_NO_TLSv1,
++ protocol & SSL_PROTOCOL_TLSV1, "TLSv1");
+ }
+ #ifndef OPENSSL_NO_SSL3
+ if (prot == TLS1_VERSION && protocol & SSL_PROTOCOL_SSLV3) {
++ ssl_set_ctx_protocol_option(s, ctx, SSL_OP_NO_SSLv3,
++ protocol & SSL_PROTOCOL_SSLV3, "SSLv3");
+ prot = SSL3_VERSION;
+ }
+ #endif
diff --git a/httpd.spec b/httpd.spec
index 697b97e..5d98218 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.34
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -81,6 +81,7 @@ Patch37: httpd-2.4.34-r1827912+.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
Patch58: httpd-2.4.34-r1738878.patch
Patch59: httpd-2.4.34-r1555631.patch
+Patch60: httpd-2.4.34-enable-sslv3.patch
# Security fixes
@@ -241,6 +242,7 @@ interface for storing and accessing per-user session data.
%patch58 -p1 -b .r1738878
%patch59 -p1 -b .r1555631
+%patch60 -p1 -b .enablesslv3
# Patch in the vendor string
sed -i '/^#define PLATFORM/s/Unix/%{vstring}/' os/unix/os.h
@@ -729,6 +731,10 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Tue Aug 28 2018 Luboš Uhliarik - 2.4.34-6
+- mod_ssl: enable SSLv3 and change behavior of "SSLProtocol All"
+ configuration (#1624777)
+
* Tue Aug 21 2018 Joe Orton - 2.4.34-5
- mod_ssl: further TLSv1.3 fix (#1619389)
From 369db50dd0f2e26d94699d80e69ae0e196fb585c Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Tue, 18 Sep 2018 13:57:48 +0100
Subject: [PATCH 005/231] mod_ssl: more TLSv1.3 fixes (#1619389) Resolves:
rhbz#1619389
---
httpd-2.4.33-sslciphdefault.patch | 33 ---
httpd-2.4.34-r1827912+.patch | 356 +++++++++++++++++-------------
httpd-2.4.34-sslciphdefault.patch | 34 +++
httpd.spec | 9 +-
4 files changed, 248 insertions(+), 184 deletions(-)
delete mode 100644 httpd-2.4.33-sslciphdefault.patch
create mode 100644 httpd-2.4.34-sslciphdefault.patch
diff --git a/httpd-2.4.33-sslciphdefault.patch b/httpd-2.4.33-sslciphdefault.patch
deleted file mode 100644
index f2919b8..0000000
--- a/httpd-2.4.33-sslciphdefault.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1109119
-
-Don't prepend !aNULL etc if PROFILE= is used with SSLCipherSuite.
-
---- httpd-2.4.33/modules/ssl/ssl_engine_config.c.sslciphdefault
-+++ httpd-2.4.33/modules/ssl/ssl_engine_config.c
-@@ -758,8 +758,10 @@
- SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
- SSLDirConfigRec *dc = (SSLDirConfigRec *)dcfg;
-
-- /* always disable null and export ciphers */
-- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
-+ /* Disable null and export ciphers by default, except for PROFILE=
-+ * configs where the parser doesn't cope. */
-+ if (strncmp(arg, "PROFILE=", 8) != 0)
-+ arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
-
- if (cmd->path) {
- dc->szCipherSuite = arg;
-@@ -1502,8 +1504,10 @@
- {
- SSLDirConfigRec *dc = (SSLDirConfigRec *)dcfg;
-
-- /* always disable null and export ciphers */
-- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
-+ /* Disable null and export ciphers by default, except for PROFILE=
-+ * configs where the parser doesn't cope. */
-+ if (strncmp(arg, "PROFILE=", 8) != 0)
-+ arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
-
- dc->proxy->auth.cipher_suite = arg;
-
diff --git a/httpd-2.4.34-r1827912+.patch b/httpd-2.4.34-r1827912+.patch
index b4b2acc..98c7ac8 100644
--- a/httpd-2.4.34-r1827912+.patch
+++ b/httpd-2.4.34-r1827912+.patch
@@ -1,15 +1,7 @@
-# ./pullrev.sh 1827912 1827924 1827992 1828220 1828222 1828720 1828723 1828790 1828791 1828792
-http://svn.apache.org/viewvc?view=revision&revision=1827912
-http://svn.apache.org/viewvc?view=revision&revision=1827924
-http://svn.apache.org/viewvc?view=revision&revision=1827992
-http://svn.apache.org/viewvc?view=revision&revision=1828220
-http://svn.apache.org/viewvc?view=revision&revision=1828222
-http://svn.apache.org/viewvc?view=revision&revision=1828720
-http://svn.apache.org/viewvc?view=revision&revision=1828723
-http://svn.apache.org/viewvc?view=revision&revision=1828790
-http://svn.apache.org/viewvc?view=revision&revision=1828791
-http://svn.apache.org/viewvc?view=revision&revision=1828792
-http://svn.apache.org/viewvc?view=revision&revision=1833588
+
+Pull all changes from upstream integration branch:
+
+svn diff -r1840105:1841219 https://svn.apache.org/repos/asf/httpd/httpd/branches/tlsv1.3-for-2.4.x
--- httpd-2.4.34/modules/ssl/mod_ssl.c.r1827912+
+++ httpd-2.4.34/modules/ssl/mod_ssl.c
@@ -65,7 +57,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
cfgMergeInt(ocsp_mask);
cfgMergeBool(ocsp_force_default);
-@@ -761,24 +763,39 @@
+@@ -761,22 +763,37 @@
const char *ssl_cmd_SSLCipherSuite(cmd_parms *cmd,
void *dcfg,
@@ -75,28 +67,21 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
SSLDirConfigRec *dc = (SSLDirConfigRec *)dcfg;
-- /* Disable null and export ciphers by default, except for PROFILE=
-- * configs where the parser doesn't cope. */
-- if (strncmp(arg, "PROFILE=", 8) != 0)
-- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
+- /* always disable null and export ciphers */
+- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
-
- if (cmd->path) {
- dc->szCipherSuite = arg;
-- }
-- else {
-- sc->server->auth.cipher_suite = arg;
+ if (arg2 == NULL) {
+ arg2 = arg1;
+ arg1 = "SSL";
}
--
-- return NULL;
+- else {
+- sc->server->auth.cipher_suite = arg;
+
+ if (!strcmp("SSL", arg1)) {
-+ /* Disable null and export ciphers by default, except for PROFILE=
-+ * configs where the parser doesn't cope. */
-+ if (strncmp(arg2, "PROFILE=", 8) != 0)
-+ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
++ /* always disable null and export ciphers */
++ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
+ if (cmd->path) {
+ dc->szCipherSuite = arg2;
+ }
@@ -104,21 +89,23 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
+ sc->server->auth.cipher_suite = arg2;
+ }
+ return NULL;
-+ }
-+#ifdef SSL_OP_NO_TLSv1_3
+ }
+-
+- return NULL;
++#if SSL_HAVE_PROTOCOL_TLSV1_3
+ else if (!strcmp("TLSv1.3", arg1)) {
+ if (cmd->path) {
+ return "TLSv1.3 ciphers cannot be set inside a directory context";
+ }
+ sc->server->auth.tls13_ciphers = arg2;
+ return NULL;
-+ }
++ }
+#endif
+ return apr_pstrcat(cmd->pool, "procotol '", arg1, "' not supported", NULL);
}
#define SSL_FLAGS_CHECK_FILE \
-@@ -1451,6 +1468,9 @@
+@@ -1449,6 +1466,9 @@
else if (strcEQ(w, "TLSv1.2")) {
thisopt = SSL_PROTOCOL_TLSV1_2;
}
@@ -128,7 +115,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
#endif
else if (strcEQ(w, "all")) {
thisopt = SSL_PROTOCOL_ALL;
-@@ -1512,18 +1532,30 @@
+@@ -1510,16 +1530,28 @@
const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *cmd,
void *dcfg,
@@ -137,10 +124,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
{
SSLDirConfigRec *dc = (SSLDirConfigRec *)dcfg;
-
-- /* Disable null and export ciphers by default, except for PROFILE=
-- * configs where the parser doesn't cope. */
-- if (strncmp(arg, "PROFILE=", 8) != 0)
-- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
+- /* always disable null and export ciphers */
+- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
-
- dc->proxy->auth.cipher_suite = arg;
-
@@ -152,14 +137,12 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
+ }
+
+ if (!strcmp("SSL", arg1)) {
-+ /* Disable null and export ciphers by default, except for PROFILE=
-+ * configs where the parser doesn't cope. */
-+ if (strncmp(arg2, "PROFILE=", 8) != 0)
-+ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
++ /* always disable null and export ciphers */
++ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
+ dc->proxy->auth.cipher_suite = arg2;
+ return NULL;
+ }
-+#ifdef SSL_OP_NO_TLSv1_3
++#if SSL_HAVE_PROTOCOL_TLSV1_3
+ else if (!strcmp("TLSv1.3", arg1)) {
+ dc->proxy->auth.tls13_ciphers = arg2;
+ return NULL;
@@ -185,7 +168,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
TLSv1_2_client_method() : /* proxy */
TLSv1_2_server_method(); /* server */
}
-+#ifdef SSL_OP_NO_TLSv1_3
++#if SSL_HAVE_PROTOCOL_TLSV1_3
+ else if (protocol == SSL_PROTOCOL_TLSV1_3) {
+ method = mctx->pkp ?
+ TLSv1_3_client_method() : /* proxy */
@@ -205,31 +188,31 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
/* always disable SSLv2, as per RFC 6176 */
SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
-@@ -640,9 +651,19 @@
+@@ -639,10 +650,19 @@
+ if (!(protocol & SSL_PROTOCOL_TLSV1_2)) {
SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1_2);
}
- #endif
-+#ifdef SSL_OP_NO_TLSv1_3
-+ if (!(protocol & SSL_PROTOCOL_TLSV1_3)) {
-+ SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1_3);
-+ }
++#if SSL_HAVE_PROTOCOL_TLSV1_3
++ ssl_set_ctx_protocol_option(s, ctx, SSL_OP_NO_TLSv1_3,
++ protocol & SSL_PROTOCOL_TLSV1_3, "TLSv1.3");
+#endif
+ #endif
#else /* #if OPENSSL_VERSION_NUMBER < 0x10100000L */
/* We first determine the maximum protocol version we should provide */
-+#ifdef SSL_OP_NO_TLSv1_3
++#if SSL_HAVE_PROTOCOL_TLSV1_3
+ if (SSL_HAVE_PROTOCOL_TLSV1_3 && (protocol & SSL_PROTOCOL_TLSV1_3)) {
+ prot = TLS1_3_VERSION;
-+ } else
++ } else
+#endif
if (protocol & SSL_PROTOCOL_TLSV1_2) {
prot = TLS1_2_VERSION;
} else if (protocol & SSL_PROTOCOL_TLSV1_1) {
-@@ -664,6 +685,11 @@
+@@ -664,6 +684,11 @@
/* Next we scan for the minimal protocol version we should provide,
* but we do not allow holes between max and min */
-+#ifdef SSL_OP_NO_TLSv1_3
++#if SSL_HAVE_PROTOCOL_TLSV1_3
+ if (prot == TLS1_3_VERSION && protocol & SSL_PROTOCOL_TLSV1_2) {
+ prot = TLS1_2_VERSION;
+ }
@@ -237,12 +220,26 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
if (prot == TLS1_2_VERSION && protocol & SSL_PROTOCOL_TLSV1_1) {
prot = TLS1_1_VERSION;
}
-@@ -888,7 +914,15 @@
+@@ -736,6 +761,13 @@
+ SSL_CTX_set_mode(ctx, SSL_MODE_RELEASE_BUFFERS);
+ #endif
+
++#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
++ /* For OpenSSL >=1.1.1, disable auto-retry mode so it's possible
++ * to consume handshake records without blocking for app-data.
++ * https://github.com/openssl/openssl/issues/7178 */
++ SSL_CTX_clear_mode(ctx, SSL_MODE_AUTO_RETRY);
++#endif
++
+ return APR_SUCCESS;
+ }
+
+@@ -888,7 +920,15 @@
ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
return ssl_die(s);
}
-
-+#ifdef SSL_OP_NO_TLSv1_3
++#if SSL_HAVE_PROTOCOL_TLSV1_3
+ if (mctx->auth.tls13_ciphers
+ && !SSL_CTX_set_ciphersuites(ctx, mctx->auth.tls13_ciphers)) {
+ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO()
@@ -254,6 +251,20 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
return APR_SUCCESS;
}
+@@ -1493,6 +1533,13 @@
+ X509_STORE_CTX *sctx;
+ X509_STORE *store = SSL_CTX_get_cert_store(mctx->ssl_ctx);
+
++#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
++ /* For OpenSSL >=1.1.1, turn on client cert support which is
++ * otherwise turned off by default (by design).
++ * https://github.com/openssl/openssl/issues/6933 */
++ SSL_CTX_set_post_handshake_auth(mctx->ssl_ctx, 1);
++#endif
++
+ SSL_CTX_set_client_cert_cb(mctx->ssl_ctx,
+ ssl_callback_proxy_cert);
+
--- httpd-2.4.34/modules/ssl/ssl_engine_kernel.c.r1827912+
+++ httpd-2.4.34/modules/ssl/ssl_engine_kernel.c
@@ -188,6 +188,12 @@
@@ -269,77 +280,38 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
return 1;
}
-@@ -424,21 +430,55 @@
+@@ -424,87 +430,70 @@
}
}
-+static int ssl_check_post_client_verify(request_rec *r, SSLSrvConfigRec *sc,
-+ SSLDirConfigRec *dc, SSL *ssl)
-+{
-+ /*
-+ * Finally check for acceptable renegotiation results
-+ */
-+ if ((dc->nVerifyClient != SSL_CVERIFY_NONE) ||
-+ (sc->server->auth.verify_mode != SSL_CVERIFY_NONE)) {
-+ BOOL do_verify = ((dc->nVerifyClient == SSL_CVERIFY_REQUIRE) ||
-+ (sc->server->auth.verify_mode == SSL_CVERIFY_REQUIRE));
-+
-+ if (do_verify && (SSL_get_verify_result(ssl) != X509_V_OK)) {
-+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02262)
-+ "Re-negotiation handshake failed: "
-+ "Client verification failed");
-+
-+ return HTTP_FORBIDDEN;
-+ }
-+
-+ if (do_verify) {
-+ X509 *peercert;
-+
-+ if ((peercert = SSL_get_peer_certificate(ssl)) == NULL) {
-+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02263)
-+ "Re-negotiation handshake failed: "
-+ "Client certificate missing");
-+
-+ return HTTP_FORBIDDEN;
-+ }
-+
-+ X509_free(peercert);
-+ }
-+ }
-+ return OK;
-+}
-+
- /*
+-/*
- * Access Handler
-+ * Access Handler, classic flavour, for SSL/TLS up to v1.2
-+ * where everything can be renegotiated and no one is happy.
- */
+- */
-int ssl_hook_Access(request_rec *r)
-+static int ssl_hook_Access_classic(request_rec *r, SSLSrvConfigRec *sc, SSLDirConfigRec *dc,
-+ SSLConnRec *sslconn, SSL *ssl)
++static int ssl_check_post_client_verify(request_rec *r, SSLSrvConfigRec *sc,
++ SSLDirConfigRec *dc, SSLConnRec *sslconn,
++ SSL *ssl)
{
- SSLDirConfigRec *dc = myDirConfig(r);
- SSLSrvConfigRec *sc = mySrvConfig(r->server);
- SSLConnRec *sslconn = myConnConfig(r->connection);
- SSL *ssl = sslconn ? sslconn->ssl : NULL;
- server_rec *handshakeserver = sslconn ? sslconn->server : NULL;
- SSLSrvConfigRec *hssc = handshakeserver? mySrvConfig(handshakeserver) : NULL;
- SSL_CTX *ctx = NULL;
- apr_array_header_t *requires;
- ssl_require_t *ssl_requires;
+- server_rec *handshakeserver = sslconn ? sslconn->server : NULL;
+- SSLSrvConfigRec *hssc = handshakeserver? mySrvConfig(handshakeserver) : NULL;
+- SSL_CTX *ctx = NULL;
+- apr_array_header_t *requires;
+- ssl_require_t *ssl_requires;
- int ok, i;
-+ int ok, i, rc;
- BOOL renegotiate = FALSE, renegotiate_quick = FALSE;
+- BOOL renegotiate = FALSE, renegotiate_quick = FALSE;
X509 *cert;
- X509 *peercert;
-@@ -446,66 +486,9 @@
- X509_STORE_CTX *cert_store_ctx;
- STACK_OF(SSL_CIPHER) *cipher_list_old = NULL, *cipher_list = NULL;
- const SSL_CIPHER *cipher = NULL;
+- X509 *peercert;
+- X509_STORE *cert_store = NULL;
+- X509_STORE_CTX *cert_store_ctx;
+- STACK_OF(SSL_CIPHER) *cipher_list_old = NULL, *cipher_list = NULL;
+- const SSL_CIPHER *cipher = NULL;
- int depth, verify_old, verify, n, is_slave = 0;
-+ int depth, verify_old, verify, n;
- const char *ncipher_suite;
-
+- const char *ncipher_suite;
+-
- /* On a slave connection, we do not expect to have an SSLConnRec, but
- * our master connection might have one. */
- if (!(sslconn && ssl) && r->connection->master) {
@@ -349,7 +321,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
- hssc = handshakeserver? mySrvConfig(handshakeserver) : NULL;
- is_slave = 1;
- }
--
+
- if (ssl) {
- /*
- * We should have handshaken here (on handshakeserver),
@@ -360,13 +332,23 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
- */
- if (!SSL_is_init_finished(ssl)) {
- return HTTP_FORBIDDEN;
-- }
++ /*
++ * Remember the peer certificate's DN
++ */
++ if ((cert = SSL_get_peer_certificate(ssl))) {
++ if (sslconn->client_cert) {
++ X509_free(sslconn->client_cert);
+ }
- ctx = SSL_get_SSL_CTX(ssl);
-- }
++ sslconn->client_cert = cert;
++ sslconn->client_dn = NULL;
+ }
-
-- /*
++
+ /*
- * Support for SSLRequireSSL directive
-- */
++ * Finally check for acceptable renegotiation results
+ */
- if (dc->bSSLRequired && !ssl) {
- if ((sc->enabled == SSL_ENABLED_OPTIONAL) && !is_slave) {
- /* This vhost was configured for optional SSL, just tell the
@@ -374,20 +356,40 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
- */
- apr_table_setn(r->err_headers_out, "Upgrade", "TLS/1.0, HTTP/1.1");
- apr_table_setn(r->err_headers_out, "Connection", "Upgrade");
--
++ if ((dc->nVerifyClient != SSL_CVERIFY_NONE) ||
++ (sc->server->auth.verify_mode != SSL_CVERIFY_NONE)) {
++ BOOL do_verify = ((dc->nVerifyClient == SSL_CVERIFY_REQUIRE) ||
++ (sc->server->auth.verify_mode == SSL_CVERIFY_REQUIRE));
++
++ if (do_verify && (SSL_get_verify_result(ssl) != X509_V_OK)) {
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02262)
++ "Re-negotiation handshake failed: "
++ "Client verification failed");
+
- return HTTP_UPGRADE_REQUIRED;
-- }
--
++ return HTTP_FORBIDDEN;
+ }
+
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02219)
- "access to %s failed, reason: %s",
- r->filename, "SSL connection required");
-
- /* remember forbidden access for strict require option */
- apr_table_setn(r->notes, "ssl-access-forbidden", "1");
--
++ if (do_verify) {
++ if (cert == NULL) {
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02263)
++ "Re-negotiation handshake failed: "
++ "Client certificate missing");
+
- return HTTP_FORBIDDEN;
-- }
--
++ return HTTP_FORBIDDEN;
++ }
++ }
+ }
++ return OK;
++}
+
- /*
- * Check to see whether SSL is in use; if it's not, then no
- * further access control checks are relevant. (the test for
@@ -396,11 +398,28 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
- if (sc->enabled == SSL_ENABLED_FALSE || !ssl) {
- return DECLINED;
- }
--
++/*
++ * Access Handler, classic flavour, for SSL/TLS up to v1.2
++ * where everything can be renegotiated and no one is happy.
++ */
++static int ssl_hook_Access_classic(request_rec *r, SSLSrvConfigRec *sc, SSLDirConfigRec *dc,
++ SSLConnRec *sslconn, SSL *ssl)
++{
++ server_rec *handshakeserver = sslconn ? sslconn->server : NULL;
++ SSLSrvConfigRec *hssc = handshakeserver? mySrvConfig(handshakeserver) : NULL;
++ SSL_CTX *ctx = NULL;
++ BOOL renegotiate = FALSE, renegotiate_quick = FALSE;
++ X509 *peercert;
++ X509_STORE *cert_store = NULL;
++ X509_STORE_CTX *cert_store_ctx;
++ STACK_OF(SSL_CIPHER) *cipher_list_old = NULL, *cipher_list = NULL;
++ const SSL_CIPHER *cipher = NULL;
++ int depth, verify_old, verify, n, rc;
++ const char *ncipher_suite;
+
#ifdef HAVE_SRP
/*
- * Support for per-directory reconfigured SSL connection parameters
-@@ -581,7 +564,7 @@
+@@ -581,7 +570,7 @@
}
/* configure new state */
@@ -409,7 +428,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
/* TODO: this categorically fails changed cipher suite settings
* on slave connections. We could do better by
* - create a new SSL* from our SSL_CTX and set cipher suite there,
-@@ -659,7 +642,7 @@
+@@ -659,7 +648,7 @@
}
if (renegotiate) {
@@ -418,7 +437,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
/* The request causes renegotiation on a slave connection.
* This is not allowed since we might have concurrent requests
* on this connection.
-@@ -732,7 +715,7 @@
+@@ -732,7 +721,7 @@
(verify & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)))
{
renegotiate = TRUE;
@@ -427,8 +446,29 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
/* The request causes renegotiation on a slave connection.
* This is not allowed since we might have concurrent requests
* on this connection.
-@@ -1050,30 +1033,8 @@
+@@ -885,6 +874,7 @@
+
+ if (renegotiate_quick) {
+ STACK_OF(X509) *cert_stack;
++ X509 *cert;
+
+ /* perform just a manual re-verification of the peer */
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02258)
+@@ -1037,43 +1027,10 @@
+ }
+
/*
+- * Remember the peer certificate's DN
+- */
+- if ((cert = SSL_get_peer_certificate(ssl))) {
+- if (sslconn->client_cert) {
+- X509_free(sslconn->client_cert);
+- }
+- sslconn->client_cert = cert;
+- sslconn->client_dn = NULL;
+- }
+-
+- /*
* Finally check for acceptable renegotiation results
*/
- if ((dc->nVerifyClient != SSL_CVERIFY_NONE) ||
@@ -455,16 +495,19 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
-
- X509_free(peercert);
- }
-+ if (OK != (rc = ssl_check_post_client_verify(r, sc, dc, ssl))) {
++ if (OK != (rc = ssl_check_post_client_verify(r, sc, dc, sslconn, ssl))) {
+ return rc;
}
/*
-@@ -1167,6 +1128,195 @@
- return DECLINED;
- }
+@@ -1096,6 +1053,215 @@
+ }
+ }
-+#ifdef SSL_OP_NO_TLSv1_3
++ return DECLINED;
++}
++
++#if SSL_HAVE_PROTOCOL_TLSV1_3
+/*
+ * Access Handler, modern flavour, for SSL/TLS v1.3 and onward.
+ * Only client certificates can be requested, everything else stays.
@@ -557,8 +600,16 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO() "verify client post handshake");
+
+ SSL_set_verify(ssl, vmode_needed, ssl_callback_SSLVerify);
-+ SSL_verify_client_post_handshake(ssl);
+
++ if (SSL_verify_client_post_handshake(ssl) != 1) {
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10158)
++ "cannot perform post-handshake authentication");
++ ssl_log_ssl_error(SSLLOG_MARK, APLOG_ERR, r->server);
++ apr_table_setn(r->notes, "error-notes",
++ "Reason: Cannot perform Post-Handshake Authentication. ");
++ return HTTP_FORBIDDEN;
++ }
++
+ old_state = sslconn->reneg_state;
+ sslconn->reneg_state = RENEG_ALLOW;
+ modssl_set_app_data2(ssl, r);
@@ -576,7 +627,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
+ /*
+ * Finally check for acceptable renegotiation results
+ */
-+ if (OK != (rc = ssl_check_post_client_verify(r, sc, dc, ssl))) {
++ if (OK != (rc = ssl_check_post_client_verify(r, sc, dc, sslconn, ssl))) {
+ return rc;
+ }
+ }
@@ -592,6 +643,9 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
+ SSLSrvConfigRec *sc = mySrvConfig(r->server);
+ SSLConnRec *sslconn = myConnConfig(r->connection);
+ SSL *ssl = sslconn ? sslconn->ssl : NULL;
++ apr_array_header_t *requires;
++ ssl_require_t *ssl_requires;
++ int ok, i, ret;
+
+ /* On a slave connection, we do not expect to have an SSLConnRec, but
+ * our master connection might have one. */
@@ -643,20 +697,26 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
+ return DECLINED;
+ }
+
-+#ifdef SSL_OP_NO_TLSv1_3
++#if SSL_HAVE_PROTOCOL_TLSV1_3
+ /* TLSv1.3+ is less complicated here. Branch off into a new codeline
+ * and avoid messing with the past. */
+ if (SSL_version(ssl) >= TLS1_3_VERSION) {
-+ return ssl_hook_Access_modern(r, sc, dc, sslconn, ssl);
-+ }
++ ret = ssl_hook_Access_modern(r, sc, dc, sslconn, ssl);
++ }
++ else
+#endif
-+ return ssl_hook_Access_classic(r, sc, dc, sslconn, ssl);
-+}
++ {
++ ret = ssl_hook_Access_classic(r, sc, dc, sslconn, ssl);
++ }
+
- /*
- * Authentication Handler:
- * Fake a Basic authentication from the X509 client certificate.
-@@ -2080,31 +2230,43 @@
++ if (ret != DECLINED) {
++ return ret;
++ }
++
+ /* If we're trying to have the user name set from a client
+ * certificate then we need to set it here. This should be safe as
+ * the user name probably isn't important from an auth checking point
+@@ -2080,31 +2246,43 @@
{
conn_rec *c;
server_rec *s;
@@ -680,6 +740,10 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
+#endif
+ {
+ SSLConnRec *sslconn;
++
++ if ((sslconn = myConnConfig(c)) == NULL) {
++ return;
++ }
- /* If the reneg state is to reject renegotiations, check the SSL
- * state machine and move to ABORT if a Client Hello is being
@@ -688,10 +752,6 @@ http://svn.apache.org/viewvc?view=revision&revision=1833588
- (where & SSL_CB_HANDSHAKE_START) &&
- scr->reneg_state == RENEG_REJECT) {
- scr->reneg_state = RENEG_ABORT;
-+ if ((sslconn = myConnConfig(c)) == NULL) {
-+ return;
-+ }
-+
+ /* If the reneg state is to reject renegotiations, check the SSL
+ * state machine and move to ABORT if a Client Hello is being
+ * read. */
diff --git a/httpd-2.4.34-sslciphdefault.patch b/httpd-2.4.34-sslciphdefault.patch
new file mode 100644
index 0000000..6060f24
--- /dev/null
+++ b/httpd-2.4.34-sslciphdefault.patch
@@ -0,0 +1,34 @@
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1109119
+
+Don't prepend !aNULL etc if PROFILE= is used with SSLCipherSuite.
+
+--- httpd-2.4.34/modules/ssl/ssl_engine_config.c.sslciphdefault
++++ httpd-2.4.34/modules/ssl/ssl_engine_config.c
+@@ -774,9 +774,11 @@
+ }
+
+ if (!strcmp("SSL", arg1)) {
+- /* always disable null and export ciphers */
+- arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
+ if (cmd->path) {
++ /* Disable null and export ciphers by default, except for PROFILE=
++ * configs where the parser doesn't cope. */
++ if (strncmp(arg2, "PROFILE=", 8) != 0)
++ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
+ dc->szCipherSuite = arg2;
+ }
+ else {
+@@ -1540,8 +1542,10 @@
+ }
+
+ if (!strcmp("SSL", arg1)) {
+- /* always disable null and export ciphers */
+- arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
++ /* Disable null and export ciphers by default, except for PROFILE=
++ * configs where the parser doesn't cope. */
++ if (strncmp(arg2, "PROFILE=", 8) != 0)
++ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
+ dc->proxy->auth.cipher_suite = arg2;
+ return NULL;
+ }
diff --git a/httpd.spec b/httpd.spec
index 697b97e..6640f65 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.34
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -73,9 +73,9 @@ Patch29: httpd-2.4.33-systemd.patch
Patch30: httpd-2.4.4-cachehardmax.patch
Patch31: httpd-2.4.33-sslmultiproxy.patch
Patch34: httpd-2.4.17-socket-activation.patch
-Patch35: httpd-2.4.33-sslciphdefault.patch
Patch36: httpd-2.4.33-r1830819+.patch
Patch37: httpd-2.4.34-r1827912+.patch
+Patch38: httpd-2.4.34-sslciphdefault.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -235,9 +235,9 @@ interface for storing and accessing per-user session data.
%patch30 -p1 -b .cachehardmax
#patch31 -p1 -b .sslmultiproxy
%patch34 -p1 -b .socketactivation
-%patch35 -p1 -b .sslciphdefault
%patch36 -p1 -b .r1830819+
%patch37 -p1 -b .r1827912+
+%patch38 -p1 -b .sslciphdefault
%patch58 -p1 -b .r1738878
%patch59 -p1 -b .r1555631
@@ -729,6 +729,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Tue Sep 18 2018 Joe Orton - 2.4.34-6
+- mod_ssl: more TLSv1.3 fixes (#1619389)
+
* Tue Aug 21 2018 Joe Orton - 2.4.34-5
- mod_ssl: further TLSv1.3 fix (#1619389)
From 86433978a1e5820ebe5ece19a64cebf77053910b Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Fri, 21 Sep 2018 13:07:38 +0100
Subject: [PATCH 006/231] mod_ssl: follow OpenSSL protocol defaults if
SSLProtocol is not configured (Rob Crittenden, #1618371) Resolves:
rhbz#1618371
---
httpd-2.4.34-sslprotdefault.patch | 53 +++++++++++++++++++++++++++++++
httpd.spec | 8 ++++-
2 files changed, 60 insertions(+), 1 deletion(-)
create mode 100644 httpd-2.4.34-sslprotdefault.patch
diff --git a/httpd-2.4.34-sslprotdefault.patch b/httpd-2.4.34-sslprotdefault.patch
new file mode 100644
index 0000000..65f8d40
--- /dev/null
+++ b/httpd-2.4.34-sslprotdefault.patch
@@ -0,0 +1,53 @@
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1618371
+
+--- httpd-2.4.34/modules/ssl/ssl_engine_config.c.sslprotdefault
++++ httpd-2.4.34/modules/ssl/ssl_engine_config.c
+@@ -119,7 +119,7 @@
+ mctx->ticket_key = NULL;
+ #endif
+
+- mctx->protocol = SSL_PROTOCOL_DEFAULT;
++ mctx->protocol = SSL_PROTOCOL_NONE;
+ mctx->protocol_set = 0;
+
+ mctx->pphrase_dialog_type = SSL_PPTYPE_UNSET;
+--- httpd-2.4.34/modules/ssl/ssl_engine_init.c.sslprotdefault
++++ httpd-2.4.34/modules/ssl/ssl_engine_init.c
+@@ -555,9 +555,8 @@
+ * Create the new per-server SSL context
+ */
+ if (protocol == SSL_PROTOCOL_NONE) {
+- ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02231)
+- "No SSL protocols available [hint: SSLProtocol]");
+- return ssl_die(s);
++ ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s,
++ "Using OpenSSL/system default SSL/TLS protocols");
+ }
+
+ cp = apr_pstrcat(p,
+@@ -673,14 +672,8 @@
+ } else if (protocol & SSL_PROTOCOL_SSLV3) {
+ prot = SSL3_VERSION;
+ #endif
+- } else {
+- SSL_CTX_free(ctx);
+- mctx->ssl_ctx = NULL;
+- ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(03378)
+- "No SSL protocols available [hint: SSLProtocol]");
+- return ssl_die(s);
+ }
+- SSL_CTX_set_max_proto_version(ctx, prot);
++ if (protocol != SSL_PROTOCOL_NONE) SSL_CTX_set_max_proto_version(ctx, prot);
+
+ /* Next we scan for the minimal protocol version we should provide,
+ * but we do not allow holes between max and min */
+@@ -700,7 +693,7 @@
+ prot = SSL3_VERSION;
+ }
+ #endif
+- SSL_CTX_set_min_proto_version(ctx, prot);
++ if (protocol != SSL_PROTOCOL_NONE) SSL_CTX_set_min_proto_version(ctx, prot);
+ #endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L */
+
+ #ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
diff --git a/httpd.spec b/httpd.spec
index 6640f65..7b97a69 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.34
-Release: 6%{?dist}
+Release: 7%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -76,6 +76,7 @@ Patch34: httpd-2.4.17-socket-activation.patch
Patch36: httpd-2.4.33-r1830819+.patch
Patch37: httpd-2.4.34-r1827912+.patch
Patch38: httpd-2.4.34-sslciphdefault.patch
+Patch39: httpd-2.4.34-sslprotdefault.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -238,6 +239,7 @@ interface for storing and accessing per-user session data.
%patch36 -p1 -b .r1830819+
%patch37 -p1 -b .r1827912+
%patch38 -p1 -b .sslciphdefault
+%patch39 -p1 -b .sslprotdefault
%patch58 -p1 -b .r1738878
%patch59 -p1 -b .r1555631
@@ -729,6 +731,10 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Fri Sep 21 2018 Joe Orton - 2.4.34-7
+- mod_ssl: follow OpenSSL protocol defaults if SSLProtocol
+ is not configured (Rob Crittenden, #1618371)
+
* Tue Sep 18 2018 Joe Orton - 2.4.34-6
- mod_ssl: more TLSv1.3 fixes (#1619389)
From e6f56309054391f226d45bafc1b9b5b1dc87cf2e Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Fri, 21 Sep 2018 15:22:11 +0100
Subject: [PATCH 007/231] comment-out SSLProtocol, SSLProxyProtocol from
ssl.conf in default configuration; now follow OpenSSL system default
(#1468322) Resolves: rhbz#1468322
---
httpd.spec | 6 +++++-
ssl.conf | 17 ++++++++---------
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/httpd.spec b/httpd.spec
index 9ddb745..6ee6bea 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.34
-Release: 7%{?dist}
+Release: 8%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -733,6 +733,10 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Fri Sep 21 2018 Joe Orton - 2.4.34-8
+- comment-out SSLProtocol, SSLProxyProtocol from ssl.conf in
+ default configuration; now follow OpenSSL system default (#1468322)
+
* Fri Sep 21 2018 Joe Orton - 2.4.34-7
- mod_ssl: follow OpenSSL protocol defaults if SSLProtocol
is not configured (Rob Crittenden, #1618371)
diff --git a/ssl.conf b/ssl.conf
index a07bd8f..373b9e5 100644
--- a/ssl.conf
+++ b/ssl.conf
@@ -70,11 +70,10 @@ LogLevel warn
SSLEngine on
# List the protocol versions which clients are allowed to connect with.
-# Disable SSLv3 by default (cf. RFC 7525 3.1.1). TLSv1 (1.0) should be
-# disabled as quickly as practical. By the end of 2016, only the TLSv1.2
-# protocol or later should remain in use.
-SSLProtocol all -SSLv3
-SSLProxyProtocol all -SSLv3
+# The OpenSSL system profile is configured by default. See
+# update-crypto-policies(8) for more details.
+#SSLProtocol all -SSLv3
+#SSLProxyProtocol all -SSLv3
# User agents such as web browsers are not configured for the user's
# own preference of either security or performance, therefore this
@@ -83,10 +82,10 @@ SSLProxyProtocol all -SSLv3
SSLHonorCipherOrder on
# SSL Cipher Suite:
-# List the ciphers that the client is permitted to negotiate.
-# See the mod_ssl documentation for a complete list.
-# The OpenSSL system profile is configured by default. See
-# update-crypto-policies(8) for more details.
+# List the ciphers that the client is permitted to negotiate.
+# See the mod_ssl documentation for a complete list.
+# The OpenSSL system profile is configured by default. See
+# update-crypto-policies(8) for more details.
SSLCipherSuite PROFILE=SYSTEM
SSLProxyCipherSuite PROFILE=SYSTEM
From 1f748ace31801b5aad9f970bd913474f4b059c58 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Tue, 25 Sep 2018 09:43:59 +0100
Subject: [PATCH 008/231] fix build if OpenSSL built w/o SSLv3 support
---
httpd-2.4.34-enable-sslv3.patch | 25 +++++++++++++------------
httpd.spec | 7 +++++--
2 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/httpd-2.4.34-enable-sslv3.patch b/httpd-2.4.34-enable-sslv3.patch
index f559bf9..a2eba80 100644
--- a/httpd-2.4.34-enable-sslv3.patch
+++ b/httpd-2.4.34-enable-sslv3.patch
@@ -1,21 +1,22 @@
-diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c
-index 517ce30..075f7e1 100644
---- a/modules/ssl/ssl_engine_config.c
-+++ b/modules/ssl/ssl_engine_config.c
-@@ -1474,6 +1474,8 @@ static const char *ssl_cmd_protocol_parse(cmd_parms *parms,
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1623165
+
+--- httpd-2.4.34/modules/ssl/ssl_engine_config.c.enable-sslv3
++++ httpd-2.4.34/modules/ssl/ssl_engine_config.c
+@@ -1474,6 +1474,10 @@
#endif
else if (strcEQ(w, "all")) {
thisopt = SSL_PROTOCOL_ALL;
-+ // by default, ALL kw doesn't turn on SSLv3
++#ifndef OPENSSL_NO_SSL3
++ /* by default, ALL kw doesn't turn on SSLv3 */
+ thisopt &= ~SSL_PROTOCOL_SSLV3;
++#endif
}
else {
return apr_pstrcat(parms->temp_pool,
-diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
-index 60df45f..f6645c2 100644
---- a/modules/ssl/ssl_engine_init.c
-+++ b/modules/ssl/ssl_engine_init.c
-@@ -537,6 +537,28 @@ static apr_status_t ssl_init_ctx_tls_extensions(server_rec *s,
+--- httpd-2.4.34/modules/ssl/ssl_engine_init.c.enable-sslv3
++++ httpd-2.4.34/modules/ssl/ssl_engine_init.c
+@@ -537,6 +537,28 @@
}
#endif
@@ -44,7 +45,7 @@ index 60df45f..f6645c2 100644
static apr_status_t ssl_init_ctx_protocol(server_rec *s,
apr_pool_t *p,
apr_pool_t *ptemp,
-@@ -695,9 +719,13 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
+@@ -687,9 +709,13 @@
}
if (prot == TLS1_1_VERSION && protocol & SSL_PROTOCOL_TLSV1) {
prot = TLS1_VERSION;
diff --git a/httpd.spec b/httpd.spec
index 6ee6bea..5d42dca 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.34
-Release: 8%{?dist}
+Release: 9%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -244,7 +244,7 @@ interface for storing and accessing per-user session data.
%patch58 -p1 -b .r1738878
%patch59 -p1 -b .r1555631
-%patch60 -p1 -b .enablesslv3
+%patch60 -p1 -b .enable-sslv3
# Patch in the vendor string
sed -i '/^#define PLATFORM/s/Unix/%{vstring}/' os/unix/os.h
@@ -733,6 +733,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Tue Sep 25 2018 Joe Orton - 2.4.34-9
+- fix build if OpenSSL built w/o SSLv3 support
+
* Fri Sep 21 2018 Joe Orton - 2.4.34-8
- comment-out SSLProtocol, SSLProxyProtocol from ssl.conf in
default configuration; now follow OpenSSL system default (#1468322)
From f201a4ebc1cf1111d8a761dc9c0ba6662bd463fb Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Fri, 28 Sep 2018 08:51:19 +0100
Subject: [PATCH 009/231] apachectl: don't read /etc/sysconfig/httpd
---
...d.patch => httpd-2.4.34-apctlsystemd.patch | 24 ++++++++++++++-----
httpd.spec | 7 ++++--
2 files changed, 23 insertions(+), 8 deletions(-)
rename httpd-2.4.3-apctl-systemd.patch => httpd-2.4.34-apctlsystemd.patch (63%)
diff --git a/httpd-2.4.3-apctl-systemd.patch b/httpd-2.4.34-apctlsystemd.patch
similarity index 63%
rename from httpd-2.4.3-apctl-systemd.patch
rename to httpd-2.4.34-apctlsystemd.patch
index c6bf5da..996978c 100644
--- a/httpd-2.4.3-apctl-systemd.patch
+++ b/httpd-2.4.34-apctlsystemd.patch
@@ -5,17 +5,29 @@ Note: "apachectl graceful" is documented to start httpd if not running.
Upstream-Status: vendor specific patch
---- httpd-2.4.18/support/apachectl.in.apctlsystemd
-+++ httpd-2.4.18/support/apachectl.in
-@@ -100,9 +100,28 @@ fi
+--- httpd-2.4.34/support/apachectl.in.apctlsystemd
++++ httpd-2.4.34/support/apachectl.in
+@@ -58,11 +58,6 @@
+ # have one, then status and fullstatus will not work.
+ STATUSURL="http://localhost:@PORT@/server-status"
+
+-# Source /etc/sysconfig/httpd for $HTTPD setting, etc.
+-if [ -r /etc/sysconfig/httpd ]; then
+- . /etc/sysconfig/httpd
+-fi
+-
+ #
+ # Set this variable to a command that increases the maximum
+ # number of file descriptors allowed per child process. This is
+@@ -100,9 +95,28 @@
ERROR=$?
}
+if [ "x$2" != "x" ] ; then
+ echo Passing arguments to httpd using apachectl is no longer supported.
+ echo You can only start/stop/restart httpd using this script.
-+ echo If you want to pass extra arguments to httpd, edit the
-+ echo /etc/sysconfig/httpd config file.
++ echo To pass extra arguments to httpd, see the httpd.service(8)
++ echo man page.
+fi
+
case $ACMD in
@@ -38,7 +50,7 @@ Upstream-Status: vendor specific patch
ERROR=$?
;;
startssl|sslstart|start-SSL)
-@@ -114,10 +133,6 @@ startssl|sslstart|start-SSL)
+@@ -114,10 +128,6 @@
configtest)
testconfig
;;
diff --git a/httpd.spec b/httpd.spec
index 5d42dca..8938613 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.34
-Release: 9%{?dist}
+Release: 10%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -59,7 +59,7 @@ Patch1: httpd-2.4.1-apctl.patch
Patch2: httpd-2.4.9-apxs.patch
Patch3: httpd-2.4.1-deplibs.patch
Patch4: httpd-2.4.34-layfix.patch
-Patch6: httpd-2.4.3-apctl-systemd.patch
+Patch6: httpd-2.4.34-apctlsystemd.patch
# Needed for socket activation and mod_systemd patch
Patch19: httpd-2.4.25-detect-systemd.patch
# Features/functional changes
@@ -733,6 +733,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Fri Sep 28 2018 Joe Orton - 2.4.34-10
+- apachectl: don't read /etc/sysconfig/httpd
+
* Tue Sep 25 2018 Joe Orton - 2.4.34-9
- fix build if OpenSSL built w/o SSLv3 support
From c72daf66bd5b17af39b0707234d0650118b52815 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Wed, 31 Oct 2018 10:01:24 +0000
Subject: [PATCH 010/231] add htcacheclean.service(8) man page
---
.gitignore | 1 +
htcacheclean.service | 3 +-
htcacheclean.service.xml | 123 +++++++++++++++++++++++++++++++++++++++
httpd.spec | 9 ++-
4 files changed, 133 insertions(+), 3 deletions(-)
create mode 100644 htcacheclean.service.xml
diff --git a/.gitignore b/.gitignore
index 4f0a93f..00acede 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,4 @@ x86_64
/httpd-*.tar.bz2
/httpd*.8
/results_httpd
+/htcacheclean.service.8
diff --git a/htcacheclean.service b/htcacheclean.service
index 166067b..d1e9d60 100644
--- a/htcacheclean.service
+++ b/htcacheclean.service
@@ -1,6 +1,7 @@
[Unit]
-Description=Disk Cache Cleaning Daemon for Apache HTTP Server
+Description=Disk Cache Cleaning Daemon for the Apache HTTP Server
After=httpd.service
+Documentation=man:htcacheclean.service(8)
[Service]
Type=forking
diff --git a/htcacheclean.service.xml b/htcacheclean.service.xml
new file mode 100644
index 0000000..d771ae7
--- /dev/null
+++ b/htcacheclean.service.xml
@@ -0,0 +1,123 @@
+
+
+
+
+
+ htcacheclean systemd unit
+ httpd
+ AuthorOrtonJoejorton@redhat.com
+
+
+
+ htcacheclean.service
+ 8
+
+
+
+ htcacheclean.service
+ htcacheclean unit file for systemd
+
+
+
+
+ /usr/lib/systemd/system/htcacheclean.service
+
+
+
+
+ Description
+
+ This manual page describes the systemd
+ unit file for the htcacheclean daemon. This
+ unit file provides a service which runs
+ htcacheclean is run in daemon mode,
+ periodically cleaning the disk cache root to ensure disk space
+ usage is within configured limits.
+
+
+
+
+ Options
+
+ The service is configured by configuration file
+ /etc/sysconfig/htcacheclean. The following
+ variables are used, following standard systemd
+ EnvironmentFile= syntax:
+
+
+
+ INTERVAL=
+
+ Sets the interval between cache clean runs, in
+ minutes. By default this is configured as
+ 15.
+
+
+
+ CACHE_ROOT=
+
+ Sets the directory name used for the cache
+ root. By default this is configured as
+ /var/cache/httpd/proxy.
+
+
+
+ LIMIT=
+
+ Sets the total disk cache space limit, in
+ bytes. Use a K or M
+ suffix to signify kilobytes or megabytes. By default this is
+ set to 100M.
+
+
+
+ OPTIONS=
+
+ Any other options to pass to
+ htcacheclean.
+
+
+
+
+
+ Files
+
+ /usr/lib/systemd/system/htcacheclean.service,
+ /etc/sysconfig/htcacheclean
+
+
+
+ See also
+
+
+ htcacheclean8,
+ httpd8,
+ httpd.service8,
+ systemd.exec8
+
+
+
+
+
+
diff --git a/httpd.spec b/httpd.spec
index 8938613..85d661c 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.34
-Release: 10%{?dist}
+Release: 11%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -49,6 +49,7 @@ Source29: 01-md.conf
Source30: README.confd
Source31: README.confmod
Source32: httpd.service.xml
+Source33: htcacheclean.service.xml
Source40: htcacheclean.service
Source41: htcacheclean.sysconf
Source42: httpd-init.service
@@ -275,6 +276,7 @@ sed 's/@MPM@/%{mpm}/' < $RPM_SOURCE_DIR/httpd.service.xml \
> httpd.service.xml
xmlto man ./httpd.service.xml
+xmlto man $RPM_SOURCE_DIR/htcacheclean.service.xml
: Building with MMN %{mmn}, MMN-ISA %{mmnisa}
: Default MPM is %{mpm}, vendor string is '%{vstring}'
@@ -497,7 +499,7 @@ install -m 644 -p $RPM_SOURCE_DIR/httpd.logrotate \
# Install systemd service man pages
install -m 644 -p httpd.service.8 httpd-init.service.8 httpd.socket.8 \
- httpd@.service.8 \
+ httpd@.service.8 htcacheclean.service.8 \
$RPM_BUILD_ROOT%{_mandir}/man8
# fix man page paths
@@ -733,6 +735,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Wed Oct 31 2018 Joe Orton - 2.4.34-11
+- add htcacheclean.service(8) man page
+
* Fri Sep 28 2018 Joe Orton - 2.4.34-10
- apachectl: don't read /etc/sysconfig/httpd
From e869b8b79917f05a480544aa297c36a45f0136bc Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Wed, 31 Oct 2018 10:08:18 +0000
Subject: [PATCH 011/231] update to 2.4.37
---
httpd-2.4.34-layfix.patch | 24 -
httpd-2.4.34-r1555631.patch | 14 -
httpd-2.4.34-r1827912+.patch | 858 -----------------------------------
httpd.spec | 13 +-
sources | 2 +-
5 files changed, 6 insertions(+), 905 deletions(-)
delete mode 100644 httpd-2.4.34-layfix.patch
delete mode 100644 httpd-2.4.34-r1555631.patch
delete mode 100644 httpd-2.4.34-r1827912+.patch
diff --git a/httpd-2.4.34-layfix.patch b/httpd-2.4.34-layfix.patch
deleted file mode 100644
index 39728a1..0000000
--- a/httpd-2.4.34-layfix.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- httpd-2.4.34/config.layout.layfix
-+++ httpd-2.4.34/config.layout
-@@ -133,6 +133,7 @@
- # Layout used in Fedora httpd packaging.
-
- prefix: /usr
-+ localstatedir: /var
- exec_prefix: ${prefix}
- bindir: ${prefix}/bin
- sbindir: ${prefix}/sbin
-@@ -144,11 +145,10 @@
- installbuilddir: ${libdir}/httpd/build
- errordir: ${datadir}/error
- iconsdir: ${datadir}/icons
-- htdocsdir: /var/www/html
-+ htdocsdir: ${localstatedir}/www/html
- manualdir: ${datadir}/manual
-- cgidir: /var/www/cgi-bin
-+ cgidir: ${localstatedir}/www/cgi-bin
- includedir: ${prefix}/include/httpd
-- localstatedir: /var
- runtimedir: /run/httpd
- logfiledir: ${localstatedir}/log/httpd
- proxycachedir: ${localstatedir}/cache/httpd/proxy
diff --git a/httpd-2.4.34-r1555631.patch b/httpd-2.4.34-r1555631.patch
deleted file mode 100644
index 7ca9478..0000000
--- a/httpd-2.4.34-r1555631.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-# ./pullrev.sh 1555631
-http://svn.apache.org/viewvc?view=revision&revision=1555631
-
---- httpd-2.4.34/modules/ssl/ssl_engine_ocsp.c
-+++ httpd-2.4.34/modules/ssl/ssl_engine_ocsp.c
-@@ -61,7 +61,7 @@
- /* Use default responder URL if forced by configuration, else use
- * certificate-specified responder, falling back to default if
- * necessary and possible. */
-- if (sc->server->ocsp_force_default) {
-+ if (sc->server->ocsp_force_default == TRUE) {
- s = sc->server->ocsp_responder;
- }
- else {
diff --git a/httpd-2.4.34-r1827912+.patch b/httpd-2.4.34-r1827912+.patch
deleted file mode 100644
index 98c7ac8..0000000
--- a/httpd-2.4.34-r1827912+.patch
+++ /dev/null
@@ -1,858 +0,0 @@
-
-Pull all changes from upstream integration branch:
-
-svn diff -r1840105:1841219 https://svn.apache.org/repos/asf/httpd/httpd/branches/tlsv1.3-for-2.4.x
-
---- httpd-2.4.34/modules/ssl/mod_ssl.c.r1827912+
-+++ httpd-2.4.34/modules/ssl/mod_ssl.c
-@@ -93,9 +93,9 @@
- SSL_CMD_SRV(FIPS, FLAG,
- "Enable FIPS-140 mode "
- "(`on', `off')")
-- SSL_CMD_ALL(CipherSuite, TAKE1,
-- "Colon-delimited list of permitted SSL Ciphers "
-- "('XXX:...:XXX' - see manual)")
-+ SSL_CMD_ALL(CipherSuite, TAKE12,
-+ "Colon-delimited list of permitted SSL Ciphers, optional preceeded "
-+ "by protocol identifier ('XXX:...:XXX' - see manual)")
- SSL_CMD_SRV(CertificateFile, TAKE1,
- "SSL Server Certificate file "
- "('/path/to/file' - PEM or DER encoded)")
-@@ -185,9 +185,9 @@
- SSL_CMD_PXY(ProxyProtocol, RAW_ARGS,
- "SSL Proxy: enable or disable SSL protocol flavors "
- "('[+-][" SSL_PROTOCOLS "] ...' - see manual)")
-- SSL_CMD_PXY(ProxyCipherSuite, TAKE1,
-+ SSL_CMD_PXY(ProxyCipherSuite, TAKE12,
- "SSL Proxy: colon-delimited list of permitted SSL ciphers "
-- "('XXX:...:XXX' - see manual)")
-+ ", optionally preceeded by protocol specifier ('XXX:...:XXX' - see manual)")
- SSL_CMD_PXY(ProxyVerify, TAKE1,
- "SSL Proxy: whether to verify the remote certificate "
- "('on' or 'off')")
-@@ -398,7 +398,7 @@
- /* We must register the library in full, to ensure our configuration
- * code can successfully test the SSL environment.
- */
--#if MODSSL_USE_OPENSSL_PRE_1_1_API
-+#if MODSSL_USE_OPENSSL_PRE_1_1_API || defined(LIBRESSL_VERSION_NUMBER)
- (void)CRYPTO_malloc_init();
- #else
- OPENSSL_malloc_init();
---- httpd-2.4.34/modules/ssl/ssl_engine_config.c.r1827912+
-+++ httpd-2.4.34/modules/ssl/ssl_engine_config.c
-@@ -136,6 +136,7 @@
- mctx->auth.cipher_suite = NULL;
- mctx->auth.verify_depth = UNSET;
- mctx->auth.verify_mode = SSL_CVERIFY_UNSET;
-+ mctx->auth.tls13_ciphers = NULL;
-
- mctx->ocsp_mask = UNSET;
- mctx->ocsp_force_default = UNSET;
-@@ -280,6 +281,7 @@
- cfgMergeString(auth.cipher_suite);
- cfgMergeInt(auth.verify_depth);
- cfgMerge(auth.verify_mode, SSL_CVERIFY_UNSET);
-+ cfgMergeString(auth.tls13_ciphers);
-
- cfgMergeInt(ocsp_mask);
- cfgMergeBool(ocsp_force_default);
-@@ -761,22 +763,37 @@
-
- const char *ssl_cmd_SSLCipherSuite(cmd_parms *cmd,
- void *dcfg,
-- const char *arg)
-+ const char *arg1, const char *arg2)
- {
- SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
- SSLDirConfigRec *dc = (SSLDirConfigRec *)dcfg;
-
-- /* always disable null and export ciphers */
-- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
--
-- if (cmd->path) {
-- dc->szCipherSuite = arg;
-+ if (arg2 == NULL) {
-+ arg2 = arg1;
-+ arg1 = "SSL";
- }
-- else {
-- sc->server->auth.cipher_suite = arg;
-+
-+ if (!strcmp("SSL", arg1)) {
-+ /* always disable null and export ciphers */
-+ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
-+ if (cmd->path) {
-+ dc->szCipherSuite = arg2;
-+ }
-+ else {
-+ sc->server->auth.cipher_suite = arg2;
-+ }
-+ return NULL;
- }
--
-- return NULL;
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ else if (!strcmp("TLSv1.3", arg1)) {
-+ if (cmd->path) {
-+ return "TLSv1.3 ciphers cannot be set inside a directory context";
-+ }
-+ sc->server->auth.tls13_ciphers = arg2;
-+ return NULL;
-+ }
-+#endif
-+ return apr_pstrcat(cmd->pool, "procotol '", arg1, "' not supported", NULL);
- }
-
- #define SSL_FLAGS_CHECK_FILE \
-@@ -1449,6 +1466,9 @@
- else if (strcEQ(w, "TLSv1.2")) {
- thisopt = SSL_PROTOCOL_TLSV1_2;
- }
-+ else if (SSL_HAVE_PROTOCOL_TLSV1_3 && strcEQ(w, "TLSv1.3")) {
-+ thisopt = SSL_PROTOCOL_TLSV1_3;
-+ }
- #endif
- else if (strcEQ(w, "all")) {
- thisopt = SSL_PROTOCOL_ALL;
-@@ -1510,16 +1530,28 @@
-
- const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *cmd,
- void *dcfg,
-- const char *arg)
-+ const char *arg1, const char *arg2)
- {
- SSLDirConfigRec *dc = (SSLDirConfigRec *)dcfg;
--
-- /* always disable null and export ciphers */
-- arg = apr_pstrcat(cmd->pool, arg, ":!aNULL:!eNULL:!EXP", NULL);
--
-- dc->proxy->auth.cipher_suite = arg;
--
-- return NULL;
-+
-+ if (arg2 == NULL) {
-+ arg2 = arg1;
-+ arg1 = "SSL";
-+ }
-+
-+ if (!strcmp("SSL", arg1)) {
-+ /* always disable null and export ciphers */
-+ arg2 = apr_pstrcat(cmd->pool, arg2, ":!aNULL:!eNULL:!EXP", NULL);
-+ dc->proxy->auth.cipher_suite = arg2;
-+ return NULL;
-+ }
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ else if (!strcmp("TLSv1.3", arg1)) {
-+ dc->proxy->auth.tls13_ciphers = arg2;
-+ return NULL;
-+ }
-+#endif
-+ return apr_pstrcat(cmd->pool, "procotol '", arg1, "' not supported", NULL);
- }
-
- const char *ssl_cmd_SSLProxyVerify(cmd_parms *cmd,
---- httpd-2.4.34/modules/ssl/ssl_engine_init.c.r1827912+
-+++ httpd-2.4.34/modules/ssl/ssl_engine_init.c
-@@ -568,6 +568,9 @@
- #ifdef HAVE_TLSV1_X
- (protocol & SSL_PROTOCOL_TLSV1_1 ? "TLSv1.1, " : ""),
- (protocol & SSL_PROTOCOL_TLSV1_2 ? "TLSv1.2, " : ""),
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ (protocol & SSL_PROTOCOL_TLSV1_3 ? "TLSv1.3, " : ""),
-+#endif
- #endif
- NULL);
- cp[strlen(cp)-2] = NUL;
-@@ -600,6 +603,13 @@
- TLSv1_2_client_method() : /* proxy */
- TLSv1_2_server_method(); /* server */
- }
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ else if (protocol == SSL_PROTOCOL_TLSV1_3) {
-+ method = mctx->pkp ?
-+ TLSv1_3_client_method() : /* proxy */
-+ TLSv1_3_server_method(); /* server */
-+ }
-+#endif
- #endif
- else { /* For multiple protocols, we need a flexible method */
- method = mctx->pkp ?
-@@ -617,7 +627,8 @@
-
- SSL_CTX_set_options(ctx, SSL_OP_ALL);
-
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
-+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20800000L)
- /* always disable SSLv2, as per RFC 6176 */
- SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
-
-@@ -639,10 +650,19 @@
- if (!(protocol & SSL_PROTOCOL_TLSV1_2)) {
- SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1_2);
- }
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ ssl_set_ctx_protocol_option(s, ctx, SSL_OP_NO_TLSv1_3,
-+ protocol & SSL_PROTOCOL_TLSV1_3, "TLSv1.3");
-+#endif
- #endif
-
- #else /* #if OPENSSL_VERSION_NUMBER < 0x10100000L */
- /* We first determine the maximum protocol version we should provide */
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ if (SSL_HAVE_PROTOCOL_TLSV1_3 && (protocol & SSL_PROTOCOL_TLSV1_3)) {
-+ prot = TLS1_3_VERSION;
-+ } else
-+#endif
- if (protocol & SSL_PROTOCOL_TLSV1_2) {
- prot = TLS1_2_VERSION;
- } else if (protocol & SSL_PROTOCOL_TLSV1_1) {
-@@ -664,6 +684,11 @@
-
- /* Next we scan for the minimal protocol version we should provide,
- * but we do not allow holes between max and min */
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ if (prot == TLS1_3_VERSION && protocol & SSL_PROTOCOL_TLSV1_2) {
-+ prot = TLS1_2_VERSION;
-+ }
-+#endif
- if (prot == TLS1_2_VERSION && protocol & SSL_PROTOCOL_TLSV1_1) {
- prot = TLS1_1_VERSION;
- }
-@@ -736,6 +761,13 @@
- SSL_CTX_set_mode(ctx, SSL_MODE_RELEASE_BUFFERS);
- #endif
-
-+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
-+ /* For OpenSSL >=1.1.1, disable auto-retry mode so it's possible
-+ * to consume handshake records without blocking for app-data.
-+ * https://github.com/openssl/openssl/issues/7178 */
-+ SSL_CTX_clear_mode(ctx, SSL_MODE_AUTO_RETRY);
-+#endif
-+
- return APR_SUCCESS;
- }
-
-@@ -888,7 +920,15 @@
- ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
- return ssl_die(s);
- }
--
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ if (mctx->auth.tls13_ciphers
-+ && !SSL_CTX_set_ciphersuites(ctx, mctx->auth.tls13_ciphers)) {
-+ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO()
-+ "Unable to configure permitted TLSv1.3 ciphers");
-+ ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
-+ return ssl_die(s);
-+ }
-+#endif
- return APR_SUCCESS;
- }
-
-@@ -1493,6 +1533,13 @@
- X509_STORE_CTX *sctx;
- X509_STORE *store = SSL_CTX_get_cert_store(mctx->ssl_ctx);
-
-+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
-+ /* For OpenSSL >=1.1.1, turn on client cert support which is
-+ * otherwise turned off by default (by design).
-+ * https://github.com/openssl/openssl/issues/6933 */
-+ SSL_CTX_set_post_handshake_auth(mctx->ssl_ctx, 1);
-+#endif
-+
- SSL_CTX_set_client_cert_cb(mctx->ssl_ctx,
- ssl_callback_proxy_cert);
-
---- httpd-2.4.34/modules/ssl/ssl_engine_kernel.c.r1827912+
-+++ httpd-2.4.34/modules/ssl/ssl_engine_kernel.c
-@@ -188,6 +188,12 @@
- || strcmp(a1->cipher_suite, a2->cipher_suite))) {
- return 0;
- }
-+ /* both have the same ca cipher suite string */
-+ if ((a1->tls13_ciphers != a2->tls13_ciphers)
-+ && (!a1->tls13_ciphers || !a2->tls13_ciphers
-+ || strcmp(a1->tls13_ciphers, a2->tls13_ciphers))) {
-+ return 0;
-+ }
- return 1;
- }
-
-@@ -424,87 +430,70 @@
- }
- }
-
--/*
-- * Access Handler
-- */
--int ssl_hook_Access(request_rec *r)
-+static int ssl_check_post_client_verify(request_rec *r, SSLSrvConfigRec *sc,
-+ SSLDirConfigRec *dc, SSLConnRec *sslconn,
-+ SSL *ssl)
- {
-- SSLDirConfigRec *dc = myDirConfig(r);
-- SSLSrvConfigRec *sc = mySrvConfig(r->server);
-- SSLConnRec *sslconn = myConnConfig(r->connection);
-- SSL *ssl = sslconn ? sslconn->ssl : NULL;
-- server_rec *handshakeserver = sslconn ? sslconn->server : NULL;
-- SSLSrvConfigRec *hssc = handshakeserver? mySrvConfig(handshakeserver) : NULL;
-- SSL_CTX *ctx = NULL;
-- apr_array_header_t *requires;
-- ssl_require_t *ssl_requires;
-- int ok, i;
-- BOOL renegotiate = FALSE, renegotiate_quick = FALSE;
- X509 *cert;
-- X509 *peercert;
-- X509_STORE *cert_store = NULL;
-- X509_STORE_CTX *cert_store_ctx;
-- STACK_OF(SSL_CIPHER) *cipher_list_old = NULL, *cipher_list = NULL;
-- const SSL_CIPHER *cipher = NULL;
-- int depth, verify_old, verify, n, is_slave = 0;
-- const char *ncipher_suite;
--
-- /* On a slave connection, we do not expect to have an SSLConnRec, but
-- * our master connection might have one. */
-- if (!(sslconn && ssl) && r->connection->master) {
-- sslconn = myConnConfig(r->connection->master);
-- ssl = sslconn ? sslconn->ssl : NULL;
-- handshakeserver = sslconn ? sslconn->server : NULL;
-- hssc = handshakeserver? mySrvConfig(handshakeserver) : NULL;
-- is_slave = 1;
-- }
-
-- if (ssl) {
-- /*
-- * We should have handshaken here (on handshakeserver),
-- * otherwise we are being redirected (ErrorDocument) from
-- * a renegotiation failure below. The access is still
-- * forbidden in the latter case, let ap_die() handle
-- * this recursive (same) error.
-- */
-- if (!SSL_is_init_finished(ssl)) {
-- return HTTP_FORBIDDEN;
-+ /*
-+ * Remember the peer certificate's DN
-+ */
-+ if ((cert = SSL_get_peer_certificate(ssl))) {
-+ if (sslconn->client_cert) {
-+ X509_free(sslconn->client_cert);
- }
-- ctx = SSL_get_SSL_CTX(ssl);
-+ sslconn->client_cert = cert;
-+ sslconn->client_dn = NULL;
- }
--
-+
- /*
-- * Support for SSLRequireSSL directive
-+ * Finally check for acceptable renegotiation results
- */
-- if (dc->bSSLRequired && !ssl) {
-- if ((sc->enabled == SSL_ENABLED_OPTIONAL) && !is_slave) {
-- /* This vhost was configured for optional SSL, just tell the
-- * client that we need to upgrade.
-- */
-- apr_table_setn(r->err_headers_out, "Upgrade", "TLS/1.0, HTTP/1.1");
-- apr_table_setn(r->err_headers_out, "Connection", "Upgrade");
-+ if ((dc->nVerifyClient != SSL_CVERIFY_NONE) ||
-+ (sc->server->auth.verify_mode != SSL_CVERIFY_NONE)) {
-+ BOOL do_verify = ((dc->nVerifyClient == SSL_CVERIFY_REQUIRE) ||
-+ (sc->server->auth.verify_mode == SSL_CVERIFY_REQUIRE));
-+
-+ if (do_verify && (SSL_get_verify_result(ssl) != X509_V_OK)) {
-+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02262)
-+ "Re-negotiation handshake failed: "
-+ "Client verification failed");
-
-- return HTTP_UPGRADE_REQUIRED;
-+ return HTTP_FORBIDDEN;
- }
-
-- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02219)
-- "access to %s failed, reason: %s",
-- r->filename, "SSL connection required");
--
-- /* remember forbidden access for strict require option */
-- apr_table_setn(r->notes, "ssl-access-forbidden", "1");
-+ if (do_verify) {
-+ if (cert == NULL) {
-+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02263)
-+ "Re-negotiation handshake failed: "
-+ "Client certificate missing");
-
-- return HTTP_FORBIDDEN;
-+ return HTTP_FORBIDDEN;
-+ }
-+ }
- }
-+ return OK;
-+}
-
-- /*
-- * Check to see whether SSL is in use; if it's not, then no
-- * further access control checks are relevant. (the test for
-- * sc->enabled is probably strictly unnecessary)
-- */
-- if (sc->enabled == SSL_ENABLED_FALSE || !ssl) {
-- return DECLINED;
-- }
-+/*
-+ * Access Handler, classic flavour, for SSL/TLS up to v1.2
-+ * where everything can be renegotiated and no one is happy.
-+ */
-+static int ssl_hook_Access_classic(request_rec *r, SSLSrvConfigRec *sc, SSLDirConfigRec *dc,
-+ SSLConnRec *sslconn, SSL *ssl)
-+{
-+ server_rec *handshakeserver = sslconn ? sslconn->server : NULL;
-+ SSLSrvConfigRec *hssc = handshakeserver? mySrvConfig(handshakeserver) : NULL;
-+ SSL_CTX *ctx = NULL;
-+ BOOL renegotiate = FALSE, renegotiate_quick = FALSE;
-+ X509 *peercert;
-+ X509_STORE *cert_store = NULL;
-+ X509_STORE_CTX *cert_store_ctx;
-+ STACK_OF(SSL_CIPHER) *cipher_list_old = NULL, *cipher_list = NULL;
-+ const SSL_CIPHER *cipher = NULL;
-+ int depth, verify_old, verify, n, rc;
-+ const char *ncipher_suite;
-
- #ifdef HAVE_SRP
- /*
-@@ -581,7 +570,7 @@
- }
-
- /* configure new state */
-- if (is_slave) {
-+ if (r->connection->master) {
- /* TODO: this categorically fails changed cipher suite settings
- * on slave connections. We could do better by
- * - create a new SSL* from our SSL_CTX and set cipher suite there,
-@@ -659,7 +648,7 @@
- }
-
- if (renegotiate) {
-- if (is_slave) {
-+ if (r->connection->master) {
- /* The request causes renegotiation on a slave connection.
- * This is not allowed since we might have concurrent requests
- * on this connection.
-@@ -732,7 +721,7 @@
- (verify & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)))
- {
- renegotiate = TRUE;
-- if (is_slave) {
-+ if (r->connection->master) {
- /* The request causes renegotiation on a slave connection.
- * This is not allowed since we might have concurrent requests
- * on this connection.
-@@ -885,6 +874,7 @@
-
- if (renegotiate_quick) {
- STACK_OF(X509) *cert_stack;
-+ X509 *cert;
-
- /* perform just a manual re-verification of the peer */
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02258)
-@@ -1037,43 +1027,10 @@
- }
-
- /*
-- * Remember the peer certificate's DN
-- */
-- if ((cert = SSL_get_peer_certificate(ssl))) {
-- if (sslconn->client_cert) {
-- X509_free(sslconn->client_cert);
-- }
-- sslconn->client_cert = cert;
-- sslconn->client_dn = NULL;
-- }
--
-- /*
- * Finally check for acceptable renegotiation results
- */
-- if ((dc->nVerifyClient != SSL_CVERIFY_NONE) ||
-- (sc->server->auth.verify_mode != SSL_CVERIFY_NONE)) {
-- BOOL do_verify = ((dc->nVerifyClient == SSL_CVERIFY_REQUIRE) ||
-- (sc->server->auth.verify_mode == SSL_CVERIFY_REQUIRE));
--
-- if (do_verify && (SSL_get_verify_result(ssl) != X509_V_OK)) {
-- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02262)
-- "Re-negotiation handshake failed: "
-- "Client verification failed");
--
-- return HTTP_FORBIDDEN;
-- }
--
-- if (do_verify) {
-- if ((peercert = SSL_get_peer_certificate(ssl)) == NULL) {
-- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02263)
-- "Re-negotiation handshake failed: "
-- "Client certificate missing");
--
-- return HTTP_FORBIDDEN;
-- }
--
-- X509_free(peercert);
-- }
-+ if (OK != (rc = ssl_check_post_client_verify(r, sc, dc, sslconn, ssl))) {
-+ return rc;
- }
-
- /*
-@@ -1096,6 +1053,215 @@
- }
- }
-
-+ return DECLINED;
-+}
-+
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+/*
-+ * Access Handler, modern flavour, for SSL/TLS v1.3 and onward.
-+ * Only client certificates can be requested, everything else stays.
-+ */
-+static int ssl_hook_Access_modern(request_rec *r, SSLSrvConfigRec *sc, SSLDirConfigRec *dc,
-+ SSLConnRec *sslconn, SSL *ssl)
-+{
-+ if ((dc->nVerifyClient != SSL_CVERIFY_UNSET) ||
-+ (sc->server->auth.verify_mode != SSL_CVERIFY_UNSET)) {
-+ int vmode_inplace, vmode_needed;
-+ int change_vmode = FALSE;
-+ int old_state, n, rc;
-+
-+ vmode_inplace = SSL_get_verify_mode(ssl);
-+ vmode_needed = SSL_VERIFY_NONE;
-+
-+ if ((dc->nVerifyClient == SSL_CVERIFY_REQUIRE) ||
-+ (sc->server->auth.verify_mode == SSL_CVERIFY_REQUIRE)) {
-+ vmode_needed |= SSL_VERIFY_PEER_STRICT;
-+ }
-+
-+ if ((dc->nVerifyClient == SSL_CVERIFY_OPTIONAL) ||
-+ (dc->nVerifyClient == SSL_CVERIFY_OPTIONAL_NO_CA) ||
-+ (sc->server->auth.verify_mode == SSL_CVERIFY_OPTIONAL) ||
-+ (sc->server->auth.verify_mode == SSL_CVERIFY_OPTIONAL_NO_CA))
-+ {
-+ vmode_needed |= SSL_VERIFY_PEER;
-+ }
-+
-+ if (vmode_needed == SSL_VERIFY_NONE) {
-+ return DECLINED;
-+ }
-+
-+ vmode_needed |= SSL_VERIFY_CLIENT_ONCE;
-+ if (vmode_inplace != vmode_needed) {
-+ /* Need to change, if new setting is more restrictive than existing one */
-+
-+ if ((vmode_inplace == SSL_VERIFY_NONE)
-+ || (!(vmode_inplace & SSL_VERIFY_PEER)
-+ && (vmode_needed & SSL_VERIFY_PEER))
-+ || (!(vmode_inplace & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)
-+ && (vmode_needed & SSL_VERIFY_FAIL_IF_NO_PEER_CERT))) {
-+ /* need to change the effective verify mode */
-+ change_vmode = TRUE;
-+ }
-+ else {
-+ /* FIXME: does this work with TLSv1.3? Is this more than re-inspecting
-+ * the certificate we should already have? */
-+ /*
-+ * override of SSLVerifyDepth
-+ *
-+ * The depth checks are handled by us manually inside the
-+ * verify callback function and not by OpenSSL internally
-+ * (and our function is aware of both the per-server and
-+ * per-directory contexts). So we cannot ask OpenSSL about
-+ * the currently verify depth. Instead we remember it in our
-+ * SSLConnRec attached to the SSL* of OpenSSL. We've to force
-+ * the renegotiation if the reconfigured/new verify depth is
-+ * less than the currently active/remembered verify depth
-+ * (because this means more restriction on the certificate
-+ * chain).
-+ */
-+ n = (sslconn->verify_depth != UNSET)?
-+ sslconn->verify_depth : sc->server->auth.verify_depth;
-+ /* determine the new depth */
-+ sslconn->verify_depth = (dc->nVerifyDepth != UNSET)
-+ ? dc->nVerifyDepth
-+ : sc->server->auth.verify_depth;
-+ if (sslconn->verify_depth < n) {
-+ change_vmode = TRUE;
-+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO()
-+ "Reduced client verification depth will "
-+ "force renegotiation");
-+ }
-+ }
-+ }
-+
-+ if (change_vmode) {
-+ char peekbuf[1];
-+
-+ if (r->connection->master) {
-+ /* FIXME: modifying the SSL on a slave connection is no good.
-+ * We would need to push this back to the master connection
-+ * somehow.
-+ */
-+ apr_table_setn(r->notes, "ssl-renegotiate-forbidden", "verify-client");
-+ return HTTP_FORBIDDEN;
-+ }
-+
-+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO() "verify client post handshake");
-+
-+ SSL_set_verify(ssl, vmode_needed, ssl_callback_SSLVerify);
-+
-+ if (SSL_verify_client_post_handshake(ssl) != 1) {
-+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10158)
-+ "cannot perform post-handshake authentication");
-+ ssl_log_ssl_error(SSLLOG_MARK, APLOG_ERR, r->server);
-+ apr_table_setn(r->notes, "error-notes",
-+ "Reason: Cannot perform Post-Handshake Authentication. ");
-+ return HTTP_FORBIDDEN;
-+ }
-+
-+ old_state = sslconn->reneg_state;
-+ sslconn->reneg_state = RENEG_ALLOW;
-+ modssl_set_app_data2(ssl, r);
-+
-+ SSL_do_handshake(ssl);
-+ /* Need to trigger renegotiation handshake by reading.
-+ * Peeking 0 bytes actually works.
-+ * See: http://marc.info/?t=145493359200002&r=1&w=2
-+ */
-+ SSL_peek(ssl, peekbuf, 0);
-+
-+ sslconn->reneg_state = old_state;
-+ modssl_set_app_data2(ssl, NULL);
-+
-+ /*
-+ * Finally check for acceptable renegotiation results
-+ */
-+ if (OK != (rc = ssl_check_post_client_verify(r, sc, dc, sslconn, ssl))) {
-+ return rc;
-+ }
-+ }
-+ }
-+
-+ return DECLINED;
-+}
-+#endif
-+
-+int ssl_hook_Access(request_rec *r)
-+{
-+ SSLDirConfigRec *dc = myDirConfig(r);
-+ SSLSrvConfigRec *sc = mySrvConfig(r->server);
-+ SSLConnRec *sslconn = myConnConfig(r->connection);
-+ SSL *ssl = sslconn ? sslconn->ssl : NULL;
-+ apr_array_header_t *requires;
-+ ssl_require_t *ssl_requires;
-+ int ok, i, ret;
-+
-+ /* On a slave connection, we do not expect to have an SSLConnRec, but
-+ * our master connection might have one. */
-+ if (!(sslconn && ssl) && r->connection->master) {
-+ sslconn = myConnConfig(r->connection->master);
-+ ssl = sslconn ? sslconn->ssl : NULL;
-+ }
-+
-+ /*
-+ * We should have handshaken here, otherwise we are being
-+ * redirected (ErrorDocument) from a renegotiation failure below.
-+ * The access is still forbidden in the latter case, let ap_die() handle
-+ * this recursive (same) error.
-+ */
-+ if (ssl && !SSL_is_init_finished(ssl)) {
-+ return HTTP_FORBIDDEN;
-+ }
-+
-+ /*
-+ * Support for SSLRequireSSL directive
-+ */
-+ if (dc->bSSLRequired && !ssl) {
-+ if ((sc->enabled == SSL_ENABLED_OPTIONAL) && !r->connection->master) {
-+ /* This vhost was configured for optional SSL, just tell the
-+ * client that we need to upgrade.
-+ */
-+ apr_table_setn(r->err_headers_out, "Upgrade", "TLS/1.0, HTTP/1.1");
-+ apr_table_setn(r->err_headers_out, "Connection", "Upgrade");
-+
-+ return HTTP_UPGRADE_REQUIRED;
-+ }
-+
-+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02219)
-+ "access to %s failed, reason: %s",
-+ r->filename, "SSL connection required");
-+
-+ /* remember forbidden access for strict require option */
-+ apr_table_setn(r->notes, "ssl-access-forbidden", "1");
-+
-+ return HTTP_FORBIDDEN;
-+ }
-+
-+ /*
-+ * Check to see whether SSL is in use; if it's not, then no
-+ * further access control checks are relevant. (the test for
-+ * sc->enabled is probably strictly unnecessary)
-+ */
-+ if (sc->enabled == SSL_ENABLED_FALSE || !ssl) {
-+ return DECLINED;
-+ }
-+
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ /* TLSv1.3+ is less complicated here. Branch off into a new codeline
-+ * and avoid messing with the past. */
-+ if (SSL_version(ssl) >= TLS1_3_VERSION) {
-+ ret = ssl_hook_Access_modern(r, sc, dc, sslconn, ssl);
-+ }
-+ else
-+#endif
-+ {
-+ ret = ssl_hook_Access_classic(r, sc, dc, sslconn, ssl);
-+ }
-+
-+ if (ret != DECLINED) {
-+ return ret;
-+ }
-+
- /* If we're trying to have the user name set from a client
- * certificate then we need to set it here. This should be safe as
- * the user name probably isn't important from an auth checking point
-@@ -2080,31 +2246,43 @@
- {
- conn_rec *c;
- server_rec *s;
-- SSLConnRec *scr;
-
- /* Retrieve the conn_rec and the associated SSLConnRec. */
- if ((c = (conn_rec *)SSL_get_app_data((SSL *)ssl)) == NULL) {
- return;
- }
-
-- if ((scr = myConnConfig(c)) == NULL) {
-- return;
-- }
-+ /* With TLS 1.3 this callback may be called multiple times on the first
-+ * negotiation, so the below logic to detect renegotiations can't work.
-+ * Fortunately renegotiations are forbidden starting with TLS 1.3, and
-+ * this is enforced by OpenSSL so there's nothing to be done here.
-+ */
-+#if SSL_HAVE_PROTOCOL_TLSV1_3
-+ if (SSL_version(ssl) < TLS1_3_VERSION)
-+#endif
-+ {
-+ SSLConnRec *sslconn;
-+
-+ if ((sslconn = myConnConfig(c)) == NULL) {
-+ return;
-+ }
-
-- /* If the reneg state is to reject renegotiations, check the SSL
-- * state machine and move to ABORT if a Client Hello is being
-- * read. */
-- if (!scr->is_proxy &&
-- (where & SSL_CB_HANDSHAKE_START) &&
-- scr->reneg_state == RENEG_REJECT) {
-- scr->reneg_state = RENEG_ABORT;
-+ /* If the reneg state is to reject renegotiations, check the SSL
-+ * state machine and move to ABORT if a Client Hello is being
-+ * read. */
-+ if (!sslconn->is_proxy &&
-+ (where & SSL_CB_HANDSHAKE_START) &&
-+ sslconn->reneg_state == RENEG_REJECT) {
-+ sslconn->reneg_state = RENEG_ABORT;
- ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02042)
- "rejecting client initiated renegotiation");
-- }
-- /* If the first handshake is complete, change state to reject any
-- * subsequent client-initiated renegotiation. */
-- else if ((where & SSL_CB_HANDSHAKE_DONE) && scr->reneg_state == RENEG_INIT) {
-- scr->reneg_state = RENEG_REJECT;
-+ }
-+ /* If the first handshake is complete, change state to reject any
-+ * subsequent client-initiated renegotiation. */
-+ else if ((where & SSL_CB_HANDSHAKE_DONE)
-+ && sslconn->reneg_state == RENEG_INIT) {
-+ sslconn->reneg_state = RENEG_REJECT;
-+ }
- }
-
- s = mySrvFromConn(c);
---- httpd-2.4.34/modules/ssl/ssl_private.h.r1827912+
-+++ httpd-2.4.34/modules/ssl/ssl_private.h
-@@ -132,13 +132,14 @@
- SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL)
- #define SSL_CTX_set_max_proto_version(ctx, version) \
- SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL)
--#endif
--/* LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not include most
-- * changes from OpenSSL >= 1.1 (new functions, macros, deprecations, ...), so
-- * we have to work around this...
-+#elif LIBRESSL_VERSION_NUMBER < 0x2070000f
-+/* LibreSSL before 2.7 declares OPENSSL_VERSION_NUMBER == 2.0 but does not
-+ * include most changes from OpenSSL >= 1.1 (new functions, macros,
-+ * deprecations, ...), so we have to work around this...
- */
- #define MODSSL_USE_OPENSSL_PRE_1_1_API (1)
--#else
-+#endif /* LIBRESSL_VERSION_NUMBER < 0x2060000f */
-+#else /* defined(LIBRESSL_VERSION_NUMBER) */
- #define MODSSL_USE_OPENSSL_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L)
- #endif
-
-@@ -238,7 +239,8 @@
- void free_bio_methods(void);
- #endif
-
--#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
-+#if OPENSSL_VERSION_NUMBER < 0x10002000L || \
-+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000f)
- #define X509_STORE_CTX_get0_store(x) (x->ctx)
- #endif
-
-@@ -372,8 +374,17 @@
- #ifdef HAVE_TLSV1_X
- #define SSL_PROTOCOL_TLSV1_1 (1<<3)
- #define SSL_PROTOCOL_TLSV1_2 (1<<4)
-+#define SSL_PROTOCOL_TLSV1_3 (1<<5)
-+
-+#ifdef SSL_OP_NO_TLSv1_3
-+#define SSL_HAVE_PROTOCOL_TLSV1_3 (1)
-+#define SSL_PROTOCOL_ALL (SSL_PROTOCOL_BASIC| \
-+ SSL_PROTOCOL_TLSV1_1|SSL_PROTOCOL_TLSV1_2|SSL_PROTOCOL_TLSV1_3)
-+#else
-+#define SSL_HAVE_PROTOCOL_TLSV1_3 (0)
- #define SSL_PROTOCOL_ALL (SSL_PROTOCOL_BASIC| \
- SSL_PROTOCOL_TLSV1_1|SSL_PROTOCOL_TLSV1_2)
-+#endif
- #else
- #define SSL_PROTOCOL_ALL (SSL_PROTOCOL_BASIC)
- #endif
-@@ -646,6 +657,11 @@
- /** for client or downstream server authentication */
- int verify_depth;
- ssl_verify_t verify_mode;
-+
-+ /** TLSv1.3 has its separate cipher list, separate from the
-+ settings for older TLS protocol versions. Since which one takes
-+ effect is a matter of negotiation, we need separate settings */
-+ const char *tls13_ciphers;
- } modssl_auth_ctx_t;
-
- #ifdef HAVE_TLS_SESSION_TICKETS
-@@ -801,7 +817,7 @@
- const char *ssl_cmd_SSLCryptoDevice(cmd_parms *, void *, const char *);
- const char *ssl_cmd_SSLRandomSeed(cmd_parms *, void *, const char *, const char *, const char *);
- const char *ssl_cmd_SSLEngine(cmd_parms *, void *, const char *);
--const char *ssl_cmd_SSLCipherSuite(cmd_parms *, void *, const char *);
-+const char *ssl_cmd_SSLCipherSuite(cmd_parms *, void *, const char *, const char *);
- const char *ssl_cmd_SSLCertificateFile(cmd_parms *, void *, const char *);
- const char *ssl_cmd_SSLCertificateKeyFile(cmd_parms *, void *, const char *);
- const char *ssl_cmd_SSLCertificateChainFile(cmd_parms *, void *, const char *);
-@@ -830,7 +846,7 @@
-
- const char *ssl_cmd_SSLProxyEngine(cmd_parms *cmd, void *dcfg, int flag);
- const char *ssl_cmd_SSLProxyProtocol(cmd_parms *, void *, const char *);
--const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *, void *, const char *);
-+const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *, void *, const char *, const char *);
- const char *ssl_cmd_SSLProxyVerify(cmd_parms *, void *, const char *);
- const char *ssl_cmd_SSLProxyVerifyDepth(cmd_parms *, void *, const char *);
- const char *ssl_cmd_SSLProxyCACertificatePath(cmd_parms *, void *, const char *);
diff --git a/httpd.spec b/httpd.spec
index 85d661c..156716f 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -12,8 +12,8 @@
Summary: Apache HTTP Server
Name: httpd
-Version: 2.4.34
-Release: 11%{?dist}
+Version: 2.4.37
+Release: 1%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -59,7 +59,6 @@ Source44: httpd@.service
Patch1: httpd-2.4.1-apctl.patch
Patch2: httpd-2.4.9-apxs.patch
Patch3: httpd-2.4.1-deplibs.patch
-Patch4: httpd-2.4.34-layfix.patch
Patch6: httpd-2.4.34-apctlsystemd.patch
# Needed for socket activation and mod_systemd patch
Patch19: httpd-2.4.25-detect-systemd.patch
@@ -75,14 +74,12 @@ Patch30: httpd-2.4.4-cachehardmax.patch
Patch31: httpd-2.4.33-sslmultiproxy.patch
Patch34: httpd-2.4.17-socket-activation.patch
Patch36: httpd-2.4.33-r1830819+.patch
-Patch37: httpd-2.4.34-r1827912+.patch
Patch38: httpd-2.4.34-sslciphdefault.patch
Patch39: httpd-2.4.34-sslprotdefault.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
Patch58: httpd-2.4.34-r1738878.patch
-Patch59: httpd-2.4.34-r1555631.patch
Patch60: httpd-2.4.34-enable-sslv3.patch
# Security fixes
@@ -223,7 +220,6 @@ interface for storing and accessing per-user session data.
%patch1 -p1 -b .apctl
%patch2 -p1 -b .apxs
%patch3 -p1 -b .deplibs
-%patch4 -p1 -b .layfix
%patch6 -p1 -b .apctlsystemd
%patch19 -p1 -b .detectsystemd
@@ -239,12 +235,10 @@ interface for storing and accessing per-user session data.
#patch31 -p1 -b .sslmultiproxy
%patch34 -p1 -b .socketactivation
%patch36 -p1 -b .r1830819+
-%patch37 -p1 -b .r1827912+
%patch38 -p1 -b .sslciphdefault
%patch39 -p1 -b .sslprotdefault
%patch58 -p1 -b .r1738878
-%patch59 -p1 -b .r1555631
%patch60 -p1 -b .enable-sslv3
# Patch in the vendor string
@@ -735,6 +729,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Wed Oct 31 2018 Joe Orton - 2.4.37-1
+- update to 2.4.37
+
* Wed Oct 31 2018 Joe Orton - 2.4.34-11
- add htcacheclean.service(8) man page
diff --git a/sources b/sources
index 1840642..ca284fa 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (httpd-2.4.34.tar.bz2) = 2bc09213f08a4722e305929fbac5f5060c7a8444704494894bb9b61f17e4d20bb6e3d663bb93fc5b2030b04a43fb12373d260cc291422b210b299725aaf3b5c8
+SHA512 (httpd-2.4.37.tar.bz2) = e802915801bbe885a65dada04b0116d145b293fabfff734dddb61a79ca1c6d65326f51155d1b864b093c3ec00d0bdfdf1401ab55677bae1ea3da1d199d7bcad4
From 920857b24c5741e97e50809b3d176eb5c543f25d Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Wed, 31 Oct 2018 12:19:33 +0000
Subject: [PATCH 012/231] add DefaultStateDir/ap_state_dir_relative()
mod_dav_fs: use state dir for default DAVLockDB mod_md: use state dir for
default MDStoreDir
---
httpd-2.4.33-mddefault.patch | 21 ---
httpd-2.4.37-r1842929+.patch | 317 +++++++++++++++++++++++++++++++++++
httpd.spec | 11 +-
3 files changed, 325 insertions(+), 24 deletions(-)
delete mode 100644 httpd-2.4.33-mddefault.patch
create mode 100644 httpd-2.4.37-r1842929+.patch
diff --git a/httpd-2.4.33-mddefault.patch b/httpd-2.4.33-mddefault.patch
deleted file mode 100644
index 9e82fb8..0000000
--- a/httpd-2.4.33-mddefault.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-
-Override default.
-
---- httpd-2.4.33/modules/md/mod_md_config.c.mddefault
-+++ httpd-2.4.33/modules/md/mod_md_config.c
-@@ -54,10 +54,14 @@
-
- #define DEF_VAL (-1)
-
-+#ifndef MD_DEFAULT_STORE_DIR
-+#define MD_DEFAULT_STORE_DIR "state/md"
-+#endif
-+
- /* Default settings for the global conf */
- static md_mod_conf_t defmc = {
- NULL,
-- "md",
-+ MD_DEFAULT_STORE_DIR,
- NULL,
- NULL,
- 80,
diff --git a/httpd-2.4.37-r1842929+.patch b/httpd-2.4.37-r1842929+.patch
new file mode 100644
index 0000000..c6aa1f7
--- /dev/null
+++ b/httpd-2.4.37-r1842929+.patch
@@ -0,0 +1,317 @@
+# ./pullrev.sh 1842929 1842931
+http://svn.apache.org/viewvc?view=revision&revision=1842929
+http://svn.apache.org/viewvc?view=revision&revision=1842931
+
+--- httpd-2.4.37/acinclude.m4.r1842929+
++++ httpd-2.4.37/acinclude.m4
+@@ -45,6 +45,7 @@
+ APACHE_SUBST(installbuilddir)
+ APACHE_SUBST(runtimedir)
+ APACHE_SUBST(proxycachedir)
++ APACHE_SUBST(statedir)
+ APACHE_SUBST(other_targets)
+ APACHE_SUBST(progname)
+ APACHE_SUBST(prefix)
+@@ -663,6 +664,7 @@
+ APACHE_SUBST_EXPANDED_ARG(runtimedir)
+ APACHE_SUBST_EXPANDED_ARG(logfiledir)
+ APACHE_SUBST_EXPANDED_ARG(proxycachedir)
++ APACHE_SUBST_EXPANDED_ARG(statedir)
+ ])
+
+ dnl
+--- httpd-2.4.37/config.layout.r1842929+
++++ httpd-2.4.37/config.layout
+@@ -29,6 +29,7 @@
+ includedir: ${prefix}/include
+ localstatedir: ${prefix}
+ runtimedir: ${localstatedir}/logs
++ statedir: ${localstatedir}/state
+ logfiledir: ${localstatedir}/logs
+ proxycachedir: ${localstatedir}/proxy
+
+@@ -54,6 +55,7 @@
+ includedir: ${prefix}/include+
+ localstatedir: ${prefix}/var+
+ runtimedir: ${localstatedir}/run
++ statedir: ${localstatedir}/state
+ logfiledir: ${localstatedir}/log
+ proxycachedir: ${localstatedir}/proxy
+
+@@ -78,6 +80,7 @@
+ includedir: /System/Library/Frameworks/Apache.framework/Versions/2.0/Headers
+ localstatedir: /var
+ runtimedir: ${prefix}/Logs
++ statedir: ${prefix}/State
+ logfiledir: ${prefix}/Logs
+ proxycachedir: ${prefix}/ProxyCache
+
+@@ -102,6 +105,7 @@
+ includedir: ${prefix}/include+
+ localstatedir: /var
+ runtimedir: ${localstatedir}/run
++ statedir: ${localstatedir}/state
+ logfiledir: ${localstatedir}/log+
+ proxycachedir: ${runtimedir}/proxy
+
+@@ -126,6 +130,7 @@
+ includedir: ${prefix}/include/apache
+ localstatedir: /var
+ runtimedir: ${localstatedir}/run
++ statedir: ${localstatedir}/lib/httpd
+ logfiledir: ${localstatedir}/log/httpd
+ proxycachedir: ${localstatedir}/cache/httpd
+
+@@ -151,6 +156,7 @@
+ includedir: ${prefix}/include/httpd
+ runtimedir: /run/httpd
+ logfiledir: ${localstatedir}/log/httpd
++ statedir: ${localstatedir}/lib/httpd
+ proxycachedir: ${localstatedir}/cache/httpd/proxy
+
+
+@@ -175,6 +181,7 @@
+ localstatedir: /var${prefix}
+ runtimedir: ${localstatedir}/run
+ logfiledir: ${localstatedir}/logs
++ statedir: ${localstatedir}/state
+ proxycachedir: ${localstatedir}/proxy
+
+
+@@ -197,6 +204,7 @@
+ cgidir: ${datadir}/cgi-bin
+ includedir: ${prefix}/include/apache
+ localstatedir: /var/lib/httpd
++ statedir: ${localstatedir}
+ runtimedir: /var/run
+ logfiledir: /var/log/httpd
+ proxycachedir: /var/cache/httpd
+@@ -223,6 +231,7 @@
+ localstatedir: /var
+ runtimedir: ${localstatedir}/run
+ logfiledir: ${localstatedir}/log/httpd
++ statedir: ${prefix}/state
+ proxycachedir: ${localstatedir}/proxy
+
+
+@@ -246,6 +255,7 @@
+ includedir: ${exec_prefix}/include
+ localstatedir: ${prefix}
+ runtimedir: /var/run
++ statedir: ${datadir}/state
+ logfiledir: ${datadir}/logs
+ proxycachedir: ${datadir}/proxy
+
+@@ -271,6 +281,7 @@
+ localstatedir: ${prefix}
+ runtimedir: ${prefix}/logs
+ logfiledir: ${prefix}/logs
++ statedir: ${prefix}/state
+ proxycachedir: ${prefix}/proxy
+
+
+@@ -315,6 +326,7 @@
+ cgidir: ${prefix}/usr/lib/cgi-bin
+ includedir: ${exec_prefix}/include/apache2
+ localstatedir: ${prefix}/var/lock/apache2
++ statedir: ${prefix}/var/lib/apache2
+ runtimedir: ${prefix}/var/run/apache2
+ logfiledir: ${prefix}/var/log/apache2
+ proxycachedir: ${prefix}/var/cache/apache2/proxy
+@@ -343,6 +355,7 @@
+ manualdir: ${datadir}/manual
+ cgidir: ${datadir}/cgi-bin
+ runtimedir: ${localstatedir}/run
++ runtimedir: ${localstatedir}/lib/httpd
+ logfiledir: ${localstatedir}/log/httpd
+ proxycachedir: ${localstatedir}/cache/httpd/cache-root
+
+@@ -366,6 +379,7 @@
+ manualdir: ${prefix}/manual
+ includedir: ${prefix}/include
+ localstatedir: /var/httpd
++ statedir: ${localstatedir}/state
+ runtimedir: ${localstatedir}/run
+ logfiledir: ${localstatedir}/logs
+ proxycachedir: ${localstatedir}/proxy
+@@ -391,6 +405,7 @@
+ includedir: ${prefix}/include/httpd
+ localstatedir: /var
+ runtimedir: ${localstatedir}/run/httpd
++ statedir: ${localstatedir}/lib/httpd
+ logfiledir: ${localstatedir}/log/httpd
+ proxycachedir: ${localstatedir}/cache/httpd
+
+--- httpd-2.4.37/configure.in.r1842929+
++++ httpd-2.4.37/configure.in
+@@ -41,7 +41,7 @@
+ AC_PREFIX_DEFAULT(/usr/local/apache2)
+
+ dnl Get the layout here, so we can pass the required variables to apr
+-APR_ENABLE_LAYOUT(Apache, [errordir iconsdir htdocsdir cgidir])
++APR_ENABLE_LAYOUT(Apache, [errordir iconsdir htdocsdir cgidir statedir])
+
+ dnl reparse the configure arguments.
+ APR_PARSE_ARGUMENTS
+--- httpd-2.4.37/include/ap_config_layout.h.in.r1842929+
++++ httpd-2.4.37/include/ap_config_layout.h.in
+@@ -60,5 +60,7 @@
+ #define DEFAULT_REL_LOGFILEDIR "@rel_logfiledir@"
+ #define DEFAULT_EXP_PROXYCACHEDIR "@exp_proxycachedir@"
+ #define DEFAULT_REL_PROXYCACHEDIR "@rel_proxycachedir@"
++#define DEFAULT_EXP_STATEDIR "@exp_statedir@"
++#define DEFAULT_REL_STATEDIR "@rel_statedir@"
+
+ #endif /* AP_CONFIG_LAYOUT_H */
+--- httpd-2.4.37/include/http_config.h.r1842929+
++++ httpd-2.4.37/include/http_config.h
+@@ -757,6 +757,14 @@
+ */
+ AP_DECLARE(char *) ap_runtime_dir_relative(apr_pool_t *p, const char *fname);
+
++/**
++ * Compute the name of a persistent state file (e.g. a database or
++ * long-lived cache) relative to the appropriate state directory.
++ * Absolute paths are returned as-is. The state directory is
++ * configured via the DefaultStateDir directive or at build time.
++ */
++AP_DECLARE(char *) ap_state_dir_relative(apr_pool_t *p, const char *fname);
++
+ /* Finally, the hook for dynamically loading modules in... */
+
+ /**
+--- httpd-2.4.37/Makefile.in.r1842929+
++++ httpd-2.4.37/Makefile.in
+@@ -213,6 +213,7 @@
+ install-other:
+ @test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)
+ @test -d $(DESTDIR)$(runtimedir) || $(MKINSTALLDIRS) $(DESTDIR)$(runtimedir)
++ @test -d $(DESTDIR)$(statedir) || $(MKINSTALLDIRS) $(DESTDIR)$(statedir)
+ @for ext in dll x; do \
+ file=apachecore.$$ext; \
+ if test -f $$file; then \
+--- httpd-2.4.37/modules/dav/fs/mod_dav_fs.c.r1842929+
++++ httpd-2.4.37/modules/dav/fs/mod_dav_fs.c
+@@ -29,6 +29,10 @@
+
+ extern module AP_MODULE_DECLARE_DATA dav_fs_module;
+
++#ifndef DEFAULT_DAV_LOCKDB
++#define DEFAULT_DAV_LOCKDB "davlockdb"
++#endif
++
+ const char *dav_get_lockdb_path(const request_rec *r)
+ {
+ dav_fs_server_conf *conf;
+@@ -39,7 +43,11 @@
+
+ static void *dav_fs_create_server_config(apr_pool_t *p, server_rec *s)
+ {
+- return apr_pcalloc(p, sizeof(dav_fs_server_conf));
++ dav_fs_server_conf *conf = apr_pcalloc(p, sizeof(dav_fs_server_conf));
++
++ conf->lockdb_path = ap_state_dir_relative(p, DEFAULT_DAV_LOCKDB);
++
++ return conf;
+ }
+
+ static void *dav_fs_merge_server_config(apr_pool_t *p,
+--- httpd-2.4.37/modules/md/mod_md_config.c.r1842929+
++++ httpd-2.4.37/modules/md/mod_md_config.c
+@@ -54,10 +54,14 @@
+
+ #define DEF_VAL (-1)
+
++#ifndef MD_DEFAULT_BASE_DIR
++#define MD_DEFAULT_BASE_DIR "state/md"
++#endif
++
+ /* Default settings for the global conf */
+ static md_mod_conf_t defmc = {
+ NULL,
+- "md",
++ NULL,
+ NULL,
+ NULL,
+ 80,
+@@ -112,6 +116,7 @@
+ memcpy(mod_md_config, &defmc, sizeof(*mod_md_config));
+ mod_md_config->mds = apr_array_make(pool, 5, sizeof(const md_t *));
+ mod_md_config->unused_names = apr_array_make(pool, 5, sizeof(const md_t *));
++ mod_md_config->base_dir = ap_state_dir_relative(pool, MD_DEFAULT_BASE_DIR);
+
+ apr_pool_cleanup_register(pool, NULL, cleanup_mod_config, apr_pool_cleanup_null);
+ }
+--- httpd-2.4.37/server/core.c.r1842929+
++++ httpd-2.4.37/server/core.c
+@@ -129,6 +129,8 @@
+ AP_DECLARE_DATA int ap_run_mode = AP_SQ_RM_UNKNOWN;
+ AP_DECLARE_DATA int ap_config_generation = 0;
+
++static const char *core_state_dir;
++
+ static void *create_core_dir_config(apr_pool_t *a, char *dir)
+ {
+ core_dir_config *conf;
+@@ -3104,6 +3106,24 @@
+ return NULL;
+ }
+
++static const char *set_state_dir(cmd_parms *cmd, void *dummy, const char *arg)
++{
++ const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
++
++ if (err != NULL) {
++ return err;
++ }
++
++ if ((apr_filepath_merge((char**)&core_state_dir, NULL,
++ ap_server_root_relative(cmd->temp_pool, arg),
++ APR_FILEPATH_TRUENAME, cmd->pool) != APR_SUCCESS)
++ || !ap_is_directory(cmd->temp_pool, core_state_dir)) {
++ return "DefaultStateDir must be a valid directory, absolute or relative to ServerRoot";
++ }
++
++ return NULL;
++}
++
+ static const char *set_timeout(cmd_parms *cmd, void *dummy, const char *arg)
+ {
+ const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_CONTEXT);
+@@ -4398,6 +4418,8 @@
+ "Common directory of server-related files (logs, confs, etc.)"),
+ AP_INIT_TAKE1("DefaultRuntimeDir", set_runtime_dir, NULL, RSRC_CONF | EXEC_ON_READ,
+ "Common directory for run-time files (shared memory, locks, etc.)"),
++AP_INIT_TAKE1("DefaultStateDir", set_state_dir, NULL, RSRC_CONF | EXEC_ON_READ,
++ "Common directory for persistent state (databases, long-lived caches, etc.)"),
+ AP_INIT_TAKE1("ErrorLog", set_server_string_slot,
+ (void *)APR_OFFSETOF(server_rec, error_fname), RSRC_CONF,
+ "The filename of the error log"),
+@@ -5150,6 +5172,27 @@
+ }
+ }
+
++AP_DECLARE(char *) ap_state_dir_relative(apr_pool_t *p, const char *file)
++{
++ char *newpath = NULL;
++ apr_status_t rv;
++ const char *state_dir;
++
++ state_dir = core_state_dir
++ ? core_state_dir
++ : ap_server_root_relative(p, DEFAULT_REL_STATEDIR);
++
++ rv = apr_filepath_merge(&newpath, state_dir, file, APR_FILEPATH_TRUENAME, p);
++ if (newpath && (rv == APR_SUCCESS || APR_STATUS_IS_EPATHWILD(rv)
++ || APR_STATUS_IS_ENOENT(rv)
++ || APR_STATUS_IS_ENOTDIR(rv))) {
++ return newpath;
++ }
++ else {
++ return NULL;
++ }
++}
++
+ static apr_random_t *rng = NULL;
+ #if APR_HAS_THREADS
+ static apr_thread_mutex_t *rng_mutex = NULL;
diff --git a/httpd.spec b/httpd.spec
index 156716f..e40e04d 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.37
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -63,7 +63,7 @@ Patch6: httpd-2.4.34-apctlsystemd.patch
# Needed for socket activation and mod_systemd patch
Patch19: httpd-2.4.25-detect-systemd.patch
# Features/functional changes
-Patch21: httpd-2.4.33-mddefault.patch
+Patch21: httpd-2.4.37-r1842929+.patch
Patch23: httpd-2.4.33-export.patch
Patch24: httpd-2.4.1-corelimit.patch
Patch25: httpd-2.4.25-selinux.patch
@@ -224,7 +224,7 @@ interface for storing and accessing per-user session data.
%patch19 -p1 -b .detectsystemd
-%patch21 -p1 -b .mddefault
+%patch21 -p1 -b .r1842929+
%patch23 -p1 -b .export
%patch24 -p1 -b .corelimit
%patch25 -p1 -b .selinux
@@ -729,6 +729,11 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Wed Oct 31 2018 Joe Orton - 2.4.37-2
+- add DefaultStateDir/ap_state_dir_relative()
+- mod_dav_fs: use state dir for default DAVLockDB
+- mod_md: use state dir for default MDStoreDir
+
* Wed Oct 31 2018 Joe Orton - 2.4.37-1
- update to 2.4.37
From 25b89a94797bf63979497969ba7cc961359bf5c5 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Fri, 2 Nov 2018 11:07:11 +0000
Subject: [PATCH 013/231] Fix grammar.
---
htcacheclean.service.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htcacheclean.service.xml b/htcacheclean.service.xml
index d771ae7..01b68e4 100644
--- a/htcacheclean.service.xml
+++ b/htcacheclean.service.xml
@@ -50,7 +50,7 @@
This manual page describes the systemd
unit file for the htcacheclean daemon. This
unit file provides a service which runs
- htcacheclean is run in daemon mode,
+ htcacheclean in daemon mode,
periodically cleaning the disk cache root to ensure disk space
usage is within configured limits.
From 2fa14eded508bce407d4c70ce1a1b983f5cfc55d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubo=C5=A1=20Uhliarik?=
Date: Wed, 7 Nov 2018 12:38:50 +0100
Subject: [PATCH 014/231] Resolves: #1647241 - fix apachectl script
---
httpd-2.4.34-apctlsystemd.patch | 2 +-
httpd.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/httpd-2.4.34-apctlsystemd.patch b/httpd-2.4.34-apctlsystemd.patch
index 996978c..20d7101 100644
--- a/httpd-2.4.34-apctlsystemd.patch
+++ b/httpd-2.4.34-apctlsystemd.patch
@@ -26,7 +26,7 @@ Upstream-Status: vendor specific patch
+if [ "x$2" != "x" ] ; then
+ echo Passing arguments to httpd using apachectl is no longer supported.
+ echo You can only start/stop/restart httpd using this script.
-+ echo To pass extra arguments to httpd, see the httpd.service(8)
++ echo "To pass extra arguments to httpd, see the httpd.service(8)"
+ echo man page.
+fi
+
diff --git a/httpd.spec b/httpd.spec
index e40e04d..f242ddb 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.37
-Release: 2%{?dist}
+Release: 3%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -729,6 +729,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Wed Nov 07 2018 Luboš Uhliarik - 2.4.37-3
+- Resolves: #1647241 - fix apachectl script
+
* Wed Oct 31 2018 Joe Orton - 2.4.37-2
- add DefaultStateDir/ap_state_dir_relative()
- mod_dav_fs: use state dir for default DAVLockDB
From 36d7a682414a54ad9b7c6a1a0b1dba29a52304df Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Thu, 8 Nov 2018 17:13:42 +0000
Subject: [PATCH 015/231] add httpd.conf(5) (#1611361) Resolves: rhbz#1611361
---
.gitignore | 1 +
README.confd | 4 +-
README.confmod | 3 +-
httpd.conf | 3 +
httpd.conf.xml | 260 ++++++++++++++++++++++++++++++++++++++++++++++
httpd.service.xml | 16 +--
httpd.spec | 22 +++-
7 files changed, 290 insertions(+), 19 deletions(-)
create mode 100644 httpd.conf.xml
diff --git a/.gitignore b/.gitignore
index 00acede..bdeafe7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,4 @@ x86_64
/httpd*.8
/results_httpd
/htcacheclean.service.8
+/httpd.conf.5
diff --git a/README.confd b/README.confd
index f5e9661..6071deb 100644
--- a/README.confd
+++ b/README.confd
@@ -5,5 +5,5 @@ processed as httpd configuration files. The directory is used in
addition to the directory /etc/httpd/conf.modules.d/, which contains
configuration files necessary to load modules.
-Files are processed in alphabetical order.
-
+Files are processed in sorted order. See httpd.conf(5) for more
+information.
diff --git a/README.confmod b/README.confmod
index d33d1d4..f4b055d 100644
--- a/README.confmod
+++ b/README.confmod
@@ -6,4 +6,5 @@ configuration fragments necessary only to load modules.
Administrators should use the directory "/etc/httpd/conf.d" to modify
the configuration of httpd, or any modules.
-Files are processed in alphanumeric order.
+Files are processed in sorted order and should have a two digit
+numeric prefix. See httpd.conf(5) for more information.
diff --git a/httpd.conf b/httpd.conf
index a7af0dc..6ab68cb 100644
--- a/httpd.conf
+++ b/httpd.conf
@@ -6,6 +6,9 @@
#
# for a discussion of each configuration directive.
#
+# See the httpd.conf(5) man page for more information on this configuration,
+# and httpd.service(8) on using and configuring the httpd service.
+#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
diff --git a/httpd.conf.xml b/httpd.conf.xml
new file mode 100644
index 0000000..fdf02b7
--- /dev/null
+++ b/httpd.conf.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+ httpd.conf
+ httpd
+ AuthorOrtonJoejorton@redhat.com
+
+
+
+ httpd.conf
+ 5
+
+
+
+ httpd.conf
+ Configuration files for httpd
+
+
+
+
+ /etc/httpd/conf/httpd.conf,
+ /etc/httpd/conf.modules.d,
+ /etc/httpd/conf.d
+
+
+
+
+ Description
+
+ The httpd daemon uses a main
+ configuration file at
+ /etc/httpd/conf/httpd.conf. The syntax of
+ this file is described at , and
+ the full set of available directives at .
+
+
+
+ Configuration structure
+
+ The main configuration file
+ (httpd.conf) sets up various defaults and
+ includes configuration files from two directories -
+ /etc/httpd/conf.modules.d and
+ /etc/httpd/conf.d. Packages containing
+ loadable modules (like ) place files
+ in the conf.modules.d directory with the
+ appropriate directive so that module
+ is loaded by default.
+
+ Some notable configured defaults are:.
+
+
+
+
+ The default document root from which content
+ is served.
+
+
+
+ The daemon lists on TCP port 80.
+
+
+
+ Error messages are logged to
+ @LOGDIR@/error_log.
+
+
+
+ CGI scripts are served via the URL-path .
+
+
+
+
+ To remove any of the default configuration provided in
+ separate files covered below, replace that file with an empty
+ file rather than removing it from the filesystem, otherwise it
+ may be restored to the original when the package which provides
+ it is upgraded.
+
+
+
+
+ MPM configuration
+
+ The configuration file at
+ /etc/httpd/conf.modules.d/00-mpm.conf is
+ used to select the multi-processing module (MPM), which governs
+ how httpd divides work between processes
+ and/or threads at run-time. Exactly one
+ directive must be uncommented in
+ this file; by default the MPM is enabled.
+ For more information on MPMs, see .
+
+ If using the prefork MPM, the
+ "httpd_graceful_shutdown" SELinux boolean should also be
+ enabled, since with this MPM, httpd needs to establish TCP
+ connections to local ports to successfully complete a graceful
+ restart or shutdown. This boolean can be enabled by running the
+ command: semanage boolean -m --on
+ httpd_graceful_shutdown
+
+
+
+ Module configuration files
+
+ Module configuration files are provided in the
+ /etc/httpd/conf.modules.d/ directory, with
+ names which are by convention prefixed with two digit numeric
+ prefix to ensure they are processed in the desired order. Core
+ modules provide with the httpd package are
+ loaded by files with a prefix to ensure
+ these are loaded first. Only filenames with a
+ suffix in this directory will be
+ processed.
+
+ Other provided configuration files are listed below.
+
+
+
+ /etc/httpd/conf.modules.d/00-base.conf
+ The set of core modules included with
+ httpd which are all loaded by
+ default.
+
+
+
+ /etc/httpd/conf.modules.d/00-optional.conf
+ The set of non-core modules included with
+ httpd which are not
+ loaded by default.
+
+
+
+
+ /etc/httpd/conf.modules.d/00-systemd.conf
+ This file loads
+ which is necessary for the correct operation of the
+ httpd.service service, and should not be
+ removed or disabled.
+
+
+
+
+
+
+ Other configuration files
+
+ Default module configuration files and site-specific
+ configuration files are loaded from the
+ /etc/httpd/conf.d/ directory. Only files
+ with a suffix will be loaded. The
+ following files are provided:
+
+
+
+ /etc/httpd/conf.d/userdir.conf
+ This file gives an example configuration for
+ to map URLs such as
+ to
+ /home/jim/public_html/. Userdir mapping
+ is disabled by default.
+
+
+
+ /etc/httpd/conf.d/autoindex.conf
+ This file provides the default configuration
+ for which generates HTML
+ directory listings when enabled. It also makes file icon
+ image files available at the
+ URL-path.
+
+
+
+ /etc/httpd/conf.d/welcome.conf
+ This file enables a "welcome page" at
+ if no content is present
+ in the default documentation root
+ /var/www/html.
+
+
+
+ /etc/httpd/conf.d/ssl.conf (present only if is installed)
+ This file configures a TLS
+ listening on port
+ . If the default configuration is used,
+ the referenced test certificate and private key are
+ generated the first time httpd.service is
+ started; see
+ httpd-init.service8
+ for more information.
+
+
+
+
+
+
+ Instantiated services
+
+ As an alternative to (or in addition to) the
+ httpd.service unit, the instatiated template
+ service httpd@.service unit file can be used,
+ which starts httpd using a different
+ configuration file to the default. For example,
+ systemctl start httpd@foobar.service will
+ start httpd using the configuration file
+ /etc/httpd/conf/foobar.conf. See httpd@.service8 for more information.
+
+
+
+
+ Files
+
+
+ /etc/httpd/conf/httpd.conf,
+ /etc/httpd/conf.d,
+ /etc/httpd/conf.modules.d
+
+
+
+
+ See also
+
+
+ httpd8,
+ httpd.service8,
+ ,
+
+
+
+
+
+
+
diff --git a/httpd.service.xml b/httpd.service.xml
index 4a6038d..b2c72dd 100644
--- a/httpd.service.xml
+++ b/httpd.service.xml
@@ -188,17 +188,10 @@ Wants=network-online.target
httpd offers a choice of multi-processing modules (MPMs),
which can be configured in
- /etc/httpd/conf.modules.d/00-mpm.conf. The
- default is to use the @MPM@ MPM.
-
- If using the prefork MPM, the
- "httpd_graceful_shutdown" SELinux boolean should also be
- enabled, since with this MPM, httpd needs to establish TCP
- connections to local ports to successfully complete a graceful
- restart or shutdown. This boolean can be enabled by running the
- command: semanage boolean -m --on
- httpd_graceful_shutdown
-
+ /etc/httpd/conf.modules.d/00-mpm.conf.
+ See
+ httpd.conf5
+ for more information on changing the MPM.
@@ -322,6 +315,7 @@ ReloadPropagatedFrom=httpd.service
httpd8,
+ httpd.conf5,
systemd1,
systemctl1,
systemd.service5,
diff --git a/httpd.spec b/httpd.spec
index f242ddb..5f68c0b 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.37
-Release: 3%{?dist}
+Release: 4%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -266,11 +266,16 @@ if test "x${vmmn}" != "x%{mmn}"; then
exit 1
fi
-sed 's/@MPM@/%{mpm}/' < $RPM_SOURCE_DIR/httpd.service.xml \
- > httpd.service.xml
+sed '
+s,@MPM@,%{mpm},g
+s,@DOCROOT@,%{docroot},g
+s,@LOGDIR@,%{_localstatedir}/log/httpd,g
+' < $RPM_SOURCE_DIR/httpd.conf.xml \
+ > httpd.conf.xml
-xmlto man ./httpd.service.xml
+xmlto man ./httpd.conf.xml
xmlto man $RPM_SOURCE_DIR/htcacheclean.service.xml
+xmlto man $RPM_SOURCE_DIR/httpd.service.xml
: Building with MMN %{mmn}, MMN-ISA %{mmnisa}
: Default MPM is %{mpm}, vendor string is '%{vstring}'
@@ -491,10 +496,13 @@ mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
install -m 644 -p $RPM_SOURCE_DIR/httpd.logrotate \
$RPM_BUILD_ROOT/etc/logrotate.d/httpd
-# Install systemd service man pages
+# Install man pages
+install -d $RPM_BUILD_ROOT%{_mandir}/man8 $RPM_BUILD_ROOT%{_mandir}/man5
install -m 644 -p httpd.service.8 httpd-init.service.8 httpd.socket.8 \
httpd@.service.8 htcacheclean.service.8 \
$RPM_BUILD_ROOT%{_mandir}/man8
+install -m 644 -p httpd.conf.5 \
+ $RPM_BUILD_ROOT%{_mandir}/man5
# fix man page paths
sed -e "s|/usr/local/apache2/conf/httpd.conf|/etc/httpd/conf/httpd.conf|" \
@@ -660,6 +668,7 @@ exit $rv
%attr(0700,apache,apache) %dir %{_localstatedir}/cache/httpd/proxy
%{_mandir}/man8/*
+%{_mandir}/man5/*
%exclude %{_mandir}/man8/httpd-init.*
%{_unitdir}/httpd.service
@@ -729,6 +738,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Nov 8 2018 Joe Orton - 2.4.37-4
+- add httpd.conf(5) (#1611361)
+
* Wed Nov 07 2018 Luboš Uhliarik - 2.4.37-3
- Resolves: #1647241 - fix apachectl script
From f7bb212f408bbcd0ffd3c6b0fb1ae7975c41d772 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Fri, 9 Nov 2018 09:01:23 +0000
Subject: [PATCH 016/231] add httpd.conf(5) (#1611361) Resolves: rhbz#1611361
---
00-mpm.conf | 2 +-
httpd.spec | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/00-mpm.conf b/00-mpm.conf
index b15f913..a4a70b8 100644
--- a/00-mpm.conf
+++ b/00-mpm.conf
@@ -1,5 +1,5 @@
# Select the MPM module which should be used by uncommenting exactly
-# one of the following LoadModule lines. See the httpd.service(8) man
+# one of the following LoadModule lines. See the httpd.conf(5) man
# page for more information on changing the MPM.
# prefork MPM: Implements a non-threaded, pre-forking web server
diff --git a/httpd.spec b/httpd.spec
index 5f68c0b..715a9e8 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -50,6 +50,7 @@ Source30: README.confd
Source31: README.confmod
Source32: httpd.service.xml
Source33: htcacheclean.service.xml
+Source34: httpd.conf.xml
Source40: htcacheclean.service
Source41: htcacheclean.sysconf
Source42: httpd-init.service
From affd30da6fb6cf7a15bdcadca606a84a42eeecc1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubo=C5=A1=20Uhliarik?=
Date: Fri, 23 Nov 2018 11:11:59 +0100
Subject: [PATCH 017/231] Resolves: #1652678 - TLS connection allowed while all
protocols are forbidden
---
httpd-2.4.34-sslprotdefault.patch | 53 -----------------
httpd-2.4.37-sslprotdefault.patch | 98 +++++++++++++++++++++++++++++++
httpd.spec | 7 ++-
3 files changed, 103 insertions(+), 55 deletions(-)
delete mode 100644 httpd-2.4.34-sslprotdefault.patch
create mode 100644 httpd-2.4.37-sslprotdefault.patch
diff --git a/httpd-2.4.34-sslprotdefault.patch b/httpd-2.4.34-sslprotdefault.patch
deleted file mode 100644
index 65f8d40..0000000
--- a/httpd-2.4.34-sslprotdefault.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1618371
-
---- httpd-2.4.34/modules/ssl/ssl_engine_config.c.sslprotdefault
-+++ httpd-2.4.34/modules/ssl/ssl_engine_config.c
-@@ -119,7 +119,7 @@
- mctx->ticket_key = NULL;
- #endif
-
-- mctx->protocol = SSL_PROTOCOL_DEFAULT;
-+ mctx->protocol = SSL_PROTOCOL_NONE;
- mctx->protocol_set = 0;
-
- mctx->pphrase_dialog_type = SSL_PPTYPE_UNSET;
---- httpd-2.4.34/modules/ssl/ssl_engine_init.c.sslprotdefault
-+++ httpd-2.4.34/modules/ssl/ssl_engine_init.c
-@@ -555,9 +555,8 @@
- * Create the new per-server SSL context
- */
- if (protocol == SSL_PROTOCOL_NONE) {
-- ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02231)
-- "No SSL protocols available [hint: SSLProtocol]");
-- return ssl_die(s);
-+ ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s,
-+ "Using OpenSSL/system default SSL/TLS protocols");
- }
-
- cp = apr_pstrcat(p,
-@@ -673,14 +672,8 @@
- } else if (protocol & SSL_PROTOCOL_SSLV3) {
- prot = SSL3_VERSION;
- #endif
-- } else {
-- SSL_CTX_free(ctx);
-- mctx->ssl_ctx = NULL;
-- ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(03378)
-- "No SSL protocols available [hint: SSLProtocol]");
-- return ssl_die(s);
- }
-- SSL_CTX_set_max_proto_version(ctx, prot);
-+ if (protocol != SSL_PROTOCOL_NONE) SSL_CTX_set_max_proto_version(ctx, prot);
-
- /* Next we scan for the minimal protocol version we should provide,
- * but we do not allow holes between max and min */
-@@ -700,7 +693,7 @@
- prot = SSL3_VERSION;
- }
- #endif
-- SSL_CTX_set_min_proto_version(ctx, prot);
-+ if (protocol != SSL_PROTOCOL_NONE) SSL_CTX_set_min_proto_version(ctx, prot);
- #endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L */
-
- #ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
diff --git a/httpd-2.4.37-sslprotdefault.patch b/httpd-2.4.37-sslprotdefault.patch
new file mode 100644
index 0000000..546fa1f
--- /dev/null
+++ b/httpd-2.4.37-sslprotdefault.patch
@@ -0,0 +1,98 @@
+diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c
+index 55c237e..5467d23 100644
+--- a/modules/ssl/ssl_engine_config.c
++++ b/modules/ssl/ssl_engine_config.c
+@@ -119,7 +119,7 @@ static void modssl_ctx_init(modssl_ctx_t *mctx, apr_pool_t *p)
+ mctx->ticket_key = NULL;
+ #endif
+
+- mctx->protocol = SSL_PROTOCOL_DEFAULT;
++ mctx->protocol = SSL_PROTOCOL_NONE;
+ mctx->protocol_set = 0;
+
+ mctx->pphrase_dialog_type = SSL_PPTYPE_UNSET;
+@@ -262,6 +262,7 @@ static void modssl_ctx_cfg_merge(apr_pool_t *p,
+ {
+ if (add->protocol_set) {
+ mrg->protocol = add->protocol;
++ mrg->protocol_set = 1;
+ }
+ else {
+ mrg->protocol = base->protocol;
+diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
+index e3f62fe..31fc0e6 100644
+--- a/modules/ssl/ssl_engine_init.c
++++ b/modules/ssl/ssl_engine_init.c
+@@ -568,6 +568,7 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
+ MODSSL_SSL_METHOD_CONST SSL_METHOD *method = NULL;
+ char *cp;
+ int protocol = mctx->protocol;
++ int protocol_set = mctx->protocol_set;
+ SSLSrvConfigRec *sc = mySrvConfig(s);
+ #if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ int prot;
+@@ -577,12 +578,18 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
+ * Create the new per-server SSL context
+ */
+ if (protocol == SSL_PROTOCOL_NONE) {
+- ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02231)
+- "No SSL protocols available [hint: SSLProtocol]");
+- return ssl_die(s);
+- }
++ if (protocol_set) {
++ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02231)
++ "No SSL protocols available [hint: SSLProtocol]");
++ return ssl_die(s);
++ }
+
+- cp = apr_pstrcat(p,
++ ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s,
++ "Using OpenSSL/system default SSL/TLS protocols");
++ cp = "default";
++ }
++ else {
++ cp = apr_pstrcat(p,
+ #ifndef OPENSSL_NO_SSL3
+ (protocol & SSL_PROTOCOL_SSLV3 ? "SSLv3, " : ""),
+ #endif
+@@ -595,7 +602,8 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
+ #endif
+ #endif
+ NULL);
+- cp[strlen(cp)-2] = NUL;
++ cp[strlen(cp)-2] = NUL;
++ }
+
+ ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s,
+ "Creating new SSL context (protocols: %s)", cp);
+@@ -696,13 +704,15 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
+ prot = SSL3_VERSION;
+ #endif
+ } else {
+- SSL_CTX_free(ctx);
+- mctx->ssl_ctx = NULL;
+- ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(03378)
+- "No SSL protocols available [hint: SSLProtocol]");
+- return ssl_die(s);
++ if (protocol_set) {
++ SSL_CTX_free(ctx);
++ mctx->ssl_ctx = NULL;
++ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(03378)
++ "No SSL protocols available [hint: SSLProtocol]");
++ return ssl_die(s);
++ }
+ }
+- SSL_CTX_set_max_proto_version(ctx, prot);
++ if (protocol != SSL_PROTOCOL_NONE) SSL_CTX_set_max_proto_version(ctx, prot);
+
+ /* Next we scan for the minimal protocol version we should provide,
+ * but we do not allow holes between max and min */
+@@ -726,7 +736,7 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
+ prot = SSL3_VERSION;
+ }
+ #endif
+- SSL_CTX_set_min_proto_version(ctx, prot);
++ if (protocol != SSL_PROTOCOL_NONE) SSL_CTX_set_min_proto_version(ctx, prot);
+ #endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L */
+
+ #ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
diff --git a/httpd.spec b/httpd.spec
index 715a9e8..8014895 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.37
-Release: 4%{?dist}
+Release: 5%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -76,7 +76,7 @@ Patch31: httpd-2.4.33-sslmultiproxy.patch
Patch34: httpd-2.4.17-socket-activation.patch
Patch36: httpd-2.4.33-r1830819+.patch
Patch38: httpd-2.4.34-sslciphdefault.patch
-Patch39: httpd-2.4.34-sslprotdefault.patch
+Patch39: httpd-2.4.37-sslprotdefault.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -739,6 +739,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Nov 22 2018 Luboš Uhliarik - 2.4.37-5
+- Resolves: #1652678 - TLS connection allowed while all protocols are forbidden
+
* Thu Nov 8 2018 Joe Orton - 2.4.37-4
- add httpd.conf(5) (#1611361)
From 85e5fe0b3f371d4964757099fe0f6d62f8ddf390 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Fri, 9 Nov 2018 11:46:40 +0000
Subject: [PATCH 018/231] Fix spelling.
---
httpd.conf.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/httpd.conf.xml b/httpd.conf.xml
index fdf02b7..0a7bdc1 100644
--- a/httpd.conf.xml
+++ b/httpd.conf.xml
@@ -223,7 +223,7 @@
Instantiated servicesAs an alternative to (or in addition to) the
- httpd.service unit, the instatiated template
+ httpd.service unit, the instantiated template
service httpd@.service unit file can be used,
which starts httpd using a different
configuration file to the default. For example,
From 8fe3905176a114f7a663edbfc991dc513e82a876 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Thu, 29 Nov 2018 16:48:09 +0000
Subject: [PATCH 019/231] Wording tweaks.
---
httpd.conf.xml | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/httpd.conf.xml b/httpd.conf.xml
index 0a7bdc1..705e527 100644
--- a/httpd.conf.xml
+++ b/httpd.conf.xml
@@ -50,12 +50,11 @@
Description
- The httpd daemon uses a main
- configuration file at
+ The main configuration file for the httpd daemon is
/etc/httpd/conf/httpd.conf. The syntax of
this file is described at , and
- the full set of available directives at .
@@ -130,8 +129,8 @@
Module configuration filesModule configuration files are provided in the
- /etc/httpd/conf.modules.d/ directory, with
- names which are by convention prefixed with two digit numeric
+ /etc/httpd/conf.modules.d/ directory. Filenames
+ in this directory are by convention prefixed with two digit numeric
prefix to ensure they are processed in the desired order. Core
modules provide with the httpd package are
loaded by files with a prefix to ensure
From e7d5e11589c1bc5d6b9d439d20c1bfe477256428 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Wed, 19 Dec 2018 16:01:30 +0000
Subject: [PATCH 020/231] Fix typos.
---
httpd.conf.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/httpd.conf.xml b/httpd.conf.xml
index 705e527..3a02111 100644
--- a/httpd.conf.xml
+++ b/httpd.conf.xml
@@ -71,7 +71,7 @@
appropriate directive so that module
is loaded by default.
- Some notable configured defaults are:.
+ Some notable configured defaults are:
@@ -81,7 +81,7 @@
- The daemon lists on TCP port 80.
+ The daemon listens on TCP port 80.
From ccaa54fd8d3aad780b8ee1588e2b77220a47a3d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?=
Date: Mon, 14 Jan 2019 19:04:04 +0100
Subject: [PATCH 021/231] Rebuilt for libcrypt.so.2 (#1666033)
---
httpd.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/httpd.spec b/httpd.spec
index 8014895..8e3bf09 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.37
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -739,6 +739,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Mon Jan 14 2019 Björn Esser - 2.4.37-6
+- Rebuilt for libcrypt.so.2 (#1666033)
+
* Thu Nov 22 2018 Luboš Uhliarik - 2.4.37-5
- Resolves: #1652678 - TLS connection allowed while all protocols are forbidden
From 1810bd511f23f55b129cb3b2ecda3b293bb08f63 Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Wed, 23 Jan 2019 11:21:32 +0000
Subject: [PATCH 022/231] new version 2.4.38 (#1668125) adjusted patches
---
...819+.patch => httpd-2.4.38-r1830819+.patch | 98 +++++++++----------
httpd.spec | 11 ++-
sources | 2 +-
3 files changed, 52 insertions(+), 59 deletions(-)
rename httpd-2.4.33-r1830819+.patch => httpd-2.4.38-r1830819+.patch (89%)
diff --git a/httpd-2.4.33-r1830819+.patch b/httpd-2.4.38-r1830819+.patch
similarity index 89%
rename from httpd-2.4.33-r1830819+.patch
rename to httpd-2.4.38-r1830819+.patch
index 0b2d90d..01027ce 100644
--- a/httpd-2.4.33-r1830819+.patch
+++ b/httpd-2.4.38-r1830819+.patch
@@ -9,9 +9,11 @@ http://svn.apache.org/viewvc?view=revision&revision=1831173
http://svn.apache.org/viewvc?view=revision&revision=1835240
http://svn.apache.org/viewvc?view=revision&revision=1835242
---- httpd-2.4.33/modules/ssl/ssl_engine_config.c.r1830819+
-+++ httpd-2.4.33/modules/ssl/ssl_engine_config.c
-@@ -891,7 +891,9 @@
+diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c
+index d276fea..5467d23 100644
+--- a/modules/ssl/ssl_engine_config.c
++++ b/modules/ssl/ssl_engine_config.c
+@@ -919,7 +919,9 @@ const char *ssl_cmd_SSLCertificateFile(cmd_parms *cmd,
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
const char *err;
@@ -22,7 +24,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
return err;
}
-@@ -907,7 +909,9 @@
+@@ -935,7 +937,9 @@ const char *ssl_cmd_SSLCertificateKeyFile(cmd_parms *cmd,
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
const char *err;
@@ -33,9 +35,11 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
return err;
}
---- httpd-2.4.33/modules/ssl/ssl_engine_init.c.r1830819+
-+++ httpd-2.4.33/modules/ssl/ssl_engine_init.c
-@@ -1181,12 +1182,18 @@
+diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
+index 8ba3486..e1b0844 100644
+--- a/modules/ssl/ssl_engine_init.c
++++ b/modules/ssl/ssl_engine_init.c
+@@ -1264,12 +1264,18 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
(certfile = APR_ARRAY_IDX(mctx->pks->cert_files, i,
const char *));
i++) {
@@ -55,7 +59,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
if ((SSL_CTX_use_certificate_file(mctx->ssl_ctx, certfile,
SSL_FILETYPE_PEM) < 1)) {
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02561)
-@@ -1215,12 +1222,46 @@
+@@ -1298,12 +1304,46 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
ERR_clear_error();
@@ -107,7 +111,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
const unsigned char *ptr;
ERR_clear_error();
-@@ -1307,8 +1348,9 @@
+@@ -1390,8 +1430,9 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
/*
* Try to read DH parameters from the (first) SSLCertificateFile
*/
@@ -119,7 +123,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
SSL_CTX_set_tmp_dh(mctx->ssl_ctx, dhparams);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02540)
"Custom DH parameters (%d bits) for %s loaded from %s",
-@@ -1320,10 +1362,10 @@
+@@ -1403,10 +1444,10 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
/*
* Similarly, try to read the ECDH curve name from SSLCertificateFile...
*/
@@ -134,42 +138,20 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
SSL_CTX_set_tmp_ecdh(mctx->ssl_ctx, eckey);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02541)
"ECDH curve %s for %s specified in %s",
---- httpd-2.4.33/modules/ssl/ssl_engine_pphrase.c.r1830819+
-+++ httpd-2.4.33/modules/ssl/ssl_engine_pphrase.c
-@@ -143,9 +143,6 @@
+diff --git a/modules/ssl/ssl_engine_pphrase.c b/modules/ssl/ssl_engine_pphrase.c
+index 8c29443..d5d33f7 100644
+--- a/modules/ssl/ssl_engine_pphrase.c
++++ b/modules/ssl/ssl_engine_pphrase.c
+@@ -143,8 +143,6 @@ apr_status_t ssl_load_encrypted_pkey(server_rec *s, apr_pool_t *p, int idx,
const char *key_id = asn1_table_vhost_key(mc, p, sc->vhost_id, idx);
EVP_PKEY *pPrivateKey = NULL;
ssl_asn1_t *asn1;
- unsigned char *ucp;
- long int length;
-- BOOL bReadable;
int nPassPhrase = (*pphrases)->nelts;
int nPassPhraseRetry = 0;
apr_time_t pkey_mtime = 0;
-@@ -222,16 +219,12 @@
- * is not empty. */
- ERR_clear_error();
-
-- bReadable = ((pPrivateKey = modssl_read_privatekey(ppcb_arg.pkey_file,
-- NULL, ssl_pphrase_Handle_CB, &ppcb_arg)) != NULL ?
-- TRUE : FALSE);
--
-- /*
-- * when the private key file now was readable,
-- * it's fine and we go out of the loop
-- */
-- if (bReadable)
-- break;
-+ pPrivateKey = modssl_read_privatekey(ppcb_arg.pkey_file,
-+ ssl_pphrase_Handle_CB, &ppcb_arg);
-+ /* If the private key was successfully read, nothing more to
-+ do here. */
-+ if (pPrivateKey != NULL)
-+ break;
-
- /*
- * when we have more remembered pass phrases
-@@ -356,19 +349,12 @@
+@@ -351,19 +349,12 @@ apr_status_t ssl_load_encrypted_pkey(server_rec *s, apr_pool_t *p, int idx,
nPassPhrase++;
}
@@ -192,7 +174,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
asn1->source_mtime = pkey_mtime;
}
-@@ -619,3 +605,288 @@
+@@ -614,3 +605,288 @@ int ssl_pphrase_Handle_CB(char *buf, int bufsize, int verify, void *srv)
*/
return (len);
}
@@ -481,9 +463,11 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
+ return APR_SUCCESS;
+}
+#endif
---- httpd-2.4.33/modules/ssl/ssl_private.h.r1830819+
-+++ httpd-2.4.33/modules/ssl/ssl_private.h
-@@ -976,21 +976,28 @@
+diff --git a/modules/ssl/ssl_private.h b/modules/ssl/ssl_private.h
+index f46814d..1fdde13 100644
+--- a/modules/ssl/ssl_private.h
++++ b/modules/ssl/ssl_private.h
+@@ -1002,21 +1002,28 @@ BOOL ssl_util_vhost_matches(const char *servername, server_rec *s);
apr_status_t ssl_load_encrypted_pkey(server_rec *, apr_pool_t *, int,
const char *, apr_array_header_t **);
@@ -521,7 +505,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
/** Mutex Support */
int ssl_mutex_init(server_rec *, apr_pool_t *);
-@@ -1078,6 +1085,10 @@
+@@ -1109,6 +1116,10 @@ int modssl_request_is_tls(const request_rec *r, SSLConnRec **sslconn);
int ssl_is_challenge(conn_rec *c, const char *servername,
X509 **pcert, EVP_PKEY **pkey);
@@ -532,9 +516,11 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
#endif /* SSL_PRIVATE_H */
/** @} */
---- httpd-2.4.33/modules/ssl/ssl_util.c.r1830819+
-+++ httpd-2.4.33/modules/ssl/ssl_util.c
-@@ -181,45 +181,37 @@
+diff --git a/modules/ssl/ssl_util.c b/modules/ssl/ssl_util.c
+index 0d23465..223b385 100644
+--- a/modules/ssl/ssl_util.c
++++ b/modules/ssl/ssl_util.c
+@@ -192,45 +192,37 @@ BOOL ssl_util_path_check(ssl_pathcheck_t pcm, const char *path, apr_pool_t *p)
return TRUE;
}
@@ -596,7 +582,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
}
ssl_asn1_t *ssl_asn1_table_get(apr_hash_t *table,
-@@ -469,3 +461,13 @@
+@@ -480,3 +472,13 @@ void ssl_util_thread_id_setup(apr_pool_t *p)
}
#endif /* #if APR_HAS_THREADS && MODSSL_USE_OPENSSL_PRE_1_1_API */
@@ -610,9 +596,11 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
+ return 0;
+#endif
+}
---- httpd-2.4.33/modules/ssl/ssl_util_ssl.c.r1830819+
-+++ httpd-2.4.33/modules/ssl/ssl_util_ssl.c
-@@ -74,7 +74,7 @@
+diff --git a/modules/ssl/ssl_util_ssl.c b/modules/ssl/ssl_util_ssl.c
+index b7f0eca..4fa089b 100644
+--- a/modules/ssl/ssl_util_ssl.c
++++ b/modules/ssl/ssl_util_ssl.c
+@@ -74,7 +74,7 @@ void modssl_set_app_data2(SSL *ssl, void *arg)
** _________________________________________________________________
*/
@@ -621,7 +609,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
{
EVP_PKEY *rc;
BIO *bioS;
-@@ -83,7 +83,7 @@
+@@ -83,7 +83,7 @@ EVP_PKEY *modssl_read_privatekey(const char* filename, EVP_PKEY **key, pem_passw
/* 1. try PEM (= DER+Base64+headers) */
if ((bioS=BIO_new_file(filename, "r")) == NULL)
return NULL;
@@ -630,7 +618,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
BIO_free(bioS);
if (rc == NULL) {
-@@ -107,41 +107,9 @@
+@@ -107,41 +107,9 @@ EVP_PKEY *modssl_read_privatekey(const char* filename, EVP_PKEY **key, pem_passw
BIO_free(bioS);
}
}
@@ -672,8 +660,10 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
/* _________________________________________________________________
**
** Smart shutdown
---- httpd-2.4.33/modules/ssl/ssl_util_ssl.h.r1830819+
-+++ httpd-2.4.33/modules/ssl/ssl_util_ssl.h
+diff --git a/modules/ssl/ssl_util_ssl.h b/modules/ssl/ssl_util_ssl.h
+index c67dacf..d6307d9 100644
+--- a/modules/ssl/ssl_util_ssl.h
++++ b/modules/ssl/ssl_util_ssl.h
@@ -64,8 +64,11 @@
void modssl_init_app_data2_idx(void);
void *modssl_get_app_data2(SSL *);
diff --git a/httpd.spec b/httpd.spec
index 8e3bf09..6539e23 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -12,8 +12,8 @@
Summary: Apache HTTP Server
Name: httpd
-Version: 2.4.37
-Release: 6%{?dist}
+Version: 2.4.38
+Release: 1%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -74,7 +74,7 @@ Patch29: httpd-2.4.33-systemd.patch
Patch30: httpd-2.4.4-cachehardmax.patch
Patch31: httpd-2.4.33-sslmultiproxy.patch
Patch34: httpd-2.4.17-socket-activation.patch
-Patch36: httpd-2.4.33-r1830819+.patch
+Patch36: httpd-2.4.38-r1830819+.patch
Patch38: httpd-2.4.34-sslciphdefault.patch
Patch39: httpd-2.4.37-sslprotdefault.patch
@@ -235,7 +235,7 @@ interface for storing and accessing per-user session data.
%patch30 -p1 -b .cachehardmax
#patch31 -p1 -b .sslmultiproxy
%patch34 -p1 -b .socketactivation
-%patch36 -p1 -b .r1830819+
+#%patch36 -p1 -b .r1830819+
%patch38 -p1 -b .sslciphdefault
%patch39 -p1 -b .sslprotdefault
@@ -739,6 +739,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Wed Jan 23 2019 Lubos Uhliarik - 2.4.38-1
+- new version 2.4.38 (#1668125)
+
* Mon Jan 14 2019 Björn Esser - 2.4.37-6
- Rebuilt for libcrypt.so.2 (#1666033)
diff --git a/sources b/sources
index ca284fa..69cd474 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (httpd-2.4.37.tar.bz2) = e802915801bbe885a65dada04b0116d145b293fabfff734dddb61a79ca1c6d65326f51155d1b864b093c3ec00d0bdfdf1401ab55677bae1ea3da1d199d7bcad4
+SHA512 (httpd-2.4.38.tar.bz2) = 8bdc36fa2bd13fd83feee17fdce4a5316ed8f96c1ac32b636ba106572ba257815438c72068d2d0e900783a3fa25c90a5da34c3f83fc2c04a1dbdbf234f7ad448
From a18552330d63b8d908a523a98bd6588ee86e1d47 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Wed, 23 Jan 2019 13:04:05 +0100
Subject: [PATCH 023/231] Update PKCS#11 patch.
---
httpd-2.4.38-r1830819+.patch | 81 +++++++++++++++++-------------------
httpd.spec | 2 +-
2 files changed, 40 insertions(+), 43 deletions(-)
diff --git a/httpd-2.4.38-r1830819+.patch b/httpd-2.4.38-r1830819+.patch
index 01027ce..7df5ff6 100644
--- a/httpd-2.4.38-r1830819+.patch
+++ b/httpd-2.4.38-r1830819+.patch
@@ -11,9 +11,9 @@ http://svn.apache.org/viewvc?view=revision&revision=1835242
diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c
index d276fea..5467d23 100644
---- a/modules/ssl/ssl_engine_config.c
-+++ b/modules/ssl/ssl_engine_config.c
-@@ -919,7 +919,9 @@ const char *ssl_cmd_SSLCertificateFile(cmd_parms *cmd,
+--- httpd-2.4.38/modules/ssl/ssl_engine_config.c.r1830819+
++++ httpd-2.4.38/modules/ssl/ssl_engine_config.c
+@@ -916,7 +916,9 @@
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
const char *err;
@@ -24,7 +24,7 @@ index d276fea..5467d23 100644
return err;
}
-@@ -935,7 +937,9 @@ const char *ssl_cmd_SSLCertificateKeyFile(cmd_parms *cmd,
+@@ -932,7 +934,9 @@
SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
const char *err;
@@ -35,11 +35,9 @@ index d276fea..5467d23 100644
return err;
}
-diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
-index 8ba3486..e1b0844 100644
---- a/modules/ssl/ssl_engine_init.c
-+++ b/modules/ssl/ssl_engine_init.c
-@@ -1264,12 +1264,18 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
+--- httpd-2.4.38/modules/ssl/ssl_engine_init.c.r1830819+
++++ httpd-2.4.38/modules/ssl/ssl_engine_init.c
+@@ -1228,12 +1228,18 @@
(certfile = APR_ARRAY_IDX(mctx->pks->cert_files, i,
const char *));
i++) {
@@ -59,7 +57,7 @@ index 8ba3486..e1b0844 100644
if ((SSL_CTX_use_certificate_file(mctx->ssl_ctx, certfile,
SSL_FILETYPE_PEM) < 1)) {
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02561)
-@@ -1298,12 +1304,46 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
+@@ -1262,12 +1268,46 @@
ERR_clear_error();
@@ -111,7 +109,7 @@ index 8ba3486..e1b0844 100644
const unsigned char *ptr;
ERR_clear_error();
-@@ -1390,8 +1430,9 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
+@@ -1354,8 +1394,9 @@
/*
* Try to read DH parameters from the (first) SSLCertificateFile
*/
@@ -123,7 +121,7 @@ index 8ba3486..e1b0844 100644
SSL_CTX_set_tmp_dh(mctx->ssl_ctx, dhparams);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02540)
"Custom DH parameters (%d bits) for %s loaded from %s",
-@@ -1403,10 +1444,10 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
+@@ -1367,10 +1408,10 @@
/*
* Similarly, try to read the ECDH curve name from SSLCertificateFile...
*/
@@ -138,11 +136,9 @@ index 8ba3486..e1b0844 100644
SSL_CTX_set_tmp_ecdh(mctx->ssl_ctx, eckey);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02541)
"ECDH curve %s for %s specified in %s",
-diff --git a/modules/ssl/ssl_engine_pphrase.c b/modules/ssl/ssl_engine_pphrase.c
-index 8c29443..d5d33f7 100644
---- a/modules/ssl/ssl_engine_pphrase.c
-+++ b/modules/ssl/ssl_engine_pphrase.c
-@@ -143,8 +143,6 @@ apr_status_t ssl_load_encrypted_pkey(server_rec *s, apr_pool_t *p, int idx,
+--- httpd-2.4.38/modules/ssl/ssl_engine_pphrase.c.r1830819+
++++ httpd-2.4.38/modules/ssl/ssl_engine_pphrase.c
+@@ -143,8 +143,6 @@
const char *key_id = asn1_table_vhost_key(mc, p, sc->vhost_id, idx);
EVP_PKEY *pPrivateKey = NULL;
ssl_asn1_t *asn1;
@@ -151,7 +147,16 @@ index 8c29443..d5d33f7 100644
int nPassPhrase = (*pphrases)->nelts;
int nPassPhraseRetry = 0;
apr_time_t pkey_mtime = 0;
-@@ -351,19 +349,12 @@ apr_status_t ssl_load_encrypted_pkey(server_rec *s, apr_pool_t *p, int idx,
+@@ -221,7 +219,7 @@
+ * is not empty. */
+ ERR_clear_error();
+
+- pPrivateKey = modssl_read_privatekey(ppcb_arg.pkey_file, NULL,
++ pPrivateKey = modssl_read_privatekey(ppcb_arg.pkey_file,
+ ssl_pphrase_Handle_CB, &ppcb_arg);
+ /* If the private key was successfully read, nothing more to
+ do here. */
+@@ -351,19 +349,12 @@
nPassPhrase++;
}
@@ -174,7 +179,7 @@ index 8c29443..d5d33f7 100644
asn1->source_mtime = pkey_mtime;
}
-@@ -614,3 +605,288 @@ int ssl_pphrase_Handle_CB(char *buf, int bufsize, int verify, void *srv)
+@@ -614,3 +605,288 @@
*/
return (len);
}
@@ -463,11 +468,9 @@ index 8c29443..d5d33f7 100644
+ return APR_SUCCESS;
+}
+#endif
-diff --git a/modules/ssl/ssl_private.h b/modules/ssl/ssl_private.h
-index f46814d..1fdde13 100644
---- a/modules/ssl/ssl_private.h
-+++ b/modules/ssl/ssl_private.h
-@@ -1002,21 +1002,28 @@ BOOL ssl_util_vhost_matches(const char *servername, server_rec *s);
+--- httpd-2.4.38/modules/ssl/ssl_private.h.r1830819+
++++ httpd-2.4.38/modules/ssl/ssl_private.h
+@@ -1002,21 +1002,28 @@
apr_status_t ssl_load_encrypted_pkey(server_rec *, apr_pool_t *, int,
const char *, apr_array_header_t **);
@@ -505,7 +508,7 @@ index f46814d..1fdde13 100644
/** Mutex Support */
int ssl_mutex_init(server_rec *, apr_pool_t *);
-@@ -1109,6 +1116,10 @@ int modssl_request_is_tls(const request_rec *r, SSLConnRec **sslconn);
+@@ -1109,6 +1116,10 @@
int ssl_is_challenge(conn_rec *c, const char *servername,
X509 **pcert, EVP_PKEY **pkey);
@@ -516,11 +519,9 @@ index f46814d..1fdde13 100644
#endif /* SSL_PRIVATE_H */
/** @} */
-diff --git a/modules/ssl/ssl_util.c b/modules/ssl/ssl_util.c
-index 0d23465..223b385 100644
---- a/modules/ssl/ssl_util.c
-+++ b/modules/ssl/ssl_util.c
-@@ -192,45 +192,37 @@ BOOL ssl_util_path_check(ssl_pathcheck_t pcm, const char *path, apr_pool_t *p)
+--- httpd-2.4.38/modules/ssl/ssl_util.c.r1830819+
++++ httpd-2.4.38/modules/ssl/ssl_util.c
+@@ -192,45 +192,37 @@
return TRUE;
}
@@ -582,7 +583,7 @@ index 0d23465..223b385 100644
}
ssl_asn1_t *ssl_asn1_table_get(apr_hash_t *table,
-@@ -480,3 +472,13 @@ void ssl_util_thread_id_setup(apr_pool_t *p)
+@@ -480,3 +472,13 @@
}
#endif /* #if APR_HAS_THREADS && MODSSL_USE_OPENSSL_PRE_1_1_API */
@@ -596,11 +597,9 @@ index 0d23465..223b385 100644
+ return 0;
+#endif
+}
-diff --git a/modules/ssl/ssl_util_ssl.c b/modules/ssl/ssl_util_ssl.c
-index b7f0eca..4fa089b 100644
---- a/modules/ssl/ssl_util_ssl.c
-+++ b/modules/ssl/ssl_util_ssl.c
-@@ -74,7 +74,7 @@ void modssl_set_app_data2(SSL *ssl, void *arg)
+--- httpd-2.4.38/modules/ssl/ssl_util_ssl.c.r1830819+
++++ httpd-2.4.38/modules/ssl/ssl_util_ssl.c
+@@ -74,7 +74,7 @@
** _________________________________________________________________
*/
@@ -609,7 +608,7 @@ index b7f0eca..4fa089b 100644
{
EVP_PKEY *rc;
BIO *bioS;
-@@ -83,7 +83,7 @@ EVP_PKEY *modssl_read_privatekey(const char* filename, EVP_PKEY **key, pem_passw
+@@ -83,7 +83,7 @@
/* 1. try PEM (= DER+Base64+headers) */
if ((bioS=BIO_new_file(filename, "r")) == NULL)
return NULL;
@@ -618,7 +617,7 @@ index b7f0eca..4fa089b 100644
BIO_free(bioS);
if (rc == NULL) {
-@@ -107,41 +107,9 @@ EVP_PKEY *modssl_read_privatekey(const char* filename, EVP_PKEY **key, pem_passw
+@@ -107,41 +107,9 @@
BIO_free(bioS);
}
}
@@ -660,10 +659,8 @@ index b7f0eca..4fa089b 100644
/* _________________________________________________________________
**
** Smart shutdown
-diff --git a/modules/ssl/ssl_util_ssl.h b/modules/ssl/ssl_util_ssl.h
-index c67dacf..d6307d9 100644
---- a/modules/ssl/ssl_util_ssl.h
-+++ b/modules/ssl/ssl_util_ssl.h
+--- httpd-2.4.38/modules/ssl/ssl_util_ssl.h.r1830819+
++++ httpd-2.4.38/modules/ssl/ssl_util_ssl.h
@@ -64,8 +64,11 @@
void modssl_init_app_data2_idx(void);
void *modssl_get_app_data2(SSL *);
diff --git a/httpd.spec b/httpd.spec
index 6539e23..01c4dda 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -235,7 +235,7 @@ interface for storing and accessing per-user session data.
%patch30 -p1 -b .cachehardmax
#patch31 -p1 -b .sslmultiproxy
%patch34 -p1 -b .socketactivation
-#%patch36 -p1 -b .r1830819+
+%patch36 -p1 -b .r1830819+
%patch38 -p1 -b .sslciphdefault
%patch39 -p1 -b .sslprotdefault
From 584830e35ee967968509b4d01e9e0a5bcc46ad5f Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Wed, 23 Jan 2019 12:34:26 +0000
Subject: [PATCH 024/231] Updated release num
---
httpd.spec | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/httpd.spec b/httpd.spec
index 01c4dda..6ff6988 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.38
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -739,7 +739,7 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
-* Wed Jan 23 2019 Lubos Uhliarik - 2.4.38-1
+* Wed Jan 23 2019 Lubos Uhliarik - 2.4.38-2
- new version 2.4.38 (#1668125)
* Mon Jan 14 2019 Björn Esser - 2.4.37-6
From a0bbdf8c6cb24387f0d5869a95215bcceb4c4a15 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko
Date: Mon, 28 Jan 2019 20:17:48 +0100
Subject: [PATCH 025/231] Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
---
httpd.spec | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/httpd.spec b/httpd.spec
index 6ff6988..378d347 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -86,7 +86,6 @@ Patch60: httpd-2.4.34-enable-sslv3.patch
# Security fixes
License: ASL 2.0
-Group: System Environment/Daemons
BuildRequires: gcc, autoconf, pkgconfig, findutils, xmlto
BuildRequires: perl-interpreter, perl-generators, systemd-devel
BuildRequires: zlib-devel, libselinux-devel, lua-devel, brotli-devel
@@ -112,7 +111,6 @@ The Apache HTTP Server is a powerful, efficient, and extensible
web server.
%package devel
-Group: Development/Libraries
Summary: Development interfaces for the Apache HTTP Server
Requires: apr-devel, apr-util-devel, pkgconfig
Requires: httpd = %{version}-%{release}
@@ -127,7 +125,6 @@ able to compile or develop additional modules for Apache, you need
to install this package.
%package manual
-Group: Documentation
Summary: Documentation for the Apache HTTP Server
Requires: httpd = %{version}-%{release}
BuildArch: noarch
@@ -138,7 +135,6 @@ reference guide for the Apache HTTP Server. The information can
also be found at https://httpd.apache.org/docs/2.4/.
%package filesystem
-Group: System Environment/Daemons
Summary: The basic directory layout for the Apache HTTP Server
BuildArch: noarch
Requires(pre): /usr/sbin/useradd
@@ -149,7 +145,6 @@ for the Apache HTTP Server including the correct permissions
for the directories.
%package tools
-Group: System Environment/Daemons
Summary: Tools for use with the Apache HTTP Server
%description tools
@@ -157,7 +152,6 @@ The httpd-tools package contains tools which can be used with
the Apache HTTP Server.
%package -n mod_ssl
-Group: System Environment/Daemons
Summary: SSL/TLS module for the Apache HTTP Server
Epoch: 1
BuildRequires: openssl-devel
@@ -173,7 +167,6 @@ server via the Secure Sockets Layer (SSL) and Transport Layer
Security (TLS) protocols.
%package -n mod_md
-Group: System Environment/Daemons
Summary: Certificate provisioning using ACME for the Apache HTTP Server
Requires: httpd = 0:%{version}-%{release}, httpd-mmn = %{mmnisa}
BuildRequires: jansson-devel, libcurl-devel
@@ -186,7 +179,6 @@ managed domains and their virtual hosts automatically. This includes
renewal of certificates before they expire.
%package -n mod_proxy_html
-Group: System Environment/Daemons
Summary: HTML and XML content filters for the Apache HTTP Server
Requires: httpd = 0:%{version}-%{release}, httpd-mmn = %{mmnisa}
BuildRequires: libxml2-devel
@@ -198,7 +190,6 @@ The mod_proxy_html and mod_xml2enc modules provide filters which can
transform and modify HTML and XML content.
%package -n mod_ldap
-Group: System Environment/Daemons
Summary: LDAP authentication modules for the Apache HTTP Server
Requires: httpd = 0:%{version}-%{release}, httpd-mmn = %{mmnisa}
Requires: apr-util-ldap
@@ -208,7 +199,6 @@ The mod_ldap and mod_authnz_ldap modules add support for LDAP
authentication to the Apache HTTP Server.
%package -n mod_session
-Group: System Environment/Daemons
Summary: Session interface for the Apache HTTP Server
Requires: httpd = 0:%{version}-%{release}, httpd-mmn = %{mmnisa}
From 887d8d1a450e2669aaf5d33b3533874a4e9b73c5 Mon Sep 17 00:00:00 2001
From: Fedora Release Engineering
Date: Fri, 1 Feb 2019 02:28:37 +0000
Subject: [PATCH 026/231] - Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering
---
httpd.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/httpd.spec b/httpd.spec
index 378d347..dc5e500 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.38
-Release: 2%{?dist}
+Release: 3%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -729,6 +729,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Fri Feb 01 2019 Fedora Release Engineering - 2.4.38-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
* Wed Jan 23 2019 Lubos Uhliarik - 2.4.38-2
- new version 2.4.38 (#1668125)
From 80cf4174c6f72e572545afe357b86f19f60712aa Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Tue, 5 Feb 2019 12:11:27 +0000
Subject: [PATCH 027/231] use serverroot-relative statedir, rundir by default
---
config.layout | 24 ++++++++++++++++++
httpd-2.4.37-r1842929+.patch | 49 +++++++++++++++++++++---------------
httpd.spec | 14 ++++++++---
pullrev.sh | 2 +-
4 files changed, 65 insertions(+), 24 deletions(-)
create mode 100644 config.layout
diff --git a/config.layout b/config.layout
new file mode 100644
index 0000000..3a9f6c8
--- /dev/null
+++ b/config.layout
@@ -0,0 +1,24 @@
+# Layout used in Fedora httpd packaging.
+
+ prefix: /etc/httpd
+ localstatedir: /var
+ exec_prefix: /usr
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/libexec
+ mandir: ${exec_prefix}/man
+ sysconfdir: /etc/httpd/conf
+ datadir: ${exec_prefix}/share/httpd
+ installbuilddir: ${libdir}/httpd/build
+ errordir: ${datadir}/error
+ iconsdir: ${datadir}/icons
+ htdocsdir: ${localstatedir}/www/html
+ manualdir: ${datadir}/manual
+ cgidir: ${localstatedir}/www/cgi-bin
+ includedir: ${exec_prefix}/include/httpd
+ runtimedir: ${prefix}/run
+ logfiledir: ${localstatedir}/log/httpd
+ statedir: ${prefix}/state
+ proxycachedir: ${localstatedir}/cache/httpd/proxy
+
diff --git a/httpd-2.4.37-r1842929+.patch b/httpd-2.4.37-r1842929+.patch
index c6aa1f7..e841e34 100644
--- a/httpd-2.4.37-r1842929+.patch
+++ b/httpd-2.4.37-r1842929+.patch
@@ -1,9 +1,10 @@
# ./pullrev.sh 1842929 1842931
http://svn.apache.org/viewvc?view=revision&revision=1842929
http://svn.apache.org/viewvc?view=revision&revision=1842931
+http://svn.apache.org/viewvc?view=revision&revision=1852982
---- httpd-2.4.37/acinclude.m4.r1842929+
-+++ httpd-2.4.37/acinclude.m4
+--- httpd-2.4.38/acinclude.m4.r1842929+
++++ httpd-2.4.38/acinclude.m4
@@ -45,6 +45,7 @@
APACHE_SUBST(installbuilddir)
APACHE_SUBST(runtimedir)
@@ -20,8 +21,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1842931
])
dnl
---- httpd-2.4.37/config.layout.r1842929+
-+++ httpd-2.4.37/config.layout
+--- httpd-2.4.38/config.layout.r1842929+
++++ httpd-2.4.38/config.layout
@@ -29,6 +29,7 @@
includedir: ${prefix}/include
localstatedir: ${prefix}
@@ -142,8 +143,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1842931
logfiledir: ${localstatedir}/log/httpd
proxycachedir: ${localstatedir}/cache/httpd
---- httpd-2.4.37/configure.in.r1842929+
-+++ httpd-2.4.37/configure.in
+--- httpd-2.4.38/configure.in.r1842929+
++++ httpd-2.4.38/configure.in
@@ -41,7 +41,7 @@
AC_PREFIX_DEFAULT(/usr/local/apache2)
@@ -153,8 +154,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1842931
dnl reparse the configure arguments.
APR_PARSE_ARGUMENTS
---- httpd-2.4.37/include/ap_config_layout.h.in.r1842929+
-+++ httpd-2.4.37/include/ap_config_layout.h.in
+--- httpd-2.4.38/include/ap_config_layout.h.in.r1842929+
++++ httpd-2.4.38/include/ap_config_layout.h.in
@@ -60,5 +60,7 @@
#define DEFAULT_REL_LOGFILEDIR "@rel_logfiledir@"
#define DEFAULT_EXP_PROXYCACHEDIR "@exp_proxycachedir@"
@@ -163,8 +164,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1842931
+#define DEFAULT_REL_STATEDIR "@rel_statedir@"
#endif /* AP_CONFIG_LAYOUT_H */
---- httpd-2.4.37/include/http_config.h.r1842929+
-+++ httpd-2.4.37/include/http_config.h
+--- httpd-2.4.38/include/http_config.h.r1842929+
++++ httpd-2.4.38/include/http_config.h
@@ -757,6 +757,14 @@
*/
AP_DECLARE(char *) ap_runtime_dir_relative(apr_pool_t *p, const char *fname);
@@ -180,8 +181,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1842931
/* Finally, the hook for dynamically loading modules in... */
/**
---- httpd-2.4.37/Makefile.in.r1842929+
-+++ httpd-2.4.37/Makefile.in
+--- httpd-2.4.38/Makefile.in.r1842929+
++++ httpd-2.4.38/Makefile.in
@@ -213,6 +213,7 @@
install-other:
@test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)
@@ -190,8 +191,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1842931
@for ext in dll x; do \
file=apachecore.$$ext; \
if test -f $$file; then \
---- httpd-2.4.37/modules/dav/fs/mod_dav_fs.c.r1842929+
-+++ httpd-2.4.37/modules/dav/fs/mod_dav_fs.c
+--- httpd-2.4.38/modules/dav/fs/mod_dav_fs.c.r1842929+
++++ httpd-2.4.38/modules/dav/fs/mod_dav_fs.c
@@ -29,6 +29,10 @@
extern module AP_MODULE_DECLARE_DATA dav_fs_module;
@@ -216,14 +217,14 @@ http://svn.apache.org/viewvc?view=revision&revision=1842931
}
static void *dav_fs_merge_server_config(apr_pool_t *p,
---- httpd-2.4.37/modules/md/mod_md_config.c.r1842929+
-+++ httpd-2.4.37/modules/md/mod_md_config.c
+--- httpd-2.4.38/modules/md/mod_md_config.c.r1842929+
++++ httpd-2.4.38/modules/md/mod_md_config.c
@@ -54,10 +54,14 @@
#define DEF_VAL (-1)
+#ifndef MD_DEFAULT_BASE_DIR
-+#define MD_DEFAULT_BASE_DIR "state/md"
++#define MD_DEFAULT_BASE_DIR "md"
+#endif
+
/* Default settings for the global conf */
@@ -242,8 +243,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1842931
apr_pool_cleanup_register(pool, NULL, cleanup_mod_config, apr_pool_cleanup_null);
}
---- httpd-2.4.37/server/core.c.r1842929+
-+++ httpd-2.4.37/server/core.c
+--- httpd-2.4.38/server/core.c.r1842929+
++++ httpd-2.4.38/server/core.c
@@ -129,6 +129,8 @@
AP_DECLARE_DATA int ap_run_mode = AP_SQ_RM_UNKNOWN;
AP_DECLARE_DATA int ap_config_generation = 0;
@@ -287,7 +288,15 @@ http://svn.apache.org/viewvc?view=revision&revision=1842931
AP_INIT_TAKE1("ErrorLog", set_server_string_slot,
(void *)APR_OFFSETOF(server_rec, error_fname), RSRC_CONF,
"The filename of the error log"),
-@@ -5150,6 +5172,27 @@
+@@ -4927,6 +4949,7 @@
+ ap_regcomp_set_default_cflags(AP_REG_DOLLAR_ENDONLY);
+
+ mpm_common_pre_config(pconf);
++ core_state_dir = NULL;
+
+ return OK;
+ }
+@@ -5150,6 +5173,27 @@
}
}
diff --git a/httpd.spec b/httpd.spec
index dc5e500..4285193 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.38
-Release: 3%{?dist}
+Release: 4%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -56,6 +56,7 @@ Source41: htcacheclean.sysconf
Source42: httpd-init.service
Source43: httpd-ssl-gencerts
Source44: httpd@.service
+Source45: config.layout
# build/scripts patches
Patch1: httpd-2.4.1-apctl.patch
Patch2: httpd-2.4.9-apxs.patch
@@ -257,6 +258,9 @@ if test "x${vmmn}" != "x%{mmn}"; then
exit 1
fi
+# Provide default layout
+cp $RPM_SOURCE_DIR/config.layout .
+
sed '
s,@MPM@,%{mpm},g
s,@DOCROOT@,%{docroot},g
@@ -399,7 +403,7 @@ install -m 644 -p $RPM_SOURCE_DIR/httpd.tmpfiles \
# Other directories
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/dav \
- $RPM_BUILD_ROOT%{_localstatedir}/lib/httpd \
+ $RPM_BUILD_ROOT%{_localstatedir}/lib/httpd/state \
$RPM_BUILD_ROOT/run/httpd/htcacheclean
# Substitute in defaults which are usually done (badly) by "make install"
@@ -461,8 +465,9 @@ ln -s ../../pixmaps/poweredby.png \
$RPM_BUILD_ROOT%{contentdir}/icons/poweredby.png
# symlinks for /etc/httpd
+rmdir $RPM_BUILD_ROOT/etc/httpd/{state,run}
ln -s ../..%{_localstatedir}/log/httpd $RPM_BUILD_ROOT/etc/httpd/logs
-ln -s ../..%{_localstatedir}/lib/httpd $RPM_BUILD_ROOT/etc/httpd/state
+ln -s ../..%{_localstatedir}/lib/httpd/state $RPM_BUILD_ROOT/etc/httpd/state
ln -s /run/httpd $RPM_BUILD_ROOT/etc/httpd/run
ln -s ../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT/etc/httpd/modules
@@ -729,6 +734,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Tue Feb 5 2019 Joe Orton - 2.4.38-4
+- use serverroot-relative statedir, rundir by default
+
* Fri Feb 01 2019 Fedora Release Engineering - 2.4.38-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
diff --git a/pullrev.sh b/pullrev.sh
index dbb97a5..5494c7e 100755
--- a/pullrev.sh
+++ b/pullrev.sh
@@ -7,7 +7,7 @@ fi
repo="https://svn.apache.org/repos/asf/httpd/httpd/trunk"
#repo="https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x"
-ver=2.4.34
+ver=2.4.37
prefix="httpd-${ver}"
suffix="r$1${2:++}"
fn="${prefix}-${suffix}.patch"
From 9e462af294c3fbd19348dba908d304daf1b3b078 Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Tue, 5 Feb 2019 12:39:17 +0000
Subject: [PATCH 028/231] segmentation fault fix (FIPS)
---
httpd-2.4.37-fips-segfault.patch | 42 ++++++++++++++++++++++++++++++++
httpd.spec | 7 +++++-
2 files changed, 48 insertions(+), 1 deletion(-)
create mode 100644 httpd-2.4.37-fips-segfault.patch
diff --git a/httpd-2.4.37-fips-segfault.patch b/httpd-2.4.37-fips-segfault.patch
new file mode 100644
index 0000000..6039980
--- /dev/null
+++ b/httpd-2.4.37-fips-segfault.patch
@@ -0,0 +1,42 @@
+diff --git a/modules/ssl/mod_ssl.c b/modules/ssl/mod_ssl.c
+index 37947e7..b50c259 100644
+--- a/modules/ssl/mod_ssl.c
++++ b/modules/ssl/mod_ssl.c
+@@ -331,9 +331,6 @@ static apr_status_t ssl_cleanup_pre_config(void *data)
+ /*
+ * Try to kill the internals of the SSL library.
+ */
+-#ifdef HAVE_FIPS
+- FIPS_mode_set(0);
+-#endif
+ /* Corresponds to OBJ_create()s */
+ OBJ_cleanup();
+ /* Corresponds to OPENSSL_load_builtin_modules() */
+diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
+index 5063a72..21e41e2 100644
+--- a/modules/ssl/ssl_engine_init.c
++++ b/modules/ssl/ssl_engine_init.c
+@@ -183,6 +183,14 @@ int ssl_is_challenge(conn_rec *c, const char *servername,
+ return 0;
+ }
+
++#ifdef HAVE_FIPS
++static apr_status_t ssl_fips_cleanup(void *data)
++{
++ FIPS_mode_set(0);
++ return APR_SUCCESS;
++}
++#endif
++
+ /*
+ * Per-module initialization
+ */
+@@ -316,6 +324,8 @@ apr_status_t ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
+ if (FIPS_mode_set(1)) {
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, APLOGNO(01884)
+ "Operating in SSL FIPS mode");
++ apr_pool_cleanup_register(p, NULL, ssl_fips_cleanup,
++ apr_pool_cleanup_null);
+ }
+ else {
+ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01885) "FIPS mode failed");
diff --git a/httpd.spec b/httpd.spec
index 4285193..b7520a2 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.38
-Release: 4%{?dist}
+Release: 5%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -78,6 +78,7 @@ Patch34: httpd-2.4.17-socket-activation.patch
Patch36: httpd-2.4.38-r1830819+.patch
Patch38: httpd-2.4.34-sslciphdefault.patch
Patch39: httpd-2.4.37-sslprotdefault.patch
+Patch40: httpd-2.4.37-fips-segfault.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -229,6 +230,7 @@ interface for storing and accessing per-user session data.
%patch36 -p1 -b .r1830819+
%patch38 -p1 -b .sslciphdefault
%patch39 -p1 -b .sslprotdefault
+%patch40 -p1 -b .fipsseg
%patch58 -p1 -b .r1738878
%patch60 -p1 -b .enable-sslv3
@@ -734,6 +736,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Tue Feb 05 2019 Lubos Uhliarik - 2.4.38-5
+- segmentation fault fix (FIPS)
+
* Tue Feb 5 2019 Joe Orton - 2.4.38-4
- use serverroot-relative statedir, rundir by default
From b86b48c4a2a3293c0e9a8cb74e01f1827c3be904 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Thu, 14 Mar 2019 10:30:15 +0000
Subject: [PATCH 029/231] apachectl: cleanup and replace script wholesale
(#1641237) * drop "apachectl fullstatus" support * run systemctl with
--no-pager option * implement graceful&graceful-stop by signal directly run
"httpd -t" from legacy action script Resolves: rhbz#1641237
---
action-configtest.sh | 2 +-
action-graceful.sh | 2 +-
apachectl.sh | 62 ++++++++++++++++++++++
httpd-2.4.1-apctl.patch | 94 ---------------------------------
httpd-2.4.34-apctlsystemd.patch | 63 ----------------------
httpd.spec | 18 ++++---
6 files changed, 75 insertions(+), 166 deletions(-)
create mode 100755 apachectl.sh
delete mode 100644 httpd-2.4.1-apctl.patch
delete mode 100644 httpd-2.4.34-apctlsystemd.patch
diff --git a/action-configtest.sh b/action-configtest.sh
index 6685b0a..711d9cd 100644
--- a/action-configtest.sh
+++ b/action-configtest.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-exec /sbin/apachectl configtest "$@"
+exec /usr/sbin/httpd -t
diff --git a/action-graceful.sh b/action-graceful.sh
index dc68b2e..4976087 100644
--- a/action-graceful.sh
+++ b/action-graceful.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-exec /sbin/apachectl graceful "$@"
+exec /sbin/apachectl graceful
diff --git a/apachectl.sh b/apachectl.sh
new file mode 100755
index 0000000..ee2dba8
--- /dev/null
+++ b/apachectl.sh
@@ -0,0 +1,62 @@
+#!/usr/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ "x$1" = "x-k" ]; then
+ shift
+fi
+
+ACMD="$1"
+ARGV="$@"
+SVC='httpd.service'
+
+if [ "x$2" != "x" ] ; then
+ echo Passing arguments to httpd using apachectl is no longer supported.
+ echo You can only start/stop/restart httpd using this script.
+ echo To pass extra arguments to httpd, see the $SVC'(8)'
+ echo man page.
+ exit 1
+fi
+
+case $ACMD in
+start|stop|restart|status)
+ /usr/bin/systemctl --no-pager $ACMD $SVC
+ ERROR=$?
+ ;;
+graceful)
+ if /usr/bin/systemctl -q is-active $SVC; then
+ /usr/bin/systemctl kill --signal=SIGUSR1 $SVC
+ else
+ /usr/bin/systemctl start $SVC
+ fi
+ ERROR=$?
+ ;;
+graceful-stop)
+ /usr/bin/systemctl kill --signal=SIGWINCH $SVC
+ ERROR=$?
+ ;;
+configtest)
+ /usr/sbin/service ${SVC/.service//} $ACMD
+ ERROR=$?
+ ;;
+*)
+ echo apachectl: The \"$ACMD\" option is not supported. 1>&2
+ ERROR=2
+ ;;
+esac
+
+exit $ERROR
+
diff --git a/httpd-2.4.1-apctl.patch b/httpd-2.4.1-apctl.patch
deleted file mode 100644
index b31c3c5..0000000
--- a/httpd-2.4.1-apctl.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-
-- fail gracefully if links is not installed on target system
-- source sysconfig/httpd for custom env. vars etc.
-- make httpd -t work even in SELinux
-- pass $OPTIONS to all $HTTPD invocation
-
-Upstream-HEAD: vendor
-Upstream-2.0: vendor
-Upstream-Status: Vendor-specific changes for better initscript integration
-
---- httpd-2.4.1/support/apachectl.in.apctl
-+++ httpd-2.4.1/support/apachectl.in
-@@ -44,19 +44,25 @@ ARGV="$@"
- # the path to your httpd binary, including options if necessary
- HTTPD='@exp_sbindir@/@progname@'
- #
--# pick up any necessary environment variables
--if test -f @exp_sbindir@/envvars; then
-- . @exp_sbindir@/envvars
--fi
- #
- # a command that outputs a formatted text version of the HTML at the
- # url given on the command line. Designed for lynx, however other
- # programs may work.
--LYNX="@LYNX_PATH@ -dump"
-+if [ -x "@LYNX_PATH@" ]; then
-+ LYNX="@LYNX_PATH@ -dump"
-+else
-+ LYNX=none
-+fi
- #
- # the URL to your server's mod_status status page. If you do not
- # have one, then status and fullstatus will not work.
- STATUSURL="http://localhost:@PORT@/server-status"
-+
-+# Source /etc/sysconfig/httpd for $HTTPD setting, etc.
-+if [ -r /etc/sysconfig/httpd ]; then
-+ . /etc/sysconfig/httpd
-+fi
-+
- #
- # Set this variable to a command that increases the maximum
- # number of file descriptors allowed per child process. This is
-@@ -76,9 +82,27 @@ if [ "x$ARGV" = "x" ] ; then
- ARGV="-h"
- fi
-
-+function checklynx() {
-+if [ "$LYNX" = "none" ]; then
-+ echo "The 'links' package is required for this functionality."
-+ exit 8
-+fi
-+}
-+
-+function testconfig() {
-+# httpd is denied terminal access in SELinux, so run in the
-+# current context to get stdout from $HTTPD -t.
-+if test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled; then
-+ runcon -- `id -Z` $HTTPD $OPTIONS -t
-+else
-+ $HTTPD $OPTIONS -t
-+fi
-+ERROR=$?
-+}
-+
- case $ACMD in
- start|stop|restart|graceful|graceful-stop)
-- $HTTPD -k $ARGV
-+ $HTTPD $OPTIONS -k $ARGV
- ERROR=$?
- ;;
- startssl|sslstart|start-SSL)
-@@ -88,17 +112,18 @@ startssl|sslstart|start-SSL)
- ERROR=2
- ;;
- configtest)
-- $HTTPD -t
-- ERROR=$?
-+ testconfig
- ;;
- status)
-+ checklynx
- $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
- ;;
- fullstatus)
-+ checklynx
- $LYNX $STATUSURL
- ;;
- *)
-- $HTTPD "$@"
-+ $HTTPD $OPTIONS "$@"
- ERROR=$?
- esac
-
diff --git a/httpd-2.4.34-apctlsystemd.patch b/httpd-2.4.34-apctlsystemd.patch
deleted file mode 100644
index 20d7101..0000000
--- a/httpd-2.4.34-apctlsystemd.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-
-Make apachectl run via systemctl.
-
-Note: "apachectl graceful" is documented to start httpd if not running.
-
-Upstream-Status: vendor specific patch
-
---- httpd-2.4.34/support/apachectl.in.apctlsystemd
-+++ httpd-2.4.34/support/apachectl.in
-@@ -58,11 +58,6 @@
- # have one, then status and fullstatus will not work.
- STATUSURL="http://localhost:@PORT@/server-status"
-
--# Source /etc/sysconfig/httpd for $HTTPD setting, etc.
--if [ -r /etc/sysconfig/httpd ]; then
-- . /etc/sysconfig/httpd
--fi
--
- #
- # Set this variable to a command that increases the maximum
- # number of file descriptors allowed per child process. This is
-@@ -100,9 +95,28 @@
- ERROR=$?
- }
-
-+if [ "x$2" != "x" ] ; then
-+ echo Passing arguments to httpd using apachectl is no longer supported.
-+ echo You can only start/stop/restart httpd using this script.
-+ echo "To pass extra arguments to httpd, see the httpd.service(8)"
-+ echo man page.
-+fi
-+
- case $ACMD in
--start|stop|restart|graceful|graceful-stop)
-- $HTTPD $OPTIONS -k $ARGV
-+start|stop|restart|status)
-+ /usr/bin/systemctl $ACMD httpd.service
-+ ERROR=$?
-+ ;;
-+graceful)
-+ if /usr/bin/systemctl -q is-active httpd.service; then
-+ /usr/bin/systemctl reload httpd.service
-+ else
-+ /usr/bin/systemctl start httpd.service
-+ fi
-+ ERROR=$?
-+ ;;
-+graceful-stop)
-+ /usr/bin/systemctl stop httpd.service
- ERROR=$?
- ;;
- startssl|sslstart|start-SSL)
-@@ -114,10 +128,6 @@
- configtest)
- testconfig
- ;;
--status)
-- checklynx
-- $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
-- ;;
- fullstatus)
- checklynx
- $LYNX $STATUSURL
diff --git a/httpd.spec b/httpd.spec
index b7520a2..d8f2d02 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.38
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -45,7 +45,6 @@ Source26: 10-listen443.conf
Source27: httpd.socket
Source28: 00-optional.conf
Source29: 01-md.conf
-# Documentation
Source30: README.confd
Source31: README.confmod
Source32: httpd.service.xml
@@ -57,11 +56,10 @@ Source42: httpd-init.service
Source43: httpd-ssl-gencerts
Source44: httpd@.service
Source45: config.layout
+Source46: apachectl.sh
# build/scripts patches
-Patch1: httpd-2.4.1-apctl.patch
Patch2: httpd-2.4.9-apxs.patch
Patch3: httpd-2.4.1-deplibs.patch
-Patch6: httpd-2.4.34-apctlsystemd.patch
# Needed for socket activation and mod_systemd patch
Patch19: httpd-2.4.25-detect-systemd.patch
# Features/functional changes
@@ -210,10 +208,8 @@ interface for storing and accessing per-user session data.
%prep
%setup -q
-%patch1 -p1 -b .apctl
%patch2 -p1 -b .apxs
%patch3 -p1 -b .deplibs
-%patch6 -p1 -b .apctlsystemd
%patch19 -p1 -b .detectsystemd
@@ -482,7 +478,8 @@ install -m755 $RPM_SOURCE_DIR/httpd-ssl-pass-dialog \
install -m755 $RPM_SOURCE_DIR/httpd-ssl-gencerts \
$RPM_BUILD_ROOT%{_libexecdir}/httpd-ssl-gencerts
-# Install action scripts
+# Install scripts
+install -p -m 755 $RPM_SOURCE_DIR/apachectl.sh $RPM_BUILD_ROOT%{_sbindir}/apachectl
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/initscripts/legacy-actions/httpd
for f in graceful configtest; do
install -p -m 755 $RPM_SOURCE_DIR/action-${f}.sh \
@@ -736,6 +733,13 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Feb 28 2019 Joe Orton - 2.4.38-6
+- apachectl: cleanup and replace script wholesale (#1641237)
+ * drop "apachectl fullstatus" support
+ * run systemctl with --no-pager option
+ * implement graceful&graceful-stop by signal directly
+- run "httpd -t" from legacy action script
+
* Tue Feb 05 2019 Lubos Uhliarik - 2.4.38-5
- segmentation fault fix (FIPS)
From c30e10218028cb4759eb0fa5a61d06e3148c073d Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Tue, 2 Apr 2019 10:53:17 +0000
Subject: [PATCH 030/231] update to 2.4.39
---
httpd-2.4.37-fips-segfault.patch | 42 --------------------------------
httpd.spec | 9 ++++---
sources | 2 +-
3 files changed, 6 insertions(+), 47 deletions(-)
delete mode 100644 httpd-2.4.37-fips-segfault.patch
diff --git a/httpd-2.4.37-fips-segfault.patch b/httpd-2.4.37-fips-segfault.patch
deleted file mode 100644
index 6039980..0000000
--- a/httpd-2.4.37-fips-segfault.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff --git a/modules/ssl/mod_ssl.c b/modules/ssl/mod_ssl.c
-index 37947e7..b50c259 100644
---- a/modules/ssl/mod_ssl.c
-+++ b/modules/ssl/mod_ssl.c
-@@ -331,9 +331,6 @@ static apr_status_t ssl_cleanup_pre_config(void *data)
- /*
- * Try to kill the internals of the SSL library.
- */
--#ifdef HAVE_FIPS
-- FIPS_mode_set(0);
--#endif
- /* Corresponds to OBJ_create()s */
- OBJ_cleanup();
- /* Corresponds to OPENSSL_load_builtin_modules() */
-diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
-index 5063a72..21e41e2 100644
---- a/modules/ssl/ssl_engine_init.c
-+++ b/modules/ssl/ssl_engine_init.c
-@@ -183,6 +183,14 @@ int ssl_is_challenge(conn_rec *c, const char *servername,
- return 0;
- }
-
-+#ifdef HAVE_FIPS
-+static apr_status_t ssl_fips_cleanup(void *data)
-+{
-+ FIPS_mode_set(0);
-+ return APR_SUCCESS;
-+}
-+#endif
-+
- /*
- * Per-module initialization
- */
-@@ -316,6 +324,8 @@ apr_status_t ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
- if (FIPS_mode_set(1)) {
- ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, APLOGNO(01884)
- "Operating in SSL FIPS mode");
-+ apr_pool_cleanup_register(p, NULL, ssl_fips_cleanup,
-+ apr_pool_cleanup_null);
- }
- else {
- ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01885) "FIPS mode failed");
diff --git a/httpd.spec b/httpd.spec
index d8f2d02..c1b14c1 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -12,8 +12,8 @@
Summary: Apache HTTP Server
Name: httpd
-Version: 2.4.38
-Release: 6%{?dist}
+Version: 2.4.39
+Release: 1%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -76,7 +76,6 @@ Patch34: httpd-2.4.17-socket-activation.patch
Patch36: httpd-2.4.38-r1830819+.patch
Patch38: httpd-2.4.34-sslciphdefault.patch
Patch39: httpd-2.4.37-sslprotdefault.patch
-Patch40: httpd-2.4.37-fips-segfault.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -226,7 +225,6 @@ interface for storing and accessing per-user session data.
%patch36 -p1 -b .r1830819+
%patch38 -p1 -b .sslciphdefault
%patch39 -p1 -b .sslprotdefault
-%patch40 -p1 -b .fipsseg
%patch58 -p1 -b .r1738878
%patch60 -p1 -b .enable-sslv3
@@ -733,6 +731,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Tue Apr 02 2019 Lubos Uhliarik - 2.4.39-1
+- update to 2.4.39
+
* Thu Feb 28 2019 Joe Orton - 2.4.38-6
- apachectl: cleanup and replace script wholesale (#1641237)
* drop "apachectl fullstatus" support
diff --git a/sources b/sources
index 69cd474..248974a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (httpd-2.4.38.tar.bz2) = 8bdc36fa2bd13fd83feee17fdce4a5316ed8f96c1ac32b636ba106572ba257815438c72068d2d0e900783a3fa25c90a5da34c3f83fc2c04a1dbdbf234f7ad448
+SHA512 (httpd-2.4.39.tar.bz2) = 9742202040b3dc6344b301540f54b2d3f8e36898410d24206a7f8dcecb1bea7d7230fabc7256752724558af249facf64bffe2cf678b8f7cccb64076737abfda7
From 94b643f7e2997f39e42a1a927284fc2c6c585bca Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Tue, 2 Apr 2019 12:34:14 +0000
Subject: [PATCH 031/231] Forgot to commit 00-base.conf with redis LoadModule
---
00-base.conf | 1 +
1 file changed, 1 insertion(+)
diff --git a/00-base.conf b/00-base.conf
index 28dacb3..e46d911 100644
--- a/00-base.conf
+++ b/00-base.conf
@@ -46,6 +46,7 @@ LoadModule macro_module modules/mod_macro.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
+LoadModule redis_module modules/mod_socache_redis.so
LoadModule remoteip_module modules/mod_remoteip.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule request_module modules/mod_request.so
From c6cd42af04575bfc94a6c59fe7f1aac854ffbadb Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Tue, 2 Apr 2019 15:27:39 +0000
Subject: [PATCH 032/231] Fix wrong module name used in LoadModule directive
---
00-base.conf | 2 +-
httpd.spec | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/00-base.conf b/00-base.conf
index e46d911..7cabce0 100644
--- a/00-base.conf
+++ b/00-base.conf
@@ -46,7 +46,6 @@ LoadModule macro_module modules/mod_macro.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
-LoadModule redis_module modules/mod_socache_redis.so
LoadModule remoteip_module modules/mod_remoteip.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule request_module modules/mod_request.so
@@ -56,6 +55,7 @@ LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule socache_dbm_module modules/mod_socache_dbm.so
LoadModule socache_memcache_module modules/mod_socache_memcache.so
+LoadModule socache_redis_module modules/mod_socache_redis.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule status_module modules/mod_status.so
LoadModule substitute_module modules/mod_substitute.so
diff --git a/httpd.spec b/httpd.spec
index c1b14c1..5363e54 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -731,7 +731,7 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
-* Tue Apr 02 2019 Lubos Uhliarik - 2.4.39-1
+* Tue Apr 02 2019 Lubos Uhliarik - 2.4.39-2
- update to 2.4.39
* Thu Feb 28 2019 Joe Orton - 2.4.38-6
From 56f7420323e1ca6f246482b4abd35f9dca73b874 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Tue, 16 Apr 2019 08:45:34 +0100
Subject: [PATCH 033/231] Grammar fixes/tweaks.
---
httpd.conf.xml | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/httpd.conf.xml b/httpd.conf.xml
index 3a02111..13e5d69 100644
--- a/httpd.conf.xml
+++ b/httpd.conf.xml
@@ -129,12 +129,12 @@
Module configuration filesModule configuration files are provided in the
- /etc/httpd/conf.modules.d/ directory. Filenames
- in this directory are by convention prefixed with two digit numeric
- prefix to ensure they are processed in the desired order. Core
- modules provide with the httpd package are
- loaded by files with a prefix to ensure
- these are loaded first. Only filenames with a
+ /etc/httpd/conf.modules.d/ directory.
+ Filenames in this directory are by convention prefixed with two
+ digit numeric prefix to ensure they are processed in the desired
+ order. Core modules provided with the httpd
+ package are loaded by files with a prefix
+ to ensure these load first. Only filenames with a
suffix in this directory will be
processed.
@@ -160,8 +160,8 @@
/etc/httpd/conf.modules.d/00-systemd.confThis file loads
which is necessary for the correct operation of the
- httpd.service service, and should not be
- removed or disabled.
+ httpd.service systemd unit, and should
+ not be removed or disabled.
From 3aa63a93a96242548cc9c99798beed41044c945f Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Tue, 16 Apr 2019 08:48:10 +0100
Subject: [PATCH 034/231] - fix statedir symlink to point to /var/lib/httpd
(#1697662)
---
httpd.spec | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/httpd.spec b/httpd.spec
index 5363e54..d53c385 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 2%{?dist}
+Release: 3%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -463,7 +463,7 @@ ln -s ../../pixmaps/poweredby.png \
# symlinks for /etc/httpd
rmdir $RPM_BUILD_ROOT/etc/httpd/{state,run}
ln -s ../..%{_localstatedir}/log/httpd $RPM_BUILD_ROOT/etc/httpd/logs
-ln -s ../..%{_localstatedir}/lib/httpd/state $RPM_BUILD_ROOT/etc/httpd/state
+ln -s ../..%{_localstatedir}/lib/httpd $RPM_BUILD_ROOT/etc/httpd/state
ln -s /run/httpd $RPM_BUILD_ROOT/etc/httpd/run
ln -s ../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT/etc/httpd/modules
@@ -731,6 +731,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Tue Apr 9 2019 Joe Orton - 2.4.39-3
+- fix statedir symlink to point to /var/lib/httpd (#1697662)
+
* Tue Apr 02 2019 Lubos Uhliarik - 2.4.39-2
- update to 2.4.39
From fc242751072a1f65e8c8d0f8e81210a2e32ea282 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Tue, 16 Apr 2019 08:49:29 +0100
Subject: [PATCH 035/231] - mod_reqtimeout: fix default values regression (PR
63325)
---
httpd-2.4.37-r1857129.patch | 65 +++++++++++++++++++++++++++++++++++++
httpd.spec | 4 +++
2 files changed, 69 insertions(+)
create mode 100644 httpd-2.4.37-r1857129.patch
diff --git a/httpd-2.4.37-r1857129.patch b/httpd-2.4.37-r1857129.patch
new file mode 100644
index 0000000..4dbf05a
--- /dev/null
+++ b/httpd-2.4.37-r1857129.patch
@@ -0,0 +1,65 @@
+# ./pullrev.sh 1857129
+http://svn.apache.org/viewvc?view=revision&revision=1857129
+
+--- httpd-2.4.37/modules/filters/mod_reqtimeout.c
++++ httpd-2.4.37/modules/filters/mod_reqtimeout.c
+@@ -31,7 +31,7 @@
+ #define UNSET -1
+ #define MRT_DEFAULT_handshake_TIMEOUT 0 /* disabled */
+ #define MRT_DEFAULT_handshake_MAX_TIMEOUT 0
+-#define MRT_DEFAULT_handshake_MIN_RATE APR_INT32_MAX
++#define MRT_DEFAULT_handshake_MIN_RATE 0
+ #define MRT_DEFAULT_header_TIMEOUT 20
+ #define MRT_DEFAULT_header_MAX_TIMEOUT 40
+ #define MRT_DEFAULT_header_MIN_RATE 500
+@@ -220,7 +220,7 @@
+ if (block == APR_NONBLOCK_READ || mode == AP_MODE_INIT
+ || mode == AP_MODE_EATCRLF) {
+ rv = ap_get_brigade(f->next, bb, mode, block, readbytes);
+- if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS) {
++ if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS) {
+ extend_timeout(ccfg, bb);
+ }
+ return rv;
+@@ -254,7 +254,7 @@
+ }
+
+ if (!APR_BRIGADE_EMPTY(bb)) {
+- if (ccfg->cur_stage.rate_factor > 0) {
++ if (ccfg->cur_stage.rate_factor) {
+ extend_timeout(ccfg, bb);
+ }
+
+@@ -315,7 +315,7 @@
+ * the real (relevant) bytes to be asked later, within the
+ * currently alloted time.
+ */
+- if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS
++ if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS
+ && mode != AP_MODE_SPECULATIVE) {
+ extend_timeout(ccfg, bb);
+ }
+@@ -638,17 +638,17 @@
+ ap_hook_post_read_request(reqtimeout_before_body, NULL, NULL,
+ APR_HOOK_MIDDLE);
+
+-#if MRT_DEFAULT_HANDSHAKE_MIN_RATE > 0
++#if MRT_DEFAULT_handshake_MIN_RATE
+ default_handshake_rate_factor = apr_time_from_sec(1) /
+- MRT_DEFAULT_HANDSHAKE_MIN_RATE;
++ MRT_DEFAULT_handshake_MIN_RATE;
+ #endif
+-#if MRT_DEFAULT_HEADER_MIN_RATE > 0
++#if MRT_DEFAULT_header_MIN_RATE
+ default_header_rate_factor = apr_time_from_sec(1) /
+- MRT_DEFAULT_HEADER_MIN_RATE;
++ MRT_DEFAULT_header_MIN_RATE;
+ #endif
+-#if MRT_DEFAULT_BODY_MIN_RATE > 0
++#if MRT_DEFAULT_body_MIN_RATE
+ default_body_rate_factor = apr_time_from_sec(1) /
+- MRT_DEFAULT_BODY_MIN_RATE;
++ MRT_DEFAULT_body_MIN_RATE;
+ #endif
+ }
+
diff --git a/httpd.spec b/httpd.spec
index d53c385..52287af 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -81,6 +81,8 @@ Patch39: httpd-2.4.37-sslprotdefault.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
Patch58: httpd-2.4.34-r1738878.patch
Patch60: httpd-2.4.34-enable-sslv3.patch
+# https://bz.apache.org/bugzilla/show_bug.cgi?id=63325
+Patch61: httpd-2.4.37-r1857129.patch
# Security fixes
@@ -228,6 +230,7 @@ interface for storing and accessing per-user session data.
%patch58 -p1 -b .r1738878
%patch60 -p1 -b .enable-sslv3
+%patch61 -p1 -b .r1857129
# Patch in the vendor string
sed -i '/^#define PLATFORM/s/Unix/%{vstring}/' os/unix/os.h
@@ -733,6 +736,7 @@ exit $rv
%changelog
* Tue Apr 9 2019 Joe Orton - 2.4.39-3
- fix statedir symlink to point to /var/lib/httpd (#1697662)
+- mod_reqtimeout: fix default values regression (PR 63325)
* Tue Apr 02 2019 Lubos Uhliarik - 2.4.39-2
- update to 2.4.39
From db627365881ba25e590d64695738231fffcd8bc3 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Tue, 16 Apr 2019 09:10:28 +0100
Subject: [PATCH 036/231] - fix systemd_postun usage.
---
httpd.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/httpd.spec b/httpd.spec
index 52287af..cdd7ff1 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -546,7 +546,7 @@ exit 0
%systemd_preun httpd.service htcacheclean.service httpd.socket
%postun
-%systemd_postun
+%systemd_postun httpd.service htcacheclean.service httpd.socket
# Trigger for conversion from SysV, per guidelines at:
# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
From bc95575bf53f74d3196619fc05f39332e7d731c7 Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Thu, 2 May 2019 14:46:02 +0000
Subject: [PATCH 037/231] httpd dependency on initscripts is unspecified
(#1705188)
- substitute "service" cmd by "httpd" with -t arg
Resolves: #1705188
---
apachectl.sh | 3 ++-
httpd.spec | 8 +++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/apachectl.sh b/apachectl.sh
index ee2dba8..77868fe 100755
--- a/apachectl.sh
+++ b/apachectl.sh
@@ -22,6 +22,7 @@ fi
ACMD="$1"
ARGV="$@"
SVC='httpd.service'
+HTTPD='@HTTPDBIN@'
if [ "x$2" != "x" ] ; then
echo Passing arguments to httpd using apachectl is no longer supported.
@@ -49,7 +50,7 @@ graceful-stop)
ERROR=$?
;;
configtest)
- /usr/sbin/service ${SVC/.service//} $ACMD
+ $HTTPD -t
ERROR=$?
;;
*)
diff --git a/httpd.spec b/httpd.spec
index cdd7ff1..00094c6 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 3%{?dist}
+Release: 4%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -414,6 +414,9 @@ sed -i \
s,@@Port@@,80,;" \
docs/conf/extra/*.conf
+# Set correct path for httpd binary in apachectl script
+sed -i 's,@HTTPDBIN@,%{_sbindir}/httpd,g' $RPM_SOURCE_DIR/apachectl.sh
+
# Create cache directory
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/httpd \
$RPM_BUILD_ROOT%{_localstatedir}/cache/httpd/proxy \
@@ -734,6 +737,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu May 02 2019 Lubos Uhliarik - 2.4.39-4
+- httpd dependency on initscripts is unspecified (#1705188)
+
* Tue Apr 9 2019 Joe Orton - 2.4.39-3
- fix statedir symlink to point to /var/lib/httpd (#1697662)
- mod_reqtimeout: fix default values regression (PR 63325)
From 67d32a785dc7bd653e149066f242071bfcb5a315 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Wed, 12 Jun 2019 10:48:06 +0100
Subject: [PATCH 038/231] fixes for StateDir directive (upstream r1857731,
r1857731)
---
...929+.patch => httpd-2.4.39-r1842929+.patch | 148 ++++++++++++------
httpd.spec | 7 +-
2 files changed, 105 insertions(+), 50 deletions(-)
rename httpd-2.4.37-r1842929+.patch => httpd-2.4.39-r1842929+.patch (75%)
diff --git a/httpd-2.4.37-r1842929+.patch b/httpd-2.4.39-r1842929+.patch
similarity index 75%
rename from httpd-2.4.37-r1842929+.patch
rename to httpd-2.4.39-r1842929+.patch
index e841e34..50f8aa1 100644
--- a/httpd-2.4.37-r1842929+.patch
+++ b/httpd-2.4.39-r1842929+.patch
@@ -1,10 +1,12 @@
-# ./pullrev.sh 1842929 1842931
+# ./pullrev.sh 1842929 1842931 1852982 1853631 1857731
http://svn.apache.org/viewvc?view=revision&revision=1842929
http://svn.apache.org/viewvc?view=revision&revision=1842931
http://svn.apache.org/viewvc?view=revision&revision=1852982
+http://svn.apache.org/viewvc?view=revision&revision=1857731
+http://svn.apache.org/viewvc?view=revision&revision=1853631
---- httpd-2.4.38/acinclude.m4.r1842929+
-+++ httpd-2.4.38/acinclude.m4
+--- httpd-2.4.39/acinclude.m4.r1842929+
++++ httpd-2.4.39/acinclude.m4
@@ -45,6 +45,7 @@
APACHE_SUBST(installbuilddir)
APACHE_SUBST(runtimedir)
@@ -21,8 +23,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
])
dnl
---- httpd-2.4.38/config.layout.r1842929+
-+++ httpd-2.4.38/config.layout
+--- httpd-2.4.39/config.layout.r1842929+
++++ httpd-2.4.39/config.layout
@@ -29,6 +29,7 @@
includedir: ${prefix}/include
localstatedir: ${prefix}
@@ -143,8 +145,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
logfiledir: ${localstatedir}/log/httpd
proxycachedir: ${localstatedir}/cache/httpd
---- httpd-2.4.38/configure.in.r1842929+
-+++ httpd-2.4.38/configure.in
+--- httpd-2.4.39/configure.in.r1842929+
++++ httpd-2.4.39/configure.in
@@ -41,7 +41,7 @@
AC_PREFIX_DEFAULT(/usr/local/apache2)
@@ -154,8 +156,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
dnl reparse the configure arguments.
APR_PARSE_ARGUMENTS
---- httpd-2.4.38/include/ap_config_layout.h.in.r1842929+
-+++ httpd-2.4.38/include/ap_config_layout.h.in
+--- httpd-2.4.39/include/ap_config_layout.h.in.r1842929+
++++ httpd-2.4.39/include/ap_config_layout.h.in
@@ -60,5 +60,7 @@
#define DEFAULT_REL_LOGFILEDIR "@rel_logfiledir@"
#define DEFAULT_EXP_PROXYCACHEDIR "@exp_proxycachedir@"
@@ -164,8 +166,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
+#define DEFAULT_REL_STATEDIR "@rel_statedir@"
#endif /* AP_CONFIG_LAYOUT_H */
---- httpd-2.4.38/include/http_config.h.r1842929+
-+++ httpd-2.4.38/include/http_config.h
+--- httpd-2.4.39/include/http_config.h.r1842929+
++++ httpd-2.4.39/include/http_config.h
@@ -757,6 +757,14 @@
*/
AP_DECLARE(char *) ap_runtime_dir_relative(apr_pool_t *p, const char *fname);
@@ -181,8 +183,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
/* Finally, the hook for dynamically loading modules in... */
/**
---- httpd-2.4.38/Makefile.in.r1842929+
-+++ httpd-2.4.38/Makefile.in
+--- httpd-2.4.39/Makefile.in.r1842929+
++++ httpd-2.4.39/Makefile.in
@@ -213,6 +213,7 @@
install-other:
@test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)
@@ -191,8 +193,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
@for ext in dll x; do \
file=apachecore.$$ext; \
if test -f $$file; then \
---- httpd-2.4.38/modules/dav/fs/mod_dav_fs.c.r1842929+
-+++ httpd-2.4.38/modules/dav/fs/mod_dav_fs.c
+--- httpd-2.4.39/modules/dav/fs/mod_dav_fs.c.r1842929+
++++ httpd-2.4.39/modules/dav/fs/mod_dav_fs.c
@@ -29,6 +29,10 @@
extern module AP_MODULE_DECLARE_DATA dav_fs_module;
@@ -204,22 +206,43 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
const char *dav_get_lockdb_path(const request_rec *r)
{
dav_fs_server_conf *conf;
-@@ -39,7 +43,11 @@
-
- static void *dav_fs_create_server_config(apr_pool_t *p, server_rec *s)
- {
-- return apr_pcalloc(p, sizeof(dav_fs_server_conf));
-+ dav_fs_server_conf *conf = apr_pcalloc(p, sizeof(dav_fs_server_conf));
-+
-+ conf->lockdb_path = ap_state_dir_relative(p, DEFAULT_DAV_LOCKDB);
-+
-+ return conf;
+@@ -57,6 +61,24 @@
+ return newconf;
}
- static void *dav_fs_merge_server_config(apr_pool_t *p,
---- httpd-2.4.38/modules/md/mod_md_config.c.r1842929+
-+++ httpd-2.4.38/modules/md/mod_md_config.c
-@@ -54,10 +54,14 @@
++static apr_status_t dav_fs_post_config(apr_pool_t *p, apr_pool_t *plog,
++ apr_pool_t *ptemp, server_rec *base_server)
++{
++ server_rec *s;
++
++ for (s = base_server; s; s = s->next) {
++ dav_fs_server_conf *conf;
++
++ conf = ap_get_module_config(s->module_config, &dav_fs_module);
++
++ if (!conf->lockdb_path) {
++ conf->lockdb_path = ap_state_dir_relative(p, DEFAULT_DAV_LOCKDB);
++ }
++ }
++
++ return OK;
++}
++
+ /*
+ * Command handler for the DAVLockDB directive, which is TAKE1
+ */
+@@ -87,6 +109,8 @@
+
+ static void register_hooks(apr_pool_t *p)
+ {
++ ap_hook_post_config(dav_fs_post_config, NULL, NULL, APR_HOOK_MIDDLE);
++
+ dav_hook_gather_propsets(dav_fs_gather_propsets, NULL, NULL,
+ APR_HOOK_MIDDLE);
+ dav_hook_find_liveprop(dav_fs_find_liveprop, NULL, NULL, APR_HOOK_MIDDLE);
+--- httpd-2.4.39/modules/md/mod_md_config.c.r1842929+
++++ httpd-2.4.39/modules/md/mod_md_config.c
+@@ -54,10 +54,18 @@
#define DEF_VAL (-1)
@@ -231,20 +254,29 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
static md_mod_conf_t defmc = {
NULL,
- "md",
-+ NULL,
++#if 1
++ NULL, /* apply default state-dir-relative */
++#else
++ MD_DEFAULT_BASE_DIR,
++#endif
NULL,
NULL,
80,
-@@ -112,6 +116,7 @@
- memcpy(mod_md_config, &defmc, sizeof(*mod_md_config));
- mod_md_config->mds = apr_array_make(pool, 5, sizeof(const md_t *));
- mod_md_config->unused_names = apr_array_make(pool, 5, sizeof(const md_t *));
-+ mod_md_config->base_dir = ap_state_dir_relative(pool, MD_DEFAULT_BASE_DIR);
-
- apr_pool_cleanup_register(pool, NULL, cleanup_mod_config, apr_pool_cleanup_null);
+@@ -864,6 +872,12 @@
+ if (mc->hsts_max_age > 0) {
+ mc->hsts_header = apr_psprintf(p, "max-age=%d", mc->hsts_max_age);
}
---- httpd-2.4.38/server/core.c.r1842929+
-+++ httpd-2.4.38/server/core.c
++
++#if 1
++ if (mc->base_dir == NULL) {
++ mc->base_dir = ap_state_dir_relative(p, MD_DEFAULT_BASE_DIR);
++ }
++#endif
+
+ return APR_SUCCESS;
+ }
+--- httpd-2.4.39/server/core.c.r1842929+
++++ httpd-2.4.39/server/core.c
@@ -129,6 +129,8 @@
AP_DECLARE_DATA int ap_run_mode = AP_SQ_RM_UNKNOWN;
AP_DECLARE_DATA int ap_config_generation = 0;
@@ -254,7 +286,25 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
static void *create_core_dir_config(apr_pool_t *a, char *dir)
{
core_dir_config *conf;
-@@ -3104,6 +3106,24 @@
+@@ -1409,12 +1411,15 @@
+ return res_buf;
+ }
+
+-static int reset_config_defines(void *dummy)
++/* pconf cleanup - clear global variables set from config here. */
++static apr_status_t reset_config(void *dummy)
+ {
+ ap_server_config_defines = saved_server_config_defines;
+ saved_server_config_defines = NULL;
+ server_config_defined_vars = NULL;
+- return OK;
++ core_state_dir = NULL;
++
++ return APR_SUCCESS;
+ }
+
+ /*
+@@ -3113,6 +3118,24 @@
return NULL;
}
@@ -279,7 +329,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
static const char *set_timeout(cmd_parms *cmd, void *dummy, const char *arg)
{
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_CONTEXT);
-@@ -4398,6 +4418,8 @@
+@@ -4407,6 +4430,8 @@
"Common directory of server-related files (logs, confs, etc.)"),
AP_INIT_TAKE1("DefaultRuntimeDir", set_runtime_dir, NULL, RSRC_CONF | EXEC_ON_READ,
"Common directory for run-time files (shared memory, locks, etc.)"),
@@ -288,15 +338,17 @@ http://svn.apache.org/viewvc?view=revision&revision=1852982
AP_INIT_TAKE1("ErrorLog", set_server_string_slot,
(void *)APR_OFFSETOF(server_rec, error_fname), RSRC_CONF,
"The filename of the error log"),
-@@ -4927,6 +4949,7 @@
+@@ -4934,8 +4959,7 @@
+
+ if (!saved_server_config_defines)
+ init_config_defines(pconf);
+- apr_pool_cleanup_register(pconf, NULL, reset_config_defines,
+- apr_pool_cleanup_null);
++ apr_pool_cleanup_register(pconf, NULL, reset_config, apr_pool_cleanup_null);
+
ap_regcomp_set_default_cflags(AP_REG_DOLLAR_ENDONLY);
- mpm_common_pre_config(pconf);
-+ core_state_dir = NULL;
-
- return OK;
- }
-@@ -5150,6 +5173,27 @@
+@@ -5163,6 +5187,27 @@
}
}
diff --git a/httpd.spec b/httpd.spec
index 00094c6..9351fde 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 4%{?dist}
+Release: 5%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -63,7 +63,7 @@ Patch3: httpd-2.4.1-deplibs.patch
# Needed for socket activation and mod_systemd patch
Patch19: httpd-2.4.25-detect-systemd.patch
# Features/functional changes
-Patch21: httpd-2.4.37-r1842929+.patch
+Patch21: httpd-2.4.39-r1842929+.patch
Patch23: httpd-2.4.33-export.patch
Patch24: httpd-2.4.1-corelimit.patch
Patch25: httpd-2.4.25-selinux.patch
@@ -737,6 +737,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Wed Jun 12 2019 Joe Orton - 2.4.39-5
+- fixes for StateDir directive (upstream r1857731, r1857731)
+
* Thu May 02 2019 Lubos Uhliarik - 2.4.39-4
- httpd dependency on initscripts is unspecified (#1705188)
From 720c6f392bad265bb6f9b8be05d2a8de536b3289 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Thu, 13 Jun 2019 16:37:06 +0100
Subject: [PATCH 039/231] mod_ssl: fix "httpd -L" (etc) before
httpd-init.service runs
---
httpd-2.4.39-r1861269.patch | 24 ++++++++++++++++++++++++
httpd.spec | 7 ++++++-
2 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 httpd-2.4.39-r1861269.patch
diff --git a/httpd-2.4.39-r1861269.patch b/httpd-2.4.39-r1861269.patch
new file mode 100644
index 0000000..4142e3c
--- /dev/null
+++ b/httpd-2.4.39-r1861269.patch
@@ -0,0 +1,24 @@
+# ./pullrev.sh r1861269
+http://svn.apache.org/viewvc?view=revision&revision=r1861269
+
+Allows "httpd -L" etc to work before httpd-init.service has run,
+if mod_ssl is installed.
+
+--- httpd-2.4.37/modules/ssl/ssl_engine_config.c
++++ httpd-2.4.37/modules/ssl/ssl_engine_config.c
+@@ -904,8 +904,14 @@
+ static const char *ssl_cmd_check_file(cmd_parms *parms,
+ const char **file)
+ {
+- const char *filepath = ap_server_root_relative(parms->pool, *file);
++ const char *filepath;
+
++ /* If only dumping the config, don't verify the paths */
++ if (ap_state_query(AP_SQ_RUN_MODE) == AP_SQ_RM_CONFIG_DUMP) {
++ return NULL;
++ }
++
++ filepath = ap_server_root_relative(parms->pool, *file);
+ if (!filepath) {
+ return apr_pstrcat(parms->pool, parms->cmd->name,
+ ": Invalid file path ", *file, NULL);
diff --git a/httpd.spec b/httpd.spec
index 9351fde..ab05228 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -76,6 +76,7 @@ Patch34: httpd-2.4.17-socket-activation.patch
Patch36: httpd-2.4.38-r1830819+.patch
Patch38: httpd-2.4.34-sslciphdefault.patch
Patch39: httpd-2.4.37-sslprotdefault.patch
+Patch40: httpd-2.4.39-r1861269.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -227,6 +228,7 @@ interface for storing and accessing per-user session data.
%patch36 -p1 -b .r1830819+
%patch38 -p1 -b .sslciphdefault
%patch39 -p1 -b .sslprotdefault
+%patch40 -p1 -b .r1861269
%patch58 -p1 -b .r1738878
%patch60 -p1 -b .enable-sslv3
@@ -737,6 +739,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Jun 13 2019 Joe Orton - 2.4.39-6
+- mod_ssl: fix "httpd -L" (etc) before httpd-init.service runs
+
* Wed Jun 12 2019 Joe Orton - 2.4.39-5
- fixes for StateDir directive (upstream r1857731, r1857731)
From e945a601cafc320679bffd9d3a2d75e4b3a5c4ff Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Thu, 13 Jun 2019 17:38:40 +0200
Subject: [PATCH 040/231] Removed bundled mod_md
---
01-md.conf | 1 -
httpd.spec | 28 ++++++----------------------
2 files changed, 6 insertions(+), 23 deletions(-)
delete mode 100644 01-md.conf
diff --git a/01-md.conf b/01-md.conf
deleted file mode 100644
index 2739202..0000000
--- a/01-md.conf
+++ /dev/null
@@ -1 +0,0 @@
-LoadModule md_module modules/mod_md.so
diff --git a/httpd.spec b/httpd.spec
index 9351fde..06e7af5 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -44,7 +44,6 @@ Source25: 01-session.conf
Source26: 10-listen443.conf
Source27: httpd.socket
Source28: 00-optional.conf
-Source29: 01-md.conf
Source30: README.confd
Source31: README.confmod
Source32: httpd.service.xml
@@ -167,18 +166,6 @@ The mod_ssl module provides strong cryptography for the Apache Web
server via the Secure Sockets Layer (SSL) and Transport Layer
Security (TLS) protocols.
-%package -n mod_md
-Summary: Certificate provisioning using ACME for the Apache HTTP Server
-Requires: httpd = 0:%{version}-%{release}, httpd-mmn = %{mmnisa}
-BuildRequires: jansson-devel, libcurl-devel
-
-%description -n mod_md
-This module manages common properties of domains for one or more
-virtual hosts. Specifically it can use the ACME protocol (RFC Draft)
-to automate certificate provisioning. These will be configured for
-managed domains and their virtual hosts automatically. This includes
-renewal of certificates before they expire.
-
%package -n mod_proxy_html
Summary: HTML and XML content filters for the Apache HTTP Server
Requires: httpd = 0:%{version}-%{release}, httpd-mmn = %{mmnisa}
@@ -328,6 +315,7 @@ export LYNX_PATH=/usr/bin/links
--enable-authn-anon --enable-authn-alias \
--disable-imagemap --disable-file-cache \
--disable-http2 \
+ --disable-md \
$*
make %{?_smp_mflags}
@@ -353,8 +341,7 @@ install -m 644 $RPM_SOURCE_DIR/README.confmod \
$RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.modules.d/README
for f in 00-base.conf 00-mpm.conf 00-lua.conf 01-cgi.conf 00-dav.conf \
00-proxy.conf 00-ssl.conf 01-ldap.conf 00-proxyhtml.conf \
- 01-ldap.conf 00-systemd.conf 01-session.conf 00-optional.conf \
- 01-md.conf; do
+ 01-ldap.conf 00-systemd.conf 01-session.conf 00-optional.conf; do
install -m 644 -p $RPM_SOURCE_DIR/$f \
$RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.modules.d/$f
done
@@ -621,7 +608,6 @@ exit $rv
%exclude %{_sysconfdir}/httpd/conf.modules.d/00-proxyhtml.conf
%exclude %{_sysconfdir}/httpd/conf.modules.d/01-ldap.conf
%exclude %{_sysconfdir}/httpd/conf.modules.d/01-session.conf
-%exclude %{_sysconfdir}/httpd/conf.modules.d/01-md.conf
%config(noreplace) %{_sysconfdir}/sysconfig/htcacheclean
%ghost %{_sysconfdir}/sysconfig/httpd
@@ -641,7 +627,6 @@ exit $rv
%{_libdir}/httpd/modules/mod*.so
%exclude %{_libdir}/httpd/modules/mod_auth_form.so
%exclude %{_libdir}/httpd/modules/mod_ssl.so
-%exclude %{_libdir}/httpd/modules/mod_md.so
%exclude %{_libdir}/httpd/modules/mod_*ldap.so
%exclude %{_libdir}/httpd/modules/mod_proxy_html.so
%exclude %{_libdir}/httpd/modules/mod_xml2enc.so
@@ -723,10 +708,6 @@ exit $rv
%{_libdir}/httpd/modules/mod_auth_form.so
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/01-session.conf
-%files -n mod_md
-%{_libdir}/httpd/modules/mod_md.so
-%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/01-md.conf
-
%files devel
%{_includedir}/httpd
%{_bindir}/apxs
@@ -737,6 +718,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Jun 13 2019 Lubos Uhliarik - 2.4.39-6
+- remove bundled mod_md module
+
* Wed Jun 12 2019 Joe Orton - 2.4.39-5
- fixes for StateDir directive (upstream r1857731, r1857731)
From 10963a8dadf029141ca95f45c0bf5c622d98ab9b Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Thu, 20 Jun 2019 11:52:17 +0100
Subject: [PATCH 041/231] remove superfluous ap_hack_ symbols from httpd binary
more verbose %check section
---
httpd-2.4.33-export.patch | 20 --------------
httpd-2.4.39-export.patch | 58 +++++++++++++++++++++++++++++++++++++++
httpd.spec | 41 +++++++++++++++++++++------
3 files changed, 90 insertions(+), 29 deletions(-)
delete mode 100644 httpd-2.4.33-export.patch
create mode 100644 httpd-2.4.39-export.patch
diff --git a/httpd-2.4.33-export.patch b/httpd-2.4.33-export.patch
deleted file mode 100644
index 9adf398..0000000
--- a/httpd-2.4.33-export.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-
-There is no need to "suck in" the apr/apr-util symbols when using
-a shared libapr{,util}, it just bloats the symbol table; so don't.
-
-Upstream-HEAD: needed
-Upstream-2.0: omit
-Upstream-Status: EXPORT_DIRS change is conditional on using shared apr
-
---- httpd-2.4.33/server/Makefile.in.export
-+++ httpd-2.4.33/server/Makefile.in
-@@ -60,9 +60,6 @@
- ls $$dir/*.h ; \
- done; \
- echo "$(top_srcdir)/server/mpm_fdqueue.h"; \
-- for dir in $(EXPORT_DIRS_APR); do \
-- ls $$dir/ap[ru].h $$dir/ap[ru]_*.h 2>/dev/null; \
-- done; \
- ) | sed -e s,//,/,g | sort -u > $@
-
- exports.c: export_files
diff --git a/httpd-2.4.39-export.patch b/httpd-2.4.39-export.patch
new file mode 100644
index 0000000..e343b22
--- /dev/null
+++ b/httpd-2.4.39-export.patch
@@ -0,0 +1,58 @@
+
+Reduce size of httpd binary by telling linker to export all symbols
+from libmain.a, rather than bloating the symbol table with ap_hack_*
+to do so indirectly.
+
+Upstream-HEAD: needed
+Upstream-2.0: omit
+
+--- httpd-2.4.39/Makefile.in.export
++++ httpd-2.4.39/Makefile.in
+@@ -4,8 +4,15 @@
+
+ PROGRAM_NAME = $(progname)
+ PROGRAM_SOURCES = modules.c
+-PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
++PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) \
++ $(PROGRAM_LDDEPS) \
++ $(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
+ PROGRAM_PRELINK = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
++PROGRAM_LDDEPS = \
++ $(BUILTIN_LIBS) \
++ $(MPM_LIB) \
++ -Wl,--whole-archive,server/.libs/libmain.a,--no-whole-archive \
++ os/$(OS_DIR)/libos.la
+ PROGRAM_DEPENDENCIES = \
+ server/libmain.la \
+ $(BUILTIN_LIBS) \
+--- httpd-2.4.39/server/main.c.export
++++ httpd-2.4.39/server/main.c
+@@ -835,17 +835,3 @@
+ return !OK;
+ }
+
+-#ifdef AP_USING_AUTOCONF
+-/* This ugly little hack pulls any function referenced in exports.c into
+- * the web server. exports.c is generated during the build, and it
+- * has all of the APR functions specified by the apr/apr.exports and
+- * apr-util/aprutil.exports files.
+- */
+-const void *ap_suck_in_APR(void);
+-const void *ap_suck_in_APR(void)
+-{
+- extern const void *ap_ugly_hack;
+-
+- return ap_ugly_hack;
+-}
+-#endif
+--- httpd-2.4.39/server/Makefile.in.export
++++ httpd-2.4.39/server/Makefile.in
+@@ -12,7 +12,7 @@
+ connection.c listen.c util_mutex.c \
+ mpm_common.c mpm_unix.c mpm_fdqueue.c \
+ util_charset.c util_cookies.c util_debug.c util_xml.c \
+- util_filter.c util_pcre.c util_regex.c exports.c \
++ util_filter.c util_pcre.c util_regex.c \
+ scoreboard.c error_bucket.c protocol.c core.c request.c provider.c \
+ eoc_bucket.c eor_bucket.c core_filters.c \
+ util_expr_parse.c util_expr_scan.c util_expr_eval.c
diff --git a/httpd.spec b/httpd.spec
index 40af3b5..860f8af 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 7%{?dist}
+Release: 8%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -63,7 +63,7 @@ Patch3: httpd-2.4.1-deplibs.patch
Patch19: httpd-2.4.25-detect-systemd.patch
# Features/functional changes
Patch21: httpd-2.4.39-r1842929+.patch
-Patch23: httpd-2.4.33-export.patch
+Patch23: httpd-2.4.39-export.patch
Patch24: httpd-2.4.1-corelimit.patch
Patch25: httpd-2.4.25-selinux.patch
Patch26: httpd-2.4.4-r1337344+.patch
@@ -556,19 +556,36 @@ test -f /etc/sysconfig/httpd-disable-posttrans || \
/bin/systemctl try-restart --no-block httpd.service htcacheclean.service >/dev/null 2>&1 || :
%check
-# Check the built modules are all PIC
-if readelf -d $RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.so | grep TEXTREL; then
- : modules contain non-relocatable code
- exit 1
-fi
+make -C server exports.o
+nm --defined httpd > exports-actual.list
set +x
rv=0
+nm --defined-only server/exports.o | \
+ sed -n '/ap_hack_/{s/.* ap_hack_//;/^ap[ru]/d;p;}' | \
+ while read sym; do
+ if ! grep -q " "$sym\$ exports-actual.list; then
+ echo ERROR: Symbol $sym missing in httpd exports
+ rv=1
+ fi
+ done
+if [ $rv -eq 0 ]; then
+ echo PASS: Symbol export list verified.
+fi
+# Check the built modules are all PIC
+if readelf -d $RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.so | grep TEXTREL; then
+ echo FAIL: Modules contain non-relocatable code
+ rv=1
+else
+ echo PASS: No non-relocatable code in module builds
+fi
# Ensure every mod_* that's built is loaded.
for f in $RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.so; do
m=${f##*/}
if ! grep -q $m $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.modules.d/*.conf; then
- echo ERROR: Module $m not configured. Disable it, or load it.
+ echo FAIL: Module $m not configured. Disable it, or load it.
rv=1
+ else
+ echo PASS: Module $m is configured and loaded.
fi
done
# Ensure every loaded mod_* is actually built
@@ -576,8 +593,10 @@ mods=`grep -h ^LoadModule $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.modules.d/*.c
for m in $mods; do
f=$RPM_BUILD_ROOT%{_libdir}/httpd/modules/${m}
if ! test -x $f; then
- echo ERROR: Module $m is configured but not built.
+ echo FAIL: Module $m is configured but not built.
rv=1
+ else
+ echo PASS: Loaded module $m is installed.
fi
done
set -x
@@ -720,6 +739,10 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Jun 20 2019 Joe Orton - 2.4.39-8
+- remove superfluous ap_hack_ symbols from httpd binary
+- more verbose %%check section
+
* Thu Jun 13 2019 Lubos Uhliarik - 2.4.39-7
- remove bundled mod_md module
From eb4dbe737f56b6380c7a69d5a65f9ef40ab390ca Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Thu, 20 Jun 2019 15:41:26 +0100
Subject: [PATCH 042/231] Now upstream though in a more complicated way which
is opt-in.
---
httpd-2.4.39-export.patch | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/httpd-2.4.39-export.patch b/httpd-2.4.39-export.patch
index e343b22..b20a6e7 100644
--- a/httpd-2.4.39-export.patch
+++ b/httpd-2.4.39-export.patch
@@ -3,8 +3,7 @@ Reduce size of httpd binary by telling linker to export all symbols
from libmain.a, rather than bloating the symbol table with ap_hack_*
to do so indirectly.
-Upstream-HEAD: needed
-Upstream-2.0: omit
+Upstream: https://svn.apache.org/r1861685 (as new default-off configure option)
--- httpd-2.4.39/Makefile.in.export
+++ httpd-2.4.39/Makefile.in
From b18b77bc684aac41fe1a9b8c1dc8d491fe051045 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Fri, 21 Jun 2019 09:00:52 +0100
Subject: [PATCH 043/231] create instance-specific StateDir in httpd@.service,
instance.conf
---
httpd.spec | 5 ++++-
httpd@.service | 2 ++
instance.conf | 5 +++--
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/httpd.spec b/httpd.spec
index 860f8af..32cb463 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 8%{?dist}
+Release: 9%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -739,6 +739,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Fri Jun 21 2019 Joe Orton - 2.4.39-9
+- create instance-specific StateDir in httpd@.service, instance.conf
+
* Thu Jun 20 2019 Joe Orton - 2.4.39-8
- remove superfluous ap_hack_ symbols from httpd binary
- more verbose %%check section
diff --git a/httpd@.service b/httpd@.service
index c58ae88..7649dff 100644
--- a/httpd@.service
+++ b/httpd@.service
@@ -12,6 +12,8 @@ Environment=LANG=C
Environment=HTTPD_INSTANCE=%i
ExecStartPre=/bin/mkdir -m 710 -p /run/httpd/instance-%i
ExecStartPre=/bin/chown root.apache /run/httpd/instance-%i
+ExecStartPre=/bin/mkdir -m 700 -p /var/lib/httpd/instance-%i
+ExecStartPre=/bin/chown apache.apache /var/lib/httpd/instance-%i
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND -f conf/%i.conf
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful -f conf/%i.conf
# Send SIGWINCH for graceful stop
diff --git a/instance.conf b/instance.conf
index f2b03f7..074fb66 100644
--- a/instance.conf
+++ b/instance.conf
@@ -1,6 +1,6 @@
#
# This is an example instance-specific configuration file. See the
-# httpd.service(8) man page for detailed information on using the
+# httpd@.service(8) man page for detailed information on using the
# the httpd@.service with instances.
#
# To use this example, copy instance.conf to /etc/httpd/conf/foobar.conf
@@ -10,7 +10,7 @@
# # systemctl start httpd@foobar.service
#
# The changes compared to the default are:
-# - DefaultRuntime and Pidfile renamed to be instance-specific
+# - DefaultRuntime, DefaultStateDir and Pidfile renamed to instance-specific
# - default logfile names are prefixed with the instance name
# - /etc/httpd/conf.d is NOT included by default (conf.modules.d still is)
#
@@ -20,4 +20,5 @@
#
DefaultRuntimeDir /run/httpd/instance-${HTTPD_INSTANCE}
+DefaultStateDir /var/lib/httpd/instance-${HTTPD_INSTANCE}
PidFile /run/httpd/instance-${HTTPD_INSTANCE}.pid
From 4d2ffdca914614be62ba75e12fea4452f8d93667 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Mon, 8 Jul 2019 09:06:38 +0100
Subject: [PATCH 044/231] Use mod_cgid for any non-prefork MPM.
---
01-cgi.conf | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/01-cgi.conf b/01-cgi.conf
index 5b8b936..4b680cf 100644
--- a/01-cgi.conf
+++ b/01-cgi.conf
@@ -2,10 +2,7 @@
# which has been configured in 00-mpm.conf. mod_cgid should be used
# with a threaded MPM; mod_cgi with the prefork MPM.
-
- LoadModule cgid_module modules/mod_cgid.so
-
-
+
LoadModule cgid_module modules/mod_cgid.so
From 2ae67b32b199fc1b8339a068b502a863e44744fd Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Mon, 8 Jul 2019 09:18:33 +0100
Subject: [PATCH 045/231] htpasswd: add SHA-256/512 support
---
httpd-2.4.37-r1861793+.patch | 270 +++++++++++++++++++++++++++++++++++
httpd.spec | 7 +-
2 files changed, 276 insertions(+), 1 deletion(-)
create mode 100644 httpd-2.4.37-r1861793+.patch
diff --git a/httpd-2.4.37-r1861793+.patch b/httpd-2.4.37-r1861793+.patch
new file mode 100644
index 0000000..c522c7c
--- /dev/null
+++ b/httpd-2.4.37-r1861793+.patch
@@ -0,0 +1,270 @@
+# ./pullrev.sh 1861793 1862611 1862612
+http://svn.apache.org/viewvc?view=revision&revision=1861793
+
+http://svn.apache.org/viewvc?view=revision&revision=1862611
+http://svn.apache.org/viewvc?view=revision&revision=1862612
+
+--- httpd-2.4.37/configure.in
++++ httpd-2.4.37/configure.in
+@@ -500,6 +500,28 @@
+ AC_SEARCH_LIBS(crypt, crypt)
+ CRYPT_LIBS="$LIBS"
+ APACHE_SUBST(CRYPT_LIBS)
++
++if test "$ac_cv_search_crypt" != "no"; then
++ # Test crypt() with the SHA-512 test vector from https://akkadia.org/drepper/SHA-crypt.txt
++ AC_CACHE_CHECK([whether crypt() supports SHA-2], [ap_cv_crypt_sha2], [
++ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
++#include
++#include
++#include
++
++#define PASSWD_0 "Hello world!"
++#define SALT_0 "\$6\$saltstring"
++#define EXPECT_0 "\$6\$saltstring\$svn8UoSVapNtMuq1ukKS4tPQd8iKwSMHWjl/O817G3uBnIFNjnQJu" \
++ "esI68u4OTLiBFdcbYEdFCoEOfaS35inz1"
++]], [char *result = crypt(PASSWD_0, SALT_0);
++ if (!result) return 1;
++ if (strcmp(result, EXPECT_0)) return 2;
++])], [ap_cv_crypt_sha2=yes], [ap_cv_crypt_sha2=no])])
++ if test "$ap_cv_crypt_sha2" = yes; then
++ AC_DEFINE([HAVE_CRYPT_SHA2], 1, [Define if crypt() supports SHA-2 hashes])
++ fi
++fi
++
+ LIBS="$saved_LIBS"
+
+ dnl See Comment #Spoon
+--- httpd-2.4.37/support/htpasswd.c
++++ httpd-2.4.37/support/htpasswd.c
+@@ -109,17 +109,21 @@
+ "for it." NL
+ " -i Read password from stdin without verification (for script usage)." NL
+ " -m Force MD5 encryption of the password (default)." NL
+- " -B Force bcrypt encryption of the password (very secure)." NL
++ " -2 Force SHA-256 crypt() hash of the password (very secure)." NL
++ " -5 Force SHA-512 crypt() hash of the password (very secure)." NL
++ " -B Force bcrypt aencryption of the password (very secure)." NL
+ " -C Set the computing time used for the bcrypt algorithm" NL
+ " (higher is more secure but slower, default: %d, valid: 4 to 31)." NL
++ " -r Set the number of rounds used for the SHA-256, SHA-512 algorithms" NL
++ " (higher is more secure but slower, default: 5000)." NL
+ " -d Force CRYPT encryption of the password (8 chars max, insecure)." NL
+- " -s Force SHA encryption of the password (insecure)." NL
++ " -s Force SHA-1 encryption of the password (insecure)." NL
+ " -p Do not encrypt the password (plaintext, insecure)." NL
+ " -D Delete the specified user." NL
+ " -v Verify password for the specified user." NL
+ "On other systems than Windows and NetWare the '-p' flag will "
+ "probably not work." NL
+- "The SHA algorithm does not use a salt and is less secure than the "
++ "The SHA-1 algorithm does not use a salt and is less secure than the "
+ "MD5 algorithm." NL,
+ BCRYPT_DEFAULT_COST
+ );
+@@ -178,7 +182,7 @@
+ if (rv != APR_SUCCESS)
+ exit(ERR_SYNTAX);
+
+- while ((rv = apr_getopt(state, "cnmspdBbDiC:v", &opt, &opt_arg)) == APR_SUCCESS) {
++ while ((rv = apr_getopt(state, "cnmspdBbDi25C:r:v", &opt, &opt_arg)) == APR_SUCCESS) {
+ switch (opt) {
+ case 'c':
+ *mask |= APHTP_NEWFILE;
+--- httpd-2.4.37/support/passwd_common.c
++++ httpd-2.4.37/support/passwd_common.c
+@@ -185,10 +185,15 @@
+ #if CRYPT_ALGO_SUPPORTED
+ char *cbuf;
+ #endif
++#ifdef HAVE_CRYPT_SHA2
++ const char *setting;
++ char method;
++#endif
+
+- if (ctx->cost != 0 && ctx->alg != ALG_BCRYPT) {
++ if (ctx->cost != 0 && ctx->alg != ALG_BCRYPT
++ && ctx->alg != ALG_CRYPT_SHA256 && ctx->alg != ALG_CRYPT_SHA512 ) {
+ apr_file_printf(errfile,
+- "Warning: Ignoring -C argument for this algorithm." NL);
++ "Warning: Ignoring -C/-r argument for this algorithm." NL);
+ }
+
+ if (ctx->passwd == NULL) {
+@@ -246,6 +251,34 @@
+ break;
+ #endif /* CRYPT_ALGO_SUPPORTED */
+
++#ifdef HAVE_CRYPT_SHA2
++ case ALG_CRYPT_SHA256:
++ case ALG_CRYPT_SHA512:
++ ret = generate_salt(salt, 16, &ctx->errstr, ctx->pool);
++ if (ret != 0)
++ break;
++
++ method = ctx->alg == ALG_CRYPT_SHA256 ? '5': '6';
++
++ if (ctx->cost)
++ setting = apr_psprintf(ctx->pool, "$%c$rounds=%d$%s",
++ method, ctx->cost, salt);
++ else
++ setting = apr_psprintf(ctx->pool, "$%c$%s",
++ method, salt);
++
++ cbuf = crypt(pw, setting);
++ if (cbuf == NULL) {
++ rv = APR_FROM_OS_ERROR(errno);
++ ctx->errstr = apr_psprintf(ctx->pool, "crypt() failed: %pm", &rv);
++ ret = ERR_PWMISMATCH;
++ break;
++ }
++
++ apr_cpystrn(ctx->out, cbuf, ctx->out_len - 1);
++ break;
++#endif /* HAVE_CRYPT_SHA2 */
++
+ #if BCRYPT_ALGO_SUPPORTED
+ case ALG_BCRYPT:
+ rv = apr_generate_random_bytes((unsigned char*)salt, 16);
+@@ -294,6 +327,19 @@
+ case 's':
+ ctx->alg = ALG_APSHA;
+ break;
++#ifdef HAVE_CRYPT_SHA2
++ case '2':
++ ctx->alg = ALG_CRYPT_SHA256;
++ break;
++ case '5':
++ ctx->alg = ALG_CRYPT_SHA512;
++ break;
++#else
++ case '2':
++ case '5':
++ ctx->errstr = "SHA-2 crypt() algorithms are not supported on this platform.";
++ return ERR_ALG_NOT_SUPP;
++#endif
+ case 'p':
+ ctx->alg = ALG_PLAIN;
+ #if !PLAIN_ALGO_SUPPORTED
+@@ -324,11 +370,12 @@
+ return ERR_ALG_NOT_SUPP;
+ #endif
+ break;
+- case 'C': {
++ case 'C':
++ case 'r': {
+ char *endptr;
+ long num = strtol(opt_arg, &endptr, 10);
+ if (*endptr != '\0' || num <= 0) {
+- ctx->errstr = "argument to -C must be a positive integer";
++ ctx->errstr = "argument to -C/-r must be a positive integer";
+ return ERR_SYNTAX;
+ }
+ ctx->cost = num;
+--- httpd-2.4.37/support/passwd_common.h
++++ httpd-2.4.37/support/passwd_common.h
+@@ -28,6 +28,8 @@
+ #include "apu_version.h"
+ #endif
+
++#include "ap_config_auto.h"
++
+ #define MAX_STRING_LEN 256
+
+ #define ALG_PLAIN 0
+@@ -35,6 +37,8 @@
+ #define ALG_APMD5 2
+ #define ALG_APSHA 3
+ #define ALG_BCRYPT 4
++#define ALG_CRYPT_SHA256 5
++#define ALG_CRYPT_SHA512 6
+
+ #define BCRYPT_DEFAULT_COST 5
+
+@@ -84,7 +88,7 @@
+ apr_size_t out_len;
+ char *passwd;
+ int alg;
+- int cost;
++ int cost; /* cost for bcrypt, rounds for SHA-2 */
+ enum {
+ PW_PROMPT = 0,
+ PW_ARG,
+--- httpd-2.4.37/docs/man/htpasswd.1
++++ httpd-2.4.37/docs/man/htpasswd.1
+@@ -27,16 +27,16 @@
+ .SH "SYNOPSIS"
+
+ .PP
+-\fB\fBhtpasswd\fR [ -\fBc\fR ] [ -\fBi\fR ] [ -\fBm\fR | -\fBB\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBC\fR \fIcost\fR ] [ -\fBD\fR ] [ -\fBv\fR ] \fIpasswdfile\fR \fIusername\fR\fR
++\fB\fBhtpasswd\fR [ -\fBc\fR ] [ -\fBi\fR ] [ -\fBm\fR | -\fBB\fR | -\fB2\fR | -\fB5\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBr\fR \fIrounds\fR ] [ -\fBC\fR \fIcost\fR ] [ -\fBD\fR ] [ -\fBv\fR ] \fIpasswdfile\fR \fIusername\fR\fR
+
+ .PP
+-\fB\fBhtpasswd\fR -\fBb\fR [ -\fBc\fR ] [ -\fBm\fR | -\fBB\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBC\fR \fIcost\fR ] [ -\fBD\fR ] [ -\fBv\fR ] \fIpasswdfile\fR \fIusername\fR \fIpassword\fR\fR
++\fB\fBhtpasswd\fR -\fBb\fR [ -\fBc\fR ] [ -\fBm\fR | -\fBB\fR | -\fB2\fR | -\fB5\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBr\fR \fIrounds\fR ] [ -\fBC\fR \fIcost\fR ] [ -\fBD\fR ] [ -\fBv\fR ] \fIpasswdfile\fR \fIusername\fR \fIpassword\fR\fR
+
+ .PP
+-\fB\fBhtpasswd\fR -\fBn\fR [ -\fBi\fR ] [ -\fBm\fR | -\fBB\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBC\fR \fIcost\fR ] \fIusername\fR\fR
++\fB\fBhtpasswd\fR -\fBn\fR [ -\fBi\fR ] [ -\fBm\fR | -\fBB\fR | -\fB2\fR | -\fB5\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBr\fR \fIrounds\fR ] [ -\fBC\fR \fIcost\fR ] \fIusername\fR\fR
+
+ .PP
+-\fB\fBhtpasswd\fR -\fBnb\fR [ -\fBm\fR | -\fBB\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBC\fR \fIcost\fR ] \fIusername\fR \fIpassword\fR\fR
++\fB\fBhtpasswd\fR -\fBnb\fR [ -\fBm\fR | -\fBB\fR | -\fB2\fR | -\fB5\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBr\fR \fIrounds\fR ] [ -\fBC\fR \fIcost\fR ] \fIusername\fR \fIpassword\fR\fR
+
+
+ .SH "SUMMARY"
+@@ -48,7 +48,7 @@
+ Resources available from the Apache HTTP server can be restricted to just the users listed in the files created by \fBhtpasswd\fR\&. This program can only manage usernames and passwords stored in a flat-file\&. It can encrypt and display password information for use in other types of data stores, though\&. To use a DBM database see dbmmanage or htdbm\&.
+
+ .PP
+-\fBhtpasswd\fR encrypts passwords using either bcrypt, a version of MD5 modified for Apache, SHA1, or the system's \fBcrypt()\fR routine\&. Files managed by \fBhtpasswd\fR may contain a mixture of different encoding types of passwords; some user records may have bcrypt or MD5-encrypted passwords while others in the same file may have passwords encrypted with \fBcrypt()\fR\&.
++\fBhtpasswd\fR encrypts passwords using either bcrypt, a version of MD5 modified for Apache, SHA-1, or the system's \fBcrypt()\fR routine\&. SHA-2-based hashes (SHA-256 and SHA-512) are supported for \fBcrypt()\fR\&. Files managed by \fBhtpasswd\fR may contain a mixture of different encoding types of passwords; some user records may have bcrypt or MD5-encrypted passwords while others in the same file may have passwords encrypted with \fBcrypt()\fR\&.
+
+ .PP
+ This manual page only lists the command line arguments\&. For details of the directives necessary to configure user authentication in httpd see the Apache manual, which is part of the Apache distribution or can be found at http://httpd\&.apache\&.org/\&.
+@@ -73,6 +73,12 @@
+ \fB-m\fR
+ Use MD5 encryption for passwords\&. This is the default (since version 2\&.2\&.18)\&.
+ .TP
++\fB-2\fR
++Use SHA-256 \fBcrypt()\fR based hashes for passwords\&. This is supported on most Unix platforms\&.
++.TP
++\fB-5\fR
++Use SHA-512 \fBcrypt()\fR based hashes for passwords\&. This is supported on most Unix platforms\&.
++.TP
+ \fB-B\fR
+ Use bcrypt encryption for passwords\&. This is currently considered to be very secure\&.
+ .TP
+@@ -79,11 +85,14 @@
+ \fB-C\fR
+ This flag is only allowed in combination with \fB-B\fR (bcrypt encryption)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 31)\&.
+ .TP
++\fB-r\fR
++This flag is only allowed in combination with \fB-2\fR or \fB-5\fR\&. It sets the number of hash rounds used for the SHA-2 algorithms (higher is more secure but slower; the default is 5,000)\&.
++.TP
+ \fB-d\fR
+ Use \fBcrypt()\fR encryption for passwords\&. This is not supported by the httpd server on Windows and Netware\&. This algorithm limits the password length to 8 characters\&. This algorithm is \fBinsecure\fR by today's standards\&. It used to be the default algorithm until version 2\&.2\&.17\&.
+ .TP
+ \fB-s\fR
+-Use SHA encryption for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.
++Use SHA-1 (160-bit) encryption for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&.
+ .TP
+ \fB-p\fR
+ Use plaintext passwords\&. Though \fBhtpasswd\fR will support creation on all platforms, the httpd daemon will only accept plain text passwords on Windows and Netware\&.
+@@ -152,11 +161,14 @@
+ When using the \fBcrypt()\fR algorithm, note that only the first 8 characters of the password are used to form the password\&. If the supplied password is longer, the extra characters will be silently discarded\&.
+
+ .PP
+-The SHA encryption format does not use salting: for a given password, there is only one encrypted representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
++The SHA-1 encryption format does not use salting: for a given password, there is only one encrypted representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&.
+
+ .PP
+-The SHA and \fBcrypt()\fR formats are insecure by today's standards\&.
++The SHA-1 and \fBcrypt()\fR formats are insecure by today's standards\&.
+
++.PP
++The SHA-2-based \fBcrypt()\fR formats (SHA-256 and SHA-512) are supported on most modern Unix systems, and follow the specification at https://www\&.akkadia\&.org/drepper/SHA-crypt\&.txt\&.
++
+ .SH "RESTRICTIONS"
+
+ .PP
diff --git a/httpd.spec b/httpd.spec
index 32cb463..a94fdb6 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 9%{?dist}
+Release: 10%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -76,6 +76,7 @@ Patch36: httpd-2.4.38-r1830819+.patch
Patch38: httpd-2.4.34-sslciphdefault.patch
Patch39: httpd-2.4.37-sslprotdefault.patch
Patch40: httpd-2.4.39-r1861269.patch
+Patch41: httpd-2.4.37-r1861793+.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -216,6 +217,7 @@ interface for storing and accessing per-user session data.
%patch38 -p1 -b .sslciphdefault
%patch39 -p1 -b .sslprotdefault
%patch40 -p1 -b .r1861269
+%patch41 -p1 -b .r1861793+
%patch58 -p1 -b .r1738878
%patch60 -p1 -b .enable-sslv3
@@ -739,6 +741,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Mon Jul 8 2019 Joe Orton - 2.4.39-10
+- htpasswd: add SHA-256/512 support
+
* Fri Jun 21 2019 Joe Orton - 2.4.39-9
- create instance-specific StateDir in httpd@.service, instance.conf
From 7ee1cb5208eaa7a0ce86eea5263d0d17e94feae1 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Mon, 8 Jul 2019 09:23:48 +0100
Subject: [PATCH 046/231] - apachectl: restore -V/-v/-t support (#1727434)
---
apachectl.sh | 6 +++++-
httpd.spec | 7 +++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/apachectl.sh b/apachectl.sh
index 77868fe..e0f6f78 100755
--- a/apachectl.sh
+++ b/apachectl.sh
@@ -49,10 +49,14 @@ graceful-stop)
/usr/bin/systemctl kill --signal=SIGWINCH $SVC
ERROR=$?
;;
-configtest)
+configtest|-t)
$HTTPD -t
ERROR=$?
;;
+-v|-V)
+ $HTTPD $ACMD
+ ERROR=$?
+ ;;
*)
echo apachectl: The \"$ACMD\" option is not supported. 1>&2
ERROR=2
diff --git a/httpd.spec b/httpd.spec
index a94fdb6..5fbcc76 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -406,7 +406,8 @@ sed -i \
docs/conf/extra/*.conf
# Set correct path for httpd binary in apachectl script
-sed -i 's,@HTTPDBIN@,%{_sbindir}/httpd,g' $RPM_SOURCE_DIR/apachectl.sh
+sed 's,@HTTPDBIN@,%{_sbindir}/httpd,g' $RPM_SOURCE_DIR/apachectl.sh \
+ > apachectl.sh
# Create cache directory
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/httpd \
@@ -474,7 +475,8 @@ install -m755 $RPM_SOURCE_DIR/httpd-ssl-gencerts \
$RPM_BUILD_ROOT%{_libexecdir}/httpd-ssl-gencerts
# Install scripts
-install -p -m 755 $RPM_SOURCE_DIR/apachectl.sh $RPM_BUILD_ROOT%{_sbindir}/apachectl
+install -m 755 apachectl.sh $RPM_BUILD_ROOT%{_sbindir}/apachectl
+touch -r $RPM_SOURCE_DIR/apachectl.sh $RPM_BUILD_ROOT%{_sbindir}/apachectl
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/initscripts/legacy-actions/httpd
for f in graceful configtest; do
install -p -m 755 $RPM_SOURCE_DIR/action-${f}.sh \
@@ -743,6 +745,7 @@ exit $rv
%changelog
* Mon Jul 8 2019 Joe Orton - 2.4.39-10
- htpasswd: add SHA-256/512 support
+- apachectl: restore -V/-v/-t support (#1727434)
* Fri Jun 21 2019 Joe Orton - 2.4.39-9
- create instance-specific StateDir in httpd@.service, instance.conf
From c4e5cc737f187af40b089e3a64848cd830ebeb5a Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Tue, 16 Jul 2019 17:14:13 +0200
Subject: [PATCH 047/231] Remove redundant part of patch - we ship are own
config.layout
---
httpd-2.4.39-r1842929+.patch | 122 -----------------------------------
1 file changed, 122 deletions(-)
diff --git a/httpd-2.4.39-r1842929+.patch b/httpd-2.4.39-r1842929+.patch
index 50f8aa1..9fea432 100644
--- a/httpd-2.4.39-r1842929+.patch
+++ b/httpd-2.4.39-r1842929+.patch
@@ -23,128 +23,6 @@ http://svn.apache.org/viewvc?view=revision&revision=1853631
])
dnl
---- httpd-2.4.39/config.layout.r1842929+
-+++ httpd-2.4.39/config.layout
-@@ -29,6 +29,7 @@
- includedir: ${prefix}/include
- localstatedir: ${prefix}
- runtimedir: ${localstatedir}/logs
-+ statedir: ${localstatedir}/state
- logfiledir: ${localstatedir}/logs
- proxycachedir: ${localstatedir}/proxy
-
-@@ -54,6 +55,7 @@
- includedir: ${prefix}/include+
- localstatedir: ${prefix}/var+
- runtimedir: ${localstatedir}/run
-+ statedir: ${localstatedir}/state
- logfiledir: ${localstatedir}/log
- proxycachedir: ${localstatedir}/proxy
-
-@@ -78,6 +80,7 @@
- includedir: /System/Library/Frameworks/Apache.framework/Versions/2.0/Headers
- localstatedir: /var
- runtimedir: ${prefix}/Logs
-+ statedir: ${prefix}/State
- logfiledir: ${prefix}/Logs
- proxycachedir: ${prefix}/ProxyCache
-
-@@ -102,6 +105,7 @@
- includedir: ${prefix}/include+
- localstatedir: /var
- runtimedir: ${localstatedir}/run
-+ statedir: ${localstatedir}/state
- logfiledir: ${localstatedir}/log+
- proxycachedir: ${runtimedir}/proxy
-
-@@ -126,6 +130,7 @@
- includedir: ${prefix}/include/apache
- localstatedir: /var
- runtimedir: ${localstatedir}/run
-+ statedir: ${localstatedir}/lib/httpd
- logfiledir: ${localstatedir}/log/httpd
- proxycachedir: ${localstatedir}/cache/httpd
-
-@@ -151,6 +156,7 @@
- includedir: ${prefix}/include/httpd
- runtimedir: /run/httpd
- logfiledir: ${localstatedir}/log/httpd
-+ statedir: ${localstatedir}/lib/httpd
- proxycachedir: ${localstatedir}/cache/httpd/proxy
-
-
-@@ -175,6 +181,7 @@
- localstatedir: /var${prefix}
- runtimedir: ${localstatedir}/run
- logfiledir: ${localstatedir}/logs
-+ statedir: ${localstatedir}/state
- proxycachedir: ${localstatedir}/proxy
-
-
-@@ -197,6 +204,7 @@
- cgidir: ${datadir}/cgi-bin
- includedir: ${prefix}/include/apache
- localstatedir: /var/lib/httpd
-+ statedir: ${localstatedir}
- runtimedir: /var/run
- logfiledir: /var/log/httpd
- proxycachedir: /var/cache/httpd
-@@ -223,6 +231,7 @@
- localstatedir: /var
- runtimedir: ${localstatedir}/run
- logfiledir: ${localstatedir}/log/httpd
-+ statedir: ${prefix}/state
- proxycachedir: ${localstatedir}/proxy
-
-
-@@ -246,6 +255,7 @@
- includedir: ${exec_prefix}/include
- localstatedir: ${prefix}
- runtimedir: /var/run
-+ statedir: ${datadir}/state
- logfiledir: ${datadir}/logs
- proxycachedir: ${datadir}/proxy
-
-@@ -271,6 +281,7 @@
- localstatedir: ${prefix}
- runtimedir: ${prefix}/logs
- logfiledir: ${prefix}/logs
-+ statedir: ${prefix}/state
- proxycachedir: ${prefix}/proxy
-
-
-@@ -315,6 +326,7 @@
- cgidir: ${prefix}/usr/lib/cgi-bin
- includedir: ${exec_prefix}/include/apache2
- localstatedir: ${prefix}/var/lock/apache2
-+ statedir: ${prefix}/var/lib/apache2
- runtimedir: ${prefix}/var/run/apache2
- logfiledir: ${prefix}/var/log/apache2
- proxycachedir: ${prefix}/var/cache/apache2/proxy
-@@ -343,6 +355,7 @@
- manualdir: ${datadir}/manual
- cgidir: ${datadir}/cgi-bin
- runtimedir: ${localstatedir}/run
-+ runtimedir: ${localstatedir}/lib/httpd
- logfiledir: ${localstatedir}/log/httpd
- proxycachedir: ${localstatedir}/cache/httpd/cache-root
-
-@@ -366,6 +379,7 @@
- manualdir: ${prefix}/manual
- includedir: ${prefix}/include
- localstatedir: /var/httpd
-+ statedir: ${localstatedir}/state
- runtimedir: ${localstatedir}/run
- logfiledir: ${localstatedir}/logs
- proxycachedir: ${localstatedir}/proxy
-@@ -391,6 +405,7 @@
- includedir: ${prefix}/include/httpd
- localstatedir: /var
- runtimedir: ${localstatedir}/run/httpd
-+ statedir: ${localstatedir}/lib/httpd
- logfiledir: ${localstatedir}/log/httpd
- proxycachedir: ${localstatedir}/cache/httpd
-
--- httpd-2.4.39/configure.in.r1842929+
+++ httpd-2.4.39/configure.in
@@ -41,7 +41,7 @@
From 2993aea7a705c7ef4b943b1770f98b2964792d83 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Wed, 17 Jul 2019 11:31:15 +0100
Subject: [PATCH 048/231] mod_cgid: use fd passing to fix script stderr
handling (#1591157) Resolves: rhbz#1591157
---
httpd-2.4.37-r1828172+.patch | 1069 ++++++++++++++++++++++++++++++++++
httpd.spec | 8 +-
2 files changed, 1076 insertions(+), 1 deletion(-)
create mode 100644 httpd-2.4.37-r1828172+.patch
diff --git a/httpd-2.4.37-r1828172+.patch b/httpd-2.4.37-r1828172+.patch
new file mode 100644
index 0000000..822cccf
--- /dev/null
+++ b/httpd-2.4.37-r1828172+.patch
@@ -0,0 +1,1069 @@
+# ./pullrev.sh 1828172 1862968 1863191
+http://svn.apache.org/viewvc?view=revision&revision=1828172
+http://svn.apache.org/viewvc?view=revision&revision=1862968
+http://svn.apache.org/viewvc?view=revision&revision=1863191
+
+--- httpd-2.4.37/modules/generators/mod_cgi.c
++++ httpd-2.4.37/modules/generators/mod_cgi.c
+@@ -92,6 +92,10 @@
+ apr_size_t bufbytes;
+ } cgi_server_conf;
+
++typedef struct {
++ apr_interval_time_t timeout;
++} cgi_dirconf;
++
+ static void *create_cgi_config(apr_pool_t *p, server_rec *s)
+ {
+ cgi_server_conf *c =
+@@ -112,6 +116,12 @@
+ return overrides->logname ? overrides : base;
+ }
+
++static void *create_cgi_dirconf(apr_pool_t *p, char *dummy)
++{
++ cgi_dirconf *c = (cgi_dirconf *) apr_pcalloc(p, sizeof(cgi_dirconf));
++ return c;
++}
++
+ static const char *set_scriptlog(cmd_parms *cmd, void *dummy, const char *arg)
+ {
+ server_rec *s = cmd->server;
+@@ -150,6 +160,17 @@
+ return NULL;
+ }
+
++static const char *set_script_timeout(cmd_parms *cmd, void *dummy, const char *arg)
++{
++ cgi_dirconf *dc = dummy;
++
++ if (ap_timeout_parameter_parse(arg, &dc->timeout, "s") != APR_SUCCESS) {
++ return "CGIScriptTimeout has wrong format";
++ }
++
++ return NULL;
++}
++
+ static const command_rec cgi_cmds[] =
+ {
+ AP_INIT_TAKE1("ScriptLog", set_scriptlog, NULL, RSRC_CONF,
+@@ -158,6 +179,9 @@
+ "the maximum length (in bytes) of the script debug log"),
+ AP_INIT_TAKE1("ScriptLogBuffer", set_scriptlog_buffer, NULL, RSRC_CONF,
+ "the maximum size (in bytes) to record of a POST request"),
++AP_INIT_TAKE1("CGIScriptTimeout", set_script_timeout, NULL, RSRC_CONF | ACCESS_CONF,
++ "The amount of time to wait between successful reads from "
++ "the CGI script, in seconds."),
+ {NULL}
+ };
+
+@@ -471,23 +495,26 @@
+ apr_filepath_name_get(r->filename));
+ }
+ else {
++ cgi_dirconf *dc = ap_get_module_config(r->per_dir_config, &cgi_module);
++ apr_interval_time_t timeout = dc->timeout > 0 ? dc->timeout : r->server->timeout;
++
+ apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT);
+
+ *script_in = procnew->out;
+ if (!*script_in)
+ return APR_EBADF;
+- apr_file_pipe_timeout_set(*script_in, r->server->timeout);
++ apr_file_pipe_timeout_set(*script_in, timeout);
+
+ if (e_info->prog_type == RUN_AS_CGI) {
+ *script_out = procnew->in;
+ if (!*script_out)
+ return APR_EBADF;
+- apr_file_pipe_timeout_set(*script_out, r->server->timeout);
++ apr_file_pipe_timeout_set(*script_out, timeout);
+
+ *script_err = procnew->err;
+ if (!*script_err)
+ return APR_EBADF;
+- apr_file_pipe_timeout_set(*script_err, r->server->timeout);
++ apr_file_pipe_timeout_set(*script_err, timeout);
+ }
+ }
+ }
+@@ -563,189 +590,7 @@
+ }
+
+ #if APR_FILES_AS_SOCKETS
+-
+-/* A CGI bucket type is needed to catch any output to stderr from the
+- * script; see PR 22030. */
+-static const apr_bucket_type_t bucket_type_cgi;
+-
+-struct cgi_bucket_data {
+- apr_pollset_t *pollset;
+- request_rec *r;
+-};
+-
+-/* Create a CGI bucket using pipes from script stdout 'out'
+- * and stderr 'err', for request 'r'. */
+-static apr_bucket *cgi_bucket_create(request_rec *r,
+- apr_file_t *out, apr_file_t *err,
+- apr_bucket_alloc_t *list)
+-{
+- apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+- apr_status_t rv;
+- apr_pollfd_t fd;
+- struct cgi_bucket_data *data = apr_palloc(r->pool, sizeof *data);
+-
+- APR_BUCKET_INIT(b);
+- b->free = apr_bucket_free;
+- b->list = list;
+- b->type = &bucket_type_cgi;
+- b->length = (apr_size_t)(-1);
+- b->start = -1;
+-
+- /* Create the pollset */
+- rv = apr_pollset_create(&data->pollset, 2, r->pool, 0);
+- if (rv != APR_SUCCESS) {
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01217)
+- "apr_pollset_create(); check system or user limits");
+- return NULL;
+- }
+-
+- fd.desc_type = APR_POLL_FILE;
+- fd.reqevents = APR_POLLIN;
+- fd.p = r->pool;
+- fd.desc.f = out; /* script's stdout */
+- fd.client_data = (void *)1;
+- rv = apr_pollset_add(data->pollset, &fd);
+- if (rv != APR_SUCCESS) {
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01218)
+- "apr_pollset_add(); check system or user limits");
+- return NULL;
+- }
+-
+- fd.desc.f = err; /* script's stderr */
+- fd.client_data = (void *)2;
+- rv = apr_pollset_add(data->pollset, &fd);
+- if (rv != APR_SUCCESS) {
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01219)
+- "apr_pollset_add(); check system or user limits");
+- return NULL;
+- }
+-
+- data->r = r;
+- b->data = data;
+- return b;
+-}
+-
+-/* Create a duplicate CGI bucket using given bucket data */
+-static apr_bucket *cgi_bucket_dup(struct cgi_bucket_data *data,
+- apr_bucket_alloc_t *list)
+-{
+- apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
+- APR_BUCKET_INIT(b);
+- b->free = apr_bucket_free;
+- b->list = list;
+- b->type = &bucket_type_cgi;
+- b->length = (apr_size_t)(-1);
+- b->start = -1;
+- b->data = data;
+- return b;
+-}
+-
+-/* Handle stdout from CGI child. Duplicate of logic from the _read
+- * method of the real APR pipe bucket implementation. */
+-static apr_status_t cgi_read_stdout(apr_bucket *a, apr_file_t *out,
+- const char **str, apr_size_t *len)
+-{
+- char *buf;
+- apr_status_t rv;
+-
+- *str = NULL;
+- *len = APR_BUCKET_BUFF_SIZE;
+- buf = apr_bucket_alloc(*len, a->list); /* XXX: check for failure? */
+-
+- rv = apr_file_read(out, buf, len);
+-
+- if (rv != APR_SUCCESS && rv != APR_EOF) {
+- apr_bucket_free(buf);
+- return rv;
+- }
+-
+- if (*len > 0) {
+- struct cgi_bucket_data *data = a->data;
+- apr_bucket_heap *h;
+-
+- /* Change the current bucket to refer to what we read */
+- a = apr_bucket_heap_make(a, buf, *len, apr_bucket_free);
+- h = a->data;
+- h->alloc_len = APR_BUCKET_BUFF_SIZE; /* note the real buffer size */
+- *str = buf;
+- APR_BUCKET_INSERT_AFTER(a, cgi_bucket_dup(data, a->list));
+- }
+- else {
+- apr_bucket_free(buf);
+- a = apr_bucket_immortal_make(a, "", 0);
+- *str = a->data;
+- }
+- return rv;
+-}
+-
+-/* Read method of CGI bucket: polls on stderr and stdout of the child,
+- * sending any stderr output immediately away to the error log. */
+-static apr_status_t cgi_bucket_read(apr_bucket *b, const char **str,
+- apr_size_t *len, apr_read_type_e block)
+-{
+- struct cgi_bucket_data *data = b->data;
+- apr_interval_time_t timeout;
+- apr_status_t rv;
+- int gotdata = 0;
+-
+- timeout = block == APR_NONBLOCK_READ ? 0 : data->r->server->timeout;
+-
+- do {
+- const apr_pollfd_t *results;
+- apr_int32_t num;
+-
+- rv = apr_pollset_poll(data->pollset, timeout, &num, &results);
+- if (APR_STATUS_IS_TIMEUP(rv)) {
+- if (timeout) {
+- ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, data->r, APLOGNO(01220)
+- "Timeout waiting for output from CGI script %s",
+- data->r->filename);
+- return rv;
+- }
+- else {
+- return APR_EAGAIN;
+- }
+- }
+- else if (APR_STATUS_IS_EINTR(rv)) {
+- continue;
+- }
+- else if (rv != APR_SUCCESS) {
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, data->r, APLOGNO(01221)
+- "poll failed waiting for CGI child");
+- return rv;
+- }
+-
+- for (; num; num--, results++) {
+- if (results[0].client_data == (void *)1) {
+- /* stdout */
+- rv = cgi_read_stdout(b, results[0].desc.f, str, len);
+- if (APR_STATUS_IS_EOF(rv)) {
+- rv = APR_SUCCESS;
+- }
+- gotdata = 1;
+- } else {
+- /* stderr */
+- apr_status_t rv2 = log_script_err(data->r, results[0].desc.f);
+- if (APR_STATUS_IS_EOF(rv2)) {
+- apr_pollset_remove(data->pollset, &results[0]);
+- }
+- }
+- }
+-
+- } while (!gotdata);
+-
+- return rv;
+-}
+-
+-static const apr_bucket_type_t bucket_type_cgi = {
+- "CGI", 5, APR_BUCKET_DATA,
+- apr_bucket_destroy_noop,
+- cgi_bucket_read,
+- apr_bucket_setaside_notimpl,
+- apr_bucket_split_notimpl,
+- apr_bucket_copy_notimpl
+-};
+-
++#include "cgi_common.h"
+ #endif
+
+ static int cgi_handler(request_rec *r)
+@@ -766,6 +611,8 @@
+ apr_status_t rv;
+ cgi_exec_info_t e_info;
+ conn_rec *c;
++ cgi_dirconf *dc = ap_get_module_config(r->per_dir_config, &cgi_module);
++ apr_interval_time_t timeout = dc->timeout > 0 ? dc->timeout : r->server->timeout;
+
+ if (strcmp(r->handler, CGI_MAGIC_TYPE) && strcmp(r->handler, "cgi-script")) {
+ return DECLINED;
+@@ -928,7 +775,7 @@
+ apr_file_pipe_timeout_set(script_in, 0);
+ apr_file_pipe_timeout_set(script_err, 0);
+
+- b = cgi_bucket_create(r, script_in, script_err, c->bucket_alloc);
++ b = cgi_bucket_create(r, dc->timeout, script_in, script_err, c->bucket_alloc);
+ if (b == NULL)
+ return HTTP_INTERNAL_SERVER_ERROR;
+ #else
+@@ -985,7 +832,7 @@
+ * stderr output, as normal. */
+ discard_script_output(bb);
+ apr_brigade_destroy(bb);
+- apr_file_pipe_timeout_set(script_err, r->server->timeout);
++ apr_file_pipe_timeout_set(script_err, timeout);
+ log_script_err(r, script_err);
+ }
+
+@@ -1036,7 +883,7 @@
+ * connection drops or we stopped sending output for some other
+ * reason */
+ if (rv == APR_SUCCESS && !r->connection->aborted) {
+- apr_file_pipe_timeout_set(script_err, r->server->timeout);
++ apr_file_pipe_timeout_set(script_err, timeout);
+ log_script_err(r, script_err);
+ }
+
+@@ -1277,7 +1124,7 @@
+ AP_DECLARE_MODULE(cgi) =
+ {
+ STANDARD20_MODULE_STUFF,
+- NULL, /* dir config creater */
++ create_cgi_dirconf, /* dir config creater */
+ NULL, /* dir merger --- default is to override */
+ create_cgi_config, /* server config */
+ merge_cgi_config, /* merge server config */
+--- httpd-2.4.37/modules/generators/mod_cgid.c
++++ httpd-2.4.37/modules/generators/mod_cgid.c
+@@ -342,15 +342,19 @@
+ return close(fd);
+ }
+
+-/* deal with incomplete reads and signals
+- * assume you really have to read buf_size bytes
+- */
+-static apr_status_t sock_read(int fd, void *vbuf, size_t buf_size)
++/* Read from the socket dealing with incomplete messages and signals.
++ * Returns 0 on success or errno on failure. Stderr fd passed as
++ * auxiliary data from other end is written to *errfd, or else stderr
++ * fileno if not present. */
++static apr_status_t sock_readhdr(int fd, int *errfd, void *vbuf, size_t buf_size)
+ {
+- char *buf = vbuf;
+ int rc;
++#ifndef HAVE_CGID_FDPASSING
++ char *buf = vbuf;
+ size_t bytes_read = 0;
+
++ if (errfd) *errfd = 0;
++
+ do {
+ do {
+ rc = read(fd, buf + bytes_read, buf_size - bytes_read);
+@@ -365,9 +369,52 @@
+ }
+ } while (bytes_read < buf_size);
+
++
++#else /* with FD passing */
++ struct msghdr msg = {0};
++ struct iovec vec = {vbuf, buf_size};
++ struct cmsghdr *cmsg;
++ union { /* union to ensure alignment */
++ struct cmsghdr cm;
++ char buf[CMSG_SPACE(sizeof(int))];
++ } u;
++
++ msg.msg_iov = &vec;
++ msg.msg_iovlen = 1;
++
++ msg.msg_control = u.buf;
++ msg.msg_controllen = sizeof(u.buf);
++
++ if (errfd) *errfd = 0;
++
++ /* use MSG_WAITALL to skip loop on truncated reads */
++ do {
++ rc = recvmsg(fd, &msg, MSG_WAITALL);
++ } while (rc < 0 && errno == EINTR);
++
++ if (rc == 0) {
++ return ECONNRESET;
++ }
++
++ cmsg = CMSG_FIRSTHDR(&msg);
++ if (errfd
++ && cmsg
++ && cmsg->cmsg_len == CMSG_LEN(sizeof(*errfd))
++ && cmsg->cmsg_level == SOL_SOCKET
++ && cmsg->cmsg_type == SCM_RIGHTS) {
++ *errfd = *((int *) CMSG_DATA(cmsg));
++ }
++#endif
++
+ return APR_SUCCESS;
+ }
+
++/* As sock_readhdr but without auxiliary fd passing. */
++static apr_status_t sock_read(int fd, void *vbuf, size_t buf_size)
++{
++ return sock_readhdr(fd, NULL, vbuf, buf_size);
++}
++
+ /* deal with signals
+ */
+ static apr_status_t sock_write(int fd, const void *buf, size_t buf_size)
+@@ -384,7 +431,7 @@
+ return APR_SUCCESS;
+ }
+
+-static apr_status_t sock_writev(int fd, request_rec *r, int count, ...)
++static apr_status_t sock_writev(int fd, int auxfd, request_rec *r, int count, ...)
+ {
+ va_list ap;
+ int rc;
+@@ -399,9 +446,39 @@
+ }
+ va_end(ap);
+
++#ifndef HAVE_CGID_FDPASSING
+ do {
+ rc = writev(fd, vec, count);
+ } while (rc < 0 && errno == EINTR);
++#else
++ {
++ struct msghdr msg = { 0 };
++ struct cmsghdr *cmsg;
++ union { /* union for alignment */
++ char buf[CMSG_SPACE(sizeof(int))];
++ struct cmsghdr align;
++ } u;
++
++ msg.msg_iov = vec;
++ msg.msg_iovlen = count;
++
++ if (auxfd) {
++ msg.msg_control = u.buf;
++ msg.msg_controllen = sizeof(u.buf);
++
++ cmsg = CMSG_FIRSTHDR(&msg);
++ cmsg->cmsg_level = SOL_SOCKET;
++ cmsg->cmsg_type = SCM_RIGHTS;
++ cmsg->cmsg_len = CMSG_LEN(sizeof(int));
++ *((int *) CMSG_DATA(cmsg)) = auxfd;
++ }
++
++ do {
++ rc = sendmsg(fd, &msg, 0);
++ } while (rc < 0 && errno == EINTR);
++ }
++#endif
++
+ if (rc < 0) {
+ return errno;
+ }
+@@ -410,7 +487,7 @@
+ }
+
+ static apr_status_t get_req(int fd, request_rec *r, char **argv0, char ***env,
+- cgid_req_t *req)
++ int *errfd, cgid_req_t *req)
+ {
+ int i;
+ char **environ;
+@@ -421,7 +498,7 @@
+ r->server = apr_pcalloc(r->pool, sizeof(server_rec));
+
+ /* read the request header */
+- stat = sock_read(fd, req, sizeof(*req));
++ stat = sock_readhdr(fd, errfd, req, sizeof(*req));
+ if (stat != APR_SUCCESS) {
+ return stat;
+ }
+@@ -479,14 +556,15 @@
+ return APR_SUCCESS;
+ }
+
+-static apr_status_t send_req(int fd, request_rec *r, char *argv0, char **env,
+- int req_type)
++static apr_status_t send_req(int fd, apr_file_t *errpipe, request_rec *r,
++ char *argv0, char **env, int req_type)
+ {
+ int i;
+ cgid_req_t req = {0};
+ apr_status_t stat;
+ ap_unix_identity_t * ugid = ap_run_get_suexec_identity(r);
+ core_dir_config *core_conf = ap_get_core_module_config(r->per_dir_config);
++ int errfd;
+
+
+ if (ugid == NULL) {
+@@ -507,16 +585,21 @@
+ req.args_len = r->args ? strlen(r->args) : 0;
+ req.loglevel = r->server->log.level;
+
++ if (errpipe)
++ apr_os_file_get(&errfd, errpipe);
++ else
++ errfd = 0;
++
+ /* Write the request header */
+ if (req.args_len) {
+- stat = sock_writev(fd, r, 5,
++ stat = sock_writev(fd, errfd, r, 5,
+ &req, sizeof(req),
+ r->filename, req.filename_len,
+ argv0, req.argv0_len,
+ r->uri, req.uri_len,
+ r->args, req.args_len);
+ } else {
+- stat = sock_writev(fd, r, 4,
++ stat = sock_writev(fd, errfd, r, 4,
+ &req, sizeof(req),
+ r->filename, req.filename_len,
+ argv0, req.argv0_len,
+@@ -531,7 +614,7 @@
+ for (i = 0; i < req.env_count; i++) {
+ apr_size_t curlen = strlen(env[i]);
+
+- if ((stat = sock_writev(fd, r, 2, &curlen, sizeof(curlen),
++ if ((stat = sock_writev(fd, 0, r, 2, &curlen, sizeof(curlen),
+ env[i], curlen)) != APR_SUCCESS) {
+ return stat;
+ }
+@@ -582,20 +665,34 @@
+ }
+ }
+
++/* Callback executed in the forked child process if exec of the CGI
++ * script fails. For the fd-passing case, output to stderr goes to
++ * the client (request handling thread) and is logged via
++ * ap_log_rerror there. For the non-fd-passing case, the "fake"
++ * request_rec passed via userdata is used to log. */
+ static void cgid_child_errfn(apr_pool_t *pool, apr_status_t err,
+ const char *description)
+ {
+- request_rec *r;
+ void *vr;
+
+ apr_pool_userdata_get(&vr, ERRFN_USERDATA_KEY, pool);
+- r = vr;
+-
+- /* sure we got r, but don't call ap_log_rerror() because we don't
+- * have r->headers_in and possibly other storage referenced by
+- * ap_log_rerror()
+- */
+- ap_log_error(APLOG_MARK, APLOG_ERR, err, r->server, APLOGNO(01241) "%s", description);
++ if (vr) {
++ request_rec *r = vr;
++
++ /* sure we got r, but don't call ap_log_rerror() because we don't
++ * have r->headers_in and possibly other storage referenced by
++ * ap_log_rerror()
++ */
++ ap_log_error(APLOG_MARK, APLOG_ERR, err, r->server, APLOGNO(01241) "%s", description);
++ }
++ else {
++ const char *logstr;
++
++ logstr = apr_psprintf(pool, APLOGNO(01241) "error spawning CGI child: %s (%pm)\n",
++ description, &err);
++ fputs(logstr, stderr);
++ fflush(stderr);
++ }
+ }
+
+ static int cgid_server(void *data)
+@@ -669,7 +766,7 @@
+ }
+
+ while (!daemon_should_exit) {
+- int errfileno = STDERR_FILENO;
++ int errfileno;
+ char *argv0 = NULL;
+ char **env = NULL;
+ const char * const *argv;
+@@ -709,7 +806,7 @@
+ r = apr_pcalloc(ptrans, sizeof(request_rec));
+ procnew = apr_pcalloc(ptrans, sizeof(*procnew));
+ r->pool = ptrans;
+- stat = get_req(sd2, r, &argv0, &env, &cgid_req);
++ stat = get_req(sd2, r, &argv0, &env, &errfileno, &cgid_req);
+ if (stat != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, stat,
+ main_server, APLOGNO(01248)
+@@ -741,6 +838,16 @@
+ continue;
+ }
+
++ if (errfileno == 0) {
++ errfileno = STDERR_FILENO;
++ }
++ else {
++ ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, main_server,
++ "using passed fd %d as stderr", errfileno);
++ /* Limit the received fd lifetime to pool lifetime */
++ apr_pool_cleanup_register(ptrans, (void *)((long)errfileno),
++ close_unix_socket, close_unix_socket);
++ }
+ apr_os_file_put(&r->server->error_log, &errfileno, 0, r->pool);
+ apr_os_file_put(&inout, &sd2, 0, r->pool);
+
+@@ -800,7 +907,10 @@
+ close(sd2);
+ }
+ else {
+- apr_pool_userdata_set(r, ERRFN_USERDATA_KEY, apr_pool_cleanup_null, ptrans);
++ if (errfileno == STDERR_FILENO) {
++ /* Used by cgid_child_errfn without fd-passing. */
++ apr_pool_userdata_set(r, ERRFN_USERDATA_KEY, apr_pool_cleanup_null, ptrans);
++ }
+
+ argv = (const char * const *)create_argv(r->pool, NULL, NULL, NULL, argv0, r->args);
+
+@@ -1099,6 +1209,33 @@
+ return ret;
+ }
+
++/* Soak up stderr from a script and redirect it to the error log.
++ * TODO: log_scripterror() and this could move to cgi_common.h. */
++static apr_status_t log_script_err(request_rec *r, apr_file_t *script_err)
++{
++ char argsbuffer[HUGE_STRING_LEN];
++ char *newline;
++ apr_status_t rv;
++ cgid_server_conf *conf = ap_get_module_config(r->server->module_config, &cgid_module);
++
++ while ((rv = apr_file_gets(argsbuffer, HUGE_STRING_LEN,
++ script_err)) == APR_SUCCESS) {
++
++ newline = strchr(argsbuffer, '\n');
++ if (newline) {
++ char *prev = newline - 1;
++ if (prev >= argsbuffer && *prev == '\r') {
++ newline = prev;
++ }
++
++ *newline = '\0';
++ }
++ log_scripterror(r, conf, r->status, 0, argsbuffer);
++ }
++
++ return rv;
++}
++
+ static int log_script(request_rec *r, cgid_server_conf * conf, int ret,
+ char *dbuf, const char *sbuf, apr_bucket_brigade *bb,
+ apr_file_t *script_err)
+@@ -1204,6 +1341,11 @@
+ return ret;
+ }
+
++#ifdef HAVE_CGID_FDPASSING
++/* Pull in CGI bucket implementation. */
++#include "cgi_common.h"
++#endif
++
+ static int connect_to_daemon(int *sdptr, request_rec *r,
+ cgid_server_conf *conf)
+ {
+@@ -1395,6 +1537,7 @@
+
+ static int cgid_handler(request_rec *r)
+ {
++ conn_rec *c = r->connection;
+ int retval, nph, dbpos;
+ char *argv0, *dbuf;
+ apr_bucket_brigade *bb;
+@@ -1404,10 +1547,11 @@
+ int seen_eos, child_stopped_reading;
+ int sd;
+ char **env;
+- apr_file_t *tempsock;
++ apr_file_t *tempsock, *script_err, *errpipe_out;
+ struct cleanup_script_info *info;
+ apr_status_t rv;
+ cgid_dirconf *dc;
++ apr_interval_time_t timeout;
+
+ if (strcmp(r->handler, CGI_MAGIC_TYPE) && strcmp(r->handler, "cgi-script")) {
+ return DECLINED;
+@@ -1416,7 +1560,7 @@
+ conf = ap_get_module_config(r->server->module_config, &cgid_module);
+ dc = ap_get_module_config(r->per_dir_config, &cgid_module);
+
+-
++ timeout = dc->timeout > 0 ? dc->timeout : r->server->timeout;
+ is_included = !strcmp(r->protocol, "INCLUDED");
+
+ if ((argv0 = strrchr(r->filename, '/')) != NULL) {
+@@ -1469,6 +1613,17 @@
+ }
+ */
+
++#ifdef HAVE_CGID_FDPASSING
++ rv = apr_file_pipe_create(&script_err, &errpipe_out, r->pool);
++ if (rv) {
++ return log_scripterror(r, conf, HTTP_SERVICE_UNAVAILABLE, rv, APLOGNO(10176)
++ "could not create pipe for stderr");
++ }
++#else
++ script_err = NULL;
++ errpipe_out = NULL;
++#endif
++
+ /*
+ * httpd core function used to add common environment variables like
+ * DOCUMENT_ROOT.
+@@ -1481,12 +1636,16 @@
+ return retval;
+ }
+
+- rv = send_req(sd, r, argv0, env, CGI_REQ);
++ rv = send_req(sd, errpipe_out, r, argv0, env, CGI_REQ);
+ if (rv != APR_SUCCESS) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01268)
+ "write to cgi daemon process");
+ }
+
++ /* The write-end of the pipe is only used by the server, so close
++ * it here. */
++ if (errpipe_out) apr_file_close(errpipe_out);
++
+ info = apr_palloc(r->pool, sizeof(struct cleanup_script_info));
+ info->conf = conf;
+ info->r = r;
+@@ -1508,12 +1667,7 @@
+ */
+
+ apr_os_pipe_put_ex(&tempsock, &sd, 1, r->pool);
+- if (dc->timeout > 0) {
+- apr_file_pipe_timeout_set(tempsock, dc->timeout);
+- }
+- else {
+- apr_file_pipe_timeout_set(tempsock, r->server->timeout);
+- }
++ apr_file_pipe_timeout_set(tempsock, timeout);
+ apr_pool_cleanup_kill(r->pool, (void *)((long)sd), close_unix_socket);
+
+ /* Transfer any put/post args, CERN style...
+@@ -1605,23 +1759,28 @@
+ */
+ shutdown(sd, 1);
+
++ bb = apr_brigade_create(r->pool, c->bucket_alloc);
++#ifdef HAVE_CGID_FDPASSING
++ b = cgi_bucket_create(r, dc->timeout, tempsock, script_err, c->bucket_alloc);
++ if (b == NULL)
++ return HTTP_INTERNAL_SERVER_ERROR; /* should call log_scripterror() w/ _UNAVAILABLE? */
++#else
++ b = apr_bucket_pipe_create(tempsock, c->bucket_alloc);
++#endif
++ APR_BRIGADE_INSERT_TAIL(bb, b);
++ b = apr_bucket_eos_create(c->bucket_alloc);
++ APR_BRIGADE_INSERT_TAIL(bb, b);
++
+ /* Handle script return... */
+ if (!nph) {
+- conn_rec *c = r->connection;
+ const char *location;
+ char sbuf[MAX_STRING_LEN];
+ int ret;
+
+- bb = apr_brigade_create(r->pool, c->bucket_alloc);
+- b = apr_bucket_pipe_create(tempsock, c->bucket_alloc);
+- APR_BRIGADE_INSERT_TAIL(bb, b);
+- b = apr_bucket_eos_create(c->bucket_alloc);
+- APR_BRIGADE_INSERT_TAIL(bb, b);
+-
+ if ((ret = ap_scan_script_header_err_brigade_ex(r, bb, sbuf,
+ APLOG_MODULE_INDEX)))
+ {
+- ret = log_script(r, conf, ret, dbuf, sbuf, bb, NULL);
++ ret = log_script(r, conf, ret, dbuf, sbuf, bb, script_err);
+
+ /*
+ * ret could be HTTP_NOT_MODIFIED in the case that the CGI script
+@@ -1658,6 +1817,11 @@
+ /* Soak up all the script output */
+ discard_script_output(bb);
+ apr_brigade_destroy(bb);
++ if (script_err) {
++ apr_file_pipe_timeout_set(script_err, timeout);
++ log_script_err(r, script_err);
++ }
++
+ /* This redirect needs to be a GET no matter what the original
+ * method was.
+ */
+@@ -1690,7 +1854,6 @@
+ }
+
+ if (nph) {
+- conn_rec *c = r->connection;
+ struct ap_filter_t *cur;
+
+ /* get rid of all filters up through protocol... since we
+@@ -1704,14 +1867,20 @@
+ }
+ r->output_filters = r->proto_output_filters = cur;
+
+- bb = apr_brigade_create(r->pool, c->bucket_alloc);
+- b = apr_bucket_pipe_create(tempsock, c->bucket_alloc);
+- APR_BRIGADE_INSERT_TAIL(bb, b);
+- b = apr_bucket_eos_create(c->bucket_alloc);
+- APR_BRIGADE_INSERT_TAIL(bb, b);
+- ap_pass_brigade(r->output_filters, bb);
++ rv = ap_pass_brigade(r->output_filters, bb);
+ }
+
++ /* don't soak up script output if errors occurred writing it
++ * out... otherwise, we prolong the life of the script when the
++ * connection drops or we stopped sending output for some other
++ * reason */
++ if (script_err && rv == APR_SUCCESS && !r->connection->aborted) {
++ apr_file_pipe_timeout_set(script_err, timeout);
++ log_script_err(r, script_err);
++ }
++
++ if (script_err) apr_file_close(script_err);
++
+ return OK; /* NOT r->status, even if it has changed. */
+ }
+
+@@ -1829,7 +1998,7 @@
+ return retval;
+ }
+
+- send_req(sd, r, command, env, SSI_REQ);
++ send_req(sd, NULL, r, command, env, SSI_REQ);
+
+ info = apr_palloc(r->pool, sizeof(struct cleanup_script_info));
+ info->conf = conf;
+--- httpd-2.4.37/modules/generators/config5.m4
++++ httpd-2.4.37/modules/generators/config5.m4
+@@ -78,4 +78,15 @@
+
+ APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
+
++AC_ARG_ENABLE(cgid-fdpassing,
++ [APACHE_HELP_STRING(--enable-cgid-fdpassing,Enable experimental mod_cgid support for fd passing)],
++ [if test "$enableval" = "yes"; then
++ AC_CHECK_DECL(CMSG_DATA,
++ [AC_DEFINE([HAVE_CGID_FDPASSING], 1, [Enable FD passing support in mod_cgid])],
++ [AC_MSG_ERROR([cannot support mod_cgid fd-passing on this system])], [
++#include
++#include ])
++ fi
++])
++
+ APACHE_MODPATH_FINISH
+--- httpd-2.4.37/modules/generators/cgi_common.h
++++ httpd-2.4.37/modules/generators/cgi_common.h
+@@ -0,0 +1,216 @@
++/* Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements. See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++#include "apr.h"
++#include "apr_strings.h"
++#include "apr_buckets.h"
++#include "apr_lib.h"
++#include "apr_poll.h"
++
++#define APR_WANT_STRFUNC
++#define APR_WANT_MEMFUNC
++#include "apr_want.h"
++
++#include "httpd.h"
++#include "util_filter.h"
++
++/* A CGI bucket type is needed to catch any output to stderr from the
++ * script; see PR 22030. */
++static const apr_bucket_type_t bucket_type_cgi;
++
++struct cgi_bucket_data {
++ apr_pollset_t *pollset;
++ request_rec *r;
++ apr_interval_time_t timeout;
++};
++
++/* Create a CGI bucket using pipes from script stdout 'out'
++ * and stderr 'err', for request 'r'. */
++static apr_bucket *cgi_bucket_create(request_rec *r,
++ apr_interval_time_t timeout,
++ apr_file_t *out, apr_file_t *err,
++ apr_bucket_alloc_t *list)
++{
++ apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
++ apr_status_t rv;
++ apr_pollfd_t fd;
++ struct cgi_bucket_data *data = apr_palloc(r->pool, sizeof *data);
++
++ APR_BUCKET_INIT(b);
++ b->free = apr_bucket_free;
++ b->list = list;
++ b->type = &bucket_type_cgi;
++ b->length = (apr_size_t)(-1);
++ b->start = -1;
++
++ /* Create the pollset */
++ rv = apr_pollset_create(&data->pollset, 2, r->pool, 0);
++ if (rv != APR_SUCCESS) {
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01217)
++ "apr_pollset_create(); check system or user limits");
++ return NULL;
++ }
++
++ fd.desc_type = APR_POLL_FILE;
++ fd.reqevents = APR_POLLIN;
++ fd.p = r->pool;
++ fd.desc.f = out; /* script's stdout */
++ fd.client_data = (void *)1;
++ rv = apr_pollset_add(data->pollset, &fd);
++ if (rv != APR_SUCCESS) {
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01218)
++ "apr_pollset_add(); check system or user limits");
++ return NULL;
++ }
++
++ fd.desc.f = err; /* script's stderr */
++ fd.client_data = (void *)2;
++ rv = apr_pollset_add(data->pollset, &fd);
++ if (rv != APR_SUCCESS) {
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01219)
++ "apr_pollset_add(); check system or user limits");
++ return NULL;
++ }
++
++ data->r = r;
++ data->timeout = timeout;
++ b->data = data;
++ return b;
++}
++
++/* Create a duplicate CGI bucket using given bucket data */
++static apr_bucket *cgi_bucket_dup(struct cgi_bucket_data *data,
++ apr_bucket_alloc_t *list)
++{
++ apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
++ APR_BUCKET_INIT(b);
++ b->free = apr_bucket_free;
++ b->list = list;
++ b->type = &bucket_type_cgi;
++ b->length = (apr_size_t)(-1);
++ b->start = -1;
++ b->data = data;
++ return b;
++}
++
++/* Handle stdout from CGI child. Duplicate of logic from the _read
++ * method of the real APR pipe bucket implementation. */
++static apr_status_t cgi_read_stdout(apr_bucket *a, apr_file_t *out,
++ const char **str, apr_size_t *len)
++{
++ char *buf;
++ apr_status_t rv;
++
++ *str = NULL;
++ *len = APR_BUCKET_BUFF_SIZE;
++ buf = apr_bucket_alloc(*len, a->list); /* XXX: check for failure? */
++
++ rv = apr_file_read(out, buf, len);
++
++ if (rv != APR_SUCCESS && rv != APR_EOF) {
++ apr_bucket_free(buf);
++ return rv;
++ }
++
++ if (*len > 0) {
++ struct cgi_bucket_data *data = a->data;
++ apr_bucket_heap *h;
++
++ /* Change the current bucket to refer to what we read */
++ a = apr_bucket_heap_make(a, buf, *len, apr_bucket_free);
++ h = a->data;
++ h->alloc_len = APR_BUCKET_BUFF_SIZE; /* note the real buffer size */
++ *str = buf;
++ APR_BUCKET_INSERT_AFTER(a, cgi_bucket_dup(data, a->list));
++ }
++ else {
++ apr_bucket_free(buf);
++ a = apr_bucket_immortal_make(a, "", 0);
++ *str = a->data;
++ }
++ return rv;
++}
++
++/* Read method of CGI bucket: polls on stderr and stdout of the child,
++ * sending any stderr output immediately away to the error log. */
++static apr_status_t cgi_bucket_read(apr_bucket *b, const char **str,
++ apr_size_t *len, apr_read_type_e block)
++{
++ struct cgi_bucket_data *data = b->data;
++ apr_interval_time_t timeout = 0;
++ apr_status_t rv;
++ int gotdata = 0;
++
++ if (block != APR_NONBLOCK_READ) {
++ timeout = data->timeout > 0 ? data->timeout : data->r->server->timeout;
++ }
++
++ do {
++ const apr_pollfd_t *results;
++ apr_int32_t num;
++
++ rv = apr_pollset_poll(data->pollset, timeout, &num, &results);
++ if (APR_STATUS_IS_TIMEUP(rv)) {
++ if (timeout) {
++ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, data->r, APLOGNO(01220)
++ "Timeout waiting for output from CGI script %s",
++ data->r->filename);
++ return rv;
++ }
++ else {
++ return APR_EAGAIN;
++ }
++ }
++ else if (APR_STATUS_IS_EINTR(rv)) {
++ continue;
++ }
++ else if (rv != APR_SUCCESS) {
++ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, data->r, APLOGNO(01221)
++ "poll failed waiting for CGI child");
++ return rv;
++ }
++
++ for (; num; num--, results++) {
++ if (results[0].client_data == (void *)1) {
++ /* stdout */
++ rv = cgi_read_stdout(b, results[0].desc.f, str, len);
++ if (APR_STATUS_IS_EOF(rv)) {
++ rv = APR_SUCCESS;
++ }
++ gotdata = 1;
++ } else {
++ /* stderr */
++ apr_status_t rv2 = log_script_err(data->r, results[0].desc.f);
++ if (APR_STATUS_IS_EOF(rv2)) {
++ apr_pollset_remove(data->pollset, &results[0]);
++ }
++ }
++ }
++
++ } while (!gotdata);
++
++ return rv;
++}
++
++static const apr_bucket_type_t bucket_type_cgi = {
++ "CGI", 5, APR_BUCKET_DATA,
++ apr_bucket_destroy_noop,
++ cgi_bucket_read,
++ apr_bucket_setaside_notimpl,
++ apr_bucket_split_notimpl,
++ apr_bucket_copy_notimpl
++};
++
diff --git a/httpd.spec b/httpd.spec
index 5fbcc76..98f5102 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 10%{?dist}
+Release: 11%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -77,6 +77,7 @@ Patch38: httpd-2.4.34-sslciphdefault.patch
Patch39: httpd-2.4.37-sslprotdefault.patch
Patch40: httpd-2.4.39-r1861269.patch
Patch41: httpd-2.4.37-r1861793+.patch
+Patch42: httpd-2.4.37-r1828172+.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -218,6 +219,7 @@ interface for storing and accessing per-user session data.
%patch39 -p1 -b .sslprotdefault
%patch40 -p1 -b .r1861269
%patch41 -p1 -b .r1861793+
+%patch42 -p1 -b .r1828172+
%patch58 -p1 -b .r1738878
%patch60 -p1 -b .enable-sslv3
@@ -316,6 +318,7 @@ export LYNX_PATH=/usr/bin/links
--enable-disk-cache \
--enable-ldap --enable-authnz-ldap \
--enable-cgid --enable-cgi \
+ --enable-cgid-fdpassing \
--enable-authn-anon --enable-authn-alias \
--disable-imagemap --disable-file-cache \
--disable-http2 \
@@ -743,6 +746,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Wed Jul 17 2019 Joe Orton - 2.4.39-11
+- mod_cgid: use fd passing to fix script stderr handling (#1591157)
+
* Mon Jul 8 2019 Joe Orton - 2.4.39-10
- htpasswd: add SHA-256/512 support
- apachectl: restore -V/-v/-t support (#1727434)
From fc0e844ce257850a310accba95d25b054f33bed3 Mon Sep 17 00:00:00 2001
From: Lubos Uhliarik
Date: Fri, 19 Jul 2019 11:28:20 +0200
Subject: [PATCH 049/231] - Remove pointless creation of /var/lib/httpd/state
dir in RPM build root - Substitute tabs for spaces.
---
httpd.spec | 47 +++++++++++++++++++++++------------------------
1 file changed, 23 insertions(+), 24 deletions(-)
diff --git a/httpd.spec b/httpd.spec
index 98f5102..b64a53e 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -276,7 +276,7 @@ autoheader && autoconf || exit 1
# Before configure; fix location of build dir in generated apxs
%{__perl} -pi -e "s:\@exp_installbuilddir\@:%{_libdir}/httpd/build:g" \
- support/apxs.in
+ support/apxs.in
export CFLAGS=$RPM_OPT_FLAGS
export LDFLAGS="-Wl,-z,relro,-z,now"
@@ -286,34 +286,34 @@ export LYNX_PATH=/usr/bin/links
# Build the daemon
./configure \
- --prefix=%{_sysconfdir}/httpd \
- --exec-prefix=%{_prefix} \
- --bindir=%{_bindir} \
- --sbindir=%{_sbindir} \
- --mandir=%{_mandir} \
- --libdir=%{_libdir} \
- --sysconfdir=%{_sysconfdir}/httpd/conf \
- --includedir=%{_includedir}/httpd \
- --libexecdir=%{_libdir}/httpd/modules \
- --datadir=%{contentdir} \
+ --prefix=%{_sysconfdir}/httpd \
+ --exec-prefix=%{_prefix} \
+ --bindir=%{_bindir} \
+ --sbindir=%{_sbindir} \
+ --mandir=%{_mandir} \
+ --libdir=%{_libdir} \
+ --sysconfdir=%{_sysconfdir}/httpd/conf \
+ --includedir=%{_includedir}/httpd \
+ --libexecdir=%{_libdir}/httpd/modules \
+ --datadir=%{contentdir} \
--enable-layout=Fedora \
--with-installbuilddir=%{_libdir}/httpd/build \
--enable-mpms-shared=all \
--with-apr=%{_prefix} --with-apr-util=%{_prefix} \
- --enable-suexec --with-suexec \
+ --enable-suexec --with-suexec \
--enable-suexec-capabilities \
- --with-suexec-caller=%{suexec_caller} \
- --with-suexec-docroot=%{docroot} \
- --without-suexec-logfile \
+ --with-suexec-caller=%{suexec_caller} \
+ --with-suexec-docroot=%{docroot} \
+ --without-suexec-logfile \
--with-suexec-syslog \
- --with-suexec-bin=%{_sbindir}/suexec \
- --with-suexec-uidmin=1000 --with-suexec-gidmin=1000 \
+ --with-suexec-bin=%{_sbindir}/suexec \
+ --with-suexec-uidmin=1000 --with-suexec-gidmin=1000 \
--with-brotli \
--enable-pie \
--with-pcre \
--enable-mods-shared=all \
- --enable-ssl --with-ssl --disable-distcache \
- --enable-proxy --enable-proxy-fdpass \
+ --enable-ssl --with-ssl --disable-distcache \
+ --enable-proxy --enable-proxy-fdpass \
--enable-cache \
--enable-disk-cache \
--enable-ldap --enable-authnz-ldap \
@@ -323,7 +323,7 @@ export LYNX_PATH=/usr/bin/links
--disable-imagemap --disable-file-cache \
--disable-http2 \
--disable-md \
- $*
+ $*
make %{?_smp_mflags}
%install
@@ -396,7 +396,6 @@ install -m 644 -p $RPM_SOURCE_DIR/httpd.tmpfiles \
# Other directories
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/dav \
- $RPM_BUILD_ROOT%{_localstatedir}/lib/httpd/state \
$RPM_BUILD_ROOT/run/httpd/htcacheclean
# Substitute in defaults which are usually done (badly) by "make install"
@@ -471,11 +470,11 @@ ln -s ../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT/etc/httpd/modules
# install http-ssl-pass-dialog
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
install -m755 $RPM_SOURCE_DIR/httpd-ssl-pass-dialog \
- $RPM_BUILD_ROOT%{_libexecdir}/httpd-ssl-pass-dialog
+ $RPM_BUILD_ROOT%{_libexecdir}/httpd-ssl-pass-dialog
# install http-ssl-gencerts
install -m755 $RPM_SOURCE_DIR/httpd-ssl-gencerts \
- $RPM_BUILD_ROOT%{_libexecdir}/httpd-ssl-gencerts
+ $RPM_BUILD_ROOT%{_libexecdir}/httpd-ssl-gencerts
# Install scripts
install -m 755 apachectl.sh $RPM_BUILD_ROOT%{_sbindir}/apachectl
@@ -489,7 +488,7 @@ done
# Install logrotate config
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
install -m 644 -p $RPM_SOURCE_DIR/httpd.logrotate \
- $RPM_BUILD_ROOT/etc/logrotate.d/httpd
+ $RPM_BUILD_ROOT/etc/logrotate.d/httpd
# Install man pages
install -d $RPM_BUILD_ROOT%{_mandir}/man8 $RPM_BUILD_ROOT%{_mandir}/man5
From 5586dfdc484bd6860eb6c46b6178318d17e5ea24 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Tue, 23 Jul 2019 10:41:39 +0100
Subject: [PATCH 050/231] drop /var/lib/dav directory, since mod_dav_fs uses
statedir
---
httpd.spec | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/httpd.spec b/httpd.spec
index b64a53e..82ff179 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 11%{?dist}
+Release: 12%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -395,12 +395,12 @@ install -m 644 -p $RPM_SOURCE_DIR/httpd.tmpfiles \
$RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d/httpd.conf
# Other directories
-mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/dav \
+mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/httpd \
$RPM_BUILD_ROOT/run/httpd/htcacheclean
# Substitute in defaults which are usually done (badly) by "make install"
sed -i \
- "s,@@ServerRoot@@/var,%{_localstatedir}/lib/dav,;
+ "/^DavLockDB/d;
s,@@ServerRoot@@/user.passwd,/etc/httpd/conf/user.passwd,;
s,@@ServerRoot@@/docs,%{docroot},;
s,@@ServerRoot@@,%{docroot},;
@@ -673,7 +673,6 @@ exit $rv
%attr(0710,root,apache) %dir /run/httpd
%attr(0700,apache,apache) %dir /run/httpd/htcacheclean
%attr(0700,root,root) %dir %{_localstatedir}/log/httpd
-%attr(0700,apache,apache) %dir %{_localstatedir}/lib/dav
%attr(0700,apache,apache) %dir %{_localstatedir}/lib/httpd
%attr(0700,apache,apache) %dir %{_localstatedir}/cache/httpd
%attr(0700,apache,apache) %dir %{_localstatedir}/cache/httpd/proxy
@@ -745,6 +744,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Tue Jul 23 2019 Joe Orton - 2.4.39-12
+- drop /var/lib/dav directory, since mod_dav_fs uses statedir
+
* Wed Jul 17 2019 Joe Orton - 2.4.39-11
- mod_cgid: use fd passing to fix script stderr handling (#1591157)
From 84b529bffa2507d21b32bf5a95f7cdec5c6e30ef Mon Sep 17 00:00:00 2001
From: Fedora Release Engineering
Date: Thu, 25 Jul 2019 08:38:22 +0000
Subject: [PATCH 051/231] - Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering
---
httpd.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/httpd.spec b/httpd.spec
index 82ff179..69c630c 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.39
-Release: 12%{?dist}
+Release: 13%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -744,6 +744,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Jul 25 2019 Fedora Release Engineering - 2.4.39-13
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
+
* Tue Jul 23 2019 Joe Orton - 2.4.39-12
- drop /var/lib/dav directory, since mod_dav_fs uses statedir
From 1578b453430d67328430007f0f1ddfffc0e83dfd Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Thu, 15 Aug 2019 06:44:03 +0100
Subject: [PATCH 052/231] update to 2.4.41
---
httpd-2.4.37-r1857129.patch | 65 ------------------------------------
httpd-2.4.37-r1861793+.patch | 4 +--
httpd-2.4.39-r1842929+.patch | 35 -------------------
httpd.spec | 10 +++---
sources | 2 +-
5 files changed, 8 insertions(+), 108 deletions(-)
delete mode 100644 httpd-2.4.37-r1857129.patch
diff --git a/httpd-2.4.37-r1857129.patch b/httpd-2.4.37-r1857129.patch
deleted file mode 100644
index 4dbf05a..0000000
--- a/httpd-2.4.37-r1857129.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-# ./pullrev.sh 1857129
-http://svn.apache.org/viewvc?view=revision&revision=1857129
-
---- httpd-2.4.37/modules/filters/mod_reqtimeout.c
-+++ httpd-2.4.37/modules/filters/mod_reqtimeout.c
-@@ -31,7 +31,7 @@
- #define UNSET -1
- #define MRT_DEFAULT_handshake_TIMEOUT 0 /* disabled */
- #define MRT_DEFAULT_handshake_MAX_TIMEOUT 0
--#define MRT_DEFAULT_handshake_MIN_RATE APR_INT32_MAX
-+#define MRT_DEFAULT_handshake_MIN_RATE 0
- #define MRT_DEFAULT_header_TIMEOUT 20
- #define MRT_DEFAULT_header_MAX_TIMEOUT 40
- #define MRT_DEFAULT_header_MIN_RATE 500
-@@ -220,7 +220,7 @@
- if (block == APR_NONBLOCK_READ || mode == AP_MODE_INIT
- || mode == AP_MODE_EATCRLF) {
- rv = ap_get_brigade(f->next, bb, mode, block, readbytes);
-- if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS) {
-+ if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS) {
- extend_timeout(ccfg, bb);
- }
- return rv;
-@@ -254,7 +254,7 @@
- }
-
- if (!APR_BRIGADE_EMPTY(bb)) {
-- if (ccfg->cur_stage.rate_factor > 0) {
-+ if (ccfg->cur_stage.rate_factor) {
- extend_timeout(ccfg, bb);
- }
-
-@@ -315,7 +315,7 @@
- * the real (relevant) bytes to be asked later, within the
- * currently alloted time.
- */
-- if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS
-+ if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS
- && mode != AP_MODE_SPECULATIVE) {
- extend_timeout(ccfg, bb);
- }
-@@ -638,17 +638,17 @@
- ap_hook_post_read_request(reqtimeout_before_body, NULL, NULL,
- APR_HOOK_MIDDLE);
-
--#if MRT_DEFAULT_HANDSHAKE_MIN_RATE > 0
-+#if MRT_DEFAULT_handshake_MIN_RATE
- default_handshake_rate_factor = apr_time_from_sec(1) /
-- MRT_DEFAULT_HANDSHAKE_MIN_RATE;
-+ MRT_DEFAULT_handshake_MIN_RATE;
- #endif
--#if MRT_DEFAULT_HEADER_MIN_RATE > 0
-+#if MRT_DEFAULT_header_MIN_RATE
- default_header_rate_factor = apr_time_from_sec(1) /
-- MRT_DEFAULT_HEADER_MIN_RATE;
-+ MRT_DEFAULT_header_MIN_RATE;
- #endif
--#if MRT_DEFAULT_BODY_MIN_RATE > 0
-+#if MRT_DEFAULT_body_MIN_RATE
- default_body_rate_factor = apr_time_from_sec(1) /
-- MRT_DEFAULT_BODY_MIN_RATE;
-+ MRT_DEFAULT_body_MIN_RATE;
- #endif
- }
-
diff --git a/httpd-2.4.37-r1861793+.patch b/httpd-2.4.37-r1861793+.patch
index c522c7c..22886e2 100644
--- a/httpd-2.4.37-r1861793+.patch
+++ b/httpd-2.4.37-r1861793+.patch
@@ -46,7 +46,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1862612
+ " -5 Force SHA-512 crypt() hash of the password (very secure)." NL
+ " -B Force bcrypt aencryption of the password (very secure)." NL
" -C Set the computing time used for the bcrypt algorithm" NL
- " (higher is more secure but slower, default: %d, valid: 4 to 31)." NL
+ " (higher is more secure but slower, default: %d, valid: 4 to 17)." NL
+ " -r Set the number of rounds used for the SHA-256, SHA-512 algorithms" NL
+ " (higher is more secure but slower, default: 5000)." NL
" -d Force CRYPT encryption of the password (8 chars max, insecure)." NL
@@ -237,7 +237,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1862612
.TP
@@ -79,11 +85,14 @@
\fB-C\fR
- This flag is only allowed in combination with \fB-B\fR (bcrypt encryption)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 31)\&.
+ This flag is only allowed in combination with \fB-B\fR (bcrypt encryption)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17)\&.
.TP
+\fB-r\fR
+This flag is only allowed in combination with \fB-2\fR or \fB-5\fR\&. It sets the number of hash rounds used for the SHA-2 algorithms (higher is more secure but slower; the default is 5,000)\&.
diff --git a/httpd-2.4.39-r1842929+.patch b/httpd-2.4.39-r1842929+.patch
index 9fea432..0bf7292 100644
--- a/httpd-2.4.39-r1842929+.patch
+++ b/httpd-2.4.39-r1842929+.patch
@@ -118,41 +118,6 @@ http://svn.apache.org/viewvc?view=revision&revision=1853631
dav_hook_gather_propsets(dav_fs_gather_propsets, NULL, NULL,
APR_HOOK_MIDDLE);
dav_hook_find_liveprop(dav_fs_find_liveprop, NULL, NULL, APR_HOOK_MIDDLE);
---- httpd-2.4.39/modules/md/mod_md_config.c.r1842929+
-+++ httpd-2.4.39/modules/md/mod_md_config.c
-@@ -54,10 +54,18 @@
-
- #define DEF_VAL (-1)
-
-+#ifndef MD_DEFAULT_BASE_DIR
-+#define MD_DEFAULT_BASE_DIR "md"
-+#endif
-+
- /* Default settings for the global conf */
- static md_mod_conf_t defmc = {
- NULL,
-- "md",
-+#if 1
-+ NULL, /* apply default state-dir-relative */
-+#else
-+ MD_DEFAULT_BASE_DIR,
-+#endif
- NULL,
- NULL,
- 80,
-@@ -864,6 +872,12 @@
- if (mc->hsts_max_age > 0) {
- mc->hsts_header = apr_psprintf(p, "max-age=%d", mc->hsts_max_age);
- }
-+
-+#if 1
-+ if (mc->base_dir == NULL) {
-+ mc->base_dir = ap_state_dir_relative(p, MD_DEFAULT_BASE_DIR);
-+ }
-+#endif
-
- return APR_SUCCESS;
- }
--- httpd-2.4.39/server/core.c.r1842929+
+++ httpd-2.4.39/server/core.c
@@ -129,6 +129,8 @@
diff --git a/httpd.spec b/httpd.spec
index 69c630c..ed18bf1 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -12,8 +12,8 @@
Summary: Apache HTTP Server
Name: httpd
-Version: 2.4.39
-Release: 13%{?dist}
+Version: 2.4.41
+Release: 1%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
@@ -83,8 +83,6 @@ Patch42: httpd-2.4.37-r1828172+.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
Patch58: httpd-2.4.34-r1738878.patch
Patch60: httpd-2.4.34-enable-sslv3.patch
-# https://bz.apache.org/bugzilla/show_bug.cgi?id=63325
-Patch61: httpd-2.4.37-r1857129.patch
# Security fixes
@@ -223,7 +221,6 @@ interface for storing and accessing per-user session data.
%patch58 -p1 -b .r1738878
%patch60 -p1 -b .enable-sslv3
-%patch61 -p1 -b .r1857129
# Patch in the vendor string
sed -i '/^#define PLATFORM/s/Unix/%{vstring}/' os/unix/os.h
@@ -744,6 +741,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Aug 15 2019 Joe Orton - 2.4.41-1
+- update to 2.4.41
+
* Thu Jul 25 2019 Fedora Release Engineering - 2.4.39-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
diff --git a/sources b/sources
index 248974a..c6aa939 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (httpd-2.4.39.tar.bz2) = 9742202040b3dc6344b301540f54b2d3f8e36898410d24206a7f8dcecb1bea7d7230fabc7256752724558af249facf64bffe2cf678b8f7cccb64076737abfda7
+SHA512 (httpd-2.4.41.tar.bz2) = 350cc7dcd2c439e0590338fa6da3f44df44f9bb885c381e91f91b14c2f48597f6f0bbac0ea118a8a67eaa70ae7edbb769beace368643ed73f6daee44c307b335
From 8c08392f60a8d4651bb53b8f83cd024fb90c9653 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher
Date: Tue, 14 May 2019 10:55:19 -0400
Subject: [PATCH 053/231] Use testpage from system-logos-httpd for proper
branding
Signed-off-by: Stephen Gallagher
---
httpd.spec | 10 ++--
index.html | 132 ---------------------------------------------------
welcome.conf | 1 +
3 files changed, 7 insertions(+), 136 deletions(-)
delete mode 100644 index.html
diff --git a/httpd.spec b/httpd.spec
index ed18bf1..043b593 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,10 +13,9 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.41
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
-Source1: index.html
Source2: httpd.logrotate
Source3: instance.conf
Source4: httpd-ssl-pass-dialog
@@ -428,8 +427,8 @@ EOF
# Handle contentdir
mkdir $RPM_BUILD_ROOT%{contentdir}/noindex \
$RPM_BUILD_ROOT%{contentdir}/server-status
-install -m 644 -p $RPM_SOURCE_DIR/index.html \
- $RPM_BUILD_ROOT%{contentdir}/noindex/index.html
+ln -s ../../fedora-testpage/index.html \
+ $RPM_BUILD_ROOT%{contentdir}/noindex/index.html
install -m 644 -p docs/server-status/* \
$RPM_BUILD_ROOT%{contentdir}/server-status
rm -rf %{contentdir}/htdocs
@@ -741,6 +740,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Sep 19 2019 Stephen Gallagher - 2.4.41-2
+- Use testpage from system-logos-httpd for proper branding
+
* Thu Aug 15 2019 Joe Orton - 2.4.41-1
- update to 2.4.41
diff --git a/index.html b/index.html
deleted file mode 100644
index 1b7ea03..0000000
--- a/index.html
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-
- Test Page for the Apache HTTP Server on Fedora
-
-
-
-
-
-
Fedora Test Page
-
-
-
-
This page is used to test the proper operation of the Apache HTTP server after it has been installed. If you can read this page, it means that the web server installed at this site is working properly, but has not yet been configured.
-
-
-
-
-
-
If you are a member of the general public:
-
-
The fact that you are seeing this page indicates that the website you just visited is either experiencing problems, or is undergoing routine maintenance.
-
-
If you would like to let the administrators of this website know that you've seen this page instead of the page you expected, you should send them e-mail. In general, mail sent to the name "webmaster" and directed to the website's domain should reach the appropriate person.
-
-
For example, if you experienced problems while visiting www.example.com, you should send e-mail to "webmaster@example.com".
-
-
Fedora is a distribution of Linux, a popular computer operating system. It is commonly used by hosting companies because it is free, and includes free web server software. Many times, they do not set up their web server correctly, and it displays this "test page" instead of the expected website.
-
-
Accordingly, please keep these facts in mind:
-
-
Neither the Fedora Project or Red Hat has any affiliation with any website or content hosted from this server (unless otherwise explicitly stated).
-
Neither the Fedora Project or Red Hat has "hacked" this webserver, this test page is an included component of Apache's httpd webserver software.
You may now add content to the directory /var/www/html/. Note that until you do so, people visiting your website will see this page, and not your content. To prevent this page from ever being used, follow the instructions in the file /etc/httpd/conf.d/welcome.conf.
-
-
-
You are free to use the images below on Apache and Fedora powered HTTP servers. Thanks for using Apache and Fedora!
-
-
-
-
-
-
-
-
diff --git a/welcome.conf b/welcome.conf
index 5d1e452..b279c2f 100644
--- a/welcome.conf
+++ b/welcome.conf
@@ -16,3 +16,4 @@
Alias /.noindex.html /usr/share/httpd/noindex/index.html
+Alias /poweredby.png /usr/share/httpd/icons/apache_pb2.png
From a4638c111cab87559dceecc46dc883164ef51375 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Wed, 25 Sep 2019 15:23:20 +0100
Subject: [PATCH 054/231] mod_ssl: restore dependency on /usr/bin/hostname
(#1135118) Resolves: rhbz#1135118
---
httpd.spec | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/httpd.spec b/httpd.spec
index 043b593..416a207 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.41
-Release: 2%{?dist}
+Release: 3%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source2: httpd.logrotate
@@ -157,7 +157,7 @@ Epoch: 1
BuildRequires: openssl-devel
Requires(pre): httpd-filesystem
Requires: httpd = 0:%{version}-%{release}, httpd-mmn = %{mmnisa}
-Requires: sscg >= 2.2.0
+Requires: sscg >= 2.2.0, /usr/bin/hostname
# Require an OpenSSL which supports PROFILE=SYSTEM
Conflicts: openssl-libs < 1:1.0.1h-4
@@ -740,6 +740,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Wed Sep 25 2019 Joe Orton - 2.4.41-3
+- mod_ssl: restore dependency on /usr/bin/hostname (#1135118)
+
* Thu Sep 19 2019 Stephen Gallagher - 2.4.41-2
- Use testpage from system-logos-httpd for proper branding
From 5b6bedca6c8618b5f40c887c01399f5592d154e0 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Wed, 2 Oct 2019 11:47:35 +0100
Subject: [PATCH 055/231] mod_cgid: possible stdout timeout handling fix
(#1757683) Resolves: rhbz#1757683
---
...172+.patch => httpd-2.4.41-r1828172+.patch | 115 ++++++++++--------
httpd.spec | 7 +-
pullrev.sh | 4 +-
3 files changed, 73 insertions(+), 53 deletions(-)
rename httpd-2.4.37-r1828172+.patch => httpd-2.4.41-r1828172+.patch (94%)
diff --git a/httpd-2.4.37-r1828172+.patch b/httpd-2.4.41-r1828172+.patch
similarity index 94%
rename from httpd-2.4.37-r1828172+.patch
rename to httpd-2.4.41-r1828172+.patch
index 822cccf..534acef 100644
--- a/httpd-2.4.37-r1828172+.patch
+++ b/httpd-2.4.41-r1828172+.patch
@@ -1,10 +1,12 @@
-# ./pullrev.sh 1828172 1862968 1863191
+# ./pullrev.sh 1828172 1862968 1863191 1867878 1867882
http://svn.apache.org/viewvc?view=revision&revision=1828172
http://svn.apache.org/viewvc?view=revision&revision=1862968
http://svn.apache.org/viewvc?view=revision&revision=1863191
+http://svn.apache.org/viewvc?view=revision&revision=1867878
+http://svn.apache.org/viewvc?view=revision&revision=1867882
---- httpd-2.4.37/modules/generators/mod_cgi.c
-+++ httpd-2.4.37/modules/generators/mod_cgi.c
+--- httpd-2.4.41/modules/generators/mod_cgi.c
++++ httpd-2.4.41/modules/generators/mod_cgi.c
@@ -92,6 +92,10 @@
apr_size_t bufbytes;
} cgi_server_conf;
@@ -287,16 +289,19 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
if (strcmp(r->handler, CGI_MAGIC_TYPE) && strcmp(r->handler, "cgi-script")) {
return DECLINED;
-@@ -928,7 +775,7 @@
- apr_file_pipe_timeout_set(script_in, 0);
- apr_file_pipe_timeout_set(script_err, 0);
+@@ -925,10 +772,7 @@
+ AP_DEBUG_ASSERT(script_in != NULL);
+ #if APR_FILES_AS_SOCKETS
+- apr_file_pipe_timeout_set(script_in, 0);
+- apr_file_pipe_timeout_set(script_err, 0);
+-
- b = cgi_bucket_create(r, script_in, script_err, c->bucket_alloc);
+ b = cgi_bucket_create(r, dc->timeout, script_in, script_err, c->bucket_alloc);
if (b == NULL)
return HTTP_INTERNAL_SERVER_ERROR;
#else
-@@ -985,7 +832,7 @@
+@@ -985,7 +829,7 @@
* stderr output, as normal. */
discard_script_output(bb);
apr_brigade_destroy(bb);
@@ -305,7 +310,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
log_script_err(r, script_err);
}
-@@ -1036,7 +883,7 @@
+@@ -1036,7 +880,7 @@
* connection drops or we stopped sending output for some other
* reason */
if (rv == APR_SUCCESS && !r->connection->aborted) {
@@ -314,7 +319,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
log_script_err(r, script_err);
}
-@@ -1277,7 +1124,7 @@
+@@ -1277,7 +1121,7 @@
AP_DECLARE_MODULE(cgi) =
{
STANDARD20_MODULE_STUFF,
@@ -323,8 +328,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
NULL, /* dir merger --- default is to override */
create_cgi_config, /* server config */
merge_cgi_config, /* merge server config */
---- httpd-2.4.37/modules/generators/mod_cgid.c
-+++ httpd-2.4.37/modules/generators/mod_cgid.c
+--- httpd-2.4.41/modules/generators/mod_cgid.c
++++ httpd-2.4.41/modules/generators/mod_cgid.c
@@ -342,15 +342,19 @@
return close(fd);
}
@@ -350,7 +355,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
do {
do {
rc = read(fd, buf + bytes_read, buf_size - bytes_read);
-@@ -365,9 +369,52 @@
+@@ -365,9 +369,60 @@
}
} while (bytes_read < buf_size);
@@ -366,11 +371,12 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
+
+ msg.msg_iov = &vec;
+ msg.msg_iovlen = 1;
-+
-+ msg.msg_control = u.buf;
-+ msg.msg_controllen = sizeof(u.buf);
+
-+ if (errfd) *errfd = 0;
++ if (errfd) {
++ msg.msg_control = u.buf;
++ msg.msg_controllen = sizeof(u.buf);
++ *errfd = 0;
++ }
+
+ /* use MSG_WAITALL to skip loop on truncated reads */
+ do {
@@ -380,10 +386,17 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
+ if (rc == 0) {
+ return ECONNRESET;
+ }
-+
-+ cmsg = CMSG_FIRSTHDR(&msg);
++ else if (rc < 0) {
++ return errno;
++ }
++ else if (rc != buf_size) {
++ /* MSG_WAITALL should ensure the recvmsg blocks until the
++ * entire length is read, but let's be paranoid. */
++ return APR_INCOMPLETE;
++ }
++
+ if (errfd
-+ && cmsg
++ && (cmsg = CMSG_FIRSTHDR(&msg)) != NULL
+ && cmsg->cmsg_len == CMSG_LEN(sizeof(*errfd))
+ && cmsg->cmsg_level == SOL_SOCKET
+ && cmsg->cmsg_type == SCM_RIGHTS) {
@@ -403,7 +416,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
/* deal with signals
*/
static apr_status_t sock_write(int fd, const void *buf, size_t buf_size)
-@@ -384,7 +431,7 @@
+@@ -384,7 +439,7 @@
return APR_SUCCESS;
}
@@ -412,7 +425,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
{
va_list ap;
int rc;
-@@ -399,9 +446,39 @@
+@@ -399,9 +454,39 @@
}
va_end(ap);
@@ -452,7 +465,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
if (rc < 0) {
return errno;
}
-@@ -410,7 +487,7 @@
+@@ -410,7 +495,7 @@
}
static apr_status_t get_req(int fd, request_rec *r, char **argv0, char ***env,
@@ -461,7 +474,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
{
int i;
char **environ;
-@@ -421,7 +498,7 @@
+@@ -421,7 +506,7 @@
r->server = apr_pcalloc(r->pool, sizeof(server_rec));
/* read the request header */
@@ -470,7 +483,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
if (stat != APR_SUCCESS) {
return stat;
}
-@@ -479,14 +556,15 @@
+@@ -479,14 +564,15 @@
return APR_SUCCESS;
}
@@ -488,7 +501,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
if (ugid == NULL) {
-@@ -507,16 +585,21 @@
+@@ -507,16 +593,21 @@
req.args_len = r->args ? strlen(r->args) : 0;
req.loglevel = r->server->log.level;
@@ -512,7 +525,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
&req, sizeof(req),
r->filename, req.filename_len,
argv0, req.argv0_len,
-@@ -531,7 +614,7 @@
+@@ -531,7 +622,7 @@
for (i = 0; i < req.env_count; i++) {
apr_size_t curlen = strlen(env[i]);
@@ -521,7 +534,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
env[i], curlen)) != APR_SUCCESS) {
return stat;
}
-@@ -582,20 +665,34 @@
+@@ -582,20 +673,34 @@
}
}
@@ -564,7 +577,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
}
static int cgid_server(void *data)
-@@ -669,7 +766,7 @@
+@@ -669,7 +774,7 @@
}
while (!daemon_should_exit) {
@@ -573,7 +586,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
char *argv0 = NULL;
char **env = NULL;
const char * const *argv;
-@@ -709,7 +806,7 @@
+@@ -709,7 +814,7 @@
r = apr_pcalloc(ptrans, sizeof(request_rec));
procnew = apr_pcalloc(ptrans, sizeof(*procnew));
r->pool = ptrans;
@@ -582,7 +595,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
if (stat != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, stat,
main_server, APLOGNO(01248)
-@@ -741,6 +838,16 @@
+@@ -741,6 +846,16 @@
continue;
}
@@ -599,7 +612,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
apr_os_file_put(&r->server->error_log, &errfileno, 0, r->pool);
apr_os_file_put(&inout, &sd2, 0, r->pool);
-@@ -800,7 +907,10 @@
+@@ -800,7 +915,10 @@
close(sd2);
}
else {
@@ -611,7 +624,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
argv = (const char * const *)create_argv(r->pool, NULL, NULL, NULL, argv0, r->args);
-@@ -1099,6 +1209,33 @@
+@@ -1099,6 +1217,33 @@
return ret;
}
@@ -645,7 +658,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
static int log_script(request_rec *r, cgid_server_conf * conf, int ret,
char *dbuf, const char *sbuf, apr_bucket_brigade *bb,
apr_file_t *script_err)
-@@ -1204,6 +1341,11 @@
+@@ -1204,6 +1349,11 @@
return ret;
}
@@ -657,7 +670,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
static int connect_to_daemon(int *sdptr, request_rec *r,
cgid_server_conf *conf)
{
-@@ -1395,6 +1537,7 @@
+@@ -1395,6 +1545,7 @@
static int cgid_handler(request_rec *r)
{
@@ -665,7 +678,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
int retval, nph, dbpos;
char *argv0, *dbuf;
apr_bucket_brigade *bb;
-@@ -1404,10 +1547,11 @@
+@@ -1404,10 +1555,11 @@
int seen_eos, child_stopped_reading;
int sd;
char **env;
@@ -678,7 +691,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
if (strcmp(r->handler, CGI_MAGIC_TYPE) && strcmp(r->handler, "cgi-script")) {
return DECLINED;
-@@ -1416,7 +1560,7 @@
+@@ -1416,7 +1568,7 @@
conf = ap_get_module_config(r->server->module_config, &cgid_module);
dc = ap_get_module_config(r->per_dir_config, &cgid_module);
@@ -687,7 +700,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
is_included = !strcmp(r->protocol, "INCLUDED");
if ((argv0 = strrchr(r->filename, '/')) != NULL) {
-@@ -1469,6 +1613,17 @@
+@@ -1469,6 +1621,17 @@
}
*/
@@ -705,7 +718,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
/*
* httpd core function used to add common environment variables like
* DOCUMENT_ROOT.
-@@ -1481,12 +1636,16 @@
+@@ -1481,12 +1644,16 @@
return retval;
}
@@ -723,7 +736,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
info = apr_palloc(r->pool, sizeof(struct cleanup_script_info));
info->conf = conf;
info->r = r;
-@@ -1508,12 +1667,7 @@
+@@ -1508,12 +1675,7 @@
*/
apr_os_pipe_put_ex(&tempsock, &sd, 1, r->pool);
@@ -737,7 +750,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
apr_pool_cleanup_kill(r->pool, (void *)((long)sd), close_unix_socket);
/* Transfer any put/post args, CERN style...
-@@ -1605,23 +1759,28 @@
+@@ -1605,23 +1767,28 @@
*/
shutdown(sd, 1);
@@ -774,7 +787,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
/*
* ret could be HTTP_NOT_MODIFIED in the case that the CGI script
-@@ -1658,6 +1817,11 @@
+@@ -1658,6 +1825,11 @@
/* Soak up all the script output */
discard_script_output(bb);
apr_brigade_destroy(bb);
@@ -786,7 +799,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
/* This redirect needs to be a GET no matter what the original
* method was.
*/
-@@ -1690,7 +1854,6 @@
+@@ -1690,7 +1862,6 @@
}
if (nph) {
@@ -794,7 +807,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
struct ap_filter_t *cur;
/* get rid of all filters up through protocol... since we
-@@ -1704,14 +1867,20 @@
+@@ -1704,14 +1875,20 @@
}
r->output_filters = r->proto_output_filters = cur;
@@ -821,7 +834,7 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
return OK; /* NOT r->status, even if it has changed. */
}
-@@ -1829,7 +1998,7 @@
+@@ -1829,7 +2006,7 @@
return retval;
}
@@ -830,8 +843,8 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
info = apr_palloc(r->pool, sizeof(struct cleanup_script_info));
info->conf = conf;
---- httpd-2.4.37/modules/generators/config5.m4
-+++ httpd-2.4.37/modules/generators/config5.m4
+--- httpd-2.4.41/modules/generators/config5.m4
++++ httpd-2.4.41/modules/generators/config5.m4
@@ -78,4 +78,15 @@
APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
@@ -848,9 +861,9 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
+])
+
APACHE_MODPATH_FINISH
---- httpd-2.4.37/modules/generators/cgi_common.h
-+++ httpd-2.4.37/modules/generators/cgi_common.h
-@@ -0,0 +1,216 @@
+--- httpd-2.4.41/modules/generators/cgi_common.h
++++ httpd-2.4.41/modules/generators/cgi_common.h
+@@ -0,0 +1,220 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
@@ -902,6 +915,10 @@ http://svn.apache.org/viewvc?view=revision&revision=1863191
+ apr_pollfd_t fd;
+ struct cgi_bucket_data *data = apr_palloc(r->pool, sizeof *data);
+
++ /* Disable APR timeout handling since we'll use poll() entirely. */
++ apr_file_pipe_timeout_set(out, 0);
++ apr_file_pipe_timeout_set(err, 0);
++
+ APR_BUCKET_INIT(b);
+ b->free = apr_bucket_free;
+ b->list = list;
diff --git a/httpd.spec b/httpd.spec
index 416a207..06fe8c5 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.41
-Release: 3%{?dist}
+Release: 4%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source2: httpd.logrotate
@@ -76,7 +76,7 @@ Patch38: httpd-2.4.34-sslciphdefault.patch
Patch39: httpd-2.4.37-sslprotdefault.patch
Patch40: httpd-2.4.39-r1861269.patch
Patch41: httpd-2.4.37-r1861793+.patch
-Patch42: httpd-2.4.37-r1828172+.patch
+Patch42: httpd-2.4.41-r1828172+.patch
# Bug fixes
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
@@ -740,6 +740,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Wed Oct 2 2019 Joe Orton - 2.4.41-4
+- mod_cgid: possible stdout timeout handling fix (#1757683)
+
* Wed Sep 25 2019 Joe Orton - 2.4.41-3
- mod_ssl: restore dependency on /usr/bin/hostname (#1135118)
diff --git a/pullrev.sh b/pullrev.sh
index 5494c7e..efe221f 100755
--- a/pullrev.sh
+++ b/pullrev.sh
@@ -7,7 +7,7 @@ fi
repo="https://svn.apache.org/repos/asf/httpd/httpd/trunk"
#repo="https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x"
-ver=2.4.37
+ver=2.4.41
prefix="httpd-${ver}"
suffix="r$1${2:++}"
fn="${prefix}-${suffix}.patch"
@@ -36,7 +36,7 @@ for r in $*; do
echo "+ fetching ${r}"
this=`mktemp /tmp/pullrevXXXXXX`
svn diff -c ${r} ${repo} | filterdiff --remove-timestamps --clean -x 'CHANGES' -x '*/next-number' -x 'STATUS' \
- --addprefix="${prefix}/" > ${this}
+ -x '*.xml' --addprefix="${prefix}/" > ${this}
next=`mktemp /tmp/pullrevXXXXXX`
combinediff --quiet ${prev} ${this} > ${next}
rm -f "${this}"
From f1280d5f56f726ae20ad766d80dc62fffe5a606c Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Thu, 3 Oct 2019 09:06:46 +0100
Subject: [PATCH 056/231] mod_proxy_balancer: fix balancer-manager XSRF check
(PR 63688)
---
httpd-2.4.41-r1865749.patch | 14 ++++++++++++++
httpd.spec | 7 ++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 httpd-2.4.41-r1865749.patch
diff --git a/httpd-2.4.41-r1865749.patch b/httpd-2.4.41-r1865749.patch
new file mode 100644
index 0000000..d79a559
--- /dev/null
+++ b/httpd-2.4.41-r1865749.patch
@@ -0,0 +1,14 @@
+# ./pullrev.sh 1865749
+http://svn.apache.org/viewvc?view=revision&revision=1865749
+
+--- httpd-2.4.41/modules/proxy/mod_proxy_balancer.c.r1865749
++++ httpd-2.4.41/modules/proxy/mod_proxy_balancer.c
+@@ -1104,7 +1104,7 @@
+ if (apr_uri_parse(r->pool, ref, &uri) || !uri.hostname)
+ return 0;
+
+- return strcmp(uri.hostname, ap_get_server_name(r)) == 0;
++ return strcasecmp(uri.hostname, ap_get_server_name(r)) == 0;
+ }
+
+ /* Manages the loadfactors and member status
diff --git a/httpd.spec b/httpd.spec
index 06fe8c5..55a783d 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -13,7 +13,7 @@
Summary: Apache HTTP Server
Name: httpd
Version: 2.4.41
-Release: 4%{?dist}
+Release: 5%{?dist}
URL: https://httpd.apache.org/
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source2: httpd.logrotate
@@ -82,6 +82,7 @@ Patch42: httpd-2.4.41-r1828172+.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
Patch58: httpd-2.4.34-r1738878.patch
Patch60: httpd-2.4.34-enable-sslv3.patch
+Patch61: httpd-2.4.41-r1865749.patch
# Security fixes
@@ -220,6 +221,7 @@ interface for storing and accessing per-user session data.
%patch58 -p1 -b .r1738878
%patch60 -p1 -b .enable-sslv3
+%patch61 -p1 -b .r1865749
# Patch in the vendor string
sed -i '/^#define PLATFORM/s/Unix/%{vstring}/' os/unix/os.h
@@ -740,6 +742,9 @@ exit $rv
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
+* Thu Oct 3 2019 Joe Orton - 2.4.41-5
+- mod_proxy_balancer: fix balancer-manager XSRF check (PR 63688)
+
* Wed Oct 2 2019 Joe Orton - 2.4.41-4
- mod_cgid: possible stdout timeout handling fix (#1757683)
From 5f6c5adf6f8ba549061650f73ec554c9e6d23d53 Mon Sep 17 00:00:00 2001
From: Joe Orton
Date: Thu, 3 Oct 2019 09:10:23 +0100
Subject: [PATCH 057/231] Remove suexec patch already merged upstream.
---
httpd-2.4.4-r1337344+.patch | 250 ------------------------------------
httpd.spec | 2 -
2 files changed, 252 deletions(-)
delete mode 100644 httpd-2.4.4-r1337344+.patch
diff --git a/httpd-2.4.4-r1337344+.patch b/httpd-2.4.4-r1337344+.patch
deleted file mode 100644
index 6e5c3e7..0000000
--- a/httpd-2.4.4-r1337344+.patch
+++ /dev/null
@@ -1,250 +0,0 @@
-# ./pullrev.sh 1337344 1341905 1342065 1341930
-
-suexec enhancements:
-
-1) use syslog for logging
-2) use capabilities not setuid/setgid root binary
-
-http://svn.apache.org/viewvc?view=revision&revision=1337344
-http://svn.apache.org/viewvc?view=revision&revision=1341905
-http://svn.apache.org/viewvc?view=revision&revision=1342065
-http://svn.apache.org/viewvc?view=revision&revision=1341930
-
---- httpd-2.4.4/configure.in.r1337344+
-+++ httpd-2.4.4/configure.in
-@@ -734,7 +734,24 @@ APACHE_HELP_STRING(--with-suexec-gidmin,
-
- AC_ARG_WITH(suexec-logfile,
- APACHE_HELP_STRING(--with-suexec-logfile,Set the logfile),[
-- AC_DEFINE_UNQUOTED(AP_LOG_EXEC, "$withval", [SuExec log file] ) ] )
-+ if test "x$withval" = "xyes"; then
-+ AC_DEFINE_UNQUOTED(AP_LOG_EXEC, "$withval", [SuExec log file])
-+ fi
-+])
-+
-+AC_ARG_WITH(suexec-syslog,
-+APACHE_HELP_STRING(--with-suexec-syslog,Set the logfile),[
-+ if test $withval = "yes"; then
-+ if test "x${with_suexec_logfile}" != "xno"; then
-+ AC_MSG_NOTICE([hint: use "--without-suexec-logfile --with-suexec-syslog"])
-+ AC_MSG_ERROR([suexec does not support both logging to file and syslog])
-+ fi
-+ AC_CHECK_FUNCS([vsyslog], [], [
-+ AC_MSG_ERROR([cannot support syslog from suexec without vsyslog()])])
-+ AC_DEFINE(AP_LOG_SYSLOG, 1, [SuExec log to syslog])
-+ fi
-+])
-+
-
- AC_ARG_WITH(suexec-safepath,
- APACHE_HELP_STRING(--with-suexec-safepath,Set the safepath),[
-@@ -744,6 +761,15 @@ AC_ARG_WITH(suexec-umask,
- APACHE_HELP_STRING(--with-suexec-umask,umask for suexec'd process),[
- AC_DEFINE_UNQUOTED(AP_SUEXEC_UMASK, 0$withval, [umask for suexec'd process] ) ] )
-
-+INSTALL_SUEXEC=setuid
-+AC_ARG_ENABLE([suexec-capabilities],
-+APACHE_HELP_STRING(--enable-suexec-capabilities,Use Linux capability bits not setuid root suexec), [
-+INSTALL_SUEXEC=caps
-+AC_DEFINE(AP_SUEXEC_CAPABILITIES, 1,
-+ [Enable if suexec is installed with Linux capabilities, not setuid])
-+])
-+APACHE_SUBST(INSTALL_SUEXEC)
-+
- dnl APR should go after the other libs, so the right symbols can be picked up
- if test x${apu_found} != xobsolete; then
- AP_LIBS="$AP_LIBS `$apu_config --avoid-ldap --link-libtool`"
---- httpd-2.4.4/docs/manual/suexec.html.en.r1337344+
-+++ httpd-2.4.4/docs/manual/suexec.html.en
-@@ -372,6 +372,21 @@
- together with the --enable-suexec option to let
- APACI accept your request for using the suEXEC feature.
-
-+
--enable-suexec-capabilities
-+
-+
Linux specific: Normally,
-+ the suexec binary is installed "setuid/setgid
-+ root", which allows it to run with the full privileges of the
-+ root user. If this option is used, the suexec
-+ binary will instead be installed with only the setuid/setgid
-+ "capability" bits set, which is the subset of full root
-+ priviliges required for suexec operation. Note that
-+ the suexec binary may not be able to write to a log
-+ file in this mode; it is recommended that the
-+ --with-suexec-syslog --without-suexec-logfile
-+ options are used in conjunction with this mode, so that syslog
-+ logging is used instead.
-+
-
--with-suexec-bin=PATH
-
-
The path to the suexec binary must be hard-coded
-@@ -433,6 +448,12 @@
- "suexec_log" and located in your standard logfile
- directory (--logfiledir).
-
-+
--with-suexec-syslog
-+
-+
If defined, suexec will log notices and errors to syslog
-+ instead of a logfile. This option must be combined
-+ with --without-suexec-logfile.
-+
-
--with-suexec-safepath=PATH
-
-
Define a safe PATH environment to pass to CGI
-@@ -550,9 +571,12 @@ Group webgroup
-
-
The suEXEC wrapper will write log information
- to the file defined with the --with-suexec-logfile
-- option as indicated above. If you feel you have configured and
-- installed the wrapper properly, have a look at this log and the
-- error_log for the server to see where you may have gone astray.
-+ option as indicated above, or to syslog if --with-suexec-syslog
-+ is used. If you feel you have configured and
-+ installed the wrapper properly, have a look at the log and the
-+ error_log for the server to see where you may have gone astray.
-+ The output of "suexec -V" will show the options
-+ used to compile suexec, if using a binary distribution.