You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2009/03/20 16:24:03 UTC

svn commit: r756525 - /httpd/test/framework/trunk/c-modules/authany/mod_authany.c

Author: trawick
Date: Fri Mar 20 15:24:02 2009
New Revision: 756525

URL: http://svn.apache.org/viewvc?rev=756525&view=rev
Log:
ensure that mod_authany's check user id hook runs after mod_ssl's

if it runs before, mod_authany can't find the auth header it needs and 
ssl/basicauth and ssl/fakeauth tests will fail

providers are used by mod_authany for httpd >= 2.3, so that build is unaffected

httpd < 2.0 doesn't have the API for hook ordering, so that build is unaffected

Modified:
    httpd/test/framework/trunk/c-modules/authany/mod_authany.c

Modified: httpd/test/framework/trunk/c-modules/authany/mod_authany.c
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/c-modules/authany/mod_authany.c?rev=756525&r1=756524&r2=756525&view=diff
==============================================================================
--- httpd/test/framework/trunk/c-modules/authany/mod_authany.c (original)
+++ httpd/test/framework/trunk/c-modules/authany/mod_authany.c Fri Mar 20 15:24:02 2009
@@ -60,10 +60,22 @@
 
 #else /* < 2.3 */
 
+#ifdef APACHE2
+
+#include "apr_pools.h"
+
+static void extra_hooks(apr_pool_t *);
+
+#define APACHE_HTTPD_TEST_EXTRA_HOOKS extra_hooks
+
+#else
+
 #define APACHE_HTTPD_TEST_HOOK_ORDER    APR_HOOK_FIRST
 #define APACHE_HTTPD_TEST_CHECK_USER_ID authany_handler
 #define APACHE_HTTPD_TEST_AUTH_CHECKER  require_any_user
 
+#endif
+
 #include "apache_httpd_test.h"
  
 static int require_any_user(request_rec *r)
@@ -130,6 +142,23 @@
 
      return OK;
 }
+
+#ifdef APACHE2
+static void extra_hooks(apr_pool_t *p)
+{
+    /* mod_authany and mod_ssl both specify APR_HOOK_FIRST as the
+     * ordering of their check-user-id hooks.
+     * mod_ssl's must run before mod_authany because it may need to
+     * generate the Basic auth information based on the certificate.
+     */
+    static const char * const modssl_runs_before[] = {"mod_ssl.c", NULL};
+
+    ap_hook_check_user_id(authany_handler, modssl_runs_before, NULL,
+                          APR_HOOK_FIRST);
+    ap_hook_auth_checker(require_any_user, NULL, NULL, APR_HOOK_FIRST);
+}
+#endif
+
 #endif
 
 APACHE_HTTPD_TEST_MODULE(authany);