From ea817f3fa1102577ae8dbf0cb4a4cc4f947146b9 Mon Sep 17 00:00:00 2001 From: Pacho Ramos Date: Sat, 9 May 2015 11:55:20 +0000 Subject: [PATCH] Apply debian patches also adding support for apache 2.4 (#532864) Package-Manager: portage-2.2.18/cvs/Linux x86_64 Manifest-Sign-Key: 0xA188FBD4 --- www-apache/mod_rpaf/ChangeLog | 11 +++- www-apache/mod_rpaf/Manifest | 15 ++++-- www-apache/mod_rpaf/files/003_ipv6.patch | 31 +++++++++++ .../mod_rpaf/files/010_multiple_proxies.patch | 37 ++++++++++++++ www-apache/mod_rpaf/files/011_apache2.4.patch | 51 +++++++++++++++++++ ...012_Add-missing-header-for-inet_addr.patch | 17 +++++++ www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild | 29 +++++++++++ 7 files changed, 184 insertions(+), 7 deletions(-) create mode 100644 www-apache/mod_rpaf/files/003_ipv6.patch create mode 100644 www-apache/mod_rpaf/files/010_multiple_proxies.patch create mode 100644 www-apache/mod_rpaf/files/011_apache2.4.patch create mode 100644 www-apache/mod_rpaf/files/012_Add-missing-header-for-inet_addr.patch create mode 100644 www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild diff --git a/www-apache/mod_rpaf/ChangeLog b/www-apache/mod_rpaf/ChangeLog index c24b8b8637c3..d8af849942df 100644 --- a/www-apache/mod_rpaf/ChangeLog +++ b/www-apache/mod_rpaf/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for www-apache/mod_rpaf -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_rpaf/ChangeLog,v 1.7 2012/11/27 19:29:50 pacho Exp $ +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_rpaf/ChangeLog,v 1.8 2015/05/09 11:55:19 pacho Exp $ + +*mod_rpaf-0.6-r1 (09 May 2015) + + 09 May 2015; Pacho Ramos +files/003_ipv6.patch, + +files/010_multiple_proxies.patch, +files/011_apache2.4.patch, + +files/012_Add-missing-header-for-inet_addr.patch, +mod_rpaf-0.6-r1.ebuild: + Apply debian patches also adding support for apache 2.4 (#532864) 27 Nov 2012; Pacho Ramos metadata.xml: Drop apache herd as discussed in http://www.gossamer- diff --git a/www-apache/mod_rpaf/Manifest b/www-apache/mod_rpaf/Manifest index b40902adfa23..80c4a94d1bb8 100644 --- a/www-apache/mod_rpaf/Manifest +++ b/www-apache/mod_rpaf/Manifest @@ -1,15 +1,20 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 +AUX 003_ipv6.patch 1265 SHA256 8cd469711beea842ae830e090c43af3f784b750e36f41cd02e9306bec5525b57 SHA512 43ad621562e550adbed4c77abb0a2596a50ea43978c8f8c0ac344a6a7eef84d8ce9398f9d1643f8b813fa480890de1b5ec57735d04fb79d6d7ed42246c8020b4 WHIRLPOOL 175c9765f63ddbfd144d96da2df0814c2d2ef03ae4bd5ccbc741a0319c9f6bbc0d853bde5776b4131fec9da9bc0463495c24048a68d72c6f04ef259bbbb09044 +AUX 010_multiple_proxies.patch 1611 SHA256 3076ffa6dc38a9912db24e76a9e8a666257248980198f81ad9be5e5ee9430d28 SHA512 6c78bfa0129fcfd464e19ec4d28fb6960bf4ee662cde1207eeb49461e8a3cae0887b4680388167b97374eeaade0627db43ff5837efa259e5497846993bba232f WHIRLPOOL 55d610b9380cf42d87df1339423ece307ad046a8915a3d8d8c3f26ae6d4081c1f6b22a237c8a57d3edd6ba1bda7952514e16bf47d018ac73906cf2a08072671e +AUX 011_apache2.4.patch 2833 SHA256 f48cf7c04bee38581c5a828a0660817a8c1de55fb00af4369a128e7a1b78bbb6 SHA512 a1e0805fe36f50b2f45e58c66fa9afc2f4583a563808560415c63dd46b92b9bcd885f4bd53c6cdad547c6db62d2bd5ee5c219beec123ade37afeb5eb9310607f WHIRLPOOL ce767242b9900845e93037f3623b6e2d1497736ad1a02d1afa418e386ba07c6f3c0c5a5afb8de43cf8fc9519035a16bc4d8b13e65d8908e0852c91a221ac8b58 +AUX 012_Add-missing-header-for-inet_addr.patch 329 SHA256 4effe6207dede4e46527f0e6333b6b2c1f321806d28deb82482a48bcb3a0e4bd SHA512 08c72bdd88e3c17a781843076d4b6b60f5949a70d6ede6e329fc1998b2ff5689227f4f2aaeef0f5e92f7b4a6b78381060c51dd8d705fde96df2e1390cdc02066 WHIRLPOOL abf9dfb4afdc5c9f49eee3598b89887d1233c136698118169a394d699601543e1a9c484e1cf49741394a5d4b403fd3b7d8f446de382c6eeb9cb9332a548d2a52 AUX 10_mod_rpaf.conf 114 SHA256 36d2c4fbfc288d8a0ff78631aa1acd5e4b0d2bf3e737653332c45725051d6e7d SHA512 33c7f44fa372644ee8654778a4fac5056830a11c90b4ef8aaac17df1e34644fa07cef7f6db2135dcf047dafb99f302c19e288653028811f4f4306aa53f7c58ec WHIRLPOOL 9437acce17e839c737f513cc643c1d0e4b13b0c46970fafa9c60da44f350175fcf3f22ec938782594ae46ef71ed15f68be08a18e3dafa3387f88a794418d5e23 DIST mod_rpaf-0.6.tar.gz 7695 SHA256 80f9dd1b0574747ef2c399335a88cf562491a7f0b940f26c684d065fe6c4c27d SHA512 1ad5af69cfe0e72cc609c081388e20e6a40cff1af7b47581b3d6958e5c7badf6580b2e14e5bd86482fe7cc7b60ca5045a2486c6f3f6e8ece7c142d38df990b4c WHIRLPOOL c0f9a8d9a561e963bf043efb64f99a8e87a7d1c704c78580c467321044abd9adda9b2c13437a4bbec8508920a18da801e1e6f4e19d03453aaf277215c074fb5a +EBUILD mod_rpaf-0.6-r1.ebuild 658 SHA256 d06d1c5e401b83162ce11afc5e57073fce1f751e0773313e6996f1fa80baa1ba SHA512 74db31ca1d8cb3c536abd45072c195d8247ea0d96cb6652ed51a4ed2f8620556e894842ff9ab599256c0f3732a1818f21c3f43f9f4cc2d8cde3d510077fe7b63 WHIRLPOOL c55cef21fac286a83d300195262f782022320403392224f6d784ffad8cdff2674decee1a32f1830bd20184f535b1ef216b7aedfbe9c5f7a5d67b8e767deef851 EBUILD mod_rpaf-0.6.ebuild 615 SHA256 6605dc7c80e6f9b4ba403ca63f4425987682065381a13acaf01180136fa61535 SHA512 2ebac9e2e3dc815e352f21a59e984165262dcbfa7d941c09f20423903e739bf9a6380602ac6d8c96470250895fd8e35056dd504d528cc95d33ae724b18f026be WHIRLPOOL 87a73de97fd06892e6bb33faa5e442ac10b80be6ef3f9b67caf57382ef07da062ea0aeb925a7086601572b5f8f32bf2f634d826ce44c13e6e257103cab7310e3 -MISC ChangeLog 1100 SHA256 d8fe82c2c072649da762aa9d743d916cbbda423320b50f436a4b56c8b4ed2206 SHA512 8af0f051f8c13c9c45df863e47257572af3fd399f271b80e0fe0264f463600d5238028684e4902e59c106564ab1880497cb463dbd8d97f1f3cfe8a15410c77c6 WHIRLPOOL 9d15bae414685fb7725611f3504b8d2b39823a1947cb9265c611ea71766671fd23c71388b1c030d039c441f63a5e9522105e76d4d865df3eb18e5f83aa511538 +MISC ChangeLog 1413 SHA256 c731424a89b6c278fb39b2c363a0fe81eccfd48ec6fba139f93b648187b7b81d SHA512 add3640ec342d7881ff8eb42cca1489a37af56040facf6f620178fdb6bd36b10b9ee73f88e89e06df316104041d70335c1f34ada009f4c9b1a63b9a263022be8 WHIRLPOOL f36dd2d0c964f0d5795ae6236366e4b0d680cc5bb1ed397727b5a61255c5822eee3ff6e1817e6d71ed73477597c6e7e1377efc1fdb3aa73ac36d793e91dee058 MISC metadata.xml 208 SHA256 98f8aa3fb70533eeab6b09d5bc30bd8f649ec13d9b04363490082fb87bb6032e SHA512 d5a7f3cb2fe57f8d7783ba358068648b122d9f5de81a17bff61ce600e42b6487e6f7e2a62c8be95cc7021cb3ea88716824b1ad0565da922ea753bea2417b3d3d WHIRLPOOL e38a6cdef2acb3efdc182efde482593790f773ab3bb9b66cced3af47e4ab39368757e17c4352c6cacaefa338341db88c3bcc3ffcd32aabd7984c5b19051a7bb7 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) +Version: GnuPG v2 -iEYEAREIAAYFAlC1FK8ACgkQCaWpQKGI+9RQSwCfWSh9MAycheZ3FicP5qjFrYcF -abEAoIXz3gbfaqf4MwBv9ksZek69sVIt -=4lwO +iEYEAREIAAYFAlVN9agACgkQCaWpQKGI+9Rc/ACghskHoNUuS1WkPHSOQ1Lewybp +GxkAn3OYNrRa3Sp3+aMxxM9JyfQ/vnRy +=iapd -----END PGP SIGNATURE----- diff --git a/www-apache/mod_rpaf/files/003_ipv6.patch b/www-apache/mod_rpaf/files/003_ipv6.patch new file mode 100644 index 000000000000..67edd55e45aa --- /dev/null +++ b/www-apache/mod_rpaf/files/003_ipv6.patch @@ -0,0 +1,31 @@ +Description: ipv6 fixes +Author: Piotr Roszatycki +Reviewed-by: Sergey B Kirpichev  +Bug-Debian: http://bugs.debian.org/726529 + +--- + mod_rpaf-2.0.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/mod_rpaf-2.0.c ++++ b/mod_rpaf-2.0.c +@@ -72,6 +72,8 @@ + #include "http_vhost.h" + #include "apr_strings.h" + ++#include ++ + module AP_MODULE_DECLARE_DATA rpaf_module; + + typedef struct { +@@ -185,6 +187,10 @@ + apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null); + r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]); + r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip); ++ apr_sockaddr_t *tmpsa; ++ int ret = apr_sockaddr_info_get(&tmpsa, r->connection->remote_ip, APR_UNSPEC, r->connection->remote_addr->port, 0, r->connection->remote_addr->pool); ++ if (ret == APR_SUCCESS) ++ memcpy(r->connection->remote_addr, tmpsa, sizeof(apr_sockaddr_t)); + if (cfg->sethostname) { + const char *hostvalue; + if (hostvalue = apr_table_get(r->headers_in, "X-Forwarded-Host")) { diff --git a/www-apache/mod_rpaf/files/010_multiple_proxies.patch b/www-apache/mod_rpaf/files/010_multiple_proxies.patch new file mode 100644 index 000000000000..2c9fae01bbe3 --- /dev/null +++ b/www-apache/mod_rpaf/files/010_multiple_proxies.patch @@ -0,0 +1,37 @@ +Description: Use the last value from the X-Forwarded-For header, which + is not in RPAFproxy_ips as the client IP, falling back to the first one + if they are all known proxies. +Author: Dagfinn Ilmari Mannsåker + +--- + mod_rpaf-2.0.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +--- a/mod_rpaf-2.0.c ++++ b/mod_rpaf-2.0.c +@@ -154,6 +154,16 @@ + return APR_SUCCESS; + } + ++static char* last_not_in_array(apr_array_header_t *forwarded_for, ++ apr_array_header_t *proxy_ips) { ++ int i; ++ for (i = (forwarded_for->nelts)-1; i > 0; i--) { ++ if (!is_in_array(((char **)forwarded_for->elts)[i], proxy_ips)) ++ break; ++ } ++ return ((char **)forwarded_for->elts)[i]; ++} ++ + static int change_remote_ip(request_rec *r) { + const char *fwdvalue; + char *val; +@@ -185,7 +195,7 @@ + rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->remote_ip); + rcr->r = r; + apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null); +- r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]); ++ r->connection->remote_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips)); + r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip); + apr_sockaddr_t *tmpsa; + int ret = apr_sockaddr_info_get(&tmpsa, r->connection->remote_ip, APR_UNSPEC, r->connection->remote_addr->port, 0, r->connection->remote_addr->pool); diff --git a/www-apache/mod_rpaf/files/011_apache2.4.patch b/www-apache/mod_rpaf/files/011_apache2.4.patch new file mode 100644 index 000000000000..1757e9f30a5a --- /dev/null +++ b/www-apache/mod_rpaf/files/011_apache2.4.patch @@ -0,0 +1,51 @@ +Description: Apache 2.4 compatibility patch +Author: Sergey B Kirpichev +Bug-Debian: http://bugs.debian.org/666792 + +--- + mod_rpaf-2.0.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/mod_rpaf-2.0.c ++++ b/mod_rpaf-2.0.c +@@ -149,8 +149,8 @@ + + static apr_status_t rpaf_cleanup(void *data) { + rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)data; +- rcr->r->connection->remote_ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip); +- rcr->r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->remote_ip); ++ rcr->r->connection->client_ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip); ++ rcr->r->connection->client_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->client_ip); + return APR_SUCCESS; + } + +@@ -173,7 +173,7 @@ + if (!cfg->enable) + return DECLINED; + +- if (is_in_array(r->connection->remote_ip, cfg->proxy_ips) == 1) { ++ if (is_in_array(r->connection->client_ip, cfg->proxy_ips) == 1) { + /* check if cfg->headername is set and if it is use + that instead of X-Forwarded-For by default */ + if (cfg->headername && (fwdvalue = apr_table_get(r->headers_in, cfg->headername))) { +@@ -192,15 +192,15 @@ + if (*fwdvalue != '\0') + ++fwdvalue; + } +- rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->remote_ip); ++ rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->client_ip); + rcr->r = r; + apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null); +- r->connection->remote_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips)); +- r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip); ++ r->connection->client_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips)); ++ r->connection->client_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->client_ip); + apr_sockaddr_t *tmpsa; +- int ret = apr_sockaddr_info_get(&tmpsa, r->connection->remote_ip, APR_UNSPEC, r->connection->remote_addr->port, 0, r->connection->remote_addr->pool); ++ int ret = apr_sockaddr_info_get(&tmpsa, r->connection->client_ip, APR_UNSPEC, r->connection->client_addr->port, 0, r->connection->client_addr->pool); + if (ret == APR_SUCCESS) +- memcpy(r->connection->remote_addr, tmpsa, sizeof(apr_sockaddr_t)); ++ memcpy(r->connection->client_addr, tmpsa, sizeof(apr_sockaddr_t)); + if (cfg->sethostname) { + const char *hostvalue; + if (hostvalue = apr_table_get(r->headers_in, "X-Forwarded-Host")) { diff --git a/www-apache/mod_rpaf/files/012_Add-missing-header-for-inet_addr.patch b/www-apache/mod_rpaf/files/012_Add-missing-header-for-inet_addr.patch new file mode 100644 index 000000000000..250a23bf918e --- /dev/null +++ b/www-apache/mod_rpaf/files/012_Add-missing-header-for-inet_addr.patch @@ -0,0 +1,17 @@ +Description: Add missing header for inet_addr +Author: Sergey B Kirpichev + +--- + mod_rpaf-2.0.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/mod_rpaf-2.0.c ++++ b/mod_rpaf-2.0.c +@@ -64,6 +64,7 @@ + * + */ + ++#include + #include "httpd.h" + #include "http_config.h" + #include "http_core.h" diff --git a/www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild b/www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild new file mode 100644 index 000000000000..0dd4a5a84340 --- /dev/null +++ b/www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild,v 1.1 2015/05/09 11:55:19 pacho Exp $ + +EAPI=5 +inherit apache-module eutils + +DESCRIPTION="Reverse proxy add forward module" +HOMEPAGE="http://stderr.net/apache/rpaf/" +SRC_URI="http://stderr.net/apache/rpaf/download/${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="" +RDEPEND="" + +APACHE2_MOD_CONF="10_${PN}" +APACHE2_MOD_DEFINE="RPAF" + +need_apache2_4 + +src_prepare() { + # Debian patches + epatch "${FILESDIR}"/0*.patch + mv ${PN}-2.0.c ${PN}.c +} -- 2.26.2