You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2018/05/31 07:24:24 UTC

svn commit: r1832580 - in /httpd/httpd/trunk: CHANGES modules/metadata/mod_remoteip.c

Author: ylavic
Date: Thu May 31 07:24:24 2018
New Revision: 1832580

URL: http://svn.apache.org/viewvc?rev=1832580&view=rev
Log:
mod_remoteip: Fix RemoteIP{Trusted,Internal}ProxyList loading broken by 2.4.33.

Overwriting server config in pre_config hook breaks EXEC_ON_READ directives,
it's automatically created on purpose anyway.


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/metadata/mod_remoteip.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1832580&r1=1832579&r2=1832580&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Thu May 31 07:24:24 2018
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) mod_remoteip: Fix RemoteIP{Trusted,Internal}ProxyList loading broken by 2.4.33.
+     [Chritophe Jaillet, Yann Ylavic]
+
   *) mod_userdir: If several directories are given in a UserDir directive, only files
      in the first existing one are checked. If the file is not found there, the
      other possible directories are not checked. The doc clearly states that they

Modified: httpd/httpd/trunk/modules/metadata/mod_remoteip.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_remoteip.c?rev=1832580&r1=1832579&r2=1832580&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_remoteip.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_remoteip.c Thu May 31 07:24:24 2018
@@ -492,17 +492,6 @@ static const char *remoteip_disable_netw
     return NULL;
 }
 
-static int remoteip_hook_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
-                              apr_pool_t *ptemp)
-{
-    remoteip_config_t *config = (remoteip_config_t *)
-                                create_remoteip_server_config(pconf, NULL);
-    ap_set_module_config(ap_server_conf->module_config, &remoteip_module,
-                         config);
-
-    return OK;
-}
-
 static int remoteip_hook_post_config(apr_pool_t *pconf, apr_pool_t *plog,
                                apr_pool_t *ptemp, server_rec *s)
 {
@@ -1244,7 +1233,6 @@ static void register_hooks(apr_pool_t *p
         ap_register_input_filter("REMOTEIP_INPUT", remoteip_input_filter, NULL,
                                  AP_FTYPE_CONNECTION + 7);
 
-    ap_hook_pre_config(remoteip_hook_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_post_config(remoteip_hook_post_config, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_pre_connection(remoteip_hook_pre_connection, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_post_read_request(remoteip_modify_request, NULL, NULL, APR_HOOK_FIRST);



Re: svn commit: r1832580 - in /httpd/httpd/trunk: CHANGES modules/metadata/mod_remoteip.c

Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, May 31, 2018 at 3:07 PM, Daniel Ruggeri <dr...@primary.net> wrote:
> Hi, Yann;
> I'm out of town and far from a usable system to investigate the code at the
> moment. On a quick review, this doesn't ring a bell. I assume it came with
> the original code donation. Seems to make sense since originally this
> functionality was all in it's own module. Based on the context, I am
> guessing you've detected the config struct is created and set twice, thus
> losing potential parameters. If that's the case, I'm confident removing the
> second occurrence should be fine.

Ok, thanks Daniel (and sorry for the inconvenience).

Re: svn commit: r1832580 - in /httpd/httpd/trunk: CHANGES modules/metadata/mod_remoteip.c

Posted by Daniel Ruggeri <dr...@primary.net>.
Hi, Yann;
   I'm out of town and far from a usable system to investigate the code at the moment. On a quick review, this doesn't ring a bell. I assume it came with the original code donation. Seems to make sense since originally this functionality was all in it's own module. Based on the context, I am guessing you've detected the config struct is created and set twice, thus losing potential parameters. If that's the case, I'm confident removing the second occurrence should be fine.
-- 
Daniel Ruggeri

On May 31, 2018 7:54:37 AM CDT, Yann Ylavic <yl...@gmail.com> wrote:
>On Thu, May 31, 2018 at 9:24 AM,  <yl...@apache.org> wrote:
>> Author: ylavic
>> Date: Thu May 31 07:24:24 2018
>> New Revision: 1832580
>>
>> URL: http://svn.apache.org/viewvc?rev=1832580&view=rev
>>
>[]
>> mod_remoteip: Fix RemoteIP{Trusted,Internal}ProxyList loading broken
>by 2.4.33.
>> --- httpd/httpd/trunk/modules/metadata/mod_remoteip.c (original)
>> +++ httpd/httpd/trunk/modules/metadata/mod_remoteip.c Thu May 31
>07:24:24 2018
>> @@ -492,17 +492,6 @@ static const char *remoteip_disable_netw
>>      return NULL;
>>  }
>>
>> -static int remoteip_hook_pre_config(apr_pool_t *pconf, apr_pool_t
>*plog,
>> -                              apr_pool_t *ptemp)
>> -{
>> -    remoteip_config_t *config = (remoteip_config_t *)
>> -                                create_remoteip_server_config(pconf,
>NULL);
>> -    ap_set_module_config(ap_server_conf->module_config,
>&remoteip_module,
>> -                         config);
>> -
>> -    return OK;
>> -}
>
>Daniel, do you remember why this was needed?
>
>Regards,
>Yann.

Re: svn commit: r1832580 - in /httpd/httpd/trunk: CHANGES modules/metadata/mod_remoteip.c

Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, May 31, 2018 at 9:24 AM,  <yl...@apache.org> wrote:
> Author: ylavic
> Date: Thu May 31 07:24:24 2018
> New Revision: 1832580
>
> URL: http://svn.apache.org/viewvc?rev=1832580&view=rev
>
[]
> mod_remoteip: Fix RemoteIP{Trusted,Internal}ProxyList loading broken by 2.4.33.
> --- httpd/httpd/trunk/modules/metadata/mod_remoteip.c (original)
> +++ httpd/httpd/trunk/modules/metadata/mod_remoteip.c Thu May 31 07:24:24 2018
> @@ -492,17 +492,6 @@ static const char *remoteip_disable_netw
>      return NULL;
>  }
>
> -static int remoteip_hook_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
> -                              apr_pool_t *ptemp)
> -{
> -    remoteip_config_t *config = (remoteip_config_t *)
> -                                create_remoteip_server_config(pconf, NULL);
> -    ap_set_module_config(ap_server_conf->module_config, &remoteip_module,
> -                         config);
> -
> -    return OK;
> -}

Daniel, do you remember why this was needed?

Regards,
Yann.