1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-25 10:59:28 +03:00
Commit Graph

450 Commits

Author SHA1 Message Date
Yann Ylavic
019efb6465 Follow up to r1739201.
These APR_TIMEUP special cases are now handled by ap_map_http_request_error().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1766998 13f79535-47bb-0310-9956-ffa450edef68
2016-10-28 10:56:03 +00:00
Evgeny Kotkov
b7c8e86f24 mod_dav: Note an API issue with the dav_hooks_repository.deliver(),
dav_hooks_vsn.deliver_report() and dav_hooks_vsn.merge() hook
definitions.

* modules/dav/main/mod_dav.h
  (dav_hooks_repository.deliver, dav_hooks_vsn.deliver_report,
   dav_hooks_vsn.merge): Add notes about the API issue.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1764043 13f79535-47bb-0310-9956-ffa450edef68
2016-10-10 09:43:19 +00:00
Evgeny Kotkov
d1ecb963ed 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1764040 13f79535-47bb-0310-9956-ffa450edef68
2016-10-10 09:40:06 +00:00
William A. Rowe Jr
2f520eb009 Fix bogus K&R declarations
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756927 13f79535-47bb-0310-9956-ffa450edef68
2016-08-19 15:59:52 +00:00
Yann Ylavic
7693d36426 mod_dav: follow up to r1746207: fix typo (missing '/') for closing tag.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756611 13f79535-47bb-0310-9956-ffa450edef68
2016-08-17 11:06:43 +00:00
Rainer Jung
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
Ruediger Pluem
810da4d8a6 * Fix compilation error introduced in r1748322 by double typedef
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1748563 13f79535-47bb-0310-9956-ffa450edef68
2016-06-15 11:34:45 +00:00
Graham Leggett
75b1758444 Allow other modules to become providers and add ACLs
to the DAV response. Requires apr-util v1.6+.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1748322 13f79535-47bb-0310-9956-ffa450edef68
2016-06-13 22:33:35 +00:00
Stefan Eissing
3597b9a443 mod_dav: making mod_dav.h compile with clang again
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1748155 13f79535-47bb-0310-9956-ffa450edef68
2016-06-13 09:31:09 +00:00
Graham Leggett
9d10b5661a 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1748047 13f79535-47bb-0310-9956-ffa450edef68
2016-06-12 20:23:21 +00:00
Graham Leggett
5405da141a mod_dav: Add dav_get_provider_name() function to obtain the name
of the provider from mod_dav.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747946 13f79535-47bb-0310-9956-ffa450edef68
2016-06-12 00:58:09 +00:00
William A. Rowe Jr
f4cc76ee71 Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
2016-06-09 00:06:42 +00:00
Graham Leggett
b40a421606 mod_dav: Add support for childtags to dav_error.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1746207 13f79535-47bb-0310-9956-ffa450edef68
2016-05-30 22:38:23 +00:00
Rainer Jung
af14d158a3 Added many log numbers to log statements that
had none.

Those were not detected by the coccinelle script.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725485 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 12:02:41 +00:00
Yann Ylavic
6f8a850766 Follow up to r1715880: revert abusive ap_casecmpstr[n]() usages.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1716151 13f79535-47bb-0310-9956-ffa450edef68
2015-11-24 14:38:54 +00:00
Yann Ylavic
e30575b0b0 More ap_casecmpstr[n]() usages (follow up to r1715876).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715880 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:48:35 +00:00
Christophe Jaillet
5ff5f64409 Remove some useless 'return' statements.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715583 13f79535-47bb-0310-9956-ffa450edef68
2015-11-21 22:03:24 +00:00
Christophe Jaillet
68131d85a4 Fix some style issues on files that can easily be synch'ed with 2.4.x
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705983 13f79535-47bb-0310-9956-ffa450edef68
2015-09-30 08:35:35 +00:00
Christophe Jaillet
27f8ab24e1 In order to save a few cycles, delay a hash table lookup which is not necessary needed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1701717 13f79535-47bb-0310-9956-ffa450edef68
2015-09-08 03:14:34 +00:00
Gregg Lewis Smith
4c24014620 Third try, follows up 1694901 and 1694902
MinGW32 and MSVC both define WIN32
MSVC and Netware do not use autoconf


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1694912 13f79535-47bb-0310-9956-ffa450edef68
2015-08-09 21:33:02 +00:00
Gregg Lewis Smith
ce2153134e followup to r1694901, it was too greedy
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1694902 13f79535-47bb-0310-9956-ffa450edef68
2015-08-09 19:47:55 +00:00
Gregg Lewis Smith
1e9ab84c6d ap_config_auto.h is not used/created in non-Autoconf compilers like MSVC
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1694901 13f79535-47bb-0310-9956-ffa450edef68
2015-08-09 19:21:44 +00:00
Christophe Jaillet
38f1949593 Save a few bytes in conf pool
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1683884 13f79535-47bb-0310-9956-ffa450edef68
2015-06-06 05:59:49 +00:00
Ben Reser
40670acf6b mod_dav: Avoid doing the walk on a COPY source for handling preconditions if
there are no preconditions provided.

* modules/dav/main/util.c:
  (dav_validate_request): avoid validating locks and ETags when there are
    no If headers providing them on a resource we aren't modifying.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1677462 13f79535-47bb-0310-9956-ffa450edef68
