summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Boehm <hollow@gentoo.org>2008-01-29 00:20:50 +0000
committerBenedikt Boehm <hollow@gentoo.org>2008-01-29 00:20:50 +0000
commitd64e5ce47b093cb6427e86c0c22ea5a67e28e4a3 (patch)
tree006c27dbcf6c9d002cfadac73580ae0e6a9e1d43 /2.2/patches
parentfix #206588 (diff)
downloadapache-d64e5ce47b093cb6427e86c0c22ea5a67e28e4a3.tar.gz
apache-d64e5ce47b093cb6427e86c0c22ea5a67e28e4a3.tar.bz2
apache-d64e5ce47b093cb6427e86c0c22ea5a67e28e4a3.zip
delete 02_all_gentoo_mod_dir_incremental.patch wrt #139451; update ampescape patch
Diffstat (limited to '2.2/patches')
-rw-r--r--2.2/patches/01_all_mod_rewrite_ampescape.patch43
-rw-r--r--2.2/patches/02_all_gentoo_mod_dir_incremental.patch96
2 files changed, 21 insertions, 118 deletions
diff --git a/2.2/patches/01_all_mod_rewrite_ampescape.patch b/2.2/patches/01_all_mod_rewrite_ampescape.patch
index 4347d49..0e22093 100644
--- a/2.2/patches/01_all_mod_rewrite_ampescape.patch
+++ b/2.2/patches/01_all_mod_rewrite_ampescape.patch
@@ -1,4 +1,3 @@
-Provide escaping for the ampersand in mod_rewrite
Index: httpd-2.2.8/modules/mappers/mod_rewrite.c
===================================================================
--- httpd-2.2.8.orig/modules/mappers/mod_rewrite.c
@@ -7,30 +6,30 @@ Index: httpd-2.2.8/modules/mappers/mod_rewrite.c
return ap_escape_uri(r->pool, key);
}
-+static char *rewrite_mapfunc_ampescape(request_rec *r, char *key) {
-+ /* we only need to escape the ampersand */
++static char *rewrite_mapfunc_ampescape(request_rec *r, char *key)
++{
++ /* we only need to escape the ampersand */
++ unsigned char *copy = (char *)apr_palloc(r->pool, 3 * strlen(key) + 3);
++ const unsigned char *s = (const unsigned char *)key;
++ unsigned char *d = (unsigned char *)copy;
++ unsigned c;
+
-+ unsigned char *copy = (char *)apr_palloc(r->pool, 3 * strlen(key) + 3);
-+ const unsigned char *s = (const unsigned char *)key;
-+ unsigned char *d = (unsigned char *)copy;
-+ unsigned c;
++ while ((c = *s)) {
++ if (c == '&') {
++ *d++ = '%';
++ *d++ = '2';
++ *d++ = '6';
++ }
++ else {
++ *d++ = c;
++ }
++ ++s;
++ }
++ *d = '\0';
+
-+ while ((c = *s)) {
-+ if (c == '&') {
-+ *d++ = '%';
-+ *d++ = '2';
-+ *d++ = '6';
-+ } else {
-+ *d++ = c;
-+ }
-+ ++s;
-+ }
-+ *d = '\0';
-+
-+ return copy;
++ return copy;
+}
+
-+
static char *rewrite_mapfunc_unescape(request_rec *r, char *key)
{
ap_unescape_url(key);
@@ -38,7 +37,7 @@ Index: httpd-2.2.8/modules/mappers/mod_rewrite.c
map_pfn_register("tolower", rewrite_mapfunc_tolower);
map_pfn_register("toupper", rewrite_mapfunc_toupper);
map_pfn_register("escape", rewrite_mapfunc_escape);
-+ map_pfn_register("ampescape", rewrite_mapfunc_ampescape);
++ map_pfn_register("ampescape", rewrite_mapfunc_ampescape);
map_pfn_register("unescape", rewrite_mapfunc_unescape);
}
return OK;
diff --git a/2.2/patches/02_all_gentoo_mod_dir_incremental.patch b/2.2/patches/02_all_gentoo_mod_dir_incremental.patch
deleted file mode 100644
index 8253fc0..0000000
--- a/2.2/patches/02_all_gentoo_mod_dir_incremental.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-Index: httpd-2.2.6/modules/mappers/mod_dir.c
-===================================================================
---- httpd-2.2.6.orig/modules/mappers/mod_dir.c
-+++ httpd-2.2.6/modules/mappers/mod_dir.c
-@@ -39,6 +39,7 @@ typedef enum {
-
- typedef struct dir_config_struct {
- apr_array_header_t *index_names;
-+ apr_array_header_t *index_names_incr;
- slash_cfg do_slash;
- } dir_config_rec;
-
-@@ -55,6 +56,23 @@ static const char *add_index(cmd_parms *
- return NULL;
- }
-
-+static const char *add_index_incr(cmd_parms *cmd, void *dummy, const char *arg)
-+{
-+ const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-+
-+ if (err != NULL) {
-+ return err;
-+ }
-+
-+ dir_config_rec *d = dummy;
-+
-+ if (!d->index_names_incr) {
-+ d->index_names_incr = apr_array_make(cmd->pool, 2, sizeof(char *));
-+ }
-+ *(const char **)apr_array_push(d->index_names_incr) = arg;
-+ return NULL;
-+}
-+
- static const char *configure_slash(cmd_parms *cmd, void *d_, int arg)
- {
- dir_config_rec *d = d_;
-@@ -67,6 +85,8 @@ static const command_rec dir_cmds[] =
- {
- AP_INIT_ITERATE("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS,
- "a list of file names"),
-+ AP_INIT_ITERATE("AddDirectoryIndex", add_index_incr, NULL, RSRC_CONF,
-+ "a list of file names"),
- AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS,
- "On or Off"),
- {NULL}
-@@ -77,6 +97,7 @@ static void *create_dir_config(apr_pool_
- dir_config_rec *new = apr_pcalloc(p, sizeof(dir_config_rec));
-
- new->index_names = NULL;
-+ new->index_names_incr = NULL;
- new->do_slash = SLASH_UNSET;
- return (void *) new;
- }
-@@ -87,7 +108,26 @@ static void *merge_dir_configs(apr_pool_
- dir_config_rec *base = (dir_config_rec *)basev;
- dir_config_rec *add = (dir_config_rec *)addv;
-
-- new->index_names = add->index_names ? add->index_names : base->index_names;
-+
-+ if (add->index_names) {
-+ new->index_names = add->index_names;
-+ } else {
-+ new->index_names = base->index_names;
-+ if (base->index_names_incr) {
-+ if (!new->index_names) {
-+ new->index_names = apr_array_make(p, 2, sizeof(char *));
-+ }
-+ apr_array_cat(new->index_names, base->index_names_incr);
-+ }
-+ }
-+
-+ if (add->index_names_incr) {
-+ if (!new->index_names) {
-+ new->index_names = apr_array_make(p, 2, sizeof(char *));
-+ }
-+ apr_array_cat(new->index_names, add->index_names_incr);
-+ }
-+
- new->do_slash =
- (add->do_slash == SLASH_UNSET) ? base->do_slash : add->do_slash;
- return new;
-@@ -155,6 +195,14 @@ static int fixup_dir(request_rec *r)
- return DECLINED;
- }
-
-+ if (d->index_names_incr) {
-+ if (!d->index_names) {
-+ d->index_names = d->index_names_incr;
-+ } else {
-+ apr_array_cat(d->index_names, d->index_names_incr);
-+ }
-+ }
-+
- if (d->index_names) {
- names_ptr = (char **)d->index_names->elts;
- num_names = d->index_names->nelts;