You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2015/10/16 13:46:49 UTC

[Bug 58498] New: Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

            Bug ID: 58498
           Summary: Apache 2.4.17: Regression with mod_autoindex (in
                    combination with Phusion Passenger)
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_autoindex
          Assignee: bugs@httpd.apache.org
          Reporter: timo.gurr@gmail.com

Created attachment 33183
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33183&action=edit
httpd-2.4.17-autoindex-revert.patch

There seems to be an issue with Phusion Passenger (5.0.20) caused by:
http://svn.apache.org/viewvc?view=revision&revision=r1701436
which has been reported here:
https://groups.google.com/forum/#!topic/phusion-passenger/jiOpv9Isua4
By reverting the offending commit Phusion Passenger works fine with 2.4.17.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

--- Comment #4 from Eric Covener <co...@gmail.com> ---
I proposed on github that they set r->handler to a passenger-skip-autoindex
string rather than "" which is what 2.4 uses as DEAULT_HANDLER_NAME

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

--- Comment #1 from Eric Covener <co...@gmail.com> ---
Can someone familiar with the passenger impl elaborate on what's going on?

If it's broken by this change -- I am assuming it operates as a handler at
APR_HOOK_MIDDLE (or later), wants to operate on requests mapped to directories
, but doesn't do anything to set a r->handler or run before mod_autoindex?

(I'd rather not just revert the fix that allows mod_autoindex to work without
mod_mime)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

Frederick888@Tsundere.moe changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Frederick888@Tsundere.moe

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

Jiří Vyskočil <sv...@centrum.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |svzj@centrum.cz

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Re: Fwd: [Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by Eric Covener <co...@gmail.com>.
On Fri, Oct 16, 2015 at 1:34 PM, Rainer Jung <ra...@kippdata.de> wrote:
> Am 16.10.2015 um 19:27 schrieb Eric Covener:
>>
>> What's with the backwards start and end there?  Does the
>> successor/predecessor override FIRST/MIDDLE/LAST?
>
>
> backwards?
>
> successor/predecessor are:
>
> static const char * const autoindex_module[] = { "mod_autoindex.c", NULL };
>
> ap_hook_handler(start_blocking_mod_autoindex, NULL, autoindex_module,
> APR_HOOK_LAST);
> ap_hook_handler(end_blocking_mod_autoindex, autoindex_module, NULL,
> APR_HOOK_FIRST);

I mean start_blocking is APR_HOOK_LAST and end_blocking is
APR_HOOK_FIRST which is odd.  I'd have thought start would come before
end :)

I (intuitively only) thought the successor only moved you around
within whatever FIRST/MIDDLE/LAST you picked, but I guess not.


-- 
Eric Covener
covener@gmail.com

Re: Fwd: [Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by Rainer Jung <ra...@kippdata.de>.
Am 16.10.2015 um 19:27 schrieb Eric Covener:
> What's with the backwards start and end there?  Does the
> successor/predecessor override FIRST/MIDDLE/LAST?

backwards?

successor/predecessor are:

static const char * const autoindex_module[] = { "mod_autoindex.c", NULL };

ap_hook_handler(start_blocking_mod_autoindex, NULL, autoindex_module, 
APR_HOOK_LAST);
ap_hook_handler(end_blocking_mod_autoindex, autoindex_module, NULL, 
APR_HOOK_FIRST);

Regards,

Rainer

> ---------- Forwarded message ----------
> From:  <bu...@apache.org>
> Date: Fri, Oct 16, 2015 at 1:24 PM
> Subject: [Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in
> combination with Phusion Passenger)
> To: bugs@httpd.apache.org
>
>
> https://bz.apache.org/bugzilla/show_bug.cgi?id=58498
>
> --- Comment #2 from Rainer Jung <ra...@kippdata.de> ---
> I'm not an expert on passenger, but one can see the hook registration at
>
> https://github.com/phusion/passenger/blob/stable-5.0/src/apache2_module/Hooks.cpp
>
> scrolling down to the end of the file.
>
> The code in the file contains some handler juggling and also rules for ordering
> relative to mod_autoindex. Especially
>
> ap_hook_handler(start_blocking_mod_autoindex, NULL, autoindex_module,
> APR_HOOK_LAST);
> ap_hook_handler(end_blocking_mod_autoindex, autoindex_module, NULL,
> APR_HOOK_FIRST);
>
> points to
>
> DEFINE_REQUEST_HOOK(start_blocking_mod_autoindex, startBlockingModAutoIndex)
> DEFINE_REQUEST_HOOK(end_blocking_mod_autoindex, endBlockingModAutoIndex)
>
> which brings the following functions into the game:
>
>          int startBlockingModAutoIndex(request_rec *r) {
>                  RequestNote *note = getRequestNote(r);
>                  if (note != 0 && hasModAutoIndex()) {
>                          note->handlerBeforeModAutoIndex = r->handler;
>                          r->handler = "";
>                  }
>                  return DECLINED;
>          }
>
>          int endBlockingModAutoIndex(request_rec *r) {
>                  RequestNote *note = getRequestNote(r);
>                  if (note != 0 && hasModAutoIndex()) {
>                          r->handler = note->handlerBeforeModAutoIndex;
>                  }
>                  return DECLINED;
>          }
>
>
> In front of them is a comment:
>
>           * mod_autoindex will try to display a directory index for URIs that
> map to a directory.
>           * This is undesired because of page caching semantics. Suppose that a
> Rails application
>           * has an ImagesController which has page caching enabled, and thus
> also a 'public/images'
>           * directory. When the visitor visits /images we'll want the request to
> be forwarded to
>           * the Rails application, instead of displaying a directory index.
>           *
>           * So in this hook method, we temporarily change some fields in the
> request structure
>           * in order to block mod_autoindex. In endBlockingModAutoIndex(), we
> restore the request
>           * structure to its former state.
>
> Not sure whether this is related.
>
> Rainer
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
> For additional commands, e-mail: bugs-help@httpd.apache.org
>
>
>

-- 
kippdata
informationstechnologie GmbH   Tel: 0228 98549 -0
Bornheimer Str. 33a            Fax: 0228 98549 -50
53111 Bonn                     www.kippdata.de

HRB 8018 Amtsgericht Bonn / USt.-IdNr. DE 196 457 417
Geschäftsführer: Dr. Thomas Höfer, Rainer Jung, Sven Maurmann

Re: [Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by Eric Covener <co...@gmail.com>.
On Fri, Oct 16, 2015 at 1:27 PM, Eric Covener <co...@gmail.com> wrote:
> What's with the backwards start and end there?  Does the
> successor/predecessor override FIRST/MIDDLE/LAST?
>
>
> ---------- Forwarded message ----------
> From:  <bu...@apache.org>
> Date: Fri, Oct 16, 2015 at 1:24 PM
> Subject: [Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in
> combination with Phusion Passenger)
> To: bugs@httpd.apache.org
>
>
> https://bz.apache.org/bugzilla/show_bug.cgi?id=58498
>
> --- Comment #2 from Rainer Jung <ra...@kippdata.de> ---
> I'm not an expert on passenger, but one can see the hook registration at
>
> https://github.com/phusion/passenger/blob/stable-5.0/src/apache2_module/Hooks.cpp
>
> scrolling down to the end of the file.
>
> The code in the file contains some handler juggling and also rules for ordering
> relative to mod_autoindex. Especially
>
> ap_hook_handler(start_blocking_mod_autoindex, NULL, autoindex_module,
> APR_HOOK_LAST);
> ap_hook_handler(end_blocking_mod_autoindex, autoindex_module, NULL,
> APR_HOOK_FIRST);
>
> points to
>
> DEFINE_REQUEST_HOOK(start_blocking_mod_autoindex, startBlockingModAutoIndex)
> DEFINE_REQUEST_HOOK(end_blocking_mod_autoindex, endBlockingModAutoIndex)
>
> which brings the following functions into the game:
>
>         int startBlockingModAutoIndex(request_rec *r) {
>                 RequestNote *note = getRequestNote(r);
>                 if (note != 0 && hasModAutoIndex()) {
>                         note->handlerBeforeModAutoIndex = r->handler;
>                         r->handler = "";

"" is what we now call DEFAULT_HANDLER_NAME which we now use to decide
nobody set a handler and things are up for grabs

If this hadn't shipped I'd be inclined to just back it out and revisit
the original issue later (mod_autoindex w/o mod_mime) -- but since it
has, I'd just as well guide passenger to use a non-empty string here
since either way, software needs to be updated.

Open to other points of view though.

Fwd: [Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by Eric Covener <co...@gmail.com>.
What's with the backwards start and end there?  Does the
successor/predecessor override FIRST/MIDDLE/LAST?


---------- Forwarded message ----------
From:  <bu...@apache.org>
Date: Fri, Oct 16, 2015 at 1:24 PM
Subject: [Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in
combination with Phusion Passenger)
To: bugs@httpd.apache.org


https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

--- Comment #2 from Rainer Jung <ra...@kippdata.de> ---
I'm not an expert on passenger, but one can see the hook registration at

https://github.com/phusion/passenger/blob/stable-5.0/src/apache2_module/Hooks.cpp

scrolling down to the end of the file.

The code in the file contains some handler juggling and also rules for ordering
relative to mod_autoindex. Especially

ap_hook_handler(start_blocking_mod_autoindex, NULL, autoindex_module,
APR_HOOK_LAST);
ap_hook_handler(end_blocking_mod_autoindex, autoindex_module, NULL,
APR_HOOK_FIRST);

points to

DEFINE_REQUEST_HOOK(start_blocking_mod_autoindex, startBlockingModAutoIndex)
DEFINE_REQUEST_HOOK(end_blocking_mod_autoindex, endBlockingModAutoIndex)

which brings the following functions into the game:

        int startBlockingModAutoIndex(request_rec *r) {
                RequestNote *note = getRequestNote(r);
                if (note != 0 && hasModAutoIndex()) {
                        note->handlerBeforeModAutoIndex = r->handler;
                        r->handler = "";
                }
                return DECLINED;
        }

        int endBlockingModAutoIndex(request_rec *r) {
                RequestNote *note = getRequestNote(r);
                if (note != 0 && hasModAutoIndex()) {
                        r->handler = note->handlerBeforeModAutoIndex;
                }
                return DECLINED;
        }


In front of them is a comment:

         * mod_autoindex will try to display a directory index for URIs that
map to a directory.
         * This is undesired because of page caching semantics. Suppose that a
Rails application
         * has an ImagesController which has page caching enabled, and thus
also a 'public/images'
         * directory. When the visitor visits /images we'll want the request to
be forwarded to
         * the Rails application, instead of displaying a directory index.
         *
         * So in this hook method, we temporarily change some fields in the
request structure
         * in order to block mod_autoindex. In endBlockingModAutoIndex(), we
restore the request
         * structure to its former state.

Not sure whether this is related.

Rainer

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org



-- 
Eric Covener
covener@gmail.com

[Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

--- Comment #2 from Rainer Jung <ra...@kippdata.de> ---
I'm not an expert on passenger, but one can see the hook registration at

https://github.com/phusion/passenger/blob/stable-5.0/src/apache2_module/Hooks.cpp

scrolling down to the end of the file.

The code in the file contains some handler juggling and also rules for ordering
relative to mod_autoindex. Especially 

ap_hook_handler(start_blocking_mod_autoindex, NULL, autoindex_module,
APR_HOOK_LAST);
ap_hook_handler(end_blocking_mod_autoindex, autoindex_module, NULL,
APR_HOOK_FIRST);

points to

DEFINE_REQUEST_HOOK(start_blocking_mod_autoindex, startBlockingModAutoIndex)
DEFINE_REQUEST_HOOK(end_blocking_mod_autoindex, endBlockingModAutoIndex)

which brings the following functions into the game:

        int startBlockingModAutoIndex(request_rec *r) {
                RequestNote *note = getRequestNote(r);
                if (note != 0 && hasModAutoIndex()) {
                        note->handlerBeforeModAutoIndex = r->handler;
                        r->handler = "";
                }
                return DECLINED;
        }

        int endBlockingModAutoIndex(request_rec *r) {
                RequestNote *note = getRequestNote(r);
                if (note != 0 && hasModAutoIndex()) {
                        r->handler = note->handlerBeforeModAutoIndex;
                }
                return DECLINED;
        }


In front of them is a comment:

         * mod_autoindex will try to display a directory index for URIs that
map to a directory.
         * This is undesired because of page caching semantics. Suppose that a
Rails application
         * has an ImagesController which has page caching enabled, and thus
also a 'public/images'
         * directory. When the visitor visits /images we'll want the request to
be forwarded to
         * the Rails application, instead of displaying a directory index.
         *
         * So in this hook method, we temporarily change some fields in the
request structure
         * in order to block mod_autoindex. In endBlockingModAutoIndex(), we
restore the request
         * structure to its former state.

Not sure whether this is related.

Rainer

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #3 from Eric Covener <co...@gmail.com> ---
(moved to dev@)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 58498] Apache 2.4.17: Regression with mod_autoindex (in combination with Phusion Passenger)

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58498

Oleksiy Shchukin <ol...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |oleksiy.shchukin@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org