You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2008/11/04 14:12:47 UTC
svn commit: r711245 -
/httpd/test/framework/trunk/c-modules/authany/mod_authany.c
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);
}