From: Jim Jagielski Date: Sun, 9 Oct 2011 12:35:53 +0000 (+0000) Subject: fix 2.2.21 induced sorting bug X-Git-Tag: 2.2.22~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=277c25640d24f8e5d348632df8d95a2f36216ff6;p=thirdparty%2Fapache%2Fhttpd.git fix 2.2.21 induced sorting bug git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1180594 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 624fc880731..ea8fb94352d 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,9 @@ Changes with Apache 2.2.22 specification, preventing unexpected expansion of target URLs in some reverse proxy configurations. [Joe Orton] + *) core: Fix hook sorting for perl modules, a regression introduced in + 2.2.21. PR: 45076. [Torsten Foertsch ] + *) Fix a regression introduced by the CVE-2011-3192 byterange fix in 2.2.20: A range of '0-' will now return 206 instead of 200. PR 51878. [Jim Jagielski] diff --git a/STATUS b/STATUS index 02c606a8ee3..ddea6331a32 100644 --- a/STATUS +++ b/STATUS @@ -92,11 +92,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * core: Fix hook sorting for perl modules, a regression introduced in 2.2.21 - Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1180325 - 2.2.x patch: http://people.apache.org/~sf/2.2_hook_sorting.diff - +1: sf, trawick, jim - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/server/main.c b/server/main.c index 04ed6c78d47..224a10ef77a 100644 --- a/server/main.c +++ b/server/main.c @@ -633,6 +633,7 @@ int main(int argc, const char * const argv[]) if (!server_conf) { destroy_and_exit_process(process, 1); } + /* sort hooks here to make sure pre_config hooks are sorted properly */ apr_hook_sort_all(); if (ap_run_pre_config(pconf, plog, ptemp) != OK) { @@ -646,6 +647,12 @@ int main(int argc, const char * const argv[]) if (rv == OK) { ap_fixup_virtual_hosts(pconf, server_conf); ap_fini_vhost_config(pconf, server_conf); + /* + * Sort hooks again because ap_process_config_tree may have added + * modules and hence hooks. This happens with mod_perl and modules + * written in perl. + */ + apr_hook_sort_all(); if (configtestonly) { ap_run_test_config(pconf, server_conf); @@ -704,6 +711,7 @@ int main(int argc, const char * const argv[]) if (!server_conf) { destroy_and_exit_process(process, 1); } + /* sort hooks here to make sure pre_config hooks are sorted properly */ apr_hook_sort_all(); if (ap_run_pre_config(pconf, plog, ptemp) != OK) { @@ -718,6 +726,12 @@ int main(int argc, const char * const argv[]) } ap_fixup_virtual_hosts(pconf, server_conf); ap_fini_vhost_config(pconf, server_conf); + /* + * Sort hooks again because ap_process_config_tree may have added + * modules and hence hooks. This happens with mod_perl and modules + * written in perl. + */ + apr_hook_sort_all(); apr_pool_clear(plog); if (ap_run_open_logs(pconf, plog, ptemp, server_conf) != OK) { ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR,