Package: gnome-vfs / 1:2.24.4-6

15_uuid_mount.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Index: gnome-vfs-2.24.2/libgnomevfs/gnome-vfs-unix-mounts.c
===================================================================
--- gnome-vfs-2.24.2.orig/libgnomevfs/gnome-vfs-unix-mounts.c	2010-02-06 11:55:48.381279121 +0100
+++ gnome-vfs-2.24.2/libgnomevfs/gnome-vfs-unix-mounts.c	2010-02-06 11:55:48.957282940 +0100
@@ -290,6 +290,15 @@
 
 		mount_entry->mount_path = g_strdup (mntent->mnt_dir);
 		mount_entry->device_path = g_strdup (mntent->mnt_fsname);
+
+		if (g_file_test (mntent->mnt_fsname, G_FILE_TEST_IS_SYMLINK)) {
+			char rpath[PATH_MAX];
+			if (realpath (mntent->mnt_fsname, rpath)) {
+				g_free (mount_entry->device_path);
+				mount_entry->device_path = g_strdup (rpath);
+			}
+		}
+
 		mount_entry->filesystem_type = g_strdup (mntent->mnt_type);
 		
 		g_hash_table_insert (mounts_hash,
@@ -580,6 +589,30 @@
                     mount_entry->mount_path = g_strdup (mntent->mnt_dir);
 
 		mount_entry->device_path = g_strdup (mntent->mnt_fsname);
+
+		if(strlen(mount_entry->device_path) >= 5 && !strncmp (mount_entry->device_path, "UUID=", 5)) {
+			gchar *device_path;
+
+			device_path = g_strdup_printf ("/dev/disk/by-uuid/%s", mount_entry->device_path+5);
+			   
+			if (g_file_test (device_path, G_FILE_TEST_IS_SYMLINK)) {
+				char rpath[PATH_MAX];
+				if (realpath (device_path, rpath)) {
+					g_free (mount_entry->device_path);
+					mount_entry->device_path = g_strdup (rpath);
+				}
+				else {
+					g_free (device_path);
+					continue;
+				}
+			}
+			else {
+				g_free (device_path);
+				continue;
+			}
+			g_free (device_path);
+		}	
+
 		mount_entry->filesystem_type = g_strdup (mntent->mnt_type);
 
 #ifdef HAVE_HASMNTOPT