From: Yann Ylavic Date: Mon, 7 Apr 2014 08:59:07 +0000 (+0000) Subject: mod_auth_form: don't crash when no AuthFormProvider is configured. PR 56351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9acddccd99cf3048b26b5c5dec70ec3d5283c9f0;p=thirdparty%2Fapache%2Fhttpd.git mod_auth_form: don't crash when no AuthFormProvider is configured. PR 56351 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1585431 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index c7726ec82ae..d9e63ef1b8f 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -2615 +2620 diff --git a/modules/aaa/mod_auth_form.c b/modules/aaa/mod_auth_form.c index e72857a6a70..ef1bfd2e962 100644 --- a/modules/aaa/mod_auth_form.c +++ b/modules/aaa/mod_auth_form.c @@ -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;