From: Joshua Slive Date: Sun, 21 Jul 2002 18:06:51 +0000 (+0000) Subject: Fix some hook ordering problems. mod_vhost_alias should, perhaps, be HOOK_LAST. X-Git-Tag: 2.0.40~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=963d47482bccb38f54a670bf9cd56cdacb507403;p=thirdparty%2Fapache%2Fhttpd.git Fix some hook ordering problems. mod_vhost_alias should, perhaps, be HOOK_LAST. It redefines the document root, so it should only be used if no other mapper wants the request. I haven't made that change here; I've simply put explict ordering to make sure we get mod_alias -> mod_userdir -> mod_vhost_alias I can't compile apache at the moment for other reasons, so this is untested, but it looks right to me. PR: 8853 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96137 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_alias.c b/modules/mappers/mod_alias.c index 6f8ab6c3f14..d600fb232f3 100644 --- a/modules/mappers/mod_alias.c +++ b/modules/mappers/mod_alias.c @@ -474,7 +474,8 @@ static int fixup_redir(request_rec *r) static void register_hooks(apr_pool_t *p) { - static const char * const aszSucc[]={ "mod_userdir.c", NULL }; + static const char * const aszSucc[]={ "mod_userdir.c", + "mod_vhost_alias.c",NULL }; ap_hook_translate_name(translate_alias_redir,NULL,aszSucc,APR_HOOK_MIDDLE); ap_hook_fixups(fixup_redir,NULL,NULL,APR_HOOK_MIDDLE); diff --git a/modules/mappers/mod_userdir.c b/modules/mappers/mod_userdir.c index 7d874bf5fd9..e76b2fe1dd2 100644 --- a/modules/mappers/mod_userdir.c +++ b/modules/mappers/mod_userdir.c @@ -392,8 +392,9 @@ static ap_unix_identity_t *get_suexec_id_doer(const request_rec *r) static void register_hooks(apr_pool_t *p) { static const char * const aszPre[]={ "mod_alias.c",NULL }; + static const char * const aszSucc[]={ "mod_vhost_alias.c",NULL }; - ap_hook_translate_name(translate_userdir,aszPre,NULL,APR_HOOK_MIDDLE); + ap_hook_translate_name(translate_userdir,aszPre,aszSucc,APR_HOOK_MIDDLE); #ifdef HAVE_UNIX_SUEXEC ap_hook_get_suexec_identity(get_suexec_id_doer,NULL,NULL,APR_HOOK_MIDDLE); #endif diff --git a/modules/mappers/mod_vhost_alias.c b/modules/mappers/mod_vhost_alias.c index fd01b5bcad3..9ad9f12c5ea 100644 --- a/modules/mappers/mod_vhost_alias.c +++ b/modules/mappers/mod_vhost_alias.c @@ -481,7 +481,9 @@ static int mva_translate(request_rec *r) static void register_hooks(apr_pool_t *p) { - ap_hook_translate_name(mva_translate, NULL, NULL, APR_HOOK_MIDDLE); + static const char * const aszPre[]={ "mod_alias.c","mod_userdir.c",NULL }; + + ap_hook_translate_name(mva_translate, aszPre, NULL, APR_HOOK_MIDDLE); } module AP_MODULE_DECLARE_DATA vhost_alias_module =