httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45076] New: pre_config hooks not called in order
Date Mon, 26 May 2008 09:48:01 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45076

           Summary: pre_config hooks not called in order
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: maxmeneault@free.fr


Created an attachment (id=22000)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22000)
pre_config hooks patch for trunk

Apparently pre_config hooks are not ordered when ap_run_pre_config is called.
I noticed and verified one issue and I noticed another one (syntactically only)
while reading through the code.

First issue (verified):
While during the first configuration pass pre_config hooks seem to be ordered
for prelinked modules during the second one hooks are not ordered (i.e. not in
the order specified by APR_HOOK_FIRST...defines).
Fix:
apr_hook_sort_all is called too late during second and further configuration
passes.
It needs to be called before ap_run_pre_config (l.734 of server/main.c).

Second issue (only noticed while reading the code):
pre_config hooks might not be ordered for dynamically loaded modules even
during first configuration pass.
Fix:
apr_hook_sort_all needs to be called before ap_run_pre_config (l.656 of
server/main.c)

I was working on 2.2.3 which suffer from these issues. I checked 2.2.8 and
trunk which still suffer these issues.

Please see attached a patch for trunk to fix these issues.

I compiled the server and checked that my patch correct the first issue (I
don't use dynamically loaded modules).

My patch shouldn't provoke any regression however I don't know why
apr_hook_sort_all was called so late. Was there any reason for that?

The only assumption I make is that hooks have to be hooked during register
hooks during module initialization or otherwise apr_hook_sort_all should be
manually called after registering a hook (as mod_cgid does).


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


Mime
View raw message