[gvfs/wip/oholy/dav-auth] dav: Fix mounting when 403 is returned for the parent folder



commit e4dbcf290cca0f4d7b73e4b515a694a6eec627d8
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Sep 13 10:08:37 2019 +0200

    dav: Fix mounting when 403 is returned for the parent folder
    
    The recent commit e9653aa9, which allows mounting when 403 is returned
    instead of 401, broke the backend for the case when authentication
    succeeded for subdirectory and 403 is returned for the parent folder.
    The backend doesn't work properly, even though it doesn't return any
    error from the mount operation. Nautilus just shows "File is of unknown
    type" and the backend prints errors like "soup_auth_authenticate:
    assertion 'password != NULL' failed". Let's prevent usage of the
    workaround from commit e9653aa9 after the first successful auth to fix
    this issue.
    
    Fixes: https://gitlab.gnome.org/GNOME/gvfs/issues/417

 daemon/gvfsbackenddav.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index 7cf9678c..1fcc6a38 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -1919,6 +1919,7 @@ do_mount (GVfsBackend  *backend,
     /* Workaround for servers which response with 403 instead of 401 in case of
      * wrong credentials to let the user specify its credentials again. */
     if (status == SOUP_STATUS_FORBIDDEN &&
+        last_good_path == NULL &&
         (data->server_auth.password != NULL ||
          data->proxy_auth.password != NULL))
       {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]