2015-05-03 18:02:33 +00:00
Jan Kaluža
6ac752395e * mod_dav_fs: set default value of DavLockDB using installation layout
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1674222 13f79535-47bb-0310-9956-ffa450edef68
2015-04-17 07:28:50 +00:00
Christophe Jaillet
71e93ff17b Avoid a potential integer underflow in the lock timeout value sent back to a client. The answer to a LOCK request could be an extremly large integer if the time needed to lock the resource was longer that the requested timeout given in the LOCK request. In such a case, we now answer "Second-0". PR55420
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1666361 13f79535-47bb-0310-9956-ffa450edef68
2015-03-13 07:21:10 +00:00
Yann Ylavic
0a431ef862 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1665625 13f79535-47bb-0310-9956-ffa450edef68
2015-03-10 17:25:17 +00:00
Joe Orton
0b73b47e98 * modules/dav/main/config.m4: Remove long-redundant expat reference.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1650490 13f79535-47bb-0310-9956-ffa450edef68
2015-01-09 10:24:28 +00:00
Christophe Jaillet
77a1c29551 Fix indent.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1638159 13f79535-47bb-0310-9956-ffa450edef68
2014-11-11 15:20:49 +00:00
Christophe Jaillet
5f064a8acc tab vs space
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1633529 13f79535-47bb-0310-9956-ffa450edef68
2014-10-22 05:24:05 +00:00
Ben Reser
3bda0de20f 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1602338 13f79535-47bb-0310-9956-ffa450edef68
2014-06-13 08:34:05 +00:00
Ben Reser
fb5675a5b8 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592655 13f79535-47bb-0310-9956-ffa450edef68
2014-05-06 05:00:21 +00:00
Christophe Jaillet
4ed59c4673 Typo in comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588862 13f79535-47bb-0310-9956-ffa450edef68
2014-04-21 09:33:41 +00:00
Christophe Jaillet
f8afa5bc25 Style, indentation. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1557317 13f79535-47bb-0310-9956-ffa450edef68
2014-01-11 06:32:59 +00:00
Christophe Jaillet
68b018c3eb Add missing break in 'dav_generic_do_refresh' to avoid useless computation.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1556914 13f79535-47bb-0310-9956-ffa450edef68
2014-01-09 18:48:11 +00:00
Christophe Jaillet
58af80a630 As in 'dav_generic_do_refresh', add missing break in 'dav_fs_do_refresh' to avoid useless computation.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1556911 13f79535-47bb-0310-9956-ffa450edef68
2014-01-09 18:44:50 +00:00
Ben Reser
02780d57bd SECURITY: CVE-2013-6438 (cve.mitre.org)
mod_dav: Keep track of length of cdata properly when removing leading spaces.

* modules/dav/main/util.c
  (dav_xml_get_cdata): reduce len variable when increasing cdata pointer.

Submitted by: Amin Tora <Amin.Tora neustar.biz>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1556428 13f79535-47bb-0310-9956-ffa450edef68
2014-01-08 02:40:38 +00:00
Jeff Trawick
30f8aa6460 more apr_file_write_full() simplification (like r1542413)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542416 13f79535-47bb-0310-9956-ffa450edef68
2013-11-15 22:03:16 +00:00
Ben Reser
31a3eab6d7 Followup to r1529559: mod_dav_fs: Fix encoding of hrefs in PROPFIND response.
Previous commit missed encoding the names of the children of the PROPFIND
request when the depth wasn't 0.

* modules/dav/fs/repos.c
  (dav_fs_append_uri): New function
  (dav_fs_walker): Use dav_fs_append_uri() and adjust length calculations to
    use the encoded length.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1531505 13f79535-47bb-0310-9956-ffa450edef68
2013-10-12 06:13:20 +00:00
Ben Reser
4de0b69f7f 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1529559 13f79535-47bb-0310-9956-ffa450edef68
2013-10-06 01:08:51 +00:00
Ben Reser
3c6d4757a1 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1528718 13f79535-47bb-0310-9956-ffa450edef68
2013-10-03 05:29:35 +00:00
Jan Kaluža
79f70135fb mod_dav: set r->status_line in dav_error_response.
It's used as argument in next ap_rvputs call. PR 55426.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1527509 13f79535-47bb-0310-9956-ffa450edef68
2013-09-30 10:35:52 +00:00
Greg Stein
b95a5db5cb 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()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1506714 13f79535-47bb-0310-9956-ffa450edef68
2013-07-24 21:09:38 +00:00
Rainer Jung
5dde0f74ca Fix indentation (plus now needed line-wrap).
Followup to r1470940.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1497588 13f79535-47bb-0310-9956-ffa450edef68
2013-06-27 22:25:56 +00:00
Graham Leggett
c340f7e666 Clarify the existing behavior.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1486027 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 12:02:28 +00:00
Graham Leggett
0d1d5098ac Reverting as per veto in http://svn.apache.org/r1486021.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1486026 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 11:59:51 +00:00
Graham Leggett
87367647de 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>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1485668 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 12:52:06 +00:00
Graham Leggett
9bc9d79079 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482522 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 18:58:06 +00:00
Graham Leggett
26548fee8b mod_dav: mod_dav overrides dav_fs response on PUT failure. PR 35981.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1477687 13f79535-47bb-0310-9956-ffa450edef68
2013-04-30 15:28:57 +00:00
Graham Leggett
42f0d9dd77 mod_dav: Make sure the URI length is calculated correctly.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1477530 13f79535-47bb-0310-9956-ffa450edef68
2013-04-30 10:15:23 +00:00