From 4c68475035ab746354b9c52d312b32f5facffdd1 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 19 Nov 2001 21:09:20 +0000 Subject: [PATCH] Fixed the behavior of the XBitHack directive. PR: 8804 Submitted by: Taketo Kabe , Cliff Woolley git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92040 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/filters/mod_include.c | 27 +++++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 20435e5a64..a7b079fb9e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.29-dev + *) Fixed the behavior of the XBitHack directive. + [Taketo Kabe , Cliff Woolley] PR#8804 + *) The threaded MPM for Unix has been removed. Use the worker MPM instead. [various] diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 5f406b79ca..8c4f287c1f 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -3052,14 +3052,6 @@ static apr_status_t includes_filter(ap_filter_t *f, apr_bucket_brigade *b) ctx->bytes_parsed = 0; } - /* Assure the platform supports Group protections */ - if ((*conf->xbithack == xbithack_full) - && (r->finfo.valid & APR_FINFO_GPROT) - && (r->finfo.protection & APR_GEXECUTE)) { - ap_update_mtime(r, r->finfo.mtime); - ap_set_last_modified(r); - } - if ((parent = ap_get_module_config(r->request_config, &include_module))) { /* Kludge --- for nested includes, we want to keep the subprocess * environment of the base document (for compatibility); that means @@ -3100,9 +3092,20 @@ static apr_status_t includes_filter(ap_filter_t *f, apr_bucket_brigade *b) * a program which may change the Last-Modified header or make the * content completely dynamic. Therefore, we can't support these * headers. + * Exception: XBitHack full means we *should* set the Last-Modified field. */ apr_table_unset(f->r->headers_out, "ETag"); - apr_table_unset(f->r->headers_out, "Last-Modified"); + + /* Assure the platform supports Group protections */ + if ((*conf->xbithack == xbithack_full) + && (r->finfo.valid & APR_FINFO_GPROT) + && (r->finfo.protection & APR_GEXECUTE)) { + ap_update_mtime(r, r->finfo.mtime); + ap_set_last_modified(r); + } + else { + apr_table_unset(f->r->headers_out, "Last-Modified"); + } return send_parsed_content(&b, r, f); } @@ -3172,7 +3175,7 @@ static int xbithack_handler(request_rec *r) /* OS/2 dosen't currently support the xbithack. This is being worked on. */ return DECLINED; #else - enum xbithack *state; + include_dir_config *conf; if (ap_strcmp_match(r->handler, "text/html")) { return DECLINED; @@ -3181,10 +3184,10 @@ static int xbithack_handler(request_rec *r) return DECLINED; } - state = (enum xbithack *) ap_get_module_config(r->per_dir_config, + conf = (include_dir_config *) ap_get_module_config(r->per_dir_config, &include_module); - if (*state == xbithack_off) { + if (*conf->xbithack == xbithack_off) { return DECLINED; } /* We always return declined, because the default handler will actually -- 2.40.0