[glib] Pass in the right device to vfs->local_file_add_info for symlinks



commit 2b2195bf68bf68837dc9f6b4765d3716694f42b3
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Nov 26 16:05:07 2009 +0100

    Pass in the right device to vfs->local_file_add_info for symlinks
    
    We used to pass the path for the symlink, but the device of the target
    which is wrong and breaks metadata access.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=593809

 gio/glocalfileinfo.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
index 0a063e9..0eb16db 100644
--- a/gio/glocalfileinfo.c
+++ b/gio/glocalfileinfo.c
@@ -1432,6 +1432,7 @@ _g_local_file_info_get (const char             *basename,
   char *symlink_target;
   GVfs *vfs;
   GVfsClass *class;
+  guint64 device;
 
   info = g_file_info_new ();
 
@@ -1483,7 +1484,9 @@ _g_local_file_info_get (const char             *basename,
       g_free (display_name);
       return NULL;
     }
-  
+
+  device = statbuf.st_dev;
+
 #ifdef S_ISLNK
   is_symlink = S_ISLNK (statbuf.st_mode);
 #else
@@ -1711,7 +1714,7 @@ _g_local_file_info_get (const char             *basename,
     {
       class->local_file_add_info (vfs,
                                   path,
-                                  statbuf.st_dev,
+                                  device,
                                   attribute_matcher,
                                   info,
                                   NULL,



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