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
This commit is contained in:
Eric Covener
2013-07-03 12:13:50 +00:00
parent e4e1533f6a
commit 7fbc93eac7
4 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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