From: Greg Stein Date: Tue, 13 Mar 2001 02:13:55 +0000 (+0000) Subject: *) mod_dav.c: allow PUT to a WORKING resource (this actually the only valid X-Git-Tag: 2.0.15~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96aaa9b62a055e11435af4de887e85c7acadfacc;p=thirdparty%2Fapache%2Fhttpd.git *) 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88508 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index e5e09fd7201..9a80b1577a9 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -965,7 +965,8 @@ static int dav_method_put(request_rec *r) return dav_handle_err(r, err, NULL); /* If not a file or collection resource, PUT not allowed */ - if (resource->type != DAV_RESOURCE_TYPE_REGULAR) { + if (resource->type != DAV_RESOURCE_TYPE_REGULAR + && resource->type != DAV_RESOURCE_TYPE_WORKING) { body = apr_psprintf(r->pool, "Cannot create resource %s with PUT.", ap_escape_html(r->pool, r->uri)); diff --git a/modules/dav/main/util.c b/modules/dav/main/util.c index e2229d30d47..09df3b429eb 100644 --- a/modules/dav/main/util.c +++ b/modules/dav/main/util.c @@ -1149,6 +1149,9 @@ static dav_error * dav_validate_resource_state(apr_pool_t *p, ** We may have aborted the scan before seeing the locktoken. ** Rescan the If: header to see if we can find the locktoken ** somewhere. + ** + ** Note that seen_locktoken == 0 implies lock_list != NULL + ** which implies locks_hooks != NULL. */ if (dav_find_submitted_locktoken(if_header, lock_list, locks_hooks)) { @@ -1364,11 +1367,6 @@ dav_error * dav_validate_request(request_rec *r, dav_resource *resource, } lock_db_opened_locally = 1; } - else { - return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0, - "Resource validation failed because no " - "lock hooks were found."); - } } /* (1) Validate the specified resource, at the specified depth */ diff --git a/modules/dav/main/util_lock.c b/modules/dav/main/util_lock.c index 2a292666a69..46daff601ed 100644 --- a/modules/dav/main/util_lock.c +++ b/modules/dav/main/util_lock.c @@ -523,10 +523,9 @@ int dav_unlock(request_rec *r, const dav_resource *resource, const dav_hooks_repository *repos_hooks = resource->hooks; dav_error *err; - /* If no locks provider, we shouldn't have been called */ + /* If no locks provider, then there is nothing to unlock. */ if (hooks == NULL) { - /* ### map result to something nice; log an error */ - return HTTP_INTERNAL_SERVER_ERROR; + return OK; } /* 2518 requires the entire lock to be removed if resource/locktoken