mod_autoindex.c

Checkout Tools
  • last updated 3 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Add ap_normalize_path() to replace ap_getparents() (with options).

include/httpd.h: Declare ap_normalize_path() and flags.

AP_NORMALIZE_ALLOW_RELATIVE:

Don't require that the path be absolute as per RFC 7230.

This is needed for lookup subrequests.

AP_NORMALIZE_NOT_ABOVE_ROOT:

Check that directory traversal ("..") don't go above root, or

initial directory with relative paths.

AP_NORMALIZE_DECODE_UNRESERVED:

Decode unreserved characters (like '.') first since they have

the same semantics encoded and decoded.

AP_NORMALIZE_MERGE_SLASHES:

Merge multiple slahes into a single one.

AP_NORMALIZE_DROP_PARAMETERS:

Ignore path parameters (";foo=bar"). Not used by httpd but since

ap_normalize_path() is taken from mod_jk's jk_servlet_normalize()

it can allow them to use the upstream version now.

server/util.c: Implement ap_normalize_path().

modules/dav/main/util.c: Replace call to ap_getparents() using

ap_normalize_path() with AP_NORMALIZE_DECODE_UNRESERVED flag since

the path comes from an obsolute URL (thus potentially %-encoded).

modules/generators/mod_autoindex.c: Replace call to ap_getparents() using

ap_normalize_path() with AP_NORMALIZE_ALLOW_RELATIVE and

AP_NORMALIZE_NOT_ABOVE_ROOT flags to be consistent with original code.

include/ap_mmn.h: MINOR bump for ap_normalize_path().

  1. … 4 more files in changeset.
Add missing pool tags to help debugging.
  1. … 41 more files in changeset.
PR62989: DOCTYPE tags in server-generated HTML.

Submitted By: Andra Farkas <deepbluemistake gmail.com>, Giovanni Bechis <giovanni paclan.it>

  1. … 11 more files in changeset.
no strncasecmp because flag has no value

Use 'ap_cstr_casecmp' to simplify code.

Remove useless case. We know that to can not be NULL at this point.

Save a few bytes in the conf pool.

'push_item' and 'add_alt' already duplicate their parameters, so we can safely use the temp_pool here.

update comments post-r1787525

Add IndexOptions UseOldDateFormat

*) mod_autoindex: Add IndexOptions UseOldDateFormat to allow the date

format from 2.2 in the Last Modified column. PR60846.

PR34014 / r903052 changed date format for autoindex

Submitted By: Hank Ibell <hwibell gmail.com>

  1. … 2 more files in changeset.
Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
  1. … 49 more files in changeset.
Follow up to r1715880: revert abusive ap_casecmpstr[n]() usages.

  1. … 7 more files in changeset.
More ap_casecmpstr[n]() usages (follow up to r1715876).

  1. … 26 more files in changeset.
Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).

  1. … 32 more files in changeset.
Revert r1715789: will re-commit without spurious functional changes.

  1. … 32 more files in changeset.
Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).

[Reverted by r1715869]

  1. … 32 more files in changeset.
Fix some style issues on files that can easily be synch'ed with 2.4.x
  1. … 15 more files in changeset.
allow autoindex w/o mod_dir/mod_mime setting the DIR_MAGIC_TYPE.

  1. … 1 more file in changeset.
s/\<\(\w\+\)\>\s\+\<\1\>/\1/g
  1. … 14 more files in changeset.
Add class attributes for empty descriptions
Remove some 'register' in variable declaration.
  1. … 2 more files in changeset.
Reduce stack usage, 32 bytes are enough here, no need to

take 8k in the stack. (19 would be enough, but be safe...)

Use the size of the buffer as opposed to MAX_STRING_LEN.

Followup to r1491221+r1491479: change consistently

the same code used in another place in the same file.

Use the size of the buffer as opposed to MAX_STRING_LEN.

Reduce stack usage, 32 bytes are enough here, no need to take 8k in the stack. (19 would be enough, but be safe...)
Use ap_rputs instead of ap_rvputs where applicable.
  1. … 1 more file in changeset.
No need to test for NULL before calling apr_pstrdup.
  1. … 3 more files in changeset.
s/;;/;/
  1. … 4 more files in changeset.
Various code cleanup to avoid compiler, cppcheck, or clang warnings:

modules/debugging/mod_firehose.c: Make some internal functions static

(to do: logs_cleanup() is unused)

modules/filters/mod_charset_lite.c: Remove dead assignments

modules/filters/mod_include.c: likewise

modules/metadata/mod_usertrack.c: likewise

modules/proxy/mod_proxy_ftp.c: likewise

modules/ssl/ssl_engine_pphrase.c: likewise

modules/proxy/mod_proxy_balancer.c: likewise;

Remove NULL check that can never happen

modules/proxy/proxy_util.c: Axe NULL-check that can never happen and if it

would, it would just mask another bug

os/unix/unixd.c: likewise

modules/http/http_filters.c: Remove sub-condition that is always true

modules/lua/mod_lua.c: Add default cases to switch statements

modules/generators/mod_autoindex.c: Unsigned value can never be < 0

server/util_expr_eval.c: Fix compiler warnings with VC and on OS2

  1. … 12 more files in changeset.
Add lots of unique tags to error log messages

  1. … 172 more files in changeset.
roll back pair of recent autoindex changes (1204355:1204306)

  1. … 4 more files in changeset.
PR51471: IndexIgnore doesn't work in DirectoryMatch.

PR39923: Allow AddDescription to work with absolute filesystem paths,

by not adding "*/" to their prefix (intended for relative paths)