Bug #266
closedWebDAV sub-folders not visible
Description
I'm using the mod_webdav plugin to 1.4.3. I have found that sub-folders which are visible from the server's filesystem do not show up in the webdav-mapped folder when I browse to it from a client. The relevant portion of my lighttpd.conf is here:
$HTTP["url"] =~ "^/webdav($|/)" { webdav.activate = "enable" } auth.backend = "htpasswd" auth.backend.htpasswd.userfile = "/usr/local/etc/htpasswd/passwd" auth.require = ( "/webdav/" => ( "method" => "basic", "realm" => "WebDAV access", "require" => "user=nick" ), )
-- Nick Triantos
Files
Updated by Anonymous about 19 years ago
I have a similar problem (not sure if it is the same). When I browse the webdav server from windows xp some, seemingly random folders don't show up, while others do. When i browse from linux with cadaver all folders show up, but when i try to ls in the folders that didn't show up in windows xp I get the following error from cadaver: "XML parse error at line 771: xmlParseEntityRef: no name ."
-- jonlst
Updated by Anonymous about 19 years ago
Hi,
Characters must be URI-escaped and XML-escaped before they are put into DAV:href element of a XML document (e.g. a PROPFIND response). But in mod_webdav, they are not:
#!c buffer_append_string(b,"<D:href>"); buffer_append_string_buffer(b, con->uri.scheme); buffer_append_string(b,"://"); buffer_append_string_buffer(b, con->uri.authority); buffer_append_string_buffer(b, con->uri.path); buffer_append_string(b,"</D:href>\n");
Here's a thread discussing character escaping in Apache's mod_dav:
http://mailman.lyra.org/pipermail/dav-dev/2003-June/004761.html
You can see how Apache mod_dav does it by downloading its source and check mod_dav.c -> dav_send_multistatus() -> dav_xml_escape_uri():
#!c ap_rputs(DEBUG_CR "<D:href>", r); ap_rputs(dav_xml_escape_uri(r->pool, first->href), r); ap_rputs("</D:href>" DEBUG_CR, r);
And, for your convenience, here's mod_dav's source:
http://www.webdav.org/mod_dav/mod_dav-1.0.3-1.3.6.tar.gz
-- iclaymore
Updated by Anonymous about 19 years ago
My previous patch fixed the bug by encoding some characters, but I'm not sure whether the list of characters encoded is complete or not.
http://trac.lighttpd.net/trac/attachment/ticket/266/uri_escape.diff
buffer_append_string_uri_encoded() is the same as buffer.c::buffer_append_string_url_encoded(), except that '/' is not encoded.
I've tested it a bit. Filenames with spaces inside can now be displayed correctly at client side (OS X 10.4.3).
-- iclaymore
Updated by jan about 19 years ago
- Status changed from Assigned to Fixed
- Resolution set to fixed
I cleaned up the code in buffer.c and added encoding like you described in changeset r822.
Updated by Anonymous over 16 years ago
- Status changed from Fixed to Need Feedback
- Resolution deleted (
fixed)
This fix is incomplete. eg/ie the dav module does not %-encode '[' or ']'. This is not in compliance with weth RFC 3986. It means for example, that any webdav client using the neon library (eg davfs2) fails to see sub-folders with [ or ] in them.
-- tj.trevelyan
Updated by stbuehler over 16 years ago
- Status changed from Need Feedback to Fixed
- Resolution set to fixed
Fixed in r2272.
Also available in: Atom