From: Stefan Fritsch Date: Sat, 6 Nov 2010 11:11:17 +0000 (+0000) Subject: Fix hook sorting for the pre_config hook. X-Git-Tag: 2.3.9~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26d9243e32a4afac20450336142aa629450ebf9a;p=apache Fix hook sorting for the pre_config hook. Move modules/http/config2.m4 back to modules/http/config.m4, since this was only done as work-around in r88887 for the broken hook-sorting. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032002 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 4019d5b7f1..737a1474c7 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,9 @@ Changes with Apache 2.3.9 Fix a denial of service attack against mod_reqtimeout. [Stefan Fritsch] + *) core: Do the hook sorting earlier so that the hooks are properly sorted + for the pre_config hook and during parsing the config. [Stefan Fritsch] + *) core: In the absence of any AllowOverride directives, the default is now "None" instead of "All". PR49823 [Eric Covener] diff --git a/STATUS b/STATUS index deff7098df..357a130d59 100644 --- a/STATUS +++ b/STATUS @@ -153,19 +153,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: wrowe suggests: it would be nice to see "MUST" v.s. "SHOULD" v.s. "MAY" out of this list, without reviewing them individually. - * There is a bug in how we sort some hooks, at least the pre-config - hook. The first time we call the hooks, they are in the correct - order, but the second time, we don't sort them correctly. Currently, - the modules/http/config.m4 file has been renamed to - modules/http/config2.m4 to work around this problem, it should moved - back when this is fixed. - - OtherBill offers that this is a SERIOUS problem. We do not sort - correctly by the ordering arguments passed to the register hook - functions. This was proven when I reordered the open_logs hook - to attempt to open the error logs prior to the access logs. Possibly - the entire sorting code needs to be refactored. - * pipes deadlock on all platforms with limited pipe buffers (e.g. both Linux and Win32, as opposed to only Win32 on 1.3). The right solution is either GStein's proposal for a "CGI Brigade", or OtherBill's proposal diff --git a/modules/http/config2.m4 b/modules/http/config.m4 similarity index 100% rename from modules/http/config2.m4 rename to modules/http/config.m4 diff --git a/server/main.c b/server/main.c index aa9eb04ae9..1943371693 100644 --- a/server/main.c +++ b/server/main.c @@ -617,6 +617,7 @@ int main(int argc, const char * const argv[]) if (!ap_server_conf) { destroy_and_exit_process(process, 1); } + apr_hook_sort_all(); if (ap_run_pre_config(pconf, plog, ptemp) != OK) { ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0, @@ -629,7 +630,6 @@ int main(int argc, const char * const argv[]) if (rv == OK) { ap_fixup_virtual_hosts(pconf, ap_server_conf); ap_fini_vhost_config(pconf, ap_server_conf); - apr_hook_sort_all(); if (ap_run_check_config(pconf, plog, ptemp, ap_server_conf) != OK) { ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0, @@ -699,6 +699,7 @@ int main(int argc, const char * const argv[]) if (!ap_server_conf) { destroy_and_exit_process(process, 1); } + apr_hook_sort_all(); if (ap_run_pre_config(pconf, plog, ptemp) != OK) { ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, @@ -712,7 +713,6 @@ int main(int argc, const char * const argv[]) } ap_fixup_virtual_hosts(pconf, ap_server_conf); ap_fini_vhost_config(pconf, ap_server_conf); - apr_hook_sort_all(); if (ap_run_check_config(pconf, plog, ptemp, ap_server_conf) != OK) { ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0,