]> granicus.if.org Git - apache/commitdiff
mod_rewrite: Log errors if rewrite map files cannot be opened
authorStefan Fritsch <sf@apache.org>
Wed, 18 Aug 2010 20:35:43 +0000 (20:35 +0000)
committerStefan Fritsch <sf@apache.org>
Wed, 18 Aug 2010 20:35:43 +0000 (20:35 +0000)
PR: 49639

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986921 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index b18b82e7339ab73df6976e0fb56b84854907c18d..a140a47fc8af342ee7d8368202c30ef7e90898e1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@ Changes with Apache 2.3.7
      mod_dav, mod_cache, mod_session: Fix Handling of requests without a path 
      segment. PR: 49246 [Mark Drayton, Jeff Trawick]
 
+  *) mod_rewrite: Log errors if rewrite map files cannot be opened. PR 49639.
+     [Stefan Fritsch]
+
   *) mod_proxy_http: Support the 'ping' property for backend HTTP/1.1 servers
      via leveraging 100-Continue as the initial "request".
      [Jim Jagielski]
index ab8dde08ab02beea57f26802811e2d61d59fc74a..3f2bd0cd347a5ce3bc710b56774fcab23481f5a5 100644 (file)
@@ -1205,9 +1205,13 @@ static char *lookup_map_txtfile(request_rec *r, const char *file, char *key)
     apr_file_t *fp = NULL;
     char line[REWRITE_MAX_TXT_MAP_LINE + 1]; /* +1 for \0 */
     char *value, *keylast;
+    apr_status_t rv;
 
-    if (apr_file_open(&fp, file, APR_READ|APR_BUFFERED, APR_OS_DEFAULT,
-                      r->pool) != APR_SUCCESS) {
+    if ((rv = apr_file_open(&fp, file, APR_READ|APR_BUFFERED, APR_OS_DEFAULT,
+                            r->pool)) != APR_SUCCESS)
+    {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+                      "mod_rewrite: can't open text RewriteMap file %s", file);
         return NULL;
     }
 
@@ -1263,9 +1267,13 @@ static char *lookup_map_dbmfile(request_rec *r, const char *file,
     apr_datum_t dbmkey;
     apr_datum_t dbmval;
     char *value;
+    apr_status_t rv;
 
-    if (apr_dbm_open_ex(&dbmfp, dbmtype, file, APR_DBM_READONLY, APR_OS_DEFAULT,
-                        r->pool) != APR_SUCCESS) {
+    if ((rv = apr_dbm_open_ex(&dbmfp, dbmtype, file, APR_DBM_READONLY,
+                              APR_OS_DEFAULT, r->pool)) != APR_SUCCESS)
+    {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+                      "mod_rewrite: can't open DBM RewriteMap %s", file);
         return NULL;
     }