You ALWAYS preserve unset state.  How else do you perform the THIRD merge?


On Mon, Jun 29, 2015 at 9:01 PM, Yann Ylavic <ylavic....@gmail.com> wrote:

> This won't work for eg, this second level inheritance: server context
> is on, vhost and inner Location are unset.
> Location->inherit_before will be unset whereas it should be on.
> We should not preserve the unset state IMHO.
>
> On Tue, Jun 30, 2015 at 3:27 AM,  <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) {
> >          a->patterns = apr_array_append(p, base->patterns,
> >                                            over->patterns);
> >      }
> >
> >
>

Reply via email to