diff -Nru apache2-2.4.7/debian/changelog apache2-2.4.7/debian/changelog --- apache2-2.4.7/debian/changelog 2015-07-24 11:44:37.000000000 -0500 +++ apache2-2.4.7/debian/changelog 2015-08-30 15:25:28.000000000 -0500 @@ -1,3 +1,22 @@ +apache2 (2.4.7-1ubuntu4.6) trusty; urgency=medium + + * d/p/fix_rewrite_rule.patch: Add a configurable option to keep mod_dir from + running when another handler is set. This makes default behavior + consistant with 2.2, and fixes (LP: #1394403) + - This adds the configuration option "DirectoryCheckHandler" which is + present in apache 2.4.8 and later versions. The default value is + "DirectoryCheckHandler Off". + - This will change default behavior. Instead of mod_dir running even if + other rules are being run, mod_dir will only run when no other rules + have been processed by default. This is the expected behavior of + mod_dir, and is consistant with the behavior of mod_dir in apache + versions < 2.4 and > 2.4.8, and so the default value of this + configuration option will correct the bug. + - The current default behavior, which is considered to be a bug, can be + kept by setting "DirectoryCheckHandler On". + + -- Wesley Wiedenmeier Tue, 18 Aug 2015 09:36:21 -0500 + apache2 (2.4.7-1ubuntu4.5) trusty-security; urgency=medium * SECURITY UPDATE: request smuggling via chunked transfer encoding diff -Nru apache2-2.4.7/debian/patches/fix_rewrite_rule.patch apache2-2.4.7/debian/patches/fix_rewrite_rule.patch --- apache2-2.4.7/debian/patches/fix_rewrite_rule.patch 1969-12-31 18:00:00.000000000 -0600 +++ apache2-2.4.7/debian/patches/fix_rewrite_rule.patch 2015-08-30 15:02:26.000000000 -0500 @@ -0,0 +1,92 @@ +Description: Add DirectoryCheckHandler to allow a 2.2-like behavior, + skipping execution when handler is already set. +Bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=53929#c10 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1394403 +Origin: upstream, https://github.com/apache/httpd/commit/f0529e54b8d889322b5113eb623e263556bfa28e +Last-Update: 2015-08-18 + +Index: apache2-2.4.7/modules/mappers/mod_dir.c +=================================================================== +--- apache2-2.4.7.orig/modules/mappers/mod_dir.c ++++ apache2-2.4.7/modules/mappers/mod_dir.c +@@ -33,17 +33,18 @@ + module AP_MODULE_DECLARE_DATA dir_module; + + typedef enum { +- SLASH_OFF = 0, +- SLASH_ON, +- SLASH_UNSET +-} slash_cfg; ++ MODDIR_OFF = 0, ++ MODDIR_ON, ++ MODDIR_UNSET ++} moddir_cfg; + + #define REDIRECT_OFF 0 + #define REDIRECT_UNSET 1 + + typedef struct dir_config_struct { + apr_array_header_t *index_names; +- slash_cfg do_slash; ++ moddir_cfg do_slash; ++ moddir_cfg checkhandler; + int redirect_index; + const char *dflt; + } dir_config_rec; +@@ -83,7 +84,14 @@ static const char *configure_slash(cmd_p + { + dir_config_rec *d = d_; + +- d->do_slash = arg ? SLASH_ON : SLASH_OFF; ++ d->do_slash = arg ? MODDIR_ON : MODDIR_OFF; ++ return NULL; ++} ++static const char *configure_checkhandler(cmd_parms *cmd, void *d_, int arg) ++{ ++ dir_config_rec *d = d_; ++ ++ d->checkhandler = arg ? MODDIR_ON : MODDIR_OFF; + return NULL; + } + static const char *configure_redirect(cmd_parms *cmd, void *d_, const char *arg1) +@@ -123,6 +131,8 @@ static const command_rec dir_cmds[] = + "a list of file names"), + AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS, + "On or Off"), ++ AP_INIT_FLAG("DirectoryCheckHandler", configure_checkhandler, NULL, DIR_CMD_PERMS, ++ "On or Off"), + AP_INIT_TAKE1("DirectoryIndexRedirect", configure_redirect, + NULL, DIR_CMD_PERMS, "On, Off, or a 3xx status code."), + +@@ -134,7 +144,8 @@ static void *create_dir_config(apr_pool_ + dir_config_rec *new = apr_pcalloc(p, sizeof(dir_config_rec)); + + new->index_names = NULL; +- new->do_slash = SLASH_UNSET; ++ new->do_slash = MODDIR_UNSET; ++ new->checkhandler = MODDIR_UNSET; + new->redirect_index = REDIRECT_UNSET; + return (void *) new; + } +@@ -147,7 +158,9 @@ static void *merge_dir_configs(apr_pool_ + + new->index_names = add->index_names ? add->index_names : base->index_names; + new->do_slash = +- (add->do_slash == SLASH_UNSET) ? base->do_slash : add->do_slash; ++ (add->do_slash == MODDIR_UNSET) ? base->do_slash : add->do_slash; ++ new->checkhandler = ++ (add->checkhandler == MODDIR_UNSET) ? base->checkhandler : add->checkhandler; + new->redirect_index= + (add->redirect_index == REDIRECT_UNSET) ? base->redirect_index : add->redirect_index; + new->dflt = add->dflt ? add->dflt : base->dflt; +@@ -260,6 +273,10 @@ static int fixup_dir(request_rec *r) + return HTTP_MOVED_PERMANENTLY; + } + ++ if (d->checkhandler == MODDIR_ON && strcmp(r->handler, DIR_MAGIC_TYPE)) { ++ return DECLINED; ++ } ++ + if (d->index_names) { + names_ptr = (char **)d->index_names->elts; + num_names = d->index_names->nelts; diff -Nru apache2-2.4.7/debian/patches/series apache2-2.4.7/debian/patches/series --- apache2-2.4.7/debian/patches/series 2015-07-24 11:44:02.000000000 -0500 +++ apache2-2.4.7/debian/patches/series 2015-08-21 18:42:07.000000000 -0500 @@ -20,3 +20,4 @@ CVE-2014-3581.patch CVE-2015-3183.patch CVE-2015-3185.patch +fix_rewrite_rule.patch