httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1389339 - in /httpd/httpd/trunk: CHANGES include/http_config.h server/config.c
Date Mon, 24 Sep 2012 12:42:32 GMT
Author: trawick
Date: Mon Sep 24 12:42:32 2012
New Revision: 1389339

URL: http://svn.apache.org/viewvc?rev=1389339&view=rev
Log:
add pre_htaccess hook; in conjunction with earlier dirwalk_stat
and post_perdir_config hooks, this should allow mpm-itk to be
used without patches to httpd core


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/include/http_config.h
    httpd/httpd/trunk/server/config.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1389339&r1=1389338&r2=1389339&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Mon Sep 24 12:42:32 2012
@@ -9,7 +9,8 @@ Changes with Apache 2.5.0
      AuthFormLoginRequiredLocation, AuthFormLoginSuccessLocation and
      AuthFormLogoutLocation directives. [Graham Leggett]
 
-  *) core: Add dirwalk_stat hook.  [Jeff Trawick]
+  *) core: Add dirwalk_stat and pre_htaccess hooks, allowing mpm-itk
+     to be used without patches to httpd core.  [Jeff Trawick]
 
   *) mod_proxy: Allow for persistence of local changes (via the
      balancer-manager) between graceful and normal restarts.

Modified: httpd/httpd/trunk/include/http_config.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_config.h?rev=1389339&r1=1389338&r2=1389339&view=diff
==============================================================================
--- httpd/httpd/trunk/include/http_config.h (original)
+++ httpd/httpd/trunk/include/http_config.h Mon Sep 24 12:42:32 2012
@@ -1322,6 +1322,15 @@ AP_DECLARE_HOOK(int,quick_handler,(reque
 AP_DECLARE_HOOK(void,optional_fn_retrieve,(void))
 
 /**
+ * Allow modules to perform a check immediately prior to opening htaccess.
+ * @param r The current request
+ * @param filename The htaccess file which will be processed
+ * @return HTTP status code to fail the operation, or DECLINED to let later
+ * modules decide
+ */
+AP_DECLARE_HOOK(int,pre_htaccess,(request_rec *r, const char *filename))
+
+/**
  * A generic pool cleanup that will reset a pointer to NULL. For use with
  * apr_pool_cleanup_register.
  * @param data The address of the pointer

Modified: httpd/httpd/trunk/server/config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/config.c?rev=1389339&r1=1389338&r2=1389339&view=diff
==============================================================================
--- httpd/httpd/trunk/server/config.c (original)
+++ httpd/httpd/trunk/server/config.c Mon Sep 24 12:42:32 2012
@@ -80,6 +80,7 @@ APR_HOOK_STRUCT(
            APR_HOOK_LINK(quick_handler)
            APR_HOOK_LINK(optional_fn_retrieve)
            APR_HOOK_LINK(test_config)
+           APR_HOOK_LINK(pre_htaccess)
 )
 
 AP_IMPLEMENT_HOOK_RUN_ALL(int, header_parser,
@@ -171,6 +172,9 @@ AP_IMPLEMENT_HOOK_RUN_FIRST(int, handler
 AP_IMPLEMENT_HOOK_RUN_FIRST(int, quick_handler, (request_rec *r, int lookup),
                             (r, lookup), DECLINED)
 
+AP_IMPLEMENT_HOOK_RUN_FIRST(int, pre_htaccess, (request_rec *r, const char *filename),
+                            (r, filename), DECLINED)
+
 /* hooks with no args are implemented last, after disabling APR hook probes */
 #if defined(APR_HOOK_PROBES_ENABLED)
 #undef APR_HOOK_PROBES_ENABLED
@@ -2078,6 +2082,7 @@ AP_CORE_DECLARE(int) ap_parse_htaccess(a
     struct htaccess_result *new;
     ap_conf_vector_t *dc = NULL;
     apr_status_t status;
+    int rc;
 
     /* firstly, search cache */
     for (cache = r->htaccess; cache != NULL; cache = cache->next) {
@@ -2104,6 +2109,10 @@ AP_CORE_DECLARE(int) ap_parse_htaccess(a
          */
         filename = ap_make_full_path(r->pool, d,
                                      ap_getword_conf(r->pool, &access_name));
+        rc = ap_run_pre_htaccess(r, filename);
+        if (rc != DECLINED && rc != OK) {
+            return rc;
+        }
         status = ap_pcfg_openfile(&f, r->pool, filename);
 
         if (status == APR_SUCCESS) {



Mime
View raw message