| /[Apache-SVN]/httpd/httpd/tags/2.3.1/modules/generators/mod_autoindex.c |
Parent Directory
|
Revision Log
| Links to HEAD: | (view) (annotate) |
| Sticky Revision: |
Tag 2.3.1 from trunk.
Remove a dirty hack in find_default_item. Creating local request_rec breaks Module Magic Number.
Make "HeaderName" and "ReadmeName" be stored in simple entries "header" and "readme" respectively. Side effect: In the case that multiple "HeaderName"s or multiple "ReadmeName"s exist in one directory section. Before this change, the first directive is effective. After this change, the last directive is effective.
Add option to insert something in autoindex head.
* Detabify and make spacing in HTML code the same as before r593816. This avoids that the autoindex test (t/modules/autoindex) fails. Adjusting the autoindex test would cause it to fail with older versions and would make it harder to recognize regressions.
* Generate valid XHTML output by adding the xhtml namespace. PR: 43649 Submitted by: Jose Kahan <jose w3.org> Reviewed by: rpluem
Make Bill happy ;)
IndexOptions ContentType=text/html Charset=UTF-8 magic.
update license header text
* modules/generators/mod_autoindex.c (output_directories): Escape filename in non-FancyIndexing case. PR: 38910 Submitted by: Robby Griffin <rmg terc.edu>
Update the copyright year in all .c, .h and .xml files
No functional Change: Removing trailing whitespace. This also means that "blank" lines consisting of just spaces or tabs are now really blank lines
Add AP_INIT_TAKE_ARGV. There can be some inconsistent results because of the behavoir of ap_getword_conf. Do not rely upon any last argument that is "". If the argument is in the middle of the line, it should work correctly. This is updated from the version sent to dev@httpd to fix the behavoir with 0 arguments. * include/http_config.h: minor MMN bump for the new interface. * modules/generators/mod_autoindex.c: Migrate IndexOptions to the new ARGV command type.
Update copyright year to 2005 and standardize on current copyright owner line.
general property cleanup
"Rule" is pretty abstract in this case and seems to cause confusion for many people.
Add ShowForbidden to IndexOptions to list files that are not shown because the subrequest returned 401 or 403. PR: 10575
* modules/standard/mod_autoindex.c (index_directory): If stat() fails for a particular dirent, ignore that entry rather than truncating the directory listing.
fix name of The Apache Software Foundation
fix copyright dates according to the first check in
apply Apache License, 2.0
update license to 2004.
add another space, for the sake of Netscape 4
restore the space which broke all tests :-)
mod_autoindex: new directive IndexStyleSheet PR: Obtained from: Submitted by: Tyler Riddle <triddle_1999 yahoo.com> and Paul Querna <chip force-elite.com> Reviewed by:
darn, the patch for bug 9587 (wrong icon for directories shown) broke the directory descriptions more or less completely. Fix it now.
- add XHTML doctypes to httpd.h - fix the (x)html output of mod_autoindex to be consistent and make it configurable to emit either HTML or XHTML PR: 23747
Don't omit the initial <tr> if SuppressIcon is set. Submitted by: Jesse Tie-Ten-Quee <highos@highos.com> PR: 21668
improve readability a (little) bit
switch to APR 1.0 API (which is still in flux) because of the changes to the argument lists of apr_mmap_dup and apr_socket_create, 2.1-dev won't build with apr and apr-util's 0.9 branch anymore
If a directory contains a file listed in the DirectoryIndex directive, the folder icon is no longer replaced by the icon of that file. PR: 9587 Submitted by: David Shane Holden <dpejesh@yahoo.com>
Unescape the supplied wildcard pattern. Otherwise the pattern will not always match as desired. In order to be correct and safe, the pattern will be re-escaped for output. PR: 12596
add some comments and WS to make it better readable (hopefully ;-)
emit and accept modern query string parameter delimiters (;). Thus column headers no longer contain unescaped ampersands. PR: 10880
buhuh! use the correct target string and don't forget F=x and V=y in column headers ...
WS and style issues. No code changes.
finished that boring job: update license to 2003. Happy New Year! ;-))
Bring forward the IndexOptions IgnoreCase option to mod_autoindex from Apache 1.3 for both 2.0 and 2.1 (since the patch/feature was previously accepted for 1.3, I'm committing without the usual vote specific to 2.0.) Only small modification of David's patch to avoid future reformatting of the options list and better handle the strnatcmp side effects. PR: 14276 Obtained from: Submitted by: David Shane Holden <dpejesh@yahoo.com> Reviewed by:
mod_autoindex: AddDescription directives for directories now work as in Apache 1.3, where no trailing '/' is specified on the directory name. Previously, the trailing '/' *had* to be specified, which was incompatible with Apache 1.3. PR: 7990
One line fix to get HTMLTable to validate. PR: 13351 Submitted by: Thom May <thommay@apache.org>
Changes for deprecated apr_is_fnmatch
if we autoindex, discard the request body and check for any errors doing so
Renames: APR_XtOffset -> APR_OFFSET APR_XtOffsetOf -> APR_OFFSETOF
stop using APLOG_NOERRNO in calls to ap_log_[pr]error()
Fix HTML 3.2 validation error: &O is not a valid entity. Should be &O Reported by: validator.w3.org
Fix mod_autoindex output with SuppressRules turned on. PR: 8016 Submitted by: David Shane Holden <dpejesh@yahoo.com>
Adapt to the rename of apr_explode_localtime to apr_time_exp_lt in APR. Submitted by: Thom May <thom@planetarytramp.net>
This is a HACK! The problem is that the fast_internal_redirect is removing the OLD_WRITE filter. Obviously that is wrong. For right now, the fix is to hack around the problem and just make it work. Long term, we need to find a real solution to this, but this gets autoindex working today.
Commit 1 of 2 to: 1. rename ap_rset_content_type to ap_set_content_type 2. reverse the arguments on the call to aligh with ap_set_content_length
First commit to introduce accessor function to set r->content_type..
Update our copyright for this year.
apr-utils rename apr_ansi_time_to_apr_time and apr_exploded_time_t. PR: Obtained from: Submitted by: Thom May <thom@planetarytramp.net> Reviewed by: Ian Holsman
next_filter of NULL to any ap_sub_req_lookup*() fn implies the subreq will never be run - or we expect to pass the subreq to fast_redirect. The comming fix will break invalid ap_sub_req_lookups* expecting to run subrequests with the next_filter NULL semantic.
That check is superfluous since we must have savename defined (otherwise, we'd get APR_INCOMPLETE on apr_dir_read).
Allow mod_autoindex to serve symlinks if permitted and optimize our stats so that only one stat() is needed. If we get APR_FINFO_MIN bits, lookup_dirent won't do a repeated stat() call. So, let's do it here. Also, if we see a symlink, expand it. (Technically, we don't *have* to expand the symlinks - the resolve_symlink fix handles that, but we can't really assume that.) Since we know that dirent will be rr->finfo anyway, go back to relying on dirent only for APR_DIR checks.
Vetoed by Ken
List files that would result in HTTP_UNAUTHORIZED in addition to successes and redirections, since there's a chance the client will actually have the proper authorization to retrieve them. Reported by: Stas Bekman
vetoing and backing out OtherBill's patch rev 1.91. This breaks mod_autoindex on systems such as Unix where apr_dir_read doesn't automatically return the filetype. You see a '?' icon rather than a folder icon for directories on 2.0.31 because mod_autoindex doesn't realize that the thing is a directory. No, we don't want more stat()s either.
Which PR? I can't count them all. Get QUERY_STRING and PATH_INFO working again. Also rounds out our fix to work around negotiated directories which Greg Ames fixed; this addition in request.c simply shortcuts all further processing.
This otherwise ineffectual patch allows modules to perform internal redirects of dirs into other resources, while still treating such a resource as a dir, based on the original apr_dir_read results.
Get rid of identifiers called 'stat' so we don't conflict with the libc 'stat' symbol.
Just style changes. Really just 's/\t/ /' since the tabstop alignment was pretty good. Added a couple braces and spaces here and there.
Style-guide fixes, no functional changes.
Restrict by content type and encoding before we go and try to drag in some text to merge as headers and footers to autoindex pages. This will escape index.gif from a bold attempt to use IndexHeader index ;) Also pass in the args to the subrequest, for anyone trying to decode what the user is looking at. A great example of this coming up.
Assure that non-FancyIndexed listings properly shortcut dir entries, and display and href the trailing slash, as well. PR: 8206
Update the Apache code to account for the XtOffset change in APR.
Fix a small bug that limited the description's width to the filename's width. Submitted by: Mladen Turk <mladen.turk@mail.inet.hr>
Fix the new method code. We need to cast 1 to an apr_int64_t or it will be treated as a 32-bit integer, and it will wrap after being shifted 32 times. Submitted by: Cody Sherr <csherr@covalent.net> and Ryan Morgan <rmorgan@covalent.net>
Thanks rbb, and the modproxy-dev autobuild report for pointing these out.
All mod_autoindex query parsing is now quietly quashed with the
IndexOption IgnoreClient. The IndexOption SuppressColumnSorting
still drops the column sort <a href>'s for the column headers, but
IgnoreClient is required to ignore these Query options entirely.
Introduced new mod_autoindex query argument parsing for F=[0|1|2]
to allow the client to select plain, FancyIndexing or HTMLTable
formatting, V=[0|1] to inhibit or enable version sorting, and
P=pattern to return only specific files. The old Query Arguments
were reorganized as C=f for sorting column 'f' (same N, D, S, or M
as before), and O=A|D for ordering ascending or descending.
Docs and an Example are provided in mod_autoindex.html
Formatted output changes only...
Introduced new mod_autoindex IndexOptions flags; SuppressIcon to
drop the icon column and SuppressRules to drop the <hr> elements.
These are necessary for HTML 3.2 final formatting rules.
Introduced HTMLTable to create rudimentary HTML table listings
(implies FancyIndexing). Necessary for alternate charsets, since
the columns are borked by multibyte characters.
Re-Introduced the mod_autoindex IndexOptions flag TrackModified
from Apache 1.3.15. This is needed for two reasons, first, given
multiple machines within a server farm, ETags and Last-Modified
stamps won't correspond from machine to machine, and second, many
Unixes don't capture changes to the date or time stamp of existing
files, since these don't modify the dirent itself.
[Originally for 1.3 by me]
Re-Introduced the mod_autoindex InextOptions flag FoldersFirst
and DirectoryWidth options from Apache 1.3.10.
[Originally for 1.3 by Ken Coar]
remove a gcc warning, leave object code unchanged
Save hundreds of cycles on every autoindex request by _not_ attempting to to test the parent (..) sub request! This patch also allows the user to see things that will redirect them. That way, the lnk or dir within the directory is displayed correctly. Also allows an ALT text entry other than DIR by providing AddAlt ^^DIRECTORY^^, as the user (might) expect to be allowed to do.
That's enough for tonight ... gheesh. Allow 2xx + OK (0) results from the subrequest to go out to the client. This doesn't address (..) anomilies, which I will address in the a.m.
Allow a slightly larger range of acceptable responses.
Fix some major brokenness. We were not validating that the autoindex subrequest'ed file was valid, and did not check a subrequest at all if the user didn't use FancyIndexing.
Begone ancient beast. IndexOptions FancyIndexing is sufficiently less confusing.
Throw back in the newline, just for source legibility.
Correct a subtle reflow problem (evident in Mozilla Gecko/20010505) that <hr>'s within <pre> tags (entirely illegal in the first place :) are not adjusted on window resize. By moving the second <hr /> into the <pre> block, at least the two rules are consistent.
Minor quibble, <li> can and should be a balanced tag
More pedantic changes to create HTML 3.2/4.01 Transitional and XHTML 1.0 Transitional - compliant output. Note that this model is forever broken, since <hr> and <img> tags within a <pre> block are, by definition, invalid. This is sort of mute since we need to start creating a table-based autoindex, mostly for utf-8 names that map in R-t-L order comixed with L-t-R formatting.
Reviewing my own commit logs ... dang did this look silly.
More signedness fixes
Change over to apr_strfsize() for apr_off_t file size formatting.
Changes to respect the new apr bucket and brigade length types (either apr_size_t for bucket lengths, or apr_off_t for aggregate brigade lengths.)
s/cont/pool/ Bring this back in line with changes to APR.
Employ the new ap_sub_req_lookup_dirent() function for mod_autoindex.
Goodbye ap_send_http_header
Begin to move functions from the http module to the core. The goal is to have only functions that are HTTP specific in the http directory.
*) fix inline handling. we had: apr_inline, APR_INLINE, USE_GNU_INLINE, and INLINE. Now, we just have APR_INLINE and APR_HAS_INLINE. - convert all usage - note that apr_general messed up the defn (compared to apr.h) - simplify the inline decision logic in os/*/os.h - simplify the code in os/*/os-inline.c *) toss ap_checkconv() [no longer used]
Namespace protect IOBUFSIZ since it is a public symbol. Submitted by: Jon Travis <jtravis@covalent.net>
rename miss: s/apr_clear_pool/apr_pool_clear/g
Update copyright to 2001
Clean up some of the includes: - explicitly include apr_lib.h since ap_config.h doesn't - use apr_want.h where possible - use APR_HAVE_ where possible - remove some unneeded includes
renaming various functions for consistency sake see: http://apr.apache.org/~dougm/apr_rename.pl PR: Obtained from: Submitted by: Reviewed by:
Eliminate all assumptions that finfo.protection reflects the existance or absense of a file. finfo.filetype is defined as 0 if APR_NOFILE, or a non-zero value if the file could be apr_stat()'ed.
Accomodate the change to the apr_read_dir() arguments, and change all apr_dirfoo() and apr_foodir() commands to apr_dir_foo() to match the earlier-renamed apr_dir_open().
The big change. This is part 3 of the apr-util symbols rename, please see the first commit of srclib/apr-util/include (cvs apr-util/include) for the quick glance at symbols changed.
Provide apr_pool_t arg to register_hooks, since anything they do in that step -must- be done with a pool that will not outlive the cmd pool, from which they may have been dynamically loaded.
adjust remaining modules to use the new handler hook method (Alan Edwards) bring back the old handler prototype by reusing r->handler (dougm) PR: Obtained from: Submitted by: Reviewed by:
Make handlers use hooks.
Stop copying file names that we get from apr_file_t's and apr_dir_t's. We copy the data when we store it in the structures, we can just return a pointer from there, and use const data. This puts the onus back on Apache to copy the data if it needs to modify it.
Rename the apr_opendir symbol to apr_dir_open. This makes more sense, and the rename was proposed a while ago inside of APR.
Allow modules to specify the first module for a sub-request. This allows modules to not have to muck with the output_filter after it creates the sub-request. Without this change, modules that create a sub-request have to manually edit the output_filters, and therefore skip the sub-request output_filter. If they skip the sub-request output_filter, then we end up sending multiple EOS buckets to the core_output_filter.
Fix a lot of the fallback from the apr_ssize_t to apr_size_t change Submitted by: Victor J. Orlikowski <v.j.orlikowski@gte.net>
Two patches (sorry), first to clean up the double assignment of the r->content_type value on UNICODE_FS, and the second to add ETag and Modified-Date to the file listing. If anyone sees an objection to this thing, please scream (loudly) before I go and attack 1.3.x with the ETag/Modified-Date Friday a.m.
Ok here it is: Win32 utf-8 native unicode filename support. There are just too many folks to credit... so this goes out from the entire ApacheCon hacking team :-)
Renamed all MODULE_EXPORT symbols to AP_MODULE_DECLARE and all symbols for CORE_EXPORT to AP_CORE_DECLARE (namespace protecting the wrapper) and retitled API_EXPORT as AP_DECLARE and APR_EXPORT as APR_DECLARE. All _VAR_ flavors changes to _DATA to be absolutely clear. Thank you Greg, for the most obvious suggestion.
Missed it... another canonical error fix
Remaining cleanup of ap_ -> apr_ and AP_ -> APR_ transformation... see src/lib/apr/apr_compat.h for most details. Also a few minor nits to get Win32 to build. PR: Obtained from: Submitted by: Reviewed by:
prefix libapr functions and types with apr_
Remove apr_strnatcmp.h. All of the functions prototyped in this file have been moved to apr_strings.h. This also modifes Apache to include apr_strings.h instead of apr_strnatcmp.h
Move all APR functions related to strings to their own directory, and create a new header for those functions. This is the first step to removing the apr/lib directory completely, and moving those files/functions to descriptive directories.
Include strings.h for strcasecmp(), strncasecmp(), and bzero(). Include time.h for time(). This removes a bunch of compiler warnings with gcc -Wall on AIX. Submitted by: Jeff Trawick, Victor Orlikowski
Fix a couple of const warnings on Linux. This basically just defines ap_strstr and ap_strstr_c, which make sure that things are const when they need to be.
Fix warnings.
Use the new command-handler initializer macros in some more modules. Unfortunately, the resulting warnings are *not* all cleaned up. Ten or so warnings spill over to non-AP_DEBUG builds (but that just means that there is a bigger pool of folks to resolve them, right?).
More consification, correct command initialisation.
PR: Obtained from: Submitted by: Reviewed by: Reverse out all _EXPORT_VAR changes back to their original _VAR_EXPORT names for linkage (API_, CORE_, and MODULE_).
This patch corrects the issues from the AP_EXPORT and linkage
specification arguments to the ap_hooks.h declarations. As with
the APR_ and AP_ patches, API_VAR_EXPORT becomes API_EXPORT_VAR,
and MODULE_VAR_EXPORT becomes MODULE_EXPORT_VAR.
I will be happy to revert the inclusion of ap_config.h from
httpd.h if this bothers anyone. More individual modules need
to be patched if we do so.
The API_EXPORTs all moved into central storage in the ap_config.h
header. Without WIN32 or API_STATIC compile time declarations,
these macros remain no-ops.
This patch also moves the following data from http_main to http_config:
const char *ap_server_argv0;
const char *ap_server_root;
ap_array_header_t *ap_server_pre_read_config;
ap_array_header_t *ap_server_post_read_config;
ap_array_header_t *ap_server_config_defines;
And the following variables had already moved into ap_hooks.c:
ap_pool_t *g_pHookPool; (initialized now in http_config)
int g_bDebugHooks; (out of http_config)
const char *g_szCurrentHookName; (out of http_config)
The changes to http_main.c are in preparation for that module to
move out to a seperate .exe for win32. Other platforms will be
unaffected, outside of these changes.
Change names of strnatcmp & strnatcasecmp to cpmply with APR naming conventions Submitted by: William Rowe
Add `IndexOptions +VersionSort', to nicely sort filenames containing version numbers. Submitted by: Martin Pool <mbp@linuxcare.com.au>
Change ap_context_t to ap_pool_t. This compiles, runs, and serves pages on Linux, but probably breaks somewhere.
Make the server work without asking for buffered file I/O. This removes all APR_BUFFERED flags from the server, and it fixes a minor bug in the ungetchar patch (I forgot a file when comitting).
Update to Apache Software License version 1.1
Backport the CSS security fixes to Apache 2.0a. Or is that forward port? My sense of direction is all confused. PR: Obtained from: Submitted by: Reviewed by:
Fix all the License issues. Including: s/Apache Group/Apache Software Foundation/ s/1999/2000/ s/Sascha's license/ASF license
Small changes to remove some compiler complaints.
Manoj has been pushing for this for a while, but I've been too dense to understand that he was right. :-) Basically, this makes the modules use ap_config to test for header file inclusion. This method is not to be used for larger modules that run autoconf theirselves. Including ap_config is only valid for modules which rely on Apache to do their configuration. Currently, this is only the core modules.
This is a huge change to the configure system. Basically, this name space protects most, if not all, of the Apache macros. This has been tested on Linux using all of the Unix MPM's. The biggest push was that Apache's httpd.h header file can no longer include the ap_config.h file. Most of the other files include this themselves now. Submitted by: Ryan Bloom and Manoj Kasichainula
Rework ap_finfo_t to split the file type out of the protection field. I've taken a stab at the unix implementation but tested only on OS/2.
time overhaul: - ap_time_t is a 64-bit scalar, microseconds since epoch - ap_exploded_time_t corresponds to struct tm with a few extras probably broken on anything except linux.
Move some modules over to using ap_time_t instead of struct tm.
Next pass at the time functions. This defines an ap_ansi_time_t which has a specific format (seconds since 0:00:00 Jan 1, 1970). I also renamed the (get|set)_curtime functions to (get|set)ansitime. This should make more sense, and be a bit more intuitive.
Separate the stat structure from the file structure and use ap_stat and ap_getfileinfo in apache.
Initialize all ap_file_t's to NULL. This allows ap_open and ap_stat to work together without causing memory leaks.
Update some dependancies. Move the final two files out of apr/inc and into apr/include. Basically just finish some cleanup from some changes I've been making over the last two days.
mod_autoindex has a small bug when calling ap_readdir. This was causing empty indexes to be created. The following patch fixes this problem Submitted by: Paul Reder Reviewed by: Bill Stoddard
Size rigour.
Add a status value to ap_log_error and ap_log_rerror. This allows us to use apr_status codes in our error logs. The main advantage of this, is portable error codes. Now, Windows will finally be able to use errno!
I missed one function when swapping paramters. This fixes it. I think I have caught them all this time. I really hope this is the final time I have to swap parameters.
Remove most of the annoying "re ap_context_t mplement" mis-replacements by what I think is their real meaning. Guys, I didn't verify all of this, please have a close look at my "fixes". Thanks.
Bring file_io up to the new parameter order for APR. I have decided to do these on a directory by directory basis for the rest of APR. I hope to cause fewer problems for other developers by doing it this way.
First patch to re-order function parameters. This one gets the low hanging fruit, and moves most of the result parameters to the first argument. Future patches in this series will move the rest of the result parameters to the beginning of the list, and will move the context's to the end of the list
A change to how APR uses user data. Now, user data is a linked list that is retreivable using a char string. Basically, you provide a string that will be used as a key when you store the data. If the key was used before, we will overwrite the old data. When you want to retreive your data, pass in the same key, and we will find the data you care about. This also makes it harder to put user data in when creating a context, so that option has disappeared. It is also impossible to inherit user data from parent contexts. This option may be added in later. I will be documenting this VERY soon.
Remove all of the calls to functions like "ap_popenf". These functions were moved down to APR, but they are being removed. They are not portable, and were only moved down for backwards compatability. With this change, they can be safely removed, which is the next commit on it's way. Submitted by: Ryan Bloom and Paul Reder
Changed pools to contexts. Tested with prefork and pthread mpm's. I'll check this out tomorrow and make sure everything was checked in correctly.
Remove timeouts as part of pthreads changes. Submitted by: Bill Stoddard
Start to implement module-defined hooks that are a) fast and b) typesafe. Replace pre_connection module call with a register_hook call and implement pre_connection as a hook. The intent is that these hooks will be extended to allow Apache to be multi-protocol, and also to allow the calling order to be specified on a per-hook/per-module basis. [Ben Laurie] Port a bunch of modules to the new module structure. ["Michael H. Voase" <mvoase@midcoast.com.au>] Submitted by: Ben Laurie
Apache 1.3.9 baseline for the Apache 2.0 repository. Obtained from: Apache 1.3.9 (minus unused files), tag APACHE_1_3_9 Submitted by: Apache Group
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
| apache@apache.org | ViewVC Help |
| Powered by ViewVC 1.1.2 |