maindavfs2 - Support: sr #108385, DAV subdirectories are not shown...

 
 

sr #108385: DAV subdirectories are not shown if their names contain Cyrillics and the like

Submitter:  Ivan Mikhailov <iv_an_ru>
Submitted:  Thu 05 Sep 2013 09:55:37 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  _71007
Open/Closed:  Closed Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 07 Sep 2013 06:44:51 PM UTC, comment #2: 

Correction:
The path in the href-element has to follow the rules for URIs. So non-ASCII-characters have to be percent encoded. Each byte of the utf-8-endoded character has to be replaced by "%xx" where x is a hexadecimal number. So your href would look something like this (it is not correct because I am to lazy to calculate the utf-8-encodings of the characters):

<D:href>/DAV/home/iv/Gallery/qq1/%ac%45%d3%d4%bb%a5%ac%33%c2%3b%a5%77/</D:href>

Werner

- <_71007>
Sat 07 Sep 2013 05:34:22 PM UTC, comment #1: 

&#1087; is not the encoding of п. It is a numerical character reference. These character references are used in XML to escape characters that have a special meaning in XML, e.g. for markup.
In WebDAV the body is XML, usually in utf-8-encoding (it starts with <?xml version="1.0" encoding="utf-8"?>). Cyrillic characters are perfectly ordinary characters and don't need any special treatment in utf-8 encoded documents. The href-element should simply look like this

<D:href>/DAV/home/iv/Gallery/qq1/привет/</D:href>

I don't know whether XML allows to use character references instead of the character itself without need. But davfs2 does ot do XML-parsing anyway. It is done by the Neon-library which in turn uses your system's XML-library for XML-parsing. So it might be a bug inthe XML-library.

But the server should not escape perfectly ordinary utf-8-encoded characters. This is at best a waste of bandwidth, but is probably asking for trouble like in your case.

If the XML-parser does not replace the character reference &#1087; with the character п the URL-parser will see charcter &. This character has special meaning in URLs and would have to be %-encoded when it appears in the path of an URL. A &-character in an URL marks the end of the path and the start of the query string. So the URL-parser will create an empty last path segment.

Werner

P.S.: if the server replaces cyrillic characters by their character references and then passes it to an XML-processor which will replace the &-character with its enitiy reference &amp;, this would be a real server bug.

- <_71007>
Thu 05 Sep 2013 09:55:37 PM UTC, original submission:  

I'm trying to connect to WebDAV interface of Virtuoso Open Source server using davfs2/1.4.6 (from Ubuntu repository) and davfs2/1.4.7 (local build with neon 0.29.6) . I've got proper authentication and the performance is quite good, but I've got an issue with DAV collections with Cyrillic and other non-latin characters: these collections are simply not shown.

The testbed mounting point is configured as
http://127.0.0.1:8180/DAV/home/iv/ /mnt/homyak2_DAV_home_iv davfs user,rw,noauto 0 0
No configuration tweaks were made for davfs2, because DAV names are UTF-8 and the OS charset is UTF-8 too.

The server produces an XML that looks nice (and handled by Total Commander, for instance)

E.g., &#1087;&#1088;&#1080;&#1074;&#1077;&#1090; is proper encoding for 'привет', the only (empty) subdirectory in /DAV/home/iv/Gallery/qq1/ . This subdirectory is not listed by 'ls

