From: Stefan Fritsch Date: Wed, 18 Aug 2010 20:35:43 +0000 (+0000) Subject: mod_rewrite: Log errors if rewrite map files cannot be opened X-Git-Tag: 2.3.7~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ffa5cece3ca3789c745cb00a91ff7b4ece480c2;p=apache mod_rewrite: Log errors if rewrite map files cannot be opened PR: 49639 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986921 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index b18b82e733..a140a47fc8 100644 --- 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] diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index ab8dde08ab..3f2bd0cd34 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -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; }