From: Stefan Fritsch Date: Sat, 12 Feb 2011 15:52:17 +0000 (+0000) Subject: Log something nicer than "Internal error: pcfg_openfile() called X-Git-Tag: 2.3.11~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f1d8f6aadc10c5b55d25ab3a75d5794bc0154e5;p=thirdparty%2Fapache%2Fhttpd.git Log something nicer than "Internal error: pcfg_openfile() called with NULL filename" if no password file is configured git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070096 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_authn_file.c b/modules/aaa/mod_authn_file.c index a50b47d2d8e..90c5d263672 100644 --- a/modules/aaa/mod_authn_file.c +++ b/modules/aaa/mod_authn_file.c @@ -75,6 +75,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) { @@ -124,6 +130,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) {