$ curl -v -X PROPFIND --user iv:xxxxxxxxxxx 'http://octo:8180/DAV/home/iv/Gallery/qq1/'

  • About to connect() to octo port 8180 (#0)
  •   Trying 10.1.1.16... connected
  • Server auth using Basic with user 'iv'

> PROPFIND /DAV/home/iv/Gallery/qq1/ HTTP/1.1
> Authorization: Basic xxxxxxxxxxxxxxxxxxx=
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: octo:8180
> Accept: /
>

< HTTP/1.1 207 Multi-Status
< Server: Virtuoso/06.04.3138 (Linux) x86_64-unknown-linux-gnu  VDB
< Connection: Keep-Alive
< Date: Thu, 05 Sep 2013 21:38:52 GMT
< Accept-Ranges: bytes
< Content-type: text/xml; charset="utf-8"
< Content-Length: 1175
<
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:M="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/">
<D:response xmlns:D="DAV:" xmlns:lp0="DAV:" xmlns:i0="DAV:" xmlns:V="http://www.openlinksw.com/virtuoso/webdav/1.0/">
<D:href>/DAV/home/iv/Gallery/qq1/</D:href>
<D:propstat>
<D:prop>
<lp0:getlastmodified>Wed, 04 Sep 2013 23:23:19 GMT</lp0:getlastmodified>
<D:resourcetype><D:collection/></D:resourcetype>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
<D:propstat>
<D:prop>
<i0:getcontentlength />
</D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
<D:response xmlns:D="DAV:" xmlns:lp0="DAV:" xmlns:i0="DAV:" xmlns:V="http://www.openlinksw.com/virtuoso/webdav/1.0/">
<D:href>/DAV/home/iv/Gallery/qq1/&#1087;&#1088;&#1080;&#1074;&#1077;&#1090;/</D:href>
<D:propstat>
<D:prop>
<lp0:getlastmodified>Thu, 05 Sep 2013 21:38:28 GMT</lp0:getlastmodified>
<D:resourcetype><D:collection/></D:resourcetype>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
<D:propstat>
<D:prop>
<i0:getcontentlength />
</D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
</D:multistatus>

  • Connection #0 to host octo left intact
  • Closing connection #0


$ curl -v -X PROPFIND --user iv:3.14oneerr3 'http://octo:8180/DAV/home/iv/Gallery/qq1/привет/'

  • About to connect() to octo port 8180 (#0)
  •   Trying 10.1.1.16... connected
  • Server auth using Basic with user 'iv'

> PROPFIND /DAV/home/iv/Gallery/qq1/привет/ HTTP/1.1
> Authorization: Basic xxxxxxxxxxxxxxxxxxx=
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: octo:8180
> Accept: /
>

< HTTP/1.1 207 Multi-Status
< Server: Virtuoso/06.04.3138 (Linux) x86_64-unknown-linux-gnu  VDB
< Connection: Keep-Alive
< Date: Thu, 05 Sep 2013 21:46:45 GMT
< Accept-Ranges: bytes
< Content-type: text/xml; charset="utf-8"
< Content-Length: 681
<
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:M="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/">
<D:response xmlns:D="DAV:" xmlns:lp0="DAV:" xmlns:i0="DAV:" xmlns:V="http://www.openlinksw.com/virtuoso/webdav/1.0/">
<D:href>/DAV/home/iv/Gallery/qq1/&#1087;&#1088;&#1080;&#1074;&#1077;&#1090;/</D:href>
<D:propstat>
<D:prop>
<lp0:getlastmodified>Thu, 05 Sep 2013 21:38:28 GMT</lp0:getlastmodified>
<D:resourcetype><D:collection/></D:resourcetype>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
<D:propstat>
<D:prop>
<i0:getcontentlength />
</D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
</D:multistatus>

  • Connection #0 to host octo left intact
  • Closing connection #0



'debug http' option results reasonable outputs in /var/logl/syslog, like

Sep  6 03:31:27 octo mount.davfs: Running pre_send hooks
Sep  6 03:31:27 octo mount.davfs: Sending request headers:#012PROPFIND /DAV/home/iv/Gallery/_public_Graphics/ HTTP/1.1#015#012User-Agent: davfs2/1.4.6 neon/0.29.6#015#012Connection: TE#015#012TE: trailers#015#01
2Host: 127.0.0.1:8180#015#012Depth: 1#015#012Content-Length: 286#015#012Content-Type: application/xml#015#012Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxx#015#012#015
Sep  6 03:31:27 octo mount.davfs: Sending request-line and headers:
Sep  6 03:31:27 octo mount.davfs: Sending request body:
Sep  6 03:31:27 octo mount.davfs: Request sent; retry is 1.
Sep  6 03:31:29 octo mount.davfs: [status-line] < HTTP/1.1 207 Multi-Status#015
Sep  6 03:31:29 octo mount.davfs: [hdr] Server: Virtuoso/06.04.3138 (Linux) x86_64-unknown-linux-gnu  VDB#015
Sep  6 03:31:29 octo mount.davfs: Header Name: [server], Value: [Virtuoso/06.04.3138 (Linux) x86_64-unknown-linux-gnu  VDB]
Sep  6 03:31:29 octo mount.davfs: [hdr] Connection: Keep-Alive#015
Sep  6 03:31:29 octo mount.davfs: Header Name: [connection], Value: [Keep-Alive]
Sep  6 03:31:29 octo mount.davfs: [hdr] Date: Thu, 05 Sep 2013 20:31:29 GMT#015
Sep  6 03:31:29 octo mount.davfs: Header Name: [date], Value: [Thu, 05 Sep 2013 20:31:29 GMT]
Sep  6 03:31:29 octo mount.davfs: [hdr] Accept-Ranges: bytes#015
Sep  6 03:31:29 octo mount.davfs: Header Name: [accept-ranges], Value: [bytes]
Sep  6 03:31:29 octo mount.davfs: [hdr] Content-type: text/xml; charset="utf-8"#015
Sep  6 03:31:29 octo mount.davfs: Header Name: [content-type], Value: [text/xml; charset="utf-8"]
Sep  6 03:31:29 octo mount.davfs: [hdr] Content-Length: 627895#015
Sep  6 03:31:29 octo mount.davfs: Header Name: [content-length], Value: [627895]
Sep  6 03:31:29 octo mount.davfs: [hdr] #015
Sep  6 03:31:29 octo mount.davfs: End of headers.
Sep  6 03:31:29 octo mount.davfs: Running post_headers hooks
Sep  6 03:31:29 octo mount.davfs: Reading 8192 bytes of response body.
Sep  6 03:31:29 octo mount.davfs: Got 8192 bytes.

Ivan Mikhailov <iv_an_ru>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by _71007 (Posted a comment)
  • -email is unavailable- added by iv_an_ru (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-04-20 _71007 StatusIn Progress Done
        Open/ClosedOpen Closed
    2013-09-07 _71007 StatusNone In Progress
        Assigned toNone _71007

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code