View | Details | Raw Unified | Return to bug 116558
Collapse All | Expand All

(-)file_not_specified_in_diff (-13 / +89 lines)
Line  Link Here
0
-- gnome-vfs-2.11.3/libgnomevfs/gnome-vfs-filesystem-type.c
0
++ gnome-vfs-2.11.3/libgnomevfs/gnome-vfs-filesystem-type.c
Lines 64-69 Link Here
64
	{ "reiserfs" , N_("ReiserFS Linux Volume"), 1 },
64
	{ "reiserfs" , N_("ReiserFS Linux Volume"), 1 },
65
	{ "smbfs"    , N_("Windows Shared Volume"), 1 },
65
	{ "smbfs"    , N_("Windows Shared Volume"), 1 },
66
	{ "supermount",N_("SuperMount Volume"), 0 },
66
	{ "supermount",N_("SuperMount Volume"), 0 },
67
	{ "subfs",     N_("SubMount Volume"), 0 },
67
	{ "udf"      , N_("DVD Volume"), 0 },
68
	{ "udf"      , N_("DVD Volume"), 0 },
68
	{ "ufs"      , N_("Solaris/BSD Volume"), 1 },
69
	{ "ufs"      , N_("Solaris/BSD Volume"), 1 },
69
	{ "udfs"     , N_("Udfs Solaris Volume"), 1 },
70
	{ "udfs"     , N_("Udfs Solaris Volume"), 1 },
70
-- gnome-vfs-2.11.3/libgnomevfs/gnome-vfs-unix-mounts.c
71
++ gnome-vfs-2.11.3/libgnomevfs/gnome-vfs-unix-mounts.c
Lines 594-600 Link Here
594
		}
594
		}
