Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 51118 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]
Implement AddDirectoryIndex and RemoveDirectoryIndex
apache-incremental-DirectoryIndex.patch (text/plain), 3.94 KB, created by
Michael Stewart (vericgar) (RETIRED)
on 2005-02-13 02:42:57 UTC
(
hide
)
Description:
Implement AddDirectoryIndex and RemoveDirectoryIndex
Filename:
MIME Type:
Creator:
Michael Stewart (vericgar) (RETIRED)
Created:
2005-02-13 02:42:57 UTC
Size:
3.94 KB
patch
obsolete
>--- ../httpd-2.0.52/modules/mappers/mod_dir.c 2004-08-15 14:59:57.000000000 -0700 >+++ httpd-2.0.52/modules/mappers/mod_dir.c 2005-02-13 02:27:55.724946750 -0800 >@@ -38,6 +38,7 @@ > > 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; > >@@ -54,6 +55,57 @@ > return NULL; > } > >+static const char *addincr_index(cmd_parms *cmd, dir_config_rec *d, const char *arg) >+{ >+ 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 *rem_index(cmd_parms *cmd, dir_config_rec *d, const char *arg) >+{ >+ >+ apr_array_header_t *keep; >+ apr_array_header_t *keep_incr; >+ char **names_ptr; >+ int num_names; >+ >+ keep = apr_array_make(cmd->pool, 2, sizeof(char *)); >+ keep_incr = apr_array_make(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 **)apr_array_push(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 **)apr_array_push(keep_incr) = name_ptr; >+ } >+ } >+ d->index_names_incr = keep_incr; >+ } >+ >+ return NULL; >+} >+ > static const char *configure_slash(cmd_parms *cmd, void *d_, int arg) > { > dir_config_rec *d = d_; >@@ -66,6 +118,10 @@ > { > AP_INIT_ITERATE("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS, > "a list of file names"), >+ AP_INIT_ITERATE("AddDirectoryIndex", addincr_index, NULL, DIR_CMD_PERMS, >+ "a list of file names"), >+ AP_INIT_ITERATE("RemoveDirectoryIndex", rem_index, NULL, DIR_CMD_PERMS, >+ "a list of file names"), > AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS, > "On or Off"), > {NULL} >@@ -76,6 +132,7 @@ > 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; > } >@@ -89,13 +146,13 @@ > 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; >+ new->index_names_incr = apr_array_append(p, base->index_names, add->index_names); > return new; > } > > static int fixup_dir(request_rec *r) > { > dir_config_rec *d; >- char *dummy_ptr[1]; > char **names_ptr; > int num_names; > int error_notfound = 0; >@@ -154,16 +211,25 @@ > return DECLINED; > } > >- if (d->index_names) { >- names_ptr = (char **)d->index_names->elts; >- num_names = d->index_names->nelts; >- } >- else { >- dummy_ptr[0] = AP_DEFAULT_INDEX; >- names_ptr = dummy_ptr; >- num_names = 1; >- } >+ /* Merge index_names and index_names_incr */ >+ apr_array_header_t *index_names; > >+ if (d->index_names) { >+ if (d->index_names_incr) { >+ index_names = apr_array_append(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 = apr_array_make(r->pool, 2, sizeof(char *)); >+ *(const char **)apr_array_push(index_names) = AP_DEFAULT_INDEX; >+ } >+ >+ names_ptr = (char **)index_names->elts; >+ num_names = index_names->nelts; >+ > for (; num_names; ++names_ptr, --num_names) { > /* XXX: Is this name_ptr considered escaped yet, or not??? */ > char *name_ptr = *names_ptr;
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