diff options
author | Ondrej Holy <oholy@redhat.com> | 2020-05-11 14:16:48 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2020-09-23 15:35:57 +0200 |
commit | b03b7955cf25e863c1aac2853ddaf647bfb70ea8 (patch) | |
tree | 5bc996eca13b6eb7fdc0c99cf6e0b60ff9a45d53 | |
parent | c0913921ff07a7d800e931962f466a34fb0621ee (diff) | |
download | gvfs-b03b7955cf25e863c1aac2853ddaf647bfb70ea8.tar.gz |
dav: Be sure that enumeration is possible when looking for a root
The DAV backend tries to find the top-most directory when mounting.
Unfortunatelly, for example with nextcloud.com, the enumeration job
fails with `Method not allowed` error for the root directory found
by this logic:
```
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\MethodNotAllowed</s:exception>
<s:message>Listing members of this collection is disabled</s:message>
</d:error>
```
This is because nextcloud.com prevents listing of its users. Let's
change the mount logic and always require info about children to be
sure that enumeration won't fail later.
Fixes: https://gitlab.gnome.org/GNOME/gvfs/-/issues/468
-rw-r--r-- | daemon/gvfsbackenddav.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c index 4ac94aca..5929ab6a 100644 --- a/daemon/gvfsbackenddav.c +++ b/daemon/gvfsbackenddav.c @@ -1446,7 +1446,6 @@ stat_location (GVfsBackend *backend, return res; } - /* ************************************************************************* */ /* Authentication */ @@ -1930,8 +1929,10 @@ do_mount (GVfsBackend *backend, last_good_path = NULL; msg_opts = soup_message_new_from_uri (SOUP_METHOD_OPTIONS, mount_base); - msg_stat = stat_location_begin (mount_base, FALSE); + /* The count_children parameter is intentionally set to TRUE to be sure that + enumeration is possible: https://gitlab.gnome.org/GNOME/gvfs/-/issues/468 */ + msg_stat = stat_location_begin (mount_base, TRUE); do { GFileType file_type; @@ -2012,7 +2013,7 @@ do_mount (GVfsBackend *backend, if (is_collection == FALSE) break; - + /* we have found a new good root, try the parent ... */ g_free (last_good_path); last_good_path = mount_base->path; |