From: Jeff Trawick Date: Mon, 14 Feb 2011 20:31:23 +0000 (+0000) Subject: Merge r1070096 from trunk: X-Git-Tag: 2.2.18~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4268087acda3df225ef7001b2c4a631b678a47dc;p=thirdparty%2Fapache%2Fhttpd.git Merge r1070096 from trunk: Log something nicer than "Internal error: pcfg_openfile() called with NULL filename" if no password file is configured Submitted by: sf Reviewed by: igalic, rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1070648 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 03ab2ed414a..5f85fec62bd 100644 --- a/STATUS +++ b/STATUS @@ -90,12 +90,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_authn_file: Log friendly error message if AuthUserFile is not set. - Trunk version of patch: - http://svn.apache.org/viewcvs.cgi?rev=1070096&view=rev - Backport version for 2.2.x of patch: - Trunk version of patch works with offset - +1: sf, igalic, rpluem PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/aaa/mod_authn_file.c b/modules/aaa/mod_authn_file.c index 018733e1ead..f3b2b9db735 100644 --- a/modules/aaa/mod_authn_file.c +++ b/modules/aaa/mod_authn_file.c @@ -70,6 +70,12 @@ static authn_status check_password(request_rec *r, const char *user, apr_status_t status; char *file_password = NULL; + if (!conf->pwfile) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, + "AuthUserFile not specified in the configuration"); + return AUTH_GENERAL_ERROR; + } + status = ap_pcfg_openfile(&f, r->pool, conf->pwfile); if (status != APR_SUCCESS) { @@ -118,6 +124,12 @@ static authn_status get_realm_hash(request_rec *r, const char *user, apr_status_t status; char *file_hash = NULL; + if (!conf->pwfile) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, + "AuthUserFile not specified in the configuration"); + return AUTH_GENERAL_ERROR; + } + status = ap_pcfg_openfile(&f, r->pool, conf->pwfile); if (status != APR_SUCCESS) {