summaryrefslogtreecommitdiff
path: root/modules/dav/main/util.c
Commit message (Collapse)AuthorAgeFilesLines
* Add MS-WDV supportmanu2023-02-131-1/+19
| | | | | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907608 13f79535-47bb-0310-9956-ffa450edef68
* * modules/dav/main/util.c (dav_process_if_header): Fix errorJoe Orton2023-01-091-1/+7
| | | | | | | path for "Not" prefix parsing. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1906487 13f79535-47bb-0310-9956-ffa450edef68
* mod_dav: Add utility functions dav_validate_root_ns(),Graham Leggett2020-07-151-7/+52
| | | | | | | | dav_find_child_ns(), dav_find_next_ns(), dav_find_attr_ns() and dav_find_attr() so that other modules get to play too. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879888 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1879074: don't let dav_process_if_header() go above root.Yann Ylavic2020-06-241-0/+1
| | | | | | | And fall through as "/". git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879149 13f79535-47bb-0310-9956-ffa450edef68
* Add ap_normalize_path() to replace ap_getparents() (with options).Yann Ylavic2020-06-221-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/httpd.h: Declare ap_normalize_path() and flags. AP_NORMALIZE_ALLOW_RELATIVE: Don't require that the path be absolute as per RFC 7230. This is needed for lookup subrequests. AP_NORMALIZE_NOT_ABOVE_ROOT: Check that directory traversal ("..") don't go above root, or initial directory with relative paths. AP_NORMALIZE_DECODE_UNRESERVED: Decode unreserved characters (like '.') first since they have the same semantics encoded and decoded. AP_NORMALIZE_MERGE_SLASHES: Merge multiple slahes into a single one. AP_NORMALIZE_DROP_PARAMETERS: Ignore path parameters (";foo=bar"). Not used by httpd but since ap_normalize_path() is taken from mod_jk's jk_servlet_normalize() it can allow them to use the upstream version now. server/util.c: Implement ap_normalize_path(). modules/dav/main/util.c: Replace call to ap_getparents() using ap_normalize_path() with AP_NORMALIZE_DECODE_UNRESERVED flag since the path comes from an obsolute URL (thus potentially %-encoded). modules/generators/mod_autoindex.c: Replace call to ap_getparents() using ap_normalize_path() with AP_NORMALIZE_ALLOW_RELATIVE and AP_NORMALIZE_NOT_ABOVE_ROOT flags to be consistent with original code. include/ap_mmn.h: MINOR bump for ap_normalize_path(). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879074 13f79535-47bb-0310-9956-ffa450edef68
* * module/dav/main/util.c (dav_check_bufsize): Don't callJoe Orton2020-02-171-1/+5
| | | | | | | | memcpy(,NULL,0) if the buffer is uninitialized, to avoid tripping UBSan. (Unclear if this is valid for this API.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874144 13f79535-47bb-0310-9956-ffa450edef68
* * Replace apr_psprintf with apr_pstrcat where the format strings onlyRuediger Pluem2019-06-281-2/+2
| | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1862270 13f79535-47bb-0310-9956-ffa450edef68
* Fix spelling in comments and text files.Rainer Jung2016-08-111-2/+2
| | | | | | | | No functional change. PR 59990 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
* Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygenWilliam A. Rowe Jr2016-06-091-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
* More ap_casecmpstr[n]() usages (follow up to r1715876).Yann Ylavic2015-11-231-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715880 13f79535-47bb-0310-9956-ffa450edef68
* In order to save a few cycles, delay a hash table lookup which is not ↵Christophe Jaillet2015-09-081-1/+2
| | | | | | necessary needed git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1701717 13f79535-47bb-0310-9956-ffa450edef68
* mod_dav: Avoid doing the walk on a COPY source for handling preconditions ifBen Reser2015-05-031-2/+4
| | | | | | | | | | | 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
* Typo in commentChristophe Jaillet2014-04-211-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588862 13f79535-47bb-0310-9956-ffa450edef68
* SECURITY: CVE-2013-6438 (cve.mitre.org)Ben Reser2014-01-081-1/+3
| | | | | | | | | | | | 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
* mod_dav: Fix PR 55306.Ben Reser2013-10-031-2/+5
| | | | | | | | | | | | | | | | | | | | | 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
* Fix indentation (plus now needed line-wrap).Rainer Jung2013-06-271-2/+3
| | | | | | | Followup to r1470940. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1497588 13f79535-47bb-0310-9956-ffa450edef68
* mod_dav: Make sure the URI length is calculated correctly.Graham Leggett2013-04-301-3/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1477530 13f79535-47bb-0310-9956-ffa450edef68
* mod_dav: Make sure that when we prepare an If URL for Etag comparison, Graham Leggett2013-04-231-0/+7
| | | | | | | | | 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
* mod_dav: Improve error handling in dav_method_put(), add newJeff Trawick2013-04-041-0/+24
| | | | | | | | | | | | 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
* [Test] First try : remove extra ';'Christophe Jaillet2012-10-111-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1397320 13f79535-47bb-0310-9956-ffa450edef68
* Cleanup effort in prep for GA push:Jim Jagielski2011-09-231-2/+2
| | | | | | | | Trim trailing whitespace... no func change git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
* CVE-2010-1452: Fix handling of missing path segments in the parsed URI ↵Paul Querna2010-07-211-1/+2
| | | | | | | | | | | | | | | 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
* Remove errno from dav_error interface. Calls to dav_new_error()Jeff Trawick2009-11-191-37/+38
| | | | | | | | | and dav_new_error_tag() must be adjusted to add an apr_status_t parameter. Reviewed by: jorton git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@882274 13f79535-47bb-0310-9956-ffa450edef68
* * Avoid SEGFAULT as hooks->set_headers can be NULL. Furthermore do not set theRuediger Pluem2008-01-011-8/+21
| | | | | | | | | ETag header permanently as setting it may not be desired for all responses. Submitted by: niq, rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607838 13f79535-47bb-0310-9956-ffa450edef68
* * Style police. No functional changes.Ruediger Pluem2007-12-291-5/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607472 13f79535-47bb-0310-9956-ffa450edef68
* mod_dav: Fix evaluation of If-Match * and If-None-Match * conditionals.Nick Kew2007-12-291-1/+41
| | | | | | | | | PR 38034 Patch by Paritosh Shah Explanation by Werner Baumann git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607466 13f79535-47bb-0310-9956-ffa450edef68
* update license header textRoy T. Fielding2006-07-111-6/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
* Update the copyright year in all .c, .h and .xml filesColm MacCarthaigh2006-04-191-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
* No functional Change: Removing trailing whitespace. This alsoJim Jagielski2005-11-101-35/+35
| | | | | | | | means that "blank" lines consisting of just spaces or tabs are now really blank lines git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
* Fix handling of unknown state tokens in If headers:Joe Orton2005-10-301-4/+16
| | | | | | | | | | | | | | | * modules/dav/main/mod_dav.h: Add dav_if_unknown to dav_if_state_type enum. * modules/dav/main/util.c (dav_add_if_state): Set returned type to dav_if_unknown for an unknown state token. (dav_validate_resource_state): Evaluate dav_if_unknown to fail match unless in a Not condition. PR: 37288 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@329562 13f79535-47bb-0310-9956-ffa450edef68
* * modules/dav/main/mod_dav.h: Wrap all public functions inJustin Erenkrantz2005-02-251-15/+22
| | | | | | | | | | | | | | 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 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@155345 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright year to 2005 and standardize on current copyright owner line.Justin Erenkrantz2005-02-041-1/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
* FINALLY Correct ap_http_method()! It is NOT a method, it's a SCHEME!William A. Rowe Jr2005-01-021-1/+1
| | | | | | | | | | Bumped mmn, and ap module cookie, for this function rename. It's not a deprecation, as ap_http_method would be a lovely function name sometime in the future: to determine what the function name implies. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123882 13f79535-47bb-0310-9956-ffa450edef68
* Forward-port from mod_dav 1.0:Joe Orton2004-03-141-1/+1
| | | | | | | | | * modules/dav/main/util.c (dav_validate_resource_state): Fix a 2617 violation: if the lock user validation fails, rather than giving a 401 without a WWW-Authenticate header, give a 403. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102958 13f79535-47bb-0310-9956-ffa450edef68
* fix name of The Apache Software FoundationAndré Malo2004-02-091-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102618 13f79535-47bb-0310-9956-ffa450edef68
* apply Apache License, version 2.0André Malo2004-02-061-49/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102523 13f79535-47bb-0310-9956-ffa450edef68
* update license to 2004.André Malo2004-01-011-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
* stop using apr_sockaddr_port_get() accessor function, as it willJeff Trawick2003-12-051-1/+1
| | | | | | | disappear from APR 1.0 API shortly git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101991 13f79535-47bb-0310-9956-ffa450edef68
* * modules/dav/main/util.c (dav_validate_resource_state): Simplify weakJoe Orton2003-11-251-11/+4
| | | | | | | etag comparison to avoid unnecessary tests and pstrdup calls. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101884 13f79535-47bb-0310-9956-ffa450edef68
* Fix a typo in the weak entity check. The prefix is W/" not "W/.Justin Erenkrantz2003-04-221-8/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99524 13f79535-47bb-0310-9956-ffa450edef68
* finished that boring job:André Malo2003-02-031-1/+1
| | | | | | | | | update license to 2003. Happy New Year! ;-)) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
* fix misuse of const in a recent commitJeff Trawick2003-01-311-6/+9
| | | | | | | | warnings with recent gcc compile break with native compiler for AIX git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98557 13f79535-47bb-0310-9956-ffa450edef68
* Allow mod_dav to do weak entity comparison function rather than a strongJustin Erenkrantz2003-01-291-1/+28
| | | | | | | | | entity comparison function. (i.e. it will optionally strip the W/ prefix.) PR: 14921 (kinda, but not really) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98536 13f79535-47bb-0310-9956-ffa450edef68
* Fix If header parsing when a non-mod_dav lock token is passed to it. We'llJustin Erenkrantz2003-01-291-2/+10
| | | | | | | | | now just skip over it rather than aborting. PR: 16452 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98524 13f79535-47bb-0310-9956-ffa450edef68
* When unlocking, the auto-checkin code does not need to refer to theGreg Stein2003-01-071-5/+5
| | | | | | | | | | parent resource. We want to (possibly) check in only the resource identified by the params. Bug found by David Waite <mass@akuma.org> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98187 13f79535-47bb-0310-9956-ffa450edef68
* Detabbify. With extreme prejudice.William A. Rowe Jr2002-10-291-715/+715
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97342 13f79535-47bb-0310-9956-ffa450edef68
* Continue the Bill Rowe apr_size_t crusade.Victor J. Orlikowski2002-07-101-4/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95993 13f79535-47bb-0310-9956-ffa450edef68
* Renames Pending:Ian Holsman2002-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This clears the list of renames pending in apr-util. Parts of this list was alreadu done, but the pending list hadn't been updated. apr_hook_debug_current from apr_current_hooking_module apr_hook_debug_show from apr_show_hook apr_hook_global_pool from apr_global_hook_pool apr_hook_sort_all from apr_sort_hooks apr_uri_port_of_scheme from apr_uri_default_port_for_scheme apr_uri_unparse from apr_uri_unparse_components apr_uri_parse from apr_uri_parse_components apr_uri_parse_hostinfo from apr_uri_parse_hostinfo_components apr_uri_t from apr_uri_components All APR_URI_* from all APU_URI_* symbols All APR_UNP_* from all UNP_* symbols PR: Obtained from: Submitted by: Thom May Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95966 13f79535-47bb-0310-9956-ffa450edef68
* The real pain. ap->apr xml and text types.William A. Rowe Jr2002-06-231-10/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95862 13f79535-47bb-0310-9956-ffa450edef68
* Update our copyright for this year.Roy T. Fielding2002-03-131-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68