595
#endif
595
#endif
596
596
597
		if ((mntent->mnt_type != NULL && strcmp ("supermount", mntent->mnt_type) == 0)
597
		if ((mntent->mnt_type != NULL && strcmp ("supermount", mntent->mnt_type) == 0) 
598
		    || (mntent->mnt_type != NULL && strcmp ("subfs", mntent->mnt_type) == 0)
598
#ifdef HAVE_HASMNTOPT
599
#ifdef HAVE_HASMNTOPT
599
		    || (hasmntopt (mntent, "user") != NULL
600
		    || (hasmntopt (mntent, "user") != NULL
600
			&& hasmntopt (mntent, "user") != hasmntopt (mntent, "user_xattr"))
601
			&& hasmntopt (mntent, "user") != hasmntopt (mntent, "user_xattr"))
601
-- gnome-vfs-2.11.3/libgnomevfs/gnome-vfs-volume-monitor-daemon.c
602
++ gnome-vfs-2.11.3/libgnomevfs/gnome-vfs-volume-monitor-daemon.c
Lines 262-271 Link Here
262
	    	return GNOME_VFS_DEVICE_TYPE_CDROM;
262
	    	return GNOME_VFS_DEVICE_TYPE_CDROM;
263
	} else if (g_str_has_prefix (device_path, "/dev/cd")) {
263
	} else if (g_str_has_prefix (device_path, "/dev/cd")) {
264
	    	return GNOME_VFS_DEVICE_TYPE_CDROM;
264
	    	return GNOME_VFS_DEVICE_TYPE_CDROM;
265
	} else if (g_str_has_prefix (device_path, "/dev/dvd")) {
266
	    	return GNOME_VFS_DEVICE_TYPE_CDROM;
265
	} else if (g_str_has_prefix (device_path, "/vol/")) {
267
	} else if (g_str_has_prefix (device_path, "/vol/")) {
266
			name = mount_path + strlen ("/");
268
			name = mount_path + strlen ("/");
267
269
268
			if (g_str_has_prefix (name, "cdrom")) {
270
			if (g_str_has_prefix (name, "cdrom") ||
271
			    g_str_has_prefix (name, "dvd")) {
269
				return GNOME_VFS_DEVICE_TYPE_CDROM;
272
				return GNOME_VFS_DEVICE_TYPE_CDROM;
270
			} else if (g_str_has_prefix (name, "floppy")) {
273
			} else if (g_str_has_prefix (name, "floppy")) {
271
				return GNOME_VFS_DEVICE_TYPE_FLOPPY;
274
				return GNOME_VFS_DEVICE_TYPE_FLOPPY;
Lines 872-878 Link Here
872
	vol->priv->is_mounted = 1;
875
	vol->priv->is_mounted = 1;
873
	
876
	
874
	vol->priv->device_type = get_device_type_from_device_and_mount (mount->device_path, mount->mount_path);
877
	vol->priv->device_type = get_device_type_from_device_and_mount (mount->device_path, mount->mount_path);
875
	
878
876
	if ((strcmp (mount->filesystem_type, "iso9660") == 0) ||
879
	if ((strcmp (mount->filesystem_type, "iso9660") == 0) ||
877
	    (strcmp (mount->filesystem_type, "cd9660") == 0)) {
880
	    (strcmp (mount->filesystem_type, "cd9660") == 0)) {
878
		if (vol->priv->device_type == GNOME_VFS_DEVICE_TYPE_UNKNOWN) {
881
		if (vol->priv->device_type == GNOME_VFS_DEVICE_TYPE_UNKNOWN) {
Lines 908-914 Link Here
908
		vol->priv->device_type = GNOME_VFS_DEVICE_TYPE_HARDDRIVE;
911
		vol->priv->device_type = GNOME_VFS_DEVICE_TYPE_HARDDRIVE;
909
	}
912
	}
910
913
911
	if (vol->priv->device_type == GNOME_VFS_DEVICE_TYPE_CDROM) {
914
	if (vol->priv->device_type == GNOME_VFS_DEVICE_TYPE_CDROM &&
915
	    strcmp (mount->filesystem_type, "subfs")) {
912
		fd = 0;
916
		fd = 0;
913
		disctype = _gnome_vfs_get_cdrom_type (mount->device_path, &fd);
917
		disctype = _gnome_vfs_get_cdrom_type (mount->device_path, &fd);
914
918
Lines 991-996 Link Here
991
	return vol;
995
	return vol;
992
}
996
}
993
997
998
static GList *
999
remove_submounts (GList *volumes)
1000
{
1001
	GList *l;
1002
	GList *new_volumes;
1003
	GHashTable *submounts;
1004
	
1005
	submounts = g_hash_table_new (g_str_hash, g_str_equal);
1006
	
1007
	for (l = volumes; l != NULL; l = l->next) {
1008
		GnomeVFSUnixMount *mount = l->data;
1009
1010
		if (!strcmp (mount->filesystem_type, "subfs")) {
1011
			g_hash_table_insert (submounts, 
1012
					     mount->device_path,
1013
					     mount);
1014
		}
1015
	}
1016
	
1017
	new_volumes = NULL;
1018
1019
	for (l = volumes; l != NULL; l = l->next) {
1020
		GnomeVFSUnixMount *mount = l->data;
1021
		
1022
		if (strcmp (mount->filesystem_type, "subfs") != 0 &&
1023
		    g_hash_table_lookup (submounts, mount->device_path)) {
1024
			_gnome_vfs_unix_mount_free (mount);
1025
		} else {
1026
			new_volumes = g_list_prepend (new_volumes, mount);
1027
		}
1028
	}
1029
1030
	g_list_free (volumes);
1031
	
1032
	g_hash_table_destroy (submounts);
1033
1034
	return g_list_reverse (new_volumes);
1035
}
1036
994
static void
1037
static void
995
update_mtab_volumes (GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon)
1038
update_mtab_volumes (GnomeVFSVolumeMonitorDaemon *volume_monitor_daemon)
996
{
1039
{
Lines 1006-1011 Link Here
1006
	if (_gnome_vfs_get_current_unix_mounts (&new_mtab)) {
1049
	if (_gnome_vfs_get_current_unix_mounts (&new_mtab)) {
1007
		new_mtab = g_list_sort (new_mtab, (GCompareFunc) _gnome_vfs_unix_mount_compare);
1050
		new_mtab = g_list_sort (new_mtab, (GCompareFunc) _gnome_vfs_unix_mount_compare);
1008
		
1051
		
1052
		new_mtab = remove_submounts (new_mtab);
1053
1009
		diff_sorted_lists (volume_monitor_daemon->last_mtab,
1054
		diff_sorted_lists (volume_monitor_daemon->last_mtab,
1010
				   new_mtab, (GCompareFunc) _gnome_vfs_unix_mount_compare,
1055
				   new_mtab, (GCompareFunc) _gnome_vfs_unix_mount_compare,
1011
				   &added, &removed);
1056
				   &added, &removed);
1012
-- gnome-vfs-2.11.3/libgnomevfs/gnome-vfs-volume-ops.c
1057
++ gnome-vfs-2.11.3/libgnomevfs/gnome-vfs-volume-ops.c
Lines 374-379 Link Here
374
mount_unmount_operation (const char *mount_point,
374
mount_unmount_operation (const char *mount_point,
375
			 const char *device_path,
375
			 const char *device_path,
376
			 const char *hal_udi,
376
			 const char *hal_udi,
377
			 const char *filesystem_type,
377
			 GnomeVFSDeviceType device_type,
378
			 GnomeVFSDeviceType device_type,
378
			 gboolean should_mount,
379
			 gboolean should_mount,
379
			 gboolean should_unmount,
380
			 gboolean should_unmount,
Lines 432-437 Link Here
432
		       command = find_command (UMOUNT_COMMAND);
433
		       command = find_command (UMOUNT_COMMAND);
433
#else
434
#else
434
	       command = find_command (UMOUNT_COMMAND);
435
	       command = find_command (UMOUNT_COMMAND);
436
	       /* Don't unmount subfs volumes */
437
	       if (!filesystem_type || strcmp (filesystem_type, "subfs") != 0) {
438
		       command = find_command (UMOUNT_COMMAND);
439
	       }
435
#endif
440
#endif
436
#ifdef  UNMOUNT_ARGUMENT
441
#ifdef  UNMOUNT_ARGUMENT
437
		argument = UNMOUNT_ARGUMENT;
442
		argument = UNMOUNT_ARGUMENT;
Lines 590-596 Link Here
590
			  GnomeVFSVolumeOpCallback  callback,
595
			  GnomeVFSVolumeOpCallback  callback,
591
			  gpointer                   user_data)
596
			  gpointer                   user_data)
592
{
597
{
593
	char *mount_path, *device_path;
598
	char *mount_path, *device_path, *filesystem_type;
594
	char *uri;
599
	char *uri;
595
	GnomeVFSVolumeType type;
600
	GnomeVFSVolumeType type;
596
601
Lines 609-622 Link Here
609
		mount_path = gnome_vfs_get_local_path_from_uri (uri);
614
		mount_path = gnome_vfs_get_local_path_from_uri (uri);
610
		g_free (uri);
615
		g_free (uri);
611
		device_path = gnome_vfs_volume_get_device_path (volume);
616
		device_path = gnome_vfs_volume_get_device_path (volume);
617
		filesystem_type = gnome_vfs_volume_get_filesystem_type (volume);
612
		mount_unmount_operation (mount_path,
618
		mount_unmount_operation (mount_path,
613
					 device_path,
619
					 device_path,
614
					 gnome_vfs_volume_get_hal_udi (volume),
620
					 gnome_vfs_volume_get_hal_udi (volume),
621
					 filesystem_type,
615
					 gnome_vfs_volume_get_device_type (volume),
622
					 gnome_vfs_volume_get_device_type (volume),
616
					 FALSE, TRUE, FALSE,
623
					 FALSE, TRUE, FALSE,
617
					 callback, user_data);
624
					 callback, user_data);
618
		g_free (mount_path);
625
		g_free (mount_path);
619
		g_free (device_path);
626
		g_free (device_path);
627
		g_free (filesystem_type);
620
	} else {
628
	} else {
621
		unmount_connected_server (volume, callback, user_data);
629
		unmount_connected_server (volume, callback, user_data);
622
	}
630
	}
Lines 637-643 Link Here
637
			GnomeVFSVolumeOpCallback  callback,
645
			GnomeVFSVolumeOpCallback  callback,
638
			gpointer                   user_data)
646
			gpointer                   user_data)
639
{
647
{
640
	char *mount_path, *device_path;
648
	char *mount_path, *device_path, *filesystem_type;
641
	char *uri;
649
	char *uri;
642
	GnomeVFSVolumeType type;
650
	GnomeVFSVolumeType type;
643
	
651
	
Lines 652-662 Link Here
652
		mount_unmount_operation (mount_path,
660
		mount_unmount_operation (mount_path,
653
					 device_path,
661
					 device_path,
654
					 gnome_vfs_volume_get_hal_udi (volume),
662
					 gnome_vfs_volume_get_hal_udi (volume),
663
					 NULL,
655
					 gnome_vfs_volume_get_device_type (volume),
664
					 gnome_vfs_volume_get_device_type (volume),
656
					 FALSE, TRUE, TRUE,
665
					 FALSE, TRUE, TRUE,
657
					 callback, user_data);
666
					 callback, user_data);
658
		g_free (mount_path);
667
		g_free (mount_path);
659
		g_free (device_path);
668
		g_free (device_path);
669
		g_free (filesystem_type);
660
	} else {
670
	} else {
661
		unmount_connected_server (volume, callback, user_data);
671
		unmount_connected_server (volume, callback, user_data);
662
	}
672
	}
Lines 686-691 Link Here
686
	mount_unmount_operation (mount_path,
696
	mount_unmount_operation (mount_path,
687
				 device_path,
697
				 device_path,
688
				 gnome_vfs_drive_get_hal_udi (drive),
698
				 gnome_vfs_drive_get_hal_udi (drive),
699
				 NULL,
689
				 GNOME_VFS_DEVICE_TYPE_UNKNOWN,
700
				 GNOME_VFS_DEVICE_TYPE_UNKNOWN,
690
				 TRUE, FALSE, FALSE,
701
				 TRUE, FALSE, FALSE,
691
				 callback, user_data);
702
				 callback, user_data);
Lines 779-784 Link Here
779
		mount_unmount_operation (mount_path,
790
		mount_unmount_operation (mount_path,
780
					 device_path,
791
					 device_path,
781
					 gnome_vfs_drive_get_hal_udi (drive),
792
					 gnome_vfs_drive_get_hal_udi (drive),
793
					 NULL,
782
					 GNOME_VFS_DEVICE_TYPE_UNKNOWN,
794
					 GNOME_VFS_DEVICE_TYPE_UNKNOWN,
783
					 FALSE, FALSE, TRUE,
795
					 FALSE, FALSE, TRUE,
784
					 callback, user_data);
796
					 callback, user_data);
785
-- gnome-vfs-2.11.3/modules/computer-method.c
797
++ gnome-vfs-2.11.3/modules/computer-method.c
Lines 494-512 Link Here
494
494
495
	volume_list = gnome_vfs_drive_get_mounted_volumes (drive);
495
	volume_list = gnome_vfs_drive_get_mounted_volumes (drive);
496
	if (volume_list != NULL) {
496
	if (volume_list != NULL) {
497
		char *filesystem_type;
498
		
497
		GnomeVFSVolume *volume;
499
		GnomeVFSVolume *volume;
498
		volume = GNOME_VFS_VOLUME (volume_list->data);
500
		volume = GNOME_VFS_VOLUME (volume_list->data);
499
501
500
		uri = gnome_vfs_volume_get_activation_uri (volume);
502
		uri = gnome_vfs_volume_get_activation_uri (volume);
501
		tmp1 = gnome_vfs_drive_get_display_name (drive);
503
		tmp1 = gnome_vfs_drive_get_display_name (drive);
502
		tmp2 = gnome_vfs_volume_get_display_name (volume);
504
		tmp2 = gnome_vfs_volume_get_display_name (volume);
503
		if (strcmp (tmp1, tmp2) != 0) {
505
506
		/* Don't bother to figure out subfs volumes */
507
		filesystem_type = gnome_vfs_volume_get_filesystem_type (volume);
508
		if ((filesystem_type == NULL || strcmp (filesystem_type, "subfs") != 0)
509
		    && strcmp (tmp1, tmp2) != 0) {
504
			name = g_strconcat (tmp1, ": ", tmp2, NULL);
510
			name = g_strconcat (tmp1, ": ", tmp2, NULL);
505
		} else {
511
		} else {
506
			name = g_strdup (tmp1);
512
			name = g_strdup (tmp1);
507
		}
513
		}
508
		g_free (tmp1);
514
		g_free (tmp1);
509
		g_free (tmp2);
515
		g_free (tmp2);
516
		g_free (filesystem_type);
510
		icon = gnome_vfs_volume_get_icon (volume);
517
		icon = gnome_vfs_volume_get_icon (volume);
511
		gnome_vfs_volume_unref (volume);
518
		gnome_vfs_volume_unref (volume);
512
	} else {
519
	} else {
513
-- gnome-vfs-2.11.3/modules/file-method.c
520
++ gnome-vfs-2.11.3/modules/file-method.c
Lines 2425-2430 Link Here
2425
		return GNOME_VFS_ERROR_INVALID_URI;
2425
		return GNOME_VFS_ERROR_INVALID_URI;
2426
	}
2426
	}
2427
	
2427
	
2428
	/* Horrible hack, I hate myself.  There are problems 
2429
	 * monitoring subfs volumes, and just about everything in /media
2430
	 * on suse is going to be a subfs volume */
2431
	if (g_str_has_prefix (filename, "/media")) {
2432
		g_free (filename);
2433
		
2434
		return GNOME_VFS_ERROR_NOT_SUPPORTED;
2435
	}
2436
	
2437
2428
	handle = g_new0 (FileMonitorHandle, 1);
2438
	handle = g_new0 (FileMonitorHandle, 1);
2429
	handle->uri = uri;
2439
	handle->uri = uri;
2430
	handle->cancelled = FALSE;
2440
	handle->cancelled = FALSE;

Return to bug 116558