You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by William A Rowe Jr <wr...@rowe-clan.net> on 2015/06/30 03:39:27 UTC

Re: svn commit: r1688339 - /httpd/httpd/trunk/modules/filters/mod_substitute.c

For 2.2/2.4 the delta is a one line change to trunk's behavior;

On Mon, Jun 29, 2015 at 8:27 PM, <wr...@apache.org> wrote:

> Author: wrowe
> Date: Tue Jun 30 01:27:42 2015
> New Revision: 1688339
>
> URL: http://svn.apache.org/r1688339
> Log:
> Very difficult to read, and therefore was wrong.
>
> Assert that the SubstituteInheritBefore option was explicitly toggled,
> and do not default in 2.x to this legacy behavior.
>
>
> Modified:
>     httpd/httpd/trunk/modules/filters/mod_substitute.c
>
> Modified: httpd/httpd/trunk/modules/filters/mod_substitute.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_substitute.c?rev=1688339&r1=1688338&r2=1688339&view=diff
>
> ==============================================================================
> --- httpd/httpd/trunk/modules/filters/mod_substitute.c (original)
> +++ httpd/httpd/trunk/modules/filters/mod_substitute.c Tue Jun 30 01:27:42
> 2015
> @@ -86,9 +86,16 @@ static void *merge_substitute_dcfg(apr_p
>      subst_dir_conf *base = (subst_dir_conf *) basev;
>      subst_dir_conf *over = (subst_dir_conf *) overv;
>
> -    a->inherit_before = (over->inherit_before > 0 ||
> (over->inherit_before < 0 &&
> -
> base->inherit_before > 0));
> -    if (a->inherit_before) {
> +    a->inherit_before = (over->inherit_before != -1)
> +                            ? over->inherit_before
> +                            : base->inherit_before;
> +    /* SubstituteInheritBefore was the default behavior until 2.5.x,
> +     * and may be re-enabled as desired; this original default behavior
> +     * was to apply inherited subst patterns before locally scoped
> patterns.
> +     * In later 2.2 and 2.4 versions, SubstituteInheritBefore may be
> toggled
> +     * 'off' to follow the corrected/expected behavior, without violating
> POLS.
> +     */
> +    if (a->inherit_before == 1) {
>

This becomes

    if (a->inherit_before)

both the default case and explicitly toggled case will honor the legacy
2.2/2.4 behavior.
Explicitly toggling 'SubstitueInheritBefore off' will 'upgrade' to the
expected 2.5 behavior.