From 7f1d8f6aadc10c5b55d25ab3a75d5794bc0154e5 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 12 Feb 2011 15:52:17 +0000 Subject: [PATCH] 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 --- modules/aaa/mod_authn_file.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) { -- 2.47.2