Parent Directory
|
Revision Log
| Links to HEAD: | (view) (download) (annotate) |
| Sticky Revision: |
Add API exposing the DavBasePath setting for use by DAV repository backend modules (mod_dav_svn needs this for POST method handling). * modules/dav/main/mod_dav.c (dav_get_base_path): New function. * include/ap_mmn.h: Bump MMN minor. Github: closes #513
* Follow up to r1918814: Always trust content types that we set literally
* Always trust content types that we set literally
* modules/dav/main/mod_dav.c (dav_get_resource): Don't mask "conf" variable.
Add DAVBasePath directive to allow users to configure the real repos root path, useful where the DAV repos is configured with a regex match. * modules/dav/main/mod_dav.c (dav_get_resource): If available, pass the configured base path as the repos root to repos provider. On the error path for fetching a resource, detect and warn specifically when the location is configured via a regex. (dav_cmd_davbasepath): New function. PR: 35077 Github: closes #376
Allow mod_dav_fs to tolerate race conditions between PROPFIND and an operation which removes a directory/file between apr_dir_read() and apr_stat(). Current behaviour is to abort the connection which seems inferior to tolerating (and logging) the error. * modules/dav/fs/repos.c (dav_fs_walker): If DAV_WALKTYPE_TOLERANT is set, ignore ENOENT from stat() rather than aborting the response. Log the error from stat either way. * modules/dav/main/mod_dav.c (dav_method_propfind): Set DAV_WALKTYPE_TOLERANT. * modules/dav/main/mod_dav.h: Add DAV_WALKTYPE_TOLERANT. Github: closes #369
Turn msext_opts into a bitfield
Add MS-WDV support MS-WDV specification: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-wdv The changes introduces the DAVMSext directive, which is used to enable MS-WDV: DAVMSext +WDV dav_get_timeout_string() is introduced as a variant of dav_get_timeout(). The former parses a string, the later parse the Timeout HTTP header.
Open the lock database read-only when possible The goal is to reduce lock contention, since a read access only requires a shared lock. The improvement should not be significant since for now we open and close the lock database on each HTTP request. PR 36636 [Wilson Felipe <wfelipe gmail.com>]
Initialize allow_lockdiscovery as unset Removing the initialization means it is set as 0 by apr_pcalloc(), and 0 is DAV_ENABLED_UNSET That is required to inherit configuration in dav_merge_dir_config() as pointed out by rpluem@ We only check for allow_lockdiscovery against DAV_ENABLED_OFF, hence DAV_ENABLED_UNSET is equivalent to DAV_ENABLED_ON, which is required for backware compatibility sake.
Turn DavLockDiscovery into a flag As requested on dev@httpd.apache.org, turn DavLockDiscovery into a Flag. Expressions can still be used by enclosing the directive by <If "expr">...</If>
mod_dav: Follow up to r1904638: Fix duplicated APLOGNO.
mod_dav: Allow to disable lock discovery via an DAVLockDiscovery expression. mod_dav-fs scales badly when a few clients run PROPFIND requests to discover directory content. Each PROPFIND involves lockdiscovery, which in turn waits for a locked access to the file containing the lock database. Performances quickly drop because of lock contention on this file. Add a DAVLockDiscovery configuration directive that allows lockdiscovery to be disabled. Its argument is an Apache expression so that flexible configuration are possible (per-request). When lock discovery is disabled, an empty lockdiscovery property is returned on POPRFIND methods, just like if no lock was set on the object. That should cause no regression, since a client cannot rely on lockdiscovery to decide when a file should be accessed, the LOCK methood must be used. If DAVLockDiscovery is not specified, the behavior is unchanged. PR 66313. Submitted by: Emmanuel Dreyfus <manu netbsd.org> Reviewed by: ylavic
Revert 1897156.
mod_dav: Follow up to r1897156: Fix warning. In file included from mod_dav.c:51: mod_dav.c: In function ‘uripath_is_canonical’: mod_dav.c:774:38: error: passing argument 1 of ‘ap_strchr’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 774 | dot_pos = strchr(dot_pos + 1, '.')) { | ~~~~~~~~^~~ /home/travis/build/apache/httpd/include/httpd.h:2469:34: note: in definition of macro ‘strchr’ 2469 | # define strchr(s, c) ap_strchr(s,c) | ^ /home/travis/build/apache/httpd/include/httpd.h:2457:36: note: expected ‘char *’ but argument is of type ‘const char *’ 2457 | AP_DECLARE(char *) ap_strchr(char *s, int c); | ~~~~~~^
core: Allow an optional expression to be specified for an effective path in the DirectoryMatch and LocationMatch directives. This allows modules like mod_dav to map URLs to URL spaces or to directories on the filesystem.
* Correctly handle errors returned by dav providers on REPORT requests.
Extend method_precondition hook to be called during the PROPFIND and LABEL walkers, once for each walked resource.
mod_dav: Allow other DAV modules to use dav_get_resource().
Begone foul tabs.
mod_dav: Add method_precondition hook. WebDAV extensions define conditions that must exist before a WebDAV method can be executed. This hook allows a WebDAV extension to verify these preconditions.
Add implementation of deliver_report and gather_reports to mod_dav.c.
Add hooks deliver_report and gather_reports to mod_dav.h. Allows other modules apart from versioning implementations to handle the REPORT method.
Add dav_get_provider(), dav_open_lockdb() and dav_close_lockdb() mod_dav.h.
core,modules: provide/use ap_parse_strict_length() helper. It helps simplifying a lot of duplicated code based on apr_strtoff(), while also rejecting leading plus/minus signs which are dissalowed in Content-Length and (Content-)Range headers.
Fix spelling errors found by codespell. [skip ci]
* Replace apr_psprintf with apr_pstrcat where the format strings only contain %s to improve efficiency. Leave out error messages as they are not on a crtical code path and error message become less readable when taking out the format specifiers.
* modules/dav/main/mod_dav.c (dav_send_multistatus): Tag the pool.
Simplify handling of short-lived pool for dav_propdb in mod_dav. No functional change. * modules/dav/main/props.c (dav_popen_propdb): Rename from dav_open_propdb, take a pool argument. (dav_open_propdb): Reimplement in terms of above, using r->pool. (dav_propfind_walker): Switch to using dav_open_propdb with scratchpool.
* modules/dav/main/mod_dav.c (dav_method_propfind): Tag the scratchpool.
* dav_stream_response processes data that has been allocated from the propdb pool. Hence close the propdb *after* dav_stream_response which clears thei probdb pool.
Save a few cycles. There is no need to check the first bytes, they are known to be "bytes ".
Wire through the log message number.
Make sure ACL API support in mod_dav is not dependent on the presence or absence of apr-util v1.6. Log a message to note that ACL support is disabled with apr-util <= 1.5.
Follow up to r1739201. These APR_TIMEUP special cases are now handled by ap_map_http_request_error().
mod_dav: Fix a potential cause of unbounded memory usage or incorrect behavior in a routine that sends <DAV:response>'s to the output filters. The dav_send_one_response() function accepts the current head of the output filter list as an argument, but the actual head can change between calls to ap_pass_brigade(). This can happen with self-removing filters, e.g., with the filter from mod_headers or mod_deflate. Consequently, executing an already removed filter can either cause unwanted memory usage or incorrect behavior. This patch changes the signature of the existing mod_dav's public API, dav_send_one_response(), because this API is not yet a part of any 2.4.x release. * modules/dav/main/mod_dav.c (dav_send_one_response): Accept a request_rec instead of an ap_filter_t. Write the response to r->output_filters. (dav_send_multistatus, dav_stream_response): Update these calling sites of dav_send_one_response(). * modules/dav/main/mod_dav.h (dav_send_one_response): Adjust definition.
mod_dav: follow up to r1746207: fix typo (missing '/') for closing tag.
Allow other modules to become providers and add ACLs to the DAV response. Requires apr-util v1.6+.
mod_dav: Add dav_begin_multistatus, dav_send_one_response, dav_finish_multistatus, dav_send_multistatus, dav_handle_err, dav_failed_proppatch, dav_success_proppatch to mod_dav.h.
mod_dav: Add dav_get_provider_name() function to obtain the name of the provider from mod_dav.
Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
mod_dav: Add support for childtags to dav_error.
Added many log numbers to log statements that had none. Those were not detected by the coccinelle script.
More ap_casecmpstr[n]() usages (follow up to r1715876).
Save a few bytes in conf pool
core, modules: like r1657897 but for core and other modules than mod_proxy. More uses of ap_map_http_request_error() and AP_FILTER_ERROR so that we never return an HTTP error status from a handler if some filter generated a response already. That is, from a handler, either ap_get_brigade() (an input filter) returned AP_FILTER_ERROR and we must forward it to ap_die(), or ap_pass_brigade() (an output filter) failed with any status and we must return AP_FILTER_ERROR in any case for ap_die() to determine whether a response is needed or not.
tab vs space
Fix PR 56480: PROPFIND walker doesn't encode hrefs properly Reverts r1529559 partially (specifically the dav_xml_escape_uri) bit. Reverts r1531505 entirely. * modules/dav/main/mod_dav.c (dav_xml_escape_uri): Revert the piece of r1529559 that removes the URI escaping from this function. * modules/dav/main/props.c (dav_do_prop_subreq): Escape the URI before doing a sub request with it. This resolves some properties like getcontenttype from failing to be returned for files that contain characters that require encoding in their path. * modules/dav/main/mod_dav.h (dav_resource): Note the inconsistency in the documentation. * modules/dav/fs/repos.c (dav_fs_get_resource): Don't use the unparsed_uri to set the uri field of the resource. This is the correct fix for the double encoding in mod_dav_fs that led to the dav_xml_escape_uri() change and r1531505. (dav_fs_walker, dav_fs_append_uri): Revert r1531505 changes.
mod_dav: Fix invalid Location header when a resource is created by passing an
absolute URI on the request line.
Using r->unparsed_uri is wrong since it might contain a scheme, hostname and
port. See section 5.1.2 of RFC 2616, an absolute URI is allowed. The
unparsed_uri field is absolutely unparsed. The current code causes the
Location header to end up having the scheme, host and port included twice.
* modules/dav/main/mod_dav.c
(dav_created): Call ap_escape_uri() on r->uri when caller doesn't provide a
location.
Fix PR 55397: dav_resource->uri treated as an unparsed uri.
The change made for PR 54611 caused this field to be treated as
unescaped. mod_dav_svn however, provided escaped URIs. Essentially
breaking support for paths with non-URI safe characters in SVN.
Adjust the code so that dav_resource->uri is assumed to be escaped and
adjust mod_dav_fs so that it uses escaped URIs in this field.
* modules/dav/fs/repos.c
(dav_fs_get_resource): Use the unparsed_uri to contruct the resource uri.
* modules/dav/main/mod_dav.c
(dav_xml_escape_uri): Do not uri escape, just handle xml escaping.
(dav_created): Assume that locn if provided is escaped.
(dav_method_copymove, dav_method_bind): Use the unparsed_uri on the request
when calling dav_created() to adjust to locn assuming it is escaped.
* modules/dav/main/mod_dav.h
(dav_resource): Document that uri is escaped.
mod_dav: Fix PR 55306.
Makes mod_dav no longer require that the lock token be provided when the
source of a COPY is locked. The prior behavior was in violating of
RFC 4918 which says that the lock token is only required on resources
that may be modified by the method.
* modules/dav/main/mod_dav.h
(DAV_VALIDATE_NO_MODIFY): New flag to be passed to dav_validate_* functions.
* modules/dav/main/mod_dav.c
(dav_method_copymove): Use the new flag when calling dav_validate_request()
on the COPY source.
* modules/dav/main/util.c
(dav_validate_resource_state): Use the flag to decide to ignore if the lock
token is not provided.
mod_dav: set r->status_line in dav_error_response. It's used as argument in next ap_rvputs call. PR 55426.
Fix bug #55304 with the provided patch, slightly reformatted. In short: do not validate conditions of a COPY source's parent since it is not modified during the operation. * modules/dav/main/mod_dav.c: (dav_method_copymove): adjust params to dav_validate_request()
CVE-2013-1896 mod_dav: Sending a MERGE request against a URI handled by mod_dav_svn with the source href (sent as part of the request body as XML) pointing to a URI that is not configured for DAV will trigger a segfault. Submitted by: Ben Reser <ben reser.org>
core: Stop the HTTP_IN filter from attempting to write error buckets to the output filters, which is bogus in the proxy case. Create a clean mapping from APR codes to HTTP status codes, and use it where needed.
mod_dav: mod_dav overrides dav_fs response on PUT failure. PR 35981.
mod_dav: Ensure URI is correctly uriencoded on return. PR 54611 Patch submitted by Timothy Wood <tjw omnigroup com> Tested by William Lewis <wiml omnigroup com>
mod_dav: Sending an If or If-Match header with an invalid ETag doesn't result in a 412 Precondition Failed for a COPY operation. PR: 54610 Submitted by: Timothy Wood <tjw omnigroup.com>
mod_dav: Improve error handling in dav_method_put(), add new dav_join_error() function. PR: 54145 Submitted by: Ben Reser <ben reser.org> Reviewed by: trawick
Add lots of unique tags to error log messages
Remove some ap_add_version_component() calls that don't provide any information because the modules don't have separate version numbers anymore
Don't send a 500 if there is a timeout
More cleanup: Expand tabs and some more indentation fixes No functional change
Cleanup effort in prep for GA push: Trim trailing whitespace... no func change
Various code cleanup PR: 51398 Submitted by: Christophe Jaillet <christophe jaillet wanadoo fr>
Avoid some memory allocations by using apr_table_setn where the string arguments are allocated from the request pool and not modified later on. Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr> PR: 51358
Improvements found by cppcheck: remove some unused variables and dead assignments, reduce the scope of some variables, add some parens to improve readability
revert r1026746: If an unknown Content-* header is received for a PUT request, we must not ignore it but reply with 501 per RFC 2616 9.6. PR: 42978 Vetoed by Roy T. Fielding: http://mail-archives.apache.org/mod_mbox/httpd-dev/201102.mbox/%3C9A5A8B62-ED16-4BD3-97DA-8475026BB81D@gbiv.com%3E
If an unknown Content-* header is received for a PUT request, we must not ignore it but reply with 501 per RFC 2616 9.6. PR: 42978
If a malformed Content-Range header is received for a PUT request, we must not use the supplied content per RFC 2616 14.16. Send 400 response instead of ignoring the Content-Range. PR: 49825
- Remove a load of unused variables (or variables that are set but never read). - Move some declarations into the correct #ifdef scope. I couldn't compile/test netware, but the changes look obvious enough.
Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take advantage of per-module loglevels
Remove errno from dav_error interface. Calls to dav_new_error() and dav_new_error_tag() must be adjusted to add an apr_status_t parameter. Reviewed by: jorton
mod_dav_fs: Include uri when logging a PUT error due to connection abort. PR: 38149
Return 409 instead of 500 for a LOCK request if the parent resource does not exist or is not a collection. PR: 43465
mod_dav: Allow other modules to add things to the DAV or Allow headers of an OPTIONS request. Submitted by: Brian France <brian brianfrance.com>
Remove unused conf variable.
* Prevent a segfault if the destination URI of a copy / move operation is not under DAV control. Return 405 (Method not allowed) instead. PR: 44734
* Set character set for HTML outputs generated by mod_ldap, mod_proxy_balancer, mod_proxy_ftp, mod_info, mod_dav without a character set to ISO-8859-1. Submitted by: jorton
update license header text
Update the copyright year in all .c, .h and .xml files
Clean up some code in mod_dav. Submitted by: Dan Rall <dlr collab.net> * modules/dav/main/mod_dav.c (dav_error_response, dav_error_response_tag): Remove redundant assignment of r->status_line which is handled by basic_http_header_check().
No functional Change: Removing trailing whitespace. This also means that "blank" lines consisting of just spaces or tabs are now really blank lines
* Fix a null pointer dereference in dav_method_mkcol during the handling of errors from dav_auto_checkin. Submitted by: Ghassan Misherghi <ghassanm ucdavis.edu>
* modules/dav/main/mod_dav.h: Wrap all public functions in DAV_DECLARE or DAV_DECLARE_NONSTD. * modules/dav/main/liveprop.c, modules/dav/main/props.c, modules/dav/main/util_lock.c, modules/dav/main/mod_dav.c, modules/dav/main/std_liveprop.c, modules/dav/main/util.c: Update function definitions. Submitted by: Branko Čibej <brane xbc.nu> Reviewed by: Justin Erenkrantz
Improve interaction with caches in mod_dav. * modules/dav/main/mod_dav.c (dav_method_get): Check for conditionals.
Update copyright year to 2005 and standardize on current copyright owner line.
general property cleanup
use new apr_strtoff function to parse PUT ranges correctly.
* modules/dav/main/mod_dav.c (dav_method_put): Fix segfault in auto-versioning error handling path. PR: 29148
* modules/dav/main/mod_dav.c (dav_finish_multistatus): New function; factored out, sends an EOS bucket after the response body. (dav_send_multistatus, dav_method_propfind): Use it. [might be related to PR 27576 if there is a real issue described there]
fix name of The Apache Software Foundation
apply Apache License, version 2.0
* modules/dav/main/mod_dav.c (dav_handler): Reject request if the Request-URI includes a fragment part, i.e. an unescaped #. PR: 21779 Submitted by: Amit Athavale <amit_athavale@lycos.com>
update license to 2004.
* modules/dav/main/mod_dav.c (dav_method_copymove): For a 401 on the destination resource, propagate the WWW-Auth header from the subrequest back to the client. PR: 15571
get rid of _FOREACH
drop the test, whether apr_brigade_create returns NULL. It does never (dumps core instead :-) Submitted by: Cliff Woolley
use bucket brigades directly when reading PUT data. This avoids problems with content-length-modifying input filter (like deflate). PR: 22104 Some stuff submitted by: tim@robbins.dropbear.id.au (Tim Robbins)
Switch ap_filter_flush() to ap_pass_brigade(). This removes a layer of
function calls, provides type safety for the ap_filter_t*, and
clarifies what is really going on (i.e. we aren't sending a FLUSH
bucket of any kind).
* mod_dav.c (dav_send_multistatus, dav_method_propfind): change the
ap_filter_flush call to ap_pass_brigade; flip the params to match
the prototype.
Have mod_dav deal with errors that happen during a streamy provider
response.
* mod_dav.c (dav_method_propfind, dav_method_report): if the dav
provider throws an error in the middle of streaming a response,
have mod_dav log an error and abort the connection.
Submitted by: Ben Collins-Sussman <sussman@collab.net>
Fix a crasher introduced on June 3.
* mod_dav.c (dav_method_propfind): the PROPFIND request might not have
a body. Therefore, we cannot dereference 'doc' unconditionally.
Test it to decide what to pass on to dav_begin_multistatus().
Submitted by: Ben Collins-Sussman <sussman@collab.net>,
David Waite <mass@akuma.org>
mod_dav improvement: make dav_method_propfind stream its response, rather than cache every <response> object and send the whole 207 at once. Note: this patch doesn't affect the mod_dav provider API at all. Providers still return property results in text-buffers, but mod_dav then streams them out immediately. Submitted by: Ben Collins-Sussman <sussman@collab.net> Reviewed by: gstein, jerenkrantz, sander * mod_dav.h (dav_walker_ctx): add a brigade field and a scratchpool field. * mod_dav.c (dav_send_one_response): new helper function to write a <DAV:response> into a brigade/filter. this code has been factorized out of dav_send_multistatus. (dav_begin_multistatus): new factorized helper func; creates brigade and sends initial <multistatus> tag. (dav_send_multistatus): create brigade, call dav_begin_multistatus, and switch all ap_rputs calls to ap_fputs instead. call dav_send_one_response when looping over response list. use a subpool when iterating. (dav_method_propfind): initialize walker ctx's brigade. initialize ctx's scratchpool as a subpool of r->pool. Send a <multistatus> tag before calling the provider's walk() function, and a </multistatus> tag afterwards. (dav_stream_response): new function, originally based on dav_add_repsonse. don't build linked list of responses in memory; just spew each response object into the brigade via dav_send_one_response(). take an incoming pool argument to do the temporary allocation and streaming. (dav_propfind_walker): pass ctx->scratchpool to dav_stream_response, and clear the pool when finished.
mod_dav providers define a 'can_be_activity' callback. Unfortunately, mod_dav isn't calling it before creating an activity. This is a required precondition (along with the resource not existing), as defined in the deltaV RFC (3253), section 13.5. * mod_dav.c (dav_method_make_activity): if available, call provider's 'can_be_activity' callback as a precondition to making an activity. Submitted by: Ben Collins-Sussman <sussman@apache.org> Reviewed by: Sander Striker
finished that boring job: update license to 2003. Happy New Year! ;-))
Code a bit more defensively. If dav_lookup_uri() ever placed user input into lookup.err.desc for the HTTP_BAD_REQUEST case, then we could have problems (via a format string attack). This change frees us from *future* worries.
Allow CGI scripts that use POST and mod_dav to exist in the same location. Mod_Dav was always setting the r->handler field to "dav_handler", but this means that mod_cgi won't run the script. According to my reading of the DAV RFC, mod_dav shouldn't do anything at all with a POST request, because it is impossible to know if the POST was meant for DAV or for some other resource. We used to excuse POST from DAV processing, so I have re-enabled that behavior. PR: 13025
If a body arrives with an OPTIONS request, and it contains an <options> tag, as defined by RFC 3253, and we don't recognize the option as a builtin one, then we pass that off to the versioning hooks of the DAV provider for it to process. However, we neglected to check whether the provider actually *had* versioning hooks first. The fix: simply check for versioning hooks before using them. Problem found by: Ryan Bloom <rbb@apache.org>
We need to set r->handler to indicate that we'll be handling the request. Otherwise, other modules may attempt to do "funny stuff" with the request (specifically: mod_dir will map /some/path/ into an index.html document if found). This reinstalls a fixups hook to set the r->handler value. Most of the checks in the dav_handler() function are now moved to the fixups hook. We just don't bother to set the handler unless all conditions are met.
Simplify mod_dav's handler. The old mechanism would jam a handler name in whenever DAV was configured for a directory. i.e. there weren't really any tests other than "is DAV handling this directory?" The name was just a marker which was tested later. The new mechanism simplies performs the test right in the handler. This is now possible since all handlers are called (before, you *had* to set your own name so that your handler would be called). Since the test is actually quite straightforward, we actually gain overall: no more fixups hook, and a couple integer comparisons (rather than a string compare). And hoo... the code is simpler, too. This code has been verified with "litmus 0.8", my own little regression script, and some hand testing of static pages and CGIs. DAV continues to work, and it doesn't appear that the changes interfered with other operation.
Switch hook from type_checker to fixups. (This hook may be able to removed entirely in favor of being in dav_handler, but that is left as an exercise to the reader.)
Allow mod_dav to be involved with sub-requests.
catch up with the apr_atoll -> apr_atoi64 rename
Replace atol() calls which should return long long with apr_atoll() calls. Submitted by: Shantonu Sen <ssen@apple.com>
The real pain. ap->apr xml and text types.
That's apr, not ap (any longer)
Call ap_discard_request_body from ap_finalize_request. Remove the call from all other modules that do not use it to determine the response for the request.
stop using APLOG_NOERRNO in calls to ap_log_[pr]error()
Add DASL(SEARCH) support to mod_dav. Submitted by: Sung Kim <hunkim@cse.ucsc.edu>
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..
The underlying change here was to add the new WebDAV/DeltaV methods now that it has an RFC. At the same time, I revamped a good chunk of the name <-> number mapping code in http_protocol.c * add M_FOO constants for the new RFC 3253 (DeltaV) methods. label where each of the builtin methods comes from. * moved METHOD_NUMBER_FIRST/LAST from http_protocol.h into http_protocol.c since they weren't used anywhere else and they weren't namespace-protected. * create register_one_method() and use it to insert all builtin methods (at _init() time) and extended methods into the registry. * add a lookup_builtin_method() to quickly map a method name to a builtin method number. * rebuild ap_method_number_of() to use the new lookup function. * revamp ap_method_name_of() to use the registry to locate the name for any method number. add a pool argument (no callers in the core code needed to be updated) * revamp make_allow() to deal with the new method numbers and all extended methods. * in mod_dav, use the new method numbers rather than registering the DeltaV methods.
Change the REPORT handling APIs to deliver the content directly into the filter stack, rather than buffering everything into memory(!).
Update our copyright for this year.
* mod_dav.c (dav_handle_err): look through the error stack for some
kind of errortag. any buried errortag is better than a generic
response.
Submitted by: Ben Collins-Sussman <sussman@collab.net>
Big style patch. Mostly detab, but also changed some comments from: /* ** */ to: /* * */ The latter is the dominant style in apache. The only other places they can be found (AFAIK) are mod_ssl and mod_rewrite.
Give mod_dav the ability to output both standard and customized
<D:error> responses. It's crucial for marshalling svn error messages
back over to the client; and someday it will be needed to return
specific <DAV:> errors as dictated by the DeltaV spec.
* mod_dav.h (dav_error): add two new fields -- an optional error
namespace, and an error-tag-name. Remove the 'delayed computation'
function and cxt ptrs in this struct; they were never used.
(dav_new_error_tag): new alternative constructor that takes new
fields.
* util.c (dav_new_error_tag): implement constructor.
* mod_dav.c (dav_error_response_tag): new function to output
'standard' xml error response based on error struct.
(dav_handle_err): if no multistatus response is passed in, and if an
error-tag is defined, then call our new xml-output routine.
Submitted by: Ben Collins-Sussman <sussman@collab.net>
Get rid of the DAVParam support. That was a concept to help out mod_dav providers in the 1.0.x series. Nowadays, the providers are full-fledged Apache modules and can define their own directives and set up per-server and per-directory parameters. (for example, mod_dav_fs and the DAVLockDB directive)
If the provider returns an error, then we should propagate it (rather than override it with HTTP_INTERNAL_SERVER_ERROR). The specific case observed was a provider issuing a redirect.
Revamp how mod_dav asks its provider to generate a GET response.
* eliminate the get_pathname and free_file vtable functions. add the
deliver() function to have the provider deliver the content
straight into a filter [stack].
* eliminate readable streams -- they are now obsolete. this gets rid
of the read_stream vtable function and DAV_MODE_READ*
* implement a deliver() function for the FS provider. this simply
constructs a bucket and EOS and shoves them into the filter. note
that this is debug code only, so the "large file" issue handled by
the core's default handler doesn't count here.
* allow the provider to handle GET for any resource type and for
collections. this moves the checks into the provider.
Fix how mod_dav examines methods in the request -- use the method number from the request. To do this, we also need to register all of the new/custom methods that mod_dav recognizes. Note: this fixes a bug where a method (e.g. REPORT) would appear in a Limit(Except) directive and Apache would register the method. The method number in the request would then be something *other* than M_INVALID, which threw off mod_dav's tests. Submitted by: Sander Striker <striker@apache.org>
Modify post_config hook so that it can return a error, causing the server not to start. previous method was to call exit(1) which would not fail gracefully PR: Obtained from: Submitted by: Reviewed by: (Idea only Jeff Trawick)
This patch changes the apr_table_elts macro so that it provides access to the internals of an apr_table_t via a const pointer instead of the current non-const pointer. Submitted by: Brian Pane <BPane@pacbell.net> Reviewed by: Ian Holsman
Don't change the type of the new resource. The provider will update it when the copy/move takes place. Specifically, the new location might imply a different type from the original, so updating the type is bad mojo. In the observed case, a resource was copied into a working collection; the type of the new resource is supposed to be WORKING. Copying the type would be wrong if the source was REGULAR.
Get rid of some byterange handling code; it doesn't apply in Apache 2.0.
Don't set r->status_line. Apache uses that in preference to any other status line, thinking we've set a custom status. Of course, it says "200 OK" no matter what error we happen to return(!).
Canonicalization will now occur on all sub_req_lookup_file() calls, and the ap_server_root_relative() will handle canonicalization as well.
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>
Clean up mod_dav error reporting to HTML/XHTML cross-compliance.
Fix a couple of compiler warnings, since these are macros, not functions. Submitted by: Justin Erenkrantz <jerenkrantz@ebuilt.com> Reviewed by: Victor Orlikowski <orlikowski@apache.org>
allow non-absolute URIs to occur in some of the requests. RFC 2518 states that the Destination: header (used in MOVE/COPY) must be an absolute URI, so it keeps that constraint.
Fix up the auto-versioning stuff. The new scheme more closely matches the intent of DeltaV draft 14, simplifying some previous assumptions. Includes some heavy fixes to MOVE/COPY in a versioning world. Fix to CHECKOUT when a working resource is not created (checkout in place) Submitted by: John Vasta <jvasta@rational.com>
Implement the MERGE method: fill in dav_method_merge(); add merge() function to dav_hooks_vsn.
clean up some warnings dealing with 1) mismatches between printf format strings and arguments 2) wrong type for last parm to ap[r]_xml_to_text 3) missing time.h decls
Patch to sync with some changes to mod_dav 1.1: *) revamp the set_target stuff -- latest draft calls this UPDATE *) update the CHECKIN method handling *) liveprop providers can catch/define "core" properties before the core gets a chance. Submitted by: John Vasta <jvasta@rational.com> Reviewed by: Greg Stein
*) mod_dav.c: allow PUT to a WORKING resource (this actually the only valid place to do a PUT(!)) *) util.c: add a comment. allow validation to proceed without a lock database (the rest of the code supported it; one erroneous check disabled that work) *) util_lock.c: allow dav_unlock() to be a no-op when a lock provide isn't present; this allows DELETE to work.
Goodbye ap_send_http_header
use apr_off_t and APR_OFF_T_FMT (for portability to 64-bit off_t systems) Submitted by: Jeff Trawick Reviewed by: Greg Stein
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
apr_make_array->apr_array_make (if only it were apr_rename.py instead of apr_rename.pl)
*) make sure the status line is set on custom responses *) allow CHECKOUT on version resources
renaming various functions for consistency sake see: http://apr.apache.org/~dougm/apr_rename.pl PR: Obtained from: Submitted by: Reviewed by:
Revamp the CHECKOUT method handling and various support functions for it. Basically, the original CHECKOUT was based on a really old draft of the DeltaV specification. This brings it up to date. *) get_resource hook now takes an optional label name and/or a flag on whether to use the DAV:checked-in property; if either one is provided, then a version resource is looked up and returned. WARNING: the parameter types are now the same, but have very different semantics. this means you won't get a compile error to figure out that something needs to be changed here. *) mod_dav.c::dav_get_resource no longer cahces the fetched resource in the request userdata. Some requests will call this function multiple times, for different resources -- we don't want to keep returning the same resource (no idea how this ended up working). *) dav_get_resource()'s parameters have been updated. target_allowed is old terminology; it is now label_allowed. The target paramter is obsoleted by the simple use_checked_in flag. *) dav_get_target_selector() is obsolete. XML element processing is done within the CHECKOUT method (i.e. only where it occurs). The other half of the old function was to simply fetch the Label: header. *) DAV_TARGET_SELECTOR_HDR is now DAV_LABEL_HDR *) dav_method_checkout() now processes all the various options for a CHECKOUT method and either modifies the initial resource lookup, or passes the data to the checkout hook function. *) the checkout hook grew a bunch of new parameters *) new utility function: dav_xml_get_cdata() to gather up all the CDATA from an XML element. this is used to extract DAV:href values. (probably move to util_xml.c at some point)
*) add activity handling: OPTIONS and MKACTIVITY *) fix HTTP status code in MKWORKSPACE handling *) add can_be_activity and make_activity hooks to dav_hooks_vsn
Provide a way to allow get_resource and get_parent_resource to return errors that might occur during the parsing of the URI and/or the lookup of the resource in the repository. Specifically: return a dav_error* and move the returned dav_resource* to an "out" parameter of the hook function.
we only need to worry about infinite-depth PROPFINDs if they are targeting a collection. allow them on plain resources.
some stylistic tweaks post- John's patch
- implement DeltaV OPTIONS extensions - let live prop providers get first crack at PROPFIND - work around MS Web Folders limit on DAV header length Submitted by: John Vasta <jvasta@rational.com> Reviewed by: Greg Stein
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.
Fix a problem found by Ryan when deleting collections, which triggered an underlying (broad) bug. dav_add_response() was assuming the walk params were a dav_walker_ctx. During the walker cleanup in Nov00, that assumption was removed, so response errors that occurred in the cleaned sections (such as dav_fs_delete_resource) could trigger a segfault. Solution: add a pool to dav_walk_resource and alter dav_add_response to use that, rather than assume the ctx is a dav_walker_ctx. [ note there is also a pool in dav_walk_resource.resource, but that pool is associated with the *resource* rather than the process of walking, so we introduced another field. currently they are the same, however. ] Found by: Ryan Bloom
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 find_liveprop() hook take a dav_resource rather than "r"
*) repos.c: liveprop hooks shouldn't respond if the resource is not an FS
resource.
*) std_liveprop.c: use empty-elem form if value=="". return NOTDEF for the
properties that we aren't ready to insert yet
shift some processing of "core" WebDAV properties out of the generic property handling code, and into a new, core liveprop handler. *) add std_liveprop.c to deal with the core DAV properties *) move DAV:resourcetype, DAV:supported-method-set, DAV:supported-live-property-set, and DAV:supported-report-set over to the new handler *) props.c::dav_get_allprops() should not look in the deadprop database for the DAV:resourcetype -- it is readonly, so should never be in there. *) strip vsn_hooks from the propdb; only the core liveprops need it now *) mod_dav.c: register the core liveprop hooks and URIs *) fs/repos.c: stripped DAV:displayname and DAV:source, in favor of letting the core handler deal with them.
*) fix subtle crasher in COPY method *) update sub-request-creation calls to include new "next filter" arg
use apr_size_t and a few minor tweaks
Apply a patch from John Vasta for adding (some/more) DeltaV support to mod_dav. The patch applied and compiled cleanly, so I'm committing. Any necessary changes from a review will come later, so that we can easily track what needed to change (and can be back-ported to mod_dav 1.1). Submitted by: John Vasta <jvasta@rational.com>
final round of walker cleanup: fix the provider API to match what is Right.
first round whack at cleaning up the walker interface
oops. only do the slash management if dir != NULL
Here it is, mod_dav should build quite nicely on Win32 (two last mild warnings to contend with.)
*) fix GET handling: cache the provider; test through the provider rather than the handle_get config member (which is now gone) *) use "DAV/2" for the server token rather than dup'ing the apache vsn
clean up the provider stuff some more: don't allow pick-and-choose of pieces, but just a complete provider. they aren't really separable anyways.
forward-port John Vasta's checkin to mod_dav 1.1.x (on Sep 25, 2000). this begins some work to upgrade the versioning support to some of the more recent drafts. - get_resource hook has new params - create_collection hook no longer takes a pool - new dav_auto_version_info structure to group up autoversion rollback/commit handling data - new functions for getting workspace, target-selector, etc - supportedlock hook now takes the resource in question (since different resources may have different locks) - new resource types; tweaks in props.c to support them - some tweaks with resource creation, Location header, etc.
*) convert fs/lock.c to use APR UUIDs for the opaque locktokens. *) blow away opaquelock.c and dav_opaquelock.h since direct use of APR UUIDs is quite easy. *) toss the uuid_state from the per-server config in mod_dav.c
The "get resource" functionality is no longer a hook. Instead, providers register themselves by name with mod_dav. The user configures a particular provider for a location/directory. mod_dav looks up that provider and uses it explicitly. (the prior behavior simply asked "anybody" to satisfy the get_resource, but it did not mesh well with user-specified providers) *) add providers.c to deal with provider registration *) rejigger mod_dav.c to toss the hook and use the provider *) clean out dav/fs/ of the old scheme and have it register itself
the DAV directive now takes the name of a repository provider
update the WebDAV versioning support: - recognize and dispatch the latest set of DeltaV methods - refine the CHECKOUT provider hook - add avail_reports provider hook - fix the "target" resolution mechanism
Updated patch to fix compile warnings from not including apr_strings.h Submitted by: Joe Orton <joe@orton.demon.co.uk> Reviewed by: Bill Stoddard
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_
Fix copy/move depth infinity lock propagation problem. Submitted by: Joe Orton <joe@orton.demon.co.uk>
shift the LimitXMLRequestBody directive to the core. use it from util_xml.
complete the removal of the old dav_dyn crap. dav plugins are now
implemented entirely through standard Apache modules, hooks, and some
additional registration.
torch just about all of the old dav_dyn stuff. temporarily hard-wire the
liveprop provider setup. this will go away momentarily (another pass).
get rid of more of the old module/provider mechanisms -- use ap_hooks to look up the plugins' function hook tables.
do the "get resource" via a hook rather than through the repository hook
structure. once the resource is retrieved, then we have the relevant
repository hooks and can dispatch through those.
some additional tweaks to use lockdb->hooks rather than fetching them
turn dav/fs/ into a real module move the DAVLockDB directive to the dav_fs module
add ap_get_status_line() so that modules can get a standardized
Status-Line value for their response.
Submitted by: Joe Orton <joe@orton.demon.co.uk>
Reviewed by: Greg Stein
Joe Orton writes: This updates mod_dav for the util_xml changes posted previously: * dav_xml -> ap_xml, and dav_text -> ap_text renaming * Add 'dav_elem_private' to hook mod_dav-specific info up to the parsed XML tree. Initialize this in several places, I think I got all necessary? [gjs: yes, you did] * Removal of the old "gross_hack", and all the XML code that was moved into util_xml Submitted by: Joe Orton <joe@orton.demon.co.uk> Reviewed by: Greg Stein
misc const cleanups and others issues found using maintainer-mode
(initial errors found by Ryan Bloom).
also switch to use new command table initializer macros.
run DAV's type_checker first so that it can grab the non-GET methods (it
will pass thru GET for normal processing)
fix the DBGn() macros for Apache 2.0
get the DAV stuff to compile for Apache 2.0. some unpleasantries are in
there, but it *does* compile.
first, obvious step: alter the license/copyright on all mod_dav files.
initial checkin of the new Apache DAV code. this is a pristine copy of mod_dav 1.0.1 (tag "V1_0_1" in the mod_dav CVS repository). For historical information about these files, see the (old) mod_dav web site at http://www.webdav.org/mod_dav/. CVS repository information can be located from those pages.
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.
| infrastructure at apache.org | ViewVC Help |
| Powered by ViewVC 1.1.26 |