25#define APR_WANT_STRFUNC
44 err->error_id = error_id;
54 const char *
namespace,
59 err->tagname = tagname;
60 err->namespace =
namespace;
67 int error_id,
const char *desc,
73 err->error_id = error_id;
204 result.err.desc =
"Invalid syntax in Destination URI.";
211 result.err.desc =
"Destination URI must be an absolute URI.";
219 "Destination URI contains invalid components "
220 "(a query or a fragment).";
254 "Destination URI refers to "
255 "different scheme or port "
257 "(want: %s://hostname:%d)",
288#ifdef APACHE_PORT_HANDLING_IS_BUSTED
292 result.err.desc =
"Destination URI refers to a different server.";
320 int ns,
const char *tagname)
336 int ns,
const char *tagname)
340 for (; child; child = child->
next)
348 int ns,
const char *tagname)
352 for (; child; child = child->
next)
403 for (child =
elem->first_child; child !=
NULL; child = child->
next) {
434 for (child =
elem->first_child; child !=
NULL; child = child->
next) {
523 (
const char *)
uri,
"\"",
NULL);
568 return now + expires;
609 new_sl->condition = condition;
649 while (*token && (*token ==
' ' || *token ==
'\t'))
697 "Invalid If-header: unclosed \"<\" or "
698 "unexpected tagged-list production.");
704 || !parsed_uri.
path) {
707 "Invalid URI in tagged If-header.");
717 "Invalid URI path tagged If-header.");
724 "Invalid percent encoded URI in "
725 "tagged If-header.");
728 uri_len = strlen(parsed_uri.
path);
729 if (uri_len > 1 && parsed_uri.
path[uri_len - 1] ==
'/') {
730 parsed_uri.
path[--uri_len] =
'\0';
747 "Invalid If-header: unclosed \"(\".");
754 "Internal server error parsing \"If:\" "
795 if (
list[1] ==
'o' &&
list[2] ==
't') {
799 "Invalid \"If:\" header: "
800 "Multiple \"not\" entries "
801 "for the same state.");
809 "Invalid \"If:\" header: "
810 "Unexpected character in List");
823 "header: Unexpected "
824 "character encountered "
841 "Invalid \"If:\" header: "
842 "Unexpected character "
843 "encountered (0x%02x, '%c').",
858 for (; if_header !=
NULL; if_header = if_header->
next) {
954 if (lockdb ==
NULL) {
969 "The locks could not be queried for "
970 "verification against a possible \"If:\" "
986 "Existing lock(s) on the requested resource "
987 "prevent an exclusive lock.");
1004 "The requested resource is already "
1005 "locked exclusively.");
1041 if (if_header ==
NULL) {
1046 "This resource is locked and an \"If:\" header "
1047 "was not supplied to allow access to the "
1070 "The locktoken specified in the \"Lock-Token:\" "
1071 "header is invalid because this resource has no "
1072 "outstanding locks.");
1088 uri_len = strlen(
uri);
1089 if (
uri[uri_len - 1] ==
'/') {
1092 pbuf->buf[--uri_len] =
'\0';
1155 if (etag[0] ==
'W' &&
1172 "an entity-tag was specified, but the resource's "
1173 "actual ETag does not match.";
1184 "an entity-tag was specified using the \"Not\" form, "
1185 "but the resource's actual ETag matches the provided "
1193 if (lockdb ==
NULL) {
1210 "a State-token was supplied, but a lock database "
1211 "is not available for to provide the required lock.";
1253 "a State-token was supplied, which used a "
1254 "\"Not\" condition. The State-token was found "
1255 "in the locks on this resource";
1265 if (
lock->auth_user &&
1272 "\" submitted a locktoken created "
1298 "a State-token was supplied, but it was not found "
1299 "in the locks on this resource.";
1312 "an unknown state token was supplied";
1396 "This resource is locked and the \"If:\" "
1397 "header did not specify one of the "
1398 "locktokens for this resource's lock(s).");
1410 "The locktoken specified in the "
1411 "\"Lock-Token:\" header did not specify one "
1412 "of this resource's locktoken(s).");
1417 "The preconditions specified by the \"If:\" "
1418 "header did not match this resource.");
1423 "The precondition(s) specified by "
1424 "the \"If:\" header did not match "
1425 "this resource. At least one "
1426 "failure is because: %s",
reason));
1467 "The locktoken specified in the "
1468 "\"Lock-Token:\" header did not specify one "
1469 "of this resource's locktoken(s).");
1473 "This resource is locked and the \"If:\" header "
1474 "did not specify one of the "
1475 "locktokens for this resource's lock(s).");
1486 ctx->if_header,
ctx->flags,
1576 if (depth && response ==
NULL) {
1582 "DESIGN ERROR: dav_validate_request called "
1583 "with depth>0, but no response ptr.");
1587 if (response !=
NULL)
1594 if (etag && *etag) {
1627 if (locktoken !=
NULL) {
1638 ifhdr_new->state->locktoken = locktoken;
1649 if (lockdb ==
NULL) {
1672 ctx.if_header = if_header;
1676 if (lockdb !=
NULL) {
1677 ctx.w.lockdb = lockdb;
1689 if_header,
flags, &work_buf,
r);
1700 "Cannot access parent of repository root.");
1720 "A validation error has occurred on the parent resource, "
1721 "preventing the operation on the resource specified by "
1756 "An error occurred on another resource, "
1757 "preventing the requested operation on "
1772 "<D:prop><D:lockdiscovery/></D:prop>" DEBUG_CR
1773 "<D:status>HTTP/1.1 424 Failed Dependency</D:status>" DEBUG_CR
1783 "An error occurred on another resource, preventing the "
1784 "requested operation on this resource.";
1791 "Error(s) occurred on resources during the "
1792 "validation process.");
1818 while (if_header !=
NULL) {
1830 if_header = if_header->
next;
1835 "No locktokens were specified in the \"If:\" "
1836 "header, so the refresh could not be performed.");
1853 idx = strlen(
s) - 1;
1867#define DAV_LABEL_HDR "Label"
1885 if (vsn_hooks !=
NULL) {
1889 if (target !=
NULL) {
1928 if (*lockdb ==
NULL) {
1933 "Auto-checkout is only enabled for locked resources, "
1934 "but there is no lock provider.");
1939 "Cannot open lock database to determine "
1940 "auto-versioning behavior.",
1948 "The locks could not be queried for "
1949 "determining auto-versioning behavior.",
1975 if (vsn_hooks ==
NULL)
1989 "Missing one or more intermediate "
1990 "collections. Cannot create resource %s.",
2010 "<DAV:cannot-modify-checked-in-parent>");
2024 "Unable to auto-checkout parent collection. "
2025 "Cannot create resource %s.",
2032 av_info->parent_checkedout = 1;
2047 "Unable to create versioned resource %s.",
2054 av_info->resource_versioned = 1;
2069 "<DAV:cannot-modify-version-controlled-content>");
2081 "Unable to checkout resource %s.",
2088 av_info->resource_checkedout = 1;
2119 if (vsn_hooks ==
NULL)
2125 if (
av_info->resource_checkedout) {
2129 "Unable to undo auto-checkout "
2136 if (
av_info->resource_versioned) {
2141 &response)) !=
NULL) {
2144 "Unable to undo auto-version-control "
2156 "Unable to undo auto-checkout "
2157 "of parent collection %s.",
2182 "Unable to auto-checkin resource %s.",
2195 &&
av_info->parent_resource->working) {
2205 "Unable to auto-checkin parent collection %s.",
const char apr_size_t len
APR general purpose library routines.
APR Standard Headers Support.
#define ap_http_scheme(r)
int ap_meets_conditions(request_rec *r)
request_rec * ap_sub_req_method_uri(const char *method, const char *new_uri, const request_rec *r, ap_filter_t *next_filter)
const char apr_port_t port
apr_brigade_flush void * ctx
const char apr_ssize_t int flags
#define APR_URI_UNP_OMITSITEPART
const apr_xml_elem int apr_array_header_t int const char ** pbuf
#define APR_XML_NS_DAV_ID
#define HTTP_MULTI_STATUS
#define HTTP_PRECONDITION_FAILED
#define HTTP_INTERNAL_SERVER_ERROR
#define HTTP_FAILED_DEPENDENCY
#define ap_is_HTTP_SERVER_ERROR(x)
#define DAV_GET_HOOKS_LOCKS(r)
dav_error * dav_new_error_tag(apr_pool_t *p, int status, int error_id, apr_status_t aprerr, const char *desc, const char *namespace, const char *tagname)
void dav_buffer_init(apr_pool_t *p, dav_buffer *pbuf, const char *str)
#define DAV_ERR_IF_UNCLOSED_PAREN
dav_lookup_result dav_lookup_uri(const char *uri, request_rec *r, int must_be_absolute)
#define DAV_ERR_IF_TAGGED
void dav_buffer_append(apr_pool_t *p, dav_buffer *pbuf, const char *str)
#define DAV_VALIDATE_NO_MODIFY
apr_xml_attr * dav_find_attr(const apr_xml_elem *elem, const char *attrname)
void dav_buffer_place_mem(apr_pool_t *p, dav_buffer *pbuf, const void *mem, apr_size_t amt, apr_size_t pad)
const char * dav_xmlns_get_prefix(dav_xmlns_info *xi, const char *uri)
const char * dav_xmlns_get_uri(dav_xmlns_info *xi, const char *prefix)
#define DAV_ERR_IF_MULTIPLE_NOT
dav_error * dav_auto_checkin(request_rec *r, dav_resource *resource, int undo, int unlock, dav_auto_version_info *av_info)
void dav_add_vary_header(request_rec *in_req, request_rec *out_req, const dav_resource *resource)
dav_error * dav_lock_query(dav_lockdb *lockdb, const dav_resource *resource, dav_lock **locks)
int dav_validate_root_ns(const apr_xml_doc *doc, int ns, const char *tagname)
dav_xmlns_info * dav_xmlns_create(apr_pool_t *pool)
void dav_xmlns_generate(dav_xmlns_info *xi, apr_text_header *phdr)
void dav_check_bufsize(apr_pool_t *p, dav_buffer *pbuf, apr_size_t extra_needed)
void dav_xmlns_add(dav_xmlns_info *xi, const char *prefix, const char *uri)
time_t dav_get_timeout(request_rec *r)
int dav_validate_root(const apr_xml_doc *doc, const char *tagname)
int dav_get_resource_state(request_rec *r, const dav_resource *resource)
#define DAV_VALIDATE_ADD_LD
dav_error * dav_join_error(dav_error *dest, dav_error *src)
dav_error * dav_get_locktoken_list(request_rec *r, dav_locktoken_list **ltl)
#define DAV_ERR_IF_UNK_CHAR
dav_error * dav_auto_checkout(request_rec *r, dav_resource *resource, int parent_only, dav_auto_version_info *av_info)
#define DAV_VALIDATE_USE_424
const char * dav_xml_get_cdata(const apr_xml_elem *elem, apr_pool_t *pool, int strip_white)
apr_xml_elem * dav_find_child(const apr_xml_elem *elem, const char *tagname)
dav_error * dav_push_error(apr_pool_t *p, int status, int error_id, const char *desc, dav_error *prev)
#define DAV_ERR_LOCK_UNK_STATE_TOKEN
#define DAV_VALIDATE_PARENT
#define DAV_DECLARE(type)
apr_xml_elem * dav_find_child_ns(const apr_xml_elem *elem, int ns, const char *tagname)
#define DAV_TIMEOUT_INFINITE
#define DAV_GET_HOOKS_VSN(r)
#define DAV_VALIDATE_IS_PARENT
void dav_set_bufsize(apr_pool_t *p, dav_buffer *pbuf, apr_size_t size)
apr_xml_attr * dav_find_attr_ns(const apr_xml_elem *elem, int ns, const char *attrname)
#define DAV_ERR_IF_ABSENT
void dav_buffer_place(apr_pool_t *p, dav_buffer *pbuf, const char *str)
const char * dav_xmlns_add_uri(dav_xmlns_info *xi, const char *uri)
#define DAV_BUFFER_MINSIZE
dav_error * dav_new_error(apr_pool_t *p, int status, int error_id, apr_status_t aprerr, const char *desc)
apr_xml_elem * dav_find_next_ns(const apr_xml_elem *elem, int ns, const char *tagname)
dav_error * dav_validate_request(request_rec *r, dav_resource *resource, int depth, dav_locktoken *locktoken, dav_response **response, int flags, dav_lockdb *lockdb)
#define DAV_RESOURCE_EXISTS
void dav_add_response(dav_walk_resource *wres, int status, dav_get_props_result *propstats)
@ DAV_AUTO_VERSION_LOCKED
@ DAV_AUTO_VERSION_ALWAYS
@ DAV_LOCKSCOPE_EXCLUSIVE
#define AP_NORMALIZE_DECODE_UNRESERVED
char * ap_getword_white(apr_pool_t *p, const char **line)
int ap_cstr_casecmp(const char *s1, const char *s2)
int ap_normalize_path(char *path, unsigned int flags)
#define ap_escape_html(p, s)
int ap_unescape_url(char *url)
#define AP_NORMALIZE_NOT_ABOVE_ROOT
const char int apr_pool_t * pool
const apr_array_header_t * list
apr_array_header_t ** result
#define APR_HASH_KEY_STRING
#define apr_pcalloc(p, size)
void apr_skiplistnode apr_skiplist_compare comp
apr_int32_t apr_int32_t apr_int32_t err
const char const char *const const char *const apr_procattr_t * attr
DAV extension module for Apache 2.0.*.
#define DAV_IF_COND_NORMAL
#define DAV_WALKTYPE_LOCKNULL
#define DAV_WALKTYPE_NORMAL
static dav_error * dav_validate_walker(dav_walk_resource *wres, int calltype)
static int dav_meets_conditions(request_rec *r, int resource_state)
static int dav_find_submitted_locktoken(const dav_if_header *if_header, const dav_lock *lock_list, const dav_hooks_locks *locks_hooks)
static dav_error * dav_add_if_state(apr_pool_t *p, dav_if_header *ih, const char *state_token, dav_if_state_type t, int condition, const dav_hooks_locks *locks_hooks)
static char * dav_fetch_next_token(char **str, char term)
static dav_error * dav_can_auto_checkout(request_rec *r, dav_resource *resource, dav_auto_version auto_version, dav_lockdb **lockdb, int *auto_checkout)
static dav_error * dav_validate_resource_state(apr_pool_t *p, const dav_resource *resource, dav_lockdb *lockdb, const dav_if_header *if_header, int flags, dav_buffer *pbuf, request_rec *r)
static dav_if_header * dav_add_if_resource(apr_pool_t *p, dav_if_header *next_ih, const char *uri, apr_size_t uri_len)
static dav_error * dav_process_if_header(request_rec *r, dav_if_header **p_ih)
struct apr_xml_elem * next
apr_text_header following_cdata
apr_sockaddr_t * local_addr
void(* close_lockdb)(dav_lockdb *lockdb)
int(* is_same_resource)(const dav_resource *res1, const dav_resource *res2)
dav_error *(* vsn_control)(dav_resource *resource, const char *target)
dav_auto_version(* auto_versionable)(const dav_resource *resource)
dav_error *(* checkin)(dav_resource *resource, int keep_checked_out, dav_resource **version_resource)
dav_error *(* uncheckout)(dav_resource *resource)
dav_error *(* checkout)(dav_resource *resource, int auto_checkout, int is_unreserved, int is_fork_ok, int create_activity, apr_array_header_t *activities, dav_resource **working_resource)
const dav_hooks_locks * hooks
const dav_hooks_repository * hooks
const dav_resource * resource
A structure that represents the current request.
apr_table_t * headers_out
int ap_matches_request_vhost(request_rec *r, const char *host, apr_port_t port)