Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 51715 Details for
Bug 50611
Apache config file IfModule security vulnerabilities
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 1.3.33 implementing AddDirectoryIndex/RemoveDirectoryIndex
apache-1.3-incrementalDirectoryIndex.patch (text/plain), 3.67 KB, created by
Michael Stewart (vericgar) (RETIRED)
on 2005-02-20 13:26:36 UTC
(
hide
)
Description:
Patch for 1.3.33 implementing AddDirectoryIndex/RemoveDirectoryIndex
Filename:
MIME Type:
Creator:
Michael Stewart (vericgar) (RETIRED)
Created:
2005-02-20 13:26:36 UTC
Size:
3.67 KB
patch
obsolete
>--- apache_1.3.33/src/modules/standard/mod_dir.c 2004-02-20 12:37:40.000000000 -0800 >+++ apache_1.3.33.new/src/modules/standard/mod_dir.c 2005-02-20 12:40:43.553575634 -0800 >@@ -30,6 +30,7 @@ > > typedef struct dir_config_struct { > array_header *index_names; >+ array_header *index_names_incr; > } dir_config_rec; > > #define DIR_CMD_PERMS OR_INDEXES >@@ -45,11 +46,67 @@ > return NULL; > } > >+static const char *addincr_index(cmd_parms *cmd, dir_config_rec *d, char *arg) >+{ >+ if (!d->index_names_incr) { >+ d->index_names_incr = ap_make_array(cmd->pool, 2, sizeof(char *)); >+ } >+ *(char **)ap_push_array(d->index_names_incr) = arg; >+ return NULL; >+} >+ >+static const char *rem_index(cmd_parms * cmd, dir_config_rec *d, char *arg) >+{ >+ array_header *keep; >+ array_header *keep_incr; >+ char **names_ptr; >+ int num_names; >+ >+ keep = ap_make_array(cmd->pool, 2, sizeof(char *)); >+ keep_incr = ap_make_array(cmd->pool, 2, sizeof(char *)); >+ >+ if (d->index_names) { >+ names_ptr = (char **)d->index_names->elts; >+ num_names = d->index_names->nelts; >+ >+ for (; num_names; ++names_ptr, --num_names) { >+ char *name_ptr = *names_ptr; >+ >+ if (strcmp(name_ptr, arg) != 0 ) { >+ *(char **)ap_push_array(keep) = name_ptr; >+ } >+ } >+ d->index_names = keep; >+ } >+ >+ if (d->index_names_incr) { >+ names_ptr = (char **)d->index_names_incr->elts; >+ num_names = d->index_names_incr->nelts; >+ >+ for (; num_names; ++names_ptr, --num_names) { >+ char *name_ptr = *names_ptr; >+ >+ if (strcmp(name_ptr, arg) != 0 ) { >+ *(char **)ap_push_array(keep_incr) = name_ptr; >+ } >+ } >+ d->index_names_incr = keep_incr; >+ } >+ >+ return NULL; >+} >+ > static const command_rec dir_cmds[] = > { > {"DirectoryIndex", add_index, NULL, > DIR_CMD_PERMS, ITERATE, > "a list of file names"}, >+ {"AddDirectoryIndex", addincr_index, NULL, >+ DIR_CMD_PERMS, ITERATE, >+ "a list of file names"}, >+ {"RemoveDirectoryIndex", rem_index, NULL, >+ DIR_CMD_PERMS, ITERATE, >+ "a list of file names"}, > {NULL} > }; > >@@ -59,6 +116,7 @@ > (dir_config_rec *) ap_pcalloc(p, sizeof(dir_config_rec)); > > new->index_names = NULL; >+ new->index_names_incr = NULL; > return (void *) new; > } > >@@ -69,6 +127,7 @@ > dir_config_rec *add = (dir_config_rec *) addv; > > new->index_names = add->index_names ? add->index_names : base->index_names; >+ new->index_names_incr = ap_append_arrays(p, base->index_names, add->index_names); > return new; > } > >@@ -77,7 +136,6 @@ > dir_config_rec *d = > (dir_config_rec *) ap_get_module_config(r->per_dir_config, > &dir_module); >- char *dummy_ptr[1]; > char **names_ptr; > int num_names; > int error_notfound = 0; >@@ -105,16 +163,25 @@ > r->filename = ap_pstrcat(r->pool, r->filename, "/", NULL); > } > >- if (d->index_names) { >- names_ptr = (char **)d->index_names->elts; >- num_names = d->index_names->nelts; >- } >- else { >- dummy_ptr[0] = DEFAULT_INDEX; >- names_ptr = dummy_ptr; >- num_names = 1; >- } >- >+ /* Merge index_names and index_names_incr */ >+ array_header *index_names; >+ >+ if (d->index_names) { >+ if (d->index_names_incr) { >+ index_names = ap_append_arrays(r->pool, d->index_names, d->index_names_incr); >+ } else { >+ index_names = d->index_names; >+ } >+ } else if (d->index_names_incr) { >+ index_names = d->index_names_incr; >+ } else { >+ index_names = ap_make_array(r->pool, 2, sizeof(char *)); >+ *(const char **)ap_push_array(index_names) = DEFAULT_INDEX; >+ } >+ >+ names_ptr = (char **)index_names->elts; >+ num_names = index_names->nelts; >+ > for (; num_names; ++names_ptr, --num_names) { > char *name_ptr = *names_ptr; > request_rec *rr = ap_sub_req_lookup_uri(name_ptr, r);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 50611
:
51100
|
51118
| 51715 |
66529