diff options
author | Christian Kellner <gicmo@gnome.org> | 2011-05-08 12:17:38 +0200 |
---|---|---|
committer | Christian Kellner <gicmo@gnome.org> | 2011-05-08 12:18:12 +0200 |
commit | a2a2fe70666618062148f5cbf0ca5e7f1eedfa0a (patch) | |
tree | 183d7407c05b213bc9fa1fa88641b6889450b997 /daemon/gvfsbackenddav.c | |
parent | 927d91cfcda34c88fd5137f6c118818903a1f02d (diff) | |
download | gvfs-a2a2fe70666618062148f5cbf0ca5e7f1eedfa0a.tar.gz |
dav: correctly handle usernames supplied in the url
When comparing URIs in dav_uri_match() do not take username or
password into account because on a redirect the server is likely to not
include the username in the url supplied in the Location header.
Therefore redirection will fail and thus mounting.
Should fix bug 586248. Patch based on a version from Henrik Holst.
Diffstat (limited to 'daemon/gvfsbackenddav.c')
-rw-r--r-- | daemon/gvfsbackenddav.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c index d63059fc..9e75ded2 100644 --- a/daemon/gvfsbackenddav.c +++ b/daemon/gvfsbackenddav.c @@ -250,16 +250,15 @@ path_equal (const char *a, const char *b, gboolean relax) static gboolean dav_uri_match (SoupURI *a, SoupURI *b, gboolean relax) { - if (a->scheme != b->scheme || - a->port != b->port || - ! str_equal (a->user, b->user, FALSE) || - ! str_equal (a->password, b->password, FALSE) || - ! str_equal (a->host, b->host, TRUE) || - ! path_equal (a->path, b->path, relax) || - ! str_equal (a->query, b->query, FALSE) || - ! str_equal (a->fragment, b->fragment, FALSE)) - return FALSE; - return TRUE; + gboolean diff; + + diff = a->scheme != b->scheme || a->port != b->port || + ! str_equal (a->host, b->host, TRUE) || + ! path_equal (a->path, b->path, relax) || + ! str_equal (a->query, b->query, FALSE) || + ! str_equal (a->fragment, b->fragment, FALSE); + + return !diff; } static gboolean |