1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

305 Commits

Author SHA1 Message Date
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
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
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
Graham Leggett
767bded576 mod_dav: Do not segfault on PROPFIND with a zero length DBM. PR 52559
Submitted by: Diego Santa Cruz <diego.santaCruz spinetix.com>
Tested by William Lewis <wiml omnigroup com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476645 13f79535-47bb-0310-9956-ffa450edef68
2013-04-27 17:52:03 +00:00
Graham Leggett
0baf2d9383 mod_dav: PROPPATCH delete (svn propdel) silently discards errors. PR 53525
Submitted by Arwin Arni <arwin collab.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476627 13f79535-47bb-0310-9956-ffa450edef68
2013-04-27 17:08:22 +00:00
Graham Leggett
455a86c472 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>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476621 13f79535-47bb-0310-9956-ffa450edef68
2013-04-27 16:55:44 +00:00
Graham Leggett
b953a0a424 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>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476604 13f79535-47bb-0310-9956-ffa450edef68
2013-04-27 15:40:18 +00:00
Graham Leggett
1416de62f5 mod_dav: Make sure that when we prepare an If URL for Etag comparison,
we compare unencoded paths. PR 53910
Patch submitted by Timothy Wood <tjw omnigroup com>
Tested by William Lewis <wiml omnigroup com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1470940 13f79535-47bb-0310-9956-ffa450edef68
2013-04-23 13:14:34 +00:00
Jeff Trawick
4149fb80f4 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1464241 13f79535-47bb-0310-9956-ffa450edef68
2013-04-04 00:22:52 +00:00
Christophe Jaillet
f0d65aca48 [Test] First try : remove extra ';'
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1397320 13f79535-47bb-0310-9956-ffa450edef68
2012-10-11 21:27:18 +00:00
Guenter Knauf
7814748ab3 NetWare build tweaks.
Make more use of internal makefile macros;
axed now obsolete include paths.
Submitted by: normw gknw net.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1371177 13f79535-47bb-0310-9956-ffa450edef68
2012-08-09 12:11:09 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Stefan Fritsch
a3ffb7e3df Remove some ap_add_version_component() calls that don't provide any information
because the modules don't have separate version numbers anymore


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199532 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 23:37:13 +00:00
Stefan Fritsch
ebfb6ac9c9 Don't send a 500 if there is a timeout
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199444 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 20:36:03 +00:00
Stefan Fritsch
1951a037bf More cleanup: Expand tabs and some more indentation fixes
No functional change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:08:42 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Stefan Fritsch
51692222f6 Various code cleanup
PR: 51398
Submitted by: Christophe Jaillet <christophe jaillet wanadoo fr>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1138627 13f79535-47bb-0310-9956-ffa450edef68
2011-06-22 20:45:34 +00:00
Stefan Fritsch
48345b21d0 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135084 13f79535-47bb-0310-9956-ffa450edef68
2011-06-13 11:04:29 +00:00
Stefan Fritsch
2014acf62f Improvements found by cppcheck:
remove some unused variables and dead assignments, reduce the scope of some
variables, add some parens to improve readability


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103459 13f79535-47bb-0310-9956-ffa450edef68
2011-05-15 16:58:45 +00:00
Guenter Knauf
10b8e04753 Create dav.imp dynamically from header to catch all exports.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1083540 13f79535-47bb-0310-9956-ffa450edef68
2011-03-20 19:14:45 +00:00
Guenter Knauf
db1cf0ac7f Removed dav_get_limit_xml_body() from mod_dav.h.
This was a forgotten prototype hanging around for close
to 11 years where no code for existed (see r85816);
now removed from all branches per wrowe's permission.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1083536 13f79535-47bb-0310-9956-ffa450edef68
2011-03-20 18:58:27 +00:00
Guenter Knauf
7c1e9bf7c9 More NetWare build fixes.
Sorted some makefile dependencies; fixed DAV makefiles.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1083478 13f79535-47bb-0310-9956-ffa450edef68
2011-03-20 15:56:39 +00:00
Guenter Knauf
888ec80125 Use a var INSTALLBASE to simplify NetWare installation rules.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082821 13f79535-47bb-0310-9956-ffa450edef68
2011-03-18 04:56:06 +00:00
Guenter Knauf
bab978c56e Use var for prelude so its possible to change it at one place.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082811 13f79535-47bb-0310-9956-ffa450edef68
2011-03-18 03:09:27 +00:00
Guenter Knauf
2dc89e951b NetWare build overhaul in order to compile on Linux.
Some more fixes ...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1079614 13f79535-47bb-0310-9956-ffa450edef68
2011-03-09 00:19:31 +00:00
Guenter Knauf
e8a8becc0f NetWare build overhaul in order to compile on Linux.
Removed absolute paths to imp files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1079487 13f79535-47bb-0310-9956-ffa450edef68
2011-03-08 18:59:02 +00:00
Guenter Knauf
46b7e1d210 NetWare build overhaul in order to compile on Linux.
Take 1.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1079407 13f79535-47bb-0310-9956-ffa450edef68
2011-03-08 16:04:40 +00:00
Stefan Fritsch
2e8f78ee92 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070061 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 12:16:18 +00:00
Daniel Earl Poirier
4485859b81 Remove mis-placed period.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1029935 13f79535-47bb-0310-9956-ffa450edef68
2010-11-02 01:15:19 +00:00
Daniel Earl Poirier
4c477008d4 Add to modules' help text (displayed by ./configure -h) more
information that will be useful in deciding whether to enable
them or not.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1029814 13f79535-47bb-0310-9956-ffa450edef68
2010-11-01 20:02:51 +00:00
Stefan Fritsch
a1662e0f41 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026746 13f79535-47bb-0310-9956-ffa450edef68
2010-10-24 08:32:10 +00:00
Stefan Fritsch
25ef3c1325 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026743 13f79535-47bb-0310-9956-ffa450edef68
2010-10-24 08:17:26 +00:00
Rainer Jung
6e66831b4a Fix broken "creationdate" property in mod_dav_fs and
remove remaining uses of sprintf() in the dav modules.

This is a regression in 2.3.7 introduced by r931434.
It calls sizeof() for a function parameter, which only returns the
pointer size, not the size of the char array. Thus the
"creationdate" property got truncated to three characters.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987484 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 12:55:42 +00:00
Stefan Fritsch
aa576071af - 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982016 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:45:21 +00:00
Paul Querna
ad53d4dcbd CVE-2010-1452: Fix handling of missing path segments in the parsed URI structure.
If a specially crafted request was sent, it is possible to crash mod_dav, 
mod_cache or mod_session, as they accessed a field that is set to NULL
by the URI parser, assuming that it always put in a valid string.

PR: 49246
Submitted by: Mark Drayton
Patch by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@966348 13f79535-47bb-0310-9956-ffa450edef68
2010-07-21 18:25:01 +00:00
Stefan Fritsch
ed451e94d1 re-order many struct members for better alignment on 64bit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959464 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 22:34:05 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Guenter Knauf
03a066c10a more NetWare makefile cleanups.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@885781 13f79535-47bb-0310-9956-ffa450edef68
2009-12-01 15:00:11 +00:00