From 7fbc93eac7f9af34b52ced5c824867e211d01ef6 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Wed, 3 Jul 2013 12:13:50 +0000 Subject: [PATCH] Restore support for the AUTH_HANDLED return code in AUTHN providers, like in 2.2, which allows authn provider to return their own status in r->status (custom error code, or return a redirect) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1499351 13f79535-47bb-0310-9956-ffa450edef68 --- include/ap_mmn.h | 3 ++- include/mod_auth.h | 3 ++- modules/aaa/mod_auth_basic.c | 3 +++ modules/aaa/mod_auth_digest.c | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 9558b28960..c4f97fb486 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -435,6 +435,7 @@ * 20121222.15 (2.5.0-dev) Add allow/decode_encoded_slashes_set to core_dir_config * 20121222.16 (2.5.0-dev) AP_DEFAULT_HANDLER_NAME/AP_IS_DEAULT_HANDLER_NAME * 20130702.0 (2.5.0-dev) Remove pre_htaccess hook, add open_htaccess hook. + * 20130702.1 (2.5.0-dev) Restore AUTH_HANDLED to mod_auth.h */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ @@ -442,7 +443,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20130702 #endif -#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/mod_auth.h b/include/mod_auth.h index 9b9561e1d6..38c0412b48 100644 --- a/include/mod_auth.h +++ b/include/mod_auth.h @@ -66,7 +66,8 @@ typedef enum { AUTH_GRANTED, AUTH_USER_FOUND, AUTH_USER_NOT_FOUND, - AUTH_GENERAL_ERROR + AUTH_GENERAL_ERROR, + AUTH_HANDLED } authn_status; typedef enum { diff --git a/modules/aaa/mod_auth_basic.c b/modules/aaa/mod_auth_basic.c index 8c1367b30a..b75e70e2a0 100644 --- a/modules/aaa/mod_auth_basic.c +++ b/modules/aaa/mod_auth_basic.c @@ -359,6 +359,9 @@ static int authenticate_basic_user(request_rec *r) "user %s not found: %s", sent_user, r->uri); return_code = HTTP_UNAUTHORIZED; break; + case AUTH_HANDLED: + return_code = r->status; + break; case AUTH_GENERAL_ERROR: default: /* We'll assume that the module has already said what its error diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index e7645a4754..da80b7d265 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -1728,6 +1728,9 @@ static int authenticate_digest_user(request_rec *r) note_digest_auth_failure(r, conf, resp, 0); return HTTP_UNAUTHORIZED; } + else if (return_code == AUTH_HANDLED) { + return r->status; + } else { /* AUTH_GENERAL_ERROR (or worse) * We'll assume that the module has already said what its error -- 2.40.0