httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r711245 - /httpd/test/framework/trunk/c-modules/authany/mod_authany.c
Date Tue, 04 Nov 2008 13:12:47 GMT
Author: rpluem
Date: Tue Nov  4 05:12:47 2008
New Revision: 711245

URL: http://svn.apache.org/viewvc?rev=711245&view=rev
Log:
* We must have an authn provider when using >= 2.3.

Submitted by: chrisd
Reviewed by: rpluem

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=711245&r1=711244&r2=711245&view=diff
==============================================================================
--- httpd/test/framework/trunk/c-modules/authany/mod_authany.c (original)
+++ httpd/test/framework/trunk/c-modules/authany/mod_authany.c Tue Nov  4 05:12:47 2008
@@ -5,6 +5,9 @@
    require user any-user
    AuthType Basic
    AuthName authany
+   <IfVersion >= 2.3>
+      AuthBasicProvider any
+   </IfVersion>
 </Location>
 
 #endif
@@ -19,6 +22,18 @@
 #include "ap_provider.h"
 #include "mod_auth.h"
 
+static authn_status authn_check_password(request_rec *r, const char *user,
+                                         const char *password)
+{
+    return strtrue(r->user) && strcmp(r->user, "guest") == 0
+        ? AUTH_GRANTED : AUTH_DENIED;
+}
+
+static const authn_provider authn_any_provider =
+{
+    &authn_check_password
+};
+
 static authz_status any_check_authorization(request_rec *r,
                                             const char *requirement)
 {
@@ -28,11 +43,13 @@
 
 static const authz_provider authz_any_provider =
 {
-    &any_check_authorization,
+    &any_check_authorization
 };
 
 static void extra_hooks(apr_pool_t *p)
 {
+    ap_register_provider(p, AUTHN_PROVIDER_GROUP,
+                         "any", "0", &authn_any_provider);
     ap_register_provider(p, AUTHZ_PROVIDER_GROUP,
                          "user", "0", &authz_any_provider);
 }



Mime
View raw message