From: Paul Querna Date: Thu, 26 May 2005 20:34:21 +0000 (+0000) Subject: Fix segmentation fault in mod_auth_{basic,digest} when no provider is explicitly... X-Git-Tag: 2.1.5~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df86e987f785a760bfd777dac31be125a1d3fc59;p=apache Fix segmentation fault in mod_auth_{basic,digest} when no provider is explicitly listed. Reported by: Ben Collins-Sussman git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@178674 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_auth_basic.c b/modules/aaa/mod_auth_basic.c index b4b48a6f21..ee296a4491 100644 --- a/modules/aaa/mod_auth_basic.c +++ b/modules/aaa/mod_auth_basic.c @@ -232,12 +232,13 @@ static int authenticate_basic_user(request_rec *r) auth_result = AUTH_GENERAL_ERROR; break; } + apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, AUTHN_DEFAULT_PROVIDER); } else { provider = current_provider->provider; + apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, current_provider->provider_name); } - apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, current_provider->provider_name); auth_result = provider->check_password(r, sent_user, sent_pw); diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index 7edf320183..9756ac2611 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -1353,12 +1353,13 @@ static authn_status get_hash(request_rec *r, const char *user, auth_result = AUTH_GENERAL_ERROR; break; } + apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, AUTHN_DEFAULT_PROVIDER); } else { provider = current_provider->provider; + apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, current_provider->provider_name); } - apr_table_setn(r->notes, AUTHN_PROVIDER_NAME_NOTE, current_provider->provider_name); /* We expect the password to be md5 hash of user:realm:password */ auth_result = provider->get_realm_hash(r, user, conf->realm,