]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Log something nicer than "Internal error: pcfg_openfile() called
authorStefan Fritsch <sf@apache.org>
Sat, 12 Feb 2011 15:52:17 +0000 (15:52 +0000)
committerStefan Fritsch <sf@apache.org>
Sat, 12 Feb 2011 15:52:17 +0000 (15:52 +0000)
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

index a50b47d2d8e3228386aaaa7299455f67dee7a252..90c5d263672b7cc7277741bb49ee2521868b1d73 100644 (file)
@@ -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) {