Bug 29034 - MKCOL returns FORBIDDEN instead of CONFLICT when parent collection does not exist
Summary: MKCOL returns FORBIDDEN instead of CONFLICT when parent collection does not e...
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_dav (show other bugs)
Version: 2.0-HEAD
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-17 11:52 UTC by Thierry Beigbeder
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry Beigbeder 2004-05-17 11:52:09 UTC
The WebDAV MKCOL method returns FORBIDDEN instead of CONFLICT when the parent 
collection or one of its ancestors does not exist.

The issue appears quickly when using the Eclipse IDE release 2.1 with the 
FTP/DAV extensions: when uploading a new project with folders/sub-folders on 
the target WebDAV site, the Eclipse DAV client checks for CONFLICT status in 
order to create parent collections. Here it gets a FORBIDDEN error which is 
simply displayed.

I have tested the following workaround with success, but it is probably not 
clean, as I just begin to discover Apache's design. In the file mod_dav.c, 
function dav_method_mkcol, I have inserted the following lines after success of 
dav_auto_checkout:
/* check state for parent */
err = (*resource->hooks->get_parent_resource)(resource,&parent_resource);
if(err == NULL && parent_resource != NULL && !parent_resource->exists) {
    return dav_error_response(r, HTTP_CONFLICT,
        "Cannot create a collection until one or more intermediate collections 
have been created.");
}

With this workaround everything seems to work well and quickly between Eclipse 
and Apache.
Comment 1 Joe Orton 2004-05-17 13:43:01 UTC
This was fixed on HEAD recently:

http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/dav/fs/repos.c?r1=1.80&r2=1.81

I'll propose it for backport to 2.0 if it causes real interop issues.  Thanks a
lot for the report.