Bug 49428 - Fix WebDAV mounts from Windows Mini-Redirector clients
Summary: Fix WebDAV mounts from Windows Mini-Redirector clients
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.29
Hardware: PC All
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 07:34 UTC by Panagiotis Astithas
Modified: 2010-10-14 11:07 UTC (History)
1 user (show)



Attachments
The patch for WebdavServlet (20.03 KB, patch)
2010-06-11 07:34 UTC, Panagiotis Astithas
Details | Diff
The patch for WebdavServlet (25.84 KB, patch)
2010-07-15 11:29 UTC, Panagiotis Astithas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Panagiotis Astithas 2010-06-11 07:34:22 UTC
Created attachment 25584 [details]
The patch for WebdavServlet

The WebdavServlet does not work with native Windows clients besides the deprecated Web Folders. The more modern, common and supported by Microsoft client, Windows Mini-Redirector that allows mapping of WebDAV shares to local drives cannot mount a WebDAV share served by tomcat's WebdavServlet.

You can observe this by using the following command from a windows machine:

> net use * http://hostname:8080/webdav

It should fail without the attached patch. The reason is that:

DAV: namespaced elements in a PROPFIND responses can not use a default namespace; each element must be explicitly prefixed with a namespace prefix defined in itself or a parent. If a default namespace is used the client will give no errors, but will not display any resources.

This is mentioned here, albeit for a single Windows version, Windows Server 2003:

http://www.greenbytes.de/tech/webdav/webdav-redirector-list.html

I have verified that the patch fixes WebDAV mounts for Windows XP, Vista & 7.
Comment 1 Panagiotis Astithas 2010-06-11 08:11:23 UTC
I should mention that the patch is against trunk revision 953660 and that I have also tested that it works fine for OS X and Linux clients.
Comment 2 Mark Thomas 2010-07-04 18:08:41 UTC
Please run the litmus test suite with your patch. Whilst the current implementation has some failures (and patches for those would be welcome too) the current patch for this issue causes additional failures.

I have taken a quick look at what is going on with tcpmon from the Apache Axis project and it looks like xmlns:D="DAV:" is being added in some circumstances without D: then being added to some (all?) elements.

