Commit 7cb4bb71 authored by Greg Stein's avatar Greg Stein
Browse files

*) 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
parent 41799fe3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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));
+3 −5
Original line number Diff line number Diff line
@@ -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 */
+2 −3
Original line number Diff line number Diff line
@@ -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