Skip to content

Commit 7cb4bb7

Browse files
committed
*) 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
1 parent 41799fe commit 7cb4bb7

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

modules/dav/main/mod_dav.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,8 @@ static int dav_method_put(request_rec *r)
965965
return dav_handle_err(r, err, NULL);
966966

967967
/* If not a file or collection resource, PUT not allowed */
968-
if (resource->type != DAV_RESOURCE_TYPE_REGULAR) {
968+
if (resource->type != DAV_RESOURCE_TYPE_REGULAR
969+
&& resource->type != DAV_RESOURCE_TYPE_WORKING) {
969970
body = apr_psprintf(r->pool,
970971
"Cannot create resource %s with PUT.",
971972
ap_escape_html(r->pool, r->uri));

modules/dav/main/util.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,9 @@ static dav_error * dav_validate_resource_state(apr_pool_t *p,
11491149
** We may have aborted the scan before seeing the locktoken.
11501150
** Rescan the If: header to see if we can find the locktoken
11511151
** somewhere.
1152+
**
1153+
** Note that seen_locktoken == 0 implies lock_list != NULL
1154+
** which implies locks_hooks != NULL.
11521155
*/
11531156
if (dav_find_submitted_locktoken(if_header, lock_list,
11541157
locks_hooks)) {
@@ -1364,11 +1367,6 @@ dav_error * dav_validate_request(request_rec *r, dav_resource *resource,
13641367
}
13651368
lock_db_opened_locally = 1;
13661369
}
1367-
else {
1368-
return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
1369-
"Resource validation failed because no "
1370-
"lock hooks were found.");
1371-
}
13721370
}
13731371

13741372
/* (1) Validate the specified resource, at the specified depth */

modules/dav/main/util_lock.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,10 +523,9 @@ int dav_unlock(request_rec *r, const dav_resource *resource,
523523
const dav_hooks_repository *repos_hooks = resource->hooks;
524524
dav_error *err;
525525

526-
/* If no locks provider, we shouldn't have been called */
526+
/* If no locks provider, then there is nothing to unlock. */
527527
if (hooks == NULL) {
528-
/* ### map result to something nice; log an error */
529-
return HTTP_INTERNAL_SERVER_ERROR;
528+
return OK;
530529
}
531530

532531
/* 2518 requires the entire lock to be removed if resource/locktoken

0 commit comments

Comments
 (0)