Re: Bug with "SetHandler None"

2016-03-19 Thread Michael Kaufmann

Eric Covener wrote:

On Sat, Mar 19, 2016 at 11:31 AM, Michael Kaufmann
 wrote:

I have found a bug in the current 2.4.x branch: "SetHandler None" does not
work anymore (note the capital letter "N"). This worked with Apache 2.4.18.
Probably this commit has changed the behavior:
http://svn.apache.org/r1729876

Thanks Michael!



Thank you for fixing the bug! :-)


Re: Bug with "SetHandler None"

2016-03-19 Thread Eric Covener
committed and proposed, was just getting these myself.

On Sat, Mar 19, 2016 at 12:44 PM, Yann Ylavic  wrote:
> On Sat, Mar 19, 2016 at 5:37 PM, Eric Covener  wrote:
>>> The bigger question is whether or not 'none' should be case insensitive
>>> or not. IMHO, it should be.
>>
>> yup. Looking now too.
>
> We probably need something like this:
>
> Index: server/core.c
> ===
> --- server/core.c(revision 1735784)
> +++ server/core.c(working copy)
> @@ -4453,16 +4453,14 @@ static int core_override_type(request_rec *r)
>"Can't evaluate handler expression: %s", err);
>  return HTTP_INTERNAL_SERVER_ERROR;
>  }
> +if (val != ap_strstr_c(val, "proxy:unix")) {
> +/* Retained for compatibility --  but not for UDS */
> +char *tmp = apr_pstrdup(r->pool, val);
> +ap_str_tolower(tmp);
> +val = tmp;
> +}
>  if (strcmp(val, "none")) {
> -if (val != ap_strstr_c(val, "proxy:unix")) {
> -/* Retained for compatibility --  but not for UDS */
> -char *tmp = apr_pstrdup(r->pool, val);
> -ap_str_tolower(tmp);
> -r->handler = tmp;
> -}
> -else {
> -r->handler = val;
> -}
> +r->handler = val;
>  }
>  }
>  else if (conf->handler && strcmp(conf->handler, "none")) {
>
> --



-- 
Eric Covener
[email protected]


Re: Bug with "SetHandler None"

2016-03-19 Thread Eric Covener
On Sat, Mar 19, 2016 at 11:31 AM, Michael Kaufmann
 wrote:
> I have found a bug in the current 2.4.x branch: "SetHandler None" does not
> work anymore (note the capital letter "N"). This worked with Apache 2.4.18.
> Probably this commit has changed the behavior:
> http://svn.apache.org/r1729876

Thanks Michael!

-- 
Eric Covener
[email protected]


Re: Bug with "SetHandler None"

2016-03-19 Thread Yann Ylavic
On Sat, Mar 19, 2016 at 5:37 PM, Eric Covener  wrote:
>> The bigger question is whether or not 'none' should be case insensitive
>> or not. IMHO, it should be.
>
> yup. Looking now too.

We probably need something like this:

Index: server/core.c
===
--- server/core.c(revision 1735784)
+++ server/core.c(working copy)
@@ -4453,16 +4453,14 @@ static int core_override_type(request_rec *r)
   "Can't evaluate handler expression: %s", err);
 return HTTP_INTERNAL_SERVER_ERROR;
 }
+if (val != ap_strstr_c(val, "proxy:unix")) {
+/* Retained for compatibility --  but not for UDS */
+char *tmp = apr_pstrdup(r->pool, val);
+ap_str_tolower(tmp);
+val = tmp;
+}
 if (strcmp(val, "none")) {
-if (val != ap_strstr_c(val, "proxy:unix")) {
-/* Retained for compatibility --  but not for UDS */
-char *tmp = apr_pstrdup(r->pool, val);
-ap_str_tolower(tmp);
-r->handler = tmp;
-}
-else {
-r->handler = val;
-}
+r->handler = val;
 }
 }
 else if (conf->handler && strcmp(conf->handler, "none")) {

--


Re: Bug with "SetHandler None"

2016-03-19 Thread Eric Covener
On Sat, Mar 19, 2016 at 12:37 PM, Eric Covener  wrote:
> yup. Looking now too.
>

I've got it

-- 
Eric Covener
[email protected]


Re: Bug with "SetHandler None"

2016-03-19 Thread Eric Covener
> The bigger question is whether or not 'none' should be case insensitive
> or not. IMHO, it should be.

yup. Looking now too.


Re: Bug with "SetHandler None"

2016-03-19 Thread Jim Jagielski
Hmmm a rough look doesn't seem to show anyplace where we
used to use strcasecmp and now use strcmp;

The bigger question is whether or not 'none' should be case insensitive
or not. IMHO, it should be.

> On Mar 19, 2016, at 11:31 AM, Michael Kaufmann  
> wrote:
> 
> Hi,
> 
> I have found a bug in the current 2.4.x branch: "SetHandler None" does not 
> work anymore (note the capital letter "N"). This worked with Apache 2.4.18. 
> Probably this commit has changed the behavior: http://svn.apache.org/r1729876
> 
> The documentation at 
> https://httpd.apache.org/docs/2.4/en/mod/core.html#sethandler is 
> inconsistent: In the syntax definition, the value "none" is used, but there 
> is also this sentence: "You can override an earlier defined SetHandler 
> directive by using the value None." So I expect that both "none" and "None" 
> should work.
> 
> Example configuration that shows the problem (the send-as-is handler is not 
> used anymore for asis files):
> 
> 
>SetHandler   None
>AddType  text/html .html .asis
>AddHandler   send-as-is html asis
> 
> 
> Regards,
> Michael