Репозиторий Sisyphus
Последнее обновление: 30 июня 2022 | Пакетов: 17500 | Посещений: 24467424
en ru br
Репозитории ALT
S:2.24.4-alt12
5.1: 2.24.4-alt0.M50P.1
4.1: 2.22.0-alt1.1
4.0: 2.16.3-alt3
3.0: 1.0.5-alt7.1
www.altlinux.org/Changes

Группа :: Система/Библиотеки
Пакет: gnome-vfs

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: gnome-vfs-2.20.0-uuid-label-mount.patch
Скачать


--- gnome-vfs-2.18.0.1/libgnomevfs/gnome-vfs-unix-mounts.c.uuid-label-mount	2007-10-01 19:23:51.000000000 +0200
+++ gnome-vfs-2.18.0.1/libgnomevfs/gnome-vfs-unix-mounts.c	2007-10-01 19:30:48.000000000 +0200
@@ -46,6 +46,7 @@
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
+#include <stdlib.h>
 #include <libgnomevfs/gnome-vfs.h>
 
 #include "gnome-vfs-unix-mounts.h"
@@ -290,6 +291,15 @@ _gnome_vfs_get_current_unix_mounts (GLis
 
 		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,
@@ -541,6 +551,7 @@ _gnome_vfs_get_unix_mount_table (GList *
 	char *opt, *opt_end;
 	struct stat sb;
 	GnomeVFSUnixMountPoint *mount_entry;
+	gboolean is_label, is_uuid;
 	
 	stat_file = read_file = get_fstab_file ();
 
@@ -574,6 +585,41 @@ _gnome_vfs_get_unix_mount_table (GList *
 
 		mount_entry->mount_path = g_strdup (mntent->mnt_dir);
 		mount_entry->device_path = g_strdup (mntent->mnt_fsname);
+
+		is_label = is_uuid = FALSE;
+
+		if ((is_uuid = g_str_has_prefix (mount_entry->device_path, "UUID=")) || (is_label = g_str_has_prefix (mount_entry->device_path, "LABEL=")) || g_str_has_prefix(mount_entry->device_path,"/dev/disk/by-")) {
+			gchar *device_path;
+
+			if (is_uuid) { 
+				device_path = g_strdup_printf ("/dev/disk/by-uuid/%s", mount_entry->device_path+5);
+			} else {
+				if (is_label) {
+					device_path = g_strdup_printf ("/dev/disk/by-label/%s", mount_entry->device_path+6);
+				}
+				else {
+					device_path = g_strdup (mount_entry->device_path);
+				}
+			}
+			   
+			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
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin