]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1070096 from trunk:
authorJeff Trawick <trawick@apache.org>
Mon, 14 Feb 2011 20:31:23 +0000 (20:31 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 14 Feb 2011 20:31:23 +0000 (20:31 +0000)
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

STATUS
modules/aaa/mod_authn_file.c

diff --git a/STATUS b/STATUS
index 03ab2ed414a93a4a5c2f72b63398e7ac7077681d..5f85fec62bd37bd5614fcb182d08ee2a5af13fd8 100644 (file)
--- 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 ]
index 018733e1ead0b29d6091846d474000a9f18b212a..f3b2b9db735dc590361e20b313355af2652870eb 100644 (file)
@@ -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) {