Hi,
while looking at backport candidate to synch 2.4 and trunk, I found this
commit.
It seems harmless to me, so could be a good candidate.
Actually, it should be no use in module provided with apache, because
none seems to use AUTH_HANDLED.
So I assume that restoring this behavior was dedicated to 3rd party module.
However, I've looked at 2.2 (i.e. 2.2.x dev branch) but did not find any
AUTH_HANDLED in the code.
Even "->ststus" is not part of mod_auth_basic.c and mod_auth_digest.c.
So I don't see how it "Restore support for the AUTH_HANDLED return code
in AUTHN providers, like in 2.2"
Could you please elaborate?
Was it done elsewhere or another way?
CJ
Le 03/07/2013 14:13, [email protected] a écrit :
Author: covener
Date: Wed Jul 3 12:13:50 2013
New Revision: 1499351
URL: http://svn.apache.org/r1499351
Log:
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)
Modified:
httpd/httpd/trunk/include/ap_mmn.h
httpd/httpd/trunk/include/mod_auth.h
httpd/httpd/trunk/modules/aaa/mod_auth_basic.c
httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
Modified: httpd/httpd/trunk/include/ap_mmn.h
URL:
http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=1499351&r1=1499350&r2=1499351&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Wed Jul 3 12:13:50 2013
@@ -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
Modified: httpd/httpd/trunk/include/mod_auth.h
URL:
http://svn.apache.org/viewvc/httpd/httpd/trunk/include/mod_auth.h?rev=1499351&r1=1499350&r2=1499351&view=diff
==============================================================================
--- httpd/httpd/trunk/include/mod_auth.h (original)
+++ httpd/httpd/trunk/include/mod_auth.h Wed Jul 3 12:13:50 2013
@@ -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 {
Modified: httpd/httpd/trunk/modules/aaa/mod_auth_basic.c
URL:
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_auth_basic.c?rev=1499351&r1=1499350&r2=1499351&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_auth_basic.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_auth_basic.c Wed Jul 3 12:13:50 2013
@@ -359,6 +359,9 @@ static int authenticate_basic_user(reque
"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
Modified: httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
URL:
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_auth_digest.c?rev=1499351&r1=1499350&r2=1499351&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_auth_digest.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Wed Jul 3 12:13:50 2013
@@ -1728,6 +1728,9 @@ static int authenticate_digest_user(requ
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