[gvfs] trash: Correctly determine fs type for paths with symlinks



commit 63b45093ccbdba33586db740ff4f5da6506caff6
Author: Ondrej Holy <oholy redhat com>
Date:   Tue Oct 25 09:00:05 2016 +0200

    trash: Correctly determine fs type for paths with symlinks
    
    If, for example, "/home" is a symlink to "/mnt/home", and the users's $HOME
    is "/home/user", then the code won't correctly recognize unix mount, because
    it just walks up the path removing trailing components. Consequently, "/" is
    used to determine filesystem type instead of "/mnt/home". It will cause
    problems if "/mnt/home" is e.g. NFS, which is handled differently than local
    filesystem.
    
    It uses newly added g_unix_mount_for. Bump GLib dependency accordingly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771431

 configure.ac                   |    2 +-
 daemon/trashlib/trashwatcher.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fa16230..31bb01d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,7 @@ GTK_DOC_CHECK
 DISTCHECK_CONFIGURE_FLAGS="--enable-gtk-doc"
 AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
 
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.49.4 gobject-2.0 gmodule-no-export-2.0 gio-unix-2.0 gio-2.0])
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.51.0 gobject-2.0 gmodule-no-export-2.0 gio-unix-2.0 gio-2.0])
 
 AC_ARG_WITH([dbus_service_dir],
            [AS_HELP_STRING([--with-dbus-service-dir=PATH],[choose directory for dbus service files, 
[default=PREFIX/share/dbus-1/services]])],
diff --git a/daemon/trashlib/trashwatcher.c b/daemon/trashlib/trashwatcher.c
index 6447023..6b45523 100644
--- a/daemon/trashlib/trashwatcher.c
+++ b/daemon/trashlib/trashwatcher.c
@@ -113,7 +113,7 @@ find_mount_entry_for_file (GFile *file)
 
       *slash = '\0';
 
-      entry = g_unix_mount_at (pathname, NULL);
+      entry = g_unix_mount_for (pathname, NULL);
     }
   while (entry == NULL && pathname[1]);
 


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