mod_autoindex.c revision 73ea536090d61caf6b149bf9d7abb3c0d95b69f1
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* Licensed to the Apache Software Foundation (ASF) under one or more
7e79e8fd53348f9fc6e8009a4a2522425ab6f08ffielding * contributor license agreements. See the NOTICE file distributed with
7e79e8fd53348f9fc6e8009a4a2522425ab6f08ffielding * this work for additional information regarding copyright ownership.
7e79e8fd53348f9fc6e8009a4a2522425ab6f08ffielding * The ASF licenses this file to You under the Apache License, Version 2.0
7e79e8fd53348f9fc6e8009a4a2522425ab6f08ffielding * (the "License"); you may not use this file except in compliance with
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * the License. You may obtain a copy of the License at
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Unless required by applicable law or agreed to in writing, software
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * distributed under the License is distributed on an "AS IS" BASIS,
7e79e8fd53348f9fc6e8009a4a2522425ab6f08ffielding * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * See the License for the specific language governing permissions and
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * limitations under the License.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * mod_autoindex.c: Handles the on-the-fly html index generation
7e79e8fd53348f9fc6e8009a4a2522425ab6f08ffielding * Rob McCool
7e79e8fd53348f9fc6e8009a4a2522425ab6f08ffielding * Adapted to Apache by rst.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Version sort added by Martin Pool <mbp@humbug.org.au>.
7e79e8fd53348f9fc6e8009a4a2522425ab6f08ffielding/****************************************************************
7e79e8fd53348f9fc6e8009a4a2522425ab6f08ffielding * Handling configuration directives...
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Define keys for sorting.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define K_NAME 'N' /* Sort by file name (default) */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define K_SIZE 'S' /* Size (absolute, not as displayed) */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define K_VALID "NMSD" /* String containing _all_ valid K_ opts */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define D_VALID "AD" /* String containing _all_ valid D_ opts */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * These are the dimensions of the default icons supplied with Apache.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Other default dimensions.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef struct ai_desc_t {
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingstatic APR_INLINE int response_is_html(request_rec *r)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding char *ctype = ap_field_noparam(r->pool, r->content_type);
404e2e1f8ad30c2d996f5fb6b3a9a4a4a14a004brbb * This routine puts the standard HTML header at the top of the index page.
a952e0c6ece342d88f2bc04e20dcfc563398eed3rbb * We include the DOCTYPE because we may be using features therefrom (i.e.,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * HEIGHT and WIDTH attributes on the icons if we're FancyIndexing).
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingstatic void emit_preamble(request_rec *r, int xhtml, const char *title)
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb d = (autoindex_config_rec *) ap_get_module_config(r->per_dir_config,
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb "<html>\n <head>\n"
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb ap_rvputs(r, " <link rel=\"stylesheet\" href=\"", d->style_sheet,
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbbstatic void push_item(apr_array_header_t *arr, char *type, const char *to,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding p->data = data ? apr_pstrdup(arr->pool, data) : NULL;
9ede6357edc9aff1fb2f7edebefab473673298aarbb p->apply_path = apr_pstrcat(arr->pool, path, "*", NULL);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding else if (to) {
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingstatic const char *add_alt(cmd_parms *cmd, void *d, const char *alt,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding const char *to)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding push_item(((autoindex_config_rec *) d)->alt_list, cmd->info, to,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingstatic const char *add_icon(cmd_parms *cmd, void *d, const char *icon,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding const char *to)
2b484455736f4c30447aa852764f53282cbeb5ddrbb return "missing closing paren";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding push_item(((autoindex_config_rec *) d)->icon_list, cmd->info, to,
ec727afb817df0e5202135278c0d2902923cc980stoddard * Add description text for a filename pattern. If the pattern has
ec727afb817df0e5202135278c0d2902923cc980stoddard * wildcards already (or we need to add them), add leading and
ec727afb817df0e5202135278c0d2902923cc980stoddard * trailing wildcards to it to ensure substring processing. If the
ec727afb817df0e5202135278c0d2902923cc980stoddard * pattern contains a '/' anywhere, force wildcard matching mode,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * add a slash to the prefix so that "bar/bletch" won't be matched
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * by "foobar/bletch", and make a note that there's a delimiter;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * the matching routine simplifies to just the actual filename
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * whenever it can. This allows definitions in parent directories
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * to be made for files in subordinate ones using relative paths.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Absent a strcasestr() function, we have to force wildcards on
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * systems for which "AAA" and "aaa" mean the same file.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingstatic const char *add_desc(cmd_parms *cmd, void *d, const char *desc,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding const char *to)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding autoindex_config_rec *dcfg = (autoindex_config_rec *) d;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding desc_entry = (ai_desc_t *) apr_array_push(dcfg->desc_list);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding desc_entry->full_path = (ap_strchr_c(to, '/') == NULL) ? 0 : 1;
02ecbdc58dc450237cba13a3982bf0b3743d539crbb desc_entry->pattern = apr_pstrcat(dcfg->desc_list->pool,
0942697a9b5de44865676345a3828741c827efe6rbb desc_entry->pattern = apr_pstrdup(dcfg->desc_list->pool, to);
3597d6b10c88c252f156fe8061b659a38dea38c2rbb desc_entry->description = apr_pstrdup(dcfg->desc_list->pool, desc);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingstatic const char *add_ignore(cmd_parms *cmd, void *d, const char *ext)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding push_item(((autoindex_config_rec *) d)->ign_list, 0, ext, cmd->path, NULL);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingstatic const char *add_opts(cmd_parms *cmd, void *d, int argc, char *const argv[])
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding autoindex_config_rec *d_cfg = (autoindex_config_rec *) d;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding for (i = 0; i < argc; i++) {
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return "Cannot combine '+' or '-' with 'None' keyword";
a5b7afe9f897d699f46d0b668b4c87936b4628f7manoj return "Cannot combine '-' with IconWidth=n";
ab5581cc78e9d865b0a6ab1404c53347b3276968rbb return "Cannot combine '-' with IconHeight=n";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return "NameWidth with no value may only appear as "
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "'-NameWidth'";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return "Cannot combine '-' with NameWidth=n";
3597d6b10c88c252f156fe8061b659a38dea38c2rbb return "NameWidth value must be greater than 5";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return "DescriptionWidth with no value may only appear as "
0942697a9b5de44865676345a3828741c827efe6rbb "'-DescriptionWidth'";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding else if (!strncasecmp(w, "DescriptionWidth=", 17)) {
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return "Cannot combine '-' with DescriptionWidth=n";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return "DescriptionWidth value must be greater than 12";
d96aa158770d3f83cb59cf0f2f7402e175f7dfccrbb return "Invalid directory indexing option";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return "Cannot combine other IndexOptions keywords with 'None'";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingstatic const char *set_default_order(cmd_parms *cmd, void *m,
a8577c2083e1fe27d78bf198668eb8bc2687d060martin autoindex_config_rec *d_cfg = (autoindex_config_rec *) m;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return "First keyword must be 'Ascending' or 'Descending'";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return "Second keyword must be 'Name', 'Date', 'Size', or "
0942697a9b5de44865676345a3828741c827efe6rbb "'Description'";
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding AP_INIT_ITERATE2("AddIcon", add_icon, BY_PATH, DIR_CMD_PERMS,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "an icon URL followed by one or more filenames"),
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding AP_INIT_ITERATE2("AddIconByType", add_icon, BY_TYPE, DIR_CMD_PERMS,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "an icon URL followed by one or more MIME types"),
0942697a9b5de44865676345a3828741c827efe6rbb AP_INIT_ITERATE2("AddIconByEncoding", add_icon, BY_ENCODING, DIR_CMD_PERMS,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "an icon URL followed by one or more content encodings"),
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding AP_INIT_ITERATE2("AddAlt", add_alt, BY_PATH, DIR_CMD_PERMS,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "alternate descriptive text followed by one or more "
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "filenames"),
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding AP_INIT_ITERATE2("AddAltByType", add_alt, BY_TYPE, DIR_CMD_PERMS,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "alternate descriptive text followed by one or more MIME "
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding AP_INIT_ITERATE2("AddAltByEncoding", add_alt, BY_ENCODING, DIR_CMD_PERMS,
6db54801798f6021bb464de7b3fdcc9dc3150f7bdgaudet "alternate descriptive text followed by one or more "
6db54801798f6021bb464de7b3fdcc9dc3150f7bdgaudet "content encodings"),
6db54801798f6021bb464de7b3fdcc9dc3150f7bdgaudet AP_INIT_TAKE_ARGV("IndexOptions", add_opts, NULL, DIR_CMD_PERMS,
2b484455736f4c30447aa852764f53282cbeb5ddrbb "one or more index options [+|-][]"),
2b484455736f4c30447aa852764f53282cbeb5ddrbb AP_INIT_TAKE2("IndexOrderDefault", set_default_order, NULL, DIR_CMD_PERMS,
6db54801798f6021bb464de7b3fdcc9dc3150f7bdgaudet "{Ascending,Descending} {Name,Size,Description,Date}"),
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding AP_INIT_ITERATE("IndexIgnore", add_ignore, NULL, DIR_CMD_PERMS,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "one or more file extensions"),
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding AP_INIT_ITERATE2("AddDescription", add_desc, BY_PATH, DIR_CMD_PERMS,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "Descriptive text followed by one or more filenames"),
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding (void *)APR_OFFSETOF(autoindex_config_rec, header),
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding (void *)APR_OFFSETOF(autoindex_config_rec, readme),
aa811cad2eb3fc01d17a5c8eba274b915ab8cd20manoj AP_INIT_RAW_ARGS("FancyIndexing", ap_set_deprecated, NULL, OR_ALL,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "The FancyIndexing directive is no longer supported. "
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding "Use IndexOptions FancyIndexing."),
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding (void *)APR_OFFSETOF(autoindex_config_rec, default_icon),
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb (void *)APR_OFFSETOF(autoindex_config_rec, style_sheet),
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb (void *)APR_OFFSETOF(autoindex_config_rec, head_insert),
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb DIR_CMD_PERMS, "String to insert in HTML HEAD section"),
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbbstatic void *create_autoindex_config(apr_pool_t *p, char *dummy)
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb (autoindex_config_rec *) apr_pcalloc(p, sizeof(autoindex_config_rec));
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb new->icon_list = apr_array_make(p, 4, sizeof(struct item));
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->alt_list = apr_array_make(p, 4, sizeof(struct item));
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb new->desc_list = apr_array_make(p, 4, sizeof(ai_desc_t));
f285a4a0695a101af2c2af5257fd660f7fd8affdrbb new->ign_list = apr_array_make(p, 4, sizeof(struct item));
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb return (void *) new;
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbbstatic void *merge_autoindex_configs(apr_pool_t *p, void *basev, void *addv)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding autoindex_config_rec *base = (autoindex_config_rec *) basev;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding autoindex_config_rec *add = (autoindex_config_rec *) addv;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new = (autoindex_config_rec *) apr_pcalloc(p, sizeof(autoindex_config_rec));
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->default_icon = add->default_icon ? add->default_icon
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->style_sheet = add->style_sheet ? add->style_sheet
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->head_insert = add->head_insert ? add->head_insert
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->icon_height = add->icon_height ? add->icon_height : base->icon_height;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->icon_width = add->icon_width ? add->icon_width : base->icon_width;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->charset = add->charset ? add->charset : base->charset;
2b484455736f4c30447aa852764f53282cbeb5ddrbb new->alt_list = apr_array_append(p, add->alt_list, base->alt_list);
2b484455736f4c30447aa852764f53282cbeb5ddrbb new->ign_list = apr_array_append(p, add->ign_list, base->ign_list);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->desc_list = apr_array_append(p, add->desc_list, base->desc_list);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->icon_list = apr_array_append(p, add->icon_list, base->icon_list);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * If the current directory says 'no options' then we also
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb * clear any incremental mods from being inheritable further down.
2cfdca5be0c69f65b43a888d6d3da846489b8fa5rbb * If there were any nonincremental options selected for
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * this directory, they dominate and we don't inherit *anything.*
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Contrariwise, we *do* inherit if the only settings here are
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * incremental ones.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * We may have incremental settings, so make sure we don't
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * inadvertently inherit an IndexOptions None from above.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * There are local nonincremental settings, which clear
2a7d0035b5594ddc0907a9cc545e14ae5140c541manoj * all inheritance from above. They *are* the new base settings.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * We're guaranteed that there'll be no overlap between
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * the add-options and the remove-options.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Inherit the NameWidth settings if there aren't any specific to
404e2e1f8ad30c2d996f5fb6b3a9a4a4a14a004brbb * the new location; otherwise we'll end up using the defaults set in the
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * config-rec creation routine.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Likewise for DescriptionWidth.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding new->default_keyid = add->default_keyid ? add->default_keyid
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb new->default_direction = add->default_direction ? add->default_direction
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/****************************************************************
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Looking things up in config entries...
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* Structure used to hold entries when we're actually building an index */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbbstatic char *find_item(const char *content_type, const char *content_encoding,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding /* Special cased for ^^DIRECTORY^^ and ^^BLANKICON^^ */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding if ((path[0] == '^') || (!ap_strcmp_match(path, p->apply_path))) {
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb if (!*(p->apply_to)) {
return p->data;
else if (!path_only) {
if (!content_encoding) {
if (content_type
p->apply_to)) {
return p->data;
p->apply_to)) {
return p->data;
return NULL;
* Look through the list of pattern/description pairs and return the first one
#ifdef CASE_BLIND_FILESYSTEM
#define MATCH_FLAGS 0
const char *filename_only;
const char *filename;
int found;
if (found) {
return NULL;
char *tt;
tt++;
char *ap;
ap++;
#ifndef CASE_BLIND_FILESYSTEM
int ch;
apr_size_t i, c, n;
while (!apr_file_eof(f)) {
n = sizeof(char) * AP_IOBUFSIZE;
const char *r_accept;
const char *r_accept_enc;
* text/anything-else. The former is allowed to be processed for
ap_filter_t *f;
emit_amble = 0;
emit_H1 = 0;
if (! suppress_amble) {
emit_amble = 0;
do_emit_plain(r, f);
apr_file_close(f);
emit_H1 = 0;
if (r_accept) {
if (r_accept_enc) {
if (emit_amble) {
if (emit_H1) {
int suppress_post = 0;
int suppress_sig = 0;
* text/anything-else. The former is allowed to be processed for
ap_filter_t *f;
do_emit_plain(r, f);
apr_file_close(f);
if (!suppress_sig) {
if (!suppress_post) {
apr_size_t n;
return NULL;
&& (response_is_html(r)
&& !r->content_encoding) {
return NULL;
return NULL;
for (x = 0, p = 0; titlebuf[x]; x++) {
if (!find[++p]) {
for (y = x; titlebuf[y]; y++) {
return NULL;
char direction)
char *testpath;
return (NULL);
if (!*p->name) {
return (NULL);
return (NULL);
int autoindex_opts,
char direction,
const char *pattern)
struct ent *p;
int show_forbidden = 0;
return (NULL);
#ifdef CASE_BLIND_FILESYSTEM
!= APR_SUCCESS)) {
return (NULL);
return (NULL);
return (NULL);
return (NULL);
p->isdir = 0;
if (p->lm < 0) {
p->lm = 0;
if (!desc[x]) {
maxsize = 0;
--maxsize;
maxsize = 0;
--maxsize;
return desc;
if (!nosort) {
char *tp;
int name_width;
int desc_width;
char *name_scratch;
char *pad_scratch;
== FANCY_INDEXING) {
if (t > name_width) {
name_width = t;
if (t > desc_width) {
desc_width = t;
ap_rvputs(r, "<th", (d->style_sheet != NULL) ? " class=\"indexcolicon\">" : " valign=\"top\">", NULL);
if (d->icon_width) {
if (d->icon_height) {
++cols;
++cols;
++cols;
++cols;
cols,
if (d->icon_width) {
if (d->icon_height) {
int nwidth;
t2 = t;
ap_rvputs(r, "<td", (d->style_sheet != NULL) ? " class=\"indexcolicon\">" : " valign=\"top\">", NULL);
: d->default_icon),
if (d->icon_width) {
if (d->icon_height) {
ap_rvputs(r, "<td", (d->style_sheet != NULL) ? " class=\"indexcolname\">" : ">", "<a href=\"", anchor, "\">",
ap_rvputs(r, "<td", (d->style_sheet != NULL) ? " class=\"indexcolname\">" : ">", "<a href=\"", anchor, "\">",
&ts);
ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcollastmod\">" : " align=\"right\">",time_str, NULL);
ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcollastmod\"> " : "> ", NULL);
ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcolsize\">" : " align=\"right\">",
ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcoldesc\">" : ">", ar[x]->desc, NULL);
: d->default_icon),
if (d->icon_width) {
if (d->icon_height) {
desc_width), r);
int result = 0;
case K_LAST_MOD:
case K_SIZE:
case K_DESC:
if (result) {
return result;
if (!result) {
if (!result) {
return result;
char *title_endp;
int num_ent = 0, x;
const char *qstring;
char keyid;
char direction;
char *colargs;
char *fullpath;
char *charset;
return HTTP_FORBIDDEN;
if (*charset) {
ap_set_etag(r);
if (r->header_only) {
& ~TABLE_INDEXING;
++eos;
if (p != NULL) {
head = p;
num_ent++;
const char *savename;
if (p != NULL) {
head = p;
num_ent++;
if (num_ent > 0) {
p = head;
ar[x++] = p;
p = p->next;
(int (*)(const void *, const void *)) dsortf);
int allow_opts;
return DECLINED;
return DECLINED;
int errstatus;
return errstatus;
return index_directory(r, d);
return HTTP_FORBIDDEN;