I’ve fixed an issue of the mod_authz_host's Allow/Deny directives worki...#2
I’ve fixed an issue of the mod_authz_host's Allow/Deny directives worki...#2vivanv wants to merge 1 commit intoy-ken:masterfrom
Conversation
…king incorrectly on httpd 2.2.25.
The apr_ipsubnet_test function was changed in APR 1.4.7, as well as in 1.4.8 that is included in httpd 2.2.25
apr_ipsubnet_test function looks like this right now:
APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
{
#if APR_HAVE_IPV6
/* XXX This line will segv on Win32 build with APR_HAVE_IPV6,
* but without the IPV6 drivers installed.
*/
if (sa->family == AF_INET) {
if (ipsub->family == AF_INET &&
((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) {
return 1;
}
...
the previous version:
APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
{
#if APR_HAVE_IPV6
/* XXX This line will segv on Win32 build with APR_HAVE_IPV6,
* but without the IPV6 drivers installed.
*/
if (sa->sa.sin.sin_family == AF_INET) {
if (ipsub->family == AF_INET &&
((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) {
return 1;
}
So IPv4 IP addresses do not match in Allow and Deny directives of mod_authz_host module.
My modifications resolve this issue.
|
Thank you for your patch. I will check behavior in my environment. |
Config files: LogFormat "%h %{X-Forwarded-For}i %l %u %t "%m" "%r&" "%q&" %>s %b "%{Referer}i" "%{User-Agent}i" pid=%{pid}P tid=%{tid}P time_ms=%D" combined CustomLog "|/import/home/ivan.voronin/tmp/solaris/023.00/apache2/bin/rotatelogs logs/access_log.%Y.%m.%d 86400" combined LoadModule rpaf_module modules/mod_rpaf-2.0.so RPAFenable On RPAFsethostname On RPAFproxy_ips 127.0.0.1 172.20.106.70 RPAFheader X-Forwarded-For<Location /rpaf_test> Order deny,allow Request: [no cookies] Request Headers: Response : LOGS: error_log.2013.09.16: |
|
...ng incorrectly on httpd 2.2.25.
The apr_ipsubnet_test function was changed in APR 1.4.7, as well as in 1.4.8 that is included in httpd 2.2.25
apr_ipsubnet_test function looks like this right now:
APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
{
if APR_HAVE_IPV6
...
the previous version:
APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
{
if APR_HAVE_IPV6
So IPv4 IP addresses do not match in Allow and Deny directives of mod_authz_host module.
My modifications resolve this issue.