After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 603422 - listing directories or downloading files with percent encoded parentheses characters fails
listing directories or downloading files with percent encoded parentheses cha...
Status: RESOLVED DUPLICATE of bug 629660
Product: gvfs
Classification: Core
Component: webdav backend
1.4.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2009-11-30 22:47 UTC by Michael Gauthier
Modified: 2011-05-17 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Gauthier 2009-11-30 22:47:52 UTC
Parentheses are not required to be encoded, but GVFS should be able to parse responses in which they are encoded as it is valid to do so.

When working with such filenames on my sever, I get:

 Could not display "dav://zest/shot/work-gauthierm/www/dav/photos-test/test3%20(copy)".
 
 Error: Response invalid
 Please select another viewer and try again.

The raw XML document corresponding to the error message as sent by my server is:

<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://www.rooftopsolutions.nl/NS/sabredav"><d:response><d:href>/shot/work-gauthierm/www/dav/photos-test/photos%20%28copy%29/</d:href><d:propstat><d:prop><d:getlastmodified xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" b:dt="dateTime.rfc1123">Mon, 30 Nov 2009 15:09:31 +0000</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 Ok</d:status></d:propstat><d:propstat><d:prop><d:creationdate/><d:displayname/><d:getcontentlength/><d:getcontenttype/><d:getetag/></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response></d:multistatus>

Note that the ( and ) characters are encoded as %28 and %29 respectively. If these characters are not sent encoded by my server, GVFS parses the result properly.
Comment 1 Michael Gauthier 2009-11-30 22:48:11 UTC
using version gvfs-1.4.1-0ubuntu1 on Ubuntu 9.10
Comment 2 Evert Pot 2010-04-23 03:11:11 UTC
I can confirm this issue. Even though parenthesis don't have any special meanings in path segments, any urlencoded value must be decoded; which clearly doesn't happen here.

In this particular case this was solved by writing a custom url encoder, that ignores parenthesis:

http://code.google.com/p/sabredav/source/browse/lib/Sabre/DAV/URLUtil.php#41
Comment 3 Evert Pot 2010-10-19 16:57:17 UTC
More info on this:

I only just found out that this is happening because urls are percent-encoded lowercase (%c3%a1), while gvfs sends them uppercase (%C3%A1). 

A bug report detailing this is here:
http://code.google.com/p/sabredav/issues/detail?id=83

So note that this is still an issue as of gvfs 1.6.1 on ubuntu 10.10.

If there's anything I can do to assist with solving this bug, I'll be glad to hear it.
Comment 4 Evert Pot 2010-10-19 17:00:29 UTC
Ok it looks like the initial parenthesis issue is unrelated to the casing-issue, because the parenthesis only actually contain numbers.

I suspect this _is_ the same bug though, urls and path-parts must be decoded before comparison.
Comment 5 Christian Kellner 2011-05-17 16:55:05 UTC
This is a duplicated of bug 629660 (and maybe also bug 561515). Thanks for the analysis Evert, you were 100% correct.

*** This bug has been marked as a duplicate of bug 629660 ***