You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/02/12 16:52:17 UTC

svn commit: r1070096 - /httpd/httpd/trunk/modules/aaa/mod_authn_file.c

Author: sf
Date: Sat Feb 12 15:52:17 2011
New Revision: 1070096

URL: http://svn.apache.org/viewvc?rev=1070096&view=rev
Log:
Log something nicer than "Internal error: pcfg_openfile() called
with NULL filename" if no password file is configured

Modified:
    httpd/httpd/trunk/modules/aaa/mod_authn_file.c

Modified: httpd/httpd/trunk/modules/aaa/mod_authn_file.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_authn_file.c?rev=1070096&r1=1070095&r2=1070096&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authn_file.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authn_file.c Sat Feb 12 15:52:17 2011
@@ -75,6 +75,12 @@ static authn_status check_password(reque
     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(reque
     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) {