]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_auth_form: don't crash when no AuthFormProvider is configured. PR 56351
authorYann Ylavic <ylavic@apache.org>
Mon, 7 Apr 2014 08:59:07 +0000 (08:59 +0000)
committerYann Ylavic <ylavic@apache.org>
Mon, 7 Apr 2014 08:59:07 +0000 (08:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1585431 13f79535-47bb-0310-9956-ffa450edef68

docs/log-message-tags/next-number
modules/aaa/mod_auth_form.c

index c7726ec82ae69568b1bbc0094031ba4cfaf58a43..d9e63ef1b8fc004cfd4a8c292ee16c7c3f08185d 100644 (file)
@@ -1 +1 @@
-2615
+2620
index e72857a6a70fd3fe5b442102e90761b7d4fbb4fc..ef1bfd2e962c6df044acfbd7fcc7c7b10a15e5ff 100644 (file)
@@ -909,6 +909,14 @@ static int authenticate_form_authn(request_rec * r)
         return HTTP_INTERNAL_SERVER_ERROR;
     }
 
+    /* We need an authentication provider. */
+    if (!conf->providers) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR,
+                      0, r, APLOGNO(02617) "need AuthFormProvider: %s",
+                      r->uri);
+        return HTTP_INTERNAL_SERVER_ERROR;
+    }
+
     /* We need an authentication realm. */
     if (!ap_auth_name(r)) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR,
@@ -1282,7 +1290,7 @@ static int authenticate_form_post_config(apr_pool_t *pconf, apr_pool_t *plog,
         ap_session_get_fn = APR_RETRIEVE_OPTIONAL_FN(ap_session_get);
         ap_session_set_fn = APR_RETRIEVE_OPTIONAL_FN(ap_session_set);
         if (!ap_session_load_fn || !ap_session_get_fn || !ap_session_set_fn) {
-            ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, APLOGNO()
+            ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, APLOGNO(02618)
                     "You must load mod_session to enable the mod_auth_form "
                                        "functions");
             return !OK;
@@ -1293,7 +1301,7 @@ static int authenticate_form_post_config(apr_pool_t *pconf, apr_pool_t *plog,
         ap_request_insert_filter_fn = APR_RETRIEVE_OPTIONAL_FN(ap_request_insert_filter);
         ap_request_remove_filter_fn = APR_RETRIEVE_OPTIONAL_FN(ap_request_remove_filter);
         if (!ap_request_insert_filter_fn || !ap_request_remove_filter_fn) {
-            ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, APLOGNO()
+            ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, APLOGNO(02619)
                     "You must load mod_request to enable the mod_auth_form "
                                        "functions");
             return !OK;