From: Jim Jagielski Date: Sat, 8 Dec 2007 14:07:25 +0000 (+0000) Subject: Merge r598299, r599393 from trunk: X-Git-Tag: 2.2.7~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=485f88e4e3a7663980c396b1a62e4a34c9d1e3e1;p=thirdparty%2Fapache%2Fhttpd.git Merge r598299, r599393 from trunk: mod_filter: don't segfault on (unsupported) chained FilterProviders. PR 43956 Since we don't support chained filters, and can't expect to while the filter_init problem remains, we should make it clear to users at startup time. Submitted by: niq Reviewed by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@602472 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a7a20909c3a..f8f4b8ba18c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.7 + *) mod_filter: Don't segfault on (unsupported) chained FilterProvider usage. + PR 43956 [Nick Kew, Ruediger Pluem] + *) core: Handle unrecognised transfer-encodings. PR 43882 [Nick Kew, Jeff Trawick] diff --git a/STATUS b/STATUS index c2fcf662198..7a9d22a32b3 100644 --- a/STATUS +++ b/STATUS @@ -79,12 +79,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_filter: Don't try to support chained filters when it doesn't work - PR 43956 - http://svn.apache.org/viewvc?view=rev&revision=598299 - http://svn.apache.org/viewvc?view=rev&revision=599393 - +1: niq, rpluem, jim - * http_protocol: Escape request method in 413 error reporting. Determined to be not generally exploitable, but a flaw in any case. PR 44014 [Victor Stinner ] diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c index 778895b4689..3ba13c954ec 100644 --- a/modules/filters/mod_filter.c +++ b/modules/filters/mod_filter.c @@ -137,7 +137,12 @@ static int filter_init(ap_filter_t *f) harness_ctx *fctx = apr_pcalloc(f->r->pool, sizeof(harness_ctx)); for (p = filter->providers; p; p = p->next) { - if (p->frec->filter_init_func) { + if (p->frec->filter_init_func == filter_init) { + ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, + "Chaining of FilterProviders not supported"); + return HTTP_INTERNAL_SERVER_ERROR; + } + else if (p->frec->filter_init_func) { f->ctx = NULL; if ((err = p->frec->filter_init_func(f)) != OK) { ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, @@ -532,10 +537,6 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, const char *args) /* if provider has been registered, we can look it up */ provider_frec = ap_get_output_filter_handle(pname); - if (!provider_frec) { - provider_frec = apr_hash_get(cfg->live_filters, pname, - APR_HASH_KEY_STRING); - } if (!provider_frec) { return apr_psprintf(cmd->pool, "Unknown filter provider %s", pname); }