I'd be happy to apply this patch once it does not add to the number of litmus failures.
Comment 3 Panagiotis Astithas 2010-07-05 11:13:54 UTC
(In reply to comment #2)
> Please run the litmus test suite with your patch. Whilst the current
> implementation has some failures (and patches for those would be welcome too)
> the current patch for this issue causes additional failures.
> 
> I have taken a quick look at what is going on with tcpmon from the Apache Axis
> project and it looks like xmlns:D="DAV:" is being added in some circumstances
> without D: then being added to some (all?) elements.
> 
> I'd be happy to apply this patch once it does not add to the number of litmus
> failures.

I did run the litmus tests before submitting the patch and AFAIR there were no regressions. Do you have a list of the tests that fail with the patch?
Comment 4 Mark Thomas 2010-07-05 12:27:53 UTC
The additional failures were in the lock tests. Test 6 failed first and that triggered multiple additional failures.
Comment 5 Panagiotis Astithas 2010-07-15 11:29:16 UTC
Created attachment 25764 [details]
The patch for WebdavServlet

This new patch fixes the regressions in the litmus lock tests. Now the litmus tests score the same with and without the patch (but of course Windows Mini-Redirector clients only work with the latter).
Comment 6 Mark Thomas 2010-07-16 08:01:18 UTC
Patch applied to 7.0.x and will be in 7.0.1

Many thanks.

Note: I'll need to update the WebDAVFixFilter to take account of this.
Comment 7 nogunha 2010-09-30 16:26:26 UTC
Hi All - 

For each element we are putting D: prefix. But still we have the issue in Windows7, Linux and Mac. It works fine in XP.  Below is the XMl response content generated by XMLWriter.
We have our own webdav servlet which extends webdavserlet
org.apache.catalina.servlets.WebdavServlet;
public class FolderServlet extends WebdavServlet {

@@@@@@@@@@@@@@@@@@@@@@ 

<?xml version="1.0" encoding="utf-8" ?> 
- <D:multistatus xmlns:D="DAV:" xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/">
- <D:response>
  <D:href>SimpleFolder</D:href> 
- <D:propstat>
- <D:prop>
+ <D:creationdate b:dt="dateTime.tz">
- <![CDATA[ 2010-09-30T15:36:21Z
  ]]> 
  </D:creationdate>
- <D:getlastmodified b:dt="dateTime.rfc1123">
- <![CDATA[ Thu, 30 Sep 2010 19:36:21 GMT
  ]]> 
  </D:getlastmodified>
  <D:displayname>SimpleFolder</D:displayname> 
- <D:resourcetype>
  <D:collection /> 
  </D:resourcetype>
  <D:source /> 
- <D:supportedlock>
- <D:lockentry>
- <D:lockscope>
  <D:exclusive /> 
  </D:lockscope>
- <D:locktype>
  <D:write /> 
  </D:locktype>
  </D:lockentry>
- <D:lockentry>
- <D:lockscope>
  <D:shared /> 
  </D:lockscope>
- <D:locktype>
  <D:write /> 
  </D:locktype>
  </D:lockentry>
  </D:supportedlock>
  </D:prop>
  <D:status>HTTP/1.1 200 OK</D:status> 
  </D:propstat>
- <D:propstat>
- <D:prop>
  <D:name /> 
  <D:parentname /> 
  <D:ishidden /> 
  <D:isreadonly /> 
  <D:getcontenttype /> 
  <D:contentclass /> 
  <D:getcontentlanguage /> 
  <D:lastaccessed /> 
  <D:getcontentlength /> 
  <D:iscollection /> 
  <D:isstructureddocument /> 
  <D:defaultdocument /> 
  <D:isroot /> 
  </D:prop>
  <D:status>HTTP/1.1 404 Not Found</D:status> 
  </D:propstat>
  </D:response>
  </D:multistatus>
Comment 8 nogunha 2010-09-30 16:29:03 UTC
What happens is we are able to map the drive in windows explorer in windows7 but it creates three mappings and when you click on each mapping it does not open the sub folders on the right side of the windows explorer so you can't edit them. It works fine in XP but not in Windows7, Mac and linux. 

(In reply to comment #7)
> Hi All - 
> For each element we are putting D: prefix. But still we have the issue in
> Windows7, Linux and Mac. It works fine in XP.  Below is the XMl response
> content generated by XMLWriter.
> We have our own webdav servlet which extends webdavserlet
> org.apache.catalina.servlets.WebdavServlet;
> public class FolderServlet extends WebdavServlet {
> @@@@@@@@@@@@@@@@@@@@@@ 
> <?xml version="1.0" encoding="utf-8" ?> 
> - <D:multistatus xmlns:D="DAV:"
> xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/">
> - <D:response>
>   <D:href>SimpleFolder</D:href> 
> - <D:propstat>
> - <D:prop>
> + <D:creationdate b:dt="dateTime.tz">
> - <![CDATA[ 2010-09-30T15:36:21Z
>   ]]> 
>   </D:creationdate>
> - <D:getlastmodified b:dt="dateTime.rfc1123">
> - <![CDATA[ Thu, 30 Sep 2010 19:36:21 GMT
>   ]]> 
>   </D:getlastmodified>
>   <D:displayname>SimpleFolder</D:displayname> 
> - <D:resourcetype>
>   <D:collection /> 
>   </D:resourcetype>
>   <D:source /> 
> - <D:supportedlock>
> - <D:lockentry>
> - <D:lockscope>
>   <D:exclusive /> 
>   </D:lockscope>
> - <D:locktype>
>   <D:write /> 
>   </D:locktype>
>   </D:lockentry>
> - <D:lockentry>
> - <D:lockscope>
>   <D:shared /> 
>   </D:lockscope>
> - <D:locktype>
>   <D:write /> 
>   </D:locktype>
>   </D:lockentry>
>   </D:supportedlock>
>   </D:prop>
>   <D:status>HTTP/1.1 200 OK</D:status> 
>   </D:propstat>
> - <D:propstat>
> - <D:prop>
>   <D:name /> 
>   <D:parentname /> 
>   <D:ishidden /> 
>   <D:isreadonly /> 
>   <D:getcontenttype /> 
>   <D:contentclass /> 
>   <D:getcontentlanguage /> 
>   <D:lastaccessed /> 
>   <D:getcontentlength /> 
>   <D:iscollection /> 
>   <D:isstructureddocument /> 
>   <D:defaultdocument /> 
>   <D:isroot /> 
>   </D:prop>
>   <D:status>HTTP/1.1 404 Not Found</D:status> 
>   </D:propstat>
>   </D:response>
>   </D:multistatus>
Comment 9 Mark Thomas 2010-09-30 17:53:02 UTC
There are lots of things that can go wrong with WebDAV. The users list is the place to get help.

Meanwhile, I've propose this fix for 6.0.x
Comment 10 Mark Thomas 2010-10-13 10:23:56 UTC
Patch has been withdrawn for 6.0.x and reverted for 7.0.x

See http://tomcat.markmail.org/thread/u5i5blwrsxf2h3zv for reasoning.
Comment 11 Konstantin Kolinko 2010-10-13 11:37:54 UTC
I reimplemented the fix in trunk in r1022120 and it will be in 7.0.4.
Proposed it for 6.0.x.
Comment 12 Mark Thomas 2010-10-14 11:07:35 UTC
Alternative patch applied to 6.0.x and will be in 6.0.30 onwards.