]> granicus.if.org Git - apache/commitdiff
Restore support for the AUTH_HANDLED return code in AUTHN providers,
authorEric Covener <covener@apache.org>
Wed, 3 Jul 2013 12:13:50 +0000 (12:13 +0000)
committerEric Covener <covener@apache.org>
Wed, 3 Jul 2013 12:13:50 +0000 (12:13 +0000)
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
include/mod_auth.h
modules/aaa/mod_auth_basic.c
modules/aaa/mod_auth_digest.c

index 9558b28960e3354ab5dfbe27e4ab44485c9ec878..c4f97fb48667f69badd7415fa067cd156d5aae57 100644 (file)
  * 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" */
 #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
index 9b9561e1d632d90621351131e341ce00939627b7..38c0412b48367c68805b21575ebdec051697ecd7 100644 (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 {
index 8c1367b30a6a28460fe3af4012376b2784d70847..b75e70e2a00f933ae721135382c20f82cac593b7 100644 (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
index e7645a47547c31c83828bff0982d119abb1cb82a..da80b7d2650ba49fad8c4d1ddd4f13b5da38e6f5 100644 (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